-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
67 lines (60 loc) · 1.81 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
import { resolve } from 'path';
import { existsSync } from 'fs';
import { i18n } from '@kbn/i18n';
import exampleRoute from './server/routes/example';
export default function (kibana) {
return new kibana.Plugin({
require: ['elasticsearch'],
name: 'kibana_nori_manager',
uiExports: {
app: {
title: 'Korean (nori) Plugin',
description: 'Nori korean analyzer management UI Kibana plugin',
main: 'plugins/kibana_nori_manager/app',
icon: 'plugins/kibana_nori_manager/img/kr.svg'
},
styleSheetPaths: [resolve(__dirname, 'public/app.scss'), resolve(__dirname, 'public/app.css')].find(p => existsSync(p)),
},
config(Joi) {
return Joi.object({
enabled: Joi.boolean().default(true),
}).default();
},
init(server, options) { // eslint-disable-line no-unused-vars
const xpackMainPlugin = server.plugins.xpack_main;
if (xpackMainPlugin) {
const featureId = 'kibana_nori_manager';
xpackMainPlugin.registerFeature({
id: featureId,
name: i18n.translate('kibanaNoriManager.featureRegistry.featureName', {
defaultMessage: 'kibana-nori-manager',
}),
navLinkId: featureId,
icon: 'canvasApp',
app: [featureId, 'kibana'],
catalogue: [],
privileges: {
all: {
api: [],
savedObject: {
all: [],
read: [],
},
ui: ['show'],
},
read: {
api: [],
savedObject: {
all: [],
read: [],
},
ui: ['show'],
},
},
});
}
// Add server routes and initialize the plugin here
exampleRoute(server);
}
});
}