From b7ca30cbb93e6cc41cfaceafa2ad6692058d1a26 Mon Sep 17 00:00:00 2001 From: nate Date: Fri, 10 Apr 2026 11:31:06 +0400 Subject: [PATCH] update --- apps/web/src/routes/dashboard.ts | 8 ++-- apps/web/src/views/status-pages.ejs | 74 +++++++++++++++++------------ 2 files changed, 49 insertions(+), 33 deletions(-) diff --git a/apps/web/src/routes/dashboard.ts b/apps/web/src/routes/dashboard.ts index 3bcdc5d..8c78480 100644 --- a/apps/web/src/routes/dashboard.ts +++ b/apps/web/src/routes/dashboard.ts @@ -684,9 +684,11 @@ export const dashboard = new Elysia() const resolved = await getAccountId(cookie, headers); if (!resolved?.accountId) return redirect("/dashboard"); const pages = await sql` - SELECT id, slug, title, description, theme, custom_domain - FROM status_pages WHERE account_id = ${resolved.accountId} - ORDER BY created_at DESC + SELECT sp.id, sp.slug, sp.title, sp.description, sp.theme, sp.custom_domain, + sp.created_at, sp.password_hash IS NOT NULL AS protected, + (SELECT count(*)::int FROM status_page_monitors spm WHERE spm.status_page_id = sp.id) AS monitor_count + FROM status_pages sp WHERE sp.account_id = ${resolved.accountId} + ORDER BY sp.created_at DESC `; return html("status-pages", { nav: "pages", pages }); }) diff --git a/apps/web/src/views/status-pages.ejs b/apps/web/src/views/status-pages.ejs index 74f3968..8121831 100644 --- a/apps/web/src/views/status-pages.ejs +++ b/apps/web/src/views/status-pages.ejs @@ -1,46 +1,60 @@ <%~ include('./partials/head', { title: 'Status pages' }) %> <%~ include('./partials/nav', { nav: 'pages' }) %> -
+

Status pages

+ New page
-

- Public pages people can visit during an outage. Each page picks a slug, the monitors to display, and optional branding. -

- <% if (!it.pages || it.pages.length === 0) { %> -
- No status pages yet. Create one to get a public URL like pages.pingql.com/your-slug. -
+
+
+ +
+

No status pages yet

+

Create a public page so visitors can check your service status

+ Create your first page +
<% } else { %> - <% it.pages.forEach(function(p) { %> -
-
- <% }) %> + + <% }) %> + <% } %>