From 16e3107d23b4bc536d509c2dd832d10366fb895e Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Mon, 24 Apr 2023 15:07:11 +0330 Subject: Better client delete + api Co-Authored-By: Alireza Ahmadi --- web/html/xui/inbounds.html | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'web/html/xui') diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html index 5bfcaccd..6f13cd86 100644 --- a/web/html/xui/inbounds.html +++ b/web/html/xui/inbounds.html @@ -70,7 +70,7 @@ {{ i18n "pages.inbounds.export" }} {{ i18n "pages.inbounds.resetAllTraffic" }} - + row.id === dbInboundId); - newDbInbound = new DBInbound(dbInbound); - inbound = newDbInbound.toInbound(); - clients = this.getClients(dbInbound.protocol, inbound.settings); - index = this.findIndexOfClient(clients, client); - clients.splice(index, 1); - const data = { - id: dbInboundId, - settings: inbound.settings.toString(), - }; + clientId = dbInbound.protocol == "trojan" ? client.password : client.id; this.$confirm({ title: '{{ i18n "pages.inbounds.deleteInbound"}}', content: '{{ i18n "pages.inbounds.deleteInboundContent"}}', class: siderDrawer.isDarkTheme ? darkClass : '', okText: '{{ i18n "delete"}}', cancelText: '{{ i18n "cancel"}}', - onOk: () => this.submit('/xui/inbound/delClient/' + client.email, data), + onOk: () => this.submit(`/xui/inbound/${dbInboundId}/delClient/${clientId}`), }); }, getClients(protocol, clientSettings) { -- cgit v1.2.3