Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions prometheus/src/plugins/PrometheusDatasourceEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import { Box, IconButton, TextField, Typography } from '@mui/material';
import { QueryParamValues } from '@perses-dev/components';
import { HTTPSettingsEditor } from '@perses-dev/plugin-system';
import { HTTPSettingsEditor, OptionsEditorProps } from '@perses-dev/plugin-system';
import MinusIcon from 'mdi-material-ui/Minus';
import PlusIcon from 'mdi-material-ui/Plus';
import { ReactElement, useRef, useState } from 'react';
Expand All @@ -27,14 +27,10 @@ interface QueryParamEntry {
value: string;
}

export interface PrometheusDatasourceEditorProps {
value: PrometheusDatasourceSpec;
onChange: (next: PrometheusDatasourceSpec) => void;
isReadonly?: boolean;
}
export type PrometheusDatasourceEditorProps = OptionsEditorProps<PrometheusDatasourceSpec>;

export function PrometheusDatasourceEditor(props: PrometheusDatasourceEditorProps): ReactElement {
const { value, onChange, isReadonly } = props;
const { value, onChange, isReadonly, testConnection } = props;

// Counter for generating unique IDs
const nextIdRef = useRef(0);
Expand Down Expand Up @@ -171,6 +167,7 @@ export function PrometheusDatasourceEditor(props: PrometheusDatasourceEditorProp
isReadonly={isReadonly}
initialSpecDirect={initialSpecDirect}
initialSpecProxy={initialSpecProxy}
testConnection={testConnection}
/>
<Typography variant="h5" mt={2} mb={1}>
Query Parameters
Expand Down
1 change: 1 addition & 0 deletions prometheus/src/plugins/prometheus-datasource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,5 @@ export const PrometheusDatasource: DatasourcePlugin<PrometheusDatasourceSpec, Pr
getBuiltinVariableDefinitions,
OptionsEditorComponent: PrometheusDatasourceEditor,
createInitialOptions: () => ({ directUrl: '' }),
healthCheckPath: '/api/v1/status/buildinfo',
};
Loading