grafana/docs/sources/developers/plugins/extend-the-grafana-ui-with-...

133 lines
5.6 KiB
Markdown
Raw Normal View History

Docs: Introduce plugin extensions (#64747) * docs(pluginextensions): initial commit detailing how to add menu items to grafana * docs(pluginextensions): initial commit detailing how to do cross plugin linking * Update cross-plugin-linking.md * Update extend-the-grafana-ui-with-links-and-commands.md * style(pluginextensions): prettier fix for extend the grafana ui with links and commands * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links-and-commands.md Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * docs(pluginextensions): add info for placements and link to metadata * docs(plugin-extensions): update metadata for new docs pages * docs(plugin-extensions): pr feedback * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * docs(plugin-extensions): remove all mention of commands * chore(plugin-extensions): rename extension doc to remove reference to commands * docs(plugin-extensions): replace usage of placement with extension point * docs(plugin-extensions): lowercase ID --------- Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com> Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-04-03 23:45:59 +08:00
---
Docs: Plugin extension API - doc review - chunk 4 (#68594) * initial commit Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Minor fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-05-23 02:43:52 +08:00
title: Use extensions to add links to app plugins
description: Learn how to add links to the Grafana user interface from an app plugin
Docs: Introduce plugin extensions (#64747) * docs(pluginextensions): initial commit detailing how to add menu items to grafana * docs(pluginextensions): initial commit detailing how to do cross plugin linking * Update cross-plugin-linking.md * Update extend-the-grafana-ui-with-links-and-commands.md * style(pluginextensions): prettier fix for extend the grafana ui with links and commands * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links-and-commands.md Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * docs(pluginextensions): add info for placements and link to metadata * docs(plugin-extensions): update metadata for new docs pages * docs(plugin-extensions): pr feedback * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * docs(plugin-extensions): remove all mention of commands * chore(plugin-extensions): rename extension doc to remove reference to commands * docs(plugin-extensions): replace usage of placement with extension point * docs(plugin-extensions): lowercase ID --------- Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com> Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-04-03 23:45:59 +08:00
---
Docs: Plugin extension API - doc review - chunk 4 (#68594) * initial commit Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Minor fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-05-23 02:43:52 +08:00
# Use extensions to add links to app plugins
Docs: Introduce plugin extensions (#64747) * docs(pluginextensions): initial commit detailing how to add menu items to grafana * docs(pluginextensions): initial commit detailing how to do cross plugin linking * Update cross-plugin-linking.md * Update extend-the-grafana-ui-with-links-and-commands.md * style(pluginextensions): prettier fix for extend the grafana ui with links and commands * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links-and-commands.md Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * docs(pluginextensions): add info for placements and link to metadata * docs(plugin-extensions): update metadata for new docs pages * docs(plugin-extensions): pr feedback * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * docs(plugin-extensions): remove all mention of commands * chore(plugin-extensions): rename extension doc to remove reference to commands * docs(plugin-extensions): replace usage of placement with extension point * docs(plugin-extensions): lowercase ID --------- Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com> Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-04-03 23:45:59 +08:00
Docs: Plugin extension API - doc review - chunk 4 (#68594) * initial commit Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Minor fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-05-23 02:43:52 +08:00
You can use the Plugin extensions API with your Grafana app plugins to add links to the Grafana UI. This feature lets you send users to your plugin's pages from other spots in the Grafana application.
Docs: Introduce plugin extensions (#64747) * docs(pluginextensions): initial commit detailing how to add menu items to grafana * docs(pluginextensions): initial commit detailing how to do cross plugin linking * Update cross-plugin-linking.md * Update extend-the-grafana-ui-with-links-and-commands.md * style(pluginextensions): prettier fix for extend the grafana ui with links and commands * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links-and-commands.md Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * docs(pluginextensions): add info for placements and link to metadata * docs(plugin-extensions): update metadata for new docs pages * docs(plugin-extensions): pr feedback * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * docs(plugin-extensions): remove all mention of commands * chore(plugin-extensions): rename extension doc to remove reference to commands * docs(plugin-extensions): replace usage of placement with extension point * docs(plugin-extensions): lowercase ID --------- Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com> Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-04-03 23:45:59 +08:00
Docs: Plugin extension API - doc review - chunk 4 (#68594) * initial commit Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Minor fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-05-23 02:43:52 +08:00
## Before you begin
Docs: Introduce plugin extensions (#64747) * docs(pluginextensions): initial commit detailing how to add menu items to grafana * docs(pluginextensions): initial commit detailing how to do cross plugin linking * Update cross-plugin-linking.md * Update extend-the-grafana-ui-with-links-and-commands.md * style(pluginextensions): prettier fix for extend the grafana ui with links and commands * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links-and-commands.md Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * docs(pluginextensions): add info for placements and link to metadata * docs(plugin-extensions): update metadata for new docs pages * docs(plugin-extensions): pr feedback * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * docs(plugin-extensions): remove all mention of commands * chore(plugin-extensions): rename extension doc to remove reference to commands * docs(plugin-extensions): replace usage of placement with extension point * docs(plugin-extensions): lowercase ID --------- Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com> Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-04-03 23:45:59 +08:00
Docs: Plugin extension API - doc review - chunk 4 (#68594) * initial commit Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Minor fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-05-23 02:43:52 +08:00
Be sure your plugin meets the following requirements before proceeding:
- It must be an app plugin.
- It must be preloaded (by setting the [preload property]({{< relref "./metadata" >}}) to `true` in the `plugin.json`
- It must be installed and enabled.
Docs: Introduce plugin extensions (#64747) * docs(pluginextensions): initial commit detailing how to add menu items to grafana * docs(pluginextensions): initial commit detailing how to do cross plugin linking * Update cross-plugin-linking.md * Update extend-the-grafana-ui-with-links-and-commands.md * style(pluginextensions): prettier fix for extend the grafana ui with links and commands * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links-and-commands.md Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * docs(pluginextensions): add info for placements and link to metadata * docs(plugin-extensions): update metadata for new docs pages * docs(plugin-extensions): pr feedback * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * docs(plugin-extensions): remove all mention of commands * chore(plugin-extensions): rename extension doc to remove reference to commands * docs(plugin-extensions): replace usage of placement with extension point * docs(plugin-extensions): lowercase ID --------- Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com> Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-04-03 23:45:59 +08:00
## Available extension points within Grafana
Docs: Plugin extension API - doc review - chunk 4 (#68594) * initial commit Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Minor fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-05-23 02:43:52 +08:00
An _extension point_ is a location within the Grafana UI where a plugin can insert links. The IDs of all extension points within Grafana start with `grafana/`. For example, you can use the following extension point ID:
- `grafana/dashboard/panel/menu`: extension point for all panel dropdown menus in dashboards
Docs: Introduce plugin extensions (#64747) * docs(pluginextensions): initial commit detailing how to add menu items to grafana * docs(pluginextensions): initial commit detailing how to do cross plugin linking * Update cross-plugin-linking.md * Update extend-the-grafana-ui-with-links-and-commands.md * style(pluginextensions): prettier fix for extend the grafana ui with links and commands * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links-and-commands.md Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * docs(pluginextensions): add info for placements and link to metadata * docs(plugin-extensions): update metadata for new docs pages * docs(plugin-extensions): pr feedback * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * docs(plugin-extensions): remove all mention of commands * chore(plugin-extensions): rename extension doc to remove reference to commands * docs(plugin-extensions): replace usage of placement with extension point * docs(plugin-extensions): lowercase ID --------- Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com> Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-04-03 23:45:59 +08:00
Docs: Plugin extension API - doc review - chunk 4 (#68594) * initial commit Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Minor fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-05-23 02:43:52 +08:00
## Add a link extension within a Grafana dashboard panel menu
Docs: Introduce plugin extensions (#64747) * docs(pluginextensions): initial commit detailing how to add menu items to grafana * docs(pluginextensions): initial commit detailing how to do cross plugin linking * Update cross-plugin-linking.md * Update extend-the-grafana-ui-with-links-and-commands.md * style(pluginextensions): prettier fix for extend the grafana ui with links and commands * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links-and-commands.md Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * docs(pluginextensions): add info for placements and link to metadata * docs(plugin-extensions): update metadata for new docs pages * docs(plugin-extensions): pr feedback * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * docs(plugin-extensions): remove all mention of commands * chore(plugin-extensions): rename extension doc to remove reference to commands * docs(plugin-extensions): replace usage of placement with extension point * docs(plugin-extensions): lowercase ID --------- Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com> Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-04-03 23:45:59 +08:00
Docs: Plugin extension API - doc review - chunk 4 (#68594) * initial commit Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Minor fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-05-23 02:43:52 +08:00
To add a link extension within a Grafana dashboard panel menu, complete the following steps:
Docs: Introduce plugin extensions (#64747) * docs(pluginextensions): initial commit detailing how to add menu items to grafana * docs(pluginextensions): initial commit detailing how to do cross plugin linking * Update cross-plugin-linking.md * Update extend-the-grafana-ui-with-links-and-commands.md * style(pluginextensions): prettier fix for extend the grafana ui with links and commands * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links-and-commands.md Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * docs(pluginextensions): add info for placements and link to metadata * docs(plugin-extensions): update metadata for new docs pages * docs(plugin-extensions): pr feedback * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * docs(plugin-extensions): remove all mention of commands * chore(plugin-extensions): rename extension doc to remove reference to commands * docs(plugin-extensions): replace usage of placement with extension point * docs(plugin-extensions): lowercase ID --------- Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com> Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-04-03 23:45:59 +08:00
Docs: Plugin extension API - doc review - chunk 4 (#68594) * initial commit Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Minor fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-05-23 02:43:52 +08:00
1. Define the link extension in your plugin's `module.ts` file.
Docs: Introduce plugin extensions (#64747) * docs(pluginextensions): initial commit detailing how to add menu items to grafana * docs(pluginextensions): initial commit detailing how to do cross plugin linking * Update cross-plugin-linking.md * Update extend-the-grafana-ui-with-links-and-commands.md * style(pluginextensions): prettier fix for extend the grafana ui with links and commands * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links-and-commands.md Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * docs(pluginextensions): add info for placements and link to metadata * docs(plugin-extensions): update metadata for new docs pages * docs(plugin-extensions): pr feedback * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * docs(plugin-extensions): remove all mention of commands * chore(plugin-extensions): rename extension doc to remove reference to commands * docs(plugin-extensions): replace usage of placement with extension point * docs(plugin-extensions): lowercase ID --------- Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com> Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-04-03 23:45:59 +08:00
Docs: Plugin extension API - doc review - chunk 4 (#68594) * initial commit Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Minor fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-05-23 02:43:52 +08:00
1. Define a new instance of the `AppPlugin` class by using the `configureExtensionLink` method. This method requires:
- an object that describes your link extension, including a `title` property for the link text
- an `extensionPointId` method that tells Grafana where the link should appear
- a `path` for the user to go to your plugin
Docs: Introduce plugin extensions (#64747) * docs(pluginextensions): initial commit detailing how to add menu items to grafana * docs(pluginextensions): initial commit detailing how to do cross plugin linking * Update cross-plugin-linking.md * Update extend-the-grafana-ui-with-links-and-commands.md * style(pluginextensions): prettier fix for extend the grafana ui with links and commands * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links-and-commands.md Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * docs(pluginextensions): add info for placements and link to metadata * docs(plugin-extensions): update metadata for new docs pages * docs(plugin-extensions): pr feedback * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * docs(plugin-extensions): remove all mention of commands * chore(plugin-extensions): rename extension doc to remove reference to commands * docs(plugin-extensions): replace usage of placement with extension point * docs(plugin-extensions): lowercase ID --------- Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com> Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-04-03 23:45:59 +08:00
```typescript
new AppPlugin().configureExtensionLink({
title: 'Go to basic app',
Docs: Plugin extension API - doc review - chunk 4 (#68594) * initial commit Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Minor fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-05-23 02:43:52 +08:00
description: 'Will send the user to the basic app',
Docs: Introduce plugin extensions (#64747) * docs(pluginextensions): initial commit detailing how to add menu items to grafana * docs(pluginextensions): initial commit detailing how to do cross plugin linking * Update cross-plugin-linking.md * Update extend-the-grafana-ui-with-links-and-commands.md * style(pluginextensions): prettier fix for extend the grafana ui with links and commands * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links-and-commands.md Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * docs(pluginextensions): add info for placements and link to metadata * docs(plugin-extensions): update metadata for new docs pages * docs(plugin-extensions): pr feedback * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * docs(plugin-extensions): remove all mention of commands * chore(plugin-extensions): rename extension doc to remove reference to commands * docs(plugin-extensions): replace usage of placement with extension point * docs(plugin-extensions): lowercase ID --------- Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com> Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-04-03 23:45:59 +08:00
extensionPointId: 'grafana/dashboard/panel/menu',
path: '/a/myorg-basic-app/one', // Must start with "/a/<PLUGIN_ID>/"
});
```
Docs: Plugin extension API - doc review - chunk 4 (#68594) * initial commit Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Minor fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-05-23 02:43:52 +08:00
Your link will now appear in dashboard panel menus. When the user clicks the link, they will be sent to the path you defined earlier.
Docs: Introduce plugin extensions (#64747) * docs(pluginextensions): initial commit detailing how to add menu items to grafana * docs(pluginextensions): initial commit detailing how to do cross plugin linking * Update cross-plugin-linking.md * Update extend-the-grafana-ui-with-links-and-commands.md * style(pluginextensions): prettier fix for extend the grafana ui with links and commands * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links-and-commands.md Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * docs(pluginextensions): add info for placements and link to metadata * docs(plugin-extensions): update metadata for new docs pages * docs(plugin-extensions): pr feedback * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * docs(plugin-extensions): remove all mention of commands * chore(plugin-extensions): rename extension doc to remove reference to commands * docs(plugin-extensions): replace usage of placement with extension point * docs(plugin-extensions): lowercase ID --------- Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com> Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-04-03 23:45:59 +08:00
Docs: Plugin extension API - doc review - chunk 4 (#68594) * initial commit Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Minor fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-05-23 02:43:52 +08:00
{{% admonition type="note" %}} Each plugin is limited to a maximum of two links per extension point.{{%
/admonition %}}
Docs: Introduce plugin extensions (#64747) * docs(pluginextensions): initial commit detailing how to add menu items to grafana * docs(pluginextensions): initial commit detailing how to do cross plugin linking * Update cross-plugin-linking.md * Update extend-the-grafana-ui-with-links-and-commands.md * style(pluginextensions): prettier fix for extend the grafana ui with links and commands * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links-and-commands.md Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * docs(pluginextensions): add info for placements and link to metadata * docs(plugin-extensions): update metadata for new docs pages * docs(plugin-extensions): pr feedback * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * docs(plugin-extensions): remove all mention of commands * chore(plugin-extensions): rename extension doc to remove reference to commands * docs(plugin-extensions): replace usage of placement with extension point * docs(plugin-extensions): lowercase ID --------- Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com> Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-04-03 23:45:59 +08:00
## Add a link extension using context within Grafana
Docs: Plugin extension API - doc review - chunk 4 (#68594) * initial commit Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Minor fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-05-23 02:43:52 +08:00
The above example works for simple cases. However, you may want to act on information from the app's panel from which the user is navigating.
To do this, use the `configure` property on the object that is passed to `configureExtensionLink()`. This property takes a function and returns an object that consists of a `title` property for the link text and a `path` to send the user to your plugin.
Alternatively, if you need to hide the link for certain scenarios, define the function to return _undefined_:
Docs: Introduce plugin extensions (#64747) * docs(pluginextensions): initial commit detailing how to add menu items to grafana * docs(pluginextensions): initial commit detailing how to do cross plugin linking * Update cross-plugin-linking.md * Update extend-the-grafana-ui-with-links-and-commands.md * style(pluginextensions): prettier fix for extend the grafana ui with links and commands * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links-and-commands.md Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * docs(pluginextensions): add info for placements and link to metadata * docs(plugin-extensions): update metadata for new docs pages * docs(plugin-extensions): pr feedback * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * docs(plugin-extensions): remove all mention of commands * chore(plugin-extensions): rename extension doc to remove reference to commands * docs(plugin-extensions): replace usage of placement with extension point * docs(plugin-extensions): lowercase ID --------- Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com> Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-04-03 23:45:59 +08:00
```typescript
new AppPlugin().configureExtensionLink({
title: 'Go to basic app',
description: 'Will send the user to the basic app',
extensionPointId: 'grafana/dashboard/panel/menu',
path: '/a/myorg-basic-app/one',
configure: (context: PanelContext) => {
switch (context?.pluginId) {
case 'timeseries':
return {
title: 'Go to page one',
description: 'hello',
path: '/a/myorg-basic-app/one',
};
case 'piechart':
return {
title: 'Go to page two',
path: '/a/myorg-basic-app/two',
};
// Returning undefined tells Grafana to hide the link
default:
return undefined;
}
},
});
```
Docs: Plugin extension API - doc review - chunk 4 (#68594) * initial commit Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Minor fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-05-23 02:43:52 +08:00
The above example demonstrates how to return a different `path` based on which plugin the dashboard panel is using. If the clicked-upon panel is neither a time series nor a pie chart panel, then the `configure()` function returns _undefined_. When this happens, Grafana doesn't render the link.
Docs: Introduce plugin extensions (#64747) * docs(pluginextensions): initial commit detailing how to add menu items to grafana * docs(pluginextensions): initial commit detailing how to do cross plugin linking * Update cross-plugin-linking.md * Update extend-the-grafana-ui-with-links-and-commands.md * style(pluginextensions): prettier fix for extend the grafana ui with links and commands * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links-and-commands.md Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * docs(pluginextensions): add info for placements and link to metadata * docs(plugin-extensions): update metadata for new docs pages * docs(plugin-extensions): pr feedback * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * docs(plugin-extensions): remove all mention of commands * chore(plugin-extensions): rename extension doc to remove reference to commands * docs(plugin-extensions): replace usage of placement with extension point * docs(plugin-extensions): lowercase ID --------- Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com> Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-04-03 23:45:59 +08:00
Docs: Plugin extension API - doc review - chunk 4 (#68594) * initial commit Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Minor fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-05-23 02:43:52 +08:00
{{% admonition type="note" %}} The context passed to the `configure()` function is bound by the `extensionPointId` into which you insert the link. Different extension points contain different contexts.{{%
/admonition %}}
Docs: Introduce plugin extensions (#64747) * docs(pluginextensions): initial commit detailing how to add menu items to grafana * docs(pluginextensions): initial commit detailing how to do cross plugin linking * Update cross-plugin-linking.md * Update extend-the-grafana-ui-with-links-and-commands.md * style(pluginextensions): prettier fix for extend the grafana ui with links and commands * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links-and-commands.md Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * docs(pluginextensions): add info for placements and link to metadata * docs(plugin-extensions): update metadata for new docs pages * docs(plugin-extensions): pr feedback * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * docs(plugin-extensions): remove all mention of commands * chore(plugin-extensions): rename extension doc to remove reference to commands * docs(plugin-extensions): replace usage of placement with extension point * docs(plugin-extensions): lowercase ID --------- Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com> Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-04-03 23:45:59 +08:00
Docs: Plugin extension API - doc review - chunk 4 (#68594) * initial commit Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Minor fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-05-23 02:43:52 +08:00
## Add an event handler to a link
Docs: Introduce plugin extensions (#64747) * docs(pluginextensions): initial commit detailing how to add menu items to grafana * docs(pluginextensions): initial commit detailing how to do cross plugin linking * Update cross-plugin-linking.md * Update extend-the-grafana-ui-with-links-and-commands.md * style(pluginextensions): prettier fix for extend the grafana ui with links and commands * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links-and-commands.md Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * docs(pluginextensions): add info for placements and link to metadata * docs(plugin-extensions): update metadata for new docs pages * docs(plugin-extensions): pr feedback * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * docs(plugin-extensions): remove all mention of commands * chore(plugin-extensions): rename extension doc to remove reference to commands * docs(plugin-extensions): replace usage of placement with extension point * docs(plugin-extensions): lowercase ID --------- Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com> Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-04-03 23:45:59 +08:00
Docs: Plugin extension API - doc review - chunk 4 (#68594) * initial commit Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Minor fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-05-23 02:43:52 +08:00
Link extensions give you the means to direct users to a plugin page via href links within the Grafana UI. You can also use them to trigger `onClick` events to perform dynamic actions when clicked.
Docs: Introduce plugin extensions (#64747) * docs(pluginextensions): initial commit detailing how to add menu items to grafana * docs(pluginextensions): initial commit detailing how to do cross plugin linking * Update cross-plugin-linking.md * Update extend-the-grafana-ui-with-links-and-commands.md * style(pluginextensions): prettier fix for extend the grafana ui with links and commands * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links-and-commands.md Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * docs(pluginextensions): add info for placements and link to metadata * docs(plugin-extensions): update metadata for new docs pages * docs(plugin-extensions): pr feedback * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * docs(plugin-extensions): remove all mention of commands * chore(plugin-extensions): rename extension doc to remove reference to commands * docs(plugin-extensions): replace usage of placement with extension point * docs(plugin-extensions): lowercase ID --------- Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com> Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-04-03 23:45:59 +08:00
Docs: Plugin extension API - doc review - chunk 4 (#68594) * initial commit Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Minor fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-05-23 02:43:52 +08:00
To add an event handler to a link in a panel menu, complete the following steps:
Docs: Introduce plugin extensions (#64747) * docs(pluginextensions): initial commit detailing how to add menu items to grafana * docs(pluginextensions): initial commit detailing how to do cross plugin linking * Update cross-plugin-linking.md * Update extend-the-grafana-ui-with-links-and-commands.md * style(pluginextensions): prettier fix for extend the grafana ui with links and commands * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links-and-commands.md Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * docs(pluginextensions): add info for placements and link to metadata * docs(plugin-extensions): update metadata for new docs pages * docs(plugin-extensions): pr feedback * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * docs(plugin-extensions): remove all mention of commands * chore(plugin-extensions): rename extension doc to remove reference to commands * docs(plugin-extensions): replace usage of placement with extension point * docs(plugin-extensions): lowercase ID --------- Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com> Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-04-03 23:45:59 +08:00
1. Define the link extension in the plugin's `module.ts` file.
Docs: Plugin extension API - doc review - chunk 4 (#68594) * initial commit Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Minor fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-05-23 02:43:52 +08:00
1. Create a new instance of the `AppPlugin` class, again using the `configureExtensionLink` method. This time, add an `onClick` property which takes a function. This function receives the click event and an object consisting of the `context` and an `openModal` function.
Docs: Introduce plugin extensions (#64747) * docs(pluginextensions): initial commit detailing how to add menu items to grafana * docs(pluginextensions): initial commit detailing how to do cross plugin linking * Update cross-plugin-linking.md * Update extend-the-grafana-ui-with-links-and-commands.md * style(pluginextensions): prettier fix for extend the grafana ui with links and commands * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links-and-commands.md Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * docs(pluginextensions): add info for placements and link to metadata * docs(plugin-extensions): update metadata for new docs pages * docs(plugin-extensions): pr feedback * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * docs(plugin-extensions): remove all mention of commands * chore(plugin-extensions): rename extension doc to remove reference to commands * docs(plugin-extensions): replace usage of placement with extension point * docs(plugin-extensions): lowercase ID --------- Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com> Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-04-03 23:45:59 +08:00
Docs: Plugin extension API - doc review - chunk 4 (#68594) * initial commit Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Minor fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-05-23 02:43:52 +08:00
In the following example, we open a dialog.
Docs: Introduce plugin extensions (#64747) * docs(pluginextensions): initial commit detailing how to add menu items to grafana * docs(pluginextensions): initial commit detailing how to do cross plugin linking * Update cross-plugin-linking.md * Update extend-the-grafana-ui-with-links-and-commands.md * style(pluginextensions): prettier fix for extend the grafana ui with links and commands * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links-and-commands.md Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * docs(pluginextensions): add info for placements and link to metadata * docs(plugin-extensions): update metadata for new docs pages * docs(plugin-extensions): pr feedback * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * docs(plugin-extensions): remove all mention of commands * chore(plugin-extensions): rename extension doc to remove reference to commands * docs(plugin-extensions): replace usage of placement with extension point * docs(plugin-extensions): lowercase ID --------- Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com> Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-04-03 23:45:59 +08:00
```typescript
new AppPlugin().configureExtensionLink({
title: 'Go to basic app',
description: 'Will send the user to the basic app',
extensionPointId: 'grafana/dashboard/panel/menu',
path: '/a/myorg-basic-app/one',
onClick: (event, { context, openModal }) => {
event.preventDefault();
openModal({
Docs: Plugin extension API - doc review - chunk 4 (#68594) * initial commit Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Minor fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-05-23 02:43:52 +08:00
title: 'My plugin dialog',
Docs: Introduce plugin extensions (#64747) * docs(pluginextensions): initial commit detailing how to add menu items to grafana * docs(pluginextensions): initial commit detailing how to do cross plugin linking * Update cross-plugin-linking.md * Update extend-the-grafana-ui-with-links-and-commands.md * style(pluginextensions): prettier fix for extend the grafana ui with links and commands * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links-and-commands.md Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * docs(pluginextensions): add info for placements and link to metadata * docs(plugin-extensions): update metadata for new docs pages * docs(plugin-extensions): pr feedback * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * docs(plugin-extensions): remove all mention of commands * chore(plugin-extensions): rename extension doc to remove reference to commands * docs(plugin-extensions): replace usage of placement with extension point * docs(plugin-extensions): lowercase ID --------- Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com> Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-04-03 23:45:59 +08:00
body: ({ onDismiss }) => <SampleModal onDismiss={onDismiss} pluginId={context?.pluginId} />,
});
},
});
type Props = {
onDismiss: () => void;
pluginId?: string;
};
const SampleModal = ({ onDismiss, pluginId }: Props) => {
return (
<VerticalGroup spacing="sm">
Docs: Plugin extension API - doc review - chunk 4 (#68594) * initial commit Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Minor fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-05-23 02:43:52 +08:00
<p>This dialog was opened via the plugin extensions API.</p>
Docs: Introduce plugin extensions (#64747) * docs(pluginextensions): initial commit detailing how to add menu items to grafana * docs(pluginextensions): initial commit detailing how to do cross plugin linking * Update cross-plugin-linking.md * Update extend-the-grafana-ui-with-links-and-commands.md * style(pluginextensions): prettier fix for extend the grafana ui with links and commands * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links-and-commands.md Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * docs(pluginextensions): add info for placements and link to metadata * docs(plugin-extensions): update metadata for new docs pages * docs(plugin-extensions): pr feedback * Update docs/sources/developers/plugins/cross-plugin-linking.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * docs(plugin-extensions): remove all mention of commands * chore(plugin-extensions): rename extension doc to remove reference to commands * docs(plugin-extensions): replace usage of placement with extension point * docs(plugin-extensions): lowercase ID --------- Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com> Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-04-03 23:45:59 +08:00
<p>The panel is using a {pluginId} plugin to display data.</p>
</VerticalGroup>
);
};
```
Docs: Plugin extension API - doc review - chunk 4 (#68594) * initial commit Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Minor fixes Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Prettier Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Update docs/sources/developers/plugins/extend-the-grafana-ui-with-links.md Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Incorporating review feedback Signed-off-by: Joe Perez <joseph.perez@grafana.com> --------- Signed-off-by: Joe Perez <joseph.perez@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-05-23 02:43:52 +08:00
As you can see, the plugin extensions API enables you to insert links into the UI of Grafana applications that send users to plugin features or trigger actions based on where the user clicked. The plugins extension API can also be used for [cross-plugin linking]({{< relref "./cross-plugin-linking" >}}).