mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-06 21:24:10 +00:00
fix: resolve Overview page stuck on loading spinner
Agent-Logs-Url: https://github.com/xAlokyx/3x-ui/sessions/6bd8383d-5697-43fe-ba43-fbdc55ca783a Co-authored-by: xAlokyx <234771438+xAlokyx@users.noreply.github.com>
This commit is contained in:
parent
d7696a0abf
commit
d449b73c10
1 changed files with 8 additions and 6 deletions
|
|
@ -695,7 +695,7 @@
|
|||
this.logicalPro = data.logicalPro;
|
||||
this.cpuSpeedMhz = data.cpuSpeedMhz;
|
||||
this.disk = new CurTotal(data.disk.current, data.disk.total);
|
||||
this.loads = data.loads.map(load => NumberFormatter.toFixed(load, 2));
|
||||
this.loads = (data.loads || [0, 0, 0]).map(load => NumberFormatter.toFixed(load, 2));
|
||||
this.mem = new CurTotal(data.mem.current, data.mem.total);
|
||||
this.netIO = data.netIO;
|
||||
this.netTraffic = data.netTraffic;
|
||||
|
|
@ -905,17 +905,19 @@
|
|||
try {
|
||||
const msg = await HttpUtil.get('/panel/api/server/status');
|
||||
if (msg.success) {
|
||||
if (!this.loadingStates.fetched) {
|
||||
this.loadingStates.fetched = true;
|
||||
}
|
||||
|
||||
this.setStatus(msg.obj, true);
|
||||
this.setStatus(msg.obj);
|
||||
} else if (!this.loadingStates.fetched) {
|
||||
this.loadingStates.fetched = true;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("Failed to get status:", e);
|
||||
if (!this.loadingStates.fetched) {
|
||||
this.loadingStates.fetched = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
setStatus(data) {
|
||||
this.loadingStates.fetched = true;
|
||||
this.status = new Status(data);
|
||||
// Push CPU percent into history (clamped 0..100)
|
||||
const v = Math.max(0, Math.min(100, Number(data?.cpu ?? 0)))
|
||||
|
|
|
|||
Loading…
Reference in a new issue