Browse Source

Make timeout for snapshot creation configurable

Ryuichi Sakai 9 years ago
parent
commit
0c9f664ea0

+ 13 - 0
public/app/features/dashboard/partials/shareModal.html

@@ -148,6 +148,19 @@
 					</div>
 					</div>
 				</div>
 				</div>
 
 
+				<div ng-if="step === 1">
+					<p class="share-modal-info-text">
+						You may need to configure the timeout value if it takes a long time to collect your dashboard's metrics.
+					</p>
+				</div>
+
+				<div class="gf-form-group share-modal-options">
+					<div class="gf-form" ng-if="step === 1">
+						<span class="gf-form-label width-12">Timeout (seconds)</span>
+						<input type="number" ng-model="snapshot.timeoutSeconds" class="gf-form-input max-width-15" >
+					</div>
+				</div>
+
 				<div ng-if="step === 1" class="gf-form-button-row">
 				<div ng-if="step === 1" class="gf-form-button-row">
 					<button class="btn gf-form-btn width-10 btn-success" ng-click="createSnapshot()" ng-disabled="loading">
 					<button class="btn gf-form-btn width-10 btn-success" ng-click="createSnapshot()" ng-disabled="loading">
 						<i class="fa fa-save"></i>
 						<i class="fa fa-save"></i>

+ 2 - 1
public/app/features/dashboard/shareSnapshotCtrl.js

@@ -12,6 +12,7 @@ function (angular, _) {
     $scope.snapshot = {
     $scope.snapshot = {
       name: $scope.dashboard.title,
       name: $scope.dashboard.title,
       expires: 0,
       expires: 0,
+      timeoutSeconds: 4,
     };
     };
 
 
     $scope.step = 1;
     $scope.step = 1;
@@ -55,7 +56,7 @@ function (angular, _) {
 
 
       $timeout(function() {
       $timeout(function() {
         $scope.saveSnapshot(external);
         $scope.saveSnapshot(external);
-      }, 4000);
+      }, $scope.snapshot.timeoutSeconds * 1000);
     };
     };
 
 
     $scope.saveSnapshot = function(external) {
     $scope.saveSnapshot = function(external) {