From fae73ff656cdbe13478cd1662a083decb1467e85 Mon Sep 17 00:00:00 2001 From: wangjia <809946525@qq.com> Date: Mon, 27 Jul 2026 11:37:12 +0800 Subject: [PATCH] =?UTF-8?q?feat(proxy):=20=E8=AE=BE=E7=BD=AE=E8=A1=8C?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=20pill=20=E5=8F=8D=E6=98=A0=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E5=88=86=E6=B5=81=E6=A8=A1=E5=BC=8F(=E4=B8=A4?= =?UTF-8?q?=E7=AB=AF,=E9=9A=8F=E6=A8=A1=E5=BC=8F+=E8=AF=AD=E8=A8=80?= =?UTF-8?q?=E8=81=94=E5=8A=A8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 设置页「Routing rules」行的模式 pill 之前静态显「智能分流/Smart routing」,不随实际 所选模式变。改为动态: - pill 加 id=routeModePill,renderRouting 按 state.routeMode 设其 data-i18n(rr.modeGlobal/ Smart/Direct)+ textContent(经 _ri 从 I18N 单源取)。切模式(seg 点击→renderRouting)即时更新。 - data-i18n 保留:切语言时 applyLang/applyI18n 用 pill 当前模式 key 重译 → 模式+语言双联动。 - pill 文案与 seg 一致(全局代理·Global / 智能分流·Smart / 全部直连·Direct)。 验收:两端语法通过、check-proto 全 resolve(rr.mode* 三态)、原型 --check 无漂移。 Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01A79VtQA1BwTuQN1ThpvYpo --- design/prototype/screens/ui-desktop.html | 4 +++- design/prototype/screens/ui-mobile.html | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/design/prototype/screens/ui-desktop.html b/design/prototype/screens/ui-desktop.html index cce4729..aff0835 100644 --- a/design/prototype/screens/ui-desktop.html +++ b/design/prototype/screens/ui-desktop.html @@ -687,7 +687,7 @@
分流规则
自定义直连 / 走隧道 / 拒绝
- 智能分流 + 智能分流
断连保护 Kill Switch
断线时阻断网络,防止数据泄露
@@ -2058,6 +2058,8 @@ var _rtBack=document.getElementById('rtBack'); if(_rtBack) _rtBack.addEventListe window.renderRouting=function(){ var mode=S.routeMode||'smart', smart=mode==='smart'; document.querySelectorAll('#rtModeSeg button').forEach(function(b){ b.classList.toggle('is-active', b.dataset.mode===mode); }); + var mp=document.getElementById('routeModePill'); + if(mp){ var mk=mode==='global'?'rr.modeGlobal':mode==='direct'?'rr.modeDirect':'rr.modeSmart'; mp.setAttribute('data-i18n',mk); mp.textContent=_ri(mk); } ['rtCnRow','rtMyRules'].forEach(function(id){ var el=document.getElementById(id); if(!el) return; el.style.opacity=smart?'':'.4'; el.style.pointerEvents=smart?'':'none'; }); var fp=document.getElementById('rtFinalPill'); if(fp){ if(mode==='direct'){ fp.textContent=_ri('rr.actDirect'); fp.className='pill is-success'; } else { fp.textContent=_ri('rr.actProxy'); fp.className='pill is-warning'; } } diff --git a/design/prototype/screens/ui-mobile.html b/design/prototype/screens/ui-mobile.html index babdf4c..c68e402 100644 --- a/design/prototype/screens/ui-mobile.html +++ b/design/prototype/screens/ui-mobile.html @@ -869,7 +869,7 @@
分流规则
-
智能分流
+
智能分流
@@ -2497,6 +2497,8 @@ $('#rowRouting').addEventListener('click', ()=>{ subOpen('routing'); renderRouti window.renderRouting=function(){ const mode=state.routeMode||'smart', smart=mode==='smart'; document.querySelectorAll('#rtModeSeg button').forEach(b=>b.classList.toggle('is-active', b.dataset.mode===mode)); + const mp=document.getElementById('routeModePill'); + if(mp){ const mk=mode==='global'?'rr.modeGlobal':mode==='direct'?'rr.modeDirect':'rr.modeSmart'; mp.setAttribute('data-i18n',mk); mp.textContent=_ri(mk); } ['rtCnRow','rtMyRules'].forEach(id=>{ const el=document.getElementById(id); if(!el) return; el.style.opacity=smart?'':'.4'; el.style.pointerEvents=smart?'':'none'; }); const fp=document.getElementById('rtFinalPill'); if(fp){ if(mode==='direct'){ fp.textContent=_ri('rr.actDirect'); fp.className='pill is-success'; } else { fp.textContent=_ri('rr.actProxy'); fp.className='pill is-warning'; } }