Display version in footer via api / angular

This commit is contained in:
Kyle Johnson 2014-11-24 00:56:20 +00:00
parent 40dcca2084
commit 941bf3535f
3 changed files with 8 additions and 1 deletions

View File

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

View File

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

View File

@ -2,7 +2,7 @@
<div class="container-fluid">
<p class="pull-right text-muted"><?= $SLANG['Load'] ?>: <span ng-bind="load"></span> -
<?= $SLANG['Disk'] ?>: <span ng-bind="diskPercent"></span>% -
<?= makePopupLink( '?view=version', 'zmVersion', 'version', 'v' . ZM_VERSION, canEdit( 'System' ) ) ?> -
<a href="?view=version" target="_blank">v {{ version }}</a>
<?php
if ( ZM_OPT_USE_AUTH )
{