From 74bf21e2be2d896d2171d24dda1ae85827169af0 Mon Sep 17 00:00:00 2001 From: thsrite Date: Sat, 13 Apr 2024 22:23:38 +0800 Subject: [PATCH] feat update|unpause --- plugins/dockermanager/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/dockermanager/__init__.py b/plugins/dockermanager/__init__.py index 21c3327..0430f58 100644 --- a/plugins/dockermanager/__init__.py +++ b/plugins/dockermanager/__init__.py @@ -127,6 +127,10 @@ class DockerManager(_PluginBase): state = self._docker_client.containers.get(container_id).stop() elif str(command) == "pause": state = self._docker_client.containers.get(container_id).pause() + elif str(command) == "unpause": + state = self._docker_client.containers.get(container_id).unpause() + elif str(command) == "update": + state = self._docker_client.containers.get(container_id).update() else: logger.error(f"不支持的命令:{command}") break @@ -302,7 +306,7 @@ class DockerManager(_PluginBase): 'model': 'time_confs', 'label': '执行命令', 'rows': 2, - 'placeholder': '容器名#cron表达式#restart/start/stop' + 'placeholder': '容器名#cron表达式#restart/start/stop/unpause/update' } } ] @@ -323,7 +327,7 @@ class DockerManager(_PluginBase): 'props': { 'type': 'info', 'variant': 'tonal', - 'text': '容器名#cron表达式#restart/start/stop' + 'text': '容器名#cron表达式#restart/start/stop/pause/unpause/update' } } ]