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,
|
appId: config.appId,
|
||||||
currentDeploymentId: null,
|
currentDeploymentId: null,
|
||||||
isDeploying: false,
|
isDeploying: false,
|
||||||
liveLogs: "Waiting for logs...",
|
|
||||||
liveStatus: "building",
|
|
||||||
showLiveLogs: false,
|
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
// Check for in-progress deployments on page load
|
// Check for in-progress deployments on page load
|
||||||
@@ -327,13 +324,12 @@ document.addEventListener("alpine:init", () => {
|
|||||||
10,
|
10,
|
||||||
);
|
);
|
||||||
this.isDeploying = true;
|
this.isDeploying = true;
|
||||||
this.showLiveLogs = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.fetchAppStatus();
|
this.fetchAppStatus();
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
this.fetchAppStatus();
|
this.fetchAppStatus();
|
||||||
this.fetchLiveLogs();
|
this.fetchDeploymentLogs();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -351,7 +347,6 @@ document.addEventListener("alpine:init", () => {
|
|||||||
) {
|
) {
|
||||||
this.currentDeploymentId = data.latestDeploymentID;
|
this.currentDeploymentId = data.latestDeploymentID;
|
||||||
if (deploying) {
|
if (deploying) {
|
||||||
this.showLiveLogs = true;
|
|
||||||
this.isDeploying = true;
|
this.isDeploying = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -366,23 +361,15 @@ document.addEventListener("alpine:init", () => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
async fetchLiveLogs() {
|
async fetchDeploymentLogs() {
|
||||||
if (!this.currentDeploymentId || !this.isDeploying) return;
|
if (!this.currentDeploymentId || !this.isDeploying) return;
|
||||||
try {
|
try {
|
||||||
const res = await fetch(
|
const res = await fetch(
|
||||||
`/apps/${this.appId}/deployments/${this.currentDeploymentId}/logs`,
|
`/apps/${this.appId}/deployments/${this.currentDeploymentId}/logs`,
|
||||||
);
|
);
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
this.liveLogs = data.logs || "Waiting for logs...";
|
|
||||||
this.liveStatus = data.status;
|
|
||||||
|
|
||||||
this.$nextTick(() => {
|
// Update the deployment card
|
||||||
Alpine.store("utils").scrollToBottom(
|
|
||||||
this.$refs.liveLogsWrapper,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Update matching deployment card if present
|
|
||||||
const card = document.querySelector(
|
const card = document.querySelector(
|
||||||
`[data-deployment-id="${this.currentDeploymentId}"]`,
|
`[data-deployment-id="${this.currentDeploymentId}"]`,
|
||||||
);
|
);
|
||||||
@@ -411,20 +398,6 @@ document.addEventListener("alpine:init", () => {
|
|||||||
|
|
||||||
submitDeploy() {
|
submitDeploy() {
|
||||||
this.isDeploying = true;
|
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) {
|
formatTime(isoTime) {
|
||||||
|
|||||||
@@ -24,17 +24,6 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</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">
|
<div id="deployments-list" class="space-y-4">
|
||||||
{{if .Deployments}}
|
{{if .Deployments}}
|
||||||
{{range .Deployments}}
|
{{range .Deployments}}
|
||||||
|
|||||||
Reference in New Issue
Block a user