Get the diskPercent from angular, via the API

This commit is contained in:
Kyle Johnson 2014-11-21 22:16:19 +00:00
parent 055a494fe4
commit 1f74d1cd60
3 changed files with 8 additions and 1 deletions

View File

@ -21,6 +21,9 @@ ZoneMinder.factory('Footer', function($http) {
return {
getLoad: function(callback) {
$http.get('/api/host/getLoad.json').success(callback);
},
getDiskPercent: function(callback) {
$http.get('/api/host/getDiskPercent.json').success(callback);
}
};
});

View File

@ -15,6 +15,10 @@ ZoneMinder.controller('FooterController', function($scope, Footer) {
Footer.getLoad(function(load) {
$scope.load = load.load;
});
Footer.getDiskPercent(function(diskPercent) {
$scope.diskPercent = diskPercent.space;
});
});
ZoneMinder.controller('EventController', function($scope, $location, Event) {

View File

@ -1,7 +1,7 @@
<div id="footer" ng-controller="FooterController">
<div class="container-fluid">
<p class="pull-right text-muted"><?= $SLANG['Load'] ?>: <span ng-bind="load"></span> -
<?= $SLANG['Disk'] ?>: <?= getDiskPercent() ?>% -
<?= $SLANG['Disk'] ?>: <span ng-bind="diskPercent"></span>% -
<?= makePopupLink( '?view=version', 'zmVersion', 'version', 'v' . ZM_VERSION, canEdit( 'System' ) ) ?> -
<?php
if ( ZM_OPT_USE_AUTH )