mirror of
https://github.com/openfaas/faas.git
synced 2025-06-09 08:46:48 +00:00
Merge branch 'master' of https://github.com/alexellis/faas
This commit is contained in:
commit
622b24268d
4
gateway/assets/img/icons/ic_delete_black.svg
Normal file
4
gateway/assets/img/icons/ic_delete_black.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<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>
|
After Width: | Height: | Size: 241 B |
@ -54,9 +54,17 @@
|
||||
<md-card-title>
|
||||
<md-card-title-text>
|
||||
|
||||
<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>
|
||||
|
33
gateway/assets/script/bootstrap.js
vendored
33
gateway/assets/script/bootstrap.js
vendored
@ -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();
|
||||
}]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user