Browser Console Cheat Sheet - jakcodex/muledump GitHub Wiki
This document is intended for users who are comfortable working with the browser console and code. If you are going to modify your Muledump client configuration directly please make sure to download a backup first.
You can read about the internal structure of Muledump SetupTools at the SetupTools Object Reference.
Don't modify Muledump Server Configuration
It shouldn't be necessary to modify Muledump server configuration. All changes are reset upon page refresh.
The following are various commands for working with Muledump client configuration directly in the browser.
Output String of All GUIDs
Object.keys(setuptools.data.accounts.accounts).join('\r\n');
Output CSV of All Accounts (Account,password)
var result = [];
for ( var i in setuptools.data.accounts.accounts )
if ( setuptools.data.accounts.accounts.hasOwnProperty(i) )
result.push(i + ',' + setuptools.data.accounts.accounts[i].password);
result.join('\r\n');
Output CSV of Accounts with Specific Config Key (e.g. enabled)
var result = [];
for ( var i in setuptools.data.accounts.accounts ) if (
setuptools.data.accounts.accounts.hasOwnProperty(i) &&
// modify the following line to set the conditionals
setuptools.data.accounts.accounts[i].enabled === true
) result.push(i + ',' + setuptools.data.accounts.accounts[i].password);
result.join('\r\n');
Modifying Account Configuration Data (e.g. disable all with loginOnly enabled)
// find and update all matching accounts
Object.filter(
setuptools.data.accounts.accounts,
function(guid, account) {
if (
// match only these items
account.loginOnly === true && account.enabled === true
// perform this action on all matches
) {
account.enabled = false;
return true;
}
}
);
// save the changes
setuptools.app.config.save();
Adding a return true;
to the filter would return an object of matching accounts and their properties.
Reset All Accounts to Default Configuration
// reset all account configurations
Object.filter(
setuptools.data.accounts.accounts,
function(guid, account) {
$.extend(true, account, setuptools.objects.account);
return true;
}
);
// save the changes
setuptools.app.config.save();
Reset Groups Manager
// reset the object
setuptools.data.groups = $.extend(true, {}, setuptools.objects.dataGroup);
// save the changes
setuptools.app.config.save();
Reset Default Settings
// merge default values
$.extend(true, setuptools.data.config, setuptools.copy.data.config);
// save the changes
setuptools.app.config.save();
Reset Character Sorting Lists
setuptools.data.muledump.chsortcustom = {
format: 1,
accounts: {}
}
// save the changes
setuptools.app.config.save();
Set Client Configuration Key to a Custom Value
// for example, enough accounts per page for a single page
setuptools.data.config.accountsPerPage = 10000;
// save the changes
setuptools.app.config.save();
Data Compression
Requires SnappyJS dependency (not planned until 9.4).
var buffer = sodium.from_string((sodium.to_base64(localStorage.getItem('key'))));
var compressed = SnappyJS.compress(buffer);
var decompressed = SnappyJS.uncompress(compressed);
var string = sodium.to_string(sodium.from_base64(sodium.to_string(decompressed)));
Get Item Group Members
Get all items in a particular item group (e.g. virtualSlotType or vst). In this example we'll use vst 50000, the uncategorized group.
var members = Object.filter(items, function(itemid, item) {
if ( item[setuptools.config.vstIndex] === 50000 ) return true;
});
Verify SetupTools Settings Manager Options
Open the Settings Manager before running this code. It verifies that all settings exist, are named properly, and that the select menu name matches.
found = [];
unknown = [];
missing = [];
malformed = [];
mismatch = [];
exempt = {
both: ['encryption', 'mqBGTimeout', 'mqConcurrent', 'mqDisplayIgn', 'mqKeepHistory', 'muleloginCopyLinks', 'pagesearchMode', 'recordConsoleTtl', 'tooltip', 'vaultbuilderAccountViewLimit', 'wbTotals', 'group'],
local: ['alertNewVersion', 'ga', 'gaErrors', 'gaOptions', 'gaPing', 'gaTotals'],
online: []
};
$('div.setuptools.app.config.settings').each(function() {
if ( typeof $(this).find('div').attr('id') !== 'string' ) {
malformed.push($(this).find('div').text());
return;
}
var matches = $(this).find('div').attr('id').match(/^settings-(.*)$/i);
if ( typeof setuptools.data.config[matches[1]] !== 'undefined' ) {
found.push(matches[1]);
if ( $(this).find('select').attr('name') !== matches[1] ) mismatch.push(matches[1]);
} else {
unknown.push(matches[1]);
}
});
Object.keys(setuptools.data.config).forEach(function(key) {
if (
found.indexOf(key) === -1 &&
exempt.both.indexOf(key) === -1 &&
(setuptools.state.hosted === true && exempt.online.indexOf(key) === -1) &&
(setuptools.state.hosted === false && exempt.local.indexOf(key) === -1)
) missing.push(key);
});
console.log(' \
Report: \n\n \
+ Missing: ' + missing + ' \n\n \
+ Unknown: ' + unknown + ' \n\n \
+ Malformed: ' + malformed + ' \n\n \
+ Mismatched: ' + mismatch + ' \n \
');