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: