From cedc38fbaa3adb84f3920552d985a834803cd056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= Date: Mon, 23 Jul 2018 20:01:01 +0200 Subject: [PATCH] [Web] Add search fields to some select forms [Web] Better container restart js, but still a wip [Web] Allow to set a DOCKER_TIMEOUT in vars.inc.php, default is 60 (seconds) --- data/web/css/mailcow.css | 3 ++ data/web/edit.php | 6 ++-- data/web/inc/footer.inc.php | 34 ++++++++++--------- data/web/inc/functions.docker.inc.php | 9 ++--- .../lib/sieve/extensions/vacation-seconds.xml | 32 +++++++++++++++++ data/web/inc/vars.inc.php | 3 ++ data/web/lang/lang.de.php | 3 +- data/web/lang/lang.en.php | 3 +- data/web/modals/footer.php | 1 - data/web/modals/mailbox.php | 12 +++---- 10 files changed, 74 insertions(+), 32 deletions(-) create mode 100644 data/web/inc/lib/sieve/extensions/vacation-seconds.xml diff --git a/data/web/css/mailcow.css b/data/web/css/mailcow.css index 1c6a856e..14d875fa 100644 --- a/data/web/css/mailcow.css +++ b/data/web/css/mailcow.css @@ -135,4 +135,7 @@ nav .glyphicon { } #top { padding-top: 70px; +} +.bootstrap-select.btn-group .no-results { + display: none; } \ No newline at end of file diff --git a/data/web/edit.php b/data/web/edit.php index 8eaae6af..9cd1994c 100644 --- a/data/web/edit.php +++ b/data/web/edit.php @@ -80,7 +80,7 @@ if (isset($_SESSION['mailcow_cc_role'])) {
- @@ -186,7 +186,7 @@ if (isset($_SESSION['mailcow_cc_role'])) {
- @@ -408,7 +408,7 @@ if (isset($_SESSION['mailcow_cc_role'])) {
- '); - $('#statusTriggerRestartContainer').text('Restarting container, this may take a while... '); - $('#statusTriggerRestartContainer2').text('Reloading webpage... '); + $('#statusTriggerRestartContainer').html(''); $.ajax({ method: 'get', url: '/inc/ajax/container_ctrl.php', - timeout: 10000, + timeout: , data: { - 'service': container, - 'action': 'restart' - }, - error: function() { - window.location = window.location.href.split("#")[0]; - }, - success: function(data) { - $('#statusTriggerRestartContainer').append(data); - $('#triggerRestartContainer').html(' '); - $('#statusTriggerRestartContainer2').append(data); - $('#triggerRestartContainer').html(' '); - window.location = window.location.href.split("#")[0]; + 'service': container, + 'action': 'restart' } - }); + }) + .always( function (data, status) { + $('#statusTriggerRestartContainer').append(data); + var htmlResponse = $.parseHTML(data) + if ($(htmlResponse).find('span').hasClass('text-success')) { + $('#triggerRestartContainer').html(' '); + setTimeout(function(){ + $('#RestartContainer').modal('toggle'); + window.location = window.location.href.split("#")[0]; + }, 1200); + } else { + $('#triggerRestartContainer').html(' '); + } + }) }); }) diff --git a/data/web/inc/functions.docker.inc.php b/data/web/inc/functions.docker.inc.php index a0705cff..183bbc58 100644 --- a/data/web/inc/functions.docker.inc.php +++ b/data/web/inc/functions.docker.inc.php @@ -1,5 +1,6 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/web/inc/vars.inc.php b/data/web/inc/vars.inc.php index 9f5e2993..fdd22f14 100644 --- a/data/web/inc/vars.inc.php +++ b/data/web/inc/vars.inc.php @@ -116,3 +116,6 @@ $OTP_LABEL = "mailcow UI"; // Default "to" address in relay test tool $RELAY_TO = "null@hosted.mailcow.de"; + +// How long to wait (in s) for cURL Docker requests +$DOCKER_TIMEOUT = 60; \ No newline at end of file diff --git a/data/web/lang/lang.de.php b/data/web/lang/lang.de.php index c918c378..3de887b1 100644 --- a/data/web/lang/lang.de.php +++ b/data/web/lang/lang.de.php @@ -8,7 +8,8 @@ $lang['header']['restart_sogo'] = 'SOGo neustarten'; $lang['header']['restart_netfilter'] = 'Netfilter neustarten'; $lang['footer']['restart_container'] = 'Container neustarten'; $lang['footer']['restart_now'] = 'Jetzt neustarten'; -$lang['footer']['restart_container_info'] = 'Wichtig: Ein korrekter Neustart eines Containers kann eine Weile in Anspruch nehmen, bitte warten Sie, bis der Prozess vollständig beendet wurde.'; +$lang['footer']['restarting_container'] = 'Container wird neugestartet, bitte warten...'; +$lang['footer']['restart_container_info'] = 'Wichtig: Der Neustart eines Containers kann eine Weile in Anspruch nehmen, bitte warten Sie, bis der Prozess vollständig beendet wurde.
Die Website wird neugeladen, wenn der Vorgang erfolgreich ist.'; $lang['footer']['confirm_delete'] = 'Löschen bestätigen'; $lang['footer']['delete_these_items'] = 'Sind Sie sicher, dass die Änderungen an Elementen mit folgender ID durchgeführt werden sollen?'; diff --git a/data/web/lang/lang.en.php b/data/web/lang/lang.en.php index aa8c2a97..2f9eda73 100644 --- a/data/web/lang/lang.en.php +++ b/data/web/lang/lang.en.php @@ -8,7 +8,8 @@ $lang['header']['restart_sogo'] = 'Restart SOGo'; $lang['header']['restart_netfilter'] = 'Restart netfilter'; $lang['footer']['restart_container'] = 'Restart container'; $lang['footer']['restart_now'] = 'Restart now'; -$lang['footer']['restart_container_info'] = 'Important: A graceful restart may take a while to complete, please wait for it to finish.'; +$lang['footer']['restarting_container'] = 'Restarting container, this may take a while...'; +$lang['footer']['restart_container_info'] = 'Important: A graceful restart may take a while to complete, please wait for it to finish.
This website will reload if the process succeeded.'; $lang['footer']['confirm_delete'] = 'Confirm deletion'; $lang['footer']['delete_these_items'] = 'Please confirm your changes to the following object id:'; diff --git a/data/web/modals/footer.php b/data/web/modals/footer.php index 05ae74b3..e861ab4e 100644 --- a/data/web/modals/footer.php +++ b/data/web/modals/footer.php @@ -196,7 +196,6 @@ if (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == 'admi

-
diff --git a/data/web/modals/mailbox.php b/data/web/modals/mailbox.php index 57ca822a..1e0a7aae 100644 --- a/data/web/modals/mailbox.php +++ b/data/web/modals/mailbox.php @@ -23,7 +23,7 @@ if (!isset($_SESSION['mailcow_cc_role'])) {
- ".htmlspecialchars($domain).""; @@ -172,7 +172,7 @@ if (!isset($_SESSION['mailcow_cc_role'])) {
- ".htmlspecialchars($domain).""; @@ -289,7 +289,7 @@ if (!isset($_SESSION['mailcow_cc_role'])) {
- ".htmlspecialchars($domain).""; @@ -329,7 +329,7 @@ if (!isset($_SESSION['mailcow_cc_role'])) {
-
-
-