create-oerlikon-grafana-plugin v1.2.0-alpha.1
create-oerlikon-grafana-plugin
Simple way to create Oerlikon Grafana plugins. The plugin created with this CLI tool will already contain following features:
- Oerlikon-UI library
- Example of the communication with the App-Frame
- Sass support
- Example how to inject environment variables
- Docker compose file to start Grafana, the proxy and your plugin in App-Frame context
- Dockerfile to create image your plugin
- Example docker-compose file for deploying to a test server
Installation
Install the npm package globally:
npm i -g create-oerlikon-grafana-plugin
Start CLI tool with:
create-oerlikon-grafana-plugin
Enter a plugin name. After submit, the CLI tool will create a folder with all necessary files and install all dependencies.
or without installation of the package:
Start CLI tool with:
npx create-oerlikon-grafana-plugin
Enter a plugin name. After submit, the CLI tool will create a folder with all necessary files and install all dependencies.
Config
After you have created the plugin, edit config paramaters in src/plugin.json
Start developing
To start developing, cd into the plugin folder and execute:
npm run watch
docker-compose -f dc-dev.yml up
now you can open Grafana with your plugin inside the App-Frame in your browser:
https://apps.oerlikon.grapes.dev/apps/dev/aHR0cDovLzEyNy4wLjAuMTo0MDAw
Environment variables
To inject an environment variable into your plugin, you can add a variable to the proxy service in the development docker-compose file dc-dev.yml
with following pattern: PROXY_VARNAME
With ENV.VARNAME
you can access the variable in your Panel or Editor component.
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago