From 0e93064321afbea42b27683da55bc47a360623c8 Mon Sep 17 00:00:00 2001 From: huangxd- <649924757@qq.com> Date: Sun, 26 Jul 2026 22:01:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E5=88=97=E8=A1=A8=E4=B8=AD=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=20UI=5FTHEME=20=E5=90=8E=E7=BC=96=E8=BE=91=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=B4=A2=E5=BC=95=E9=94=99=E4=B9=B1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在渲染环境变量列表时,过滤掉 UI_THEME 项后,原索引与显示位置不匹配,导致编辑和删除操作错误。现保留原始索引,确保操作指向正确的配置项。 --- danmu_api/ui/js/systemsettings.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/danmu_api/ui/js/systemsettings.js b/danmu_api/ui/js/systemsettings.js index 6841792..b311045 100644 --- a/danmu_api/ui/js/systemsettings.js +++ b/danmu_api/ui/js/systemsettings.js @@ -2254,14 +2254,15 @@ function renderEnvList() { if (themeSettings) themeSettings.hidden = currentCategory !== 'system'; const items = (envVariables[currentCategory] || []) - .filter(item => item.key !== 'UI_THEME'); + .map((item, originalIndex) => ({ item, originalIndex })) + .filter(({ item }) => item.key !== 'UI_THEME'); if (items.length === 0) { list.innerHTML = '

暂无配置项

'; return; } - list.innerHTML = items.map((item, index) => { + list.innerHTML = items.map(({ item, originalIndex }) => { const typeLabel = item.type === 'boolean' ? '布尔' : item.type === 'number' ? '数字' : item.type === 'select' ? '单选' : @@ -2279,8 +2280,8 @@ function renderEnvList() {
\${item.description || '无描述'}
- - + +
\`;