Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'web/html/xui/inbound_modal.html')
-rw-r--r--web/html/xui/inbound_modal.html55
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 = '';