Remove separate live logs section, update logs in deployment card
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -24,17 +24,6 @@
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Live Build Logs (shown during active deployment) -->
|
||||
<div class="card p-6 mb-4" x-show="showLiveLogs" x-cloak>
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<h2 class="section-title">Live Build Logs</h2>
|
||||
<span x-bind:class="liveStatusBadgeClass" x-text="liveStatusLabel"></span>
|
||||
</div>
|
||||
<div x-ref="liveLogsWrapper" class="bg-gray-900 rounded-lg p-4 overflow-auto" style="max-height: 400px;">
|
||||
<pre class="text-gray-100 text-xs font-mono whitespace-pre-wrap" x-text="liveLogs"></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="deployments-list" class="space-y-4">
|
||||
{{if .Deployments}}
|
||||
{{range .Deployments}}
|
||||
|
||||
Reference in New Issue
Block a user