From 2b9f1935431af638fbcdc5cb0ac9a3a8b4facac1 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 22 May 2024 22:48:11 -0400 Subject: [PATCH] see Changelog - just a few small page redirect bugs in static/gui --- CHANGELOG.md | 1 + static/gui/app-store/apps/002-001/fetch.html | 45 ++++++------ static/gui/app-store/apps/002-002/fetch.html | 77 +++++++------------- static/gui/app-store/apps/004-001/fetch.html | 45 ++++++------ static/gui/dashboard/001-a.html | 19 +++-- static/gui/dashboard/002.html | 17 +++++ 6 files changed, 105 insertions(+), 99 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 542f82928..97f5883f8 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ## [0.0.1-rtw.15] - Q2/2024 +May 22 - few bug fixes on redirects. see commit history from today for a list of files that i've modified May 22 - Forced the Add App icon to be present on the demo, or it may confuse website visitors new to the whole project May-22 - Adding the new client-side cache method to the GUI which doubles up as the homeserver GUI and online interactive demo May-21 - Modified the gui a bit with the new client-side cache method of showing/hiding apps - our alternative to install/uninstall diff --git a/static/gui/app-store/apps/002-001/fetch.html b/static/gui/app-store/apps/002-001/fetch.html index f3b75fb12..b3be0b37c 100755 --- a/static/gui/app-store/apps/002-001/fetch.html +++ b/static/gui/app-store/apps/002-001/fetch.html @@ -1,27 +1,28 @@ - - - - - + + + + + Redirect Page + + + // Check if the hostname contains "datro" + if (hostname.indexOf("datro") !== -1) { + // Redirect to the demo URL + window.location.replace("https:///demo.jellyfin.org/stable/web/index.html"); + } else { + // Construct the URL for the local server with port 8096 + var redirectUrl = "http://" + hostname + ":8096"; - - - - + // Redirect to the local server URL + window.location.replace(redirectUrl); + } + }; + - + + - diff --git a/static/gui/app-store/apps/002-002/fetch.html b/static/gui/app-store/apps/002-002/fetch.html index c1625b95d..439b46628 100755 --- a/static/gui/app-store/apps/002-002/fetch.html +++ b/static/gui/app-store/apps/002-002/fetch.html @@ -1,55 +1,30 @@ -<<<<<<< HEAD - - - - - - - - - - - - - - - - -======= - - - - - + + + + + + + + - - - - - + // Add a timeout to handle cases where the port doesn't load within a reasonable timeframe + setTimeout(function() { + // Redirect back to the previous page with an error message + window.history.back(); + // You can also display an alert or some other message to inform the user about the issue + alert("Failed to load the local server. Please try again later."); + }, 10000); // Adjust the timeout duration (in milliseconds) as needed + }); + - ->>>>>>> 741d0a0ca1ee372699f08f24b26ce103144db70c + \ No newline at end of file diff --git a/static/gui/app-store/apps/004-001/fetch.html b/static/gui/app-store/apps/004-001/fetch.html index d6d94a058..7133985cd 100755 --- a/static/gui/app-store/apps/004-001/fetch.html +++ b/static/gui/app-store/apps/004-001/fetch.html @@ -1,26 +1,29 @@ - - - - - + + + + + Redirect Page + + + // Check if the hostname contains "datro" + if (hostname.indexOf("datro") !== -1) { + // Redirect to the demo URL + window.location.replace("https://demo.openhab.org/#!/page/floorplan_tabs"); + } else { + // Construct the URL for the local server with port 8080 + var redirectUrl = "http://" + hostname + ":8080"; - - - - + // Redirect to the local server URL + window.location.replace(redirectUrl); + } + }; + - + + + diff --git a/static/gui/dashboard/001-a.html b/static/gui/dashboard/001-a.html index 5ea82e763..b7a466ca4 100755 --- a/static/gui/dashboard/001-a.html +++ b/static/gui/dashboard/001-a.html @@ -6,10 +6,19 @@ + function redirectUser() { + var hostname = window.location.hostname; + + // Check if the hostname contains "hbnb.local" + if (hostname.indexOf("hbnb.local") !== -1) { + // Local hosting, force HTTP + window.location.replace("http://datro.xyz/"); + } else { + // Online hosting, use protocol-relative URL + window.location.replace("//datro.xyz/"); + } + } + Search Apps @@ -108,7 +117,7 @@ .role-buttons {margin:5px!important;color:white!important;} .rounded-circle {margin-top:0!important; margin-bottom:15px;} .btn:hover {background:#333366!important;} - .rolestore-buttons {float:left; postion:absolute; margin-top:0!important;text-align:center!important; width:100%!important; padding-top:0px; margin-bottom:1rem;} + .rolestore-buttons {float:left; position:absolute; margin-top:0!important;text-align:center!important; width:100%!important; padding-top:0px; margin-bottom:1rem;} .btn-success {max-width:205px!Important;min-width:268px!Important;} .btn-lg {padding-left:20px!Important; justify-content: center!Important; display:inline-flex!important;} diff --git a/static/gui/dashboard/002.html b/static/gui/dashboard/002.html index 53315a8ad..aeb97abe0 100644 --- a/static/gui/dashboard/002.html +++ b/static/gui/dashboard/002.html @@ -2,6 +2,9 @@ Hβnβ Entertainment Screen + + + @@ -17,6 +20,20 @@ +