grafana-azure-device-update
所属分类:物联网
开发工具:TypeScript
文件大小:226KB
下载次数:0
上传日期:2023-03-03 02:10:13
上 传 者:
sh-1993
说明: 用于物联网中心Azure设备更新的Grafana插件
(Grafana plugin for Azure Device Update for IoT Hub)
文件列表:
.config (0, 2023-02-14)
.config\.eslintrc (324, 2023-02-14)
.config\.prettierrc.js (409, 2023-02-14)
.config\Dockerfile (679, 2023-02-14)
.config\jest-setup.js (766, 2023-02-14)
.config\jest.config.js (1379, 2023-02-14)
.config\jest (0, 2023-02-14)
.config\jest\mocks (0, 2023-02-14)
.config\jest\mocks\react-inlinesvg.tsx (857, 2023-02-14)
.config\jest\utils.js (801, 2023-02-14)
.config\tsconfig.json (681, 2023-02-14)
.config\types (0, 2023-02-14)
.config\types\custom.d.ts (602, 2023-02-14)
.config\webpack (0, 2023-02-14)
.config\webpack\constants.ts (65, 2023-02-14)
.config\webpack\utils.ts (1286, 2023-02-14)
.config\webpack\webpack.config.ts (5821, 2023-02-14)
.eslintrc (38, 2023-02-14)
.nvmrc (2, 2023-02-14)
.prettierrc.js (122, 2023-02-14)
CHANGELOG.md (52, 2023-02-14)
LICENSE (11356, 2023-02-14)
cypress (0, 2023-02-14)
cypress\integration (0, 2023-02-14)
cypress\integration\01-smoke.spec.ts (226, 2023-02-14)
docker-compose.yaml (459, 2023-02-14)
jest-setup.js (77, 2023-02-14)
jest.config.js (281, 2023-02-14)
package-lock.json (778726, 2023-02-14)
package.json (2605, 2023-02-14)
src (0, 2023-02-14)
... ...
# Grafana app plugin template
This template is a starting point for building an app plugin for Grafana.
## What are Grafana app plugins?
App plugins can let you create a custom out-of-the-box monitoring experience by custom pages, nested datasources and panel plugins.
## Getting started
### Frontend
1. Install dependencies
```bash
yarn install
```
2. Build plugin in development mode and run in watch mode
```bash
yarn dev
```
3. Build plugin in production mode
```bash
yarn build
```
4. Run the tests (using Jest)
```bash
# Runs the tests and watches for changes, requires git init first
yarn test
# Exists after running all the tests
yarn test:ci
```
5. Spin up a Grafana instance and run the plugin inside it (using Docker)
```bash
yarn server
```
6. Run the E2E tests (using Cypress)
```bash
# Spin up a Grafana instance first that we tests against
yarn server
# Start the tests
yarn e2e
```
7. Run the linter
```bash
yarn lint
# or
yarn lint:fix
```
# Distributing your plugin
When distributing a Grafana plugin either within the community or privately the plugin must be signed so the Grafana application can verify its authenticity. This can be done with the `@grafana/sign-plugin` package.
_Note: It's not necessary to sign a plugin during development. The docker development environment that is scaffolded with `@grafana/create-plugin` caters for running the plugin without a signature._
## Initial steps
Before signing a plugin please read the Grafana [plugin publishing and signing criteria](https://grafana.com/docs/grafana/latest/developers/plugins/publishing-and-signing-criteria/) documentation carefully.
`@grafana/create-plugin` has added the necessary commands and workflows to make signing and distributing a plugin via the grafana plugins catalog as straightforward as possible.
Before signing a plugin for the first time please consult the Grafana [plugin signature levels](https://grafana.com/docs/grafana/latest/developers/plugins/sign-a-plugin/#plugin-signature-levels) documentation to understand the differences between the types of signature level.
1. Create a [Grafana Cloud account](https://grafana.com/signup).
2. Make sure that the first part of the plugin ID matches the slug of your Grafana Cloud account.
- _You can find the plugin ID in the plugin.json file inside your plugin directory. For example, if your account slug is `acmecorp`, you need to prefix the plugin ID with `acmecorp-`._
3. Create a Grafana Cloud API key with the `PluginPublisher` role.
4. Keep a record of this API key as it will be required for signing a plugin
## Signing a plugin
### Using Github actions release workflow
If the plugin is using the github actions supplied with `@grafana/create-plugin` signing a plugin is included out of the box. The [release workflow](./.github/workflows/release.yml) can prepare everything to make submitting your plugin to Grafana as easy as possible. Before being able to sign the plugin however a secret needs adding to the Github repository.
1. Please navigate to "settings > secrets > actions" within your repo to create secrets.
2. Click "New repository secret"
3. Name the secret "GRAFANA_API_KEY"
4. Paste your Grafana Cloud API key in the Secret field
5. Click "Add secret"
#### Push a version tag
To trigger the workflow we need to push a version tag to github. This can be achieved with the following steps:
1. Run `npm version `
2. Run `git push origin main --follow-tags`
## Learn more
Below you can find source code for existing app plugins and other related documentation.
- [Basic app plugin example](https://github.com/grafana/grafana-plugin-examples/tree/master/examples/app-basic#readme)
- [Plugin.json documentation](https://grafana.com/docs/grafana/latest/developers/plugins/metadata/)
- [How to sign a plugin?](https://grafana.com/docs/grafana/latest/developers/plugins/sign-a-plugin/)
近期下载者:
相关文件:
收藏者: