Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMHSanaei <ho3ein.sanaei@gmail.com>2023-06-14 19:20:19 +0300
committerMHSanaei <ho3ein.sanaei@gmail.com>2023-06-14 19:20:19 +0300
commitd40e61fc454a9c42d2ac69950074bf3504d484bf (patch)
treefdbc6f122ad99a078698c82205520c15167b8242 /web/html/xui/index.html
parentc0f1a926e588303051a6a3e977ed2948e6dfd764 (diff)
fix and improve
Diffstat (limited to 'web/html/xui/index.html')
-rw-r--r--web/html/xui/index.html17
1 files changed, 12 insertions, 5 deletions
diff --git a/web/html/xui/index.html b/web/html/xui/index.html
index 9795e87d..989aa286 100644
--- a/web/html/xui/index.html
+++ b/web/html/xui/index.html
@@ -449,9 +449,13 @@
this.loadingTip = tip;
},
async getStatus() {
- const msg = await HttpUtil.post('/server/status');
- if (msg.success) {
- this.setStatus(msg.obj);
+ try {
+ const msg = await HttpUtil.post('/server/status');
+ if (msg.success) {
+ this.setStatus(msg.obj);
+ }
+ } catch (e) {
+ console.error("Failed to get status:", e);
}
},
setStatus(data) {
@@ -560,11 +564,14 @@
},
},
async mounted() {
- while (true) {
+ let retries = 0;
+ while (retries < 5) {
try {
await this.getStatus();
+ retries = 0;
} catch (e) {
- console.error(e);
+ console.error("Error occurred while fetching status:", e);
+ retries++;
}
await PromiseUtil.sleep(2000);
}