Commit Graph

49 Commits

Author SHA1 Message Date
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
5345b506e2 feat: 风险规则增加上传按钮+对应后端接口(七牛云) 2026-07-06 00:36:46 +08:00
mediabot-pt
b286f733dc feat: 页面配置+风险规则右侧改为可编辑表格双向同步JSON编辑器 2026-07-05 22:50:23 +08:00
mediabot-pt
4d928ead51 refactor: 统一四页面交互模式(列表全宽→编辑双栏) 2026-07-05 21:15:46 +08:00
mediabot-pt
91bd6e6aeb fix: 页面配置+风险规则恢复站点列表首页+点击进入编辑模式 2026-07-05 21:08:32 +08:00
mediabot-pt
2ce81957e2 fix: 表格行高增加去掉small尺寸 2026-07-05 20:19:15 +08:00
mediabot-pt
5381e2104d refactor: 页面配置+风险规则改为左编辑器右可视化的脚本管理同款布局 2026-07-05 20:08:06 +08:00
mediabot-pt
7ee928aa42 refactor: 风险规则服务端默认模板+版本历史+UI 2026-07-05 19:57:04 +08:00
mediabot-pt
41d730c249 refactor: 页面配置+风险规则改用纯CodeEditor(去掉表格模式) 2026-07-05 18:56:42 +08:00
mediabot-pt
9cf6274656 refactor: 查看默认模板改用CodeEditor替代pre/alert 2026-07-05 18:54:56 +08:00
mediabot-pt
79dfd60348 feat: 风险规则默认模板增加编辑按钮 2026-07-05 12:38:53 +08:00
mediabot-pt
a2b906ffaa feat: 页面配置+风险规则增加站点类型默认模板+读取默认按钮 2026-07-05 01:03:03 +08:00
mediabot-pt
f8c55349f4 fix: 风险规则改为按站点展示,每站点一行 2026-07-05 00:59:17 +08:00
mediabot-pt
161905cf49 fix: 风险规则默认4种类型+合并DB数据 2026-07-05 00:54:20 +08:00
mediabot-pt
0e0ac23a14 fix: 去掉expand列改用表格下方独立编辑区域 2026-07-05 00:48:56 +08:00
mediabot-pt
340a375dcf fix: 内联编辑替代弹窗+风险规则动态站点类型+页面配置修复加载 2026-07-05 00:42:26 +08:00
mediabot-pt
2999e848f8 fix: RiskRules+SitePages数组迭代空值保护 2026-07-05 00:34:33 +08:00
mediabot-pt
5ad6b043e4 feat: 页面配置+风险规则编辑器支持表格/JSON双模式切换 2026-07-05 00:22:28 +08:00
mediabot-pt
e8a7c38eab fix: 页面配置合并站点列表+风险规则默认全类型+修复api.raw调用 2026-07-05 00:16:16 +08:00
mediabot-pt
73c01b3573 refactor: 拆分两个独立菜单(页面配置+风险规则)+CRUD完整+删除接口 2026-07-05 00:08:56 +08:00