Delete snapshot fix: the action is now shows confirmation directly in the modal (not opening a new tab with api call as in beta1), Fixes #1682

This commit is contained in:
Torkel Ödegaard 2015-04-01 08:24:03 +02:00
parent 3c2bfbfc1c
commit 4ca125da41
2 changed files with 15 additions and 1 deletions

View File

@ -84,6 +84,13 @@
</p>
</div>
<div class="share-snapshot-header" ng-if="step === 3">
<p class="share-snapshot-info-text">
The snapshot has now been deleted. If it you have already accessed it once, It might take up to an hour before it is removed from
browser caches or CDN caches.
</p>
</div>
<div class="editor-row" style="margin: 11px 20px 33px 20px">
<div class="section" ng-if="step === 1">
<div class="tight-form">
@ -135,7 +142,8 @@
</div>
<div class="pull-right" ng-if="step === 2" style="padding: 5px">
Did you make a mistake? <a href="{{deleteUrl}}" target="_blank">delete snapshot.</a>
Did you make a mistake? <a class="pointer" ng-click="deleteSnapshot()" target="_blank">delete snapshot.</a>
</div>
</div>
</script>

View File

@ -117,6 +117,12 @@ function (angular, _) {
});
};
$scope.deleteSnapshot = function() {
backendSrv.get($scope.deleteUrl).then(function() {
$scope.step = 3;
});
};
$scope.saveExternalSnapshotRef = function(cmdData, results) {
// save external in local instance as well
cmdData.external = true;