diff options
| author | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-04-18 21:04:06 +0300 |
|---|---|---|
| committer | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-04-18 21:04:06 +0300 |
| commit | 3e0faecaaebd8394a1a9d18ec11b5a60f210b654 (patch) | |
| tree | 70226a9e7a73155d05410bda80a38673f8db2a83 /web/html/xui/inbound_modal.html | |
| parent | dc7dbae14a37492ac3a7e3822b3e0b250e248173 (diff) | |
improve reality setting
split xtls from tls - remove iran warp - remove old setting reality from franzkafka (it was a messy code) -and other improvement
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
Diffstat (limited to 'web/html/xui/inbound_modal.html')
| -rw-r--r-- | web/html/xui/inbound_modal.html | 55 |
1 files changed, 34 insertions, 21 deletions
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; - } - }, - methods: { - streamNetworkChange(oldValue) { - if (oldValue === 'kcp') { - this.inModal.inbound.tls = false; - } }, - 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; - } + get client() { + return inModal.getClients(this.inbound.protocol, this.inbound.settings)[0]; }, - removeClient(index, clients) { - clients.splice(index, 1); + get delayedExpireDays() { + return this.client && this.client.expiryTime < 0 ? this.client.expiryTime / -86400000 : 0; }, - isExpiry(index) { - return this.inbound.isExpiry(index) + set delayedExpireDays(days){ + this.client.expiryTime = -86400000 * days; }, - isClientEnable(email) { - clientStats = this.dbInbound.clientStats ? this.dbInbound.clientStats.find(stats => stats.email === email) : null - return clientStats ? clientStats['enable'] : true + }, + methods: { + streamNetworkChange() { + if (!inModal.inbound.canSetTls()) { + this.inModal.inbound.stream.security = 'none'; + } + if (!inModal.inbound.canEnableReality()) { + this.inModal.inbound.reality = false; + } }, 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 = ''; |
