Open-source status page, incident response and uptime monitoring
TypeScript alertingincident-managementmcpmcp-servermonitoringmonitoring-as-codeobservabilityon-callopen-sourcesrestatus-pagestatuspagesynthetic-monitoringterraformtinybirdtursouptimeuptime-checkeruptime-monitor
chore: add banner (#1034)
Maximilian Kaskec441b67b8536
diff --git a/apps/web/src/app/app/[workspaceSlug]/(dashboard)/incidents/(overview)/page.tsx b/apps/web/src/app/app/[workspaceSlug]/(dashboard)/incidents/(overview)/page.tsxindex 305cebee8..eff25c35d 100644--- a/apps/web/src/app/app/[workspaceSlug]/(dashboard)/incidents/(overview)/page.tsx+++ b/apps/web/src/app/app/[workspaceSlug]/(dashboard)/incidents/(overview)/page.tsx@@ -4,23 +4,33 @@ import { EmptyState } from "@/components/dashboard/empty-state";import { columns } from "@/components/data-table/incident/columns";import { DataTable } from "@/components/data-table/incident/data-table";import { api } from "@/trpc/server";+import { ReportInfoBanner } from "./report-info-banner";export default async function IncidentPage() {- const incidents = await api.incident.getIncidentsByWorkspace.query();+ const [incidents, statusReports] = await Promise.all([+ api.incident.getIncidentsByWorkspace.query(),+ api.statusReport.getStatusReportByWorkspace.query(),+ ]);++ console.log(statusReports);if (incidents?.length === 0)return (- <EmptyState- icon="siren"- title="No incidents"- description="Hopefully you will see this screen for a long time."- action={undefined}- />+ <>+ <EmptyState+ icon="siren"+ title="No incidents"+ description="Hopefully you will see this screen for a long time."+ action={undefined}+ />+ {!statusReports.length ? <ReportInfoBanner /> : null}+ </>);return (<><DataTable columns={columns} data={incidents} />+ {!statusReports.length ? <ReportInfoBanner /> : null}</>);}diff --git a/apps/web/src/app/app/[workspaceSlug]/(dashboard)/incidents/(overview)/report-info-banner.tsx b/apps/web/src/app/app/[workspaceSlug]/(dashboard)/incidents/(overview)/report-info-banner.tsxnew file mode 100644index 000000000..a58143d9a--- /dev/null+++ b/apps/web/src/app/app/[workspaceSlug]/(dashboard)/incidents/(overview)/report-info-banner.tsx@@ -0,0 +1,24 @@+import { Alert, AlertDescription, AlertTitle } from "@openstatus/ui";+import { Megaphone } from "lucide-react";+import Link from "next/link";++export function ReportInfoBanner() {+ return (+ <Alert className="max-w-4xl">+ <Megaphone className="h-4 w-4" />+ <AlertTitle>Looking for Status Reports?</AlertTitle>+ <AlertDescription>+ The incidents will be created automatically if an endpoint fails. If you+ want to inform your users about a planned maintenance, or a current+ issue you can create a status report. Go to{" "}+ <Link+ className="underline underline-offset-4 hover:text-primary hover:no-underline"+ href="./status-pages"+ >+ Status Pages+ </Link>{" "}+ and select a page you want to report on.+ </AlertDescription>+ </Alert>+ );+}