From e541976b777a3cffc2102b290a186d57c4e054ea Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Fri, 21 Nov 2014 20:06:59 +0000 Subject: [PATCH] Grab system load from API and set with angular --- web/skins/bootstrap/js/app.js | 8 ++++++++ web/skins/bootstrap/js/controllers.js | 6 ++++++ web/skins/bootstrap/views/footer.php | 4 ++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/web/skins/bootstrap/js/app.js b/web/skins/bootstrap/js/app.js index 816fd02d2..bda8d6288 100644 --- a/web/skins/bootstrap/js/app.js +++ b/web/skins/bootstrap/js/app.js @@ -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) { diff --git a/web/skins/bootstrap/js/controllers.js b/web/skins/bootstrap/js/controllers.js index e895487af..4592e0477 100644 --- a/web/skins/bootstrap/js/controllers.js +++ b/web/skins/bootstrap/js/controllers.js @@ -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; diff --git a/web/skins/bootstrap/views/footer.php b/web/skins/bootstrap/views/footer.php index 18bd78c62..8fad75e6a 100644 --- a/web/skins/bootstrap/views/footer.php +++ b/web/skins/bootstrap/views/footer.php @@ -1,6 +1,6 @@ -