Commit Graph

186 Commits

Author SHA1 Message Date
mediabot-pt
f65b8d0e2e fix: 四页面 savePreview 检查 save-preview 响应 code,失败时不误显成功
ApiResponse.error 返回 HTTP 200 + JSON code:400,Axios 当成功处理
前端未检查 code 字段导致误显成功但 draft 实际未创建,发布按钮不出现
2026-07-07 23:46:55 +08:00
mediabot-pt
04fc009a33 refactor: AccessResultCheck 去掉审批相关按钮和逻辑,简化为两阶段发布
移除:通过/拒绝/发布(approveConfig)按钮、approveConfig/rejectConfig/saveScript 函数、approving/rejecting/saving ref
保留:保存预览版 → 发布正式版 两阶段流程
2026-07-07 23:38:48 +08:00
mediabot-pt
1436f81667 feat: 快照API响应增加顶层version字段,与check接口保持一致 2026-07-07 22:49:03 +08:00
mediabot-pt
45f16f2b54 refactor: 统一所有页面按钮文案,合并上传逻辑到保存
1. Sites.vue: '保存' → '保存预览版'
2. SitePages.vue: '保存' → '保存预览版',移除上传按钮和uploadPages函数
3. AccessResultCheck.vue: 两处'保存' → '保存预览版'
4. SitePagesController: savePages/saveDefaultPages 直接包含CDN上传,移除 /upload 端点
2026-07-07 18:02:22 +08:00
mediabot-pt
51e9341748 fix: 风险规则保存按钮文案改为'保存预览版' 2026-07-07 17:58:46 +08:00
mediabot-pt
ec37369bc2 refactor: 合并上传到保存按钮,去掉上传按钮
1. 后端 saveRules/saveDefaultRules 接口直接包含 CDN 上传逻辑
2. 移除独立的 /upload 端点(风险规则 + 默认规则)
3. 前端去掉上传按钮和 uploadRules 函数
4. 现在只需保存→发布正式版两步即可完成
2026-07-07 17:57:20 +08:00
mediabot-pt
40eea42710 fix: 上传风险规则后同步更新站点快照,解决状态仍显示未发布的问题
1. 后端 RiskRuleServiceImpl:将 updateSnapshotsByType 从异步事件改为同步调用 snapshotService.updateSnapshot
2. 前端 RiskRules.vue:上传按钮成功后调用 fetchSnapshotStatus 刷新状态标签
2026-07-07 17:54:37 +08:00
mediabot-pt
e953e9a7fd refactor: 合并保存按钮,点击保存即自动保存源数据+拍快照 2026-07-07 13:19:50 +08:00
mediabot-pt
e659b9bca6 refactor: 保存预览版自动先保存源数据,简化操作一步完成 2026-07-07 13:16:34 +08:00
mediabot-pt
6505f621d1 feat: 编辑器增加「重置」和「丢弃预览版」按钮,支持回退预览版快照 2026-07-07 13:12:19 +08:00
mediabot-pt
e99de15703 feat: 编辑器增加版本状态(预览版/正式版)和未保存提示 2026-07-07 12:19:18 +08:00
mediabot-pt
ebfb6395db refactor: 合并三级缓存为统一缓存 + 重命名 saveDraft → savePreview
1. 三个 Caffeine Cache 合并为一个 jsonCache,key 用 :published/:draft 后缀区分
2. saveDraft → savePreview,更准确反映「预览版」语义(非临时草稿)
3. getPreviewBundleJson 去掉独立缓存,直接查 DB(preview 是 draft+published 逻辑并集,缓存意义不大)
4. 前端按钮「保存草稿」→「保存预览版」,API 路径 /save-draft → /save-preview
2026-07-07 11:45:04 +08:00
mediabot-pt
3cc7b932a8 fix: 修复快照两阶段发布方案的缓存一致性和前端问题
1. updateSnapshot() 自动触发生成 draft 后刷新 draft/preview 缓存
2. saveDraft() 同时刷新 previewJsonCache
3. 前端编辑页新增「保存站点」按钮,确保站点基本信息可持久化
4. publishManifest() 兼容 bundle 改用缓存 JSON,避免重复 buildSnapshot
2026-07-07 11:43:06 +08:00
mediabot-pt
5f58083074 feat: 快照改为预览版/正式版两阶段发布 - 新增 saveDraft 接口手动保存草稿快照 - 新增 getDraftBundleJson 方法读取预览版(Caffeine缓存) - SnapshotController 支持 ?preview=true 参数读取 draft - 前端编辑页改为'保存草稿'+'发布正式版'两个按钮 - AdminController 新增单站点 save-draft/publish 接口 - 复用 populateSnapshotFields 消除重复代码 2026-07-07 11:36:38 +08:00
mediabot-pt
0b0dcb4f04 refactor: use only siteId for risk rule storage, drop type-level fallback 2026-07-06 23:52:30 +08:00
mediabot-pt
a643d976cf feat: support both site-level and type-level risk rule storage
List shows source column: site-level or type-level

