Sfoglia il codice sorgente

experimenting with new func editor

Torkel Ödegaard 11 anni fa
parent
commit
e186c9b8bc

+ 17 - 0
src/app/directives/ngBlur.js

@@ -17,4 +17,21 @@ function (angular) {
       };
       };
     }]);
     }]);
 
 
+  angular
+    .module('kibana.directives')
+    .directive('dynamicWidth', function() {
+      return {
+        restrict: 'A',
+        link: function postLink(scope, elem, attrs) {
+          var startVal = scope.$eval(attrs.ngModel);
+          elem[0].style.width = ((startVal.length) * 11) + 'px';
+
+          elem.keyup(function() {
+            elem[0].style.width = ((elem.val().length * 11)) + 'px';
+          });
+        }
+      };
+    });
+
+
 });
 });

+ 13 - 3
src/app/partials/graphite/editor.html

@@ -76,9 +76,19 @@
             </ul>
             </ul>
           </li>
           </li>
           <li ng-repeat="func in functions">
           <li ng-repeat="func in functions">
-            <a class="grafana-target-segment grafana-target-function dropdown-toggle" bs-popover="'app/partials/graphite/funcEditor.html'" data-placement="bottom">
-              {{func.text}}
-            </a>
+            <!-- <a  class="grafana-target-segment grafana-target-function dropdown-toggle"
+                bs-popover="'app/partials/graphite/funcEditor.html'"
+                data-placement="bottom">
+              {{func.def.name}}
+            </a> -->
+            <span class="grafana-target-segment grafana-target-function">
+              <span>{{func.def.name}}(</span><span ng-repeat="param in func.def.params">
+                <input  type="text"
+                        class="input-mini grafana-function-param-input"
+                        dynamic-width
+                        ng-model="func.params[$index]"></input>
+              </span><span>)</span>
+            </span>
           </li>
           </li>
           <li class="dropdown" graphite-add-func>
           <li class="dropdown" graphite-add-func>
 
 

File diff suppressed because it is too large
+ 0 - 0
src/css/bootstrap.dark.min.css


File diff suppressed because it is too large
+ 0 - 0
src/css/bootstrap.light.min.css


+ 7 - 0
src/css/less/grafana.less

@@ -281,6 +281,13 @@
   }
   }
 }
 }
 
 
+input[type=text].grafana-function-param-input {
+  background: transparent;
+  border: none;
+  margin: 0;
+  padding: 0;
+}
+
 .grafana-target-controls-left {
 .grafana-target-controls-left {
   list-style: none;
   list-style: none;
   float: left;
   float: left;

Some files were not shown because too many files changed in this diff