switch field input to text input if no fields list exists
This commit is contained in:
@@ -13,8 +13,11 @@
|
||||
<td width="97%" style="padding-right:20px">
|
||||
<input type="text" style="width:100%" ng-model="panel.query">
|
||||
</td>
|
||||
<td>
|
||||
<select class="input-small" ng-model="panel.field" ng-options="f for f in fields"></select>
|
||||
<td ng-show="panel.fields.length > 0">
|
||||
<select class="input-small" ng-model="panel.field" ng-options="f for f in panel.fields"></select>
|
||||
</td>
|
||||
<td ng-show="panel.fields.length == 0">
|
||||
<input class="input-small" ng-model="panel.field" type="text"/>
|
||||
</td>
|
||||
<td style="margin-left:20px" width="1%">
|
||||
<button style="margin-top:0px" type="submit" class="btn btn-info" ng-click="get_data()"><i class="icon-search"></i></button>
|
||||
|
||||
@@ -30,6 +30,7 @@ angular.module('kibana.derivequeries', [])
|
||||
query : "*",
|
||||
group : "default",
|
||||
field : '_type',
|
||||
fields : [],
|
||||
spyable : true,
|
||||
size : 5,
|
||||
exclude : []
|
||||
@@ -38,9 +39,7 @@ angular.module('kibana.derivequeries', [])
|
||||
|
||||
$scope.init = function() {
|
||||
eventBus.register($scope,'fields', function(event, fields) {
|
||||
$scope.panel.sort = _.clone(fields.sort);
|
||||
$scope.fields = fields.all,
|
||||
$scope.active = _.clone(fields.active);
|
||||
$scope.panel.fields = fields.all;
|
||||
});
|
||||
eventBus.register($scope,'time', function(event,time){set_time(time)});
|
||||
eventBus.register($scope,'query', function(event, query) {
|
||||
|
||||
Reference in New Issue
Block a user