1313
1414import { Box , IconButton , TextField , Typography } from '@mui/material' ;
1515import { QueryParamValues } from '@perses-dev/components' ;
16- import { HTTPSettingsEditor } from '@perses-dev/plugin-system' ;
16+ import { HTTPSettingsEditor , OptionsEditorProps } from '@perses-dev/plugin-system' ;
1717import MinusIcon from 'mdi-material-ui/Minus' ;
1818import PlusIcon from 'mdi-material-ui/Plus' ;
1919import { ReactElement , useRef , useState } from 'react' ;
@@ -27,14 +27,10 @@ interface QueryParamEntry {
2727 value : string ;
2828}
2929
30- export interface PrometheusDatasourceEditorProps {
31- value : PrometheusDatasourceSpec ;
32- onChange : ( next : PrometheusDatasourceSpec ) => void ;
33- isReadonly ?: boolean ;
34- }
30+ export type PrometheusDatasourceEditorProps = OptionsEditorProps < PrometheusDatasourceSpec > ;
3531
3632export function PrometheusDatasourceEditor ( props : PrometheusDatasourceEditorProps ) : ReactElement {
37- const { value, onChange, isReadonly } = props ;
33+ const { value, onChange, isReadonly, testConnection } = props ;
3834
3935 // Counter for generating unique IDs
4036 const nextIdRef = useRef ( 0 ) ;
@@ -171,6 +167,7 @@ export function PrometheusDatasourceEditor(props: PrometheusDatasourceEditorProp
171167 isReadonly = { isReadonly }
172168 initialSpecDirect = { initialSpecDirect }
173169 initialSpecProxy = { initialSpecProxy }
170+ testConnection = { testConnection }
174171 />
175172 < Typography variant = "h5" mt = { 2 } mb = { 1 } >
176173 Query Parameters
0 commit comments