Skip to content

Commit a1c7a35

Browse files
committed
add monitor datasource to ppl alert flyout
1 parent a6b0887 commit a1c7a35

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

public/components/Flyout/flyouts/components/AlertsDashboardFlyoutComponentPpl.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ import {
3030
PplPreviewTable,
3131
pplRespToDocs,
3232
} from '../../../../pages/CreateMonitor/components/PplPreviewTable/PplPreviewTable';
33+
import {
34+
getDataSources,
35+
getLocalClusterName,
36+
} from '../../../../pages/CreateMonitor/components/CrossClusterConfigurations/utils/helpers';
37+
import { getDataSourceQueryObj } from '../../../../pages/utils/helpers';
3338

3439
const DEFAULT_PAGE_SIZE = 5;
3540

@@ -41,6 +46,7 @@ export default class AlertsDashboardFlyoutComponentPpl extends Component {
4146
alerts: [],
4247
alertState: 'ALL',
4348
loading: true,
49+
localClusterName: undefined,
4450
page: 0,
4551
size: DEFAULT_PAGE_SIZE,
4652
sortDirection: 'desc',
@@ -55,8 +61,18 @@ export default class AlertsDashboardFlyoutComponentPpl extends Component {
5561
componentDidMount() {
5662
this._isMounted = true;
5763
this.getAlerts();
64+
this.getLocalClusterName();
5865
}
5966

67+
getLocalClusterName = async () => {
68+
const { httpClient } = this.props;
69+
const dataSourceQuery = getDataSourceQueryObj();
70+
const localClusterName = await getLocalClusterName(httpClient, dataSourceQuery);
71+
if (this._isMounted) {
72+
this.setState({ localClusterName });
73+
}
74+
};
75+
6076
componentDidUpdate(prevProps, prevState) {
6177
const watchedStateFields = ['page', 'size', 'alertState', 'sortDirection', 'sortField'];
6278

@@ -243,6 +259,7 @@ export default class AlertsDashboardFlyoutComponentPpl extends Component {
243259
alerts,
244260
alertState,
245261
loading,
262+
localClusterName,
246263
openResultPopoverId,
247264
page,
248265
size,
@@ -389,6 +406,14 @@ export default class AlertsDashboardFlyoutComponentPpl extends Component {
389406
</p>
390407
</EuiText>
391408
</EuiFlexItem>
409+
<EuiFlexItem>
410+
<EuiText size="s">
411+
<strong>Monitor data sources</strong>
412+
<p style={{ whiteSpace: 'pre-wrap' }}>
413+
{getDataSources(monitor, localClusterName).join('\n')}
414+
</p>
415+
</EuiText>
416+
</EuiFlexItem>
392417
</EuiFlexGroup>
393418

394419
<EuiHorizontalRule margin="xxl" />

public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStatsV2.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ const getTime = (time) => {
1919

2020
const getLastUpdatedHeader = () => {
2121
return (
22-
<span style={{ display: 'inline-flex', alignItems: 'center' }}>
22+
<span style={{ display: 'inline-flex', alignItems: 'baseline' }}>
2323
Last updated
2424
<EuiToolTip content="Time displayed in UTC">
25-
<EuiIcon type="iInCircle" size="s" style={{ marginLeft: '4px' }} />
25+
<EuiIcon type="iInCircle" size="s" style={{ marginLeft: '4px', marginTop: '-2px' }} />
2626
</EuiToolTip>
2727
</span>
2828
);

public/pages/MonitorDetails/containers/Triggers/TriggersPpl.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ const formatMinutes = (value) =>
5050

5151
const getExpireDurationHeader = () => {
5252
return (
53-
<span style={{ display: 'inline-flex', alignItems: 'center' }}>
53+
<span style={{ display: 'inline-flex', alignItems: 'baseline' }}>
5454
Expire duration
5555
<EuiToolTip content="Default to 7 days if not specified">
56-
<EuiIcon type="iInCircle" size="s" style={{ marginLeft: '4px' }} />
56+
<EuiIcon type="iInCircle" size="s" style={{ marginLeft: '4px', marginTop: '-2px' }} />
5757
</EuiToolTip>
5858
</span>
5959
);

0 commit comments

Comments
 (0)