import React, { useState } from 'react'; import AutoSizer from 'react-virtualized-auto-sizer'; import { Button, CodeEditor } from '@grafana/ui'; import { dashboardWatcher } from 'app/features/live/dashboard/dashboardWatcher'; import { getDashboardSrv } from '../../services/DashboardSrv'; import { DashboardModel } from '../../state/DashboardModel'; interface Props { dashboard: DashboardModel; } export const JsonEditorSettings: React.FC = ({ dashboard }) => { const [dashboardJson, setDashboardJson] = useState(JSON.stringify(dashboard.getSaveModelClone(), null, 2)); const onBlur = (value: string) => { setDashboardJson(value); }; const onClick = () => { getDashboardSrv() .saveJSONDashboard(dashboardJson) .then(() => { dashboardWatcher.reloadPage(); }); }; return ( <>

JSON Model

The JSON Model below is data structure that defines the dashboard. Including settings, panel settings & layout, queries etc.
{({ width }) => ( )}
{dashboard.meta.canSave && ( )} ); };