Spark Admin: Reload page if websocket is disconnected
This commit is contained in:
1 parent
f6861820e4
commit
c0f255f5a7
2 files changed
+12
-10
No files matched your search
@@ -20,7 +20,7 @@ set(PROTO_GLOBS
|
||||
file (GLOB_RECURSE Proto_Deps RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${PROTO_GLOBS})
|
||||
file (GLOB_RECURSE Proto_Deps_For_Tool RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/api ${PROTO_GLOBS})
|
||||
file (GLOB_RECURSE Api_Src RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ui/src/*.fs)
|
||||
file (GLOB_RECURSE Ui_Src RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} api/src/*.fs)
|
||||
file (GLOB_RECURSE Ui_Src RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} api/src/*.ts)
|
||||
file (GLOB_RECURSE build_scripts RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} api/*.sh)
|
||||
|
||||
set (All_Deps ${Proto_Deps} ${Api_Src} ${Ui_Src} ${build_scripts})
|
||||
|
||||
@@ -88,15 +88,17 @@ class PrivateContext {
|
||||
|
||||
|
||||
onclose(_){
|
||||
console.log("Reconnecting in 3 seconds...")
|
||||
let i = setInterval(() => {
|
||||
if (!this.connected()) {
|
||||
this.connect()
|
||||
}
|
||||
else {
|
||||
clearInterval(i)
|
||||
}
|
||||
},3000);
|
||||
alert("Server disconnected. You will need to log in again.");
|
||||
window.location = window.location;
|
||||
// console.log("Reconnecting in 3 seconds...")
|
||||
// let i = setInterval(() => {
|
||||
// if (!this.connected()) {
|
||||
// this.connect()
|
||||
// }
|
||||
// else {
|
||||
// clearInterval(i)
|
||||
// }
|
||||
// },3000);
|
||||
}
|
||||
onmessage(e){
|
||||
const raw_buffer = new Uint8Array(e.data)
|
||||
|
||||
Reference in new issue
Block a user