mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 04:09:50 +08:00
Plugins: Move alias support to plugin json (but still hardcoded) (#75129)
This commit is contained in:
@ -33,7 +33,16 @@ export function hasPanelPlugin(id: string): boolean {
|
||||
}
|
||||
|
||||
export function getPanelPluginMeta(id: string): PanelPluginMeta {
|
||||
return config.panels[id] || Object.values(config.panels).find((p) => p.alias === id);
|
||||
const v = config.panels[id];
|
||||
if (!v) {
|
||||
// Check alias values before failing
|
||||
for (const p of Object.values(config.panels)) {
|
||||
if (p.aliasIDs?.includes(id)) {
|
||||
return p;
|
||||
}
|
||||
}
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
export function importPanelPluginFromMeta(meta: PanelPluginMeta): Promise<PanelPlugin> {
|
||||
|
Reference in New Issue
Block a user