Commit 691b763c by Torkel Ödegaard

added text edit mode to targets

parent 8308d95e
...@@ -16,6 +16,7 @@ function (angular, _, config, graphiteFunctions, Parser) { ...@@ -16,6 +16,7 @@ function (angular, _, config, graphiteFunctions, Parser) {
$scope.functions = []; $scope.functions = [];
$scope.segments = []; $scope.segments = [];
$scope.funcDefs = graphiteFunctions; $scope.funcDefs = graphiteFunctions;
$scope.showTextEditor = false;
var parser = new Parser($scope.target.target); var parser = new Parser($scope.target.target);
var astNode = parser.getAst(); var astNode = parser.getAst();
......
...@@ -6,7 +6,10 @@ ...@@ -6,7 +6,10 @@
<span class="grafana-target-onoff"> <span class="grafana-target-onoff">
<i class="icon-eye-open"></i> <i class="icon-eye-open"></i>
</span> </span>
<ul class="grafana-segment-list" role="menu">
<input type="text" class="grafana-target-text-input" ng-model="target.target" focus-me="showTextEditor" ng-blur="showTextEditor = false" ng-show="showTextEditor" />
<ul class="grafana-segment-list" role="menu" ng-hide="showTextEditor">
<li class="dropdown" ng-repeat="segment in segments" role="menuitem"> <li class="dropdown" ng-repeat="segment in segments" role="menuitem">
<a tabindex="1" <a tabindex="1"
class="grafana-target-segment dropdown-toggle" class="grafana-target-segment dropdown-toggle"
...@@ -24,7 +27,7 @@ ...@@ -24,7 +27,7 @@
</ul> </ul>
<ul class="grafana-target-controls"> <ul class="grafana-target-controls">
<li> <li>
<a class="pointer" tabindex="1" ng-click="enableTextEditor()"> <a class="pointer" tabindex="1" ng-click="showTextEditor = true">
<i class="icon-pencil"></i> <i class="icon-pencil"></i>
</a> </a>
</li> </li>
...@@ -43,7 +46,7 @@ ...@@ -43,7 +46,7 @@
</div> </div>
</div> </div>
<div class="grafana-target-func-panel-wrapper"> <div class="grafana-target-func-panel-wrapper" ng-hide="showTextEditor">
<div class="grafana-target-func-panel"> <div class="grafana-target-func-panel">
<span class="grafana-target-func-panel-icon"> <span class="grafana-target-func-panel-icon">
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -155,6 +155,15 @@ ...@@ -155,6 +155,15 @@
} }
} }
input[type=text].grafana-target-text-input {
padding: 2px 6px;
margin: 2px;
background: transparent;
width: 80%;
float: left;
border: none;
}
.grafana-target .dropdown { .grafana-target .dropdown {
padding: 0; margin: 0; padding: 0; margin: 0;
} }
......
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