mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-14 05:23:09 +00:00
bugs fix
This commit is contained in:
@@ -116,7 +116,7 @@ func (a *InboundController) getClientIps(c *gin.Context) {
|
||||
|
||||
ips , err := a.inboundService.GetInboundClientIps(email)
|
||||
if err != nil {
|
||||
jsonMsg(c, "修改", err)
|
||||
jsonObj(c, "No IP Record", nil)
|
||||
return
|
||||
}
|
||||
jsonObj(c, ips, nil)
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<a-input type="number" v-model.number="inbound.settings.vmesses[0].limitIp"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item v-if="inbound.settings.vmesses[0].email && inbound.settings.vmesses[0].limitIp > 0 && inbound.id">
|
||||
<a-form-item v-if="inbound.settings.vmesses[0].email && inbound.settings.vmesses[0].limitIp > 0 && isEdit">
|
||||
<span slot="label">
|
||||
Client IP Log
|
||||
<a-tooltip>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
visible: false,
|
||||
confirmLoading: false,
|
||||
okText: '确定',
|
||||
isEdit: false,
|
||||
confirm: null,
|
||||
inbound: new Inbound(),
|
||||
dbInbound: new DBInbound(),
|
||||
@@ -18,7 +19,7 @@
|
||||
ok() {
|
||||
ObjectUtil.execute(inModal.confirm, inModal.inbound, inModal.dbInbound);
|
||||
},
|
||||
show({ title='', okText='确定', inbound=null, dbInbound=null, confirm=(inbound, dbInbound)=>{} }) {
|
||||
show({ title='', okText='确定', inbound=null, dbInbound=null, confirm=(inbound, dbInbound)=>{}, isEdit=false }) {
|
||||
this.title = title;
|
||||
this.okText = okText;
|
||||
if (inbound) {
|
||||
@@ -33,6 +34,7 @@
|
||||
}
|
||||
this.confirm = confirm;
|
||||
this.visible = true;
|
||||
this.isEdit = isEdit;
|
||||
},
|
||||
close() {
|
||||
inModal.visible = false;
|
||||
@@ -68,6 +70,9 @@
|
||||
},
|
||||
get clientIps() {
|
||||
return inModal.clientIps;
|
||||
},
|
||||
get isEdit() {
|
||||
return inModal.isEdit;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -82,9 +87,16 @@
|
||||
if (!msg.success) {
|
||||
return;
|
||||
}
|
||||
ips = JSON.parse(msg.obj)
|
||||
ips = ips.join(",")
|
||||
this.inModal.clientIps = ips
|
||||
try {
|
||||
ips = JSON.parse(msg.obj)
|
||||
ips = ips.join(",")
|
||||
this.inModal.clientIps = ips
|
||||
} catch (error) {
|
||||
// text
|
||||
this.inModal.clientIps = msg.obj
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
async clearDBClientIps(email) {
|
||||
const msg = await HttpUtil.post('/xui/inbound/clearClientIps/'+ email);
|
||||
|
||||
@@ -240,7 +240,8 @@
|
||||
inModal.loading();
|
||||
await this.addInbound(inbound, dbInbound);
|
||||
inModal.close();
|
||||
}
|
||||
},
|
||||
isEdit: false
|
||||
});
|
||||
},
|
||||
openEditInbound(dbInbound) {
|
||||
@@ -254,7 +255,8 @@
|
||||
inModal.loading();
|
||||
await this.updateInbound(inbound, dbInbound);
|
||||
inModal.close();
|
||||
}
|
||||
},
|
||||
isEdit: true
|
||||
});
|
||||
},
|
||||
async addInbound(inbound, dbInbound) {
|
||||
|
||||
Reference in New Issue
Block a user