Submit
Path:
~
/
/
usr
/
share
/
grafana
/
public
/
app
/
features
/
dimensions
/
editors
/
ThresholdsEditor
/
File Content:
thresholds.tsx
import React from 'react'; import { StandardEditorProps, ThresholdsConfig, ThresholdsMode, ThresholdsFieldConfigSettings } from '@grafana/data'; import { ThresholdsEditor } from './ThresholdsEditor'; type Props = StandardEditorProps<ThresholdsConfig, ThresholdsFieldConfigSettings>; export class ThresholdsValueEditor extends React.PureComponent<Props> { constructor(props: Props) { super(props); } render() { const { onChange } = this.props; let value = this.props.value; if (!value) { value = { mode: ThresholdsMode.Percentage, // Must be sorted by 'value', first value is always -Infinity steps: [ // anything? ], }; } return <ThresholdsEditor thresholds={value} onChange={onChange} />; } }
Submit
FILE
FOLDER
INFO
Name
Size
Permission
Action
ThresholdsEditor.test.tsx
7015 bytes
0644
ThresholdsEditor.tsx
8595 bytes
0644
thresholds.tsx
787 bytes
0644
N4ST4R_ID | Naxtarrr