From 4b20f16024769a072fa7c665d605e38134ef2920 Mon Sep 17 00:00:00 2001
From: "Shishkevich D." <135337715+shishkevichd@users.noreply.github.com>
Date: Sun, 22 Jun 2025 00:27:09 +0700
Subject: refactor: new loading logic, icons for tabs
---
web/html/index.html | 41 +++++++++++++++++++----------------------
1 file changed, 19 insertions(+), 22 deletions(-)
(limited to 'web/html/index.html')
diff --git a/web/html/index.html b/web/html/index.html
index 61e3947f..db678cd6 100644
--- a/web/html/index.html
+++ b/web/html/index.html
@@ -4,15 +4,6 @@
.ant-layout-content {
margin: 24px 16px;
}
- .ant-card-hoverable {
- margin-inline: 0.3rem;
- }
- .ant-alert-error {
- margin-inline: 0.3rem;
- }
- }
- .ant-col-sm-24 {
- margin-top: 10px;
}
.ant-card-dark h2 {
color: var(--dark-color-text-primary);
@@ -84,9 +75,9 @@
-
+
-
-
+
-
-
+
+
-
+
@@ -153,7 +144,7 @@
-
+
@@ -488,7 +479,7 @@
}
class Status {
- constructor(data, isLoaded = false) {
+ constructor(data) {
this.cpu = new CurTotal(0, 0);
this.cpuCores = 0;
this.logicalPro = 0;
@@ -512,7 +503,6 @@
return;
}
- this.isLoaded = isLoaded;
this.cpu = new CurTotal(data.cpu, 100);
this.cpuCores = data.cpuCores;
this.logicalPro = data.logicalPro;
@@ -632,32 +622,39 @@
mixins: [MediaQueryMixin],
data: {
themeSwitcher,
+ loadingStates: {
+ fetched: false,
+ spinning: false
+ },
status: new Status(),
versionModal,
logModal,
backupModal,
- spinning: false,
loadingTip: '{{ i18n "loading"}}',
showAlert: false,
showIp: false
},
methods: {
loading(spinning, tip = '{{ i18n "loading"}}') {
- this.spinning = spinning;
+ this.loadingStates.spinning = spinning;
this.loadingTip = tip;
},
async getStatus() {
try {
const msg = await HttpUtil.post('/server/status');
if (msg.success) {
+ if (!this.loadingStates.fetched) {
+ this.loadingStates.fetched = true;
+ }
+
this.setStatus(msg.obj, true);
}
} catch (e) {
console.error("Failed to get status:", e);
}
},
- setStatus(data, isLoaded = false) {
- this.status = new Status(data, isLoaded);
+ setStatus(data) {
+ this.status = new Status(data);
},
async openSelectV2rayVersion() {
this.loading(true);
--
cgit v1.2.3