From f72b05f2d230d102e8bbdba9c583ebc64a8342b3 Mon Sep 17 00:00:00 2001 From: yunyingk Date: Mon, 6 Apr 2026 00:56:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E8=A7=84=E5=88=99?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E5=8A=A0=E5=88=86=E9=9A=94=E7=BA=BF=E3=80=81?= =?UTF-8?q?ID=E7=A7=BB=E8=87=B3=E6=9C=AB=E5=88=97=E3=80=81=E9=95=BF?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E6=88=AA=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ekb_cli/commands/agent/detail.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/ekb_cli/commands/agent/detail.py b/src/ekb_cli/commands/agent/detail.py index 6aca121..00014e5 100644 --- a/src/ekb_cli/commands/agent/detail.py +++ b/src/ekb_cli/commands/agent/detail.py @@ -52,24 +52,26 @@ def cmd_detail(agent_id: str = typer.Argument(..., help="Agent ID")): # 关联规则列表 rules = d.get("agentRule", []) if rules: - table = Table(title="关联规则", show_lines=False) - table.add_column("规则描述") + table = Table(title="关联规则", show_lines=True) + table.add_column("规则描述", max_width=24, no_wrap=True) table.add_column("规则编码", style="dim", no_wrap=True) - table.add_column("ID", style="dim", no_wrap=True) - table.add_column("适用场景") + table.add_column("适用场景", max_width=16, no_wrap=True) table.add_column("风险等级", no_wrap=True) table.add_column("更新日期", style="dim", no_wrap=True) + table.add_column("ID", style="dim", no_wrap=True) for r in rules: level = r.get("level", "") level_str = f"[red]{level}[/red]" if level == "严重" else f"[yellow]{level}[/yellow]" update_date = (r.get("updateTime", "") or "")[:10] + desc = r.get("description", "") + purpose = r.get("purpose", "") table.add_row( - r.get("description", ""), + desc, r.get("code", ""), - r.get("id", ""), - r.get("purpose", ""), + purpose, level_str, update_date, + r.get("id", ""), ) console.print(table) else: