Skip to content

Commit 735db57

Browse files
feat: show compose runtime status
1 parent d1c6ec3 commit 735db57

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

web/src/views/ApplicationDetail.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ const dockerfilePath = ref("Dockerfile");
7373
const buildContext = ref(".");
7474
const variables = ref<Variable[]>([]);
7575
const detectedVariables = ref<NonNullable<Validation["summary"]["environment_variables"]>>([]);
76+
const runtime = ref<{ mode: string; status: string; services: Array<{ name: string; image: string; desired: number; running: number; failed: number }> } | null>(null);
7677
const sourceTypes = [
7778
{ value: "compose", label: "Docker Compose" },
7879
{ value: "image", label: "Imagem Docker" },
@@ -99,6 +100,7 @@ async function load() {
99100
);
100101
detectedVariables.value = application.value.source_summary?.environment_variables || [];
101102
await loadSource();
103+
runtime.value = await api<typeof runtime.value>(`/api/v1/applications/${route.params.applicationId}/runtime`);
102104
} catch (err) {
103105
error.value =
104106
err instanceof Error
@@ -377,6 +379,12 @@ onMounted(load);
377379
detectados.
378380
</p>
379381
</article>
382+
<article v-if="sourceType === 'compose' && runtime" class="panel full-width">
383+
<p class="label">PUBLICAÇÃO</p>
384+
<h2>{{ runtime.status === "running" ? "Aplicação em execução" : "Ainda não publicada" }}</h2>
385+
<p class="muted">Modo: {{ runtime.mode === "swarm" ? "Docker Swarm" : "Docker em servidor único" }}</p>
386+
<div v-if="runtime.services.length" class="summary-grid compact"><div v-for="service in runtime.services" :key="service.name"><span>{{ service.name }}</span><strong>{{ service.running }}/{{ service.desired }}</strong><small>{{ service.image }}</small></div></div>
387+
</article>
380388
</section>
381389
<section v-else-if="tab === 'source'" class="source-editor">
382390
<div class="section-head">

0 commit comments

Comments
 (0)