diff --git a/public/app/plugins/datasource/cloudwatch/components/CrossAccountLogsQueryField.tsx b/public/app/plugins/datasource/cloudwatch/components/CrossAccountLogsQueryField.tsx index 6dacc9fd6d6..b328eeca6ee 100644 --- a/public/app/plugins/datasource/cloudwatch/components/CrossAccountLogsQueryField.tsx +++ b/public/app/plugins/datasource/cloudwatch/components/CrossAccountLogsQueryField.tsx @@ -1,7 +1,7 @@ import React, { useMemo, useState } from 'react'; import { SelectableValue } from '@grafana/data'; -import { EditorField } from '@grafana/experimental'; +import { EditorField, Space } from '@grafana/experimental'; import { Button, Checkbox, IconButton, LoadingPlaceholder, Modal, useStyles2 } from '@grafana/ui'; import Search from '../Search'; @@ -90,6 +90,7 @@ export const CrossAccountLogsQueryField = (props: CrossAccountLogsQueryProps) => searchPhrase={searchPhrase} /> + { searchFn(searchPhrase, accountId); @@ -99,6 +100,7 @@ export const CrossAccountLogsQueryField = (props: CrossAccountLogsQueryProps) => accountId={searchAccountId} /> +
@@ -126,14 +128,17 @@ export const CrossAccountLogsQueryField = (props: CrossAccountLogsQueryProps) => selectableLogGroups.map((row) => ( @@ -143,11 +148,12 @@ export const CrossAccountLogsQueryField = (props: CrossAccountLogsQueryProps) =>
- handleSelectCheckbox(row, ev.currentTarget.checked)} - value={!!(row.value && selectedLogGroups.some((lg) => lg.value === row.value))} - /> - +
+ handleSelectCheckbox(row, ev.currentTarget.checked)} + value={!!(row.value && selectedLogGroups.some((lg) => lg.value === row.value))} + /> + + +
{accountNameById[row.text]} {row.text}
+
-
@@ -159,7 +165,7 @@ export const CrossAccountLogsQueryField = (props: CrossAccountLogsQueryProps) => -
+
{props.selectedLogGroups.map((lg) => (
{lg.label} diff --git a/public/app/plugins/datasource/cloudwatch/components/styles.ts b/public/app/plugins/datasource/cloudwatch/components/styles.ts index 3334f8870f0..5371a277ece 100644 --- a/public/app/plugins/datasource/cloudwatch/components/styles.ts +++ b/public/app/plugins/datasource/cloudwatch/components/styles.ts @@ -8,6 +8,12 @@ const getStyles = (theme: GrafanaTheme2) => ({ tableLayout: 'fixed', }), + selectedLogGroupsContainer: css({ + marginLeft: theme.spacing(0.5), + display: 'flex', + flexFlow: 'wrap', + }), + tableScroller: css({ maxHeight: '50vh', overflow: 'auto', @@ -30,6 +36,11 @@ const getStyles = (theme: GrafanaTheme2) => ({ }, }), + nestedEntry: css({ + display: 'flex', + alignItems: 'center', + }), + logGroupSearchResults: css({ overflow: 'hidden', textOverflow: 'ellipsis', @@ -58,8 +69,8 @@ const getStyles = (theme: GrafanaTheme2) => ({ selectedLogGroup: css({ background: theme.colors.background.secondary, borderRadius: theme.shape.borderRadius(), - margin: theme.spacing(0.25, 1, 0.25, 0), - padding: theme.spacing(0.25, 0, 0.25, 1), + margin: theme.spacing(0, 1, 1, 0), + padding: theme.spacing(0.5, 0, 0.5, 1), color: theme.colors.text.primary, fontSize: theme.typography.size.sm, }), @@ -70,6 +81,7 @@ const getStyles = (theme: GrafanaTheme2) => ({ removeButton: css({ verticalAlign: 'middle', + marginLeft: theme.spacing(0.5), }), addBtn: css({