This repository has been archived by the owner on Nov 22, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 79
/
index.js
80 lines (76 loc) · 2.67 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
var path = require('path');
module.exports = function (kibana) {
var mainFile = 'plugins/timelion/app';
var ownDescriptor = Object.getOwnPropertyDescriptor(kibana, 'autoload');
var protoDescriptor = Object.getOwnPropertyDescriptor(kibana.constructor.prototype, 'autoload');
var 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',
description: 'Time series expressions for everything',
icon: 'plugins/timelion/icon.svg',
main: mainFile,
injectVars: function (server, options) {
var config = server.config();
return {
kbnIndex: config.get('kibana.index'),
esShardTimeout: config.get('elasticsearch.shardTimeout'),
esApiVersion: config.get('elasticsearch.apiVersion')
};
}
},
hacks: [
'plugins/timelion/lib/panel_registry',
'plugins/timelion/panels/timechart/timechart'
],
visTypes: [
'plugins/timelion/vis'
],
modules: {
flot$: {
path: path.resolve(__dirname, 'bower_components/flot/jquery.flot'),
imports: 'jquery'
},
flotTime$: {
path: path.resolve(__dirname, 'bower_components/flot/jquery.flot.time'),
imports: 'flot'
},
/*flotCanvas$: {
path: path.resolve(__dirname, 'bower_components/flot/jquery.flot.canvas'),
imports: 'flot'
},*/
flotSymbol$: {
path: path.resolve(__dirname, 'bower_components/flot/jquery.flot.symbol'),
imports: 'flot'
},
angularSortableView$: {
path: path.resolve(__dirname, 'bower_components/angular-sortable-view/src/angular-sortable-view.js')
},
flotCrosshair$: {
path: path.resolve(__dirname, 'bower_components/flot/jquery.flot.crosshair'),
imports: 'flot'
},
flotSelection$: {
path: path.resolve(__dirname, 'bower_components/flot/jquery.flot.selection'),
imports: 'flot'
},
flotStack$: {
path: path.resolve(__dirname, 'bower_components/flot/jquery.flot.stack'),
imports: 'flot'
},
flotAxisLabels$: {
path: path.resolve(__dirname, 'vendor_components/flot/jquery.flot.axislabels'),
imports: 'flot'
}
}
},
init: require('./init.js'),
});
};