From add853fadaebeed99d2eadcf6ec2fa9396bf6ccd Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Mon, 20 Feb 2023 20:59:55 +0330 Subject: update pack 3 user pass will be generated randomly upgrade all dependencies move add client buttom --- web/html/xui/form/protocol/trojan.html | 213 +++++++++++++++------------------ web/html/xui/form/protocol/vless.html | 64 ++++------ web/html/xui/form/protocol/vmess.html | 67 ++++------- web/html/xui/inbound_modal.html | 22 +--- 4 files changed, 150 insertions(+), 216 deletions(-) (limited to 'web/html/xui') diff --git a/web/html/xui/form/protocol/trojan.html b/web/html/xui/form/protocol/trojan.html index fa5a2032..6d43bc34 100644 --- a/web/html/xui/form/protocol/trojan.html +++ b/web/html/xui/form/protocol/trojan.html @@ -1,141 +1,126 @@ {{define "form/trojan"}} + - - - Account is (Expired|Traffic Ended) And Disabled - + + Account is (Expired|Traffic Ended) And Disabled + + + + Email + + + + + + + + + + + + + + + {{ i18n "none" }} + [[ key ]] + + - Email + {{ i18n "pages.inbounds.totalFlow" }}(GB) - - + - + - - - - - - - none - [[ key ]] - + + + {{ i18n "pages.inbounds.expireDate" }} + + + + + + - - - {{ i18n "pages.inbounds.totalFlow" }}(GB) - + + - + + + - - - - - - {{ i18n "pages.inbounds.expireDate" }} - - - - - - - - - - - - - - - [[ sizeFormat(getUpStats(trojan.email)) ]] / [[ sizeFormat(getDownStats(trojan.email)) ]] - used : [[ sizeFormat(getUpStats(trojan.email) + getDownStats(trojan.email)) ]] - - - - - - - - - - - - - - + [[ sizeFormat(getUpStats(trojan.email)) ]] / [[ sizeFormat(getDownStats(trojan.email)) ]] + used : [[ sizeFormat(getUpStats(trojan.email) + getDownStats(trojan.email)) ]] + + + + + + + + + + + + + + + + - - - + - + + + + + - - fallback[[ index + 1 ]] - - - - - - - - - - - - - - - - - - + + fallback[[ index + 1 ]] + + + + + + + + + + + + + + + + + + {{end}} \ No newline at end of file diff --git a/web/html/xui/form/protocol/vless.html b/web/html/xui/form/protocol/vless.html index 5d56fdd3..fc7ffaa6 100644 --- a/web/html/xui/form/protocol/vless.html +++ b/web/html/xui/form/protocol/vless.html @@ -1,6 +1,7 @@ {{define "form/vless"}} -{{ i18n "clients"}} + @@ -26,20 +27,20 @@ - + - none + {{ i18n "none" }} [[ key ]] - + - none + {{ i18n "none" }} [[ key ]] - - + + [[ key ]] @@ -71,7 +72,7 @@ @@ -79,43 +80,26 @@ [[ sizeFormat(getUpStats(vless.email)) ]] / [[ sizeFormat(getDownStats(vless.email)) ]] used : [[ sizeFormat(getUpStats(vless.email) + getDownStats(vless.email)) ]] - - + + + - - - - - - - - - - + + + + + + + + diff --git a/web/html/xui/form/protocol/vmess.html b/web/html/xui/form/protocol/vmess.html index 9ed444c6..f7050a5e 100644 --- a/web/html/xui/form/protocol/vmess.html +++ b/web/html/xui/form/protocol/vmess.html @@ -1,5 +1,6 @@ {{define "form/vmess"}} + @@ -56,7 +57,7 @@ @@ -64,56 +65,34 @@ [[ sizeFormat(getUpStats(vmess.email)) ]] / [[ sizeFormat(getDownStats(vmess.email)) ]] used : [[ sizeFormat(getUpStats(vmess.email) + getDownStats(vmess.email)) ]] - - - - - - + + + + + - - - - - - - - - + - + + + + + + + - - - - - + + + -{{end}} +{{end}} \ No newline at end of file diff --git a/web/html/xui/inbound_modal.html b/web/html/xui/inbound_modal.html index 4fec0ded..80ea2286 100644 --- a/web/html/xui/inbound_modal.html +++ b/web/html/xui/inbound_modal.html @@ -77,7 +77,7 @@ this.inModal.inbound.tls = false; } }, - addClient(protocol,value, clients) { + addClient(protocol, clients) { switch (protocol) { case Protocols.VMESS: return clients.push(new Inbound.VmessSettings.Vmess()); case Protocols.VLESS: return clients.push(new Inbound.VLESSSettings.VLESS()); @@ -88,7 +88,6 @@ removeClient(index, clients) { clients.splice(index, 1); }, - async resetClientTraffic(client,event) { const msg = await HttpUtil.post('/xui/inbound/resetClientTraffic/'+ client.email); if (!msg.success) { @@ -122,7 +121,6 @@ } } } - }, getDownStats(email) { clientStats = this.inbound.clientStats @@ -138,30 +136,18 @@ } }, isClientEnable(email) { - clientStats = this.inbound.clientStats - if(clientStats.length > 0) - { - for (const key in clientStats) { - if (Object.hasOwnProperty.call(clientStats, key)) { - if(clientStats[key]['email'] == email) - return clientStats[key]['enable'] - - } - } - } + clientStats = this.dbInbound.clientStats ? this.dbInbound.clientStats.find(stats => stats.email === email) : null + return clientStats ? clientStats['enable'] : true }, - getHeaderText(email) { if(email == "") return "Add Client" return email + (this.isClientEnable(email) == true ? ' Active' : ' Deactive') }, - getHeaderStyle(email) { return (this.isClientEnable(email) == true ? '' : 'deactive-client') }, - getNewEmail(client) { var chars = 'abcdefghijklmnopqrstuvwxyz1234567890'; var string = ''; @@ -175,4 +161,4 @@ }); -{{end}} +{{end}} \ No newline at end of file -- cgit v1.2.3