Skip to content

Commit

Permalink
feat: 插件管理页面筛选插件状态时支持筛选未安装插件的主机 (closed TencentBlueKing#2415)
Browse files Browse the repository at this point in the history
  • Loading branch information
chalice-1831 committed Aug 27, 2024
1 parent 107d77d commit cdd5581
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions apps/node_man/handlers/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,23 @@ def list(params: Dict[str, Any]):
}
)

head_plugins = tools.PluginV2Tools.fetch_head_plugins()
host_uninstall_plugin = defaultdict(list)
for host_id, plugins in host_plugin.items():
installed_plugin_names = set(plugin["name"] for plugin in plugins)
host_uninstall_plugin[host_id] = list(set(head_plugins) - installed_plugin_names)

for host_id, uninstall_plugins in host_uninstall_plugin.items():
for plugin_name in uninstall_plugins:
host_plugin[host_id].append(
{
"name": plugin_name,
"status": const.ProcStateType.NOT_INSTALLED,
"version": "--",
"host_id": host_id,
}
)

ap_id_obj_map = AccessPoint.ap_id_obj_map()

# 汇总
Expand Down

0 comments on commit cdd5581

Please sign in to comment.