Skip to content

Commit

Permalink
feat(ui): add facets to alerts table (#2396)
Browse files Browse the repository at this point in the history
Co-authored-by: Kirill Chernakov <[email protected]>
Co-authored-by: Tal <[email protected]>
  • Loading branch information
3 people authored Nov 6, 2024
1 parent 56aa378 commit a6a2999
Show file tree
Hide file tree
Showing 9 changed files with 728 additions and 114 deletions.
2 changes: 1 addition & 1 deletion keep-ui/app/alerts/alert-presets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export default function AlertPresets({
</div>
</div>
</Modal>
<div className="flex w-full items-start xl:mt-6">
<div className="flex w-full items-start relative z-10">
<AlertsRulesBuilder
table={table}
defaultQuery=""
Expand Down
34 changes: 34 additions & 0 deletions keep-ui/app/alerts/alert-severity-border.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import clsx from "clsx";
import { Severity } from "./models";

export function AlertSeverityBorder({
severity,
}: {
severity: Severity | undefined;
}) {
const getSeverityBgClassName = (severity?: Severity) => {
switch (severity) {
case "critical":
return "bg-red-500";
case "high":
case "error":
return "bg-orange-500";
case "warning":
return "bg-yellow-500";
case "info":
return "bg-blue-500";
default:
return "bg-emerald-500";
}
};

return (
<div
className={clsx(
"absolute w-1 h-full top-0 left-0",
getSeverityBgClassName(severity)
)}
aria-label={severity}
/>
);
}
1 change: 1 addition & 0 deletions keep-ui/app/alerts/alert-severity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export default function AlertSeverity({ severity }: Props) {
icon={icon}
tooltip={capitalize(severityText)}
size="sm"
className="!p-0"
/>
);
}
Loading

0 comments on commit a6a2999

Please sign in to comment.