Commit a608b809 by Rashid Khan

switch field input to text input if no fields list exists

parent ed0056dd
...@@ -13,8 +13,11 @@ ...@@ -13,8 +13,11 @@
<td width="97%" style="padding-right:20px"> <td width="97%" style="padding-right:20px">
<input type="text" style="width:100%" ng-model="panel.query"> <input type="text" style="width:100%" ng-model="panel.query">
</td> </td>
<td> <td ng-show="panel.fields.length > 0">
<select class="input-small" ng-model="panel.field" ng-options="f for f in fields"></select> <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>
<td style="margin-left:20px" width="1%"> <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> <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', []) ...@@ -30,6 +30,7 @@ angular.module('kibana.derivequeries', [])
query : "*", query : "*",
group : "default", group : "default",
field : '_type', field : '_type',
fields : [],
spyable : true, spyable : true,
size : 5, size : 5,
exclude : [] exclude : []
...@@ -38,9 +39,7 @@ angular.module('kibana.derivequeries', []) ...@@ -38,9 +39,7 @@ angular.module('kibana.derivequeries', [])
$scope.init = function() { $scope.init = function() {
eventBus.register($scope,'fields', function(event, fields) { eventBus.register($scope,'fields', function(event, fields) {
$scope.panel.sort = _.clone(fields.sort); $scope.panel.fields = fields.all;
$scope.fields = fields.all,
$scope.active = _.clone(fields.active);
}); });
eventBus.register($scope,'time', function(event,time){set_time(time)}); eventBus.register($scope,'time', function(event,time){set_time(time)});
eventBus.register($scope,'query', function(event, query) { eventBus.register($scope,'query', function(event, query) {
......
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