-
Notifications
You must be signed in to change notification settings - Fork 8.3k
/
Copy pathindex.js
89 lines (85 loc) · 3.02 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
export default function (kibana) {
let mainFile = 'plugins/timelion/app';
const ownDescriptor = Object.getOwnPropertyDescriptor(kibana, 'autoload');
const protoDescriptor = Object.getOwnPropertyDescriptor(kibana.constructor.prototype, 'autoload');
const descriptor = ownDescriptor || protoDescriptor || {};
if (descriptor.get) {
// the autoload list has been replaced with a getter that complains about
// improper access, bypass that getter by seeing if it is defined
mainFile = 'plugins/timelion/app_with_autoload';
}
return new kibana.Plugin({
require: ['kibana', 'elasticsearch'],
uiExports: {
app: {
title: 'Timelion',
order: -1000,
description: 'Time series expressions for everything',
icon: 'plugins/timelion/icon.svg',
main: mainFile,
injectVars: function (server) {
const config = server.config();
return {
kbnIndex: config.get('kibana.index'),
esShardTimeout: config.get('elasticsearch.shardTimeout'),
esApiVersion: config.get('elasticsearch.apiVersion')
};
},
uses: [
'savedObjectTypes',
]
},
hacks: [
'plugins/timelion/lib/panel_registry',
'plugins/timelion/panels/timechart/timechart'
],
visTypes: [
'plugins/timelion/vis'
],
mappings: require('./mappings.json'),
uiSettingDefaults: {
'timelion:showTutorial': {
value: false,
description: 'Should I show the tutorial by default when entering the timelion app?'
},
'timelion:es.timefield': {
value: '@timestamp',
description: 'Default field containing a timestamp when using .es()'
},
'timelion:es.default_index': {
value: '_all',
description: 'Default elasticsearch index to search with .es()'
},
'timelion:target_buckets': {
value: 200,
description: 'The number of buckets to shoot for when using auto intervals'
},
'timelion:max_buckets': {
value: 2000,
description: 'The maximum number of buckets a single datasource can return'
},
'timelion:default_columns': {
value: 2,
description: 'Number of columns on a timelion sheet by default'
},
'timelion:default_rows': {
value: 2,
description: 'Number of rows on a timelion sheet by default'
},
'timelion:min_interval': {
value: '1ms',
description: 'The smallest interval that will be calculated when using "auto"'
},
'timelion:graphite.url': {
value: 'https://www.hostedgraphite.com/UID/ACCESS_KEY/graphite',
description: '<em>[experimental]</em> The URL of your graphite host'
},
'timelion:quandl.key': {
value: 'someKeyHere',
description: '<em>[experimental]</em> Your API key from www.quandl.com'
}
}
},
init: require('./init.js'),
});
}