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
path: root/web/html
diff options
context:
space:
mode:
authorsomebodywashere <68244480+somebodywashere@users.noreply.github.com>2025-08-06 16:42:32 +0300
committerGitHub <noreply@github.com>2025-08-06 16:42:32 +0300
commitce72d53d1a30940443de01a64542ed19685185a3 (patch)
treee67b56da54faf510e85339638510c61a613e578c /web/html
parent5e641ff9e80a6ec75ff2e3258737892689f8e109 (diff)
fix: inbounds slow loading (#3228) (#3322)
especially encountered on big amount of clients
Diffstat (limited to 'web/html')
-rw-r--r--web/html/inbounds.html49
1 files changed, 21 insertions, 28 deletions
diff --git a/web/html/inbounds.html b/web/html/inbounds.html
index e1267190..e2b98d49 100644
--- a/web/html/inbounds.html
+++ b/web/html/inbounds.html
@@ -405,9 +405,9 @@
<span>[[ clientEmail ]]</span>
<a-tooltip :overlay-class-name="themeSwitcher.currentTheme">
<template #title>
- [[ getClientWithComment(clientEmail, dbInbound.id).comment ]]
+ [[ clientCount[dbInbound.id].comments.get(clientEmail) ]]
</template>
- <a-icon type="message" v-if="getClientWithComment(clientEmail, dbInbound.id).comment"></a-icon>
+ <a-icon type="message" v-if="clientCount[dbInbound.id].comments.get(clientEmail)"></a-icon>
</a-tooltip>
</div>
</template>
@@ -419,9 +419,9 @@
<span>[[ clientEmail ]]</span>
<a-tooltip :overlay-class-name="themeSwitcher.currentTheme">
<template #title>
- [[ getClientWithComment(clientEmail, dbInbound.id).comment ]]
+ [[ clientCount[dbInbound.id].comments.get(clientEmail) ]]
</template>
- <a-icon type="message" v-if="getClientWithComment(clientEmail, dbInbound.id).comment"></a-icon>
+ <a-icon type="message" v-if="clientCount[dbInbound.id].comments.get(clientEmail)"></a-icon>
</a-tooltip>
</div>
</template>
@@ -433,9 +433,9 @@
<span>[[ clientEmail ]]</span>
<a-tooltip :overlay-class-name="themeSwitcher.currentTheme">
<template #title>
- [[ getClientWithComment(clientEmail, dbInbound.id).comment ]]
+ [[ clientCount[dbInbound.id].comments.get(clientEmail) ]]
</template>
- <a-icon type="message" v-if="getClientWithComment(clientEmail, dbInbound.id).comment"></a-icon>
+ <a-icon type="message" v-if="clientCount[dbInbound.id].comments.get(clientEmail)"></a-icon>
</a-tooltip>
</div>
</template>
@@ -447,9 +447,9 @@
<span>[[ clientEmail ]]</span>
<a-tooltip :overlay-class-name="themeSwitcher.currentTheme">
<template #title>
- [[ getClientWithComment(clientEmail, dbInbound.id).comment ]]
+ [[ clientCount[dbInbound.id].comments.get(clientEmail) ]]
</template>
- <a-icon type="message" v-if="getClientWithComment(clientEmail, dbInbound.id).comment"></a-icon>
+ <a-icon type="message" v-if="clientCount[dbInbound.id].comments.get(clientEmail)"></a-icon>
</a-tooltip>
</div>
</template>
@@ -534,9 +534,9 @@
<span>[[ clientEmail ]]</span>
<a-tooltip :overlay-class-name="themeSwitcher.currentTheme">
<template #title>
- [[ getClientWithComment(clientEmail, dbInbound.id).comment ]]
+ [[ clientCount[dbInbound.id].comments.get(clientEmail) ]]
</template>
- <a-icon type="message" v-if="getClientWithComment(clientEmail, dbInbound.id).comment"></a-icon>
+ <a-icon type="message" v-if="clientCount[dbInbound.id].comments.get(clientEmail)"></a-icon>
</a-tooltip>
</div>
</template>
@@ -548,9 +548,9 @@
<span>[[ clientEmail ]]</span>
<a-tooltip :overlay-class-name="themeSwitcher.currentTheme">
<template #title>
- [[ getClientWithComment(clientEmail, dbInbound.id).comment ]]
+ [[ clientCount[dbInbound.id].comments.get(clientEmail) ]]
</template>
- <a-icon type="message" v-if="getClientWithComment(clientEmail, dbInbound.id).comment"></a-icon>
+ <a-icon type="message" v-if="clientCount[dbInbound.id].comments.get(clientEmail)"></a-icon>
</a-tooltip>
</div>
</template>
@@ -562,9 +562,9 @@
<span>[[ clientEmail ]]</span>
<a-tooltip :overlay-class-name="themeSwitcher.currentTheme">
<template #title>
- [[ getClientWithComment(clientEmail, dbInbound.id).comment ]]
+ [[ clientCount[dbInbound.id].comments.get(clientEmail) ]]
</template>
- <a-icon type="message" v-if="getClientWithComment(clientEmail, dbInbound.id).comment"></a-icon>
+ <a-icon type="message" v-if="clientCount[dbInbound.id].comments.get(clientEmail)"></a-icon>
</a-tooltip>
</div>
</template>
@@ -576,9 +576,9 @@
<span>[[ clientEmail ]]</span>
<a-tooltip :overlay-class-name="themeSwitcher.currentTheme">
<template #title>
- [[ getClientWithComment(clientEmail, dbInbound.id).comment ]]
+ [[ clientCount[dbInbound.id].comments.get(clientEmail) ]]
</template>
- <a-icon type="message" v-if="getClientWithComment(clientEmail, dbInbound.id).comment"></a-icon>
+ <a-icon type="message" v-if="clientCount[dbInbound.id].comments.get(clientEmail)"></a-icon>
</a-tooltip>
</div>
</template>
@@ -811,17 +811,6 @@
loading(spinning = true) {
this.loadingStates.spinning = spinning;
},
- getClientWithComment(email, inboundId) {
- const dbInbound = this.dbInbounds.find(inbound => inbound.id === inboundId);
- if (!dbInbound) return { email, comment: '' };
-
- const inboundSettings = JSON.parse(dbInbound.settings);
- if (inboundSettings.clients) {
- const client = inboundSettings.clients.find(c => c.email === email);
- return client ? { email: client.email, comment: client.comment || '' } : { email, comment: '' };
- }
- return { email, comment: '' };
- },
async getDBInbounds() {
this.refreshing = true;
const msg = await HttpUtil.post('/panel/inbound/list');
@@ -893,7 +882,7 @@
}
},
getClientCounts(dbInbound, inbound) {
- let clientCount = 0, active = [], deactive = [], depleted = [], expiring = [], online = [];
+ let clientCount = 0, active = [], deactive = [], depleted = [], expiring = [], online = [], comments = new Map();
clients = inbound.clients;
clientStats = dbInbound.clientStats
now = new Date().getTime()
@@ -901,6 +890,9 @@
clientCount = clients.length;
if (dbInbound.enable) {
clients.forEach(client => {
+ if (client.comment) {
+ comments.set(client.email, client.comment)
+ }
if (client.enable) {
active.push(client.email);
if (this.isClientOnline(client.email)) online.push(client.email);
@@ -929,6 +921,7 @@
depleted: depleted,
expiring: expiring,
online: online,
+ comments: comments,
};
},