Grab system load from API and set with angular
This commit is contained in:
parent
345f152181
commit
e541976b77
|
@ -17,6 +17,14 @@ ZoneMinder.factory('Header', function($http) {
|
|||
};
|
||||
});
|
||||
|
||||
ZoneMinder.factory('Footer', function($http) {
|
||||
return {
|
||||
getLoad: function(callback) {
|
||||
$http.get('/api/host/getLoad.json').success(callback);
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
ZoneMinder.factory('Event', function($http) {
|
||||
return {
|
||||
getEvent: function(eventId) {
|
||||
|
|
|
@ -11,6 +11,12 @@ ZoneMinder.controller('HeaderController', function($scope, Header) {
|
|||
});
|
||||
});
|
||||
|
||||
ZoneMinder.controller('FooterController', function($scope, Footer) {
|
||||
Footer.getLoad(function(load) {
|
||||
$scope.load = load.load;
|
||||
});
|
||||
});
|
||||
|
||||
ZoneMinder.controller('EventController', function($scope, $location, Event) {
|
||||
|
||||
var eventId = $location.search().eid;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<div id="footer">
|
||||
<div id="footer" ng-controller="FooterController">
|
||||
<div class="container-fluid">
|
||||
<p class="pull-right text-muted"><?= $SLANG['Load'] ?>: <?= getLoad() ?> -
|
||||
<p class="pull-right text-muted"><?= $SLANG['Load'] ?>: <span ng-bind="load"></span> -
|
||||
<?= $SLANG['Disk'] ?>: <?= getDiskPercent() ?>% -
|
||||
<?= makePopupLink( '?view=version', 'zmVersion', 'version', 'v' . ZM_VERSION, canEdit( 'System' ) ) ?> -
|
||||
<?php
|
||||
|
|
Loading…
Reference in New Issue