import { css } from '@emotion/css'; import React from 'react'; import { DataSourceJsonData, DataSourcePluginOptionsEditorProps, GrafanaTheme, updateDatasourcePluginJsonDataOption, } from '@grafana/data'; import { InlineField, InlineFieldRow, InlineSwitch, useStyles } from '@grafana/ui'; export interface NodeGraphOptions { enabled?: boolean; } export interface NodeGraphData extends DataSourceJsonData { nodeGraph?: NodeGraphOptions; } interface Props extends DataSourcePluginOptionsEditorProps {} export function NodeGraphSettings({ options, onOptionsChange }: Props) { const styles = useStyles(getStyles); return (

Node Graph

) => updateDatasourcePluginJsonDataOption({ onOptionsChange, options }, 'nodeGraph', { ...options.jsonData.nodeGraph, enabled: event.currentTarget.checked, }) } />
); } const getStyles = (theme: GrafanaTheme) => ({ container: css` label: container; width: 100%; `, row: css` label: row; align-items: baseline; `, });