Skip to content

Commit bc1f56d

Browse files
committed
refactor(csp): 将 CSP 规则降级为 Tools 页内卡片
- 从主侧边栏移除独立菜单/路由,改为在 Tools 页面以卡片形式呈现 - 卡片仅展示全局开关、规则启用/总数摘要和"管理规则"入口 - 完整的规则表格、创建/编辑、模式测试移入 800px Drawer - 帮助指南改由卡片标题栏的问号图标触发,与开发工具卡片视觉对齐
1 parent a17aa76 commit bc1f56d

5 files changed

Lines changed: 294 additions & 280 deletions

File tree

‎src/locales/en-US/translation.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
"csp_rule_guide": "Guide",
5454
"csp_global_switch": "Remove All CSP",
5555
"csp_global_switch_desc": "When enabled, CSP headers will be removed from all pages without configuring rules",
56+
"csp_manage_rules": "Manage Rules",
57+
"csp_rule_summary": "Custom rules: {enabled} enabled / {total} total",
5658
"csp_global_enabled": "Global CSP removal enabled",
5759
"csp_global_disabled": "Global CSP removal disabled",
5860
"csp_test_title": "Pattern Test",

‎src/locales/zh-CN/translation.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
"csp_rule_guide": "帮助",
5454
"csp_global_switch": "全局移除 CSP",
5555
"csp_global_switch_desc": "开启后将移除所有网页的 CSP 头,无需配置规则",
56+
"csp_manage_rules": "管理规则",
57+
"csp_rule_summary": "自定义规则: {enabled} 已启用 / {total} 总数",
5658
"csp_global_enabled": "已开启全局移除 CSP",
5759
"csp_global_disabled": "已关闭全局移除 CSP",
5860
"csp_test_title": "模式测试",

‎src/pages/components/layout/Sider.tsx‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Logger from "@App/pages/options/routes/Logger";
2-
import CSPRule from "@App/pages/options/routes/CSPRule";
32
import ScriptEditor from "@App/pages/options/routes/script/ScriptEditor";
43
import ScriptList from "@App/pages/options/routes/ScriptList";
54
import Setting from "@App/pages/options/routes/Setting";
@@ -12,7 +11,6 @@ import {
1211
IconGithub,
1312
IconLeft,
1413
IconLink,
15-
IconLock,
1614
IconQuestion,
1715
IconRight,
1816
IconSettings,
@@ -74,11 +72,6 @@ const Sider: React.FC = () => {
7472
<IconTool /> {t("tools")}
7573
</MenuItem>
7674
</CustomLink>
77-
<CustomLink to="/csp-rule">
78-
<MenuItem key="/csp-rule">
79-
<IconLock /> {t("csp_rule")}
80-
</MenuItem>
81-
</CustomLink>
8275
<CustomLink to="/setting" className="menu-setting">
8376
<MenuItem key="/setting">
8477
<IconSettings /> {t("settings")}
@@ -211,7 +204,6 @@ const Sider: React.FC = () => {
211204
</Route>
212205
<Route path="/subscribe" element={<SubscribeList />} />
213206
<Route path="/logger" element={<Logger />} />
214-
<Route path="/csp-rule" element={<CSPRule />} />
215207
<Route path="/tools" element={<Tools />} />
216208
<Route path="/setting" element={<Setting />} />
217209
</Routes>

0 commit comments

Comments
 (0)