From 8d2fa2dcf639b12491ab2fe7b201df9fa0b523ed Mon Sep 17 00:00:00 2001 From: heavygale Date: Sun, 27 Jan 2019 12:26:40 +0100 Subject: [PATCH] Fallback to "host" if "ui" isn't set Fallback for not yet updated mailcows: Use the hostname as the mailcow-ui-domain as before. --- docs/clients.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/clients.js b/docs/clients.js index 78e4c331c..c507e990f 100644 --- a/docs/clients.js +++ b/docs/clients.js @@ -74,12 +74,15 @@ if (window.location.href.indexOf('/client') >= 0) { el.innerText = getCookie('host'); }); Array.prototype.forEach.call(document.getElementsByClassName('client_var_link'), function(el) { - if (!getCookie('ui')) { + if (!getCookie('ui') && !getCookie('host')) { el.href = '#'; - } else if (getCookie('port') != '443') { - el.href = 'https://' + getCookie('ui') + ':' + getCookie('port') + '/' + el.getAttribute("href"); } else { - el.href = 'https://' + getCookie('ui') + '/' + el.getAttribute("href"); + var ui_domain = getCookie('ui') ? getCookie('ui') : getCookie('host'); + if (getCookie('port') != '443') { + el.href = 'https://' + ui_domain + ':' + getCookie('port') + '/' + el.getAttribute("href"); + } else { + el.href = 'https://' + ui_domain + '/' + el.getAttribute("href"); + } } }); Array.prototype.forEach.call(document.getElementsByClassName('client_var_email'), function(el) {