mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-27 11:12:55 +00:00
remove graph
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import AlertRuleGraphEditor from "@app/components/alert-rule-editor/AlertRuleGraphEditor";
|
||||
import HeaderTitle from "@app/components/SettingsSectionTitle";
|
||||
import { apiResponseToFormValues } from "@app/lib/alertRuleForm";
|
||||
import { createApiClient, formatAxiosError } from "@app/lib/api";
|
||||
import { useEnvContext } from "@app/hooks/useEnvContext";
|
||||
@@ -59,9 +60,15 @@ export default function EditAlertRulePage() {
|
||||
|
||||
if (formValues === undefined) {
|
||||
return (
|
||||
<div className="min-h-[12rem] flex items-center justify-center text-muted-foreground text-sm">
|
||||
{t("loading")}
|
||||
</div>
|
||||
<>
|
||||
<HeaderTitle
|
||||
title={t("alertingEditRule")}
|
||||
description={t("alertingRuleCredenzaDescription")}
|
||||
/>
|
||||
<div className="min-h-[12rem] flex items-center justify-center text-muted-foreground text-sm">
|
||||
{t("loading")}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -70,13 +77,19 @@ export default function EditAlertRulePage() {
|
||||
}
|
||||
|
||||
return (
|
||||
<AlertRuleGraphEditor
|
||||
key={alertRuleId}
|
||||
orgId={orgId}
|
||||
alertRuleId={alertRuleId}
|
||||
initialValues={formValues}
|
||||
isNew={false}
|
||||
disabled={!isPaid}
|
||||
/>
|
||||
<>
|
||||
<HeaderTitle
|
||||
title={t("alertingEditRule")}
|
||||
description={t("alertingRuleCredenzaDescription")}
|
||||
/>
|
||||
<AlertRuleGraphEditor
|
||||
key={alertRuleId}
|
||||
orgId={orgId}
|
||||
alertRuleId={alertRuleId}
|
||||
initialValues={formValues}
|
||||
isNew={false}
|
||||
disabled={!isPaid}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,23 +1,32 @@
|
||||
"use client";
|
||||
|
||||
import AlertRuleGraphEditor from "@app/components/alert-rule-editor/AlertRuleGraphEditor";
|
||||
import HeaderTitle from "@app/components/SettingsSectionTitle";
|
||||
import { defaultFormValues } from "@app/lib/alertRuleForm";
|
||||
import { usePaidStatus } from "@app/hooks/usePaidStatus";
|
||||
import { tierMatrix } from "@server/lib/billing/tierMatrix";
|
||||
import { useParams } from "next/navigation";
|
||||
import { useTranslations } from "next-intl";
|
||||
|
||||
export default function NewAlertRulePage() {
|
||||
const params = useParams();
|
||||
const orgId = params.orgId as string;
|
||||
const t = useTranslations();
|
||||
const { isPaidUser } = usePaidStatus();
|
||||
const isPaid = isPaidUser(tierMatrix.alertingRules);
|
||||
|
||||
return (
|
||||
<AlertRuleGraphEditor
|
||||
orgId={orgId}
|
||||
initialValues={defaultFormValues()}
|
||||
isNew
|
||||
disabled={!isPaid}
|
||||
/>
|
||||
<>
|
||||
<HeaderTitle
|
||||
title={t("alertingCreateRule")}
|
||||
description={t("alertingRuleCredenzaDescription")}
|
||||
/>
|
||||
<AlertRuleGraphEditor
|
||||
orgId={orgId}
|
||||
initialValues={defaultFormValues()}
|
||||
isNew
|
||||
disabled={!isPaid}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user