From e43bd68986d24562e93e160a798bc688cda2824d Mon Sep 17 00:00:00 2001 From: Muse Date: Fri, 23 Oct 2026 00:09:35 +0000 Subject: [PATCH] B6 fixes from first E2E contact: PUT /probe/notify answers the fresh view; frontend notifyLogin is boolean and secret flags use the notify-prefixed wire names --- frontend/src/pages/settings/PublicPageTab.tsx | 22 +++++++++---------- internal/web/controller/probe_notify.go | 7 +++++- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/frontend/src/pages/settings/PublicPageTab.tsx b/frontend/src/pages/settings/PublicPageTab.tsx index 1108f0b..c8dbb57 100644 --- a/frontend/src/pages/settings/PublicPageTab.tsx +++ b/frontend/src/pages/settings/PublicPageTab.tsx @@ -69,13 +69,13 @@ interface NotifySettingsWire { notifyGrace: number; notifyTraffic: number; notifyExpiry: number; - notifyLogin: string; + notifyLogin: boolean; notifyTelegramText: string; notifyWebhookBody: string; telegramConfigured: boolean; webhookConfigured: boolean; - webhookUrlSet: boolean; - webhookHeadersSet: boolean; + notifyWebhookUrlSet: boolean; + notifyWebhookHeadersSet: boolean; } interface CoverageRow { @@ -232,12 +232,12 @@ export default function PublicPageTab() { async function testNotify() { setNotifyTesting(true); try { - const msg = await HttpUtil.post('/panel/api/probe/notify/test', undefined, { + const msg = await HttpUtil.post<{ sent: string[] }>('/panel/api/probe/notify/test', undefined, { silent: true, }); if (msg?.success) { messageApi.success( - t('pages.settings.probeNotify.testSent', { channels: (msg.obj ?? []).join('、') }), + t('pages.settings.probeNotify.testSent', { channels: (msg.obj?.sent ?? []).join('、') }), ); } else { messageApi.error(msg?.msg || t('pages.settings.probeThemes.saveFailed')); @@ -627,8 +627,8 @@ export default function PublicPageTab() {
{t('pages.settings.probeNotify.loginAlert')}
setNotify({ ...notify, notifyLogin: v ? 'on' : 'off' })} + checked={notify.notifyLogin} + onChange={(v) => setNotify({ ...notify, notifyLogin: v })} /> @@ -670,14 +670,14 @@ export default function PublicPageTab() { { setWebhookUrl(e.target.value); setUrlTouched(true); }} /> - {notify.webhookUrlSet && !urlTouched ? ( + {notify.notifyWebhookUrlSet && !urlTouched ? (