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

Added All Value support for custom type templating

utkarshcmu 10 лет назад
Родитель
Сommit
c5435596ad

+ 17 - 0
public/app/features/templating/partials/editor.html

@@ -146,6 +146,23 @@
 							</ul>
 							<div class="clearfix"></div>
 						</div>
+            <div class="tight-form">
+              <ul class="tight-form-list">
+                <li class="tight-form-item" style="width: 100px;">
+                  <editor-checkbox text="All value" model="current.includeAll" change="runQuery()"></editor-checkbox>
+                </li>
+                <li ng-show="current.includeAll">
+                  <input type="text" class="input-xlarge tight-form-input" style="width:364px" ng-model='current.options[0].value'></input>
+                </li>
+                <li class="tight-form-item" ng-show="current.includeAll">
+                  All format
+                </li>
+                <li ng-show="current.includeAll">
+                  <select class="input-medium tight-form-input last" ng-model="current.allFormat" ng-change="runQuery()" ng-options="f for f in ['glob', 'wildcard', 'regex wildcard', 'regex values', 'lucene', 'pipe']"></select>
+                </li>
+              </ul>
+              <div class="clearfix"></div>
+            </div>
 					</div>
 
 					<div ng-show="current.type === 'query'">

+ 5 - 0
public/app/features/templating/templateValuesSrv.js

@@ -115,6 +115,11 @@ function (angular, _, kbn) {
       if (variable.type === 'interval') {
         self.updateAutoInterval(variable);
       }
+
+      if (variable.type === 'custom' && variable.includeAll) {
+        self.addAllOption(variable);
+      }
+
     };
 
     this.updateOptions = function(variable) {