/usr/lib/python3/dist-packages/glances/outputs/static/js/services/plugins/glances_cpu.js is in glances 2.7.1.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | glancesApp.service('GlancesPluginCpu', function() {
var _pluginName = "cpu";
var _view = {};
this.total = null;
this.user = null;
this.system = null;
this.idle = null;
this.nice = null;
this.irq = null;
this.iowait = null;
this.steal = null;
this.ctx_switches = null;
this.interrupts = null;
this.soft_interrupts = null;
this.syscalls = null;
this.setData = function(data, views) {
data = data[_pluginName];
_view = views[_pluginName];
this.total = data.total;
this.user = data.user;
this.system = data.system;
this.idle = data.idle;
this.nice = data.nice;
this.irq = data.irq;
this.iowait = data.iowait;
this.steal = data.steal;
if (data.ctx_switches) {
this.ctx_switches = Math.floor(data.ctx_switches / data.time_since_update);
}
if (data.interrupts) {
this.interrupts = Math.floor(data.interrupts / data.time_since_update);
}
if (data.soft_interrupts) {
this.soft_interrupts = Math.floor(data.soft_interrupts / data.time_since_update);
}
if (data.syscalls) {
this.syscalls = Math.floor(data.syscalls / data.time_since_update);
}
}
this.getDecoration = function(value) {
if(_view[value] == undefined) {
return;
}
return _view[value].decoration.toLowerCase();
}
});
|