From 75fdeb2843f9ce470a1f899cecc7b2f0c51ea504 Mon Sep 17 00:00:00 2001 From: DerLinkman Date: Tue, 18 Oct 2022 14:19:51 +0200 Subject: [PATCH] Fixed queue message error --- data/Dockerfiles/dockerapi/dockerapi.py | 2 +- data/web/js/site/queue.js | 14 +++++++++----- data/web/queue.php | 1 + data/web/templates/modals/admin.twig | 14 -------------- data/web/templates/modals/queue.twig | 14 ++++++++++++++ data/web/templates/queue.twig | 5 ++++- 6 files changed, 29 insertions(+), 21 deletions(-) create mode 100644 data/web/templates/modals/queue.twig diff --git a/data/Dockerfiles/dockerapi/dockerapi.py b/data/Dockerfiles/dockerapi/dockerapi.py index 965fc906..03ed5ef0 100644 --- a/data/Dockerfiles/dockerapi/dockerapi.py +++ b/data/Dockerfiles/dockerapi/dockerapi.py @@ -248,7 +248,7 @@ class DockerUtils: for container in (await self.docker_client.containers.list()): if container._id == container_id: postcat_exec = await container.exec(["/bin/bash", "-c", "/usr/sbin/postcat -q " + sanitized_string], user='postfix') - return exec_run_handler('utf8_text_only', postcat_exec) + return await exec_run_handler('utf8_text_only', postcat_exec) # api call: container_post - post_action: exec - cmd: mailq - task: unhold async def container_post__exec__mailq__unhold(self, container_id, request_json): diff --git a/data/web/js/site/queue.js b/data/web/js/site/queue.js index 88e48d97..057ad840 100644 --- a/data/web/js/site/queue.js +++ b/data/web/js/site/queue.js @@ -6,6 +6,9 @@ jQuery(function($){ $('#' + table_name).DataTable().ajax.reload(); }); + + function humanFileSize(i){if(Math.abs(i)<1024)return i+" B";var B=["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],e=-1;do{i/=1024,++e}while(Math.abs(i)>=1024&&e json_encode($_SESSION['acl']), 'role' => $role, 'lang_admin' => json_encode($lang['admin']), + 'lang_queue' => json_encode($lang['queue']), 'lang_datatables' => json_encode($lang['datatables']) ]; diff --git a/data/web/templates/modals/admin.twig b/data/web/templates/modals/admin.twig index a67e4848..15971e59 100644 --- a/data/web/templates/modals/admin.twig +++ b/data/web/templates/modals/admin.twig @@ -233,20 +233,6 @@ - - +{% include 'modals/queue.twig' %} +