-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.js
58 lines (47 loc) · 1.39 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
import Promise from 'bluebird';
import topologyRoutes from './server/routes/api';
import publishElasticsearchClient from './server/lib/publish_elasticsearch_client';
export default function (kibana) {
return new kibana.Plugin({
require: ['elasticsearch'],
uiExports: {
app: {
title: 'topology',
description: 'a cluster Topology explorer',
main: 'plugins/topology/app',
icon: 'plugins/topology/topology.png',
},
hacks: [
'plugins/topology/hack'
]
},
config(Joi) {
return Joi.object({
enabled: Joi.boolean().default(true),
elasticsearch: {
username: Joi.string(),
password: Joi.string(),
url: Joi.string(),
ssl: {
cert: Joi.string(),
key: Joi.string(),
ca: Joi.array().items(Joi.string()),
verify: Joi.boolean()
}
}
}).default();
},
init(server, options) {
var plugin = this;
topologyRoutes(server);
plugin.status.yellow('Waiting for Topology');
server.plugins.elasticsearch.status.on('green', function () {
Promise.try(publishElasticsearchClient(server))
.then(function (arg) {
plugin.status.green('Ready.');
})
.catch(console.log.bind(console));
});
}
});
};