From 2cdf502831cba3900b88267e9e2266960a959d6c Mon Sep 17 00:00:00 2001 From: mediabot-pt <295750538+mediabot-pt@users.noreply.github.com> Date: Mon, 6 Jul 2026 17:19:57 +0800 Subject: [PATCH] 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 --- web/src/views/RiskRules.vue | 364 +++++++++++++++++++++++++++++++----- 1 file changed, 314 insertions(+), 50 deletions(-) diff --git a/web/src/views/RiskRules.vue b/web/src/views/RiskRules.vue index 0ef5e95..47df22d 100644 --- a/web/src/views/RiskRules.vue +++ b/web/src/views/RiskRules.vue @@ -26,71 +26,202 @@ - +
-
-

编辑: {{ editType }}

+ +
+
+

编辑: {{ editType }}

+ {{ parsed.length }} 条规则 +
+ + + {{ showJson ? '收起' : 'JSON' }} + + 模板 保存 上传 返回列表
+ +
-
+ +
+ +
+ + 添加规则 + + + 从模板添加 + + + — 该类型暂无规则,请添加或从模板导入 +
+ + +
+
+ +
+
+ + + + + + {{ x.label }} + + + + + + + + +
+
+ #{{ idx + 1 }} + +
+
+ + +
+
+ 触发条件 + 当 + + + + + + + → + {{ levelText(rule.level) }} +
+ +
+ +
+
+
+
+
+ + +
JSON 配置
-
-
双向可视化
- - - - - - - - - - - - - - - - - - - - - - - - - - -
该类型暂无规则
-
+ 添加
-
+ + + +
+ +
+ + {{ p.name }} + {{ presetDesc(p) }} + +
+
+
+ +
+ +