Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
bugs fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hossinasaadi committed Oct 30, 2022
1 parent 58327d5 commit 60b649b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion web/controller/inbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion web/html/xui/form/protocol/vmess.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
20 changes: 16 additions & 4 deletions web/html/xui/inbound_modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
visible: false,
confirmLoading: false,
okText: '确定',
isEdit: false,
confirm: null,
inbound: new Inbound(),
dbInbound: new DBInbound(),
clientIps: "",
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) {
Expand All @@ -33,6 +34,7 @@
}
this.confirm = confirm;
this.visible = true;
this.isEdit = isEdit;
},
close() {
inModal.visible = false;
Expand Down Expand Up @@ -68,6 +70,9 @@
},
get clientIps() {
return inModal.clientIps;
},
get isEdit() {
return inModal.isEdit;
}
},
methods: {
Expand All @@ -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);
Expand Down
6 changes: 4 additions & 2 deletions web/html/xui/inbounds.html
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@
inModal.loading();
await this.addInbound(inbound, dbInbound);
inModal.close();
}
},
isEdit: false
});
},
openEditInbound(dbInbound) {
Expand All @@ -254,7 +255,8 @@
inModal.loading();
await this.updateInbound(inbound, dbInbound);
inModal.close();
}
},
isEdit: true
});
},
async addInbound(inbound, dbInbound) {
Expand Down

0 comments on commit 60b649b

Please sign in to comment.