Fix #99410: SocketIO Reconnect Web Interface #104235
@ -49,15 +49,16 @@ export default {
|
|||||||
flamencoVersion: DEFAULT_FLAMENCO_VERSION,
|
flamencoVersion: DEFAULT_FLAMENCO_VERSION,
|
||||||
backendURL: backendURL,
|
backendURL: backendURL,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
window.app = this;
|
window.app = this;
|
||||||
this.fetchManagerInfo();
|
this.fetchManagerInfo();
|
||||||
|
|
||||||
const sockStatus = useSocketStatus();
|
const sockStatus = useSocketStatus();
|
||||||
this.$watch(() => sockStatus.isConnected, (isConnected) => {
|
this.$watch(() => sockStatus.isConnected, (isConnected) => {
|
||||||
dr.sybren marked this conversation as resolved
|
|||||||
if (isConnected) {
|
if (!isConnected) return;
|
||||||
|
if (!sockStatus.wasEverDisconnected) return;
|
||||||
this.socketIOReconnect();
|
this.socketIOReconnect();
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -72,14 +73,14 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
socketIOReconnect() {
|
socketIOReconnect() {
|
||||||
this.fetchManagerInfo()
|
const metaAPI = new API.MetaApi(getAPIClient())
|
||||||
if (this.flamencoVersion !== DEFAULT_FLAMENCO_VERSION || this.flamencoName !== DEFAULT_FLAMENCO_NAME ) {
|
metaAPI.getVersion().then((version) => {
|
||||||
console.log(`Upgraded Flamenco Version: ${this.flamencoVersion}`);
|
if (version.name === this.flamencoName && version.version == this.flamencoVersion)
|
||||||
|
return;
|
||||||
// Reload the page
|
console.log(`Updated from ${this.flamencoVersion} to ${version.version}`);
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
});
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user
This should also check
sockStatus.wasEverDisconnected
, otherwise it'll also respond to the initial connection.