Commit 3059870b by Torkel Ödegaard

func editor starting to work

parent 089b1f53
...@@ -132,11 +132,12 @@ function (angular, _, config) { ...@@ -132,11 +132,12 @@ function (angular, _, config) {
$scope.functions = _.without($scope.functions, func); $scope.functions = _.without($scope.functions, func);
}; };
$scope.functionParmsChanged = function(func) { $scope.functionParamsChanged = function(func) {
func.text = func.name + '('; func.text = func.def.name + '(';
_.each(func.def.params, function(param) { _.each(func.def.params, function(param) {
func.text += func.params[param.name]; func.text += func.params[param.name];
}); });
func.text += ')';
}; };
$scope.addFunction = function() { $scope.addFunction = function() {
......
...@@ -95,8 +95,11 @@ ...@@ -95,8 +95,11 @@
<i class="icon-long-arrow-right"></i> <i class="icon-long-arrow-right"></i>
</span> </span>
<ul> <ul>
<li>
groupByNode( <input type="text" class="func-param" value="1"
</li>
<li ng-repeat="func in functions"> <li ng-repeat="func in functions">
<a bs-popover="'app/panels/graphite/funcEditor.html'" data-placement="top">{{func.text}}</a> <a bs-popover="'app/panels/graphite/funcEditor.html'" data-placement="bottom">{{func.text}}</a>
<i class="icon-long-arrow-right"></i> <i class="icon-long-arrow-right"></i>
</li> </li>
<li> <li>
......
<div class="grafana-func-editor">
<div class="row-fluid">
<a ng-click="removeFunction(func)">
Remove
</a>
|
<a ng-click="disableFunction(func)">
Disable
</a>
|
<a ng-click="helpFunction(func)">
Help
</a>
|
<a ng-click="dismiss()">
Close
</a>
</div>
<div class="editor-row">
<div class="section">
<div class="editor-option" ng-repeat="param in func.def.params">
<label class="small">{{param.name}}</label>
<input ng-if="param.type === 'int'"
placeholder="seconds"
focus-me="true"
class="input-mini"
ng-change="functionParamsChanged(func)" ng-model-onblur
ng-model="func.params[param.name]" />
<select ng-if="param.type === 'node'"
class="input-mini"
ng-model="func.params[param.name]"
ng-change="functionParamsChanged(func)"
ng-options="f for f in [1,2,3,4,5,6,7,8,9,10]">
</select>
<select ng-if="param.type === 'function'"
class="input-small"
ng-change="functionParamsChanged(func)"
ng-model="func.params[param.name]"
ng-options="f for f in ['sumSeries', 'avgSeries']">
</select>
</div>
</div>
</div>
<!-- <div class="row-fluid">
<div class="pull-left">
<input ng-if="param.type === 'int'"
placeholder="seconds"
focus-me="true"
class="input-mini"
ng-model="func.params[param.name]" />
<select ng-if="param.type === 'node'"
class="input-mini"
ng-model="func.params[param.name]"
ng-options="f for f in [1,2,3,4,5,6,7,8,9,10]">
</select>
<select ng-if="param.type === 'function'"
class="input-small"
ng-model="func.params[param.name]"
ng-options="f for f in ['sumSeries', 'avgSeries']">
</select>
</div>
</div>
--></div>
\ 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