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

Started work on annotations submenu control

Torkel Odegaard 12 лет назад
Родитель
Сommit
0e3c0fcc2e

+ 0 - 1
src/app/dashboards/default.json

@@ -42,7 +42,6 @@
           "span": 12,
           "span": 12,
           "editable": true,
           "editable": true,
           "type": "graphite",
           "type": "graphite",
-          "loadingEditor": false,
           "x-axis": true,
           "x-axis": true,
           "y-axis": true,
           "y-axis": true,
           "scale": 1,
           "scale": 1,

+ 8 - 0
src/app/panels/annotations/module.html

@@ -0,0 +1,8 @@
+<div ng-controller='AnnotationsCtrl' ng-init="init()">
+
+  <div class="submenu-toggle">
+    <label class="small" for="showAnnotations">Hide</label>
+    <input type="checkbox" id="showAnnotations"></label>
+  </div>
+
+</div>

+ 44 - 0
src/app/panels/annotations/module.js

@@ -0,0 +1,44 @@
+/*
+
+  ## annotations
+
+*/
+define([
+  'angular',
+  'app',
+  'underscore'
+],
+function (angular, app, _) {
+  'use strict';
+
+  var module = angular.module('kibana.panels.annotations', []);
+  app.useModule(module);
+
+  module.controller('AnnotationsCtrl', function($scope) {
+
+    $scope.panelMeta = {
+      status  : "Stable",
+      description : "Annotations"
+    };
+
+    // Set and populate defaults
+    var _d = {
+    };
+    _.defaults($scope.panel,_d);
+
+    $scope.init = function() {
+      $scope.panel.annotations = [
+        {
+          type: 'graphite-target',
+          target: 'metric'
+        },
+        {
+          type: 'graphite-target',
+          target: 'metric2'
+        }
+      ];
+    };
+
+
+  });
+});

+ 9 - 6
src/app/panels/filtering/module.html

@@ -5,7 +5,6 @@
     }
     }
     .filtering-container label {
     .filtering-container label {
       float: left;
       float: left;
-      font-size: inherit;
     }
     }
     .filtering-container input[type=checkbox] {
     .filtering-container input[type=checkbox] {
       margin: 0;
       margin: 0;
@@ -13,11 +12,14 @@
     .filter-panel-filter {
     .filter-panel-filter {
       display:inline-block;
       display:inline-block;
       vertical-align: top;
       vertical-align: top;
-      padding: 3px 10px 0px 10px;
+      padding: 4px 10px 3px 10px;
       border-right: 1px solid #202020;
       border-right: 1px solid #202020;
     }
     }
+    .filter-panel-filter:first-child {
+      padding-left: 0;
+    }
     .filter-panel-filter ul {
     .filter-panel-filter ul {
-      margin-bottom: 3px;
+      margin-bottom: 0px;
     }
     }
 
 
     .filter-deselected {
     .filter-deselected {
@@ -25,12 +27,13 @@
     }
     }
     .filter-action {
     .filter-action {
       float:right;
       float:right;
+      padding-right: 2px;
       margin-bottom: 0px !important;
       margin-bottom: 0px !important;
-      margin-left: 3px;
+      margin-left: 0px;
       margin-top: 4px;
       margin-top: 4px;
     }
     }
     .add-filter-action {
     .add-filter-action {
-      padding: 3px 10px 0px 10px;
+      padding: 3px 10px 0px 5px;
       position: relative;
       position: relative;
       top: 4px;
       top: 4px;
     }
     }
@@ -78,7 +81,7 @@
             <input type='text' ng-model="filter.query">
             <input type='text' ng-model="filter.query">
           </li>
           </li>
           <li>
           <li>
-            <label for="includeAll">Include all</label>:
+            <label for="includeAll">Include all:</label>
             <input id="includeAll" type='checkbox' ng-model="filter.includeAll">
             <input id="includeAll" type='checkbox' ng-model="filter.includeAll">
           </li>
           </li>
         </ul>
         </ul>

+ 0 - 1
src/app/panels/graphite/module.js

@@ -225,7 +225,6 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
       $scope.panel.tooltip.query_as_alias = true;
       $scope.panel.tooltip.query_as_alias = true;
 
 
       $scope.get_data();
       $scope.get_data();
-
     };
     };
 
 
     $scope.remove_panel_from_row = function(row, panel) {
     $scope.remove_panel_from_row = function(row, panel) {

+ 16 - 2
src/app/partials/dashboard.html

@@ -1,13 +1,27 @@
 <!-- is there a better way to repeat without actually affecting the page? -->
 <!-- is there a better way to repeat without actually affecting the page? -->
-<div class="filter-pulldown" ng-repeat="pulldown in dashboard.current.pulldowns" ng-controller="PulldownCtrl" ng-show="pulldown.enable">
+<!-- <div class="filter-pulldown" ng-controller="PulldownCtrl" ng-show="pulldown.enable">
   <div class="top-row-close pointer pull-left" ng-click="toggle_pulldown(pulldown);dismiss();" bs-tooltip="'Toggle '+pulldown.type" data-placement="bottom">
   <div class="top-row-close pointer pull-left" ng-click="toggle_pulldown(pulldown);dismiss();" bs-tooltip="'Toggle '+pulldown.type" data-placement="bottom">
     <span class="small"><strong>{{pulldown.type}}</strong></span>
     <span class="small"><strong>{{pulldown.type}}</strong></span>
   </div>
   </div>
   <div class="top-row-open" ng-hide="pulldown.collapse">
   <div class="top-row-open" ng-hide="pulldown.collapse">
-    <kibana-simple-panel type="pulldown.type" ng-cloak></kibana-simple-panel>
+    <kibana-simple-panel type="filtering" ng-cloak></kibana-simple-panel>
+    <kibana-simple-panel type="annotations" ng-cloak></kibana-simple-panel>
+  </div>
+  <div class="clearfix"></div>
+</div> -->
+
+<div class="submenu-controls">
+  <div class="submenu-panel" ng-repeat="pulldown in dashboard.current.pulldowns | filter:{ enable: true }">
+    <div class="submenu-panel-title">
+      <span class="small"><strong>{{pulldown.type}}:</strong></span>
+    </div>
+    <div class="submenu-panel-wrapper">
+      <kibana-simple-panel type="pulldown.type" ng-cloak></kibana-simple-panel>
+    </div>
   </div>
   </div>
   <div class="clearfix"></div>
   <div class="clearfix"></div>
 </div>
 </div>
+
 <div class="clearfix"></div>
 <div class="clearfix"></div>
 <div class="container-fluid main" ng-class="{'grafana-dashboard-hide-controls': dashboard.current.hideControls}">
 <div class="container-fluid main" ng-class="{'grafana-dashboard-hide-controls': dashboard.current.hideControls}">
   <div>
   <div>

+ 10 - 1
src/app/services/dashboard.js

@@ -27,7 +27,7 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
       failover: false,
       failover: false,
       panel_hints: true,
       panel_hints: true,
       rows: [],
       rows: [],
-      pulldowns: [ { type: 'filtering' } ],
+      pulldowns: [ { type: 'filtering' },  { type: 'annotations' } ],
       nav: [ { type: 'timepicker' } ],
       nav: [ { type: 'timepicker' } ],
       services: {},
       services: {},
       loader: {
       loader: {
@@ -131,6 +131,15 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
         });
         });
       }
       }
 
 
