|
|
@ -40,20 +40,20 @@ define([
|
|
|
|
var sFrameChan;
|
|
|
|
var sFrameChan;
|
|
|
|
|
|
|
|
|
|
|
|
var categories = {
|
|
|
|
var categories = {
|
|
|
|
'general': [
|
|
|
|
'general': [ // Msg.admin_cat_general
|
|
|
|
'cp-admin-flush-cache',
|
|
|
|
'cp-admin-flush-cache',
|
|
|
|
'cp-admin-update-limit',
|
|
|
|
'cp-admin-update-limit',
|
|
|
|
'cp-admin-archive',
|
|
|
|
'cp-admin-archive',
|
|
|
|
'cp-admin-unarchive',
|
|
|
|
'cp-admin-unarchive',
|
|
|
|
// 'cp-admin-registration',
|
|
|
|
// 'cp-admin-registration',
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'quota': [
|
|
|
|
'quota': [ // Msg.admin_cat_quota
|
|
|
|
'cp-admin-defaultlimit',
|
|
|
|
'cp-admin-defaultlimit',
|
|
|
|
'cp-admin-setlimit',
|
|
|
|
'cp-admin-setlimit',
|
|
|
|
'cp-admin-getquota',
|
|
|
|
'cp-admin-getquota',
|
|
|
|
'cp-admin-getlimits',
|
|
|
|
'cp-admin-getlimits',
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'stats': [
|
|
|
|
'stats': [ // Msg.admin_cat_stats
|
|
|
|
'cp-admin-refresh-stats',
|
|
|
|
'cp-admin-refresh-stats',
|
|
|
|
'cp-admin-active-sessions',
|
|
|
|
'cp-admin-active-sessions',
|
|
|
|
'cp-admin-active-pads',
|
|
|
|
'cp-admin-active-pads',
|
|
|
@ -61,11 +61,11 @@ define([
|
|
|
|
'cp-admin-registered',
|
|
|
|
'cp-admin-registered',
|
|
|
|
'cp-admin-disk-usage',
|
|
|
|
'cp-admin-disk-usage',
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'support': [
|
|
|
|
'support': [ // Msg.admin_cat_support
|
|
|
|
'cp-admin-support-list',
|
|
|
|
'cp-admin-support-list',
|
|
|
|
'cp-admin-support-init'
|
|
|
|
'cp-admin-support-init'
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'performance': [
|
|
|
|
'performance': [ // Msg.admin_cat_performance
|
|
|
|
'cp-admin-refresh-performance',
|
|
|
|
'cp-admin-refresh-performance',
|
|
|
|
'cp-admin-performance-profiling',
|
|
|
|
'cp-admin-performance-profiling',
|
|
|
|
]
|
|
|
|
]
|
|
|
@ -73,7 +73,7 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
var create = {};
|
|
|
|
var create = {};
|
|
|
|
|
|
|
|
|
|
|
|
var makeBlock = function (key, addButton) {
|
|
|
|
var makeBlock = function (key, addButton) { // Title, Hint, maybeButton
|
|
|
|
// Convert to camlCase for translation keys
|
|
|
|
// Convert to camlCase for translation keys
|
|
|
|
var safeKey = key.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });
|
|
|
|
var safeKey = key.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });
|
|
|
|
|
|
|
|
|
|
|
@ -90,7 +90,7 @@ define([
|
|
|
|
};
|
|
|
|
};
|
|
|
|
create['update-limit'] = function () {
|
|
|
|
create['update-limit'] = function () {
|
|
|
|
var key = 'update-limit';
|
|
|
|
var key = 'update-limit';
|
|
|
|
var $div = makeBlock(key, true);
|
|
|
|
var $div = makeBlock(key, true); // Msg.admin_updateLimitHint, .admin_updateLimitTitle, .admin_updateLimitButton
|
|
|
|
$div.find('button').click(function () {
|
|
|
|
$div.find('button').click(function () {
|
|
|
|
sFrameChan.query('Q_UPDATE_LIMIT', null, function (e, res) {
|
|
|
|
sFrameChan.query('Q_UPDATE_LIMIT', null, function (e, res) {
|
|
|
|
if (e || (res && res.error)) { return void console.error(e || res.error); }
|
|
|
|
if (e || (res && res.error)) { return void console.error(e || res.error); }
|
|
|
@ -101,7 +101,7 @@ define([
|
|
|
|
};
|
|
|
|
};
|
|
|
|
create['flush-cache'] = function () {
|
|
|
|
create['flush-cache'] = function () {
|
|
|
|
var key = 'flush-cache';
|
|
|
|
var key = 'flush-cache';
|
|
|
|
var $div = makeBlock(key, true);
|
|
|
|
var $div = makeBlock(key, true); // Msg.admin_flushCacheHint, .admin_flushCacheTitle, .admin_flushCacheButton
|
|
|
|
var called = false;
|
|
|
|
var called = false;
|
|
|
|
$div.find('button').click(function () {
|
|
|
|
$div.find('button').click(function () {
|
|
|
|
if (called) { return; }
|
|
|
|
if (called) { return; }
|
|
|
@ -225,14 +225,14 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
create['archive'] = function () {
|
|
|
|
create['archive'] = function () {
|
|
|
|
var key = 'archive';
|
|
|
|
var key = 'archive';
|
|
|
|
var $div = makeBlock(key, true);
|
|
|
|
var $div = makeBlock(key, true); // Msg.admin_archiveHint, .admin_archiveTitle, .admin_archiveButton
|
|
|
|
var $button = $div.find('button');
|
|
|
|
var $button = $div.find('button');
|
|
|
|
archiveForm(true, $div, $button);
|
|
|
|
archiveForm(true, $div, $button);
|
|
|
|
return $div;
|
|
|
|
return $div;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
create['unarchive'] = function () {
|
|
|
|
create['unarchive'] = function () {
|
|
|
|
var key = 'unarchive';
|
|
|
|
var key = 'unarchive';
|
|
|
|
var $div = makeBlock(key, true);
|
|
|
|
var $div = makeBlock(key, true); // Msg.admin_unarchiveHint, .admin_unarchiveTitle, .admin_unarchiveButton
|
|
|
|
var $button = $div.find('button');
|
|
|
|
var $button = $div.find('button');
|
|
|
|
archiveForm(false, $div, $button);
|
|
|
|
archiveForm(false, $div, $button);
|
|
|
|
return $div;
|
|
|
|
return $div;
|
|
|
@ -240,7 +240,7 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
create['registration'] = function () {
|
|
|
|
create['registration'] = function () {
|
|
|
|
var key = 'registration';
|
|
|
|
var key = 'registration';
|
|
|
|
var $div = makeBlock(key, true);
|
|
|
|
var $div = makeBlock(key, true); // Msg.admin_registrationHint, .admin_registrationTitle, .admin_registrationButton
|
|
|
|
var $button = $div.find('button');
|
|
|
|
var $button = $div.find('button');
|
|
|
|
var state = APP.instanceStatus.restrictRegistration;
|
|
|
|
var state = APP.instanceStatus.restrictRegistration;
|
|
|
|
if (state) {
|
|
|
|
if (state) {
|
|
|
@ -282,7 +282,7 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
create['defaultlimit'] = function () {
|
|
|
|
create['defaultlimit'] = function () {
|
|
|
|
var key = 'defaultlimit';
|
|
|
|
var key = 'defaultlimit';
|
|
|
|
var $div = makeBlock(key);
|
|
|
|
var $div = makeBlock(key); // Msg.admin_defaultlimitHint, .admin_defaultlimitTitle
|
|
|
|
var _limit = APP.instanceStatus.defaultStorageLimit;
|
|
|
|
var _limit = APP.instanceStatus.defaultStorageLimit;
|
|
|
|
var _limitMB = Util.bytesToMegabytes(_limit);
|
|
|
|
var _limitMB = Util.bytesToMegabytes(_limit);
|
|
|
|
var limit = getPrettySize(_limit);
|
|
|
|
var limit = getPrettySize(_limit);
|
|
|
@ -322,7 +322,7 @@ define([
|
|
|
|
};
|
|
|
|
};
|
|
|
|
create['getlimits'] = function () {
|
|
|
|
create['getlimits'] = function () {
|
|
|
|
var key = 'getlimits';
|
|
|
|
var key = 'getlimits';
|
|
|
|
var $div = makeBlock(key);
|
|
|
|
var $div = makeBlock(key); // Msg.admin_getlimitsHint, .admin_getlimitsTitle
|
|
|
|
APP.refreshLimits = function () {
|
|
|
|
APP.refreshLimits = function () {
|
|
|
|
sFrameChan.query('Q_ADMIN_RPC', {
|
|
|
|
sFrameChan.query('Q_ADMIN_RPC', {
|
|
|
|
cmd: 'GET_LIMITS',
|
|
|
|
cmd: 'GET_LIMITS',
|
|
|
@ -385,7 +385,7 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
create['setlimit'] = function () {
|
|
|
|
create['setlimit'] = function () {
|
|
|
|
var key = 'setlimit';
|
|
|
|
var key = 'setlimit';
|
|
|
|
var $div = makeBlock(key);
|
|
|
|
var $div = makeBlock(key); // Msg.admin_setlimitHint, .admin_setlimitTitle
|
|
|
|
|
|
|
|
|
|
|
|
var user = h('input.cp-setlimit-key');
|
|
|
|
var user = h('input.cp-setlimit-key');
|
|
|
|
var $key = $(user);
|
|
|
|
var $key = $(user);
|
|
|
@ -471,7 +471,7 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
create['getquota'] = function () {
|
|
|
|
create['getquota'] = function () {
|
|
|
|
var key = 'getquota';
|
|
|
|
var key = 'getquota';
|
|
|
|
var $div = makeBlock(key, true);
|
|
|
|
var $div = makeBlock(key, true); // Msg.admin_getquotaHint, .admin_getquotaTitle, .admin_getquotaButton
|
|
|
|
|
|
|
|
|
|
|
|
var input = h('input#cp-admin-getquota', {
|
|
|
|
var input = h('input#cp-admin-getquota', {
|
|
|
|
type: 'text'
|
|
|
|
type: 'text'
|
|
|
@ -521,7 +521,7 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
create['active-sessions'] = function () {
|
|
|
|
create['active-sessions'] = function () {
|
|
|
|
var key = 'active-sessions';
|
|
|
|
var key = 'active-sessions';
|
|
|
|
var $div = makeBlock(key);
|
|
|
|
var $div = makeBlock(key); // Msg.admin_activeSessionsHint, .admin_activeSessionsTitle
|
|
|
|
var onRefresh = function () {
|
|
|
|
var onRefresh = function () {
|
|
|
|
$div.find('pre').remove();
|
|
|
|
$div.find('pre').remove();
|
|
|
|
sFrameChan.query('Q_ADMIN_RPC', {
|
|
|
|
sFrameChan.query('Q_ADMIN_RPC', {
|
|
|
@ -539,7 +539,7 @@ define([
|
|
|
|
};
|
|
|
|
};
|
|
|
|
create['active-pads'] = function () {
|
|
|
|
create['active-pads'] = function () {
|
|
|
|
var key = 'active-pads';
|
|
|
|
var key = 'active-pads';
|
|
|
|
var $div = makeBlock(key);
|
|
|
|
var $div = makeBlock(key); // Msg.admin_activePadsHint, .admin_activePadsTitle
|
|
|
|
var onRefresh = function () {
|
|
|
|
var onRefresh = function () {
|
|
|
|
$div.find('pre').remove();
|
|
|
|
$div.find('pre').remove();
|
|
|
|
sFrameChan.query('Q_ADMIN_RPC', {
|
|
|
|
sFrameChan.query('Q_ADMIN_RPC', {
|
|
|
@ -556,7 +556,7 @@ define([
|
|
|
|
};
|
|
|
|
};
|
|
|
|
create['open-files'] = function () {
|
|
|
|
create['open-files'] = function () {
|
|
|
|
var key = 'open-files';
|
|
|
|
var key = 'open-files';
|
|
|
|
var $div = makeBlock(key);
|
|
|
|
var $div = makeBlock(key); // Msg.admin_openFilesHint, .admin_openFilesTitle
|
|
|
|
var onRefresh = function () {
|
|
|
|
var onRefresh = function () {
|
|
|
|
$div.find('pre').remove();
|
|
|
|
$div.find('pre').remove();
|
|
|
|
sFrameChan.query('Q_ADMIN_RPC', {
|
|
|
|
sFrameChan.query('Q_ADMIN_RPC', {
|
|
|
@ -573,7 +573,7 @@ define([
|
|
|
|
};
|
|
|
|
};
|
|
|
|
create['registered'] = function () {
|
|
|
|
create['registered'] = function () {
|
|
|
|
var key = 'registered';
|
|
|
|
var key = 'registered';
|
|
|
|
var $div = makeBlock(key);
|
|
|
|
var $div = makeBlock(key); // Msg.admin_registeredHint, .admin_registeredTitle
|
|
|
|
var onRefresh = function () {
|
|
|
|
var onRefresh = function () {
|
|
|
|
$div.find('pre').remove();
|
|
|
|
$div.find('pre').remove();
|
|
|
|
sFrameChan.query('Q_ADMIN_RPC', {
|
|
|
|
sFrameChan.query('Q_ADMIN_RPC', {
|
|
|
@ -590,7 +590,7 @@ define([
|
|
|
|
};
|
|
|
|
};
|
|
|
|
create['disk-usage'] = function () {
|
|
|
|
create['disk-usage'] = function () {
|
|
|
|
var key = 'disk-usage';
|
|
|
|
var key = 'disk-usage';
|
|
|
|
var $div = makeBlock(key, true);
|
|
|
|
var $div = makeBlock(key, true); // Msg.admin_diskUsageHint, .admin_diskUsageTitle, .admin_diskUsageButton
|
|
|
|
var called = false;
|
|
|
|
var called = false;
|
|
|
|
$div.find('button').click(function () {
|
|
|
|
$div.find('button').click(function () {
|
|
|
|
$div.find('button').hide();
|
|
|
|
$div.find('button').hide();
|
|
|
@ -628,7 +628,7 @@ define([
|
|
|
|
var supportKey = ApiConfig.supportMailbox;
|
|
|
|
var supportKey = ApiConfig.supportMailbox;
|
|
|
|
create['support-list'] = function () {
|
|
|
|
create['support-list'] = function () {
|
|
|
|
if (!supportKey || !APP.privateKey) { return; }
|
|
|
|
if (!supportKey || !APP.privateKey) { return; }
|
|
|
|
var $container = makeBlock('support-list');
|
|
|
|
var $container = makeBlock('support-list'); // Msg.admin_supportListHint, .admin_supportListTitle
|
|
|
|
var $div = $(h('div.cp-support-container')).appendTo($container);
|
|
|
|
var $div = $(h('div.cp-support-container')).appendTo($container);
|
|
|
|
|
|
|
|
|
|
|
|
var catContainer = h('div.cp-dropdown-container');
|
|
|
|
var catContainer = h('div.cp-dropdown-container');
|
|
|
@ -893,7 +893,7 @@ define([
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
create['support-init'] = function () {
|
|
|
|
create['support-init'] = function () {
|
|
|
|
var $div = makeBlock('support-init');
|
|
|
|
var $div = makeBlock('support-init'); // Msg.admin_supportInitHint, .admin_supportInitTitle
|
|
|
|
if (!supportKey) {
|
|
|
|
if (!supportKey) {
|
|
|
|
$div.append(h('p', Messages.admin_supportInitHelp));
|
|
|
|
$div.append(h('p', Messages.admin_supportInitHelp));
|
|
|
|
return $div;
|
|
|
|
return $div;
|
|
|
@ -945,7 +945,7 @@ define([
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
create['performance-profiling'] = function () {
|
|
|
|
create['performance-profiling'] = function () {
|
|
|
|
var $div = makeBlock('performance-profiling');
|
|
|
|
var $div = makeBlock('performance-profiling'); // Msg.admin_performanceProfilingHint, .admin_performanceProfilingTitle
|
|
|
|
|
|
|
|
|
|
|
|
var onRefresh = function () {
|
|
|
|
var onRefresh = function () {
|
|
|
|
var body = h('tbody');
|
|
|
|
var body = h('tbody');
|
|
|
|