mirror of
https://github.com/nicolargo/glances.git
synced 2026-03-13 11:28:12 -04:00
Merge pull request #1243 from notFloran/fix-webui-issues
[WebUI] fix issues with folders/port plugins
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
<div class="table-row" ng-if="vm.folders.length > 0">
|
||||
<div class="table-cell text-left title">FOLDERS</div>
|
||||
<div class="table-cell"></div>
|
||||
<div class="table-cell">Size</div>
|
||||
</div>
|
||||
<div class="table-row" ng-repeat="folder in vm.folders">
|
||||
<div class="table-cell text-left">{{ folder.path }}</div>
|
||||
<div class="table-cell"></div>
|
||||
<div class="table-cell" ng-class="vm.getDecoration(folder)">{{ folder.size | bytes }}</div>
|
||||
</div>
|
||||
|
||||
@@ -20,16 +20,26 @@ export default function GlancesPluginPortsController($scope, GlancesStats) {
|
||||
}, this);
|
||||
}
|
||||
|
||||
vm.getDecoration = function (port) {
|
||||
vm.getPortDecoration = function (port) {
|
||||
if (port.status === null) {
|
||||
return 'careful';
|
||||
}
|
||||
|
||||
if (port.status === false) {
|
||||
} else if (port.status === false) {
|
||||
return 'critical';
|
||||
} else if (port.rtt_warning !== null && port.status > port.rtt_warning) {
|
||||
return 'warning';
|
||||
}
|
||||
|
||||
if (port.rtt_warning !== null && port.status > port.rtt_warning) {
|
||||
return 'ok';
|
||||
};
|
||||
|
||||
vm.getWebDecoration = function (web) {
|
||||
var okCodes = [200, 301, 302];
|
||||
|
||||
if (web.status === null) {
|
||||
return 'careful';
|
||||
} else if (okCodes.indexOf(web.status) === -1) {
|
||||
return 'critical';
|
||||
} else if (web.rtt_warning !== null && web.elapsed > web.rtt_warning) {
|
||||
return 'warning';
|
||||
}
|
||||
|
||||
|
||||
@@ -3,10 +3,15 @@
|
||||
20}}
|
||||
</div>
|
||||
<div class="table-cell"></div>
|
||||
<div ng-switch="port.status" ng-class="vm.getDecoration(port)" class="table-cell">
|
||||
<div ng-switch="port.status" ng-class="vm.getPortDecoration(port)" class="table-cell" ng-if="port.host">
|
||||
<span ng-switch-when="null">Scanning</span>
|
||||
<span ng-switch-when="false">Timeout</span>
|
||||
<span ng-switch-when="true">Open</span>
|
||||
<span ng-switch-default>{{port.status * 1000.0 | number:0}}ms</span>
|
||||
</div>
|
||||
<div ng-switch="port.status" ng-class="vm.getWebDecoration(port)" class="table-cell" ng-if="port.url">
|
||||
<span ng-switch-when="null">Scanning</span>
|
||||
<span ng-switch-when="Error">Error</span>
|
||||
<span ng-switch-default>Code {{ port.status }}</span>
|
||||
</div>
|
||||
</div>
|
||||
BIN
glances/outputs/static/public/glances.js
vendored
BIN
glances/outputs/static/public/glances.js
vendored
Binary file not shown.
BIN
glances/outputs/static/public/glances.map.js
vendored
BIN
glances/outputs/static/public/glances.map.js
vendored
Binary file not shown.
Reference in New Issue
Block a user