Commit 18c70835 by Rashid Khan

Added failover index setting

parent f2553f8e
......@@ -5,18 +5,25 @@
</div>
<div class="span3">
<h6>Time Field</h6>
<input type="text" class="input-small" ng-model="panel.timefield" ng-change="get_data()">
<input type="text" class="input-small" ng-model="panel.timefield">
</div>
<div class="span6">
</div>
<div class="row-fluid">
<h5>Index Settings</h5>
<div class="span5">
<h6>Index pattern <small>Absolutes in double quotes</small></h6>
<input type="text" class="input-large" ng-model="panel.index" ng-change="get_data()">
<input type="text" class="input-medium" ng-model="panel.index">
</div>
<div class="span5">
<h6>Failover Index <small>If none match the pattern</small></h6>
<input type="text" class="input-medium" ng-model="panel.defaultindex">
</div>
</div>
<div class="row-fluid">
<h5>Relative mode <small>settings</small></h5>
<div class="span8">
<h6>Relative time options <small>comma seperated</small></h6>
<input type="text" array-join class="input-large" ng-model="panel.time_options" ng-change="get_data()">
<input type="text" array-join class="input-large" ng-model="panel.time_options">
</div>
<div class="span3">
<h6>Default timespan</h6>
......
......@@ -35,6 +35,7 @@ angular.module('kibana.timepicker', [])
timespan : '15m',
timefield : '@timestamp',
index : '"logstash-"yyyy.mm.dd',
defaultindex : "NOINDEX",
group : "default",
refresh : {
enable : false,
......@@ -195,7 +196,9 @@ angular.module('kibana.timepicker', [])
});
return all_indices().then(function(p) {
return _.intersection(p,possible);
var indices = _.intersection(p,possible);
console.log(indices)
return indices.length == 0 ? [$scope.panel.defaultindex] : indices;
})
};
......
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