From 6236d00ea2324a8c4e05a57181d0d2318f33584e Mon Sep 17 00:00:00 2001 From: Saish Pawar Date: Thu, 13 Mar 2025 01:28:11 +0530 Subject: [PATCH] fix: made protocol dynamic in the publishURL displayed on 'Publish As Website' dialogbox (#1170) * change https to http on UIWindowPublishWebsite * fix: made protocol string dynamic in the publish as website dialogbox --- src/gui/src/UI/UIWindowPublishWebsite.js | 5 +++-- src/gui/src/helpers.js | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gui/src/UI/UIWindowPublishWebsite.js b/src/gui/src/UI/UIWindowPublishWebsite.js index 38bf2b5de..3e0ca3a81 100644 --- a/src/gui/src/UI/UIWindowPublishWebsite.js +++ b/src/gui/src/UI/UIWindowPublishWebsite.js @@ -36,8 +36,9 @@ async function UIWindowPublishWebsite(target_dir_uid, target_dir_name, target_di h += `
`; // subdomain h += `
`; - h += ``; - h += `
https://.${html_encode(window.hosting_domain)}
`; + h += ``; + + h += `
${html_encode(window.extractProtocol(window.url))}://.${html_encode(window.hosting_domain)}
`; h += `
`; // uid h += ``; diff --git a/src/gui/src/helpers.js b/src/gui/src/helpers.js index 6ffd149a4..86aab6f0c 100644 --- a/src/gui/src/helpers.js +++ b/src/gui/src/helpers.js @@ -2224,6 +2224,10 @@ window.extractSubdomain = function(url) { return subdomain; } +window.extractProtocol = function (url) { + var protocol = url.split('://')[0]; + return protocol; +} window.sleep = function(ms){ return new Promise(resolve => setTimeout(resolve, ms)); }