소스 검색

began on being able to control fill style per series

Torkel Odegaard 12 년 전
부모
커밋
ee8ba469dd
3개의 변경된 파일28개의 추가작업 그리고 19개의 파일을 삭제
  1. 8 2
      src/app/panels/graphite/legend.html
  2. 12 12
      src/app/panels/graphite/module.js
  3. 8 5
      src/config.js

+ 8 - 2
src/app/panels/graphite/legend.html

@@ -18,11 +18,17 @@
 <script type="text/ng-template" id="colorPopup.html">
   <div class="histogram-legend-popover">
     <div class="histogram-legend-popover-header">
+      <a class="close" ng-click="dismiss();" href="">×</a>
+    </div>
+
+    <div class="editor-row">
       <a class="small" ng-click="toggleYAxis(series)">
-        Toggle Y-axis (y&sup2;)
+        2:nd Y-axis (y&sup2;) <input type="checkbox"></input>
       </a>
+    </div>
 
-      <a class="close" ng-click="dismiss();" href="">×</a>
+    <div class="editor-row">
+      Fill style <select class="input-mini" ng-model="panel.aliasFillStyle[series.alias]" ng-options="f for f in ['no', 'all', 'null']" ng-change="get_data()"></select>
     </div>
 
     <div class="editor-row">

+ 12 - 12
src/app/panels/graphite/module.js

@@ -217,7 +217,8 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
       targets: [],
 
       aliasColors: {},
-      aliasYAxis: {}
+      aliasYAxis: {},
+      aliasFillStyle: {}
     };
 
     _.defaults($scope.panel,_d);
@@ -338,15 +339,18 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
       if(results.length === 0 ) {
         return [];
       }
+      _.each(results, function(targetData) {
+        var alias = targetData.target;
+        var color = $scope.panel.aliasColors[alias] || $scope.colors[data.length];
+        var yaxis = $scope.panel.aliasYAxis[alias] || 1;
 
-      var tsOpts = {
-        interval: $scope.interval,
-        start_date: $scope.range && $scope.range.from,
-        end_date: $scope.range && $scope.range.to,
-        fill_style: 'no'
-      };
+        var tsOpts = {
+          interval: $scope.interval,
+          start_date: $scope.range && $scope.range.from,
+          end_date: $scope.range && $scope.range.to,
+          fill_style: $scope.panel.aliasFillStyle[alias] || 'no',
+        };
 
-      _.each(results, function(targetData) {
         var time_series = new timeSeries.ZeroFilled(tsOpts);
 
         _.each(targetData.datapoints, function(valueArray) {
@@ -355,10 +359,6 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
           }
         });
 
-        var alias = targetData.target;
-        var color = $scope.panel.aliasColors[alias] || $scope.colors[data.length];
-        var yaxis = $scope.panel.aliasYAxis[alias] || 1;
-
         var seriesInfo = {
           alias: alias,
           color:  color,

+ 8 - 5
src/config.js

@@ -1,6 +1,6 @@
 /** @scratch /configuration/config.js/1
  * == Configuration
- * config.js is where you will find the core Kibana configuration. This file contains parameter that
+ * config.js is where you will find the core Grafana configuration. This file contains parameter that
  * must be set before kibana is run for the first time.
  */
 define(['settings'],
@@ -16,13 +16,15 @@ function (Settings) {
      * ==== elasticsearch
      *
      * The URL to your elasticsearch server. You almost certainly don't
-     * want +http://localhost:9200+ here. Even if Kibana and Elasticsearch are on
+     * want +http://localhost:9200+ here. Even if Grafana and Elasticsearch are on
      * the same host. By default this will attempt to reach ES at the same host you have
-     * kibana installed on. You probably want to set it to the FQDN of your
+     * Grafana installed on. You probably want to set it to the FQDN of your
      * elasticsearch host
      */
     elasticsearch: "http://"+window.location.hostname+":9200",
 
+    graphiteUrl: "http://"+window.location.hostname+":8080",
+
     /** @scratch /configuration/config.js/5
      * ==== default_route
      *
@@ -35,12 +37,13 @@ function (Settings) {
     default_route     : '/dashboard/file/default.json',
 
     /** @scratch /configuration/config.js/5
-     * ==== kibana-int
+     * ==== Grafana-int
      *
-     * The default ES index to use for storing Kibana specific object
+     * The default ES index to use for storing Grafana specific object
      * such as stored dashboards
      */
     kibana_index: "kibana-int",
+    grafana_index: "grafana-int",
 
     /** @scratch /configuration/config.js/5
      * ==== panel_name