From 79d2441c239e58564414f771c93a1ba54d60cc09 Mon Sep 17 00:00:00 2001 From: Wenaixi Date: Mon, 30 Mar 2026 23:06:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E5=81=A5=E5=BA=B7=E6=A3=80=E6=9F=A5=E5=89=8D=E7=AB=AF=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在配置管理页面添加定时健康检查开关、间隔配置 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus --- static/app/config-manager.js | 22 ++++++++++++++++++++ static/components/section-config.html | 29 +++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/static/app/config-manager.js b/static/app/config-manager.js index 68e99cc..1e031f7 100644 --- a/static/app/config-manager.js +++ b/static/app/config-manager.js @@ -236,6 +236,21 @@ async function loadConfiguration() { }); } + // 定时健康检查配置 + const scheduledHealthCheckEnabledEl = document.getElementById('scheduledHealthCheckEnabled'); + const scheduledHealthCheckStartupRunEl = document.getElementById('scheduledHealthCheckStartupRun'); + const scheduledHealthCheckIntervalEl = document.getElementById('scheduledHealthCheckInterval'); + + if (data.SCHEDULED_HEALTH_CHECK) { + if (scheduledHealthCheckEnabledEl) scheduledHealthCheckEnabledEl.checked = data.SCHEDULED_HEALTH_CHECK.enabled !== false; + if (scheduledHealthCheckStartupRunEl) scheduledHealthCheckStartupRunEl.checked = data.SCHEDULED_HEALTH_CHECK.startupRun !== false; + if (scheduledHealthCheckIntervalEl) scheduledHealthCheckIntervalEl.value = data.SCHEDULED_HEALTH_CHECK.interval || 600000; + } else { + if (scheduledHealthCheckEnabledEl) scheduledHealthCheckEnabledEl.checked = true; + if (scheduledHealthCheckStartupRunEl) scheduledHealthCheckStartupRunEl.checked = true; + if (scheduledHealthCheckIntervalEl) scheduledHealthCheckIntervalEl.value = 600000; + } + } catch (error) { console.error('Failed to load configuration:', error); } @@ -346,6 +361,13 @@ async function saveConfiguration() { } else { config.TLS_SIDECAR_ENABLED_PROVIDERS = []; } + + // 定时健康检查配置 + config.SCHEDULED_HEALTH_CHECK = { + enabled: document.getElementById('scheduledHealthCheckEnabled')?.checked !== false, + startupRun: document.getElementById('scheduledHealthCheckStartupRun')?.checked !== false, + interval: parseInt(document.getElementById('scheduledHealthCheckInterval')?.value || 600000) + }; try { await window.apiClient.post('/config', config); diff --git a/static/components/section-config.html b/static/components/section-config.html index 37e0fe1..d5fd694 100644 --- a/static/components/section-config.html +++ b/static/components/section-config.html @@ -228,6 +228,35 @@ + +
+

定时健康检查

+
+
+ + +
+
+ + +
+
+
+ + + 设置定时健康检查的执行间隔 +
+