2016-05-18 22:50:06 +02:00
|
|
|
'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';
|
|
|
|
|
2017-05-06 17:31:34 +02:00
|
|
|
MonitoringService.confirm($routeParams.token)
|
2016-05-18 22:50:06 +02:00
|
|
|
.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();
|
|
|
|
};
|
|
|
|
});
|