Explorar el Código

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

Torkel Ödegaard hace 10 años
padre
commit
4ca125da41

+ 9 - 1
public/app/features/dashboard/partials/shareModal.html

@@ -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>

+ 6 - 0
public/app/features/dashboard/shareSnapshotCtrl.js

@@ -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;