fix(setup): redirect to port 8080 after restore
After restore, the setup server (port 8081) exits and the main controller restarts on port 8080. waitForRestart() now polls port 8080 using no-cors mode and redirects there when it responds. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -33,14 +33,13 @@
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
// After restore, the setup server (port 8081) exits and the main
|
||||
// controller restarts on port 8080. Poll port 8080 until it responds.
|
||||
var mainURL = window.location.protocol + '//' + window.location.hostname + ':8080/';
|
||||
function waitForRestart() {
|
||||
fetch('/', {redirect: 'follow'})
|
||||
.then(function(r) {
|
||||
if (r.ok) {
|
||||
window.location.href = '/';
|
||||
} else {
|
||||
setTimeout(waitForRestart, 2000);
|
||||
}
|
||||
fetch(mainURL, {redirect: 'follow', mode: 'no-cors'})
|
||||
.then(function() {
|
||||
window.location.href = mainURL;
|
||||
})
|
||||
.catch(function() {
|
||||
setTimeout(waitForRestart, 2000);
|
||||
|
||||
Reference in New Issue
Block a user