From 72d465154559ebfe9e5f0d87cdd203c9a9157f1c Mon Sep 17 00:00:00 2001 From: xuans Date: Fri, 16 Oct 2026 22:08:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=B3=BB=E7=BB=9F=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E6=94=AF=E6=8C=81=E6=8C=89=E6=A8=A1=E5=9D=97=E7=8B=AC?= =?UTF-8?q?=E7=AB=8B=E6=8F=90=E4=BA=A4=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/Dashboard/SettingsPayload.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/Dashboard/SettingsPayload.js b/frontend/src/views/Dashboard/SettingsPayload.js index 96189ab..0d3df0d 100644 --- a/frontend/src/views/Dashboard/SettingsPayload.js +++ b/frontend/src/views/Dashboard/SettingsPayload.js @@ -19,17 +19,29 @@ const requestFields = { ], }; -export function settingsPayload(current, targetSection) { + +const tabSectionMap = { + service: ["server", "web", "paths"], + acme: ["acme"], + dns: ["dns"], + notification: ["notification"], +}; + +export function settingsPayload(current, targetTabOrSection) { const payload = {}; + let targetSections = null; + if (targetTabOrSection) { + targetSections = tabSectionMap[targetTabOrSection] || [targetTabOrSection]; + } for (const [section, fields] of Object.entries(requestFields)) { - if (targetSection && targetSection !== section) continue; + if (targetSections && !targetSections.includes(section)) continue; const source = current[section] || {}; payload[section] = Object.fromEntries( fields.filter((field) => source[field] !== undefined) .map((field) => [field, source[field]]), ); } - if (!targetSection || targetSection === "dns") { + if (!targetSections || targetSections.includes("dns")) { const dns = current.dns || {}; payload.dns = { provider: dns.provider }; if (dns.credential_ref && dns.verification_token) {