Merge pull request #1472 from notFloran/webui-fix-isLinux

[WebUI] Fix use of isLinux
This commit is contained in:
Nicolas Hennion 2019-04-20 11:23:32 +02:00 committed by GitHub
commit 68d10873bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 42 additions and 18 deletions

View File

@ -28,6 +28,8 @@ export default function GlancesPluginCpuController($scope, GlancesStats) {
var stats = data.stats['cpu'];
_view = data.views['cpu'];
vm.isLinux = data.isLinux;
vm.total = stats.total;
vm.user = stats.user;
vm.system = stats.system;

View File

@ -72,7 +72,7 @@
{{ vm.soft_interrupts }}
</div>
</div>
<div class="table-row" ng-if="!statsSystem.isLinux() && vm.syscalls">
<div class="table-row" ng-if="!vm.isLinux && vm.syscalls">
<div class="table-cell text-left">syscal:</div>
<div class="table-cell">
{{ vm.syscalls }}

View File

@ -25,6 +25,7 @@ export default function GlancesPluginSystemController($scope, GlancesStats) {
var loadData = function (data) {
var stats = data.stats['system'];
vm.isLinux = data.isLinux;
vm.hostname = stats['hostname'];
vm.platform = stats['platform'];
vm.os.name = stats['os_name'];

View File

@ -1,7 +1,6 @@
<section id="system">
<span ng-if="vm.isDisconnected" class="critical">Disconnected from</span>
<span class="title">{{ vm.hostname }}</span>
<span ng-if="vm.stats.isLinux" class="hidden-xs hidden-sm">({{ vm.humanReadableName }} / {{ vm.os.name }} {{ vm.os.version }})</span>
<span ng-if="!vm.stats.isLinux"
class="hidden-xs hidden-sm">({{ vm.os.name }} {{ vm.os.version }} {{ vm.platform }})</span>
<span ng-if="vm.isLinux" class="hidden-xs hidden-sm">({{ vm.humanReadableName }} / {{ vm.os.name }} {{ vm.os.version }})</span>
<span ng-if="!vm.isLinux" class="hidden-xs hidden-sm">({{ vm.os.name }} {{ vm.os.version }} {{ vm.platform }})</span>
</section>

View File

@ -2003,7 +2003,8 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"aproba": {
"version": "1.2.0",
@ -2024,12 +2025,14 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -2044,17 +2047,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
@ -2171,7 +2177,8 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"ini": {
"version": "1.3.5",
@ -2183,6 +2190,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@ -2197,6 +2205,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@ -2204,12 +2213,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"minipass": {
"version": "2.2.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.1",
"yallist": "^3.0.0"
@ -2228,6 +2239,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@ -2308,7 +2320,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
@ -2320,6 +2333,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@ -2405,7 +2419,8 @@
"safe-buffer": {
"version": "5.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
@ -2441,6 +2456,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@ -2460,6 +2476,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@ -2503,12 +2520,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"yallist": {
"version": "3.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
}
}
},

View File

@ -40468,6 +40468,8 @@ function GlancesPluginCpuController($scope, GlancesStats) {
var stats = data.stats['cpu'];
_view = data.views['cpu'];
vm.isLinux = data.isLinux;
vm.total = stats.total;
vm.user = stats.user;
vm.system = stats.system;
@ -40509,7 +40511,7 @@ function GlancesPluginCpuController($scope, GlancesStats) {
/***/ (function(module, exports) {
var path = '/Users/floranbrutel/dev/glances/glances/outputs/static/js/components/plugin-cpu/view.html';
var html = "<section id=\"cpu\" class=\"plugin\">\n <div class=\"row\">\n <div class=\"col-sm-24 col-md-12 col-lg-8\">\n <div class=\"table\">\n <div class=\"table-row\">\n <div class=\"table-cell text-left title\">CPU</div>\n <div class=\"table-cell\">{{ vm.total }}%</div>\n </div>\n <div class=\"table-row\">\n <div class=\"table-cell text-left\">user:</div>\n <div class=\"table-cell\" ng-class=\"vm.getDecoration('user')\">\n {{ vm.user }}%\n </div>\n </div>\n <div class=\"table-row\">\n <div class=\"table-cell text-left\">system:</div>\n <div class=\"table-cell\" ng-class=\"vm.getDecoration('system')\">\n {{ vm.system }}%\n </div>\n </div>\n <div class=\"table-row\">\n <div class=\"table-cell text-left\">idle:</div>\n <div class=\"table-cell\">{{ vm.idle }}%</div>\n </div>\n </div>\n </div>\n <div class=\"hidden-xs hidden-sm col-md-12 col-lg-8\">\n <div class=\"table\">\n <div class=\"table-row\" ng-show=\"vm.nice != undefined\">\n <div class=\"table-cell text-left\">nice:</div>\n <div class=\"table-cell\">\n {{ vm.nice }}%\n </div>\n </div>\n <div class=\"table-row\" ng-show=\"vm.irq != undefined\">\n <div class=\"table-cell text-left\">irq:</div>\n <div class=\"table-cell\">\n {{ vm.irq }}%\n </div>\n </div>\n <div class=\"table-row\" ng-show=\"vm.iowait != undefined\">\n <div class=\"table-cell text-left\">iowait:</div>\n <div class=\"table-cell\" ng-class=\"vm.getDecoration('iowait')\">\n {{ vm.iowait }}%\n </div>\n </div>\n <div class=\"table-row\" ng-show=\"vm.steal != undefined\">\n <div class=\"table-cell text-left\">steal:</div>\n <div class=\"table-cell\" ng-class=\"vm.getDecoration('steal')\">\n {{ vm.steal }}%\n </div>\n </div>\n </div>\n </div>\n <div class=\"hidden-xs hidden-sm hidden-md col-lg-8\">\n <div class=\"table\">\n <div class=\"table-row\" ng-if=\"vm.ctx_switches\">\n <div class=\"table-cell text-left\">ctx_sw:</div>\n <div class=\"table-cell\" ng-class=\"vm.getDecoration('ctx_switches')\">\n {{ vm.ctx_switches }}\n </div>\n </div>\n <div class=\"table-row\" ng-if=\"vm.interrupts\">\n <div class=\"table-cell text-left\">inter:</div>\n <div class=\"table-cell\">\n {{ vm.interrupts }}\n </div>\n </div>\n <div class=\"table-row\" ng-if=\"vm.soft_interrupts\">\n <div class=\"table-cell text-left\">sw_int:</div>\n <div class=\"table-cell\">\n {{ vm.soft_interrupts }}\n </div>\n </div>\n <div class=\"table-row\" ng-if=\"!statsSystem.isLinux() && vm.syscalls\">\n <div class=\"table-cell text-left\">syscal:</div>\n <div class=\"table-cell\">\n {{ vm.syscalls }}\n </div>\n </div>\n </div>\n </div>\n </div>\n</section>\n";
var html = "<section id=\"cpu\" class=\"plugin\">\n <div class=\"row\">\n <div class=\"col-sm-24 col-md-12 col-lg-8\">\n <div class=\"table\">\n <div class=\"table-row\">\n <div class=\"table-cell text-left title\">CPU</div>\n <div class=\"table-cell\">{{ vm.total }}%</div>\n </div>\n <div class=\"table-row\">\n <div class=\"table-cell text-left\">user:</div>\n <div class=\"table-cell\" ng-class=\"vm.getDecoration('user')\">\n {{ vm.user }}%\n </div>\n </div>\n <div class=\"table-row\">\n <div class=\"table-cell text-left\">system:</div>\n <div class=\"table-cell\" ng-class=\"vm.getDecoration('system')\">\n {{ vm.system }}%\n </div>\n </div>\n <div class=\"table-row\">\n <div class=\"table-cell text-left\">idle:</div>\n <div class=\"table-cell\">{{ vm.idle }}%</div>\n </div>\n </div>\n </div>\n <div class=\"hidden-xs hidden-sm col-md-12 col-lg-8\">\n <div class=\"table\">\n <div class=\"table-row\" ng-show=\"vm.nice != undefined\">\n <div class=\"table-cell text-left\">nice:</div>\n <div class=\"table-cell\">\n {{ vm.nice }}%\n </div>\n </div>\n <div class=\"table-row\" ng-show=\"vm.irq != undefined\">\n <div class=\"table-cell text-left\">irq:</div>\n <div class=\"table-cell\">\n {{ vm.irq }}%\n </div>\n </div>\n <div class=\"table-row\" ng-show=\"vm.iowait != undefined\">\n <div class=\"table-cell text-left\">iowait:</div>\n <div class=\"table-cell\" ng-class=\"vm.getDecoration('iowait')\">\n {{ vm.iowait }}%\n </div>\n </div>\n <div class=\"table-row\" ng-show=\"vm.steal != undefined\">\n <div class=\"table-cell text-left\">steal:</div>\n <div class=\"table-cell\" ng-class=\"vm.getDecoration('steal')\">\n {{ vm.steal }}%\n </div>\n </div>\n </div>\n </div>\n <div class=\"hidden-xs hidden-sm hidden-md col-lg-8\">\n <div class=\"table\">\n <div class=\"table-row\" ng-if=\"vm.ctx_switches\">\n <div class=\"table-cell text-left\">ctx_sw:</div>\n <div class=\"table-cell\" ng-class=\"vm.getDecoration('ctx_switches')\">\n {{ vm.ctx_switches }}\n </div>\n </div>\n <div class=\"table-row\" ng-if=\"vm.interrupts\">\n <div class=\"table-cell text-left\">inter:</div>\n <div class=\"table-cell\">\n {{ vm.interrupts }}\n </div>\n </div>\n <div class=\"table-row\" ng-if=\"vm.soft_interrupts\">\n <div class=\"table-cell text-left\">sw_int:</div>\n <div class=\"table-cell\">\n {{ vm.soft_interrupts }}\n </div>\n </div>\n <div class=\"table-row\" ng-if=\"!vm.isLinux && vm.syscalls\">\n <div class=\"table-cell text-left\">syscal:</div>\n <div class=\"table-cell\">\n {{ vm.syscalls }}\n </div>\n </div>\n </div>\n </div>\n </div>\n</section>\n";
window.angular.module('ng').run(['$templateCache', function(c) { c.put(path, html) }]);
module.exports = path;
@ -42295,6 +42297,7 @@ function GlancesPluginSystemController($scope, GlancesStats) {
var loadData = function (data) {
var stats = data.stats['system'];
vm.isLinux = data.isLinux;
vm.hostname = stats['hostname'];
vm.platform = stats['platform'];
vm.os.name = stats['os_name'];
@ -42310,7 +42313,7 @@ function GlancesPluginSystemController($scope, GlancesStats) {
/***/ (function(module, exports) {
var path = '/Users/floranbrutel/dev/glances/glances/outputs/static/js/components/plugin-system/view.html';
var html = "<section id=\"system\">\n <span ng-if=\"vm.isDisconnected\" class=\"critical\">Disconnected from</span>\n <span class=\"title\">{{ vm.hostname }}</span>\n <span ng-if=\"vm.stats.isLinux\" class=\"hidden-xs hidden-sm\">({{ vm.humanReadableName }} / {{ vm.os.name }} {{ vm.os.version }})</span>\n <span ng-if=\"!vm.stats.isLinux\"\n class=\"hidden-xs hidden-sm\">({{ vm.os.name }} {{ vm.os.version }} {{ vm.platform }})</span>\n</section>\n";
var html = "<section id=\"system\">\n <span ng-if=\"vm.isDisconnected\" class=\"critical\">Disconnected from</span>\n <span class=\"title\">{{ vm.hostname }}</span>\n <span ng-if=\"vm.isLinux\" class=\"hidden-xs hidden-sm\">({{ vm.humanReadableName }} / {{ vm.os.name }} {{ vm.os.version }})</span>\n <span ng-if=\"!vm.isLinux\" class=\"hidden-xs hidden-sm\">({{ vm.os.name }} {{ vm.os.version }} {{ vm.platform }})</span>\n</section>\n";
window.angular.module('ng').run(['$templateCache', function(c) { c.put(path, html) }]);
module.exports = path;

File diff suppressed because one or more lines are too long