General : cleaning and optimizing CSS

General : responsive design
General : reload button now spins when you reload block
General : update jQuery plugin Knob to 1.2.11
General : optimizing security (config file esm.config.json is now in the conf/ folder with an htaccess)
CPU : retrieves correctly CPU frequency for Raspberry Pi
CPU : add CPU temperature (+ option to enable/disable)
System : little correction for getting distro name
Swap : fix if swap is disabled
Services status : adds protocol TCP or UDP for checking service status
Services status : new option to hide port number (see show_port in services section)
This commit is contained in:
ShevAbam 2015-07-07 15:57:41 +02:00
parent dd982cee07
commit 9970343fe5
32 changed files with 2486 additions and 410 deletions

View File

@ -23,4 +23,6 @@ You can download the last version [here](http://www.ezservermonitor.com/esm-web/
The [documentation](http://www.ezservermonitor.com/esm-web/documentation) explains all the parameters of *esm.config.json*.
Changelog is available [here](http://www.ezservermonitor.com/esm-web/changelog).
**View more information on the [official website](http://www.ezservermonitor.com/esm-web/features).**

8
autoload.php Normal file
View File

@ -0,0 +1,8 @@
<?php
function eSMAutoload($class)
{
include __DIR__.'/libs/Utils/'.$class.'.php';
}
spl_autoload_register('eSMAutoload');

1
conf/.htaccess Normal file
View File

@ -0,0 +1 @@
deny from all

65
conf/esm.config.json Normal file
View File

@ -0,0 +1,65 @@
{
"esm": {
"version": "2.5",
"website": "http://www.ezservermonitor.com",
"check_updates": true,
"auto_refresh": 0
},
"cpu": {
"enable_temperature": true
},
"disk": {
"show_tmpfs": false
},
"ping": {
"hosts": [
"facebook.com",
"google.com",
"yahoo.com"
]
},
"last_login": {
"max": 5
},
"services": {
"show_port": true,
"list": [
{
"name": "Web Server",
"host": "localhost",
"port": 80,
"protocol": "tcp"
},
{
"name": "Email Server (incoming)",
"host": "localhost",
"port": 993,
"protocol": "tcp"
},
{
"name": "Email Server (outgoing)",
"host": "localhost",
"port": 587,
"protocol": "tcp"
},
{
"name": "FTP Server",
"host": "localhost",
"port": 21,
"protocol": "tcp"
},
{
"name": "Database Server",
"host": "localhost",
"port": 3306,
"protocol": "tcp"
},
{
"name": "SSH",
"host": "localhost",
"port": 22,
"protocol": "tcp"
}
]
}
}

View File

@ -1,53 +0,0 @@
{
"esm": {
"version": "2.4",
"website": "http://www.ezservermonitor.com",
"check_updates": true,
"auto_refresh": 0
},
"disk": {
"show_tmpfs": false
},
"ping": {
"hosts": [
"facebook.com",
"google.com",
"yahoo.com"
]
},
"last_login": {
"max": 5
},
"services": [
{
"name": "Web Server",
"host": "localhost",
"port": 80
},
{
"name": "Email Server (incoming)",
"host": "localhost",
"port": 993
},
{
"name": "Email Server (outgoing)",
"host": "localhost",
"port": 587
},
{
"name": "FTP Server",
"host": "localhost",
"port": 21
},
{
"name": "Database Server",
"host": "localhost",
"port": 3306
},
{
"name": "SSH Service",
"host": "localhost",
"port": 22
}
]
}

View File

@ -1,6 +1,5 @@
<?php
require 'libs/Utils/Misc.class.php';
require 'libs/Utils/Config.class.php';
require 'autoload.php';
$Config = new Config();
$update = $Config->checkUpdate();
?>
@ -169,6 +168,12 @@ $update = $Config->checkUpdate();
<td>Bogomips</td>
<td id="cpu-bogomips"></td>
</tr>
<?php if ($Config->get('cpu:enable_temperature')): ?>
<tr>
<td>Temperature</td>
<td id="cpu-temp"></td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>

121
js/esm.js
View File

@ -3,11 +3,17 @@ var esm = {};
esm.getSystem = function() {
$.get('libs/system.php', function(data) {
var module = 'system';
esm.reloadBlock_spin(module);
var $box = $('.box#esm-system .box-content tbody');
$.get('libs/'+module+'.php', function(data) {
esm.insertDatas($box, 'system', data);
var $box = $('.box#esm-'+module+' .box-content tbody');
esm.insertDatas($box, module, data);
esm.reloadBlock_spin(module);
}, 'json');
@ -16,14 +22,20 @@ esm.getSystem = function() {
esm.getLoad_average = function() {
$.get('libs/load_average.php', function(data) {
var module = 'load_average';
esm.reloadBlock_spin(module);
var $box = $('.box#esm-load_average .box-content');
$.get('libs/'+module+'.php', function(data) {
var $box = $('.box#esm-'+module+' .box-content');
esm.reconfigureGauge($('input#load-average_1', $box), data[0]);
esm.reconfigureGauge($('input#load-average_5', $box), data[1]);
esm.reconfigureGauge($('input#load-average_15', $box), data[2]);
esm.reloadBlock_spin(module);
}, 'json');
}
@ -31,11 +43,17 @@ esm.getLoad_average = function() {
esm.getCpu = function() {
$.get('libs/cpu.php', function(data) {
var module = 'cpu';
esm.reloadBlock_spin(module);
var $box = $('.box#esm-cpu .box-content tbody');
$.get('libs/'+module+'.php', function(data) {
esm.insertDatas($box, 'cpu', data);
var $box = $('.box#esm-'+module+' .box-content tbody');
esm.insertDatas($box, module, data);
esm.reloadBlock_spin(module);
}, 'json');
@ -44,11 +62,17 @@ esm.getCpu = function() {
esm.getMemory = function() {
$.get('libs/memory.php', function(data) {
var module = 'memory';
esm.reloadBlock_spin(module);
var $box = $('.box#esm-memory .box-content tbody');
$.get('libs/'+module+'.php', function(data) {
esm.insertDatas($box, 'memory', data);
var $box = $('.box#esm-'+module+' .box-content tbody');
esm.insertDatas($box, module, data);
esm.reloadBlock_spin(module);
// Percent bar
var $progress = $('.progressbar', $box);
@ -72,11 +96,15 @@ esm.getMemory = function() {
esm.getSwap = function() {
$.get('libs/swap.php', function(data) {
var module = 'swap';
esm.reloadBlock_spin(module);
var $box = $('.box#esm-swap .box-content tbody');
$.get('libs/'+module+'.php', function(data) {
esm.insertDatas($box, 'swap', data);
var $box = $('.box#esm-'+module+' .box-content tbody');
esm.insertDatas($box, module, data);
// Percent bar
var $progress = $('.progressbar', $box);
@ -92,6 +120,8 @@ esm.getSwap = function() {
$progress.addClass('orange');
else
$progress.addClass('red');
esm.reloadBlock_spin(module);
}, 'json');
@ -100,9 +130,13 @@ esm.getSwap = function() {
esm.getDisk = function() {
$.get('libs/disk.php', function(data) {
var module = 'disk';
esm.reloadBlock_spin(module);
var $box = $('.box#esm-disk .box-content tbody');
$.get('libs/'+module+'.php', function(data) {
var $box = $('.box#esm-'+module+' .box-content tbody');
$box.empty();
for (var line in data)
@ -127,6 +161,8 @@ esm.getDisk = function() {
$box.append(html);
}
esm.reloadBlock_spin(module);
}, 'json');
@ -135,9 +171,13 @@ esm.getDisk = function() {
esm.getLast_login = function() {
$.get('libs/last_login.php', function(data) {
var module = 'last_login';
esm.reloadBlock_spin(module);
var $box = $('.box#esm-last_login .box-content tbody');
$.get('libs/'+module+'.php', function(data) {
var $box = $('.box#esm-'+module+' .box-content tbody');
$box.empty();
for (var line in data)
@ -150,6 +190,8 @@ esm.getLast_login = function() {
$box.append(html);
}
esm.reloadBlock_spin(module);
}, 'json');
@ -158,9 +200,13 @@ esm.getLast_login = function() {
esm.getNetwork = function() {
$.get('libs/network.php', function(data) {
var module = 'network';
esm.reloadBlock_spin(module);
var $box = $('.box#esm-network .box-content tbody');
$.get('libs/'+module+'.php', function(data) {
var $box = $('.box#esm-'+module+' .box-content tbody');
$box.empty();
for (var line in data)
@ -176,6 +222,8 @@ esm.getNetwork = function() {
$box.append(html);
}
esm.reloadBlock_spin(module);
}, 'json');
}
@ -183,9 +231,13 @@ esm.getNetwork = function() {
esm.getPing = function() {
$.get('libs/ping.php', function(data) {
var module = 'ping';
esm.reloadBlock_spin(module);
var $box = $('.box#esm-ping .box-content tbody');
$.get('libs/'+module+'.php', function(data) {
var $box = $('.box#esm-'+module+' .box-content tbody');
$box.empty();
for (var line in data)
@ -198,6 +250,8 @@ esm.getPing = function() {
$box.append(html);
}
esm.reloadBlock_spin(module);
}, 'json');
@ -206,9 +260,13 @@ esm.getPing = function() {
esm.getServices = function() {
$.get('libs/services.php', function(data) {
var module = 'services';
esm.reloadBlock_spin(module);
var $box = $('.box#esm-services .box-content tbody');
$.get('libs/'+module+'.php', function(data) {
var $box = $('.box#esm-'+module+' .box-content tbody');
$box.empty();
for (var line in data)
@ -225,14 +283,14 @@ esm.getServices = function() {
$box.append(html);
}
esm.reloadBlock_spin(module);
}, 'json');
}
esm.getAll = function() {
esm.getSystem();
esm.getCpu();
@ -247,7 +305,18 @@ esm.getAll = function() {
}
esm.reloadBlock = function(block) {
esm.mapping[block]();
}
esm.reloadBlock_spin = function(block) {
var $module = $('.box#esm-'+block);
$('.reload', $module).toggleClass('spin disabled');
$('.box-content', $module).toggleClass('faded');
}
esm.insertDatas = function($box, block, datas) {

View File

@ -2,7 +2,7 @@
/**
* Downward compatible, touchable dial
*
* Version: 1.2.8
* Version: 1.2.11
* Requires: jQuery v1.7+
*
* Copyright (c) 2012 Anthony Terrien
@ -10,7 +10,15 @@
*
* Thanks to vor, eskimoblood, spiffistan, FabrizioC
*/
(function($) {
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
/**
* Kontrol library
@ -80,43 +88,41 @@
._draw();
};
if(this.$.data('kontroled')) return;
if (this.$.data('kontroled')) return;
this.$.data('kontroled', true);
this.extend();
this.o = $.extend(
{
this.o = $.extend({
// Config
min : this.$.data('min') !== undefined ? this.$.data('min') : 0,
max : this.$.data('max') !== undefined ? this.$.data('max') : 100,
stopper : true,
readOnly : this.$.data('readonly') || (this.$.attr('readonly') === 'readonly'),
min: this.$.data('min') !== undefined ? this.$.data('min') : 0,
max: this.$.data('max') !== undefined ? this.$.data('max') : 100,
stopper: true,
readOnly: this.$.data('readonly') || (this.$.attr('readonly') === 'readonly'),
// UI
cursor : (this.$.data('cursor') === true && 30) ||
this.$.data('cursor') || 0,
thickness : (
this.$.data('thickness') &&
Math.max(Math.min(this.$.data('thickness'), 1), 0.01)
) || 0.35,
lineCap : this.$.data('linecap') || 'butt',
width : this.$.data('width') || 200,
height : this.$.data('height') || 200,
displayInput : this.$.data('displayinput') == null || this.$.data('displayinput'),
displayPrevious : this.$.data('displayprevious'),
fgColor : this.$.data('fgcolor') || '#87CEEB',
cursor: this.$.data('cursor') === true && 30
|| this.$.data('cursor') || 0,
thickness: this.$.data('thickness')
&& Math.max(Math.min(this.$.data('thickness'), 1), 0.01)
|| 0.35,
lineCap: this.$.data('linecap') || 'butt',
width: this.$.data('width') || 200,
height: this.$.data('height') || 200,
displayInput: this.$.data('displayinput') == null || this.$.data('displayinput'),
displayPrevious: this.$.data('displayprevious'),
fgColor: this.$.data('fgcolor') || '#87CEEB',
inputColor: this.$.data('inputcolor'),
font: this.$.data('font') || 'Arial',
fontWeight: this.$.data('font-weight') || 'bold',
inline : false,
step : this.$.data('step') || 1,
inline: false,
step: this.$.data('step') || 1,
rotation: this.$.data('rotation'),
// Hooks
draw : null, // function () {}
change : null, // function (value) {}
cancel : null, // function () {}
release : null, // function (value) {}
draw: null, // function () {}
change: null, // function (value) {}
cancel: null, // function () {}
release: null, // function (value) {}
// Output formatting, allows to add unit: %, ms ...
format: function(v) {
@ -130,12 +136,12 @@
// finalize options
this.o.flip = this.o.rotation === 'anticlockwise' || this.o.rotation === 'acw';
if(!this.o.inputColor) {
if (!this.o.inputColor) {
this.o.inputColor = this.o.fgColor;
}
// routing value
if(this.$.is('fieldset')) {
if (this.$.is('fieldset')) {
// fieldset = array of integer
this.v = {};
@ -146,33 +152,31 @@
s.v[k] = s.o.parse($this.val());
$this.bind(
'change blur'
, function () {
'change blur',
function () {
var val = {};
val[k] = $this.val();
s.val(val);
s.val(s._validate(val));
}
);
});
this.$.find('legend').remove();
} else {
// input = integer
this.i = this.$;
this.v = this.o.parse(this.$.val());
(this.v === '') && (this.v = this.o.min);
this.v === '' && (this.v = this.o.min);
this.$.bind(
'change blur'
, function () {
'change blur',
function () {
s.val(s._validate(s.o.parse(s.$.val())));
}
);
}
(!this.o.displayInput) && this.$.hide();
!this.o.displayInput && this.$.hide();
// adds needed DOM elements (canvas, div)
this.$c = $(document.createElement('canvas')).attr({
@ -191,7 +195,7 @@
this.$div = this.$.parent();
if (typeof G_vmlCanvasManager !== 'undefined') {
G_vmlCanvasManager.initElement(this.$c[0]);
G_vmlCanvasManager.initElement(this.$c[0]);
}
this.c = this.$c[0].getContext ? this.$c[0].getContext('2d') : null;
@ -205,21 +209,20 @@
}
// hdpi support
this.scale = (window.devicePixelRatio || 1) /
(
this.scale = (window.devicePixelRatio || 1) / (
this.c.webkitBackingStorePixelRatio ||
this.c.mozBackingStorePixelRatio ||
this.c.msBackingStorePixelRatio ||
this.c.oBackingStorePixelRatio ||
this.c.backingStorePixelRatio || 1
);
);
// detects relative width / height
this.relativeWidth = ((this.o.width % 1 !== 0) &&
this.o.width.indexOf('%'));
this.relativeHeight = ((this.o.height % 1 !== 0) &&
this.o.height.indexOf('%'));
this.relative = (this.relativeWidth || this.relativeHeight);
this.relativeWidth = this.o.width % 1 !== 0
&& this.o.width.indexOf('%');
this.relativeHeight = this.o.height % 1 !== 0
&& this.o.height.indexOf('%');
this.relative = this.relativeWidth || this.relativeHeight;
// computes size and carves the component
this._carve();
@ -253,15 +256,15 @@
};
this._carve = function() {
if(this.relative) {
if (this.relative) {
var w = this.relativeWidth ?
this.$div.parent().width() *
parseInt(this.o.width) / 100 :
this.$div.parent().width(),
this.$div.parent().width() *
parseInt(this.o.width) / 100
: this.$div.parent().width(),
h = this.relativeHeight ?
this.$div.parent().height() *
parseInt(this.o.height) / 100 :
this.$div.parent().height();
this.$div.parent().height() *
parseInt(this.o.height) / 100
: this.$div.parent().height();
// apply relative
this.w = this.h = Math.min(w, h);
@ -302,25 +305,21 @@
s.clear();
s.dH
&& (d = s.dH());
(d !== false) && s.draw();
s.dH && (d = s.dH());
d !== false && s.draw();
};
this._touch = function (e) {
var touchMove = function (e) {
var v = s.xy2val(
e.originalEvent.touches[s.t].pageX,
e.originalEvent.touches[s.t].pageY
);
);
if (v == s.cv) return;
if (s.cH && (s.cH(v) === false)) return;
if (s.cH && s.cH(v) === false) return;
s.change(s._validate(v));
s._draw();
@ -336,8 +335,8 @@
k.c.d
.bind("touchmove.k", touchMove)
.bind(
"touchend.k"
, function () {
"touchend.k",
function () {
k.c.d.unbind('touchmove.k touchend.k');
s.val(s.cv);
}
@ -347,7 +346,6 @@
};
this._mouse = function (e) {
var mouseMove = function (e) {
var v = s.xy2val(e.pageX, e.pageY);
@ -367,23 +365,21 @@
.bind("mousemove.k", mouseMove)
.bind(
// Escape key cancel current change
"keyup.k"
, function (e) {
"keyup.k",
function (e) {
if (e.keyCode === 27) {
k.c.d.unbind("mouseup.k mousemove.k keyup.k");
if (
s.eH
&& (s.eH() === false)
) return;
if (s.eH && s.eH() === false)
return;
s.cancel();
}
}
)
.bind(
"mouseup.k"
, function (e) {
"mouseup.k",
function (e) {
k.c.d.unbind('mousemove.k mouseup.k keyup.k');
s.val(s.cv);
}
@ -396,26 +392,26 @@
var o = this.$c.offset();
this.x = o.left;
this.y = o.top;
return this;
};
this._listen = function () {
if (!this.o.readOnly) {
this.$c
.bind(
"mousedown"
, function (e) {
"mousedown",
function (e) {
e.preventDefault();
s._xy()._mouse(e);
}
}
)
.bind(
"touchstart"
, function (e) {
"touchstart",
function (e) {
e.preventDefault();
s._xy()._touch(e);
}
}
);
this.listen();
@ -423,10 +419,9 @@
this.$.attr('readonly', 'readonly');
}
if(this.relative) {
if (this.relative) {
$(window).resize(function() {
s._carve()
.init();
s._carve().init();
s._draw();
});
}
@ -456,8 +451,9 @@
this.$c[0].width = this.$c[0].width;
};
this._validate = function(v) {
return (~~ (((v < 0) ? -0.5 : 0.5) + (v/this.o.step))) * this.o.step;
this._validate = function (v) {
var val = (~~ (((v < 0) ? -0.5 : 0.5) + (v/this.o.step))) * this.o.step;
return Math.round(val * 100) / 100;
};
// Abstract methods
@ -474,14 +470,19 @@
this.h2rgba = function (h, a) {
var rgb;
h = h.substring(1,7)
rgb = [parseInt(h.substring(0,2),16)
,parseInt(h.substring(2,4),16)
,parseInt(h.substring(4,6),16)];
rgb = [
parseInt(h.substring(0,2), 16),
parseInt(h.substring(2,4), 16),
parseInt(h.substring(4,6), 16)
];
return "rgba(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + "," + a + ")";
};
this.copy = function (f, t) {
for (var i in f) { t[i] = f[i]; }
for (var i in f) {
t[i] = f[i];
}
};
};
@ -501,14 +502,12 @@
this.PI2 = 2*Math.PI;
this.extend = function () {
this.o = $.extend(
{
bgColor : this.$.data('bgcolor') || '#EEEEEE',
angleOffset : this.$.data('angleoffset') || 0,
angleArc : this.$.data('anglearc') || 360,
inline : true
}, this.o
);
this.o = $.extend({
bgColor: this.$.data('bgcolor') || '#EEEEEE',
angleOffset: this.$.data('angleoffset') || 0,
angleArc: this.$.data('anglearc') || 360,
inline: true
}, this.o);
};
this.val = function (v, triggerRelease) {
@ -517,10 +516,10 @@
// reverse format
v = this.o.parse(v);
if (
triggerRelease !== false && (v != this.v) && this.rH &&
(this.rH(v) === false)
) return;
if (triggerRelease !== false
&& v != this.v
&& this.rH
&& this.rH(v) === false) { return; }
this.cv = this.o.stopper ? max(min(v, this.o.max), this.o.min) : v;
this.v = this.cv;
@ -535,23 +534,23 @@
var a, ret;
a = Math.atan2(
x - (this.x + this.w2)
, - (y - this.y - this.w2)
x - (this.x + this.w2),
- (y - this.y - this.w2)
) - this.angleOffset;
if (this.o.flip) {
a = this.angleArc - a - this.PI2;
}
if(this.angleArc != this.PI2 && (a < 0) && (a > -0.5)) {
if (this.angleArc != this.PI2 && (a < 0) && (a > -0.5)) {
// if isset angleArc option, set to min if .5 under min
a = 0;
} else if (a < 0) {
a += this.PI2;
}
ret = ~~ (0.5 + (a * (this.o.max - this.o.min) / this.angleArc))
+ this.o.min;
ret = (a * (this.o.max - this.o.min) / this.angleArc) + this.o.min;
this.o.stopper && (ret = max(min(ret, this.o.max), this.o.min));
@ -559,60 +558,75 @@
};
this.listen = function () {
// bind MouseWheel
var s = this, mwTimerStop, mwTimerRelease,
var s = this, mwTimerStop,
mwTimerRelease,
mw = function (e) {
e.preventDefault();
var ori = e.originalEvent
,deltaX = ori.detail || ori.wheelDeltaX
,deltaY = ori.detail || ori.wheelDeltaY
,v = s._validate(s.o.parse(s.$.val()))
+ (deltaX>0 || deltaY>0 ? s.o.step : deltaX<0 || deltaY<0 ? -s.o.step : 0);
var ori = e.originalEvent,
deltaX = ori.detail || ori.wheelDeltaX,
deltaY = ori.detail || ori.wheelDeltaY,
v = s._validate(s.o.parse(s.$.val()))
+ (
deltaX > 0 || deltaY > 0
? s.o.step
: deltaX < 0 || deltaY < 0 ? -s.o.step : 0
);
v = max(min(v, s.o.max), s.o.min);
s.val(v, false);
if(s.rH) {
if (s.rH) {
// Handle mousewheel stop
clearTimeout(mwTimerStop);
mwTimerStop = setTimeout(function() {
mwTimerStop = setTimeout(function () {
s.rH(v);
mwTimerStop = null;
}, 100);
// Handle mousewheel releases
if(!mwTimerRelease) {
mwTimerRelease = setTimeout(function() {
if(mwTimerStop) s.rH(v);
if (!mwTimerRelease) {
mwTimerRelease = setTimeout(function () {
if (mwTimerStop)
s.rH(v);
mwTimerRelease = null;
}, 200);
}
}
}
, kval, to, m = 1, kv = {37:-s.o.step, 38:s.o.step, 39:s.o.step, 40:-s.o.step};
},
kval,
to,
m = 1,
kv = {
37: -s.o.step,
38: s.o.step,
39: s.o.step,
40: -s.o.step
};
this.$
.bind(
"keydown"
,function (e) {
"keydown",
function (e) {
var kc = e.keyCode;
// numpad support
if(kc >= 96 && kc <= 105) {
if (kc >= 96 && kc <= 105) {
kc = e.keyCode = kc - 48;
}
kval = parseInt(String.fromCharCode(kc));
if (isNaN(kval)) {
(kc !== 13) // enter
&& (kc !== 8) // bs
&& (kc !== 9) // tab
&& (kc !== 189) // -
&& (kc !== 190 || s.$.val().match(/\./)) // . only allowed once
(kc !== 13) // enter
&& kc !== 8 // bs
&& kc !== 9 // tab
&& kc !== 189 // -
&& (kc !== 190
|| s.$.val().match(/\./)) // . allowed once
&& e.preventDefault();
// arrows
@ -622,20 +636,20 @@
var v = s.o.parse(s.$.val()) + kv[kc] * m;
s.o.stopper && (v = max(min(v, s.o.max), s.o.min));
s.change(v);
s.change(s._validate(v));
s._draw();
// long time keydown speed-up
to = window.setTimeout(
function () { m *= 2; }, 30
);
to = window.setTimeout(function () {
m *= 2;
}, 30);
}
}
}
)
.bind(
"keyup"
,function (e) {
"keyup",
function (e) {
if (isNaN(kval)) {
if (to) {
window.clearTimeout(to);
@ -648,7 +662,6 @@
(s.$.val() > s.o.max && s.$.val(s.o.max))
|| (s.$.val() < s.o.min && s.$.val(s.o.min));
}
}
);
@ -657,11 +670,8 @@
};
this.init = function () {
if (
this.v < this.o.min
|| this.v > this.o.max
) this.v = this.o.min;
if (this.v < this.o.min
|| this.v > this.o.max) { this.v = this.o.min; }
this.$.val(this.v);
this.w2 = this.w / 2;
@ -686,30 +696,29 @@
this.endAngle = 1.5 * Math.PI + this.angleOffset + this.angleArc;
var s = max(
String(Math.abs(this.o.max)).length
, String(Math.abs(this.o.min)).length
, 2
) + 2;
String(Math.abs(this.o.max)).length,
String(Math.abs(this.o.min)).length,
2
) + 2;
this.o.displayInput
&& this.i.css({
'width' : ((this.w / 2 + 4) >> 0) + 'px'
,'height' : ((this.w / 3) >> 0) + 'px'
,'position' : 'absolute'
,'vertical-align' : 'middle'
,'margin-top' : ((this.w / 3) >> 0) + 'px'
,'margin-left' : '-' + ((this.w * 3 / 4 + 2) >> 0) + 'px'
,'border' : 0
,'background' : 'none'
,'font' : this.o.fontWeight + ' ' + ((this.w / s) >> 0) + 'px ' + this.o.font
,'text-align' : 'center'
,'color' : this.o.inputColor || this.o.fgColor
,'padding' : '0px'
,'-webkit-appearance': 'none'
})
|| this.i.css({
'width' : '0px'
,'visibility' : 'hidden'
'width' : ((this.w / 2 + 4) >> 0) + 'px',
'height' : ((this.w / 3) >> 0) + 'px',
'position' : 'absolute',
'vertical-align' : 'middle',
'margin-top' : ((this.w / 3) >> 0) + 'px',
'margin-left' : '-' + ((this.w * 3 / 4 + 2) >> 0) + 'px',
'border' : 0,
'background' : 'none',
'font' : this.o.fontWeight + ' ' + ((this.w / s) >> 0) + 'px ' + this.o.font,
'text-align' : 'center',
'color' : this.o.inputColor || this.o.fgColor,
'padding' : '0px',
'-webkit-appearance': 'none'
}) || this.i.css({
'width': '0px',
'visibility': 'hidden'
});
};
@ -735,6 +744,7 @@
this.o.cursor
&& (sa = ea - this.cursorExt)
&& (ea = ea + this.cursorExt);
return {
s: sa,
e: ea,
@ -743,30 +753,33 @@
};
this.draw = function () {
var c = this.g, // context
a = this.arc(this.cv) // Arc
, pa // Previous arc
, r = 1;
a = this.arc(this.cv), // Arc
pa, // Previous arc
r = 1;
c.lineWidth = this.lineWidth;
c.lineCap = this.lineCap;
c.strokeStyle = this.o.bgColor;
c.arc(this.xy, this.xy, this.radius, this.endAngle - 0.00001, this.startAngle + 0.00001, true);
c.stroke();
if (this.o.bgColor !== "none") {
c.beginPath();
c.strokeStyle = this.o.bgColor;
c.arc(this.xy, this.xy, this.radius, this.endAngle - 0.00001, this.startAngle + 0.00001, true);
c.stroke();
}
if (this.o.displayPrevious) {
pa = this.arc(this.v);
c.beginPath();
c.strokeStyle = this.pColor;
c.arc(this.xy, this.xy, this.radius, pa.s, pa.e, pa.d);
c.strokeStyle = this.pColor;
c.arc(this.xy, this.xy, this.radius, pa.s, pa.e, pa.d);
c.stroke();
r = (this.cv == this.v);
r = this.cv == this.v;
}
c.beginPath();
c.strokeStyle = r ? this.o.fgColor : this.fgColor ;
c.arc(this.xy, this.xy, this.radius, a.s, a.e, a.d);
c.strokeStyle = r ? this.o.fgColor : this.fgColor ;
c.arc(this.xy, this.xy, this.radius, a.s, a.e, a.d);
c.stroke();
};
@ -786,4 +799,4 @@
).parent();
};
})(jQuery);
}));

View File

@ -9,7 +9,7 @@ class Config
{
$this->_checkPHPVersion(5.3);
$this->file = __DIR__.'/../../esm.config.json';
$this->file = __DIR__.'/../../conf/esm.config.json';
if (!file_exists($this->file))
throw new \Exception('Config file '.basename($this->file).' not found');
@ -47,7 +47,8 @@ class Config
}
}
return $tab == $this->config ? null : $tab;
// return $tab == $this->config ? null : $tab;
return $tab;
}

View File

@ -4,6 +4,10 @@ class Misc
{
/**
* Returns human size
*
* @param float $filesize File size
* @param int $precision Number of decimals
* @return string Human size
*/
public static function getSize($filesize, $precision = 2)
{
@ -23,6 +27,8 @@ class Misc
/**
* Returns hostname
*
* @return string Hostname
*/
public static function getHostname()
{
@ -32,6 +38,8 @@ class Misc
/**
* Returns CPU cores number
*
* @return int Number of cores
*/
public static function getCpuCoresNumber()
{
@ -52,6 +60,8 @@ class Misc
/**
* Returns server IP
*
* @return string Server local IP
*/
public static function getLanIp()
{
@ -61,6 +71,11 @@ class Misc
/**
* Returns a command that exists in the system among $cmds
*
* @param array $cmds List of commands
* @param string $args List of arguments (optional)
* @param bool $returnWithArgs If true, returns command with the arguments
* @return string Command
*/
public static function whichCommand($cmds, $args = '', $returnWithArgs = true)
{
@ -89,14 +104,61 @@ class Misc
* Ex : echo 'cheva'.Misc::pluralize(5, 'ux', 'l'); ==> prints chevaux
* Ex : echo 'cheva'.Misc::pluralize(1, 'ux', 'l'); ==> prints cheval
*
* @param int $nb
* @param string $plural
* @param string $singular
*
* @return string
* @param int $nb Number
* @param string $plural String for plural word
* @param string $singular String for singular word
* @return string String pluralized
*/
public static function pluralize($nb, $plural = 's', $singular = '')
{
return $nb > 1 ? $plural : $singular;
}
/**
* Checks if a port is open (TCP or UPD)
*
* @param string $host Host to check
* @param int $port Port number
* @param string $protocol tcp or udp
* @param integer $timeout Timeout
* @return bool True if the port is open else false
*/
public static function scanPort($host, $port, $protocol = 'tcp', $timeout = 3)
{
if ($protocol == 'tcp')
{
$handle = @fsockopen($host, $port, $errno, $errstr, $timeout);
if ($handle)
return true;
else
return false;
}
elseif ($protocol == 'udp')
{
$handle = @fsockopen('udp://'.$host, $port, $errno, $errstr, $timeout);
socket_set_timeout($handle, $timeout);
$write = fwrite($handle, 'x00');
$startTime = time();
$header = fread($handle, 1);
$endTime = time();
$timeDiff = $endTime - $startTime;
fclose($handle);
if ($timeDiff >= $timeout)
return true;
else
return false;
}
return false;
}
}

View File

@ -1,5 +1,6 @@
<?php
require 'Utils/Misc.class.php';
require '../autoload.php';
$Config = new Config();
// Number of cores
$num_cores = Misc::getCpuCoresNumber();
@ -10,6 +11,7 @@ $model = 'N.A';
$frequency = 'N.A';
$cache = 'N.A';
$bogomips = 'N.A';
$temp = 'N.A';
if ($cpuinfo = shell_exec('cat /proc/cpuinfo'))
{
@ -50,6 +52,32 @@ if ($cpuinfo = shell_exec('cat /proc/cpuinfo'))
}
}
if ($frequency == 'N.A')
{
if ($f = shell_exec('cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq'))
{
$f = $f / 1000;
$frequency = $f.' MHz';
}
}
// CPU Temp
if ($Config->get('cpu:enable_temperature'))
{
if (exec('/usr/bin/sensors | grep -E "^(CPU Temp|Core 0)" | cut -d \'+\' -f2 | cut -d \'.\' -f1', $t))
{
if (isset($t[0]))
$temp = $t[0].' °C';
}
else
{
if (exec('cat /sys/class/thermal/thermal_zone0/temp', $t))
{
$temp = round($t[0] / 1000).' °C';
}
}
}
$datas = array(
'model' => $model,
@ -57,6 +85,7 @@ $datas = array(
'frequency' => $frequency,
'cache' => $cache,
'bogomips' => $bogomips,
'temp' => $temp,
);
echo json_encode($datas);

View File

@ -1,6 +1,5 @@
<?php
require 'Utils/Misc.class.php';
require 'Utils/Config.class.php';
require '../autoload.php';
$Config = new Config();
$datas = array();

View File

@ -1,5 +1,5 @@
<?php
require 'Utils/Config.class.php';
require '../autoload.php';
$Config = new Config();

View File

@ -1,5 +1,5 @@
<?php
require 'Utils/Misc.class.php';
require '../autoload.php';
if (!($load_tmp = shell_exec('cat /proc/loadavg | awk \'{print $1","$2","$3}\'')))
{

View File

@ -1,5 +1,5 @@
<?php
require 'Utils/Misc.class.php';
require '../autoload.php';
$free = 0;
@ -22,7 +22,9 @@ if (!($total = shell_exec('grep MemTotal /proc/meminfo | awk \'{print $2}\'')))
$used = $total - $free;
// Percent used
$percent_used = 100 - (round($free / $total * 100));
$percent_used = 0;
if ($total > 0)
$percent_used = 100 - (round($free / $total * 100));
$datas = array(

View File

@ -1,10 +1,9 @@
<?php
require 'Utils/Misc.class.php';
require '../autoload.php';
$datas = array();
$network = array();
// Possible commands for ifconfig and ip
$commands = array(
'ifconfig' => array('ifconfig', '/sbin/ifconfig', '/usr/bin/ifconfig', '/usr/sbin/ifconfig'),

View File

@ -1,5 +1,5 @@
<?php
require 'Utils/Config.class.php';
require '../autoload.php';
$Config = new Config();

View File

@ -1,35 +1,33 @@
<?php
require 'Utils/Config.class.php';
require '../autoload.php';
$Config = new Config();
$datas = array();
if (count($Config->get('services')) > 0)
$available_protocols = array('tcp', 'udp');
$show_port = $Config->get('services:show_port');
if (count($Config->get('services:list')) > 0)
{
foreach ($Config->get('services') as $service)
foreach ($Config->get('services:list') as $service)
{
$host = $service['host'];
$sock = @fsockopen($host, $service['port'], $num, $error, 5);
if ($sock)
{
$datas[] = array(
'port' => $service['port'],
'name' => $service['name'],
'status' => 1,
);
fclose($sock);
}
$host = $service['host'];
$port = $service['port'];
$name = $service['name'];
$protocol = isset($service['protocol']) && in_array($service['protocol'], $available_protocols) ? $service['protocol'] : 'tcp';
if (Misc::scanPort($host, $port, $protocol))
$status = 1;
else
{
$datas[] = array(
'port' => $service['port'],
'name' => $service['name'],
'status' => 0,
);
}
$status = 0;
$datas[] = array(
'port' => $show_port === true ? $port : '',
'name' => $name,
'status' => $status,
);
}
}

View File

@ -1,5 +1,5 @@
<?php
require 'Utils/Misc.class.php';
require '../autoload.php';
// Free
if (!($free = shell_exec('grep SwapFree /proc/meminfo | awk \'{print $2}\'')))
@ -17,7 +17,9 @@ if (!($total = shell_exec('grep SwapTotal /proc/meminfo | awk \'{print $2}\'')))
$used = $total - $free;
// Percent used
$percent_used = 100 - (round($free / $total * 100));
$percent_used = 0;
if ($total > 0)
$percent_used = 100 - (round($free / $total * 100));
$datas = array(

View File

@ -1,5 +1,5 @@
<?php
require 'Utils/Misc.class.php';
require '../autoload.php';
// Hostname
$hostname = php_uname('n');
@ -9,7 +9,7 @@ if (!($os = shell_exec('/usr/bin/lsb_release -ds | cut -d= -f2 | tr -d \'"\'')))
{
if(!($os = shell_exec('cat /etc/system-release | cut -d= -f2 | tr -d \'"\'')))
{
if (!($os = shell_exec('find /etc/*-release -type f -exec cat {} \; | grep NAME | tail -n 1 | cut -d= -f2 | tr -d \'"\'')))
if (!($os = shell_exec('find /etc/*-release -type f -exec cat {} \; | grep PRETTY_NAME | tail -n 1 | cut -d= -f2 | tr -d \'"\'')))
{
$os = 'N.A';
}

View File

@ -1,26 +1,27 @@
/* Buttons */
$button-default-color: #c5c5c5;
$button-red: #ff0000;
$button-orange: #fe9c43;
$button-purple: #9a68c7;
$button-blue: #3ba9e4;
$button-green: #75b343;
$button-black: #4b4b4b;
$button-salmon: #F5AD9E;
@import "_config.frontend";
/* Labels */
$label-default: #bfbfbf;
$label-success: #46a546;
$label-warning: #f89406;
$label-important: #c43c35;
$label-notice: #62cffc;
$label-border-radius: 3px;
$label-font-size: 10px;
$label: (
types: (
default: #bfbfbf,
success: #46a546,
warning: #f89406,
important: #c43c35,
error: #c43c35,
notice: #62cffc
),
border-radius: 3px,
font-size: 10px
);
/* Classic box */
$classic-box-color: darken(#99AEC4, 7%);
$classic-box-background: #fff;
$classic-box-border: lighten(#99AEC4, 16%);
$classic-box-header-height: 35px;
$classic-box-title-color: #fff;
$classic-box-title-fontsize: 14px;
$classic-box: (
color: darken($main-color, 7%),
background: #fff,
border-color: lighten($main-color, 16%),
header: (
height: 35px,
color: #fff,
font-size: 14px
)
);

View File

@ -15,22 +15,29 @@
}
}
@mixin letterpress($opacity) {
text-shadow: rgba(255, 255, 255, $opacity) 0 1px 0;
}
@mixin hide-text {
font: 0/0 a;
text-shadow: none;
color: transparent;
}
@mixin link-colors($normal, $hover: $normal, $visited: $normal) {
color: $normal;
&:hover, &:focus {
color: $hover;
@function map-get-deep($map, $keys...) {
@if length($keys) == 1 {
$keys: nth($keys, 1);
}
&:visited {
color: $visited;
$warn: "#{nth($keys, 1)}";
$length: length($keys);
$get: map-get($map, nth($keys, 1));
@if $length > 1 {
@for $i from 2 through $length {
@if $get != null and type-of($get) == 'map' {
$warn: $warn + "->#{nth($keys, $i)}";
$get: map-get($get, nth($keys, $i));
@if $get == null {
@return map-get-deep-warning($warn, $get);
}
}
@else {
@return map-get-deep-warning($warn, $get);
}
}
}
}
@return $get;
}

View File

@ -52,7 +52,7 @@ nav[role="main"] {
#appname {
float: left;
width: 120px;
width: 150px;
text-align: left;
a {
@ -231,6 +231,35 @@ table.firstBold tbody tr td:first-child {
}
/* --------------------------- */
/* == Reload style */
/* --------------------------- */
.reload.spin {
@include animation(spin 2000ms infinite linear);
}
@-ms-keyframes spin {
from { -ms-transform: rotate(0deg); }
to { -ms-transform: rotate(360deg); }
}
@-moz-keyframes spin {
from { -moz-transform: rotate(0deg); }
to { -moz-transform: rotate(360deg); }
}
@-webkit-keyframes spin {
from { -webkit-transform: rotate(0deg); }
to { -webkit-transform: rotate(360deg); }
}
@keyframes spin {
from {
transform:rotate(0deg);
}
to {
transform:rotate(360deg);
}
}
/* --------------------------- */
/* == Load Average */
/* --------------------------- */
@ -239,3 +268,55 @@ table.firstBold tbody tr td:first-child {
font-weight: normal;
}
}
/* ------------------------- */
/* == Responsive */
/* ------------------------- */
@media only screen and (max-width: 1024px) {
.column-left, .column-right {
float: none;
width: 100%;
}
.box {
width: 100%;
margin-right: 0 !important;
margin-left: 0 !important;
}
}
@media only screen and (max-width: 550px) {
nav[role="main"] {
#appname {
width: 135px;
}
#hostname {
margin-left: 0;
font-size: 12px;
}
#update {
margin-left: 0;
font-size: 9px;
position: absolute;
top: 47px;
line-height: inherit;
}
ul > li {
> a {
padding: 12px 0;
}
}
}
.box#esm-load_average {
div {
width: 100%;
float: none;
}
}
}

View File

@ -6,8 +6,7 @@
/* -------------------- */
/* == Fonts */
/* -------------------- */
@include font-face('OpenSans-Light', font-files('OpenSans-Light.ttf'));
@include font-face('OpenSans-Light', font-files('OpenSans-Light.ttf', 'OpenSans-Light.svg', 'OpenSans-Light.woff'), 'OpenSans-Light.eot');
@include font-face('Entypo', font-files('entypo.ttf', 'entypo.eot', 'entypo.svg', 'entypo.woff'));
@import "../libs/_icons.entypo";
@ -15,7 +14,6 @@
/* ------------------- */
/* == Misc */
/* ------------------- */
* { padding: 0; margin: 0; }
*:focus { outline: none; }
@ -37,11 +35,6 @@ img { border: 0; }
.debug { border: 1px solid red; }
.u { text-decoration: underline; }
.b { font-weight: bold; }
.i { font-style: italic; }
.r { text-decoration: line-through; }
.text_left, .t-left { text-align: left; }
.text_right, .t-right { text-align: right !important; }
.text_center, .t-center { text-align: center; }
@ -65,9 +58,6 @@ img { border: 0; }
width: 66%;
}
.m-l-10 { margin-left: 10px; }
.m-r-10 { margin-right: 10px; }
/*pre {
background-color: #fafafa;
@ -83,32 +73,6 @@ img { border: 0; }
.w50p { width: 50%; }
.w100p { width: 100%; }
.w30 { width: 30px; }
.w50 { width: 50px; }
.w60 { width: 60px; }
.w70 { width: 70px; }
.w75 { width: 75px; }
.w90 { width: 90px; }
.w100 { width: 100px; }
.w110 { width: 110px; }
.w120 { width: 120px; }
.w130 { width: 130px; }
.w150 { width: 150px; }
.w180 { width: 180px; }
.w200 { width: 200px; }
.w220 { width: 220px; }
.w250 { width: 250px; }
.w300 { width: 300px; }
.w350 { width: 350px; }
.w400 { width: 400px; }
.w450 { width: 450px; }
.w500 { width: 500px; }
.w600 { width: 600px; }
.w700 { width: 700px; }
.w800 { width: 800px; }
.w900 { width: 900px; }
.w1000 { width: 1000px; }
/* ------------------------ */
/* == Scrollbar */

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

View File

@ -1 +1 @@
html{height:100%}body{font-size:14px;font-family:OpenSans-Light, Verdana, sans-serif, Arial;margin:0 auto;color:#4d5157;background-color:#fff}a{color:#99aec4}a:hover{color:#a9bbcd;text-decoration:none}::-moz-selection{background-color:#7994b1;color:#fafbfc}::selection{background-color:#7994b1;color:#fafbfc}nav[role="main"]{position:fixed;top:0;left:0;right:0;background-color:#99aec4;height:60px;width:100%;padding-left:5px;color:#fff;font-size:16px;text-align:center;z-index:2}nav[role="main"] #appname{float:left;width:120px;text-align:left}nav[role="main"] #appname a{color:#fff;text-decoration:none}nav[role="main"] #appname a:first-child{font-size:24px}nav[role="main"] #appname a:first-child span[class^="icon-"]{font-size:30px;margin-right:10px}nav[role="main"] #appname a:last-child{display:block;font-size:11px;font-style:italic}nav[role="main"] #hostname{float:left;margin-left:110px;line-height:60px}nav[role="main"] #update{float:left;margin-left:100px;line-height:60px;font-size:13px}nav[role="main"] #update a{color:#fff}nav[role="main"]>ul{text-align:right;list-style-type:none}nav[role="main"]>ul>li{display:inline-block}nav[role="main"]>ul>li>a{display:inline-block;padding:13px 15px;color:#fff;text-decoration:none;-webkit-transition:background 300ms ease-in-out;-moz-transition:background 300ms ease-in-out;-o-transition:background 300ms ease-in-out;transition:background 300ms ease-in-out}nav[role="main"]>ul>li>a:hover{background:#acbdcf;-webkit-transition:background 300ms ease-in-out;-moz-transition:background 300ms ease-in-out;-o-transition:background 300ms ease-in-out;transition:background 300ms ease-in-out}nav[role="main"]>ul>li>a>span[class^="icon-"]{font-size:30px}#main-container{overflow:auto;margin-top:60px;background-color:#fff;padding:20px 25px}ul.list{margin-left:20px;list-style-type:none}ul.list li{position:relative;padding-left:12px}ul.list li:before{content:'';width:5px;height:5px;background-color:#99aec4;position:absolute;left:0;top:9px}table:not(.no-style){width:100%;border-collapse:collapse;border-spacing:0;font-size:13px}table:not(.no-style) tr{border-bottom:1px solid #ebebeb;border-top:1px solid #fff}table:not(.no-style) thead tr{border-top:none}table:not(.no-style) tbody tr:last-child{border-bottom:none}table:not(.no-style) tbody tr:nth-child(odd){background:#f2f2f2}table:not(.no-style) tbody tr td,table:not(.no-style) thead tr th{padding:6px 8px;position:relative;text-align:left}table:not(.no-style) tbody tr td:last-child,table:not(.no-style) thead tr th:last-child{border-right:none}table:not(.no-style) tbody tr td:first-child,table:not(.no-style) thead tr th:first-child{border-left:none}table:not(.no-style) thead{color:#898989;font-size:13px;font-weight:bold}table:not(.no-style) thead tr th{text-align:center}table:not(.no-style) tbody tr:hover{background:#eaeef3}table.firstBold tbody tr td:first-child{font-weight:bold;color:#7e848c}.progressbar-wrap{width:100%;background-color:rgba(153,174,196,0.2)}.progressbar-wrap .progressbar{text-indent:5px}.progressbar-wrap .progressbar.green{background-color:#7BCE6C}.progressbar-wrap .progressbar.orange{background-color:#E3BB80}.progressbar-wrap .progressbar.red{background-color:#CF6B6B}.box#esm-load_average h3{font-weight:normal}
html{height:100%}body{font-size:14px;font-family:OpenSans-Light, Verdana, sans-serif, Arial;margin:0 auto;color:#4D5157;background-color:#fff}a{color:#99AEC4}a:hover{color:#a9bbcd;text-decoration:none}::-moz-selection{background-color:#7994b1;color:#fafbfc}::selection{background-color:#7994b1;color:#fafbfc}nav[role="main"]{position:fixed;top:0;left:0;right:0;background-color:#99AEC4;height:60px;width:100%;padding-left:5px;color:#fff;font-size:16px;text-align:center;z-index:2}nav[role="main"] #appname{float:left;width:150px;text-align:left}nav[role="main"] #appname a{color:#fff;text-decoration:none}nav[role="main"] #appname a:first-child{font-size:24px}nav[role="main"] #appname a:first-child span[class^="icon-"]{font-size:30px;margin-right:10px}nav[role="main"] #appname a:last-child{display:block;font-size:11px;font-style:italic}nav[role="main"] #hostname{float:left;margin-left:110px;line-height:60px}nav[role="main"] #update{float:left;margin-left:100px;line-height:60px;font-size:13px}nav[role="main"] #update a{color:#fff}nav[role="main"]>ul{text-align:right;list-style-type:none}nav[role="main"]>ul>li{display:inline-block}nav[role="main"]>ul>li>a{display:inline-block;padding:13px 15px;color:#fff;text-decoration:none;-moz-transition:background 300ms ease-in-out;-o-transition:background 300ms ease-in-out;-webkit-transition:background 300ms ease-in-out;transition:background 300ms ease-in-out}nav[role="main"]>ul>li>a:hover{background:#acbdcf;-moz-transition:background 300ms ease-in-out;-o-transition:background 300ms ease-in-out;-webkit-transition:background 300ms ease-in-out;transition:background 300ms ease-in-out}nav[role="main"]>ul>li>a>span[class^="icon-"]{font-size:30px}#main-container{overflow:auto;margin-top:60px;background-color:#fff;padding:20px 25px}ul.list{margin-left:20px;list-style-type:none}ul.list li{position:relative;padding-left:12px}ul.list li:before{content:'';width:5px;height:5px;background-color:#99AEC4;position:absolute;left:0;top:9px}table:not(.no-style){width:100%;border-collapse:collapse;border-spacing:0;font-size:13px}table:not(.no-style) tr{border-bottom:1px solid #ebebeb;border-top:1px solid #fff}table:not(.no-style) thead tr{border-top:none}table:not(.no-style) tbody tr:last-child{border-bottom:none}table:not(.no-style) tbody tr:nth-child(odd){background:#f2f2f2}table:not(.no-style) tbody tr td,table:not(.no-style) thead tr th{padding:6px 8px;position:relative;text-align:left}table:not(.no-style) tbody tr td:last-child,table:not(.no-style) thead tr th:last-child{border-right:none}table:not(.no-style) tbody tr td:first-child,table:not(.no-style) thead tr th:first-child{border-left:none}table:not(.no-style) thead{color:#898989;font-size:13px;font-weight:bold}table:not(.no-style) thead tr th{text-align:center}table:not(.no-style) tbody tr:hover{background:#eaeef3}table.firstBold tbody tr td:first-child{font-weight:bold;color:#7e848c}.progressbar-wrap{width:100%;background-color:rgba(153,174,196,0.2)}.progressbar-wrap .progressbar{text-indent:5px}.progressbar-wrap .progressbar.green{background-color:#7BCE6C}.progressbar-wrap .progressbar.orange{background-color:#E3BB80}.progressbar-wrap .progressbar.red{background-color:#CF6B6B}.reload.spin{-moz-animation:spin 2000ms infinite linear;-webkit-animation:spin 2000ms infinite linear;animation:spin 2000ms infinite linear}@-ms-keyframes spin{from{-ms-transform:rotate(0deg)}to{-ms-transform:rotate(360deg)}}@-moz-keyframes spin{from{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(360deg)}}@-webkit-keyframes spin{from{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}.box#esm-load_average h3{font-weight:normal}@media only screen and (max-width: 1024px){.column-left,.column-right{float:none;width:100%}.box{width:100%;margin-right:0 !important;margin-left:0 !important}}@media only screen and (max-width: 550px){nav[role="main"] #appname{width:135px}nav[role="main"] #hostname{margin-left:0;font-size:12px}nav[role="main"] #update{margin-left:0;font-size:9px;position:absolute;top:47px;line-height:inherit}nav[role="main"] ul>li>a{padding:12px 0}.box#esm-load_average div{width:100%;float:none}}

View File

@ -1,28 +1,28 @@
@import "compass";
.box {
background: $classic-box-background;
box-shadow: 3px 3px 0 rgba($classic-box-border, .6);
background: map-get($classic-box, background);
box-shadow: 3px 3px 0 rgba(map-get($classic-box, border-color), .6);
margin-bottom: 15px;
border: 1px solid $classic-box-border;
border: 1px solid map-get($classic-box, border-color);
padding: 2px;
.box-header {
background-color: $classic-box-color;
height: $classic-box-header-height;
background-color: map-get($classic-box, color);
height: map-get-deep($classic-box, header, height);
h1 {
color: $classic-box-title-color;
color: map-get-deep($classic-box, header, color);
float: left;
font-size: $classic-box-title-fontsize;
font-size: map-get-deep($classic-box, header, font-size);
font-weight: bold;
line-height: $classic-box-header-height - 2px;
line-height: map-get-deep($classic-box, header, height) - 2px;
padding-left: 10px;
text-transform: uppercase;
/*text-shadow: rgba(0, 0, 0, 1) 0 1px 0;*/
&:first-letter {
font-size: $classic-box-title-fontsize + 6px;
font-size: map-get-deep($classic-box, header, font-size) + 6px;
}
}
ul {
@ -34,20 +34,20 @@
margin-left: -3px;
a {
color: lighten($classic-box-title-color, 10%);
font-size: $classic-box-title-fontsize + 6px;
line-height: $classic-box-header-height;
color: lighten(map-get-deep($classic-box, header, color), 10%);
font-size: map-get-deep($classic-box, header, font-size) + 6px;
line-height: map-get-deep($classic-box, header, height);
padding: 4px 10px;
text-decoration: none;
&:hover:not(.disabled) {
background: lighten($classic-box-color, 20%);
color: $classic-box-color !important;
background: lighten(map-get($classic-box, color), 20%);
color: map-get($classic-box, color) !important;
}
&.disabled {
opacity: .4;
/*opacity: .4;*/
&:hover {
cursor: default;
@ -74,12 +74,16 @@
table a {
text-decoration: none;
color: $classic-box-color;
color: map-get($classic-box, color);
&:hover {
color: lighten($classic-box-color, 20%);
color: lighten(map-get($classic-box, color), 20%);
}
}
&.faded {
opacity: .4;
}
}
.box-footer {

View File

@ -2,24 +2,17 @@
span.label {
padding: 1px 3px 2px;
font-size: $label-font-size;
font-size: map-get($label, font-size);
font-weight: bold;
color: #fff;
text-transform: uppercase;
white-space: nowrap;
background-color: $label-default;
@include border-radius($label-border-radius);
&.success {
background-color: $label-success;
}
&.warning {
background-color: $label-warning;
}
&.important, &.error {
background-color: $label-important;
}
&.notice {
background-color: $label-notice;
background-color: map-get-deep($label, types, default);
@include border-radius(map-get($label, border-radius));
@each $name, $color in map-get($label, types) {
&.#{""+$name+""} {
background-color: $color;
}
}
}

File diff suppressed because one or more lines are too long