Skip to content
Snippets Groups Projects
Commit 622b2426 authored by Alex Ellis's avatar Alex Ellis
Browse files

Merge branch 'master' of https://github.com/alexellis/faas

parents 499d6128 ab8a7e68
No related branches found
No related tags found
No related merge requests found
<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/>
<path d="M0 0h24v24H0z" fill="none"/>
</svg>
\ No newline at end of file
......@@ -54,9 +54,17 @@
<md-card-title>
<md-card-title-text>
<span class="md-headline">
{{function.name}}
</span>
<div layout="row" layout-align="space-between">
<span class="md-headline">
{{function.name}}
</span>
<md-button ng-click="deleteFunction()" class="md-icon-button" aria-label="Delete">
<md-tooltip md-direction="left">Delete</md-tooltip>
<md-icon md-svg-icon="img/icons/ic_delete_black.svg"></md-icon>
</md-button>
</div>
<div layout-gt-sm="row">
<md-input-container class="md-icon-float md-block">
<label>Replicas</label>
......
......@@ -151,5 +151,38 @@ app.controller("home", ['$scope', '$log', '$http', '$location', '$timeout', '$md
showDialog();
};
$scope.deleteFunction = function($event) {
var confirm = $mdDialog.confirm()
.title('Delete Function')
.textContent('Are you sure you want to delete ' + $scope.selectedFunction.name + '?')
.ariaLabel('Delete function')
.targetEvent($event)
.ok('OK')
.cancel('Cancel');
$mdDialog.show(confirm)
.then(function() {
var options = {
url: "/system/functions",
data: {
functionName: $scope.selectedFunction.name
},
method: "DELETE",
headers: { "Content-Type": "application/json"},
responseType: "json"
};
return $http(options);
}).then(function(){
$scope.showPostInvokedToast("Success");
}).catch(function(err) {
if (err) {
// show error toast only if there actually is an err.
// because hitting 'Cancel' also rejects the promise.
$scope.showPostInvokedToast("Error");
}
});
};
fetch();
}]);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment