From 3b8e17c21ff9080f097b1c331bb572e803d7a645 Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Mon, 26 Sep 2022 11:23:04 +0200 Subject: [PATCH 1/5] fix layout issues --- data/web/css/build/013-mailcow.css | 29 +++++++++++ data/web/css/themes/mailcow-darkmode.css | 47 ++++++++++-------- data/web/js/build/014-mailcow.js | 2 +- data/web/js/site/mailbox.js | 55 +-------------------- data/web/templates/admin/tab-sys-mails.twig | 4 +- data/web/templates/base.twig | 2 +- data/web/templates/index.twig | 10 ++-- 7 files changed, 66 insertions(+), 83 deletions(-) diff --git a/data/web/css/build/013-mailcow.css b/data/web/css/build/013-mailcow.css index 685eb80d..9be8b024 100644 --- a/data/web/css/build/013-mailcow.css +++ b/data/web/css/build/013-mailcow.css @@ -394,3 +394,32 @@ button[aria-expanded='true'] > .caret { .list-group-header { background: #f7f7f7; } + + +.bg-primary, .alert-primary, .btn-primary { + background-color: #0F688D !important; + border-color: #0d526d !important; +} +.bg-info, .alert-info, .btn-info { + background-color: #148DBC !important; + border-color: #127ea8 !important; +} + +.bootstrap-select>.dropdown-toggle.bs-placeholder.btn-secondary { + color: rgb(137 137 137)!important; +} + +.progress { + background-color: #d5d5d5; +} + + +.btn-outline-secondary:hover { + background-color: #f0f0f0; +} +.btn.btn-outline-secondary { + border-color: #cfcfcf !important; +} +.btn-check:checked+.btn-outline-secondary, .btn-check:active+.btn-outline-secondary, .btn-outline-secondary:active, .btn-outline-secondary.active, .btn-outline-secondary.dropdown-toggle.show { + background-color: #f0f0f0 !important; +} diff --git a/data/web/css/themes/mailcow-darkmode.css b/data/web/css/themes/mailcow-darkmode.css index 7a84ddaa..03f99307 100644 --- a/data/web/css/themes/mailcow-darkmode.css +++ b/data/web/css/themes/mailcow-darkmode.css @@ -84,9 +84,13 @@ legend { .dropdown-menu>li>a:focus, .dropdown-menu>li>a:hover { color: #fafafa; } + .bootstrap-select>.dropdown-toggle.bs-placeholder, .bootstrap-select>.dropdown-toggle.bs-placeholder:active, .bootstrap-select>.dropdown-toggle.bs-placeholder:focus, .bootstrap-select>.dropdown-toggle.bs-placeholder:hover { color: #fff; } +.bootstrap-select>.dropdown-toggle.bs-placeholder, .bootstrap-select>.dropdown-toggle.bs-placeholder.btn-secondary { + color: #d4d4d4 !important; +} tbody tr { color: #555; } @@ -150,12 +154,6 @@ input.form-control:disabled, textarea.form-disabled { background-color: #242424; } -.tag-add { - color: #ccc; -} -.tag-add:hover { - color: #d1d1d1; -} .list-group-item { @@ -198,6 +196,17 @@ input.form-control:disabled, textarea.form-disabled { border-color: #d8d8d8; } +.table-light { + --bs-table-bg: #f6f6f6; + --bs-table-striped-bg: #eaeaea; + --bs-table-striped-color: #000; + --bs-table-active-bg: #dddddd; + --bs-table-active-color: #000; + --bs-table-hover-bg: #e4e4e4; + --bs-table-hover-color: #000; + color: #000; + border-color: #dddddd; +} .form-control-plaintext { color: #e0e0e0; @@ -239,17 +248,6 @@ a:hover { } -.table-light { - --bs-table-bg: #f6f6f6; - --bs-table-striped-bg: #eaeaea; - --bs-table-striped-color: #000; - --bs-table-active-bg: #dddddd; - --bs-table-active-color: #000; - --bs-table-hover-bg: #e4e4e4; - --bs-table-hover-color: #000; - color: #000; - border-color: #dddddd; -} .accordion-item { @@ -290,7 +288,12 @@ a:hover { color: #fff; background-color: #555; } - +.tag-add { + color: #ccc; +} +.tag-add:hover { + color: #d1d1d1; +} table.dataTable.dtr-inline.collapsed>tbody>tr>td.dtr-control:before:hover, @@ -316,12 +319,15 @@ table.dataTable.dtr-inline.collapsed>tbody>tr>td.dataTables_empty { .btn-check-label { color: #fff; } +.btn-outline-secondary:hover { + background-color: #c3c3c3; +} .btn.btn-outline-secondary { color: #fff !important; border-color: #7a7a7a !important; } .btn-check:checked+.btn-outline-secondary, .btn-check:active+.btn-outline-secondary, .btn-outline-secondary:active, .btn-outline-secondary.active, .btn-outline-secondary.dropdown-toggle.show { - background-color: #7a7a7a !important; + background-color: #9b9b9b !important; } @@ -347,4 +353,5 @@ table.dataTable.dtr-inline.collapsed>tbody>tr>td.dataTables_empty { } .list-group-header { background: #333; -} \ No newline at end of file +} + diff --git a/data/web/js/build/014-mailcow.js b/data/web/js/build/014-mailcow.js index 27bc54ce..a2e25547 100644 --- a/data/web/js/build/014-mailcow.js +++ b/data/web/js/build/014-mailcow.js @@ -247,7 +247,7 @@ $(document).ready(function() { $('#containerName').text(container); $('#triggerRestartContainer').click(function(){ $(this).prop("disabled",true); - $(this).html('
Loading...
'); + $(this).html('
Loading...
'); $('#statusTriggerRestartContainer').html(lang_footer.restarting_container); $.ajax({ method: 'get', diff --git a/data/web/js/site/mailbox.js b/data/web/js/site/mailbox.js index ee2b4a16..8f541ffa 100644 --- a/data/web/js/site/mailbox.js +++ b/data/web/js/site/mailbox.js @@ -1,58 +1,5 @@ $(document).ready(function() { acl_data = JSON.parse(acl); - // FooTable.domainFilter = FooTable.Filtering.extend({ - // construct: function(instance){ - // this._super(instance); - // this.def = lang.all_domains; - // this.$domain = null; - // }, - // $create: function(){ - // this._super(); - // var self = this; - // var domains = []; - - // $.each(self.ft.rows.all, function(i, row){ - // if((row.val().domain != null) && ($.inArray(row.val().domain, domains) === -1)) domains.push(row.val().domain); - // }); - - // $form_grp = $('
', {'class': 'form-group'}) - // .append($('
- + {% if ui_texts.ui_announcement_text and ui_texts.ui_announcement_active and not is_root_uri %} -
+
{{ ui_texts.ui_announcement_text }}
{% endif %} diff --git a/data/web/templates/index.twig b/data/web/templates/index.twig index 827aba86..656b2e71 100644 --- a/data/web/templates/index.twig +++ b/data/web/templates/index.twig @@ -69,18 +69,18 @@
{% if not oauth2_request and (mailcow_apps or app_links) %} {{ ui_texts.apps_name|raw }}
-
+
{% for app in mailcow_apps %} {% if not skip_sogo or not is_uri('SOGo', app.link) %} -
- {{ app.name }} + {% endif %} {% endfor %} {% for row in app_links %} {% for key, val in row %} -
- {{ key }} + {% endfor %} {% endfor %} From 4387e4764f10da6b3f38b71abe2759c974df789b Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Mon, 26 Sep 2022 12:19:51 +0200 Subject: [PATCH 2/5] display public ips on debug page --- data/web/debug.php | 18 +++++++++++++++++- data/web/templates/debug.twig | 7 +++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/data/web/debug.php b/data/web/debug.php index e263e181..e9b426c4 100644 --- a/data/web/debug.php +++ b/data/web/debug.php @@ -44,9 +44,24 @@ foreach ($containers as $container => $container_info) { $containers[$container]['State']['StartedAtHR'] = $started; } -// get mailconf data +// get mailcow data $hostname = getenv('MAILCOW_HOSTNAME'); $timezone = getenv('TZ'); +// get public ips +$curl = curl_init(); +curl_setopt($curl, CURLOPT_URL, 'http://ipv4.mailcow.email'); +curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); +curl_setopt($curl, CURLOPT_POST, 0); +$ipv4 = curl_exec($curl); +curl_setopt($curl, CURLOPT_URL, 'http://ipv6.mailcow.email'); +curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); +curl_setopt($curl, CURLOPT_POST, 0); +$ipv6 = curl_exec($curl); +$ips = array( + "ipv4" => $ipv4, + "ipv6" => $ipv6 +); +curl_close($curl); $template = 'debug.twig'; $template_data = [ @@ -54,6 +69,7 @@ $template_data = [ 'vmail_df' => $vmail_df, 'hostname' => $hostname, 'timezone' => $timezone, + 'ips' => $ips, 'solr_status' => $solr_status, 'solr_uptime' => round($solr_status['status']['dovecot-fts']['uptime'] / 1000 / 60 / 60), 'clamd_status' => $clamd_status, diff --git a/data/web/templates/debug.twig b/data/web/templates/debug.twig index 3465da6e..64a3376e 100644 --- a/data/web/templates/debug.twig +++ b/data/web/templates/debug.twig @@ -49,6 +49,13 @@

{{ hostname }}

+ + IPs + + {{ ips.ipv4 }} + {{ ips.ipv6 }} + + Version
From 8a0bd239853e4cd6b0977db229f437e2f60d17e6 Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Tue, 27 Sep 2022 12:30:10 +0200 Subject: [PATCH 3/5] fix some layout issues --- data/web/css/build/013-mailcow.css | 2 +- data/web/css/themes/mailcow-darkmode.css | 3 +++ data/web/templates/index.twig | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/data/web/css/build/013-mailcow.css b/data/web/css/build/013-mailcow.css index 9be8b024..9580492d 100644 --- a/data/web/css/build/013-mailcow.css +++ b/data/web/css/build/013-mailcow.css @@ -289,7 +289,7 @@ code { width: 20%; } table.dataTable>tbody>tr.child ul.dtr-details>li { - border-bottom: 1px solid rgba(239, 239, 239, 0.129); + border-bottom: 1px solid rgba(0, 0, 0, 0.129); padding: 0.5em 0; } diff --git a/data/web/css/themes/mailcow-darkmode.css b/data/web/css/themes/mailcow-darkmode.css index 03f99307..e1824420 100644 --- a/data/web/css/themes/mailcow-darkmode.css +++ b/data/web/css/themes/mailcow-darkmode.css @@ -107,6 +107,9 @@ tbody tr { .table-striped>tbody>tr:nth-of-type(odd) { background-color: #333; } +table.dataTable>tbody>tr.child ul.dtr-details>li { + border-bottom: 1px solid rgba(255, 255, 255, 0.13); +} tbody tr { color: #ccc; } diff --git a/data/web/templates/index.twig b/data/web/templates/index.twig index 656b2e71..f9b89831 100644 --- a/data/web/templates/index.twig +++ b/data/web/templates/index.twig @@ -6,8 +6,8 @@
-
- {{ lang.login.login }} +
+ {{ lang.login.login }}
From 3d82d9af1bd2d15a16c6a923a1cc9eb6cccd9400 Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Tue, 27 Sep 2022 12:31:02 +0200 Subject: [PATCH 4/5] add loading animation for container charts --- data/web/js/site/debug.js | 14 ++++++++++++-- data/web/templates/debug.twig | 28 ++++++++++++++++++++-------- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/data/web/js/site/debug.js b/data/web/js/site/debug.js index 1e633673..deb0215e 100644 --- a/data/web/js/site/debug.js +++ b/data/web/js/site/debug.js @@ -1129,8 +1129,16 @@ function update_container_stats(timeout=5){ console.log(container); console.log(data); prev_stats = null; - if (data.length >= 2) - prev_stats = data[data.length -2] + if (data.length >= 2){ + prev_stats = data[data.length -2]; + + // hide spinners if we collected enough data + $('#' + container + "_DiskIOChart").removeClass('d-none'); + $('#' + container + "_DiskIOChart").prev().addClass('d-none'); + $('#' + container + "_NetIOChart").removeClass('d-none'); + $('#' + container + "_NetIOChart").prev().addClass('d-none'); + } + data = data[data.length -1]; if (prev_stats != null){ @@ -1387,6 +1395,8 @@ function createHostCpuAndMemChart(){ } // check for mailcow updates function check_update(current_version, github_repo_url){ + if (!current_version || !github_repo_url) return false; + var github_account = github_repo_url.split("/")[3]; var github_repo_name = github_repo_url.split("/")[4]; diff --git a/data/web/templates/debug.twig b/data/web/templates/debug.twig index 64a3376e..fd917ccf 100644 --- a/data/web/templates/debug.twig +++ b/data/web/templates/debug.twig @@ -210,13 +210,19 @@ {{ lang.debug.solr_dead }} {% endif %}
-
+
Disk I/O
- +
+ Loading... +
+
-
+
Net I/O
- +
+ Loading... +
+
-
+
Disk I/O
- +
+ Loading... +
+
-
+
Net I/O
- +
+ Loading... +
+
Date: Tue, 27 Sep 2022 12:32:14 +0200 Subject: [PATCH 5/5] add sieve access toggle to mass-actions-mailbox --- data/web/js/site/mailbox.js | 18 +++++++++++------- data/web/templates/mailbox/tab-mailboxes.twig | 6 ++++++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/data/web/js/site/mailbox.js b/data/web/js/site/mailbox.js index 8f541ffa..c74494aa 100644 --- a/data/web/js/site/mailbox.js +++ b/data/web/js/site/mailbox.js @@ -358,6 +358,7 @@ jQuery(function($){ item.pop3_access = ''; item.imap_access = ''; item.smtp_access = ''; + item.sieve_access = ''; if (item.attributes.quarantine_notification === 'never') { item.quarantine_notification = lang.never; } else if (item.attributes.quarantine_notification === 'hourly') { @@ -375,15 +376,13 @@ jQuery(function($){ item.quarantine_category = lang.q_all; } if (acl_data.login_as === 1) { - var btnSize = 'btn-xs-third'; - if (ALLOW_ADMIN_EMAIL_LOGIN) btnSize = 'btn-xs-quart'; - item.action = '
' + - ' ' + lang.edit + '' + - ' ' + lang.remove + '' + - ''; + item.action = '
' + + ' ' + lang.edit + '' + + ' ' + lang.remove + '' + + ''; if (ALLOW_ADMIN_EMAIL_LOGIN) { - item.action += ''; + item.action += ''; } item.action += '
'; } @@ -504,6 +503,11 @@ jQuery(function($){ data: 'pop3_access', defaultContent: '' }, + { + title: 'SIEVE', + data: 'sieve_access', + defaultContent: '' + }, { title: lang.quarantine_notification, data: 'quarantine_notification', diff --git a/data/web/templates/mailbox/tab-mailboxes.twig b/data/web/templates/mailbox/tab-mailboxes.twig index 6ce65beb..7f5e21a3 100644 --- a/data/web/templates/mailbox/tab-mailboxes.twig +++ b/data/web/templates/mailbox/tab-mailboxes.twig @@ -54,6 +54,9 @@
  • {{ lang.mailbox.activate }}
  • {{ lang.mailbox.deactivate }}
  • + +
  • {{ lang.mailbox.activate }}
  • +
  • {{ lang.mailbox.deactivate }}
  • {{ lang.mailbox.add_mailbox }}
    @@ -95,6 +98,9 @@
  • {{ lang.mailbox.activate }}
  • {{ lang.mailbox.deactivate }}
  • + +
  • {{ lang.mailbox.activate }}
  • +
  • {{ lang.mailbox.deactivate }}