mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Removing plugin list panel (#46914)
The core plugin named plugin list panel is removed
This commit is contained in:
parent
6e0826a986
commit
25235b3167
@ -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,
|
||||
|
@ -127,7 +127,6 @@ func verifyCorePluginCatalogue(t *testing.T, pm *PluginManager) {
|
||||
"news": {},
|
||||
"nodeGraph": {},
|
||||
"piechart": {},
|
||||
"pluginlist": {},
|
||||
"stat": {},
|
||||
"state-timeline": {},
|
||||
"status-history": {},
|
||||
|
@ -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,
|
||||
|
@ -55,11 +55,6 @@
|
||||
"type": "dashlist",
|
||||
"pluginVersion": "8.1.0-pre"
|
||||
},
|
||||
{
|
||||
"id": 30,
|
||||
"title": "Panel list",
|
||||
"type": "pluginlist"
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"title": "Alert list",
|
||||
|
@ -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",
|
||||
|
@ -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,
|
||||
|
@ -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 (
|
||||
<CustomScrollbar autoHeightMin="100%" autoHeightMax="100%">
|
||||
<div className={styles.pluginList}>
|
||||
{pluginState.value.map((category) => (
|
||||
<div className={styles.section} key={`category-${category.type}`}>
|
||||
<h6 className={styles.sectionHeader}>{category.header}</h6>
|
||||
{category.list.map((plugin) => (
|
||||
<a className={styles.item} href={plugin.defaultNavUrl} key={`plugin-${plugin.id}`}>
|
||||
<img src={plugin.info.logos.small} className={styles.image} width="17" height="17" alt="" />
|
||||
<span className={styles.title}>{plugin.name}</span>
|
||||
<span className={styles.version}>v{plugin.info.version}</span>
|
||||
{isAdmin &&
|
||||
(plugin.hasUpdate ? (
|
||||
<ModalsController>
|
||||
{({ showModal, hideModal }) => (
|
||||
<Tooltip content={`New version: ${plugin.latestVersion}`} placement="top">
|
||||
<span
|
||||
className={cx(styles.message, styles.messageUpdate)}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
|
||||
showModal(UpdatePluginModal, {
|
||||
pluginID: plugin.id,
|
||||
pluginName: plugin.name,
|
||||
onDismiss: hideModal,
|
||||
isOpen: true,
|
||||
});
|
||||
}}
|
||||
>
|
||||
Update available!
|
||||
</span>
|
||||
</Tooltip>
|
||||
)}
|
||||
</ModalsController>
|
||||
) : plugin.enabled ? (
|
||||
<span className={cx(styles.message, styles.messageNoUpdate)}>Up to date</span>
|
||||
) : (
|
||||
<span className={cx(styles.message, styles.messageEnable)}>Enable now</span>
|
||||
))}
|
||||
</a>
|
||||
))}
|
||||
|
||||
{category.list.length === 0 && (
|
||||
<a className={styles.item} href="https://grafana.com/plugins">
|
||||
<span className={styles.noneInstalled}>
|
||||
None installed. <em className={styles.emphasis}>Browse Grafana.com</em>
|
||||
</span>
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</CustomScrollbar>
|
||||
);
|
||||
}
|
||||
|
||||
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};
|
||||
`,
|
||||
}));
|
@ -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.
|
@ -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 (
|
||||
<Modal title="Update Plugin" icon="cloud-download" onDismiss={onDismiss} isOpen>
|
||||
<div className={styles.container}>
|
||||
<p>Type the following on the command line to update {pluginName}.</p>
|
||||
<pre>
|
||||
<code>grafana-cli plugins update {pluginID}</code>
|
||||
</pre>
|
||||
<span className={styles.small}>
|
||||
Check out {pluginName} on <a href={`https://grafana.com/plugins/${pluginID}`}>Grafana.com</a> for README and
|
||||
changelog. If you do not have access to the command line, ask your Grafana administator.
|
||||
</span>
|
||||
</div>
|
||||
<p className={styles.updateAllTip}>
|
||||
<img className={styles.inlineLogo} src="public/img/grafana_icon.svg" />
|
||||
<strong>Pro tip</strong>: To update all plugins at once, type{' '}
|
||||
<code className={styles.codeSmall}>grafana-cli plugins update-all</code> on the command line.
|
||||
</p>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
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};
|
||||
`,
|
||||
}));
|
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 80.9 80.9"><defs><style>.cls-1{fill:#84aff1;}.cls-2{fill:#3865ab;}.cls-3{fill:#fff;}.cls-4{fill:url(#linear-gradient);}</style><linearGradient id="linear-gradient" x1="15.08" y1="38.4" x2="52.47" y2="38.4" gradientTransform="translate(6.17 2.56)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#f2cc0c"/><stop offset="1" stop-color="#ff9830"/></linearGradient></defs><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><path class="cls-1" d="M40.45,80.9A40.45,40.45,0,1,1,80.9,40.45,40.5,40.5,0,0,1,40.45,80.9Zm0-76.9A36.45,36.45,0,1,0,76.9,40.45,36.49,36.49,0,0,0,40.45,4Z"/><path class="cls-2" d="M40.45,8.13A32.31,32.31,0,0,0,16.23,61.84l12.9-12.9L32,51.77l-12.9,12.9A32.32,32.32,0,1,0,40.45,8.13Z"/><path class="cls-3" d="M38.43,23.71H52.34a1,1,0,0,1,1,1v3.41a1,1,0,0,1-1,1H38.43a0,0,0,0,1,0,0V23.71A0,0,0,0,1,38.43,23.71Z" transform="translate(-5.24 40.18) rotate(-45)"/><path class="cls-3" d="M47,32.31H60.94a1,1,0,0,1,1,1v3.41a1,1,0,0,1-1,1H47a0,0,0,0,1,0,0V32.31A0,0,0,0,1,47,32.31Z" transform="translate(-8.8 48.78) rotate(-45)"/><path class="cls-4" d="M35.83,22.26l-5.29,5.29C25.16,32.93,23,39.74,26.79,46L21.25,51.5l8.15,8.15,5.54-5.54c6.22,3.82,13,1.63,18.41-3.76l5.29-5.28Z"/></g></g></svg>
|
Before Width: | Height: | Size: 1.3 KiB |
@ -1,4 +0,0 @@
|
||||
import { PanelPlugin } from '@grafana/data';
|
||||
import { PluginList } from './PluginList';
|
||||
|
||||
export const plugin = new PanelPlugin(PluginList);
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user