mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
Check glances status on monitor page.
This commit is contained in:
parent
c9afc3edde
commit
78132cc22d
2 changed files with 32 additions and 16 deletions
38
js/app.js
38
js/app.js
|
@ -589,28 +589,36 @@ app = Sammy('#main', function (sam) {
|
|||
monitorData = {}
|
||||
|
||||
// Why this method ?
|
||||
c.api('/monitor/update-stats', function(data) { // ?
|
||||
c.api('/service/status', function(data) { // ?
|
||||
monitorData.status = true;
|
||||
|
||||
c.api('/monitor/system', function(data) {
|
||||
monitorData.system = data;
|
||||
if (data.status == 'running') {
|
||||
c.api('/monitor/system', function(data) {
|
||||
monitorData.system = data;
|
||||
|
||||
c.api('/monitor/disk', function(data) {
|
||||
monitorData.disk = data;
|
||||
c.api('/monitor/disk', function(data) {
|
||||
monitorData.disk = data;
|
||||
|
||||
c.api('/monitor/network', function(data) {
|
||||
monitorData.network = data;
|
||||
|
||||
// Remove useless interface
|
||||
delete monitorData.network.usage.lo;
|
||||
c.api('/monitor/network', function(data) {
|
||||
monitorData.network = data;
|
||||
|
||||
// Remove useless interface
|
||||
delete monitorData.network.usage.lo;
|
||||
|
||||
c.view('monitor', monitorData);
|
||||
});
|
||||
|
||||
c.view('monitor', monitorData);
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
else {
|
||||
monitorData.status = false;
|
||||
c.view('monitor', monitorData);
|
||||
}
|
||||
|
||||
|
||||
}, 'POST', {period: 'day'});
|
||||
|
||||
}, 'GET', {names: 'glances'});
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<div class="view-title">Monitoring</div>
|
||||
<div class="br"></div>
|
||||
|
||||
{{#if status}}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h2 class="panel-title"><span class="glyphicon glyphicon-info-sign"></span> Infos</h2>
|
||||
|
@ -216,5 +217,12 @@
|
|||
|
||||
</div><!-- .panel-group -->
|
||||
|
||||
{{else}}
|
||||
<div class="alert alert-warning">
|
||||
<span class="glyphicon glyphicon-exclamation-sign"></span>
|
||||
Monitoring is not enabled.
|
||||
<br>
|
||||
Check <a href="/#/services/glances">glances</a> service status.
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{{/if}}
|
Loading…
Reference in a new issue