diff --git a/devenv/dev-dashboards/all-panels.json b/devenv/dev-dashboards/all-panels.json index 6e4cf7cd21d..a76161c64f2 100644 --- a/devenv/dev-dashboards/all-panels.json +++ b/devenv/dev-dashboards/all-panels.json @@ -374,17 +374,6 @@ "title": "Dashboard list", "type": "dashlist" }, - { - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 29 - }, - "id": 30, - "title": "Panel list", - "type": "pluginlist" - }, { "gridPos": { "h": 8, diff --git a/pkg/plugins/manager/manager_integration_test.go b/pkg/plugins/manager/manager_integration_test.go index 3a74f718648..cf6eec40fac 100644 --- a/pkg/plugins/manager/manager_integration_test.go +++ b/pkg/plugins/manager/manager_integration_test.go @@ -127,7 +127,6 @@ func verifyCorePluginCatalogue(t *testing.T, pm *PluginManager) { "news": {}, "nodeGraph": {}, "piechart": {}, - "pluginlist": {}, "stat": {}, "state-timeline": {}, "status-history": {}, diff --git a/pkg/schema/testdata/devenvgoldenfiles/all-panels.json b/pkg/schema/testdata/devenvgoldenfiles/all-panels.json index 305b3608691..c86ce253881 100644 --- a/pkg/schema/testdata/devenvgoldenfiles/all-panels.json +++ b/pkg/schema/testdata/devenvgoldenfiles/all-panels.json @@ -444,27 +444,6 @@ "overrides": [] } }, - { - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 29 - }, - "id": 30, - "title": "Panel list", - "type": "pluginlist", - "transparent": false, - "repeatDirection": "h", - "transformations": [], - "options": {}, - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - } - }, { "gridPos": { "h": 8, diff --git a/pkg/services/searchV2/extract/testdata/devdash-all-panels-info.json b/pkg/services/searchV2/extract/testdata/devdash-all-panels-info.json index 1818176ca66..26e3218ec73 100644 --- a/pkg/services/searchV2/extract/testdata/devdash-all-panels-info.json +++ b/pkg/services/searchV2/extract/testdata/devdash-all-panels-info.json @@ -55,11 +55,6 @@ "type": "dashlist", "pluginVersion": "8.1.0-pre" }, - { - "id": 30, - "title": "Panel list", - "type": "pluginlist" - }, { "id": 6, "title": "Alert list", diff --git a/pkg/tests/api/plugins/data/expectedListResp.json b/pkg/tests/api/plugins/data/expectedListResp.json index e83c9ab8367..2c012c8a7a5 100644 --- a/pkg/tests/api/plugins/data/expectedListResp.json +++ b/pkg/tests/api/plugins/data/expectedListResp.json @@ -1034,42 +1034,6 @@ "signatureType": "", "signatureOrg": "" }, - { - "name": "Plugin list", - "type": "panel", - "id": "pluginlist", - "enabled": true, - "pinned": false, - "info": { - "author": { - "name": "Grafana Labs", - "url": "https://grafana.com" - }, - "description": "Plugin List for Grafana", - "links": null, - "logos": { - "small": "public/app/plugins/panel/pluginlist/img/icn-dashlist-panel.svg", - "large": "public/app/plugins/panel/pluginlist/img/icn-dashlist-panel.svg" - }, - "build": {}, - "screenshots": null, - "version": "", - "updated": "" - }, - "dependencies": { - "grafanaDependency": "", - "grafanaVersion": "*", - "plugins": [] - }, - "latestVersion": "", - "hasUpdate": false, - "defaultNavUrl": "/plugins/pluginlist/", - "category": "", - "state": "", - "signature": "internal", - "signatureType": "", - "signatureOrg": "" - }, { "name": "PostgreSQL", "type": "datasource", diff --git a/public/app/features/plugins/built_in_plugins.ts b/public/app/features/plugins/built_in_plugins.ts index ebe372a6fff..3128e26f815 100644 --- a/public/app/features/plugins/built_in_plugins.ts +++ b/public/app/features/plugins/built_in_plugins.ts @@ -47,7 +47,6 @@ import * as statusHistoryPanel from 'app/plugins/panel/status-history/module'; import * as candlestickPanel from 'app/plugins/panel/candlestick/module'; import * as xyChartPanel from 'app/plugins/panel/xychart/module'; import * as dashListPanel from 'app/plugins/panel/dashlist/module'; -import * as pluginsListPanel from 'app/plugins/panel/pluginlist/module'; import * as alertListPanel from 'app/plugins/panel/alertlist/module'; import * as annoListPanel from 'app/plugins/panel/annolist/module'; import * as heatmapPanelNG from 'app/plugins/panel/heatmap-new/module'; @@ -110,7 +109,6 @@ const builtInPlugins: any = { 'app/plugins/panel/canvas/module': canvasPanel, 'app/plugins/panel/icon/module': iconPanel, 'app/plugins/panel/dashlist/module': dashListPanel, - 'app/plugins/panel/pluginlist/module': pluginsListPanel, 'app/plugins/panel/alertlist/module': alertListPanel, 'app/plugins/panel/annolist/module': annoListPanel, 'app/plugins/panel/heatmap/module': heatmapPanel, diff --git a/public/app/plugins/panel/pluginlist/PluginList.tsx b/public/app/plugins/panel/pluginlist/PluginList.tsx deleted file mode 100644 index c3af90ac740..00000000000 --- a/public/app/plugins/panel/pluginlist/PluginList.tsx +++ /dev/null @@ -1,151 +0,0 @@ -import React from 'react'; -import { useAsync } from 'react-use'; -import { css, cx } from '@emotion/css'; -import { GrafanaTheme, PanelProps, PluginMeta, PluginType } from '@grafana/data'; -import { CustomScrollbar, ModalsController, stylesFactory, Tooltip, useStyles } from '@grafana/ui'; -import { contextSrv } from 'app/core/services/context_srv'; -import { getBackendSrv } from 'app/core/services/backend_srv'; -import { UpdatePluginModal } from './components/UpdatePluginModal'; - -export function PluginList(props: PanelProps) { - const pluginState = useAsync(async () => { - const plugins: PluginMeta[] = await getBackendSrv().get('api/plugins', { embedded: 0, core: 0 }); - return [ - { header: 'Installed Apps', list: plugins.filter((p) => p.type === PluginType.app), type: PluginType.app }, - { header: 'Installed Panels', list: plugins.filter((p) => p.type === PluginType.panel), type: PluginType.panel }, - { - header: 'Installed Datasources', - list: plugins.filter((p) => p.type === PluginType.datasource), - type: PluginType.datasource, - }, - ]; - }, []); - - const styles = useStyles(getStyles); - const isAdmin = contextSrv.user.isGrafanaAdmin; - - if (pluginState.loading || pluginState.value === undefined) { - return null; - } - - return ( - -
- {pluginState.value.map((category) => ( -
-
{category.header}
- {category.list.map((plugin) => ( - - - {plugin.name} - v{plugin.info.version} - {isAdmin && - (plugin.hasUpdate ? ( - - {({ showModal, hideModal }) => ( - - { - e.preventDefault(); - - showModal(UpdatePluginModal, { - pluginID: plugin.id, - pluginName: plugin.name, - onDismiss: hideModal, - isOpen: true, - }); - }} - > - Update available! - - - )} - - ) : plugin.enabled ? ( - Up to date - ) : ( - Enable now - ))} - - ))} - - {category.list.length === 0 && ( - - - None installed. Browse Grafana.com - - - )} -
- ))} -
-
- ); -} - -const getStyles = stylesFactory((theme: GrafanaTheme) => ({ - pluginList: css` - display: flex; - flex-direction: column; - `, - section: css` - display: flex; - flex-direction: column; - &:not(:last-of-type) { - margin-bottom: 16px; - } - `, - sectionHeader: css` - color: ${theme.colors.textWeak}; - margin-bottom: ${theme.spacing.d}; - `, - image: css` - width: 17px; - margin-right: ${theme.spacing.xxs}; - `, - title: css` - margin-right: calc(${theme.spacing.d} / 3); - `, - version: css` - font-size: ${theme.typography.size.sm}; - color: ${theme.colors.textWeak}; - `, - item: css` - display: flex; - justify-content: flex-start; - align-items: center; - cursor: pointer; - margin: ${theme.spacing.xxs}; - padding: ${theme.spacing.sm}; - background: ${theme.colors.dashboardBg}; - border-radius: ${theme.border.radius.md}; - `, - message: css` - margin-left: auto; - font-size: ${theme.typography.size.sm}; - `, - messageEnable: css` - color: ${theme.colors.linkExternal}; - &:hover { - border-bottom: ${theme.border.width.sm} solid ${theme.colors.linkExternal}; - } - `, - messageUpdate: css` - &:hover { - border-bottom: ${theme.border.width.sm} solid ${theme.colors.text}; - } - `, - messageNoUpdate: css` - color: ${theme.colors.textWeak}; - `, - noneInstalled: css` - color: ${theme.colors.textWeak}; - font-size: ${theme.typography.size.sm}; - `, - emphasis: css` - font-weight: ${theme.typography.weight.semibold}; - font-style: normal; - color: ${theme.colors.textWeak}; - `, -})); diff --git a/public/app/plugins/panel/pluginlist/README.md b/public/app/plugins/panel/pluginlist/README.md deleted file mode 100644 index 2e0d851d7e5..00000000000 --- a/public/app/plugins/panel/pluginlist/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Plugin List Panel - Native Plugin - -The Plugin List plans shows the installed plugins for your Grafana instance and is **included** with Grafana. It is used on the default Home dashboard. diff --git a/public/app/plugins/panel/pluginlist/components/UpdatePluginModal.tsx b/public/app/plugins/panel/pluginlist/components/UpdatePluginModal.tsx deleted file mode 100644 index b48d99529eb..00000000000 --- a/public/app/plugins/panel/pluginlist/components/UpdatePluginModal.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import React from 'react'; -import { Modal, stylesFactory, useStyles } from '@grafana/ui'; -import { GrafanaTheme } from '@grafana/data'; -import { css } from '@emotion/css'; - -interface Props { - pluginName: string; - pluginID: string; - onConfirm?: () => void; - onDismiss?: () => void; -} - -export function UpdatePluginModal({ pluginName, pluginID, onDismiss }: Props) { - const styles = useStyles(getStyles); - - return ( - -
-

Type the following on the command line to update {pluginName}.

-
-          grafana-cli plugins update {pluginID}
-        
- - Check out {pluginName} on Grafana.com for README and - changelog. If you do not have access to the command line, ask your Grafana administator. - -
-

- - Pro tip: To update all plugins at once, type{' '} - grafana-cli plugins update-all on the command line. -

-
- ); -} - -const getStyles = stylesFactory((theme: GrafanaTheme) => ({ - small: css` - font-size: ${theme.typography.size.sm}; - font-weight: ${theme.typography.weight.regular}; - `, - codeSmall: css` - font-size: ${theme.typography.size.xs}; - padding: ${theme.spacing.xxs}; - margin: 0 ${theme.spacing.xxs}; - `, - container: css` - margin-bottom: calc(${theme.spacing.d} * 2.5); - `, - updateAllTip: css` - color: ${theme.colors.textWeak}; - font-size: ${theme.typography.size.sm}; - `, - inlineLogo: css` - vertical-align: sub; - margin-right: calc(${theme.spacing.d} / 3); - width: ${theme.spacing.md}; - `, -})); diff --git a/public/app/plugins/panel/pluginlist/img/icn-dashlist-panel.svg b/public/app/plugins/panel/pluginlist/img/icn-dashlist-panel.svg deleted file mode 100644 index bdc6c33039c..00000000000 --- a/public/app/plugins/panel/pluginlist/img/icn-dashlist-panel.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/app/plugins/panel/pluginlist/module.tsx b/public/app/plugins/panel/pluginlist/module.tsx deleted file mode 100644 index 86f97e04b5d..00000000000 --- a/public/app/plugins/panel/pluginlist/module.tsx +++ /dev/null @@ -1,4 +0,0 @@ -import { PanelPlugin } from '@grafana/data'; -import { PluginList } from './PluginList'; - -export const plugin = new PanelPlugin(PluginList); diff --git a/public/app/plugins/panel/pluginlist/plugin.json b/public/app/plugins/panel/pluginlist/plugin.json deleted file mode 100644 index c2faa3b6dd7..00000000000 --- a/public/app/plugins/panel/pluginlist/plugin.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "panel", - "name": "Plugin list", - "id": "pluginlist", - - "skipDataQuery": true, - - "info": { - "description": "Plugin List for Grafana", - "author": { - "name": "Grafana Labs", - "url": "https://grafana.com" - }, - "logos": { - "small": "img/icn-dashlist-panel.svg", - "large": "img/icn-dashlist-panel.svg" - } - } -}