Просмотр исходного кода

Small fix to graphite target controller to still revert to text box for expressions with multiple series that do not use a series reference

Torkel Ödegaard 11 лет назад
Родитель
Сommit
fb08b71884

+ 3 - 0
src/app/controllers/graphiteTarget.js

@@ -90,6 +90,9 @@ function (angular, _, config, gfunc, Parser) {
         break;
         break;
       case 'metric':
       case 'metric':
         if ($scope.segments.length > 0) {
         if ($scope.segments.length > 0) {
+          if ($scope.segments[0].length !== 1) {
+            throw { message: 'Multiple metric params not supported, use text editor.' };
+          }
           addFunctionParameter(func, astNode.segments[0].value, index, true);
           addFunctionParameter(func, astNode.segments[0].value, index, true);
           break;
           break;
         }
         }

+ 2 - 3
src/app/services/panelSrv.js

@@ -9,9 +9,8 @@ function (angular, _) {
   module.service('panelSrv', function($rootScope, $timeout, datasourceSrv) {
   module.service('panelSrv', function($rootScope, $timeout, datasourceSrv) {
 
 
     this.init = function($scope) {
     this.init = function($scope) {
-      if (!$scope.panel.span) {
-        $scope.panel.span = 12;
-      }
+      if (!$scope.panel.span) { $scope.panel.span = 12; }
+      if (!$scope.panel.title) { $scope.panel.title = 'No title'; }
 
 
       var menu = [
       var menu = [
         {
         {

+ 1 - 0
src/css/less/grafana.less

@@ -4,6 +4,7 @@
 @import "bootstrap-tagsinput.less";
 @import "bootstrap-tagsinput.less";
 @import "tables_lists.less";
 @import "tables_lists.less";
 @import "search.less";
 @import "search.less";
+@import "panel.less";
 
 
 .hide-controls {
 .hide-controls {
   padding: 0;
   padding: 0;

+ 0 - 69
src/css/less/overrides.less

@@ -65,75 +65,6 @@ code, pre {
   background-color: @grayLighter;
   background-color: @grayLighter;
 }
 }
 
 
-.panel {
-  display: inline-block;
-  float: left;
-  vertical-align: top;
-}
-
-.panel-container {
-  padding: 0px 0px 0px 0px;
-  background: @grafanaPanelBackground;
-  margin: 5px;
-  position: relative;
-}
-
-.panel-content {
-  padding: 0px 10px 5px 10px;
-}
-
-.panel-title {
-  border: 0px;
-  font-weight: bold;
-}
-
-.panel-loading {
-  position:absolute;
-  top: 0px;
-  right: 4px;
-  z-index: 800;
-}
-
-.panel div.panel-extra div.panel-extra-container {
-  margin-right: -10px;
-  margin-top: 3px;
-  text-align: center;
-  ul {
-    text-align: left;
-  }
-}
-
-.panel div.panel-extra {
-  font-size: 0.9em;
-  margin-bottom: 0px;
-}
-
-.panel div.panel-extra .extra {
-  float:right !important;
-}
-
-.panel-error {
-  color: @white;
-  position: absolute;
-  left: 0;
-  padding: 0px 17px 6px 5px;
-  top: 0;
-  i {
-    position: relative;
-    top: -2px;
-  }
-}
-.panel-error-arrow {
-  width: 0;
-  height: 0;
-  position: absolute;
-  border-left: 31px solid transparent;
-  border-right: 30px solid transparent;
-  border-bottom: 27px solid @grafanaPanelBackground;
-  left: 0;
-  bottom: 0;
-}
-
 div.editor-row {
 div.editor-row {
   vertical-align: top;
   vertical-align: top;
 }
 }

+ 71 - 0
src/css/less/panel.less

@@ -0,0 +1,71 @@
+.panel {
+  display: inline-block;
+  float: left;
+  vertical-align: top;
+}
+
+.panel-container {
+  padding: 0px 0px 0px 0px;
+  background: @grafanaPanelBackground;
+  margin: 5px;
+  position: relative;
+}
+
+.panel-content {
+  padding: 0px 10px 5px 10px;
+}
+
+.panel-title {
+  border: 0px;
+  font-weight: bold;
+  position: relative;
+}
+
+.panel-loading {
+  position:absolute;
+  top: 0px;
+  right: 4px;
+  z-index: 800;
+}
+
+.panel div.panel-extra div.panel-extra-container {
+  margin-right: -10px;
+  margin-top: 3px;
+  text-align: center;
+  ul {
+    text-align: left;
+  }
+}
+
+.panel div.panel-extra {
+  font-size: 0.9em;
+  margin-bottom: 0px;
+}
+
+.panel div.panel-extra .extra {
+  float:right !important;
+}
+
+.panel-error {
+  color: @white;
+  position: absolute;
+  left: 0;
+  padding: 0px 17px 6px 5px;
+  top: 0;
+  i {
+    position: relative;
+    top: -2px;
+  }
+}
+
+.panel-error-arrow {
+  width: 0;
+  height: 0;
+  position: absolute;
+  border-left: 31px solid transparent;
+  border-right: 30px solid transparent;
+  border-bottom: 27px solid @grafanaPanelBackground;
+  left: 0;
+  bottom: 0;
+}
+