mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-10-27 18:32:52 +00:00
Compare commits
2 commits
e1d5fce55b
...
4b79ab9487
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b79ab9487 | ||
|
|
f0a32f207d |
1 changed files with 10 additions and 3 deletions
|
|
@ -676,7 +676,9 @@
|
||||||
|
|
||||||
const parts = log.split(' ');
|
const parts = log.split(' ');
|
||||||
|
|
||||||
if(parts.length >= 10) {
|
let logEntryCutoffIndex = 1;
|
||||||
|
|
||||||
|
if (parts.length >= 10) {
|
||||||
const dateTime = `<b>${parts[0]} ${parts[1]}</b>`;
|
const dateTime = `<b>${parts[0]} ${parts[1]}</b>`;
|
||||||
const from = `<b>${parts[3]}</b>`;
|
const from = `<b>${parts[3]}</b>`;
|
||||||
const to = `<b>${parts[5].replace(/^\/+/, "")}</b>`;
|
const to = `<b>${parts[5].replace(/^\/+/, "")}</b>`;
|
||||||
|
|
@ -684,9 +686,14 @@
|
||||||
let outboundColor = '';
|
let outboundColor = '';
|
||||||
if (parts[parts.length - 1] === "b") {
|
if (parts[parts.length - 1] === "b") {
|
||||||
outboundColor = ' style="color: #e04141;"'; //red for blocked
|
outboundColor = ' style="color: #e04141;"'; //red for blocked
|
||||||
|
logEntryCutoffIndex = 2;
|
||||||
}
|
}
|
||||||
else if (parts[parts.length - 1] === "p") {
|
else if (parts[parts.length - 1] === "p") {
|
||||||
outboundColor = ' style="color: #3c89e8;"'; //blue for proxies
|
outboundColor = ' style="color: #3c89e8;"'; //blue for proxies
|
||||||
|
logEntryCutoffIndex = 2;
|
||||||
|
}
|
||||||
|
else if (parts[parts.length - 1] === "f") {
|
||||||
|
logEntryCutoffIndex = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
formattedLogs += `<span${outboundColor}>
|
formattedLogs += `<span${outboundColor}>
|
||||||
|
|
@ -695,10 +702,10 @@ ${dateTime}
|
||||||
${from}
|
${from}
|
||||||
${parts[4]}
|
${parts[4]}
|
||||||
${to}
|
${to}
|
||||||
${parts.slice(6, parts.length - 2).join(' ')}
|
${parts.slice(6, parts.length - logEntryCutoffIndex).join(' ')}
|
||||||
</span>`;
|
</span>`;
|
||||||
} else {
|
} else {
|
||||||
formattedLogs += `<span>${parts.slice(0, parts.length - 2).join(' ')}</span>`;
|
formattedLogs += `<span>${parts.slice(0, parts.length - logEntryCutoffIndex).join(' ')}</span>`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue