working on graphite target editor

This commit is contained in:
Torkel Ödegaard
2013-12-20 08:18:08 +01:00
parent 56b3443268
commit 8e69f82553
4 changed files with 84 additions and 8 deletions
+15 -2
View File
@@ -1,7 +1,8 @@
define([
'angular',
'underscore'
],
function (angular) {
function (angular, _) {
'use strict';
var module = angular.module('kibana.controllers');
@@ -9,7 +10,19 @@ function (angular) {
module.controller('GraphiteTargetCtrl', function($scope) {
$scope.init = function() {
console.log('target:', $scope.target);
$scope.segments = [];
var strSegments = $scope.target.target.split('.');
_.each(strSegments, function (segment, index) {
if (segment === '*') {
segment = '<i class="icon-asterisk"><i>';
}
$scope.segments[index] = { val: segment };
});
};
$scope.setSegmentStar = function (index) {
$scope.segments[index] = {val: '<i class="icon-asterisk"><i>' };
};
$scope.targetChanged = function() {