+      var annotations = _.findWhere(dashboard.pulldowns, {type: 'annotations'});
+      if (!annotations) {
+        dashboard.pulldowns.push({
+          type: 'annotations',
+          enable: false,
+          collapse: true
+        });
+      }
+
       return dashboard;
       return dashboard;
     };
     };
 
 

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/css/bootstrap.dark.min.css


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/css/bootstrap.light.min.css


+ 25 - 5
src/vendor/bootstrap/less/grafana.less

@@ -37,17 +37,37 @@
   }
   }
 }
 }
 
 
-.filter-pulldown {
+.submenu-controls {
   background: #292929;
   background: #292929;
+  font-size: inherit;
+  label {
+    margin: 0;
+    padding-right: 4px;
+    display: inline;
+  }
+  input[type=checkbox] {
+    margin: 0;
+  }
 }
 }
 
 
-.top-row-close {
+.submenu-panel {
+  padding: 0 10px 0 17px;
   border-right: 1px solid #202020;
   border-right: 1px solid #202020;
+  float: left;
+}
+
+.submenu-panel-title {
+  float: left;
+  text-transform: uppercase;
+  padding: 3px 10px 0 0;
 }
 }
-.top-row-open {
+
+.submenu-panel-wrapper {
   float: left;
   float: left;
-  padding: 0px;
-  background: none;
+}
+
+.submenu-toggle {
+  padding: 3px 0;
 }
 }
 
 
 .row-button {
 .row-button {

+ 0 - 22
src/vendor/bootstrap/less/overrides.less

@@ -222,28 +222,6 @@ form input.ng-invalid {
   margin: 0px 10px;
   margin: 0px 10px;
 }
 }
 
 
-.row-close {
-  padding: 0px;
-  margin: 0px;
-  min-height: 30px !important;
-  line-height: 30px;
-  background: @kibanaPanelBackground;
-}
-
-.top-row-open {
-  background: @navbarBackground;
-  padding: 5px 25px 5px 25px;
-}
-
-.top-row-close {
-  padding: 5px 10px;
-  text-transform: uppercase;
-  margin: 0px;
-  text-align: left;
-  min-height: 16px !important;
-  line-height: 16px;
-}
-
 .row-open {
 .row-open {
   margin-top: 5px;
   margin-top: 5px;
   left:-34px;
   left:-34px;

Некоторые файлы не были показаны из-за большого количества измененных файлов