2021-10-25 06:55:06 -05:00
|
|
|
import { PluginState } from '@grafana/data';
|
2022-04-22 08:33:13 -05:00
|
|
|
import { config, GrafanaBootConfig } from '@grafana/runtime';
|
2019-06-19 13:31:47 -05:00
|
|
|
// Legacy binding paths
|
|
|
|
export { config, GrafanaBootConfig as Settings };
|
2019-12-18 04:31:11 -06:00
|
|
|
|
|
|
|
let grafanaConfig: GrafanaBootConfig = config;
|
|
|
|
|
|
|
|
export default grafanaConfig;
|
|
|
|
|
|
|
|
export const getConfig = () => {
|
|
|
|
return grafanaConfig;
|
|
|
|
};
|
|
|
|
|
|
|
|
export const updateConfig = (update: Partial<GrafanaBootConfig>) => {
|
|
|
|
grafanaConfig = {
|
|
|
|
...grafanaConfig,
|
|
|
|
...update,
|
|
|
|
};
|
|
|
|
};
|
2021-07-19 10:07:28 -05:00
|
|
|
|
2022-04-12 07:55:57 -05:00
|
|
|
// The `enable_alpha` flag is not exposed directly, this is equivalent
|
2021-07-19 10:07:28 -05:00
|
|
|
export const hasAlphaPanels = Boolean(config.panels?.debug?.state === PluginState.alpha);
|