Move getDiskPercent from Footer to Host factory

This commit is contained in:
Kyle Johnson 2014-11-25 16:30:27 +00:00
parent 9b636c89bc
commit f854bf4dcb
2 changed files with 5 additions and 9 deletions

View File

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

View File

@ -12,10 +12,6 @@ ZoneMinder.controller('HeaderController', function($scope, Header) {
}); });
ZoneMinder.controller('FooterController', function($scope, Footer) { ZoneMinder.controller('FooterController', function($scope, Footer) {
Footer.getDiskPercent(function(diskPercent) {
$scope.diskPercent = diskPercent.space;
});
Footer.getVersion(function(version) { Footer.getVersion(function(version) {
$scope.version = version.version; $scope.version = version.version;
}); });
@ -100,8 +96,8 @@ ZoneMinder.controller('ConfigController', function($scope, $http, Config) {
}); });
ZoneMinder.controller('HostController', function($scope, Host, Footer) { ZoneMinder.controller('HostController', function($scope, Host) {
Footer.getDiskPercent(function(diskPercent) { Host.getDiskPercent(function(diskPercent) {
var array = []; var array = [];
angular.forEach(diskPercent.usage, function(value, key) { angular.forEach(diskPercent.usage, function(value, key) {
var a = { var a = {