-
+
+
+
@@ -52,22 +52,22 @@
[[ key ]]
-
-
+
+
+
+
+
None
[[ key ]]
-
-
-
[[ key ]]
-
+
@@ -93,33 +93,79 @@
+
+
+
+
+
+
+
+
+ [[ key ]]
+
+
+
+
+
+
+
+ {{ i18n "pages.inbounds.certificatePath" }}
+ {{ i18n "pages.inbounds.certificateContent" }}
+
+
+
+
+
+
+
+
+
+ {{ i18n "pages.inbounds.setDefaultCert" }}
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
[[ key ]]
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ Get New Key
+
{{end}}
\ No newline at end of file
diff --git a/web/html/xui/inbound_info_modal.html b/web/html/xui/inbound_info_modal.html
index 049d529e..4e8c7dae 100644
--- a/web/html/xui/inbound_info_modal.html
+++ b/web/html/xui/inbound_info_modal.html
@@ -49,10 +49,14 @@
tls: {{ i18n "enabled" }}
tls {{ i18n "domainName" }}: [[ inbound.serverName ? inbound.serverName : '' ]]
-
+ |
xtls: {{ i18n "enabled" }}
xtls {{ i18n "domainName" }}: [[ inbound.serverName ? inbound.serverName : '' ]]
|
+
+ reality: {{ i18n "enabled" }}
+ reality {{ i18n "domainName" }}: [[ inbound.serverName ? inbound.serverName : '' ]]
+ |
tls: {{ i18n "disabled" }}
|
diff --git a/web/html/xui/inbound_modal.html b/web/html/xui/inbound_modal.html
index 6b140abc..98cb188f 100644
--- a/web/html/xui/inbound_modal.html
+++ b/web/html/xui/inbound_modal.html
@@ -43,6 +43,14 @@
loading(loading) {
inModal.confirmLoading = loading;
},
+ getClients(protocol, clientSettings) {
+ switch(protocol){
+ case Protocols.VMESS: return clientSettings.vmesses;
+ case Protocols.VLESS: return clientSettings.vlesses;
+ case Protocols.TROJAN: return clientSettings.trojans;
+ default: return null;
+ }
+ },
};
const protocols = {
@@ -62,6 +70,7 @@
inModal: inModal,
Protocols: protocols,
SSMethods: SSMethods,
+ delayedStart: false,
get inbound() {
return inModal.inbound;
},
@@ -70,36 +79,40 @@
},
get isEdit() {
return inModal.isEdit;
- }
+ },
+ get client() {
+ return inModal.getClients(this.inbound.protocol, this.inbound.settings)[0];
+ },
+ get delayedExpireDays() {
+ return this.client && this.client.expiryTime < 0 ? this.client.expiryTime / -86400000 : 0;
+ },
+ set delayedExpireDays(days){
+ this.client.expiryTime = -86400000 * days;
+ },
},
methods: {
- streamNetworkChange(oldValue) {
- if (oldValue === 'kcp') {
- this.inModal.inbound.tls = false;
+ streamNetworkChange() {
+ if (!inModal.inbound.canSetTls()) {
+ this.inModal.inbound.stream.security = 'none';
}
- },
- 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());
- case Protocols.TROJAN: return clients.push(new Inbound.TrojanSettings.Trojan());
- default: return null;
+ if (!inModal.inbound.canEnableReality()) {
+ this.inModal.inbound.reality = false;
}
},
- removeClient(index, clients) {
- clients.splice(index, 1);
- },
- isExpiry(index) {
- return this.inbound.isExpiry(index)
- },
- isClientEnable(email) {
- clientStats = this.dbInbound.clientStats ? this.dbInbound.clientStats.find(stats => stats.email === email) : null
- return clientStats ? clientStats['enable'] : true
- },
setDefaultCertData(){
inModal.inbound.stream.tls.certs[0].certFile = app.defaultCert;
inModal.inbound.stream.tls.certs[0].keyFile = app.defaultKey;
},
+ async getNewX25519Cert(){
+ inModal.loading(true);
+ const msg = await HttpUtil.post('/server/getNewX25519Cert');
+ inModal.loading(false);
+ if (!msg.success) {
+ return;
+ }
+ inModal.inbound.stream.reality.privateKey = msg.obj.privateKey;
+ inModal.inbound.stream.reality.settings.publicKey = msg.obj.publicKey;
+ },
getNewEmail(client) {
var chars = 'abcdefghijklmnopqrstuvwxyz1234567890';
var string = '';
diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html
index b962efcb..15782b1d 100644
--- a/web/html/xui/inbounds.html
+++ b/web/html/xui/inbounds.html
@@ -133,26 +133,26 @@
[[ dbInbound.toInbound().stream.network ]]
TLS
- XTLS
+ XTLS
Reality
[[ clientCount[dbInbound.id].clients ]]
-
+
[[ clientEmail ]]
[[ clientCount[dbInbound.id].deactive.length ]]
-
+
[[ clientEmail ]]
[[ clientCount[dbInbound.id].depleted.length ]]
-
+
[[ clientEmail ]]
@@ -531,9 +531,9 @@
title: '{{ i18n "pages.client.add"}}',
okText: '{{ i18n "pages.client.submitAdd"}}',
dbInbound: dbInbound,
- confirm: async (inbound, dbInbound, index) => {
+ confirm: async (clients, dbInboundId) => {
clientModal.loading();
- await this.addClient(inbound, dbInbound);
+ await this.addClient(clients, dbInboundId);
clientModal.close();
},
isEdit: false
@@ -545,9 +545,9 @@
title: '{{ i18n "pages.client.bulk"}} ' + dbInbound.remark,
okText: '{{ i18n "pages.client.bulk"}}',
dbInbound: dbInbound,
- confirm: async (inbound, dbInbound) => {
+ confirm: async (clients, dbInboundId) => {
clientsBulkModal.loading();
- await this.addClient(inbound, dbInbound);
+ await this.addClient(clients, dbInboundId);
clientsBulkModal.close();
},
});
@@ -561,9 +561,9 @@
okText: '{{ i18n "pages.client.submitEdit"}}',
dbInbound: dbInbound,
index: index,
- confirm: async (inbound, dbInbound, index) => {
+ confirm: async (client, dbInboundId, index) => {
clientModal.loading();
- await this.updateClient(inbound, dbInbound, index);
+ await this.updateClient(client, dbInboundId, index);
clientModal.close();
},
isEdit: true
@@ -573,17 +573,17 @@
firstKey = Object.keys(client)[0];
return clients.findIndex(c => c[firstKey] === client[firstKey]);
},
- async addClient(inbound, dbInbound) {
+ async addClient(clients, dbInboundId) {
const data = {
- id: dbInbound.id,
- settings: inbound.settings.toString(),
+ id: dbInboundId,
+ settings: '{"clients": [' + clients.toString() +']}',
};
- await this.submit('/xui/inbound/addClient/', data);
+ await this.submit(`/xui/inbound/addClient`, data);
},
- async updateClient(inbound, dbInbound, index) {
+ async updateClient(client, dbInboundId, index) {
const data = {
- id: dbInbound.id,
- settings: inbound.settings.toString(),
+ id: dbInboundId,
+ settings: '{"clients": [' + client.toString() +']}',
};
await this.submit(`/xui/inbound/updateClient/${index}`, data);
},
diff --git a/web/html/xui/setting.html b/web/html/xui/setting.html
index e10737e0..7ce0e160 100644
--- a/web/html/xui/setting.html
+++ b/web/html/xui/setting.html
@@ -125,7 +125,6 @@
-