From efa90cac6a86b969406adf7988144248ada6a4db Mon Sep 17 00:00:00 2001 From: nate Date: Fri, 10 Apr 2026 00:50:05 +0400 Subject: [PATCH] feat: bring over api features to dash --- apps/web/src/routes/dashboard.ts | 10 +++++++++ apps/web/src/views/incident-edit.ejs | 5 +++++ .../src/views/partials/monitor-form-js.ejs | 1 + apps/web/src/views/partials/monitor-form.ejs | 10 +++++++++ apps/web/src/views/status-page-edit.ejs | 22 ++++++++++++++++++- 5 files changed, 47 insertions(+), 1 deletion(-) diff --git a/apps/web/src/routes/dashboard.ts b/apps/web/src/routes/dashboard.ts index 6617721..67fd0f1 100644 --- a/apps/web/src/routes/dashboard.ts +++ b/apps/web/src/routes/dashboard.ts @@ -594,6 +594,7 @@ export const dashboard = new Elysia() retry_interval_s: Number(b.retry_interval_s) || undefined, resend_interval: Number(b.resend_interval) || 0, cert_alert_days: b.cert_alert_days != null ? Number(b.cert_alert_days) : 0, + max_redirects: b.max_redirects != null ? Number(b.max_redirects) : 1, channel_ids: Array.isArray(b.channel_ids) ? b.channel_ids : (b.channel_ids ? [b.channel_ids] : []), regions, request_headers: Object.keys(requestHeaders).length ? requestHeaders : null, @@ -636,6 +637,7 @@ export const dashboard = new Elysia() retry_interval_s: Number(b.retry_interval_s) || undefined, resend_interval: Number(b.resend_interval) || 0, cert_alert_days: b.cert_alert_days != null ? Number(b.cert_alert_days) : 0, + max_redirects: b.max_redirects != null ? Number(b.max_redirects) : 1, channel_ids: Array.isArray(b.channel_ids) ? b.channel_ids : (b.channel_ids ? [b.channel_ids] : []), regions, request_headers: Object.keys(requestHeaders).length ? requestHeaders : null, @@ -737,8 +739,11 @@ export const dashboard = new Elysia() bar_frequency: b.bar_frequency || "daily", bar_count: Number(b.bar_count) || 90, show_response_time: !!b.show_response_time, + show_cert_expiry: !!b.show_cert_expiry, show_powered_by: !!b.show_powered_by, index_search: !!b.index_search, + auto_refresh_s: Number(b.auto_refresh_s) || 60, + og_image_url: b.og_image_url || null, password: b.password || undefined, custom_css: b.custom_css || null, footer_text: b.footer_text || null, @@ -767,8 +772,11 @@ export const dashboard = new Elysia() bar_frequency: b.bar_frequency || "daily", bar_count: Number(b.bar_count) || 90, show_response_time: !!b.show_response_time, + show_cert_expiry: !!b.show_cert_expiry, show_powered_by: !!b.show_powered_by, index_search: !!b.index_search, + auto_refresh_s: Number(b.auto_refresh_s) || 60, + og_image_url: b.og_image_url || null, custom_css: b.custom_css || null, footer_text: b.footer_text || null, monitors: monitorsForApi, @@ -858,6 +866,7 @@ export const dashboard = new Elysia() title: b.title, status: b.status || "investigating", severity: b.severity || "minor", + pinned: !!b.pinned, monitor_ids: monitorIds, status_page_ids: pageIds, initial_update: { body: b.initial_update_body || "Investigating." }, @@ -883,6 +892,7 @@ export const dashboard = new Elysia() title: b.title, status: b.status, severity: b.severity, + pinned: !!b.pinned, monitor_ids: monitorIds, status_page_ids: pageIds, }), diff --git a/apps/web/src/views/incident-edit.ejs b/apps/web/src/views/incident-edit.ejs index d40eea6..fc685ad 100644 --- a/apps/web/src/views/incident-edit.ejs +++ b/apps/web/src/views/incident-edit.ejs @@ -25,6 +25,11 @@ class="w-full bg-gray-900 border border-gray-800 rounded-lg px-4 py-2.5 text-gray-100 placeholder-gray-600 focus:outline-none focus:border-blue-500"> + +
diff --git a/apps/web/src/views/partials/monitor-form-js.ejs b/apps/web/src/views/partials/monitor-form-js.ejs index 26927dc..70e2036 100644 --- a/apps/web/src/views/partials/monitor-form-js.ejs +++ b/apps/web/src/views/partials/monitor-form-js.ejs @@ -47,6 +47,7 @@ retry_interval_s: Number(document.getElementById(prefix + 'retry-interval').value), resend_interval: Number(document.getElementById(prefix + 'resend-interval').value), cert_alert_days: Number(document.getElementById(prefix + 'cert-alert-days').value), + max_redirects: Number(document.getElementById(prefix + 'max-redirects-follow').value), }; body.channel_ids = [...document.querySelectorAll('.' + prefix + 'channel-check:checked')].map(el => el.value); if (Object.keys(headers).length) body.request_headers = headers; diff --git a/apps/web/src/views/partials/monitor-form.ejs b/apps/web/src/views/partials/monitor-form.ejs index a9d654f..771f6ad 100644 --- a/apps/web/src/views/partials/monitor-form.ejs +++ b/apps/web/src/views/partials/monitor-form.ejs @@ -121,6 +121,16 @@
+
+ + +
+ <% const certDaysRaw = Number(monitor.cert_alert_days); const certDaysSel = (certDaysRaw >= 1 && certDaysRaw <= 9) ? String(certDaysRaw) : '0'; diff --git a/apps/web/src/views/status-page-edit.ejs b/apps/web/src/views/status-page-edit.ejs index c7c4f24..ede029a 100644 --- a/apps/web/src/views/status-page-edit.ejs +++ b/apps/web/src/views/status-page-edit.ejs @@ -160,11 +160,15 @@ <% } %> -
+
+
+
+
+ + +
+
+ + +
+
+ <% const hasPassword = !it.isNew && p.password_hash; %>