Browse Source

Merge branch 'master' into ldap

Torkel Ödegaard 10 years ago
parent
commit
a69086a718

+ 4 - 3
docs/sources/project/building_from_source.md

@@ -17,6 +17,7 @@ dev environment.
 ## Get Code
 
 ```
+export GOPATH=`pwd`
 go get github.com/grafana/grafana
 ```
 
@@ -24,11 +25,11 @@ go get github.com/grafana/grafana
 ```
 cd $GOPATH/src/github.com/grafana/grafana
 go run build.go setup            (only needed once to install godep)
-godep restore                    (will pull down all golang lib dependecies in your current GOPATH)
+$GOPATH/bin/godep restore                    (will pull down all golang lib dependecies in your current GOPATH)
 go build .
 ```
 
-# Building on Windows
+## Building on Windows
 The Grafana backend includes Sqlite3 which requires GCC to compile. So in order to compile Grafana on windows you need
 to install GCC. We recommend [TDM-GCC](http://tdm-gcc.tdragon.net/download).
 
@@ -74,4 +75,4 @@ You only need to add the options you want to override. Config files are applied
 
 ## Create a pull requests
 
-Before or after your create a pull requests, sign the [contributor license agreement](/docs/contributing/cla.html).
+Before or after your create a pull requests, sign the [contributor license agreement](/project/cla.html).

+ 1 - 1
docs/sources/reference/http_api.md

@@ -53,7 +53,7 @@ Creates a new dashboard or updates an existing dashboard.
             "rows": [
               {
               }
-            ]
+            ],
             "schemaVersion": 6,
             "version": 0
           },

+ 45 - 2
docs/sources/reference/singlestat.md

@@ -11,5 +11,48 @@ page_keywords: grafana, singlestat, panel, documentation
 The singlestat panel allows you to show the one main summery stat of a single series (like max, min, avg, sum). It also
 provides thresholds to color that singlestat metric or the panel background.
 
-## Options
-- TODO
+### Big Value Configuration
+
+The big value configuration allows you to both customize the look of your singlestat metric, as well as add additional labels to contexualize the metric.
+
+<img class="no-shadow" src="/img/v1/Singlestat-BaseSettings.png">
+
+1. `Big Value`: Big Value refers to the collection of values displayed in the singlestat panel.
+2. `Prefixes`: The Prefix fields let you define a custom label and font-size (as a %) to appear *before* the singlestat metric.
+3. `Values`: The Value fields let you set the (min, max, average, current, total) and font-size (as a %) of the singlestat metric.
+4. `Potsfixes`: The Postfix fields let you define a custom label and font-size (as a %) to appear *after* the singlestat metric.
+5. `Units`: Units are appended to the the singlestat metric within the panel, and will respect the color and threshold settings for the Value.
+6. `Decimals`: The Decimal field allows you to override automatic decimal precision, inceasing the digits displayed for your singlestat metric.
+
+### Coloring
+
+The coloring options of the singlestat config allow you to dynamically change the colors based on the displayed data.
+
+<img class="no-shadow" src="/img/v1/Singlestat-Coloring.png">
+
+1. `Background`: The Background checkbox applies the configured thresholds and colors to the entirity of the singlestat panel background.
+2. `Value`: The Value checkbox applies the configured thresholds and colors to the value within the singlestat panel.
+3. `Thresholds`: Thresholds allow you to change the background and value colors dyanmically within the panel. The threshold field accepts **3 comma-separated** values, corresponding to the three colors directly to the right.
+4. `Colors`: The color picker allows you to select a color and opacity
+5. `Invert order`: This link toggles the threshold color order.</br>For example: Green, Orange, Red (<img class="no-shadow" src="/img/v1/gyr.png">) will become Red, Orange, Green (<img class="no-shadow" src="/img/v1/ryg.png">).
+
+### Spark Lines
+
+Spark lines are a great way of seeing the historical data associated with a single stat value, providing valuable context at a glance. Spark lines act differently than traditional graph panels and do not include x or y axis, coordinates, a legend, or ability to interact with the graph.
+
+<img class="no-shadow" src="/img/v1/Singlestat-Sparklines.png">
+
+1. `Show`: The show checkbox will toggle whether the spark line is shown in the panel. When unselected, only the value will appear.
+2. `Background`: Check if you want the sparklines to take up the full panel width or uncheck if they should only be at the bottom.
+3. `Line Color`: This color selection applies to the color of the sparkline itself.
+4. `Fill Color`: This color selection applies to the area below the sparkline.
+
+> ***Pro-tip:*** Reduce the opacity on  fill colors for nice looking panels.
+
+### Value to text mapping
+
+Value to text mapping allows you to translate values into explcit text. The text will respect all styling, thresholds and customization defined for the value.
+
+<img class="no-shadow" src="/img/v1/Singlestat-ValueMapping.png">
+
+

+ 2 - 0
public/app/components/timeSeries.js

