From 0e266b88f0eb70bf46d3ecc4df148794bc307205 Mon Sep 17 00:00:00 2001 From: Hamidreza Ghavami Date: Mon, 8 May 2023 19:14:22 +0430 Subject: update UI to use themeSwitcher --- web/html/xui/client_modal.html | 45 +++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 22 deletions(-) (limited to 'web/html/xui/client_modal.html') diff --git a/web/html/xui/client_modal.html b/web/html/xui/client_modal.html index e459b520..89175f31 100644 --- a/web/html/xui/client_modal.html +++ b/web/html/xui/client_modal.html @@ -1,7 +1,7 @@ {{define "clientsModal"}} {{template "form/client"}} @@ -23,13 +23,13 @@ isExpired: false, delayedStart: false, ok() { - if(clientModal.isEdit){ + if (clientModal.isEdit) { ObjectUtil.execute(clientModal.confirm, clientModalApp.client, clientModal.dbInbound.id, clientModal.oldClientId); } else { ObjectUtil.execute(clientModal.confirm, clientModalApp.client, clientModal.dbInbound.id); } }, - show({ title='', okText='{{ i18n "sure" }}', index=null, dbInbound=null, confirm=()=>{}, isEdit=false }) { + show({ title = '', okText = '{{ i18n "sure" }}', index = null, dbInbound = null, confirm = () => { }, isEdit = false }) { this.visible = true; this.title = title; this.okText = okText; @@ -40,11 +40,11 @@ this.index = index === null ? this.clients.length : index; this.isExpired = isEdit ? this.inbound.isExpiry(this.index) : false; this.delayedStart = false; - if (isEdit){ - if (this.clients[index].expiryTime < 0){ + if (isEdit) { + if (this.clients[index].expiryTime < 0) { this.delayedStart = true; } - this.oldClientId = this.getClientId(dbInbound.protocol,clients[index]); + this.oldClientId = this.getClientId(dbInbound.protocol, clients[index]); } else { this.addClient(this.inbound.protocol, this.clients); } @@ -52,7 +52,7 @@ this.confirm = confirm; }, getClients(protocol, clientSettings) { - switch(protocol){ + switch (protocol) { case Protocols.VMESS: return clientSettings.vmesses; case Protocols.VLESS: return clientSettings.vlesses; case Protocols.TROJAN: return clientSettings.trojans; @@ -61,7 +61,7 @@ } }, getClientId(protocol, client) { - switch(protocol){ + switch (protocol) { case Protocols.TROJAN: return client.password; case Protocols.SHADOWSOCKS: return client.email; default: return client.id; @@ -103,24 +103,24 @@ return this.clientModal.isEdit; }, get isTrafficExhausted() { - if(!clientStats) return false - if(clientStats.total <= 0) return false - if(clientStats.up + clientStats.down < clientStats.total) return false + if (!clientStats) return false + if (clientStats.total <= 0) return false + if (clientStats.up + clientStats.down < clientStats.total) return false return true }, get isExpiry() { return this.clientModal.isExpired }, get statsColor() { - if(!clientStats) return 'blue' - if(clientStats.total <= 0) return 'blue' - else if(clientStats.total > 0 && (clientStats.down+clientStats.up) < clientStats.total) return 'cyan' + if (!clientStats) return 'blue' + if (clientStats.total <= 0) return 'blue' + else if (clientStats.total > 0 && (clientStats.down + clientStats.up) < clientStats.total) return 'cyan' else return 'red' }, get delayedExpireDays() { return this.client && this.client.expiryTime < 0 ? this.client.expiryTime / -86400000 : 0; }, - set delayedExpireDays(days){ + set delayedExpireDays(days) { this.client.expiryTime = -86400000 * days; }, }, @@ -129,13 +129,13 @@ var chars = 'abcdefghijklmnopqrstuvwxyz1234567890'; var string = ''; var len = 6 + Math.floor(Math.random() * 5); - for(var ii=0; ii { iconElement.disabled = true; - const msg = await HttpUtil.postWithModal('/xui/inbound/' + dbInboundId + '/resetClientTraffic/'+ email); + const msg = await HttpUtil.postWithModal('/xui/inbound/' + dbInboundId + '/resetClientTraffic/' + email); if (msg.success) { this.clientModal.clientStats.up = 0; this.clientModal.clientStats.down = 0; @@ -175,5 +175,6 @@ }, }, }); + {{end}} -- cgit v1.2.3