Commit Graph

72 Commits

Author SHA1 Message Date
mediabot-pt
8b004e5c45 feat: 风险规则缓刑天数可配置
- DRATIO/RATIO 编辑区域增加缓刑天数输入框
- 规则摘要和卡片头部的缓刑天数文案改为动态读取 graceDays 字段
- DRATIO 预设模板增加 graceDays: 7 默认值
- 不填时默认7天,向后兼容
2026-07-12 23:18:55 +08:00
mediabot-pt
b95c42e6e5 fix: 修复 RiskRules.vue ruleText 函数中 DRATIO 分支缺少 if 条件导致编译错误 2026-07-11 23:31:30 +08:00
mediabot-pt
6c40505b73 fix: TRAFFIC 规则两个条件共用同一个阈值天数 2026-07-10 15:57:52 +08:00
mediabot-pt
dee204c99b feat: TRAFFIC 规则增加连续未登录天数输入,预设默认90天 2026-07-10 15:56:23 +08:00
mediabot-pt
cebe8c67c2 refactor: 分享率 DRATIO 预设默认值改为下载量>0且分享率<1.0 2026-07-10 11:10:18 +08:00
mediabot-pt
b0be61669c fix: 新人考核标题'不满足'→'低于阈值',与下方'低于X'文案一致 2026-07-09 00:57:38 +08:00
mediabot-pt
88371180bb fix: 新人考核标题改为风险方向,'考核要求'→'以下任一不满足→封号' 2026-07-09 00:07:49 +08:00
mediabot-pt
a4607a568c fix: 新人考核默认条件 GTE→LT,与显示'低于'保持一致 2026-07-09 00:00:14 +08:00
mediabot-pt
de16176442 fix: 新人考核统一逻辑方向,改为'低于X'与其他规则一致
卡片显示:上传量 低于 10 GB → 封号
摘要显示:上传量 < 10GB 或 做种积分 < 2500 → 封号
2026-07-08 23:50:06 +08:00
mediabot-pt
c7f1b7b66d fix: 新人考核摘要加'不满足'消除歧义,与分享率逻辑统一 2026-07-08 23:48:03 +08:00
mediabot-pt
4313e87473 refactor: 动态分享率 → 分享率 2026-07-08 22:38:58 +08:00
mediabot-pt
7414a06152 fix: DRATIO 统一逻辑方向,改为 '分享率<X' 与其他规则保持一致
所有规则现在统一: 指标越过阈值 → 风险
- H&R≥5 → 封号
- 下载量≥100GB且分享率<0.3 → 封号
- 距上次登录>150天 → 封号
2026-07-08 22:29:52 +08:00
mediabot-pt
ce794d1b61 fix: DRATIO 动态分享率默认值合理化,UI 加'要求'二字消除歧义
预设默认值: 1.0/2.0/3.0 → 0.3/0.5/0.8
意图: 下载量越大,允许的分享率越低,不是越高
2026-07-08 22:28:03 +08:00
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
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
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