diff --git a/web/controller/inbound.go b/web/controller/inbound.go
index c9922b3f65..3a3c964b62 100644
--- a/web/controller/inbound.go
+++ b/web/controller/inbound.go
@@ -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)
diff --git a/web/html/xui/form/protocol/vmess.html b/web/html/xui/form/protocol/vmess.html
index 381caa5ba8..84d9072128 100644
--- a/web/html/xui/form/protocol/vmess.html
+++ b/web/html/xui/form/protocol/vmess.html
@@ -17,7 +17,7 @@
-
+
Client IP Log
diff --git a/web/html/xui/inbound_modal.html b/web/html/xui/inbound_modal.html
index 1bf06a7c99..1d58c60a0f 100644
--- a/web/html/xui/inbound_modal.html
+++ b/web/html/xui/inbound_modal.html
@@ -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);
diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html
index 85321eded4..6133ee780a 100644
--- a/web/html/xui/inbounds.html
+++ b/web/html/xui/inbounds.html
@@ -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) {