Hiding hidden indices by default (option to show).
This commit is contained in:
parent
5ecd51cfd7
commit
5719ea85db
2 changed files with 36 additions and 13 deletions
|
@ -10,11 +10,17 @@
|
|||
<label class="small">Persistent id field <tip>choose a field that does not change on node restart</tip></label>
|
||||
<input type="text" bs-typeahead="fields.list" class="input-large" ng-model="panel.persistent_field"/>
|
||||
</div>
|
||||
<div class="editor-option" ng-show="panel.mode != 'count'">
|
||||
<div class="editor-option">
|
||||
<label class="small">Display field <tip>will be used as the name of each row</tip></label>
|
||||
<input type="text" bs-typeahead="fields.list" class="input-large" ng-model="panel.display_field"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" ng-show="panel.mode == 'indices'">
|
||||
<div class="editor-option">
|
||||
<label class="small">Show hidden indices <tip>indices whose name starts with a dot (`.`) are considered hidden</tip></label>
|
||||
<input type="checkbox" ng-model="panel.show_hidden"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid">
|
||||
|
|
|
@ -18,7 +18,7 @@ define([
|
|||
modals: [],
|
||||
editorTabs: [],
|
||||
status: "Experimental",
|
||||
description: "An overview of cluster health, by node."
|
||||
description: "A stats table for nodes or nodes"
|
||||
};
|
||||
|
||||
// Set and populate defaults
|
||||
|
@ -41,7 +41,8 @@ define([
|
|||
defaults: {
|
||||
display_field: "node.name",
|
||||
persistent_field: "node.transport_address",
|
||||
metrics: [ 'process.cpu.percent', 'os.load_average.1m', 'os.mem.used_percent', 'fs.data.available_in_bytes' ]
|
||||
metrics: [ 'process.cpu.percent', 'os.load_average.1m', 'os.mem.used_percent', 'fs.data.available_in_bytes' ],
|
||||
show_hidden: true
|
||||
},
|
||||
availableMetrics: [
|
||||
{
|
||||
|
@ -88,7 +89,8 @@ define([
|
|||
defaults: {
|
||||
display_field: null,
|
||||
persistent_field: 'index',
|
||||
metrics: [ 'primaries.docs.count', 'primaries.indexing.index_total', 'total.search.query_total', 'total.merges.current' ]
|
||||
metrics: [ 'primaries.docs.count', 'primaries.indexing.index_total', 'total.search.query_total', 'total.merges.current' ],
|
||||
show_hidden: false
|
||||
},
|
||||
availableMetrics: [
|
||||
{
|
||||
|
@ -142,10 +144,14 @@ define([
|
|||
return m;
|
||||
};
|
||||
|
||||
_.defaults($scope.panel, $scope.modeInfo[$scope.panel.mode].defaults);
|
||||
|
||||
|
||||
$scope.panel.metrics = _.map($scope.panel.metrics, function (m) {
|
||||
return metricDefaults(m);
|
||||
});
|
||||
|
||||
|
||||
$scope.$watch('panel.mode', function (m) {
|
||||
if (_.isUndefined(m)) {
|
||||
return;
|
||||
|
@ -158,6 +164,10 @@ define([
|
|||
_.throttle($scope.get_rows(), 500);
|
||||
});
|
||||
|
||||
$scope.$watch('panel.show_hidden', function () {
|
||||
_.throttle($scope.get_rows(), 500);
|
||||
});
|
||||
|
||||
$scope.init = function () {
|
||||
$scope.warnLevels = {};
|
||||
$scope.rows = [];
|
||||
|
@ -178,19 +188,24 @@ define([
|
|||
var
|
||||
request,
|
||||
filter,
|
||||
results;
|
||||
results,
|
||||
facet;
|
||||
|
||||
filter = filterSrv.getBoolFilter(filterSrv.ids);
|
||||
filter.must($scope.get_mode_filter());
|
||||
|
||||
request = $scope.ejs.Request().indices(dashboard.indices).size(0).searchType("count");
|
||||
request.facet(
|
||||
$scope.ejs.TermsFacet('terms')
|
||||
.field($scope.panel.persistent_field)
|
||||
.size(9999999)
|
||||
.order('term')
|
||||
.facetFilter(filter)
|
||||
);
|
||||
facet = $scope.ejs.TermsFacet('terms')
|
||||
.field($scope.panel.persistent_field)
|
||||
.size(9999999)
|
||||
.order('term')
|
||||
.facetFilter(filter);
|
||||
|
||||
if (!$scope.panel.show_hidden) {
|
||||
facet.regex("[^.].*");
|
||||
}
|
||||
|
||||
request.facet(facet);
|
||||
|
||||
results = request.doSearch();
|
||||
|
||||
|
@ -370,7 +385,9 @@ define([
|
|||
};
|
||||
|
||||
$scope.get_sort_value = function (row) {
|
||||
if ($scope.panel.sort[0] === '__name__') return row.display_name;
|
||||
if ($scope.panel.sort[0] === '__name__') {
|
||||
return row.display_name;
|
||||
}
|
||||
return $scope.data[row.id + '_' + $scope.panel.sort[0]].mean;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue