Added confirmation page for monitoring + a few tweaks.
This commit is contained in:
parent
1b173b79d4
commit
0bdce5debb
24 changed files with 431 additions and 72 deletions
app/scripts/controllers
35
app/scripts/controllers/confirmMonitoringCtrl.js
Normal file
35
app/scripts/controllers/confirmMonitoringCtrl.js
Normal file
|
@ -0,0 +1,35 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('ffffng')
|
||||
.controller('ConfirmMonitoringCtrl', function ($scope, Navigator, MonitoringService, $routeParams, config) {
|
||||
if (!config.monitoring.enabled) {
|
||||
Navigator.home();
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.config = config;
|
||||
|
||||
$scope.monitoringInfo = {};
|
||||
$scope.monitoringStatus = 'loading';
|
||||
|
||||
MonitoringService.confirm($routeParams['mac'], $routeParams['token'])
|
||||
.then(
|
||||
function (response) {
|
||||
// success
|
||||
$scope.monitoringInfo = response.data;
|
||||
$scope.monitoringStatus = 'confirmed';
|
||||
},
|
||||
function () {
|
||||
// error
|
||||
$scope.monitoringStatus = 'error';
|
||||
}
|
||||
);
|
||||
|
||||
$scope.goHome = function () {
|
||||
Navigator.home();
|
||||
};
|
||||
|
||||
$scope.goToUpdate = function () {
|
||||
Navigator.updateNode();
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue