Merge branch 'dark' of github.com:xwiki-labs/cryptpad into dark

pull/1/head
ansuz 4 years ago
commit 44a849b7a9

@ -142,6 +142,7 @@
@cp_buttons-default-color: @cryptpad_text_col; @cp_buttons-default-color: @cryptpad_text_col;
@cp_buttons-default-border: @cryptpad_text_col; @cp_buttons-default-border: @cryptpad_text_col;
@cp_buttons-red: #E55236; @cp_buttons-red: #E55236;
@cp_buttons-red-text: @cryptpad_color_light_red;
@cp_buttons-red-color: #FFF; @cp_buttons-red-color: #FFF;
@cp_buttons-red-border: transparent; @cp_buttons-red-border: transparent;
@cp_buttons-primary: @cryptpad_color_brand; @cp_buttons-primary: @cryptpad_color_brand;
@ -159,7 +160,7 @@
@cp_sidebar-right-bg: @cryptpad_color_grey_900; @cp_sidebar-right-bg: @cryptpad_color_grey_900;
@cp_sidebar-right-fg: @cryptpad_text_col; // XXX was black @cp_sidebar-right-fg: @cryptpad_text_col; // XXX was black
@cp_sidebar-left-active: @cp_sidebar-right-bg; @cp_sidebar-left-active: @cp_sidebar-right-bg;
@cp_sidebar-hint: @cryptpad_color_hint_grey; @cp_sidebar-hint: fade(@cryptpad_text_col, 80%);
// Drive // Drive
@cp_drive-bg: @cp_sidebar-right-bg; @cp_drive-bg: @cp_sidebar-right-bg;
@ -327,6 +328,7 @@
// Code // Code
@cp_preview-bg: @cryptpad_color_grey_900; @cp_preview-bg: @cryptpad_color_grey_900;
@cp_preview-fg: @cryptpad_text_col; @cp_preview-fg: @cryptpad_text_col;
@cp_preview-link: @cryptpad_color_brand_300;
// Debug // Debug
@cp_debug-hover: fade(@cryptpad_color_black, 10%); @cp_debug-hover: fade(@cryptpad_color_black, 10%);

@ -142,6 +142,7 @@
@cp_buttons-default-color: @cryptpad_text_col; @cp_buttons-default-color: @cryptpad_text_col;
@cp_buttons-default-border: @cryptpad_text_col; @cp_buttons-default-border: @cryptpad_text_col;
@cp_buttons-red: #E55236; @cp_buttons-red: #E55236;
@cp_buttons-red-text: @cp_buttons-red;
@cp_buttons-red-color: #FFF; @cp_buttons-red-color: #FFF;
@cp_buttons-red-border: transparent; @cp_buttons-red-border: transparent;
@cp_buttons-primary: @cryptpad_color_brand; @cp_buttons-primary: @cryptpad_color_brand;
@ -327,6 +328,7 @@
// Code // Code
@cp_preview-bg: @cryptpad_color_white; @cp_preview-bg: @cryptpad_color_white;
@cp_preview-fg: @cryptpad_text_col; @cp_preview-fg: @cryptpad_text_col;
@cp_preview-link: @cryptpad_color_brand;
// Debug // Debug
@cp_debug-hover: fade(@cryptpad_color_black, 10%); @cp_debug-hover: fade(@cryptpad_color_black, 10%);

@ -142,7 +142,7 @@
&.danger-alt, &.btn-danger-alt, &.btn-danger-outline { &.danger-alt, &.btn-danger-alt, &.btn-danger-outline {
border-color: @cp_buttons-red; border-color: @cp_buttons-red;
color: @cp_buttons-red; color: @cp_buttons-red-text;
&:hover, &:not(:disabled):active, &:focus { &:hover, &:not(:disabled):active, &:focus {
border-color: @cp_buttons-red; border-color: @cp_buttons-red;
color: @cp_buttons-red-color; color: @cp_buttons-red-color;

@ -53,6 +53,7 @@ define([
'cp-admin-getlimits', 'cp-admin-getlimits',
], ],
'stats': [ 'stats': [
'cp-admin-refresh-stats',
'cp-admin-active-sessions', 'cp-admin-active-sessions',
'cp-admin-active-pads', 'cp-admin-active-pads',
'cp-admin-open-files', 'cp-admin-open-files',
@ -466,49 +467,86 @@ define([
return $div; return $div;
}; };
var onRefreshStats = Util.mkEvent();
create['refresh-stats'] = function () {
var key = 'refresh-stats';
var $div = $('<div>', {'class': 'cp-admin-' + key + ' cp-sidebarlayout-element'});
var $btn = $(h('button.btn.btn-primary', Messages.oo_refresh));
$btn.click(function () {
onRefreshStats.fire();
});
$div.append($btn);
return $div;
};
create['active-sessions'] = function () { create['active-sessions'] = function () {
var key = 'active-sessions'; var key = 'active-sessions';
var $div = makeBlock(key); var $div = makeBlock(key);
sFrameChan.query('Q_ADMIN_RPC', { var onRefresh = function () {
cmd: 'ACTIVE_SESSIONS', $div.find('pre').remove();
}, function (e, data) { sFrameChan.query('Q_ADMIN_RPC', {
var total = data[0]; cmd: 'ACTIVE_SESSIONS',
var ips = data[1]; }, function (e, data) {
$div.append(h('pre', total + ' (' + ips + ')')); var total = data[0];
}); var ips = data[1];
$div.find('pre').remove();
$div.append(h('pre', total + ' (' + ips + ')'));
});
};
onRefresh();
onRefreshStats.reg(onRefresh);
return $div; return $div;
}; };
create['active-pads'] = function () { create['active-pads'] = function () {
var key = 'active-pads'; var key = 'active-pads';
var $div = makeBlock(key); var $div = makeBlock(key);
sFrameChan.query('Q_ADMIN_RPC', { var onRefresh = function () {
cmd: 'ACTIVE_PADS', $div.find('pre').remove();
}, function (e, data) { sFrameChan.query('Q_ADMIN_RPC', {
console.log(e, data); cmd: 'ACTIVE_PADS',
$div.append(h('pre', String(data))); }, function (e, data) {
}); console.log(e, data);
$div.find('pre').remove();
$div.append(h('pre', String(data)));
});
};
onRefresh();
onRefreshStats.reg(onRefresh);
return $div; return $div;
}; };
create['open-files'] = function () { create['open-files'] = function () {
var key = 'open-files'; var key = 'open-files';
var $div = makeBlock(key); var $div = makeBlock(key);
sFrameChan.query('Q_ADMIN_RPC', { var onRefresh = function () {
cmd: 'GET_FILE_DESCRIPTOR_COUNT', $div.find('pre').remove();
}, function (e, data) { sFrameChan.query('Q_ADMIN_RPC', {
console.log(e, data); cmd: 'GET_FILE_DESCRIPTOR_COUNT',
$div.append(h('pre', String(data))); }, function (e, data) {
}); console.log(e, data);
$div.find('pre').remove();
$div.append(h('pre', String(data)));
});
};
onRefresh();
onRefreshStats.reg(onRefresh);
return $div; return $div;
}; };
create['registered'] = function () { create['registered'] = function () {
var key = 'registered'; var key = 'registered';
var $div = makeBlock(key); var $div = makeBlock(key);
sFrameChan.query('Q_ADMIN_RPC', { var onRefresh = function () {
cmd: 'REGISTERED_USERS', $div.find('pre').remove();
}, function (e, data) { sFrameChan.query('Q_ADMIN_RPC', {
console.log(e, data); cmd: 'REGISTERED_USERS',
$div.append(h('pre', String(data))); }, function (e, data) {
}); console.log(e, data);
$div.find('pre').remove();
$div.append(h('pre', String(data)));
});
};
onRefresh();
onRefreshStats.reg(onRefresh);
return $div; return $div;
}; };
create['disk-usage'] = function () { create['disk-usage'] = function () {

@ -112,6 +112,10 @@
media-tag > * { media-tag > * {
margin-bottom: 1rem; margin-bottom: 1rem;
} }
a {
color: @cp_preview-link;
text-decoration: underline;
}
} }
.cp-splitter { .cp-splitter {

Loading…
Cancel
Save