Commit 56b34432 by Torkel Ödegaard

began work on graphite target editor

parent 591846c8
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
"globals": { "globals": {
"define": true, "define": true,
"require": true, "require": true,
"Chromath": false "Chromath": false,
"setImmediate": true
} }
} }
\ No newline at end of file
...@@ -5,5 +5,6 @@ define([ ...@@ -5,5 +5,6 @@ define([
'./pulldown', './pulldown',
'./zoom', './zoom',
'./search', './search',
'./metricKeys' './metricKeys',
'./graphiteTarget'
], function () {}); ], function () {});
\ No newline at end of file
define([
'angular',
],
function (angular) {
'use strict';
var module = angular.module('kibana.controllers');
module.controller('GraphiteTargetCtrl', function($scope) {
$scope.init = function() {
console.log('target:', $scope.target);
};
$scope.targetChanged = function() {
$scope.$parent.get_data();
$scope.editMode = false;
};
$scope.edit = function() {
$scope.editMode = true;
};
});
});
\ No newline at end of file
...@@ -16,10 +16,10 @@ function (angular, _, config, $) { ...@@ -16,10 +16,10 @@ function (angular, _, config, $) {
$scope.giveSearchFocus = 0; $scope.giveSearchFocus = 0;
$scope.selectedIndex = null; $scope.selectedIndex = null;
keyboardManager.bind('shift+s', function() { /*keyboardManager.bind('shift+s', function() {
$element.find('.dropdown').addClass('open'); $element.find('.dropdown').addClass('open');
$scope.giveSearchFocus += 1; $scope.giveSearchFocus += 1;
}); });*/
keyboardManager.bind('esc', function() { keyboardManager.bind('esc', function() {
$element.find('.dropdown').removeClass('open'); $element.find('.dropdown').removeClass('open');
......
<div class="editor-row"> <div class="editor-row">
<div ng-repeat="target in panel.targets"> <div ng-repeat="target in panel.targets" ng-controller="GraphiteTargetCtrl">
<div class="row-fluid"> <div class="row-fluid">
<div class="span12"> <div class="span12">
<input type="text" ng-model="target.target" class="input-large" style="width:95%" ng-model-onblur ng-change="get_data()" bs-typeahead="typeAheadSource" data-min-length=0 /> <span ng-if="!editMode">
<i ng-click="panel.targets = _.without(panel.targets, target)" class="pointer icon-remove" style="position: relative; top: -5px; left: 5px;"></i> {{target.target}}
</span>
<input ng-if="editMode" type="text" ng-model="target.target" class="input-large" style="width:100%" ng-model-onblur ng-change="targetChanged()" bs-typeahead="typeAheadSource" data-min-length=0 />
<span ng-if="!editMode">
<i ng-click="edit()" class="pointer icon-edit" style="padding: 0 7px;"></i>
<i ng-click="panel.targets = _.without(panel.targets, target)" class="pointer icon-remove" style="padding: 0 7px;"></i>
</span>
</div> </div>
</div> </div>
</div> </div>
......
<div ng-controller='graphite' ng-init="init()" style="min-height:{{panel.height || row.height}}" ng-class='{"panel-full-edit-mode": inEditMode}'> <div ng-controller='graphite' ng-init="init()" style="min-height:{{panel.height || row.height}}" ng-class='{"panel-full-edit": inEditMode}'>
<style> <style>
.histogram-legend { .histogram-legend {
display:inline-block; display:inline-block;
...@@ -86,6 +86,7 @@ ...@@ -86,6 +86,7 @@
<div histogram-chart class="pointer histogram-chart" params="{{panel}}"> <div histogram-chart class="pointer histogram-chart" params="{{panel}}">
</div> </div>
<div class="grafana-legend-container">
<span ng-show="panel.legend" ng-repeat='series in legend' class="histogram-legend"> <span ng-show="panel.legend" ng-repeat='series in legend' class="histogram-legend">
<i class='icon-circle' ng-style="{color: series.color}"></i> <i class='icon-circle' ng-style="{color: series.color}"></i>
<span class='small histogram-legend-item'> <span class='small histogram-legend-item'>
...@@ -93,8 +94,9 @@ ...@@ -93,8 +94,9 @@
<span ng-if="!panel.show_query">{{series.alias}}</span> <span ng-if="!panel.show_query">{{series.alias}}</span>
</span> </span>
</span> </span>
</div>
<div class="fluid-row panel-full-edit-mode-controls" ng-show="inEditMode" style="margin: 20px;"> <div class="fluid-row panel-full-edit-controls" ng-show="inEditMode">
<div ng-model="editor.index" bs-tabs> <div ng-model="editor.index" bs-tabs>
<div ng-repeat="tab in setEditorTabs(panelMeta)" data-title="{{tab}}"> <div ng-repeat="tab in setEditorTabs(panelMeta)" data-title="{{tab}}">
</div> </div>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
//display: none; //display: none;
} }
.panel-full-edit-mode { .panel-full-edit {
z-index: 1500; z-index: 1500;
display: block; display: block;
position: fixed; position: fixed;
...@@ -81,3 +81,17 @@ ...@@ -81,3 +81,17 @@
padding: 0 10px 10px 10px; padding: 0 10px 10px 10px;
background: #202328; background: #202328;
} }
.grafana-legend-container {
text-align: center;
}
.panel-full-edit-controls {
margin: 11px;
.nav-tabs > li > a {
line-height: 15px;
padding-top: 6px;
padding-bottom: 6px;
font-size: 0.8rem;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment