From 419ea63dd0f7f2a693dbf674e411782301e06dc6 Mon Sep 17 00:00:00 2001 From: fgsfds <4870330+fgsfds@users.noreply.github.com> Date: Tue, 5 Aug 2025 15:10:14 +0500 Subject: Added filters to the xray logs viewer (#3314) * added filters to xray logs viewer * better freedom/blackhole tags handling * better freedom/blackhole tags handling 2 * fix comments * fix comments 2 --- web/html/index.html | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'web/html/index.html') diff --git a/web/html/index.html b/web/html/index.html index 4089e6a6..bc5483b0 100644 --- a/web/html/index.html +++ b/web/html/index.html @@ -457,6 +457,14 @@ + + + + + Direct + Blocked + Proxy + @@ -651,6 +659,9 @@ visible: false, logs: [], rows: 20, + showDirect: true, + showBlocked: true, + showProxy: true, loading: false, show(logs) { this.visible = true; @@ -665,17 +676,17 @@ const parts = log.split(' '); - if(parts.length === 9) { + if(parts.length === 10) { const dateTime = `${parts[0]} ${parts[1]}`; const from = `${parts[3]}`; const to = `${parts[5].replace(/^\/+/, "")}`; let outboundColor = ''; - if (parts[8].startsWith('blocked')) { - outboundColor = ' style="color: #e04141;"'; + if (parts[9] === "b") { + outboundColor = ' style="color: #e04141;"'; //red for blocked } - else if (!parts[8].startsWith('direct')) { - outboundColor = ' style="color: #3c89e8;"'; + else if (parts[9] === "p") { + outboundColor = ' style="color: #3c89e8;"'; //blue for proxies } formattedLogs += ` @@ -684,10 +695,10 @@ ${dateTime} ${from} ${parts[4]} ${to} - ${parts.slice(6).join(' ')} + ${parts.slice(6, 9).join(' ')} `; } else { - formattedLogs += `${parts.join(' ')}`; + formattedLogs += `${log}`; } }); @@ -817,7 +828,7 @@ ${dateTime} }, async openXrayLogs(){ xraylogModal.loading = true; - const msg = await HttpUtil.post('server/xraylogs/'+xraylogModal.rows); + const msg = await HttpUtil.post('server/xraylogs/'+xraylogModal.rows,{filter: xraylogModal.filter, showDirect: xraylogModal.showDirect, showBlocked: xraylogModal.showBlocked, showProxy: xraylogModal.showProxy}); if (!msg.success) { return; } -- cgit v1.2.3