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

Moved function definition out of template.

Marco Vito Moscaritolo 11 лет назад
Родитель
Сommit
6fb36acc9a
2 измененных файлов с 6 добавлено и 1 удалено
  1. 1 0
      src/app/controllers/influxTargetCtrl.js
  2. 5 1
      src/app/partials/influxdb/editor.html

+ 1 - 0
src/app/controllers/influxTargetCtrl.js

@@ -15,6 +15,7 @@ function (angular) {
         $scope.target.function = 'mean';
       }
 
+      $scope.functions = ['count', 'mean', 'sum', 'min', 'max', 'mode', 'distinct', 'median', 'derivative', 'stddev', 'first', 'last'];
       $scope.oldSeries = $scope.target.series;
       $scope.$on('typeahead-updated', function(){
         $timeout($scope.get_data);

+ 5 - 1
src/app/partials/influxdb/editor.html

@@ -74,7 +74,11 @@
             function
           </li>
           <li>
-            <select class="input-medium grafana-target-segment-input"  ng-change="get_data()" ng-model="target.function" ng-options="f for f in ['count', 'mean', 'sum', 'min', 'max', 'mode', 'distinct', 'median', 'derivative', 'stddev', 'first', 'last']" ></select>
+            <select class="input-medium grafana-target-segment-input"
+                    ng-change="get_data()"
+                    ng-model="target.function"
+                    ng-options="f for f in functions" ></select>
+          </li>
           </li>
           <li class="grafana-target-segment">
             group by time