Remove separate live logs section, update logs in deployment card

This commit is contained in:
2025-12-31 15:06:35 -08:00
parent a2539ebf3a
commit 4cd12d717c
2 changed files with 3 additions and 41 deletions

View File

@@ -312,9 +312,6 @@ document.addEventListener("alpine:init", () => {
appId: config.appId,
currentDeploymentId: null,
isDeploying: false,
liveLogs: "Waiting for logs...",
liveStatus: "building",
showLiveLogs: false,
init() {
// Check for in-progress deployments on page load
@@ -327,13 +324,12 @@ document.addEventListener("alpine:init", () => {
10,
);
this.isDeploying = true;
this.showLiveLogs = true;
}
this.fetchAppStatus();
setInterval(() => {
this.fetchAppStatus();
this.fetchLiveLogs();
this.fetchDeploymentLogs();
}, 1000);
},
@@ -351,7 +347,6 @@ document.addEventListener("alpine:init", () => {
) {
this.currentDeploymentId = data.latestDeploymentID;
if (deploying) {
this.showLiveLogs = true;
this.isDeploying = true;
}
}
@@ -366,23 +361,15 @@ document.addEventListener("alpine:init", () => {
}
},
async fetchLiveLogs() {
async fetchDeploymentLogs() {
if (!this.currentDeploymentId || !this.isDeploying) return;
try {
const res = await fetch(
`/apps/${this.appId}/deployments/${this.currentDeploymentId}/logs`,
);
const data = await res.json();
this.liveLogs = data.logs || "Waiting for logs...";
this.liveStatus = data.status;
this.$nextTick(() => {
Alpine.store("utils").scrollToBottom(
this.$refs.liveLogsWrapper,
);
});
// Update matching deployment card if present
// Update the deployment card
const card = document.querySelector(
`[data-deployment-id="${this.currentDeploymentId}"]`,
);
@@ -411,20 +398,6 @@ document.addEventListener("alpine:init", () => {
submitDeploy() {
this.isDeploying = true;
this.showLiveLogs = true;
this.liveLogs = "Starting deployment...";
this.liveStatus = "building";
},
get liveStatusBadgeClass() {
return (
Alpine.store("utils").statusBadgeClass(this.liveStatus) +
" text-xs"
);
},
get liveStatusLabel() {
return Alpine.store("utils").statusLabel(this.liveStatus);
},
formatTime(isoTime) {