From e1da43053d23c995bcd6e7267cb20042398cd64f Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Sun, 9 Apr 2023 23:13:18 +0330 Subject: alireza update pack Co-Authored-By: Alireza Ahmadi --- web/html/xui/client_bulk_modal.html | 42 ++++-- web/html/xui/client_modal.html | 20 ++- web/html/xui/form/client.html | 25 +++- web/html/xui/form/protocol/trojan.html | 2 +- web/html/xui/form/protocol/vless.html | 2 +- web/html/xui/form/tls_settings.html | 1 + web/html/xui/inbound_client_table.html | 8 +- web/html/xui/inbound_info_modal.html | 54 ++++++-- web/html/xui/inbound_modal.html | 4 + web/html/xui/inbounds.html | 245 +++++++++++++++++++++++---------- web/html/xui/index.html | 41 ++++-- web/html/xui/setting.html | 4 +- 12 files changed, 332 insertions(+), 116 deletions(-) (limited to 'web/html/xui') diff --git a/web/html/xui/client_bulk_modal.html b/web/html/xui/client_bulk_modal.html index 2024fa1d..4e282ccd 100644 --- a/web/html/xui/client_bulk_modal.html +++ b/web/html/xui/client_bulk_modal.html @@ -10,8 +10,7 @@ Random+Prefix Random+Prefix+Num Random+Prefix+Num+Postfix - Random+Prefix+Num@Telegram Username - Prefix+Num+Postfix [ BE CAREFUL! ] + Prefix+Num+Postfix [ BE CAREFUL! ]
@@ -27,15 +26,19 @@ - tg_uname - {{ i18n "pages.client.postfix" }} + {{ i18n "pages.client.postfix" }} - {{ i18n "pages.client.clientCount" }} + + + + + + {{ i18n "pages.inbounds.totalFlow" }}(GB) @@ -48,7 +51,13 @@ - + + + + + + + {{ i18n "pages.inbounds.expireDate" }} @@ -83,6 +92,9 @@ lastNum: 1, emailPrefix: "", emailPostfix: "", + subId: "", + tgId: "", + delayedStart: false, ok() { method=clientsBulkModal.emailMethod; if(method>1){ @@ -94,11 +106,13 @@ } prefix = (method>0 && clientsBulkModal.emailPrefix.length>0) ? clientsBulkModal.emailPrefix : ""; useNum=(method>1); - postfix = (method>2 && clientsBulkModal.emailPostfix.length>0) ? (method == 4 ? "@" : "") + clientsBulkModal.emailPostfix : ""; + postfix = (method>2 && clientsBulkModal.emailPostfix.length>0) ? clientsBulkModal.emailPostfix : ""; for (let i = start; i < end; i++) { newClient = clientsBulkModal.newClient(clientsBulkModal.dbInbound.protocol); - if(method==5) newClient.email = ""; + if(method==4) newClient.email = ""; newClient.email += useNum ? prefix + i.toString() + postfix : prefix + postfix; + newClient.subId = clientsBulkModal.subId; + newClient.tgId = clientsBulkModal.tgId; newClient._totalGB = clientsBulkModal.totalGB; newClient._expiryTime = clientsBulkModal.expiryTime; clientsBulkModal.clients.push(newClient); @@ -112,16 +126,18 @@ this.confirm = confirm; this.quantity = 1; this.totalGB = 0; - this.expiryTime = ''; + this.expiryTime = 0; this.emailMethod= 0; this.firstNum= 1; this.lastNum= 1; this.emailPrefix= ""; this.emailPostfix= ""; - + this.subId= ""; + this.tgId= ""; this.dbInbound = new DBInbound(dbInbound); this.inbound = dbInbound.toInbound(); this.clients = this.getClients(this.inbound.protocol, this.inbound.settings); + this.delayedStart = false; }, getClients(protocol, clientSettings) { switch(protocol){ @@ -156,6 +172,12 @@ get inbound() { return this.clientsBulkModal.inbound; }, + get delayedExpireDays() { + return this.clientsBulkModal.expiryTime < 0 ? this.clientsBulkModal.expiryTime / -86400000 : 0; + }, + set delayedExpireDays(days){ + this.clientsBulkModal.expiryTime = -86400000 * days; + }, }, }); diff --git a/web/html/xui/client_modal.html b/web/html/xui/client_modal.html index e4ee8659..d1078f23 100644 --- a/web/html/xui/client_modal.html +++ b/web/html/xui/client_modal.html @@ -1,7 +1,7 @@ {{define "clientsModal"}} {{template "form/client"}} @@ -19,6 +19,7 @@ index: null, clientIps: null, isExpired: false, + delayedStart: false, ok() { ObjectUtil.execute(clientModal.confirm, clientModal.inbound, clientModal.dbInbound, clientModal.index); }, @@ -32,8 +33,13 @@ this.clients = this.getClients(this.inbound.protocol, this.inbound.settings); this.index = index === null ? this.clients.length : index; this.isExpired = isEdit ? this.inbound.isExpiry(this.index) : false; + this.delayedStart = false; if (!isEdit){ this.addClient(this.inbound.protocol, this.clients); + } else { + if (this.clients[index].expiryTime < 0){ + this.delayedStart = true; + } } this.clientStats = this.dbInbound.clientStats.find(row => row.email === this.clients[this.index].email); this.confirm = confirm; @@ -82,7 +88,7 @@ }, get isTrafficExhausted() { if(!clientStats) return false - if(clientStats.total == 0) return false + if(clientStats.total <= 0) return false if(clientStats.up + clientStats.down < clientStats.total) return false return true }, @@ -91,10 +97,16 @@ }, get statsColor() { if(!clientStats) return 'blue' - if(clientStats.total === 0) 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){ + this.client.expiryTime = -86400000 * days; + }, }, methods: { getNewEmail(client) { diff --git a/web/html/xui/form/client.html b/web/html/xui/form/client.html index 288fb0ef..3f91c8e8 100644 --- a/web/html/xui/form/client.html +++ b/web/html/xui/form/client.html @@ -15,6 +15,9 @@ + + + @@ -59,8 +62,14 @@ + + + + + + - + {{ i18n "none" }} [[ key ]] @@ -83,7 +92,7 @@ - + + + + + + + {{ i18n "pages.inbounds.expireDate" }} @@ -102,8 +117,8 @@ + :dropdown-class-name="siderDrawer.isDarkTheme ? 'ant-card-dark' : ''" + v-model="client._expiryTime" style="width: 170px;"> Expired diff --git a/web/html/xui/form/protocol/trojan.html b/web/html/xui/form/protocol/trojan.html index c0694d25..158b64af 100644 --- a/web/html/xui/form/protocol/trojan.html +++ b/web/html/xui/form/protocol/trojan.html @@ -76,7 +76,7 @@ -