@@ -13,6 +13,7 @@ function (_, kbn) {
     this.color = opts.color;
     this.valueFormater = kbn.valueFormats.none;
     this.stats = {};
+    this.legend = true;
   }
 
   function matchSeriesOverride(aliasOrRegex, seriesAlias) {
@@ -55,6 +56,7 @@ function (_, kbn) {
       if (override.fillBelowTo !== void 0) { this.fillBelowTo = override.fillBelowTo; }
       if (override.color !== void 0) { this.color = override.color; }
       if (override.transform !== void 0) { this.transform = override.transform; }
+      if (override.legend !== void 0) { this.legend = override.legend; }
 
       if (override.yaxis !== void 0) {
         this.yaxis = override.yaxis;

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

@@ -29,7 +29,7 @@ function (angular, _) {
       {text: 'Public on the web', value: 3},
     ];
 
-    $scope.externalUrl = 'http://snapshots-origin.raintank.io';
+    $scope.externalUrl = '//snapshots-origin.raintank.io';
     $scope.apiUrl = '/api/snapshots';
 
     $scope.createSnapshot = function(external) {

+ 4 - 0
public/app/panels/graph/legend.js

@@ -130,6 +130,10 @@ function (angular, app, _, kbn, $) {
             if (panel.legend.hideEmpty && series.allIsNull) {
               continue;
             }
+            // ignore series excluded via override
+            if (!series.legend) {
+              continue;
+            }
 
             var html = '<div class="graph-legend-series';
             if (series.yaxis === 2) { html += ' pull-right'; }

+ 1 - 0
public/app/panels/graph/seriesOverridesCtrl.js

@@ -104,6 +104,7 @@ define([
     $scope.addOverrideOption('Y-axis', 'yaxis', [1, 2]);
     $scope.addOverrideOption('Z-index', 'zindex', [-1,-2,-3,0,1,2,3]);
     $scope.addOverrideOption('Transform', 'transform', ['negative-Y']);
+    $scope.addOverrideOption('Legend', 'legend', [true, false]);
     $scope.updateCurrentOverrides();
 
   });

+ 6 - 7
public/app/plugins/datasource/graphite/partials/query.editor.html

@@ -12,7 +12,7 @@
           </a>
         </li>
         <li class="tight-form-item">
-          <a class="pointer" tabindex="1" ng-click="showTextEditor = !showTextEditor">
+          <a class="pointer" tabindex="1" ng-click="toggleEditorMode()">
             <i class="fa fa-pencil"></i>
           </a>
         </li>
@@ -65,15 +65,14 @@
 				</li>
 			</ul>
 
-			<input  type="text"
-			class="tight-form-clear-input span10"
+			<input  type="text" class="tight-form-clear-input span10"
               ng-model="target.target"
-              focus-me="showTextEditor"
+              focus-me="target.textEditor"
               spellcheck='false'
-              ng-model-onblur ng-change="targetTextChanged()"
-              ng-show="showTextEditor" />
+              ng-model-onblur ng-change="get_data()"
+              ng-show="target.textEditor" />
 
-      <ul class="tight-form-list" role="menu" ng-hide="showTextEditor">
+      <ul class="tight-form-list" role="menu" ng-hide="target.textEditor">
 				<li ng-repeat="segment in segments" role="menuitem">
 					<metric-segment segment="segment" get-alt-segments="getAltSegments($index)" on-value-changed="segmentValueChanged(segment, $index)"></metric-segment>
 				</li>

+ 11 - 4
public/app/plugins/datasource/graphite/queryCtrl.js

@@ -20,15 +20,22 @@ function (angular, _, config, gfunc, Parser) {
       parseTarget();
     };
 
+    $scope.toggleEditorMode = function() {
+      $scope.target.textEditor = !$scope.target.textEditor;
+      parseTarget();
+    };
+
     // The way parsing and the target editor works needs
     // to be rewritten to handle functions that take multiple series
     function parseTarget() {
       $scope.functions = [];
       $scope.segments = [];
-      $scope.showTextEditor = false;
-
       delete $scope.parserError;
 
+      if ($scope.target.textEditor) {
+        return;
+      }
+
       var parser = new Parser($scope.target.target);
       var astNode = parser.getAst();
       if (astNode === null) {
@@ -38,7 +45,7 @@ function (angular, _, config, gfunc, Parser) {
 
       if (astNode.type === 'error') {
         $scope.parserError = astNode.message + " at position: " + astNode.pos;
-        $scope.showTextEditor = true;
+        $scope.target.textEditor = true;
         return;
       }
 
@@ -48,7 +55,7 @@ function (angular, _, config, gfunc, Parser) {
       catch (err) {
         console.log('error parsing target:', err.message);
         $scope.parserError = err.message;
-        $scope.showTextEditor = true;
+        $scope.target.textEditor = true;
       }
 
       checkOtherSegments($scope.segments.length - 1);