mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-14 05:23:09 +00:00
fix multi user bugs
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
</a-form-item>
|
||||
<a-form-item v-if="vless.email && vless.limitIp > 0 && isEdit">
|
||||
<span slot="label">
|
||||
client IP log
|
||||
IP log
|
||||
<a-tooltip>
|
||||
<template slot="title">
|
||||
IPs history Log (before enabling inbound after it has been disabled by IP limit, you should clear the log)
|
||||
@@ -28,11 +28,13 @@
|
||||
<a-icon type="question-circle" theme="filled"></a-icon>
|
||||
</a-tooltip>
|
||||
</span>
|
||||
<a-form layout="block">
|
||||
|
||||
<a-textarea disabled :value="getIPsByIndex(index)" :auto-size="{ minRows: 1, maxRows: 1 }">
|
||||
</a-textarea>
|
||||
<a-textarea readonly @click="getDBClientIps(vless.email,$event)" placeholder="Click To Get IPs" :auto-size="{ minRows: 0.5, maxRows: 10 }">
|
||||
</a-textarea>
|
||||
|
||||
<a-button type="danger" @click="clearDBClientIps(vless.email)" >clear log</a-button>
|
||||
<a-button type="danger" @click="clearDBClientIps(vless.email,$event)" >clear log</a-button>
|
||||
</a-form>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
<a-form-item label="id">
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</a-form-item>
|
||||
<a-form-item v-if="vmess.email && vmess.limitIp > 0 && isEdit">
|
||||
<span slot="label">
|
||||
Client IP Log
|
||||
IP Log
|
||||
<a-tooltip>
|
||||
<template slot="title">
|
||||
IPs history Log (before enabling inbound after it has been disabled by IP limit, you should clear the log)
|
||||
@@ -29,10 +29,10 @@
|
||||
</a-tooltip>
|
||||
</span>
|
||||
|
||||
<a-textarea disabled :input="getDBClientIps(vmess.email)" v-model="clientIps" :auto-size="{ minRows: 1, maxRows: 1 }">
|
||||
<a-textarea readonly @click="getDBClientIps(vmess.email,$event)" placeholder="Click To Get IPs" :auto-size="{ minRows: 0.5, maxRows: 10 }">
|
||||
</a-textarea>
|
||||
|
||||
<a-button type="danger" @click="clearDBClientIps(vmess.email)" >clear log</a-button>
|
||||
<a-button type="danger" @click="clearDBClientIps(vmess.email,$event)" >clear log</a-button>
|
||||
</a-form-item>
|
||||
|
||||
</a-form>
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
confirm: null,
|
||||
inbound: new Inbound(),
|
||||
dbInbound: new DBInbound(),
|
||||
clientIps: [],
|
||||
ok() {
|
||||
ObjectUtil.execute(inModal.confirm, inModal.inbound, inModal.dbInbound);
|
||||
},
|
||||
@@ -68,9 +67,6 @@
|
||||
get dbInbound() {
|
||||
return inModal.dbInbound;
|
||||
},
|
||||
get clientIps() {
|
||||
return inModal.clientIps;
|
||||
},
|
||||
get isEdit() {
|
||||
return inModal.isEdit;
|
||||
}
|
||||
@@ -92,7 +88,7 @@
|
||||
clients.splice(index, 1);
|
||||
},
|
||||
|
||||
async getDBClientIps(index, email) {
|
||||
async getDBClientIps(email,event) {
|
||||
|
||||
const msg = await HttpUtil.post('/xui/inbound/clientIps/'+ email);
|
||||
if (!msg.success) {
|
||||
@@ -101,50 +97,23 @@
|
||||
try {
|
||||
ips = JSON.parse(msg.obj)
|
||||
ips = ips.join(",")
|
||||
this.inModal.clientIps[index] = ips
|
||||
event.target.value = ips
|
||||
} catch (error) {
|
||||
// text
|
||||
this.inModal.clientIps[index] = msg.obj
|
||||
event.target.value = msg.obj
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
async clearDBClientIps(email) {
|
||||
async clearDBClientIps(email,event) {
|
||||
const msg = await HttpUtil.post('/xui/inbound/clearClientIps/'+ email);
|
||||
if (!msg.success) {
|
||||
return;
|
||||
}
|
||||
this.inModal.clientIps = ""
|
||||
},
|
||||
getIPsByIndex(index) {
|
||||
return inModal.clientIps[index]
|
||||
event.target.value = ""
|
||||
},
|
||||
|
||||
},
|
||||
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)
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user