It provides a simple Grafana 7.x panel that shows only one button - to integrate with any kind of HTTP/REST API:
- Support
GET
andPOST
HTTP verb- Adds no new javascript dependencies
- Uses standard browser APIs and respects CORS
- Optional text payload for
POST
requests
- Support for custom header parameter or query parameter
- Variable support via
$variableName
in- URL
- parameter name & value
- Button label
- Support for HTTP Basic Auth
- Custom label text & Grafana template design
- Customize icon & button colors
Due to the Grafana API & security restrictions in modern browsers the following must be considered before using Basic Auth:
- Neither username nor password are stored encryted in Grafana. The password is there to everyone with access to the dashboard in Grafana!
- The server at the URL must provide proper resposne to the CORS pre-flight request. That is:
- Provide a proper response to the
OPTIONS
request performed by the browser before the actualGET
/POST
requiest is issued - Provide a
Access-Control-Allow-Credentials: true
header - Provide a proper
Access-Control-Allow-Origin
header. No wildcards are allowed if credentials are used!
- Provide a proper response to the
These limitations are inherent and canot be fixed or addressed by the plugin!
Use Basic Auth only if these limitations are acceptable!
Via the Grafana CLI:
$ grafana-cli --pluginUrl https://github.com/cloudspout/cloudspout-button-panel/releases/download/7.0.7/cloudspout-button-panel.zip \
plugins install cloudspout-button-panel
For Grafna >= 7.3.0 you must also set either
- the environment variable
GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=cloudspout-button-panel
- update the Grafana configuration to include
[plugins] allow_loading_unsigned_plugins=cloudspout-button-panel
Use Grafana's environment variable to add this plugin to your installation:
$ docker run -p 3000:3000 -it \
-e GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=cloudspout-button-panel \
-e "GF_INSTALL_PLUGINS=https://github.com/cloudspout/cloudspout-button-panel/releases/download/7.0.7/cloudspout-button-panel.zip;cloudspout-button-panel" \
grafana/grafana:7.3.1
First, install dependencies. Node 12.x is required
yarn install
To work with this plugin run:
yarn watch
This will run linting tools and apply prettier fix.
Use an actual Docker container in parallel to test:
$ docker run --rm -p 3000:3000 -v "$(pwd)"/dist:/var/lib/grafana/plugins/cloudspout-button-panel --name=grafana grafana/grafana:7.3.1
To build the plugin run:
npm run dist
-
Update
README.md
for the correct, upcomming version. -
GITHUB_TOKEN=... GRAFANA_API_KEY=... npm run release
GPL v3
Icons made by Pixel perfect from www.flaticon.com