Browse Source

(snapshot) save original url

Mitsuhiro Tanda 9 years ago
parent
commit
7aaa15ad95

+ 6 - 0
public/app/features/dashboard/dashnav/dashnav.html

@@ -41,6 +41,12 @@
 					<div class="dropdown-desc">Export the dashboard to a JSON file for others and to share on Grafana.net</div>
 				</a>
 			</li>
+			<li>
+				<a class="pointer" ng-if="dashboard.snapshot.originalUrl" ng-href="{{dashboard.snapshot.originalUrl}}">
+					<i class="fa fa-link"></i> Original Dashboard
+					<div class="dropdown-desc">Open original dashboard</div>
+				</a>
+			</li>
 		</ul>
 	</li>
 	<li ng-show="::dashboardMeta.canSave">

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

@@ -41,7 +41,8 @@ function (angular, _) {
 
     $scope.createSnapshot = function(external) {
       $scope.dashboard.snapshot = {
-        timestamp: new Date()
+        timestamp: new Date(),
+        originalUrl: $location.absUrl()
       };
 
       $scope.loading = true;