Skip to content

Commit 91b140f

Browse files
committed
refactor: enhance deploy tracking layout and fix logging duplicate loops
1 parent 902f8bf commit 91b140f

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/mcp/apps/deploy/mcp-app.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,7 @@ <h3>Services to Deploy</h3>
245245

246246
<div id="progress-container" class="progress-section">
247247
<h3>Deployment Progress</h3>
248-
<div class="progress-bar-container">
249-
<div id="progress-bar" class="progress-bar"></div>
250-
</div>
248+
<progress id="progress-bar" max="100" value="0" style="width: 100%;"></progress>
251249
<div id="status-list" class="status-list">
252250
<!-- Logs go here -->
253251
</div>

src/mcp/apps/deploy/mcp-app.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ function addLog(message: string, type: "info" | "success" | "error" = "info"): v
1717
}
1818

1919
function updateProgress(percentage: number): void {
20-
progressBar.style.width = `${percentage}%`;
20+
progressBar.value = percentage;
2121
}
2222

2323
function pollStatus(jobId: string): void {
24+
let loggedCount = 0;
2425
// eslint-disable-next-line @typescript-eslint/no-misused-promises
2526
const interval = setInterval(async () => {
2627
try {
@@ -41,9 +42,10 @@ function pollStatus(jobId: string): void {
4142
if (job) {
4243
updateProgress(job.progress);
4344

44-
// Clear and redraw logs to avoid duplication if we are reading full history
45-
statusList.innerHTML = "";
46-
job.logs.forEach((log: string) => addLog(log));
45+
// Incrementally draw new logs only
46+
const newLogs = job.logs.slice(loggedCount);
47+
newLogs.forEach((log: string) => addLog(log));
48+
loggedCount = job.logs.length;
4749

4850
if (job.status === "success") {
4951
addLog("Deployment completed successfully!", "success");

0 commit comments

Comments
 (0)