Преглед изворни кода

Added all unit formats to new unit selector, #1331

Torkel Ödegaard пре 11 година
родитељ
комит
3a27b610d5
2 измењених фајлова са 21 додато и 4 уклоњено
  1. 18 1
      src/app/components/kbn.js
  2. 3 3
      src/app/panels/graph/axisEditor.html

+ 18 - 1
src/app/components/kbn.js

@@ -492,6 +492,7 @@ function($, _, moment) {
         submenu: [
           {text: 'none' , value: 'none'},
           {text: 'short', value: 'short'},
+          {text: 'percent', value: 'percent'},
         ]
       },
       {
@@ -500,16 +501,32 @@ function($, _, moment) {
           {text: 'nanoseconds (ns)' , value: 'ns'},
           {text: 'microseconds (µs)', value: 'µs'},
           {text: 'milliseconds (ms)', value: 'ms'},
+          {text: 'seconds (s)', value: 's'},
         ]
       },
       {
         text: 'data',
         submenu: [
-          {text: 'bit', value: 'bit'},
+          {text: 'bits', value: 'bits'},
           {text: 'bytes', value: 'bytes'},
           {text: 'kilobytes', value: 'kbytes'},
         ]
       },
+      {
+        text: 'data rate',
+        submenu: [
+          {text: 'bits/sec', value: 'bps'},
+          {text: 'bytes/sec', value: 'Bps'},
+        ]
+      },
+      {
+        text: 'energy',
+        submenu: [
+          {text: 'watt', value: 'watt'},
+          {text: 'joule', value: 'joule'},
+          {text: 'eV', value: 'ev'},
+        ]
+      },
     ];
   };
 

+ 3 - 3
src/app/panels/graph/axisEditor.html

@@ -10,7 +10,7 @@
 					<li class="grafana-target-segment">
 						Unit
 					</li>
-					<li class="dropdown" style="width: 150px;"
+					<li class="dropdown" style="width: 140px;"
 						ng-model="panel.y_formats[0]"
 						dropdown-typeahead="unitFormats"
 						dropdown-typeahead-on-select="setUnitFormat(0, $subItem)">
@@ -47,7 +47,7 @@
 					<li class="grafana-target-segment">
 						Unit
 					</li>
-					<li class="dropdown" style="width: 150px"
+					<li class="dropdown" style="width: 140px"
 						ng-model="panel.y_formats[1]"
 						dropdown-typeahead="unitFormats"
 						dropdown-typeahead-on-select="setUnitFormat(1, $subItem)">
@@ -104,7 +104,7 @@
 					<input type="text" class="input-small grafana-target-segment-input">
 				</li>
 				<li class="grafana-target-segment">
-					<spectrum-picker ng-model="panel.grid.threshold1Color" ng-change="render()" ></spectrum-picker>
+					<spectrum-picker ng-model="panel.grid.threshold2Color" ng-change="render()" ></spectrum-picker>
 				</li>
 				<li class="grafana-target-segment">
 					Line mode