Jelajahi Sumber

SinglestatPanel: Fixed absolute drilldown link issue, Fixes #1150

Torkel Ödegaard 11 tahun lalu
induk
melakukan
d7ef6daeb8
2 mengubah file dengan 8 tambahan dan 1 penghapusan
  1. 1 0
      CHANGELOG.md
  2. 7 1
      src/app/panels/singlestat/singleStatPanel.js

+ 1 - 0
CHANGELOG.md

@@ -10,6 +10,7 @@
 - [Issue #1095](https://github.com/grafana/grafana/issues/1095). DrilldownLink: template variables in params property was not interpolated
 - [Issue #1114](https://github.com/grafana/grafana/issues/1114). Graphite: Lexer fix, allow equal sign (=) in metric paths
 - [Issue #1136](https://github.com/grafana/grafana/issues/1136). Graph: Fix to legend value Max and negative values
+- [Issue #1150](https://github.com/grafana/grafana/issues/1150). SinglestatPanel: Fixed absolute drilldown link issue
 
 # 1.9.0-rc1 (2014-11-17)
 

+ 7 - 1
src/app/panels/singlestat/singleStatPanel.js

@@ -186,7 +186,13 @@ function (angular, app, _, $) {
           var linkInfo = linkSrv.getPanelLinkAnchorInfo(panel.links[0]);
           if (linkInfo.href[0] === '#') { linkInfo.href = linkInfo.href.substring(1); }
 
-          $timeout(function() { $location.url(linkInfo.href); });
+          if (linkInfo.href.indexOf('http') === 0) {
+            window.location.href = linkInfo.href;
+          } else {
+            $timeout(function() {
+              $location.url(linkInfo.href);
+            });
+          }
 
           drilldownTooltip.detach();
         });