Set the logState in header via angular
This commit is contained in:
parent
175e7d3e22
commit
64122b3b98
|
@ -10,6 +10,9 @@ ZoneMinder.factory('Header', function($http) {
|
|||
return {
|
||||
getLogState: function(callback) {
|
||||
$http.get('/api/monitors.json').success(callback);
|
||||
},
|
||||
getDaemonStatus: function(callback) {
|
||||
$http.get('/api/host/daemonCheck.json').success(callback);
|
||||
}
|
||||
};
|
||||
});
|
||||
|
|
|
@ -4,6 +4,12 @@ ZoneMinder.controller('HeaderController', function($scope, Header) {
|
|||
Header.getLogState(function(results) {
|
||||
console.log(results);
|
||||
});
|
||||
|
||||
Header.getDaemonStatus(function(results) {
|
||||
if (results.result == 1) {
|
||||
$scope.isRunning = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
ZoneMinder.controller('EventController', function($scope, $location, Event) {
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<div class="container-fluid">
|
||||
<a href="?view=console"><span class="navbar-brand">ZoneMinder</span></a>
|
||||
|
||||
<button type="button" class="btn btn-<?= $statusClass ?> btn-md navbar-btn pull-right" data-toggle="modal" data-target="#myModal">
|
||||
<button type="button" class="btn btn-md navbar-btn pull-right" ng-class="isRunning ? 'btn-success' : 'btn-danger'" data-toggle="modal" data-target="#myModal">
|
||||
<span class="glyphicon glyphicon-off"></span>
|
||||
</button>
|
||||
|
||||
|
|
Loading…
Reference in New Issue