mirror of
https://github.com/baoweise-bot/aimili-vpngate.git
synced 2026-09-08 17:26:46 +08:00
fix(web): replace location.reload() with load() to prevent page flashing and preserve search/scroll states during node switching
This commit is contained in:
+3
-3
@@ -2669,12 +2669,12 @@ function startConnectionPolling() {
|
|||||||
try {
|
try {
|
||||||
await fetch("./api/test_proxy", { method: "POST" });
|
await fetch("./api/test_proxy", { method: "POST" });
|
||||||
} catch(pe){}
|
} catch(pe){}
|
||||||
location.reload();
|
load();
|
||||||
}
|
}
|
||||||
} catch(pe) {
|
} catch(pe) {
|
||||||
clearInterval(pollInterval);
|
clearInterval(pollInterval);
|
||||||
pollInterval = null;
|
pollInterval = null;
|
||||||
location.reload();
|
load();
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
@@ -2725,7 +2725,7 @@ async function disconnectNode(){
|
|||||||
try {
|
try {
|
||||||
await fetch("./api/test_proxy", { method: "POST" });
|
await fetch("./api/test_proxy", { method: "POST" });
|
||||||
} catch(pe){}
|
} catch(pe){}
|
||||||
location.reload();
|
load();
|
||||||
} else {
|
} else {
|
||||||
alert("断开连接失败: " + (result.error || "未知错误"));
|
alert("断开连接失败: " + (result.error || "未知错误"));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user