Added delete feature for nodes.

This commit is contained in:
baldo 2016-05-16 18:27:03 +02:00
parent 39e7af6238
commit 79aadc85c2
20 changed files with 300 additions and 20 deletions
app/scripts/controllers

View file

@ -0,0 +1,26 @@
'use strict';
angular.module('ffffng')
.controller('DeleteNodeCtrl', function ($scope, Navigator, NodeService, config, ConfirmDeletionDialog) {
$scope.config = config;
$scope.token = undefined;
$scope.deleted = false;
$scope.onSubmitToken = function (token) {
$scope.token = token;
return NodeService.getNode(token)
.success(function (node) {
ConfirmDeletionDialog.open(node).result.then(function () {
NodeService.deleteNode(token)
.success(function () {
$scope.deleted = true;
$scope.hostname = node.hostname;
});
});
});
};
$scope.cancel = function () {
Navigator.home();
};
});

View file

@ -11,4 +11,8 @@ angular.module('ffffng')
$scope.updateNode = function () {
Navigator.updateNode();
};
$scope.deleteNode = function () {
Navigator.deleteNode();
};
});