Fallback: siteId rule first, then siteType rule

Save always creates site-level entry; load falls back to type-level if none exists
2026-07-06 23:51:26 +08:00
mediabot-pt
5a7b218944 fix: store risk rules per siteId instead of shared siteType 2026-07-06 23:50:23 +08:00
mediabot-pt
dde14cb73f fix: save no longer returns to list page 2026-07-06 23:39:45 +08:00
mediabot-pt
650402baf2 fix: remove fold/expand feature, always show card body
Fold was unreliable and unnecessary; body is always visible now
2026-07-06 23:33:29 +08:00
mediabot-pt
8381589388 fix: improve card fold/expand UX - single-click toggle, clear text hint
Click anywhere on header to toggle fold/expand

Right side shows '\u5c55\u5f00' or '\u6536\u8d77' text instead of tiny arrow icon

Drag handle icon stops click propagation to prevent accidental fold

Delete button uses stopPropagation to avoid triggering fold
2026-07-06 23:26:56 +08:00
mediabot-pt
1c06be991d feat: DRATIO supports multiple threshold-ratio levels
Replace single threshold+minRatio with levels array

Card header: \u4e0b\u8f7d\u91cf\u5206\u7ea7\u63a7\u5236\uff082\u7ea7\uff09

Card body: editable rows with add/delete buttons per level

Default preset: 100GB\u21921.0, 500GB\u21922.0, 1000GB\u21923.0

Auto-migrate old single-value format on load
2026-07-06 23:07:27 +08:00
mediabot-pt
1cea882d9d refactor: make applicable condition a read-only tag in card header
Applicable is preset-defined, not editable on card

Shown as grey tag after action label: \u5c01\u53f7/\u5220\u9664\u8d26\u53f7 (\u975e\u5c01\u5b58\u8d26\u53f7)

Remove applicable dropdown from card body, onApplicableChange handler
2026-07-06 23:02:16 +08:00
mediabot-pt
194ce96f39 refactor: make rule type a read-only label on card
Type is fixed by preset, no need for dropdown editing

Remove unused typeDefaults, onTypeChange functions
2026-07-06 23:00:55 +08:00
mediabot-pt
cf26f2f6b1 refactor: remove add-rule button, keep only quick-add dropdown
All rule patterns are covered by presets, no need for blank rule creation

Also fix missing Refresh icon import
2026-07-06 22:52:19 +08:00
mediabot-pt
36e05896e5 refactor: remove redundant template import dialog, keep only quick-add dropdown
Quick-add dropdown already serves the same purpose with fewer clicks
2026-07-06 22:45:16 +08:00
mediabot-pt
110af4a79c feat: prevent duplicate rules by type+applicable key
- Uniqueness key: type + applicable condition combination

- '添加规则' button warns if KILL(null) already exists

- Dropdown and template dialog disabled+greyed for already-added presets

- Import skips duplicates with warning message

