mirror of
https://github.com/grafana/grafana.git
synced 2025-09-27 08:34:00 +08:00
Alerting: Filter rules list (#32818)
This commit is contained in:
@ -24,6 +24,7 @@ export interface DataSourcePickerProps {
|
||||
mixed?: boolean;
|
||||
dashboard?: boolean;
|
||||
metrics?: boolean;
|
||||
type?: string | string[];
|
||||
annotations?: boolean;
|
||||
variables?: boolean;
|
||||
alerting?: boolean;
|
||||
@ -108,9 +109,10 @@ export class DataSourcePicker extends PureComponent<DataSourcePickerProps, DataS
|
||||
}
|
||||
|
||||
getDataSourceOptions() {
|
||||
const { tracing, metrics, mixed, dashboard, variables, annotations, pluginId, alerting, filter } = this.props;
|
||||
const { alerting, tracing, metrics, mixed, dashboard, variables, annotations, pluginId, type, filter } = this.props;
|
||||
const options = this.dataSourceSrv
|
||||
.getList({
|
||||
alerting,
|
||||
tracing,
|
||||
metrics,
|
||||
dashboard,
|
||||
@ -118,8 +120,8 @@ export class DataSourcePicker extends PureComponent<DataSourcePickerProps, DataS
|
||||
variables,
|
||||
annotations,
|
||||
pluginId,
|
||||
alerting,
|
||||
filter,
|
||||
type,
|
||||
})
|
||||
.map((ds) => ({
|
||||
value: ds.name,
|
||||
|
@ -60,6 +60,9 @@ export interface GetDataSourceListFilters {
|
||||
|
||||
/** apply a function to filter */
|
||||
filter?: (dataSource: DataSourceInstanceSettings) => boolean;
|
||||
|
||||
/** Only returns datasources matching the specified types (ie. Loki, Prometheus) */
|
||||
type?: string | string[];
|
||||
}
|
||||
|
||||
let singletonInstance: DataSourceSrv;
|
||||
|
Reference in New Issue
Block a user