From 5c12dcf95092f62eece0f519ea6d1c3bc94596d7 Mon Sep 17 00:00:00 2001 From: dbdbd9 Date: Mon, 28 Jul 2025 11:30:21 +0700 Subject: [PATCH] fix delete log --- public/css/style.css | 13 ++++++ public/dashboard.html | 97 ++++++++++++++++++++++++++++++++++--------- server.js | 53 ++++++++++++++++++----- 3 files changed, 134 insertions(+), 29 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index 265bfa6..3427f90 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -108,6 +108,10 @@ input[type="text"]:focus { margin-top: 32px; } +.command-section .log-block.soft-deleted { + background-color: #ffd2d2; +} + .command-section h3 { display: flex; justify-content: space-between; @@ -370,6 +374,15 @@ mark { text-align: center; } +.cancel-trash-btn { + font-size: 16px; + position: absolute; + right: 2px; + top: 2px; + padding: 8px; + text-align: center; +} + .remove-item-btn { font-size: 20px; right: 2px; diff --git a/public/dashboard.html b/public/dashboard.html index 96fbc43..8bfdb7d 100644 --- a/public/dashboard.html +++ b/public/dashboard.html @@ -115,7 +115,7 @@ - @@ -332,6 +332,9 @@ async function loadLogs(pid, version) { logSections.innerHTML = ""; logsCache[`${pid}_${version}`] = {}; + const currentVerUser = versionsUser.find( + (verItem) => verItem.version === version, + ); for (const cmd of commands) { const res = await fetch( @@ -359,8 +362,16 @@ -
- +
+ ${ + currentVerUser + ? "" + : data[0].is_deleted + ? `` + : `` + } ${data[0].filename}\n${data[0].output}
`; @@ -373,10 +384,27 @@ const curr = info.logs[info.index]; const logBlock = document.getElementById(`log-${cmd}`); - logBlock.innerHTML = ` - - ${curr.filename}\n${curr.output} - `; + logBlock.className = `log-block ${ + curr.is_deleted ? "soft-deleted" : "" + }`; + + const currentVerUser = versionsUser.find( + (verItem) => verItem.version === version, + ); + + if (!currentVerUser) { + if (curr.is_deleted) { + logBlock.innerHTML = ` + + ${curr.filename}\n${curr.output} + `; + } else { + logBlock.innerHTML = ` + + ${curr.filename}\n${curr.output} + `; + } + } document.getElementById( `page-info-${cmd}`, @@ -494,10 +522,15 @@ ${license}`.trim(); } - +