config.ts 619 B

12345678910111213141516171819202122
  1. import { PluginState } from '@grafana/data';
  2. import { config, GrafanaBootConfig } from '@grafana/runtime';
  3. // Legacy binding paths
  4. export { config, GrafanaBootConfig as Settings };
  5. let grafanaConfig: GrafanaBootConfig = config;
  6. export default grafanaConfig;
  7. export const getConfig = () => {
  8. return grafanaConfig;
  9. };
  10. export const updateConfig = (update: Partial<GrafanaBootConfig>) => {
  11. grafanaConfig = {
  12. ...grafanaConfig,
  13. ...update,
  14. };
  15. };
  16. // The `enable_alpha` flag is not exposed directly, this is equivalent
  17. export const hasAlphaPanels = Boolean(config.panels?.debug?.state === PluginState.alpha);