Slate Administrative Bookmarklets
New to bookmarklets? Learn more about them.
Switch to test:
javascript: dbname = $('.footer_machine').text().split(' / ')[2]; if (dbname.substring(dbname.length - 5) != '-test') {let url = new URL(document.location); url.host = dbname + '.test.technolutions.net';window.location.href = url.href;};
Switch to backup (Time Warp):
javascript:dbname = $('.footer_machine').text().split(' / ')[2]; if (dbname.substring(dbname.length - 5) != '-test') {let url = new URL(document.location); url.host = dbname + '-backup.test.technolutions.net';window.location.href = url.href;};
Go from public form URL to the backend (useful when the URL has been customized):
javascript:const url = new URL(document.location);var form_id = $("form[id^='form_']").parent().attr('id');if (form_id == undefined) {form_id = location.search.substring(1);} else {form_id = form_id.substring(5);}document.location = `${url.protocol}//${url.host}/manage/form/form?id=${form_id}`;
The below are not original to me, but I regrettably do not know where they came from.
Force execute rules:
javascript: function ForceExecute() { let pathname = window.location.pathname; if (!pathname.match(/\/manage\/lookup\/(record|dataset)/)) { return } ;let qs = new URLSearchParams(window.location.search); let person = document.getElementById('link_record').value; let url = null; if (pathname.includes('dataset')) { url = `${pathname}?id=${qs.get('id')}`; } else { url = `${pathname}?id=${person}`; } ;console.log(url); FW.Progress.Load(); fetch(url, { method: 'post', headers: { 'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' }, body: 'cmd=defer' }).then((data)=>{ console.log(data); alert('Rules executed successfully.'); window.location.reload(); } ).catch((error)=>{ alert('Temporarily unable to commit these changes.'); FW.Progress.Unload(); } ); } ForceExecute();
The above will only force rule execution on records already queued for rules.
Refresh fields and prompts:
javascript: refreshFields = function () { var base_url = document.URL.match(/(https?:\/\/.+?)\//)[1]; var route = '/manage/database/admin'; var cmds = ['promptRefresh', 'destinationRefresh']; cmds.forEach(function (cmd) { $.get(`${base_url}${route}`, {'cmd': cmd}) .done(function (data) { msg = `${cmd}: ${data}`; console.log(msg); showPopUp(msg); }); }); }; showPopUp = function(data) { var el = $('<div>', {'class': 'popup'}); el.css({ 'width': '20%', 'border-radius': '6px', 'padding': '1rem', 'position': 'absolute', 'top': '.75rem', 'right': '.75rem', 'background': '#ecf0f1',%20%20%20%20%20%20'font-size':%20'.75rem',%20%20%20%20%20%20'z-index':%209999,%20%20%20%20%20%20'color':%20'#999'%20%20%20%20});%20%20%20%20el.text(data);%20%20%20%20el.click(function(){%20$(this).fadeOut(200,%20function(){%20$(this).remove()%20});%20});%20%20%20%20$('body').append(el);%20%20%20%20setTimeout(function()%20{%20el.fadeOut(200,%20function(){%20$(this).remove()%20})%20},%203000);%20%20};%20%20refreshFields();
No Comments