- Applicable dropdown change guarded against duplicates
2026-07-06 22:44:15 +08:00
mediabot-pt
accb38986a style: add color to action labels in rule summary text
\u4fdd\u53f7=green(#67c23a), \u5c01\u53f7/\u5220\u9664\u8d26\u53f7=red(#f56c6c), \u5c01\u53f7(\u7f13\u52117\u5929)=orange(#e6a23c)
2026-07-06 22:41:55 +08:00
mediabot-pt
7ec4e16eb6 feat: add fixed-order rule summary text at bottom of visual editor
Sort order: EXEMPT \u2192 TASK \u2192 HD \u2192 KILL \u2192 RATIO \u2192 DRATIO \u2192 TRAFFIC

Each rule shown as natural language sentence with applicable condition

TASK shows only enabled requirements

Regardless of card drag order, summary always displays in fixed sequence
2026-07-06 22:35:38 +08:00
mediabot-pt
15dcccb405 feat: add enable/disable switch for each TASK requirement
Each requirement has an el-switch; disabled items grey out and input is locked

Sites can pick only the conditions they need (e.g. upload+download only)
2026-07-06 22:31:52 +08:00
mediabot-pt
a956d38365 fix: rename ratio penalty label to \u5c01\u53f7\uff08\u7f13\u52117\u5929\uff09
More accurate than '\u964d\u7ea7\u81f3Peasant': user is demoted regardless of rank, then killed after 7 days

Template dialog: '\u7f13\u52117\u5929' instead of '\u964d\u7ea7'
2026-07-06 22:29:23 +08:00
mediabot-pt
86d1089114 fix: RATIO/DRATIO actions change to demote-to-Peasant first
- Low ratio \u2192 demote to Peasant \u2192 kill after 7 days, not immediate kill

- Orange arrow + '\u964d\u7ea7\u81f3Peasant' label instead of red '\u5c01\u53f7/\u5220\u9664\u8d26\u53f7'

- Card body shows full explanation: \u4f4e\u4e8e\u6b64\u5206\u4eab\u7387\u5219\u964d\u7ea7\u81f3Peasant\uff0c7\u5929\u540e\u5c01\u53f7/\u5220\u9664\u8d26\u53f7

- Template dialog also shows '\u964d\u7ea7' label for RATIO/DRATIO presets
2026-07-06 22:28:24 +08:00
mediabot-pt
03f6fd265f style: remove colored left border and hover shadow from rule cards
Simpler, cleaner look without the AI-style decorative borders
2026-07-06 22:24:22 +08:00
mediabot-pt
30edbf9d32 feat: convert rank inputs to dropdown with level numbers
- 10 standard PT ranks: Peasant(0) \u2192 Nexus Master(9)

- Dropdown shows \u201c3. Elite User\u201d format with level and name

- Card header and template dialog also show level numbers

- Default preset: Elite User for perm, Power User for seal
2026-07-06 22:23:10 +08:00
mediabot-pt
d8a23f1e40 feat: add EXEMPT type for rank-based immunity rules
- Opposite of kill rules: protects users instead of deleting them

- permRank: users at/above this rank permanently immune from all cleanups

- sealExemptRank: users at/above this rank won't be killed when sealed

- Green left border + green '\u4fdd\u53f7' label to visually distinguish from kill rules

- Template: Elite User for perm, Power User for seal exemption
2026-07-06 22:14:55 +08:00
mediabot-pt
d1570fb80b feat: add DRATIO type for dynamic ratio rules
- When download reaches threshold (GB), ratio must meet minRatio

- Card header: \u4e0b\u8f7d\u91cf \u2265 XGB \u65f6\u5206\u4eab\u7387 \u2265 Y \u2192 \u5c01\u53f7/\u5220\u9664\u8d26\u53f7

- Card body: download threshold input + required ratio input

- Preset: 100GB download, 1.0 ratio
2026-07-06 22:13:52 +08:00
mediabot-pt
b5a8dfa3b8 feat: add TASK type for new user assessment rules
- New TASK type with requirements array: upload_gb, download_gb, bonus, seeding_score, avg_seed_time

- Card header shows: \u8003\u6838\u5468\u671f N\u5929 \u2192 \u5c01\u53f7/\u5220\u9664\u8d26\u53f7

- Card body: editable period + 5 requirement rows (each with editable threshold)

- Type switch to TASK auto-initializes requirements from defaults

- Preset import auto-fills requirements for TASK rules

- Add seeding_score metric option
2026-07-06 22:13:04 +08:00
mediabot-pt
51bf25912b fix: add explicit '\u65e0\u6761\u4ef6' option to applicable dropdown
Easier to switch back than relying on clearable X button
2026-07-06 22:07:41 +08:00
mediabot-pt
66e1ec32c6 chore: hide description field in rule card body
Card header already shows full rule summary, description is redundant
2026-07-06 22:06:16 +08:00
mediabot-pt
5f57453af9 fix: remove redundant LOGIN type, rename KILL label to \u6d3b\u8dc3\u5ea6
- LOGIN type duplicated with KILL (both use days_since_last_login)

- KILL label: \u5c01\u53f7\u89c4\u5219 \u2192 \u6d3b\u8dc3\u5ea6 (action is always \u5c01\u53f7/\u5220\u9664\u8d26\u53f7, type now describes monitoring category)
2026-07-06 22:00:10 +08:00
mediabot-pt
3209ff16d6 chore: change \u5c01\u53f7 label to \u5c01\u53f7/\u5220\u9664\u8d26\u53f7 2026-07-06 21:58:13 +08:00
mediabot-pt
c9889a4aab refactor: simplify rule card UI - hide metric/condition/unit
- Replace editable name/metric/condition/unit with plain text in card header

- Card header shows: [type] [metric label] [condition label] [threshold][unit] \u2192 \u5c01\u53f7

- Type change auto-updates metric/condition/unit via typeDefaults mapping

- Card body only shows: threshold, applicable, description

- Fix edit title to show site name instead of raw siteType

- Remove unused styles and functions
2026-07-06 21:52:48 +08:00
mediabot-pt
842c01d79a refactor: remove action field, rules define kill conditions only
- WARN is auto-detected by RiskCheckEngine (riskPct > 80), not configured in rules

- Each rule simply defines: type + metric + condition + threshold + unit -> 封号

- Card always shows red left border and red '封号' arrow, no action selector

- Presets reduced to 7 kill-only templates, no WARN presets
2026-07-06 21:12:47 +08:00
mediabot-pt
040b97914e refactor: simplify risk rules to KILL/WARN actions only
- Replace complex type system (DEMOTE/TASK) with simple KILL/WARN action model

- Each rule now has: type (monitoring category) + action (KILL=封号 / WARN=告警)

- Type options: KILL/TRAFFIC/LOGIN/HD/RATIO (no DEMOTE/TASK)

- Card left border color by action: red=KILL, orange=WARN

- 12 preset templates with alert-based rules (60-day no-traffic warn, 140-day login warn, HnR warn, ratio warn)

- Remove requirements sub-table and downloadThreshold fields
2026-07-06 21:11:21 +08:00
mediabot-pt
9b5cee6439 feat: full PT site management rules system in risk rules editor
Type coverage: KILL/DEMOTE/TASK/TRAFFIC/LOGIN/HD/RATIO matching all 6 rule categories

Advanced fields: applicable conditions (!sealed/sealed/zero_traffic/new_account_30d), requirements for TASK type, downloadThreshold for DEMOTE type

12 preset templates covering: dynamic ratio, survival policy, zero-activity cleanup, novice exam, HnR penalty, traffic anomaly

Card fold/expand via double-click or arrow button, metric suggestions with filterable select, cleaner field layout
2026-07-06 21:06:20 +08:00
mediabot-pt
6a41938671 fix: restore left JSON editor + right card layout for risk rules editor
- Left pane: fixed 400px CodeEditor for JSON editing

- Right pane: card-based visual editor with natural language, drag-and-drop, presets

- Remove JSON toggle button, always show both panes
2026-07-06 17:51:46 +08:00
mediabot-pt
2cdf502831 feat: redesign risk rules editor with card-based visual UI
- Replace table-based editor with intuitive card layout showing rules as readable sentences

- Add drag-and-drop reordering for risk rules

- Add 8 preset rule templates with one-click import (traffic, ratio, kill, HnR, login)

- Collapse JSON editor by default, toggle via button for power users

- Show condition as natural language (GT=greater than, LT=less than, etc.)

- Color-coded left border by severity (red=CRITICAL, orange=WARN, blue=INFO)

- Add optional rule description field
2026-07-06 17:19:57 +08:00
mediabot-pt
773ad8fdb7 feat: page config upload button for normal sites, add cloud upload endpoint
- SitePagesController: add PUT /admin/site-pages/{siteId}/upload for uploading normal site pages to cloud storage

- SitePages.vue: show upload button for both default templates and normal sites
2026-07-06 15:13:09 +08:00
mediabot-pt
8724774850 feat: 页面配置入口地址添加验证按钮,解析失败自动提交错误日志
- 后端新增 POST /api/v1/admin/site-pages/verify 端点
  - 接收 siteId/url/pageKey,用对应 Groovy 脚本访问URL并解析
  - 解析失败(matched=false)时自动提交 error-log 到 PAR
  - 支持 HTTP_ERROR/EMPTY_RESPONSE/PARSE_FAILED/SCRIPT_ERROR 多种错误类型
- 前端 SitePages.vue 每条页面入口 URL 后添加验证按钮
  - 成功显示绿色 ✓,失败显示红色 ✗,并展示解析结果消息
  - 显示响应耗时
- api/index.js 新增 adapter.verifyPage 方法
2026-07-06 13:39:32 +08:00
mediabot-pt
02b7278c8c remove-authvalue-from-page-config 2026-07-06 12:15:40 +08:00
mediabot-pt
7042149a13 fix-page-config-reload-empty 2026-07-06 12:14:38 +08:00