Link to disable monitoring
This commit is contained in:
parent
0bdce5debb
commit
5a5c70cfb1
10 changed files with 230 additions and 0 deletions
app/scripts
|
@ -36,6 +36,11 @@ angular.module('ffffng', [
|
|||
controller: 'ConfirmMonitoringCtrl',
|
||||
title: 'Versand von Status-E-Mails bestätigen'
|
||||
})
|
||||
.when('/monitoring/disable', {
|
||||
templateUrl: 'views/disableMonitoring.html',
|
||||
controller: 'DisableMonitoringCtrl',
|
||||
title: 'Versand von Status-E-Mails deaktivieren'
|
||||
})
|
||||
.otherwise({
|
||||
redirectTo: '/'
|
||||
});
|
||||
|
|
35
app/scripts/controllers/disableMonitoringCtrl.js
Normal file
35
app/scripts/controllers/disableMonitoringCtrl.js
Normal file
|
@ -0,0 +1,35 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('ffffng')
|
||||
.controller('DisableMonitoringCtrl', function ($scope, Navigator, MonitoringService, $routeParams, config) {
|
||||
if (!config.monitoring.enabled) {
|
||||
Navigator.home();
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.config = config;
|
||||
|
||||
$scope.monitoringInfo = {};
|
||||
$scope.monitoringStatus = 'loading';
|
||||
|
||||
MonitoringService.disable($routeParams['mac'], $routeParams['token'])
|
||||
.then(
|
||||
function (response) {
|
||||
// success
|
||||
$scope.monitoringInfo = response.data;
|
||||
$scope.monitoringStatus = 'disabled';
|
||||
},
|
||||
function () {
|
||||
// error
|
||||
$scope.monitoringStatus = 'error';
|
||||
}
|
||||
);
|
||||
|
||||
$scope.goHome = function () {
|
||||
Navigator.home();
|
||||
};
|
||||
|
||||
$scope.goToUpdate = function () {
|
||||
Navigator.updateNode();
|
||||
};
|
||||
});
|
|
@ -8,6 +8,13 @@ angular.module('ffffng')
|
|||
return $q.reject({});
|
||||
}
|
||||
return $http.put('/api/monitoring/confirm/' + mac + '?token=' + token);
|
||||
},
|
||||
|
||||
'disable': function (mac, token) {
|
||||
if (!mac || !token) {
|
||||
return $q.reject({});
|
||||
}
|
||||
return $http.put('/api/monitoring/disable/' + mac + '?token=' + token);
|
||||
}
|
||||
};
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue