Skip to content

Commit

Permalink
Merge branch 'main' of github.com:percona-platform/grafana into PMM-1…
Browse files Browse the repository at this point in the history
…2378-cluster-view
  • Loading branch information
matejkubinec committed Sep 6, 2023
2 parents 6c029e7 + 493e60d commit 05443c1
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 42 deletions.
11 changes: 0 additions & 11 deletions public/app/percona/check/Check.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,6 @@ export const CheckService = {
.sort((a, b) => order[a.severity] - order[b.severity]),
};
},
async silenceAlert(alertId: string, silence: boolean, token?: CancelToken) {
return api.post<void, any>(
`${BASE_URL}/ToggleCheckAlert`,
{
alert_id: alertId,
silence,
},
false,
token
);
},
runDbChecks(checkNames: string[], token?: CancelToken): Promise<void | {}> {
return api.post<{}, {}>(
'/v1/management/SecurityChecks/Start',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
export const Messages = {
noChecks: 'No checks found.',
readMore: 'Read More',
activate: 'Activate',
silence: 'Silence',
pageTitle: (serviceName: string) => `Failed Checks for service "${serviceName}"`,
};
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ export const getStyles = ({ v1: { colors: v1Colors, spacing }, colors }: Grafana
${labelStyles}
}
`,
actions: css`
display: flex;
align-items: center;
justify-content: center;
`,
disabledRow: css`
background-color: ${colors.action.disabledBackground} !important;
opacity: ${colors.action.disabledOpacity};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { GrafanaRouteComponentProps } from 'app/core/navigation/types';
import { Severity } from 'app/percona/integrated-alerting/components/Severity';
import { Chip } from 'app/percona/shared/components/Elements/Chip';
import { ExpandableCell } from 'app/percona/shared/components/Elements/ExpandableCell';
import { SilenceBell } from 'app/percona/shared/components/Elements/SilenceBell';
import { ExtendedColumn, Table } from 'app/percona/shared/components/Elements/Table';
import { useStoredTablePageSize } from 'app/percona/shared/components/Elements/Table/Pagination';
import { useCancelToken } from 'app/percona/shared/components/hooks/cancelToken.hook';
Expand Down Expand Up @@ -63,14 +62,6 @@ export const ServiceChecks: FC<GrafanaRouteComponentProps<{ service: string }>>
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [pageIndex, pageSize, serviceId]);

const onSilenceClick = useCallback(
async (alertId: string, silenced: boolean) => {
await CheckService.silenceAlert(alertId, !silenced);
fetchChecks();
},
[fetchChecks]
);

const columns = useMemo(
(): Array<ExtendedColumn<ServiceFailedCheck>> => [
{
Expand Down Expand Up @@ -104,22 +95,8 @@ export const ServiceChecks: FC<GrafanaRouteComponentProps<{ service: string }>>
</a>
) : null,
},
{
Header: 'Actions',
accessor: 'silenced',
width: '30px',
Cell: ({ value, row }) => (
<span className={styles.actions}>
<SilenceBell
tooltip={value ? Messages.activate : Messages.silence}
silenced={value}
onClick={() => onSilenceClick(row.original.alertId, row.original.silenced)}
/>
</span>
),
},
],
[styles.link, styles.actions, onSilenceClick]
[styles.link]
);

const onPaginationChanged = useCallback(
Expand Down

0 comments on commit 05443c1

Please sign in to comment.