Hide application filter for queries that do not support it, fixes #1643
This commit is contained in:
@@ -154,6 +154,8 @@ export const ProblemsQueryEditor = ({ query, datasource, onChange }: Props) => {
|
||||
}
|
||||
};
|
||||
|
||||
const supportsApplications = datasource.zabbix.supportsApplications();
|
||||
|
||||
return (
|
||||
<>
|
||||
<QueryEditorRow>
|
||||
@@ -186,6 +188,7 @@ export const ProblemsQueryEditor = ({ query, datasource, onChange }: Props) => {
|
||||
</InlineField>
|
||||
</QueryEditorRow>
|
||||
<QueryEditorRow>
|
||||
{supportsApplications && (
|
||||
<InlineField label="Application" labelWidth={12}>
|
||||
<MetricPicker
|
||||
width={24}
|
||||
@@ -195,6 +198,7 @@ export const ProblemsQueryEditor = ({ query, datasource, onChange }: Props) => {
|
||||
onChange={onFilterChange('application')}
|
||||
/>
|
||||
</InlineField>
|
||||
)}
|
||||
<InlineField label="Problem" labelWidth={12}>
|
||||
<Input
|
||||
width={24}
|
||||
@@ -205,7 +209,7 @@ export const ProblemsQueryEditor = ({ query, datasource, onChange }: Props) => {
|
||||
</InlineField>
|
||||
<InlineField label="Tags" labelWidth={12}>
|
||||
<Input
|
||||
width={24}
|
||||
width={36}
|
||||
defaultValue={query.tags?.filter}
|
||||
placeholder="tag1:value1, tag2:value2"
|
||||
onBlur={onTextFilterChange('tags')}
|
||||
|
||||
@@ -260,7 +260,7 @@ export const TriggersQueryEditor = ({ query, datasource, onChange }: Props) => {
|
||||
)}
|
||||
</QueryEditorRow>
|
||||
<QueryEditorRow>
|
||||
{(supportsApplications || query.countTriggersBy !== 'items') && (
|
||||
{supportsApplications && (
|
||||
<InlineField label="Application" labelWidth={12}>
|
||||
<MetricPicker
|
||||
width={24}
|
||||
@@ -292,14 +292,6 @@ export const TriggersQueryEditor = ({ query, datasource, onChange }: Props) => {
|
||||
onBlur={onTextFilterChange('trigger')}
|
||||
/>
|
||||
</InlineField>
|
||||
<InlineField label="Tags" labelWidth={12}>
|
||||
<Input
|
||||
width={24}
|
||||
defaultValue={query.tags?.filter}
|
||||
placeholder="tag1:value1, tag2:value2"
|
||||
onBlur={onTextFilterChange('tags')}
|
||||
/>
|
||||
</InlineField>
|
||||
</>
|
||||
)}
|
||||
{query.countTriggersBy === 'items' && (
|
||||
@@ -313,6 +305,16 @@ export const TriggersQueryEditor = ({ query, datasource, onChange }: Props) => {
|
||||
/>
|
||||
</InlineField>
|
||||
)}
|
||||
{!supportsApplications && (
|
||||
<InlineField label="Tags" labelWidth={12}>
|
||||
<Input
|
||||
width={24}
|
||||
defaultValue={query.tags?.filter}
|
||||
placeholder="tag1:value1, tag2:value2"
|
||||
onBlur={onTextFilterChange('tags')}
|
||||
/>
|
||||
</InlineField>
|
||||
)}
|
||||
</QueryEditorRow>
|
||||
<QueryEditorRow>
|
||||
<InlineField label="Min severity" labelWidth={12}>
|
||||
|
||||
Reference in New Issue
Block a user