@ -2,7 +2,7 @@ import React from 'react';
import { DataSourceInstanceSettings , PanelPlugin } from '@grafana/data' ;
import { DataSourceInstanceSettings , PanelPlugin } from '@grafana/data' ;
import { config } from '@grafana/runtime' ;
import { config } from '@grafana/runtime' ;
import { TagsInput } from '@grafana/ui' ;
import { Button , Stack , TagsInput } from '@grafana/ui' ;
import { OldFolderPicker } from 'app/core/components/Select/OldFolderPicker' ;
import { OldFolderPicker } from 'app/core/components/Select/OldFolderPicker' ;
import {
import {
ALL_FOLDER ,
ALL_FOLDER ,
@ -228,8 +228,8 @@ const unifiedAlertList = new PanelPlugin<UnifiedAlertListOptions>(UnifiedAlertLi
} )
} )
. addBooleanSwitch ( {
. addBooleanSwitch ( {
path : 'dashboardAlerts' ,
path : 'dashboardAlerts' ,
name : 'Alerts from this dashboard' ,
name : 'Alerts linked to this dashboard' ,
description : 'Show alerts from this dashboard' ,
description : 'Only show alerts linked to this dashboard' ,
defaultValue : false ,
defaultValue : false ,
category : [ 'Options' ] ,
category : [ 'Options' ] ,
} )
} )
@ -250,19 +250,23 @@ const unifiedAlertList = new PanelPlugin<UnifiedAlertListOptions>(UnifiedAlertLi
. addCustomEditor ( {
. addCustomEditor ( {
path : 'datasource' ,
path : 'datasource' ,
name : 'Datasource' ,
name : 'Datasource' ,
description : 'Filter alerts from selected data source' ,
description : 'Filter from alert source' ,
id : 'datasource' ,
id : 'datasource' ,
defaultValue : null ,
defaultValue : null ,
editor : function RenderDatasourcePicker ( props ) {
editor : function RenderDatasourcePicker ( props ) {
return (
return (
< DataSourcePicker
< Stack gap = { 1 } >
{ . . . props }
< DataSourcePicker
type = { [ 'prometheus' , 'loki' , 'grafana' ] }
{ . . . props }
noDefault
type = { [ 'prometheus' , 'loki' , 'grafana' ] }
current = { props . value }
noDefault
onChange = { ( ds : DataSourceInstanceSettings ) = > props . onChange ( ds . name ) }
current = { props . value }
onClear = { ( ) = > props . onChange ( null ) }
onChange = { ( ds : DataSourceInstanceSettings ) = > props . onChange ( ds . name ) }
/ >
/ >
< Button variant = "secondary" onClick = { ( ) = > props . onChange ( null ) } >
Clear
< / Button >
< / Stack >
) ;
) ;
} ,
} ,
category : [ 'Filter' ] ,
category : [ 'Filter' ] ,