From 88fc4f81d452d8513169a2efd75553aa0ad64743 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Wed, 17 May 2023 15:57:47 +0330 Subject: [feature] filter inbound clients Co-Authored-By: Alireza Ahmadi --- web/html/xui/inbounds.html | 56 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 52 insertions(+), 4 deletions(-) (limited to 'web/html/xui/inbounds.html') diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html index f11d5a79..6fdf0c43 100644 --- a/web/html/xui/inbounds.html +++ b/web/html/xui/inbounds.html @@ -105,7 +105,17 @@ - + + + {{ i18n "none" }} + {{ i18n "disabled" }} + {{ i18n "depleted" }} + {{ i18n "depletingSoon" }} + + + { + const newInbound = new DBInbound(inbound); + const inboundSettings = JSON.parse(inbound.settings); + if (this.clientCount[inbound.id] && this.clientCount[inbound.id].hasOwnProperty(this.filterBy)){ + const list = this.clientCount[inbound.id][this.filterBy]; + if (list.length > 0) { + const filteredSettings = { "clients": [] }; + inboundSettings.clients.forEach(client => { + if (list.includes(client.email)) { + filteredSettings.clients.push(client); + } + }); + newInbound.settings = Inbound.Settings.fromJson(inbound.protocol, filteredSettings); + this.searchedInbounds.push(newInbound); + } + } + }); + } + }, + toggleFilter(){ + if(this.enableFilter) { + this.searchKey = ''; + } else { + this.filterBy = ''; + this.searchedInbounds = this.dbInbounds.slice(); + } + }, generalActions(action) { switch (action.key) { case "export": -- cgit v1.2.3