Hello World
本章主要讲解如何开发一个简单的kibana插件,实现一个kibana app,在页面上输出hello world。
使用官方推荐的模板工具生成

1. Install SAO

1
npm install -g sao
Copied!

2. 创建工程目录

在kibana工程plugin 新建demo目录

3. 生成代码

在demo目录下执行:
1
sao kibana-plugin
Copied!
tip:如果需要制定版本使用:sao [email protected]
然后根据提示输入自定义选项,我这边运行效果如下:
1
PS E:\github\kibana\kibana\plugins\demo> sao kibana-plugin
2
> Installing template-kibana-plugin with npm...
3
? Name of your plugin? demo
4
? Provide a short description Hello World
5
? What Kibana version are you targeting? 5.5.1
6
? Should an app component be generated? Yes
7
? Should translation files be generated? Yes
8
? Should an hack component be generated? Yes
9
? Should a server API be generated? Yes
10
Initialized empty Git repository in E:/github/kibana/kibana/plugins/demo/.git/
11
> [email protected] postinstall E:\github\kibana\kibana\plugins\demo\node_modules\spawn-sync
12
> node postinstall
13
14
> [email protected] postinstall E:\github\kibana\kibana\plugins\demo
15
> plugin-helpers postinstall
16
17
npm notice created a lockfile as package-lock.json. You should commit this file.
18
npm WARN [email protected] No repository field.
19
npm WARN [email protected] No license field.
20
21
added 361 packages in 30.126s
22
success Your plugin has been created, use `npm start` to run it
Copied!

4. 运行

在kibana工程目录下执行:npm start

5. 效果