diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js
index 4526ef1a..cb15842b 100644
--- a/web/assets/js/model/xray.js
+++ b/web/assets/js/model/xray.js
@@ -881,7 +881,7 @@ class Inbound extends XrayCommonClass {
this.sniffing = new Sniffing();
}
- genVmessLink(address='', remark='') {
+ genVmessLink(address='', remark='', clientIndex=0) {
if (this.protocol !== Protocols.VMESS) {
return '';
}
@@ -934,8 +934,8 @@ class Inbound extends XrayCommonClass {
ps: remark,
add: address,
port: this.port,
- id: this.settings.vmesses[0].id,
- aid: this.settings.vmesses[0].alterId,
+ id: this.settings.vmesses[clientIndex].id,
+ aid: this.settings.vmesses[clientIndex].alterId,
net: network,
type: type,
host: host,
@@ -945,9 +945,9 @@ class Inbound extends XrayCommonClass {
return 'vmess://' + base64(JSON.stringify(obj, null, 2));
}
- genVLESSLink(address = '', remark='') {
+ genVLESSLink(address = '', remark='', clientIndex=0) {
const settings = this.settings;
- const uuid = settings.vlesses[0].id;
+ const uuid = settings.vlesses[clientIndex].id;
const port = this.port;
const type = this.stream.network;
const params = new Map();
@@ -1009,7 +1009,7 @@ class Inbound extends XrayCommonClass {
}
if (this.xtls) {
- params.set("flow", this.settings.vlesses[0].flow);
+ params.set("flow", this.settings.vlesses[clientIndex].flow);
}
const link = `vless://${uuid}@${address}:${port}`;
@@ -1036,10 +1036,10 @@ class Inbound extends XrayCommonClass {
return `trojan://${settings.clients[0].password}@${address}:${this.port}#${encodeURIComponent(remark)}`;
}
- genLink(address='', remark='') {
+ genLink(address='', remark='', clientIndex=0) {
switch (this.protocol) {
- case Protocols.VMESS: return this.genVmessLink(address, remark);
- case Protocols.VLESS: return this.genVLESSLink(address, remark);
+ case Protocols.VMESS: return this.genVmessLink(address, remark, clientIndex);
+ case Protocols.VLESS: return this.genVLESSLink(address, remark, clientIndex);
case Protocols.SHADOWSOCKS: return this.genSSLink(address, remark);
case Protocols.TROJAN: return this.genTrojanLink(address, remark);
default: return '';
diff --git a/web/html/common/qrcode_modal.html b/web/html/common/qrcode_modal.html
index 9a3359d5..e071f46a 100644
--- a/web/html/common/qrcode_modal.html
+++ b/web/html/common/qrcode_modal.html
@@ -3,6 +3,20 @@
:closable="true" width="300px" :ok-text="qrModal.okText"
cancel-text='{{ i18n "close" }}' :ok-button-props="{attrs:{id:'qr-modal-ok-btn'}}">
+ click on QR Code to Copy
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/web/html/xui/component/inbound_info.html b/web/html/xui/component/inbound_info.html
index b3eca115..cbf156d1 100644
--- a/web/html/xui/component/inbound_info.html
+++ b/web/html/xui/component/inbound_info.html
@@ -32,10 +32,10 @@
tls: {{ i18n "closure" }}
- tls {{ i18n "domainName" }}: [[ inbound.serverName ? inbound.serverName : '{{ i18n "none" }}' ]]
+ tls {{ i18n "domainName" }}: [[ inbound.serverName ? inbound.serverName : '' ]]
- xtls {{ i18n "domainName" }}: [[ inbound.serverName ? inbound.serverName : '{{ i18n "none" }}' ]]
+ xtls {{ i18n "domainName" }}: [[ inbound.serverName ? inbound.serverName : '' ]]
{{end}}
@@ -46,14 +46,16 @@
{{ i18n "pages.inbounds.address"}}: [[ dbInbound.address ]]
{{ i18n "pages.inbounds.port"}}: [[ dbInbound.port ]]
-
- uuid: [[ inbound.uuid ]]
- alterId: [[ inbound.alterId ]]
+
+ uuid: [[ vmess.id ]]
+ alterId: [[ vmess.alterId ]]
+
-
- uuid: [[ inbound.uuid ]]
- flow: [[ inbound.flow ]]
+
+ uuid: [[ vless.id ]]
+ flow: [[ vless.flow ]]
+
diff --git a/web/html/xui/form/protocol/vless.html b/web/html/xui/form/protocol/vless.html
index deba14b0..65f4f393 100644
--- a/web/html/xui/form/protocol/vless.html
+++ b/web/html/xui/form/protocol/vless.html
@@ -1,8 +1,9 @@
{{define "form/vless"}}
-
+
-
+
@@ -15,9 +16,9 @@
-
+
-
+
client IP log
@@ -28,21 +29,56 @@
-
+
- clear log
+ clear log
-
+
-
+
[[ key ]]
+
+
+
+
+
+
+
diff --git a/web/html/xui/form/protocol/vmess.html b/web/html/xui/form/protocol/vmess.html
index ea0c62a9..e358bee1 100644
--- a/web/html/xui/form/protocol/vmess.html
+++ b/web/html/xui/form/protocol/vmess.html
@@ -1,8 +1,9 @@
{{define "form/vmess"}}
-
+
-
+
@@ -15,9 +16,9 @@
-
+
-
+
Client IP Log
@@ -28,21 +29,60 @@
-
+
- clear log
+ clear log
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
{{end}}
\ No newline at end of file
diff --git a/web/html/xui/inbound_modal.html b/web/html/xui/inbound_modal.html
index dfe86923..d4797c9a 100644
--- a/web/html/xui/inbound_modal.html
+++ b/web/html/xui/inbound_modal.html
@@ -15,7 +15,7 @@
confirm: null,
inbound: new Inbound(),
dbInbound: new DBInbound(),
- clientIps: "",
+ clientIps: [],
ok() {
ObjectUtil.execute(inModal.confirm, inModal.inbound, inModal.dbInbound);
},
@@ -81,7 +81,18 @@
this.inModal.inbound.tls = false;
}
},
- async getDBClientIps(email) {
+ addClient(protocol,value, clients) {
+ switch (protocol) {
+ case Protocols.VMESS: return clients.push(new Inbound.VmessSettings.Vmess());
+ case Protocols.VLESS: return clients.push(new Inbound.VLESSSettings.VLESS());
+ default: return null;
+ }
+ },
+ removeClient(index, clients) {
+ clients.splice(index, 1);
+ },
+
+ async getDBClientIps(index, email) {
const msg = await HttpUtil.post('/xui/inbound/clientIps/'+ email);
if (!msg.success) {
@@ -90,10 +101,10 @@
try {
ips = JSON.parse(msg.obj)
ips = ips.join(",")
- this.inModal.clientIps = ips
+ this.inModal.clientIps[index] = ips
} catch (error) {
// text
- this.inModal.clientIps = msg.obj
+ this.inModal.clientIps[index] = msg.obj
}
@@ -105,8 +116,34 @@
}
this.inModal.clientIps = ""
},
+ getIPsByIndex(index) {
+ return inModal.clientIps[index]
+ },
},
+ updated() {
+ switch (inModal.inbound.protocol) {
+ case Protocols.VMESS:
+ vmesses = inModal.inbound.settings.vmesses
+ for (const index in vmesses) {
+ if(vmesses[index].email)
+ this.getDBClientIps(index, vmesses[index].email)
+ }
+ break;
+ case Protocols.VLESS:
+ vlesses = inModal.inbound.settings.vlesses
+
+ for (const index in vlesses) {
+ if(vlesses[index].email)
+ this.getDBClientIps(index, vlesses[index].email)
+
+ }
+ break;
+ default: return null;
+ }
+ console.log(this.inModal.clientIps)
+
+ }
});
diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html
index 3c5aafb5..3844d49c 100644
--- a/web/html/xui/inbounds.html
+++ b/web/html/xui/inbounds.html
@@ -324,7 +324,7 @@
},
showQrcode(dbInbound) {
const link = dbInbound.genLink();
- qrModal.show('{{ i18n "qrCode"}}', link);
+ qrModal.show('{{ i18n "qrCode"}}', link, dbInbound);
},
showInfo(dbInbound) {
infoModal.show(dbInbound);