define([ 'jquery', '/api/config', '/customize/application_config.js', '/bower_components/chainpad-crypto/crypto.js', '/common/toolbar.js', '/bower_components/nthen/index.js', '/common/sframe-common.js', '/common/hyperscript.js', '/customize/messages.js', '/common/common-interface.js', '/common/common-ui-elements.js', '/common/common-util.js', '/common/common-hash.js', '/common/common-signing-keys.js', '/support/ui.js', '/lib/datepicker/flatpickr.js', '/bower_components/tweetnacl/nacl-fast.min.js', 'css!/lib/datepicker/flatpickr.min.css', 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', 'less!/admin/app-admin.less', ], function ( $, ApiConfig, AppConfig, Crypto, Toolbar, nThen, SFCommon, h, Messages, UI, UIElements, Util, Hash, Keys, Support, Flatpickr ) { var APP = { 'instanceStatus': {} }; var Nacl = window.nacl; var common; var sFrameChan; var categories = { 'general': [ // Msg.admin_cat_general 'cp-admin-flush-cache', 'cp-admin-update-limit', 'cp-admin-archive', 'cp-admin-unarchive', 'cp-admin-registration', 'cp-admin-email' ], 'quota': [ // Msg.admin_cat_quota 'cp-admin-defaultlimit', 'cp-admin-setlimit', 'cp-admin-getquota', 'cp-admin-getlimits', ], 'stats': [ // Msg.admin_cat_stats 'cp-admin-refresh-stats', 'cp-admin-uptime', 'cp-admin-active-sessions', 'cp-admin-active-pads', 'cp-admin-open-files', 'cp-admin-registered', 'cp-admin-disk-usage', ], 'support': [ // Msg.admin_cat_support 'cp-admin-support-list', 'cp-admin-support-init', 'cp-admin-support-priv', ], 'broadcast': [ // Msg.admin_cat_broadcast 'cp-admin-maintenance', 'cp-admin-survey', 'cp-admin-broadcast', ], 'performance': [ // Msg.admin_cat_performance 'cp-admin-refresh-performance', 'cp-admin-performance-profiling', 'cp-admin-enable-disk-measurements', 'cp-admin-bytes-written', ], 'network': [ // Msg.admin_cat_network 'cp-admin-update-available', 'cp-admin-checkup', 'cp-admin-block-daily-check', //'cp-admin-provide-aggregate-statistics', 'cp-admin-list-my-instance', 'cp-admin-consent-to-contact', 'cp-admin-remove-donate-button', 'cp-admin-instance-purpose', ], }; var create = {}; var keyToCamlCase = function (key) { return key.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); }); }; var makeBlock = function (key, addButton) { // Title, Hint, maybeButton // Convert to camlCase for translation keys var safeKey = keyToCamlCase(key); var $div = $('
', {'class': 'cp-admin-' + key + ' cp-sidebarlayout-element'}); $('