perf(command): 优化命令冲突计数逻辑
This commit is contained in:
@@ -27,11 +27,10 @@ class CommandRoute(Route):
|
||||
|
||||
async def get_commands(self):
|
||||
commands = await list_commands()
|
||||
conflicts = await list_command_conflicts()
|
||||
summary = {
|
||||
"total": len(commands),
|
||||
"disabled": len([cmd for cmd in commands if not cmd["enabled"]]),
|
||||
"conflicts": len(conflicts),
|
||||
"conflicts": len([cmd for cmd in commands if cmd.get("has_conflict")]),
|
||||
}
|
||||
return Response().ok({"items": commands, "summary": summary}).__dict__
|
||||
|
||||
|
||||
Reference in New Issue
Block a user