refactor(admin): fold code highlight and system notice into 常用功能
The 代码高亮 and 系统公告 schemas existed but appeared in no menu, so their routes were never generated (routes come from the sidebar constants). The reference keeps both inside the 常用功能 panel rather than as their own entries, so follow that structure instead of adding sidebar items. - global/common now carries three groups after the lazy-load ones: 代码高亮 (switch / line numbers / buttons / max height / light+dark theme) and 弹窗通知 (policy, content, 4 buttons, size, radius, icon, expiry) - group keys are uniquified (code-highlight, code-theme, notice-*) so they do not collide with the existing performance group - delete the orphan code-highlight.js / system-notice.js schemas and their section entries on both the Vue and PHP sides - delete post-list/pay.js and its PHP counterpart: every post_pay_* and post_download_* key there had zero runtime consumers, and the reference has no such page (paid-content config lives under 支付&付费) tools/health and tools/import-export turned out to already be reachable as custom pages, and remain untouched. Tests: admin contract audit 0 errors (warnings 56 → 51); SPA builds clean; suite 967/968 with the pre-existing frontend-lifecycle failure. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
451b04160b
commit
6c3c0f7c6d
9 files changed
+276
-438
No files matched your search
+112
-128
@@ -35,6 +35,118 @@ class GlobalSchema {
|
||||
]],
|
||||
['key' => 'thumbnail', 'label' => '懒加载预载图', 'type' => 'media', 'default' => get_template_directory_uri() . '/assets/img/thumbnail.svg'],
|
||||
]],
|
||||
['key' => 'code-highlight', 'title' => '代码高亮设置', 'fields' => [
|
||||
['key' => 'highlight_kg', 'label' => '代码高亮开关', 'type' => 'switch', 'default' => true],
|
||||
['key' => 'highlight_hh', 'label' => '显示行号', 'type' => 'switch', 'default' => false, 'dependsOn' => ['key' => 'highlight_kg', 'value' => true]],
|
||||
['key' => 'highlight_btn', 'label' => '显示扩展按钮', 'type' => 'switch', 'default' => true, 'dependsOn' => ['key' => 'highlight_kg', 'value' => true]],
|
||||
['key' => 'highlight_maxheight', 'label' => '最大高度(px,0=不限)', 'type' => 'number', 'default' => 400, 'min' => 0, 'max' => 2000, 'dependsOn' => ['key' => 'highlight_kg', 'value' => true]],
|
||||
]],
|
||||
['key' => 'code-theme', 'title' => '主题设置', 'fields' => [
|
||||
['key' => 'highlight_zt', 'label' => '日间默认主题', 'type' => 'select', 'default' => 'enlighter', 'dependsOn' => ['key' => 'highlight_kg', 'value' => true], 'options' => [
|
||||
['label' => '浅色: Enlighter', 'value' => 'enlighter'],
|
||||
['label' => '浅色: Bootstrap', 'value' => 'bootstrap4'],
|
||||
['label' => '浅色: Classic', 'value' => 'classic'],
|
||||
['label' => '浅色: Beyond', 'value' => 'beyond'],
|
||||
['label' => '浅色: Mowtwo', 'value' => 'mowtwo'],
|
||||
['label' => '浅色: Eclipse', 'value' => 'eclipse'],
|
||||
['label' => '浅色: Droide', 'value' => 'droide'],
|
||||
['label' => '浅色: Minimal', 'value' => 'minimal'],
|
||||
['label' => '浅色: Rowhammer', 'value' => 'rowhammer'],
|
||||
['label' => '浅色: Godzilla', 'value' => 'godzilla'],
|
||||
['label' => '深色: Dracula', 'value' => 'dracula'],
|
||||
['label' => '深色: Atomic', 'value' => 'atomic'],
|
||||
['label' => '深色: Monokai', 'value' => 'monokai'],
|
||||
]],
|
||||
['key' => 'highlight_dark_zt', 'label' => '暗色默认主题', 'type' => 'select', 'default' => 'monokai', 'dependsOn' => ['key' => 'highlight_kg', 'value' => true], 'options' => [
|
||||
['label' => '深色: Dracula', 'value' => 'dracula'],
|
||||
['label' => '深色: Atomic', 'value' => 'atomic'],
|
||||
['label' => '深色: Monokai', 'value' => 'monokai'],
|
||||
['label' => '浅色: Enlighter', 'value' => 'enlighter'],
|
||||
['label' => '浅色: Bootstrap', 'value' => 'bootstrap4'],
|
||||
]],
|
||||
]],
|
||||
['key' => 'notice-basic', 'title' => '公告设置', 'fields' => [
|
||||
['key' => 'system_notice_enabled', 'label' => '启用系统公告', 'type' => 'switch', 'default' => true],
|
||||
['key' => 'system_notice_policy', 'label' => '显示对象', 'type' => 'select', 'default' => '', 'options' => [
|
||||
['label' => '所有访客', 'value' => ''],
|
||||
['label' => '仅登录用户', 'value' => 'signin'],
|
||||
['label' => '仅 VIP 会员', 'value' => 'vip'],
|
||||
['label' => '仅非 VIP', 'value' => 'free'],
|
||||
['label' => '仅认证用户', 'value' => 'auth'],
|
||||
]],
|
||||
['key' => 'system_notice_title', 'label' => '公告标题', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'system_notice_content', 'label' => '公告内容', 'type' => 'textarea', 'default' => ''],
|
||||
]],
|
||||
['key' => 'notice-buttons', 'title' => '按钮组(留空则不显示)', 'fields' => [
|
||||
['key' => 'system_notice_btn1_text', 'label' => '按钮 1 文案', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'system_notice_btn1_link', 'label' => '按钮 1 链接', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'system_notice_btn1_color', 'label' => '按钮 1 颜色', 'type' => 'select', 'default' => 'primary', 'options' => [
|
||||
['label' => '主题色', 'value' => 'primary'],
|
||||
['label' => '成功绿', 'value' => 'success'],
|
||||
['label' => '警告橙', 'value' => 'warning'],
|
||||
['label' => '危险红', 'value' => 'danger'],
|
||||
['label' => '信息蓝', 'value' => 'info'],
|
||||
['label' => '深紫', 'value' => 'purple'],
|
||||
['label' => '深灰', 'value' => 'dark'],
|
||||
]],
|
||||
['key' => 'system_notice_btn2_text', 'label' => '按钮 2 文案', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'system_notice_btn2_link', 'label' => '按钮 2 链接', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'system_notice_btn2_color', 'label' => '按钮 2 颜色', 'type' => 'select', 'default' => 'primary', 'options' => [
|
||||
['label' => '主题色', 'value' => 'primary'],
|
||||
['label' => '成功绿', 'value' => 'success'],
|
||||
['label' => '警告橙', 'value' => 'warning'],
|
||||
['label' => '危险红', 'value' => 'danger'],
|
||||
['label' => '信息蓝', 'value' => 'info'],
|
||||
['label' => '深紫', 'value' => 'purple'],
|
||||
['label' => '深灰', 'value' => 'dark'],
|
||||
]],
|
||||
['key' => 'system_notice_btn3_text', 'label' => '按钮 3 文案', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'system_notice_btn3_link', 'label' => '按钮 3 链接', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'system_notice_btn3_color', 'label' => '按钮 3 颜色', 'type' => 'select', 'default' => 'primary', 'options' => [
|
||||
['label' => '主题色', 'value' => 'primary'],
|
||||
['label' => '成功绿', 'value' => 'success'],
|
||||
['label' => '警告橙', 'value' => 'warning'],
|
||||
['label' => '危险红', 'value' => 'danger'],
|
||||
['label' => '信息蓝', 'value' => 'info'],
|
||||
['label' => '深紫', 'value' => 'purple'],
|
||||
['label' => '深灰', 'value' => 'dark'],
|
||||
]],
|
||||
['key' => 'system_notice_btn4_text', 'label' => '按钮 4 文案', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'system_notice_btn4_link', 'label' => '按钮 4 链接', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'system_notice_btn4_color', 'label' => '按钮 4 颜色', 'type' => 'select', 'default' => 'primary', 'options' => [
|
||||
['label' => '主题色', 'value' => 'primary'],
|
||||
['label' => '成功绿', 'value' => 'success'],
|
||||
['label' => '警告橙', 'value' => 'warning'],
|
||||
['label' => '危险红', 'value' => 'danger'],
|
||||
['label' => '信息蓝', 'value' => 'info'],
|
||||
['label' => '深紫', 'value' => 'purple'],
|
||||
['label' => '深灰', 'value' => 'dark'],
|
||||
]],
|
||||
]],
|
||||
['key' => 'notice-style', 'title' => '样式设置', 'fields' => [
|
||||
['key' => 'system_notice_size', 'label' => '弹窗尺寸', 'type' => 'select', 'default' => '', 'options' => [
|
||||
['label' => '默认', 'value' => ''],
|
||||
['label' => '迷你', 'value' => 'modal-mini'],
|
||||
['label' => '小号', 'value' => 'modal-sm'],
|
||||
['label' => '大号', 'value' => 'modal-lg'],
|
||||
]],
|
||||
['key' => 'system_notice_radius', 'label' => '按钮圆角', 'type' => 'switch', 'default' => false, 'help' => '开启后弹窗按钮使用圆角样式'],
|
||||
['key' => 'system_notice_class', 'label' => '公告样式类', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'system_notice_title_icon', 'label' => '标题图标', 'type' => 'icon', 'default' => ''],
|
||||
['key' => 'system_notice_title_class', 'label' => '标题背景配色', 'type' => 'select', 'default' => '', 'options' => [
|
||||
['label' => '无', 'value' => ''],
|
||||
['label' => '炫彩黄', 'value' => 'jb-yellow'],
|
||||
['label' => '炫彩蓝', 'value' => 'jb-blue'],
|
||||
['label' => '炫彩绿', 'value' => 'jb-green'],
|
||||
['label' => '炫彩紫', 'value' => 'jb-purple'],
|
||||
['label' => '炫彩红', 'value' => 'jb-red'],
|
||||
['label' => '炫彩橙', 'value' => 'jb-orange'],
|
||||
], 'help' => '弹窗标题区域的背景配色方案'],
|
||||
['key' => 'system_notice_title_style', 'label' => '标题样式', 'type' => 'input', 'default' => ''],
|
||||
]],
|
||||
['key' => 'notice-expire', 'title' => '过期设置', 'fields' => [
|
||||
['key' => 'system_notice_expires', 'label' => '弹窗周期(小时)', 'type' => 'number', 'default' => 24, 'min' => 0, 'max' => 720, 'help' => '0 表示永不过期'],
|
||||
]],
|
||||
],
|
||||
],
|
||||
'logo' => [
|
||||
@@ -160,134 +272,6 @@ class GlobalSchema {
|
||||
]],
|
||||
],
|
||||
],
|
||||
'code-highlight' => [
|
||||
'key' => 'code-highlight',
|
||||
'title' => '代码高亮',
|
||||
'version' => '1.0.0',
|
||||
'option_key' => 'jio_settings',
|
||||
'groups' => [
|
||||
['key' => 'basic', 'title' => '代码高亮设置', 'fields' => [
|
||||
['key' => 'highlight_kg', 'label' => '代码高亮开关', 'type' => 'switch', 'default' => true],
|
||||
['key' => 'highlight_hh', 'label' => '显示行号', 'type' => 'switch', 'default' => false, 'dependsOn' => ['key' => 'highlight_kg', 'value' => true]],
|
||||
['key' => 'highlight_btn', 'label' => '显示扩展按钮', 'type' => 'switch', 'default' => true, 'dependsOn' => ['key' => 'highlight_kg', 'value' => true]],
|
||||
['key' => 'highlight_maxheight', 'label' => '最大高度(px,0=不限)', 'type' => 'number', 'default' => 400, 'min' => 0, 'max' => 2000, 'dependsOn' => ['key' => 'highlight_kg', 'value' => true]],
|
||||
]],
|
||||
['key' => 'theme', 'title' => '主题设置', 'fields' => [
|
||||
['key' => 'highlight_zt', 'label' => '日间默认主题', 'type' => 'select', 'default' => 'enlighter', 'dependsOn' => ['key' => 'highlight_kg', 'value' => true], 'options' => [
|
||||
['label' => '浅色: Enlighter', 'value' => 'enlighter'],
|
||||
['label' => '浅色: Bootstrap', 'value' => 'bootstrap4'],
|
||||
['label' => '浅色: Classic', 'value' => 'classic'],
|
||||
['label' => '浅色: Beyond', 'value' => 'beyond'],
|
||||
['label' => '浅色: Mowtwo', 'value' => 'mowtwo'],
|
||||
['label' => '浅色: Eclipse', 'value' => 'eclipse'],
|
||||
['label' => '浅色: Droide', 'value' => 'droide'],
|
||||
['label' => '浅色: Minimal', 'value' => 'minimal'],
|
||||
['label' => '浅色: Rowhammer', 'value' => 'rowhammer'],
|
||||
['label' => '浅色: Godzilla', 'value' => 'godzilla'],
|
||||
['label' => '深色: Dracula', 'value' => 'dracula'],
|
||||
['label' => '深色: Atomic', 'value' => 'atomic'],
|
||||
['label' => '深色: Monokai', 'value' => 'monokai'],
|
||||
]],
|
||||
['key' => 'highlight_dark_zt', 'label' => '暗色默认主题', 'type' => 'select', 'default' => 'monokai', 'dependsOn' => ['key' => 'highlight_kg', 'value' => true], 'options' => [
|
||||
['label' => '深色: Dracula', 'value' => 'dracula'],
|
||||
['label' => '深色: Atomic', 'value' => 'atomic'],
|
||||
['label' => '深色: Monokai', 'value' => 'monokai'],
|
||||
['label' => '浅色: Enlighter', 'value' => 'enlighter'],
|
||||
['label' => '浅色: Bootstrap', 'value' => 'bootstrap4'],
|
||||
]],
|
||||
]],
|
||||
],
|
||||
],
|
||||
'system-notice' => [
|
||||
'key' => 'system-notice',
|
||||
'title' => '系统公告',
|
||||
'version' => '2.0.0',
|
||||
'option_key' => 'jio_settings',
|
||||
'groups' => [
|
||||
['key' => 'basic', 'title' => '公告设置', 'fields' => [
|
||||
['key' => 'system_notice_enabled', 'label' => '启用系统公告', 'type' => 'switch', 'default' => true],
|
||||
['key' => 'system_notice_policy', 'label' => '显示对象', 'type' => 'select', 'default' => '', 'options' => [
|
||||
['label' => '所有访客', 'value' => ''],
|
||||
['label' => '仅登录用户', 'value' => 'signin'],
|
||||
['label' => '仅 VIP 会员', 'value' => 'vip'],
|
||||
['label' => '仅非 VIP', 'value' => 'free'],
|
||||
['label' => '仅认证用户', 'value' => 'auth'],
|
||||
]],
|
||||
['key' => 'system_notice_title', 'label' => '公告标题', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'system_notice_content', 'label' => '公告内容', 'type' => 'textarea', 'default' => ''],
|
||||
]],
|
||||
['key' => 'buttons', 'title' => '按钮组(留空则不显示)', 'fields' => [
|
||||
['key' => 'system_notice_btn1_text', 'label' => '按钮 1 文案', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'system_notice_btn1_link', 'label' => '按钮 1 链接', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'system_notice_btn1_color', 'label' => '按钮 1 颜色', 'type' => 'select', 'default' => 'primary', 'options' => [
|
||||
['label' => '主题色', 'value' => 'primary'],
|
||||
['label' => '成功绿', 'value' => 'success'],
|
||||
['label' => '警告橙', 'value' => 'warning'],
|
||||
['label' => '危险红', 'value' => 'danger'],
|
||||
['label' => '信息蓝', 'value' => 'info'],
|
||||
['label' => '深紫', 'value' => 'purple'],
|
||||
['label' => '深灰', 'value' => 'dark'],
|
||||
]],
|
||||
['key' => 'system_notice_btn2_text', 'label' => '按钮 2 文案', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'system_notice_btn2_link', 'label' => '按钮 2 链接', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'system_notice_btn2_color', 'label' => '按钮 2 颜色', 'type' => 'select', 'default' => 'primary', 'options' => [
|
||||
['label' => '主题色', 'value' => 'primary'],
|
||||
['label' => '成功绿', 'value' => 'success'],
|
||||
['label' => '警告橙', 'value' => 'warning'],
|
||||
['label' => '危险红', 'value' => 'danger'],
|
||||
['label' => '信息蓝', 'value' => 'info'],
|
||||
['label' => '深紫', 'value' => 'purple'],
|
||||
['label' => '深灰', 'value' => 'dark'],
|
||||
]],
|
||||
['key' => 'system_notice_btn3_text', 'label' => '按钮 3 文案', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'system_notice_btn3_link', 'label' => '按钮 3 链接', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'system_notice_btn3_color', 'label' => '按钮 3 颜色', 'type' => 'select', 'default' => 'primary', 'options' => [
|
||||
['label' => '主题色', 'value' => 'primary'],
|
||||
['label' => '成功绿', 'value' => 'success'],
|
||||
['label' => '警告橙', 'value' => 'warning'],
|
||||
['label' => '危险红', 'value' => 'danger'],
|
||||
['label' => '信息蓝', 'value' => 'info'],
|
||||
['label' => '深紫', 'value' => 'purple'],
|
||||
['label' => '深灰', 'value' => 'dark'],
|
||||
]],
|
||||
['key' => 'system_notice_btn4_text', 'label' => '按钮 4 文案', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'system_notice_btn4_link', 'label' => '按钮 4 链接', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'system_notice_btn4_color', 'label' => '按钮 4 颜色', 'type' => 'select', 'default' => 'primary', 'options' => [
|
||||
['label' => '主题色', 'value' => 'primary'],
|
||||
['label' => '成功绿', 'value' => 'success'],
|
||||
['label' => '警告橙', 'value' => 'warning'],
|
||||
['label' => '危险红', 'value' => 'danger'],
|
||||
['label' => '信息蓝', 'value' => 'info'],
|
||||
['label' => '深紫', 'value' => 'purple'],
|
||||
['label' => '深灰', 'value' => 'dark'],
|
||||
]],
|
||||
]],
|
||||
['key' => 'style', 'title' => '样式设置', 'fields' => [
|
||||
['key' => 'system_notice_size', 'label' => '弹窗尺寸', 'type' => 'select', 'default' => '', 'options' => [
|
||||
['label' => '默认', 'value' => ''],
|
||||
['label' => '迷你', 'value' => 'modal-mini'],
|
||||
['label' => '小号', 'value' => 'modal-sm'],
|
||||
['label' => '大号', 'value' => 'modal-lg'],
|
||||
]],
|
||||
['key' => 'system_notice_radius', 'label' => '按钮圆角', 'type' => 'switch', 'default' => false, 'help' => '开启后弹窗按钮使用圆角样式'],
|
||||
['key' => 'system_notice_class', 'label' => '公告样式类', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'system_notice_title_icon', 'label' => '标题图标', 'type' => 'icon', 'default' => ''],
|
||||
['key' => 'system_notice_title_class', 'label' => '标题背景配色', 'type' => 'select', 'default' => '', 'options' => [
|
||||
['label' => '无', 'value' => ''],
|
||||
['label' => '炫彩黄', 'value' => 'jb-yellow'],
|
||||
['label' => '炫彩蓝', 'value' => 'jb-blue'],
|
||||
['label' => '炫彩绿', 'value' => 'jb-green'],
|
||||
['label' => '炫彩紫', 'value' => 'jb-purple'],
|
||||
['label' => '炫彩红', 'value' => 'jb-red'],
|
||||
['label' => '炫彩橙', 'value' => 'jb-orange'],
|
||||
], 'help' => '弹窗标题区域的背景配色方案'],
|
||||
['key' => 'system_notice_title_style', 'label' => '标题样式', 'type' => 'input', 'default' => ''],
|
||||
]],
|
||||
['key' => 'expire', 'title' => '过期设置', 'fields' => [
|
||||
['key' => 'system_notice_expires', 'label' => '弹窗周期(小时)', 'type' => 'number', 'default' => 24, 'min' => 0, 'max' => 720, 'help' => '0 表示永不过期'],
|
||||
]],
|
||||
],
|
||||
],
|
||||
'search' => [
|
||||
'key' => 'search',
|
||||
'title' => '搜索功能',
|
||||
|
||||
@@ -254,32 +254,6 @@ class SchemaPostList {
|
||||
]],
|
||||
],
|
||||
],
|
||||
'pay' => [
|
||||
'key' => 'pay',
|
||||
'title' => '付费内容',
|
||||
'version' => '1.0.0',
|
||||
'option_key' => 'jio_settings',
|
||||
'groups' => [
|
||||
['key' => 'basic', 'title' => '付费设置', 'fields' => [
|
||||
['key' => 'post_pay_enable', 'label' => '启用付费内容', 'type' => 'switch', 'default' => false],
|
||||
['key' => 'post_pay_price_default', 'label' => '默认价格', 'type' => 'number', 'default' => 0, 'min' => 0, 'max' => 9999],
|
||||
['key' => 'post_pay_free_logged_show', 'label' => '登录用户显示免费', 'type' => 'switch', 'default' => false],
|
||||
['key' => 'post_pay_box_position', 'label' => '付费框位置', 'type' => 'radio', 'default' => 'content', 'options' => [
|
||||
['label' => '内容前', 'value' => 'content'],
|
||||
['label' => '全文遮罩', 'value' => 'mask'],
|
||||
]],
|
||||
['key' => 'post_pay_mark', 'label' => '付费标记', 'type' => 'input', 'default' => '付费'],
|
||||
['key' => 'post_pay_show_user', 'label' => '显示购买用户', 'type' => 'switch', 'default' => false],
|
||||
]],
|
||||
['key' => 'download', 'title' => '下载设置', 'fields' => [
|
||||
['key' => 'post_download_enable', 'label' => '启用下载功能', 'type' => 'switch', 'default' => false],
|
||||
['key' => 'post_download_remote_s', 'label' => '远程文件下载', 'type' => 'switch', 'default' => false],
|
||||
['key' => 'post_download_verify_nonce', 'label' => '下载鉴权', 'type' => 'switch', 'default' => true],
|
||||
['key' => 'post_download_user_log', 'label' => '用户下载日志', 'type' => 'switch', 'default' => true],
|
||||
['key' => 'post_download_post_log', 'label' => '文章下载日志', 'type' => 'switch', 'default' => true],
|
||||
]],
|
||||
],
|
||||
],
|
||||
'submit' => [
|
||||
'key' => 'submit',
|
||||
'title' => '前台投稿',
|
||||
|
||||
Reference in new issue
Block a user