mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
Merge pull request #6759 from bevacqua/feature/config-switch-dow
Added advanced setting to tweak starting day of week
This commit is contained in:
commit
40b2645db9
5 changed files with 34 additions and 25 deletions
|
@ -1,7 +1,7 @@
|
||||||
[[kibana-settings-reference]]
|
[[kibana-settings-reference]]
|
||||||
|
|
||||||
WARNING: Modifying the following settings can signficantly affect Kibana's performance and cause problems that are
|
WARNING: Modifying the following settings can signficantly affect Kibana's performance and cause problems that are
|
||||||
difficult to diagnose. Setting a property's value to a blank field will revert to the default behavior, which may not be
|
difficult to diagnose. Setting a property's value to a blank field will revert to the default behavior, which may not be
|
||||||
compatible with other configuration settings. Deleting a custom setting removes it from Kibana permanently.
|
compatible with other configuration settings. Deleting a custom setting removes it from Kibana permanently.
|
||||||
|
|
||||||
.Kibana Settings Reference
|
.Kibana Settings Reference
|
||||||
|
@ -10,38 +10,39 @@ compatible with other configuration settings. Deleting a custom setting removes
|
||||||
`sort:options`:: Options for the Elasticsearch https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html[sort] parameter.
|
`sort:options`:: Options for the Elasticsearch https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html[sort] parameter.
|
||||||
`dateFormat`:: The format to use for displaying pretty-formatted dates.
|
`dateFormat`:: The format to use for displaying pretty-formatted dates.
|
||||||
`dateFormat:tz`:: The timezone that Kibana uses. The default value of `Browser` uses the timezone detected by the browser.
|
`dateFormat:tz`:: The timezone that Kibana uses. The default value of `Browser` uses the timezone detected by the browser.
|
||||||
`dateFormat:scaled`:: These values define the format used to render ordered time-based data. Formatted timestamps must
|
`dateFormat:scaled`:: These values define the format used to render ordered time-based data. Formatted timestamps must
|
||||||
|
`dateFormat:dow`:: This property defines what day weeks should start on.
|
||||||
adapt to the interval between measurements. Keys are http://en.wikipedia.org/wiki/ISO_8601#Time_intervals[ISO8601 intervals].
|
adapt to the interval between measurements. Keys are http://en.wikipedia.org/wiki/ISO_8601#Time_intervals[ISO8601 intervals].
|
||||||
`defaultIndex`:: Default is `null`. This property specifies the default index.
|
`defaultIndex`:: Default is `null`. This property specifies the default index.
|
||||||
`metaFields`:: An array of fields outside of `_source`. Kibana merges these fields into the document when displaying the
|
`metaFields`:: An array of fields outside of `_source`. Kibana merges these fields into the document when displaying the
|
||||||
document.
|
document.
|
||||||
`defaultColumns`:: Default is `_source`. Defines the columns that appear by default on the Discover page.
|
`defaultColumns`:: Default is `_source`. Defines the columns that appear by default on the Discover page.
|
||||||
`discover:sampleSize`:: The number of rows to show in the Discover table.
|
`discover:sampleSize`:: The number of rows to show in the Discover table.
|
||||||
`doc_table:highlight`:: Highlight results in Discover and Saved Searches Dashboard. Highlighing makes request slow when
|
`doc_table:highlight`:: Highlight results in Discover and Saved Searches Dashboard. Highlighing makes request slow when
|
||||||
working on big documents. Set this property to `false` to disable highlighting.
|
working on big documents. Set this property to `false` to disable highlighting.
|
||||||
`courier:maxSegmentCount`:: Kibana splits requests in the Discover app into segments to limit the size of requests sent to
|
`courier:maxSegmentCount`:: Kibana splits requests in the Discover app into segments to limit the size of requests sent to
|
||||||
the Elasticsearch cluster. This setting constrains the length of the segment list. Long segment lists can significantly
|
the Elasticsearch cluster. This setting constrains the length of the segment list. Long segment lists can significantly
|
||||||
increase request processing time.
|
increase request processing time.
|
||||||
`fields:popularLimit`:: This setting governs how many of the top most popular fields are shown.
|
`fields:popularLimit`:: This setting governs how many of the top most popular fields are shown.
|
||||||
`histogram:barTarget`:: When date histograms use the `auto` interval, Kibana attempts to generate this number of bars.
|
`histogram:barTarget`:: When date histograms use the `auto` interval, Kibana attempts to generate this number of bars.
|
||||||
`histogram:maxBars`:: Date histograms are not generated with more bars than the value of this property, scaling values
|
`histogram:maxBars`:: Date histograms are not generated with more bars than the value of this property, scaling values
|
||||||
when necessary.
|
when necessary.
|
||||||
`visualization:tileMap:maxPrecision`:: The maximum geoHash precision displayed on tile maps: 7 is high, 10 is very high,
|
`visualization:tileMap:maxPrecision`:: The maximum geoHash precision displayed on tile maps: 7 is high, 10 is very high,
|
||||||
12 is the maximum. http://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-geohashgrid-aggregation.html#_cell_dimensions_at_the_equator[Explanation of cell dimensions].
|
12 is the maximum. http://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-geohashgrid-aggregation.html#_cell_dimensions_at_the_equator[Explanation of cell dimensions].
|
||||||
`visualization:tileMap:WMSdefaults`:: Default properties for the WMS map server support in the tile map.
|
`visualization:tileMap:WMSdefaults`:: Default properties for the WMS map server support in the tile map.
|
||||||
`visualization:colorMapping`:: Maps values to specified colors within visualizations.
|
`visualization:colorMapping`:: Maps values to specified colors within visualizations.
|
||||||
`visualization:loadingDelay`:: Time to wait before dimming visualizations during query.
|
`visualization:loadingDelay`:: Time to wait before dimming visualizations during query.
|
||||||
`csv:separator`:: A string that serves as the separator for exported values.
|
`csv:separator`:: A string that serves as the separator for exported values.
|
||||||
`csv:quoteValues`:: Set this property to `true` to quote exported values.
|
`csv:quoteValues`:: Set this property to `true` to quote exported values.
|
||||||
`history:limit`:: In fields that have history, such as query inputs, the value of this property limits how many recent
|
`history:limit`:: In fields that have history, such as query inputs, the value of this property limits how many recent
|
||||||
values are shown.
|
values are shown.
|
||||||
`shortDots:enable`:: Set this property to `true` to shorten long field names in visualizations. For example, instead of
|
`shortDots:enable`:: Set this property to `true` to shorten long field names in visualizations. For example, instead of
|
||||||
`foo.bar.baz`, show `f.b.baz`.
|
`foo.bar.baz`, show `f.b.baz`.
|
||||||
`truncate:maxHeight`:: This property specifies the maximum height that a cell occupies in a table. A value of 0 disables
|
`truncate:maxHeight`:: This property specifies the maximum height that a cell occupies in a table. A value of 0 disables
|
||||||
truncation.
|
truncation.
|
||||||
`indexPattern:fieldMapping:lookBack`:: The value of this property sets the number of recent matching patterns to query the
|
`indexPattern:fieldMapping:lookBack`:: The value of this property sets the number of recent matching patterns to query the
|
||||||
field mapping for index patterns with names that contain timestamps.
|
field mapping for index patterns with names that contain timestamps.
|
||||||
`format:defaultTypeMap`:: A map of the default format name for each field type. Field types that are not explicitly
|
`format:defaultTypeMap`:: A map of the default format name for each field type. Field types that are not explicitly
|
||||||
mentioned use "_default_".
|
mentioned use "_default_".
|
||||||
`format:number:defaultPattern`:: Default numeral format for the "number" format.
|
`format:number:defaultPattern`:: Default numeral format for the "number" format.
|
||||||
`format:bytes:defaultPattern`:: Default numeral format for the "bytes" format.
|
`format:bytes:defaultPattern`:: Default numeral format for the "bytes" format.
|
||||||
|
|
|
@ -2,8 +2,10 @@ import moment from 'moment-timezone';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
|
||||||
export default function configDefaultsProvider() {
|
export default function configDefaultsProvider() {
|
||||||
// wrapped in provider so that a new instance is given to each app/test
|
const weekdays = moment.weekdays().slice();
|
||||||
|
const [defaultWeekday] = weekdays;
|
||||||
|
|
||||||
|
// wrapped in provider so that a new instance is given to each app/test
|
||||||
return {
|
return {
|
||||||
'buildNum': {
|
'buildNum': {
|
||||||
readonly: true
|
readonly: true
|
||||||
|
@ -46,6 +48,12 @@ export default function configDefaultsProvider() {
|
||||||
' <a href="http://en.wikipedia.org/wiki/ISO_8601#Time_intervals" target="_blank">' +
|
' <a href="http://en.wikipedia.org/wiki/ISO_8601#Time_intervals" target="_blank">' +
|
||||||
'ISO8601 intervals.</a>'
|
'ISO8601 intervals.</a>'
|
||||||
},
|
},
|
||||||
|
'dateFormat:dow': {
|
||||||
|
value: defaultWeekday,
|
||||||
|
description: 'What day should weeks start on?',
|
||||||
|
type: 'select',
|
||||||
|
options: weekdays
|
||||||
|
},
|
||||||
'defaultIndex': {
|
'defaultIndex': {
|
||||||
value: null,
|
value: null,
|
||||||
description: 'The index to access if no index is set',
|
description: 'The index to access if no index is set',
|
||||||
|
|
|
@ -19,11 +19,9 @@ uiRoutes
|
||||||
uiModules
|
uiModules
|
||||||
.get('kibana')
|
.get('kibana')
|
||||||
.service('timefilter', function (Private, globalState, $rootScope, config) {
|
.service('timefilter', function (Private, globalState, $rootScope, config) {
|
||||||
|
|
||||||
let Events = Private(EventsProvider);
|
let Events = Private(EventsProvider);
|
||||||
let diff = Private(UtilsDiffTimePickerValsProvider);
|
let diff = Private(UtilsDiffTimePickerValsProvider);
|
||||||
|
|
||||||
|
|
||||||
function convertISO8601(stringTime) {
|
function convertISO8601(stringTime) {
|
||||||
let obj = moment(stringTime, 'YYYY-MM-DDTHH:mm:ss.SSSZ', true);
|
let obj = moment(stringTime, 'YYYY-MM-DDTHH:mm:ss.SSSZ', true);
|
||||||
return obj.isValid() ? obj : stringTime;
|
return obj.isValid() ? obj : stringTime;
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import moment from 'moment';
|
||||||
import UiModules from 'ui/modules';
|
import UiModules from 'ui/modules';
|
||||||
import chromeNavControlsRegistry from 'ui/registry/chrome_nav_controls';
|
import chromeNavControlsRegistry from 'ui/registry/chrome_nav_controls';
|
||||||
import { once, clone } from 'lodash';
|
import { once, clone } from 'lodash';
|
||||||
|
@ -6,7 +7,7 @@ import toggleHtml from './kbn_global_timepicker.html';
|
||||||
|
|
||||||
UiModules
|
UiModules
|
||||||
.get('kibana')
|
.get('kibana')
|
||||||
.directive('kbnGlobalTimepicker', (timefilter, globalState, $rootScope) => {
|
.directive('kbnGlobalTimepicker', (timefilter, globalState, $rootScope, config) => {
|
||||||
const listenForUpdates = once($scope => {
|
const listenForUpdates = once($scope => {
|
||||||
$scope.$listen(timefilter, 'update', (newVal, oldVal) => {
|
$scope.$listen(timefilter, 'update', (newVal, oldVal) => {
|
||||||
globalState.time = clone(timefilter.time);
|
globalState.time = clone(timefilter.time);
|
||||||
|
@ -18,6 +19,12 @@ UiModules
|
||||||
return {
|
return {
|
||||||
template: toggleHtml,
|
template: toggleHtml,
|
||||||
link: ($scope, $el, attrs) => {
|
link: ($scope, $el, attrs) => {
|
||||||
|
config.$bind($scope, 'dateFormat:dow', 'dateFormat_dow');
|
||||||
|
$scope.$watch('dateFormat_dow', function (day) {
|
||||||
|
const dow = moment.weekdays().indexOf(day);
|
||||||
|
moment.locale(moment.locale(), { week: { dow } });
|
||||||
|
});
|
||||||
|
|
||||||
listenForUpdates($rootScope);
|
listenForUpdates($rootScope);
|
||||||
|
|
||||||
$rootScope.timefilter = timefilter;
|
$rootScope.timefilter = timefilter;
|
||||||
|
|
|
@ -15,7 +15,6 @@ let notify = new Notifier({
|
||||||
location: 'timepicker',
|
location: 'timepicker',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
module.directive('kbnTimepicker', function (quickRanges, timeUnits, refreshIntervals) {
|
module.directive('kbnTimepicker', function (quickRanges, timeUnits, refreshIntervals) {
|
||||||
return {
|
return {
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
|
@ -28,10 +27,6 @@ module.directive('kbnTimepicker', function (quickRanges, timeUnits, refreshInter
|
||||||
},
|
},
|
||||||
template: html,
|
template: html,
|
||||||
controller: function ($scope) {
|
controller: function ($scope) {
|
||||||
let init = function () {
|
|
||||||
$scope.setMode($scope.mode);
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.format = 'MMMM Do YYYY, HH:mm:ss.SSS';
|
$scope.format = 'MMMM Do YYYY, HH:mm:ss.SSS';
|
||||||
$scope.modes = ['quick', 'relative', 'absolute'];
|
$scope.modes = ['quick', 'relative', 'absolute'];
|
||||||
$scope.activeTab = $scope.activeTab || 'filter';
|
$scope.activeTab = $scope.activeTab || 'filter';
|
||||||
|
@ -115,7 +110,7 @@ module.directive('kbnTimepicker', function (quickRanges, timeUnits, refreshInter
|
||||||
$scope.mode = thisMode;
|
$scope.mode = thisMode;
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.setQuick = function (from, to, description) {
|
$scope.setQuick = function (from, to) {
|
||||||
$scope.from = from;
|
$scope.from = from;
|
||||||
$scope.to = to;
|
$scope.to = to;
|
||||||
};
|
};
|
||||||
|
@ -154,7 +149,7 @@ module.directive('kbnTimepicker', function (quickRanges, timeUnits, refreshInter
|
||||||
$scope.interval = interval;
|
$scope.interval = interval;
|
||||||
};
|
};
|
||||||
|
|
||||||
init();
|
$scope.setMode($scope.mode);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue