mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Plugins: Change managed plugins installation call (#77120)
This commit is contained in:
committed by
GitHub
parent
6097ff255c
commit
e754c5a6c6
@@ -2,9 +2,9 @@ import { PluginError, PluginMeta, renderMarkdown } from '@grafana/data';
|
||||
import { getBackendSrv, isFetchError } from '@grafana/runtime';
|
||||
import { accessControlQueryParam } from 'app/core/utils/accessControl';
|
||||
|
||||
import { API_ROOT, GCOM_API_ROOT } from './constants';
|
||||
import { API_ROOT, GCOM_API_ROOT, INSTANCE_API_ROOT } from './constants';
|
||||
import { isLocalPluginVisibleByConfig, isRemotePluginVisibleByConfig } from './helpers';
|
||||
import { LocalPlugin, RemotePlugin, CatalogPluginDetails, Version, PluginVersion } from './types';
|
||||
import { LocalPlugin, RemotePlugin, CatalogPluginDetails, Version, PluginVersion, InstancePlugin } from './types';
|
||||
|
||||
export async function getPluginDetails(id: string): Promise<CatalogPluginDetails> {
|
||||
const remote = await getRemotePlugin(id);
|
||||
@@ -105,6 +105,14 @@ export async function getLocalPlugins(): Promise<LocalPlugin[]> {
|
||||
return localPlugins.filter(isLocalPluginVisibleByConfig);
|
||||
}
|
||||
|
||||
export async function getInstancePlugins(): Promise<InstancePlugin[]> {
|
||||
const { items: instancePlugins }: { items: InstancePlugin[] } = await getBackendSrv().get(
|
||||
`${INSTANCE_API_ROOT}/plugins`
|
||||
);
|
||||
|
||||
return instancePlugins;
|
||||
}
|
||||
|
||||
export async function installPlugin(id: string) {
|
||||
// This will install the latest compatible version based on the logic
|
||||
// on the backend.
|
||||
|
||||
Reference in New Issue
Block a user