From 784e6e24e2bfffbd3a90ba3e57c7c540bcd468d8 Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Wed, 15 Feb 2023 12:33:34 +0100 Subject: [PATCH] Enhanced search --- web/html/xui/inbounds.html | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html index 2b93e5c0..5bd4c904 100644 --- a/web/html/xui/inbounds.html +++ b/web/html/xui/inbounds.html @@ -196,18 +196,18 @@ }]; const innerColumns = [ - { title: '', width: 50, scopedSlots: { customRender: 'actions' } }, + { title: '', width: 20, scopedSlots: { customRender: 'actions' } }, { title: '{{ i18n "pages.inbounds.client" }}', width: 80, scopedSlots: { customRender: 'client' } }, - { title: '{{ i18n "pages.inbounds.traffic" }}', width: 100, scopedSlots: { customRender: 'traffic' } }, - { title: '{{ i18n "pages.inbounds.expireDate" }}', width: 80, scopedSlots: { customRender: 'expiryTime' } }, + { title: '{{ i18n "pages.inbounds.traffic" }}↑|↓', width: 80, scopedSlots: { customRender: 'traffic' } }, + { title: '{{ i18n "pages.inbounds.expireDate" }}', width: 70, scopedSlots: { customRender: 'expiryTime' } }, { title: 'UID', width: 150, dataIndex: "id" }, ]; const innerTrojanColumns = [ - { title: '', width: 50, scopedSlots: { customRender: 'actions' } }, + { title: '', width: 20, scopedSlots: { customRender: 'actions' } }, { title: '{{ i18n "pages.inbounds.client" }}', width: 80, scopedSlots: { customRender: 'client' } }, - { title: '{{ i18n "pages.inbounds.traffic" }}', width: 100, scopedSlots: { customRender: 'traffic' } }, - { title: '{{ i18n "pages.inbounds.expireDate" }}', width: 80, scopedSlots: { customRender: 'expiryTime' } }, + { title: '{{ i18n "pages.inbounds.traffic" }}↑|↓', width: 80, scopedSlots: { customRender: 'traffic' } }, + { title: '{{ i18n "pages.inbounds.expireDate" }}', width: 70, scopedSlots: { customRender: 'expiryTime' } }, { title: 'Password', width: 150, dataIndex: "password" }, ]; @@ -257,7 +257,18 @@ this.searchedInbounds.splice(0, this.searchedInbounds.length); this.dbInbounds.forEach(inbound => { if (ObjectUtil.deepSearch(inbound, key)) { - this.searchedInbounds.push(inbound); + const newInbound = new DBInbound(inbound); + const inboundSettings = JSON.parse(inbound.settings); + if (inboundSettings.hasOwnProperty('clients')){ + const searchedSettings = { "clients": [] }; + inboundSettings.clients.forEach(client => { + if (ObjectUtil.deepSearch(client, key)){ + searchedSettings.clients.push(client); + } + }); + newInbound.settings = Inbound.Settings.fromJson(inbound.protocol, searchedSettings); + } + this.searchedInbounds.push(newInbound); } }); }