app插件案例
简介
实践
准备
1.修改index.js
const api =require('./server/routes');
export default function (kibana) {
return new kibana.Plugin({
require: ['elasticsearch'],
uiExports: {
// Register the app component of our plugin to uiExports
app: {
// The title of the app (will be shown to the user)
title: 'Indices',
// An description of the application.
description: 'An awesome Kibana plugin',
// The require reference to the JavaScript file for this app
main: 'plugins/elasticsearch_status/app',
// The require reference to the icon of the app
icon: 'plugins/elasticsearch_status/icon.svg'
}
},
// The init method will be executed when the Kibana server starts and loads
// this plugin. It is used to set up everything that you need.
init(server, options) {
// Just call the api module that we imported above (the server/routes.js file)
// and pass the server to it, so it can register several API interfaces at the server.
api(server);
}
});
};2.新增routes.js
3.新增app.js
4.运行
参考
Last updated
