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>
|
<script>
|
||||||
(function() {
|
(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() {
|
function waitForRestart() {
|
||||||
fetch('/', {redirect: 'follow'})
|
fetch(mainURL, {redirect: 'follow', mode: 'no-cors'})
|
||||||
.then(function(r) {
|
.then(function() {
|
||||||
if (r.ok) {
|
window.location.href = mainURL;
|
||||||
window.location.href = '/';
|
|
||||||
} else {
|
|
||||||
setTimeout(waitForRestart, 2000);
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.catch(function() {
|
.catch(function() {
|
||||||
setTimeout(waitForRestart, 2000);
|
setTimeout(waitForRestart, 2000);
|
||||||
|
|||||||
Reference in New Issue
Block a user