Skip to content

Open-source status page, incident response and uptime monitoring

chore: create page default (#1479)

Maximilian Kaske090ab12380f2
diff --git a/apps/docs/src/content/docs/tutorial/how-to-configure-status-page.mdx b/apps/docs/src/content/docs/tutorial/how-to-configure-status-page.mdx
index 3081709e5..3be5dc0c2 100644
--- a/apps/docs/src/content/docs/tutorial/how-to-configure-status-page.mdx
+++ b/apps/docs/src/content/docs/tutorial/how-to-configure-status-page.mdx
@@ -16,7 +16,7 @@ import StatusPageBeta4 from '../../../assets/tutorial/configure-status-page/stat
We are releasing a new version of our status pages.
-<Aside>This is an **opt-in toggle**. We will keep the current status page until next year to allow you migrate or provide any feedback.</Aside>
+<Aside>Newly created pages will automatically run on the new version. For old pages, this is an **opt-in toggle**. We will keep the current status page until next year to allow you migrate or provide any feedback.</Aside>
You can always have a look how your status page will look like via `https://[slug].stpg.dev`.
diff --git a/packages/api/src/router/page.ts b/packages/api/src/router/page.ts
index 7cbad85d4..46d0c0299 100644
--- a/packages/api/src/router/page.ts
+++ b/packages/api/src/router/page.ts
@@ -569,6 +569,14 @@ export const pageRouter = createTRPCRouter({
});
}
+ // REMINDER: default config from legacy page
+ const defaultConfiguration = {
+ type: "absolute",
+ value: "requests",
+ uptime: true,
+ theme: "default-rounded",
+ } satisfies Record<string, string | boolean | undefined>;
+
const newPage = await opts.ctx.db
.insert(page)
.values({
@@ -577,6 +585,8 @@ export const pageRouter = createTRPCRouter({
slug: opts.input.slug,
description: opts.input.description ?? "",
icon: opts.input.icon ?? "",
+ legacyPage: false,
+ configuration: defaultConfiguration,
customDomain: "", // TODO: make nullable
})
.returning()