Skip to content

Commit

Permalink
see Changelog - just a few small page redirect bugs in static/gui
Browse files Browse the repository at this point in the history
  • Loading branch information
unclehowell committed May 23, 2024
1 parent c383bc2 commit 2b9f193
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 99 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
45 changes: 23 additions & 22 deletions static/gui/app-store/apps/002-001/fetch.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
<!Doctype html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<title>Redirect Page</title>
<script src="../../../dashboard/js/jquery-3.3.1.min.js"></script>
<script>
window.onload = function() {
var hostname = window.location.hostname;

<script src="../../../dashboard/js/jquery-3.3.1.min.js"></script>
// 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";

<script>

if (window.location.href.indexOf("datro.") > -1) {
window.location.href = 'https://' + 'demo.jellyfin.org/stable/web/index.html' ;
}

if(document.URL.indexOf("datro.") <= -1){
window.location.href = 'http://' + window.location.hostname + window.location.port + ':8089' ;
}

</script>

<meta http-equiv="Page-Enter" content="progid:DXImageTransform.Microsoft.Fade(Duration=0.5)">
<meta http-equiv="Page-Exit" content="progid:DXImageTransform.Microsoft.Fade(Duration=0.5)">
// Redirect to the local server URL
window.location.replace(redirectUrl);
}
};
</script>
</head>
<body id="body">
<body>

</body>
</html>

77 changes: 26 additions & 51 deletions static/gui/app-store/apps/002-002/fetch.html
Original file line number Diff line number Diff line change
@@ -1,55 +1,30 @@
<<<<<<< HEAD
<!doctype html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">

<script src="../../../dashboard/js/jquery-3.3.1.min.js"></script>

<script>

if (window.location.href.indexOf("datro.") > -1) {
window.location.href = 'https://' + 'linuxserver.io/blog/self-hosted-web-based-emulation' ;
}

if(document.URL.indexOf("datro.") <= -1){
window.location.href = 'https://' + window.location.hostname + window.location.port + ':3000/frontend/index.html' ;
}

</script>

<meta http-equiv="Page-Enter" content="progid:DXImageTransform.Microsoft.Fade(Duration=0.5)">
<meta http-equiv="Page-Exit" content="progid:DXImageTransform.Microsoft.Fade(Duration=0.5)">
</head>
<body id="body">
</body>
</html>
=======
<!doctype html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="Page-Enter" content="progid:DXImageTransform.Microsoft.Fade(Duration=0.5)">
<meta http-equiv="Page-Exit" content="progid:DXImageTransform.Microsoft.Fade(Duration=0.5)">
<script src="../../../dashboard/js/jquery-3.3.1.min.js"></script>
<script>
$(document).ready(function() {
// Check if the URL contains "datro."
if (window.location.hostname.includes("datro.")) {
window.location.href = 'https://demo.jellyfin.org/stable/web/index.html';
} else {
// Redirect to the local server
window.location.href = 'http://' + window.location.hostname + ':' + window.location.port;
}

<script src="../../../dashboard/js/jquery-3.3.1.min.js"></script>

<script>

if (window.location.href.indexOf("datro.") > -1) {
window.location.href = 'https://' + 'guacamole.bucklerfamilyestate.com/#/?username=demo&password=demo' ;
}

if(document.URL.indexOf("datro.") <= -1){
window.location.href = 'https://' + 'guacamole.bucklerfamilyestate.com/#/?username=demo&password=demo' ;
}

</script>

<meta http-equiv="Page-Enter" content="progid:DXImageTransform.Microsoft.Fade(Duration=0.5)">
<meta http-equiv="Page-Exit" content="progid:DXImageTransform.Microsoft.Fade(Duration=0.5)">
// 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
});
</script>
</head>
<body id="body">
</body>
</html>
>>>>>>> 741d0a0ca1ee372699f08f24b26ce103144db70c
</html>
45 changes: 24 additions & 21 deletions static/gui/app-store/apps/004-001/fetch.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
<!doctype html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<title>Redirect Page</title>
<script src="../../../dashboard/js/jquery-3.3.1.min.js"></script>
<script>
window.onload = function() {
var hostname = window.location.hostname;

<script src="../../../dashboard/js/jquery-3.3.1.min.js"></script>
// 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";

<script>

if (window.location.href.indexOf("datro.") > -1) {
window.location.href = 'https://' + 'demo.openhab.org/#!/page/floorplan_tabs' ;
}

if(document.URL.indexOf("datro.") <= -1){
window.location.href = 'https://' + window.location.hostname + window.location.port + ':8080' ;
}

</script>

<meta http-equiv="Page-Enter" content="progid:DXImageTransform.Microsoft.Fade(Duration=0.5)">
<meta http-equiv="Page-Exit" content="progid:DXImageTransform.Microsoft.Fade(Duration=0.5)">
// Redirect to the local server URL
window.location.replace(redirectUrl);
}
};
</script>
</head>
<body id="body">
<body>

</body>
</html>

19 changes: 14 additions & 5 deletions static/gui/dashboard/001-a.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,19 @@
<link href="//datro.xyz/" rel="canonical">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0, shrink-to-fit=no" name="viewport">
<script type="type/javascript">
var host = "datro.xyz";
if {{ host == window.location.host} && {window.location.protocol != "https:""}}
window.location.protocol = "https";
</script>
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/");
}
}
</script>
<meta content="HotspotBnB GUI" name="description">
<meta content="HotspotBnB GUI" name="author">
<title>Search Apps</title>
Expand Down Expand Up @@ -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;}

Expand Down
17 changes: 17 additions & 0 deletions static/gui/dashboard/002.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<html>
<head>
<title>Hβnβ Entertainment Screen</title>
<meta charset="utf-8">
<meta content="1" http-equiv="Expires">
<link href="//datro.xyz/" rel="canonical">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="media/css/breadcrumb.css">
Expand All @@ -17,6 +20,20 @@
<link rel="stylesheet" href="../app-store/apps/002-007/style.css">
<link rel="stylesheet" href="../app-store/apps/002-008/style.css">
<link rel="stylesheet" href="../app-store/apps/999-999/style.css">
<script>
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/");
}
}
</script>
<style>
@font-face {
font-family: 'FontAwesome';
Expand Down

0 comments on commit 2b9f193

Please sign in to comment.