From 61489077d7d5740250702c68846abae6a3598c6f Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Sun, 18 Feb 2024 00:46:49 +0330 Subject: [wg] auto multi-peer and qrcode Co-Authored-By: Alireza Ahmadi --- web/html/common/qrcode_modal.html | 19 ++++++++---- web/html/xui/form/outbound.html | 35 ++++++---------------- web/html/xui/form/protocol/wireguard.html | 12 ++++++-- web/html/xui/inbound_info_modal.html | 48 ++++++++++++++++++++++++------- web/html/xui/inbounds.html | 2 +- 5 files changed, 70 insertions(+), 46 deletions(-) (limited to 'web/html') diff --git a/web/html/common/qrcode_modal.html b/web/html/common/qrcode_modal.html index 3c4fd929..3bda4c29 100644 --- a/web/html/common/qrcode_modal.html +++ b/web/html/common/qrcode_modal.html @@ -35,12 +35,21 @@ this.client = client; this.subId = ''; this.qrcodes = []; - this.inbound.genAllLinks(this.dbInbound.remark, app.remarkModel, client).forEach(l => { - this.qrcodes.push({ - remark: l.remark, - link: l.link + if (this.inbound.protocol == Protocols.WIREGUARD){ + this.inbound.genInboundLinks(dbInbound.remark).split('\r\n').forEach((l,index) =>{ + this.qrcodes.push({ + remark: "Peer " + (index+1), + link: l + }); }); - }); + } else { + this.inbound.genAllLinks(this.dbInbound.remark, app.remarkModel, client).forEach(l => { + this.qrcodes.push({ + remark: l.remark, + link: l.link + }); + }); + } this.visible = true; }, close: function () { diff --git a/web/html/xui/form/outbound.html b/web/html/xui/form/outbound.html index fb6a7af7..469c42b9 100644 --- a/web/html/xui/form/outbound.html +++ b/web/html/xui/form/outbound.html @@ -134,28 +134,10 @@ - - + - - + @@ -189,7 +171,6 @@ - - - {{ i18n "pages.xray.wireguard.psk" }} - + diff --git a/web/html/xui/inbound_info_modal.html b/web/html/xui/inbound_info_modal.html index cdcabad9..23f8bd47 100644 --- a/web/html/xui/inbound_info_modal.html +++ b/web/html/xui/inbound_info_modal.html @@ -179,10 +179,10 @@ @@ -319,7 +345,6 @@ index: null, isExpired: false, subLink: '', - tgLink: '', show(dbInbound, index) { this.index = index; this.inbound = dbInbound.toInbound(); @@ -327,14 +352,15 @@ this.clientSettings = this.inbound.clients ? this.inbound.clients[index] : null; this.isExpired = this.inbound.clients ? this.inbound.isExpiry(index): this.dbInbound.isExpiry; this.clientStats = this.inbound.clients ? this.dbInbound.clientStats.find(row => row.email === this.clientSettings.email) : []; - this.links = this.inbound.genAllLinks(this.dbInbound.remark, app.remarkModel, this.clientSettings); + if (this.inbound.protocol == Protocols.WIREGUARD){ + this.links = this.inbound.genInboundLinks(dbInbound.remark).split('\r\n') + } else { + this.links = this.inbound.genAllLinks(this.dbInbound.remark, app.remarkModel, this.clientSettings); + } if (this.clientSettings) { if (this.clientSettings.subId) { this.subLink = this.genSubLink(this.clientSettings.subId); } - if (this.clientSettings.tgId) { - this.tgLink = "https://t.me/" + this.clientSettings.tgId; - } } this.visible = true; }, diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html index aab05462..93f25730 100644 --- a/web/html/xui/inbounds.html +++ b/web/html/xui/inbounds.html @@ -200,7 +200,7 @@ {{ i18n "edit" }} - + {{ i18n "qrCode" }} -- cgit v1.2.3