wowowowowo
Some checks failed
CI / Lint (push) Failing after 22s
CI / Tests (push) Failing after 33s

This commit is contained in:
2026-05-28 15:15:41 +01:00
parent 8f603122e2
commit 5b977c1f41
129 changed files with 9943 additions and 722 deletions

View File

@@ -1,15 +1,18 @@
<script setup>
<script setup lang="ts">
import OperationTimeline from "@/components/operations/OperationTimeline.vue";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import AppLayout from "@/layouts/AppLayout.vue";
import { Head, Link } from "@inertiajs/vue3";
import { PencilIcon } from "lucide-vue-next";
import { PencilIcon, PlusIcon } from "lucide-vue-next";
const props = defineProps({
server: { type: Object, required: true },
service: { type: Object, required: true },
});
defineProps<{
server?: Record<string, any> | null;
service: Record<string, any>;
environment?: Record<string, any> | null;
application?: Record<string, any> | null;
}>();
</script>
<template>
@@ -17,17 +20,41 @@ const props = defineProps({
<AppLayout
:breadcrumbs="[
{
title: 'Servers',
href: route('servers.index', { organisation: $page.props.organisation.id }),
},
{
title: server.name,
href: route('servers.show', {
organisation: $page.props.organisation.id,
server: server.id,
}),
},
...(application && environment
? [
{
title: 'Applications',
href: route('applications.index', { organisation: $page.props.organisation.id }),
},
{
title: application.name,
href: route('applications.show', {
organisation: $page.props.organisation.id,
application: application.id,
}),
},
{
title: environment.name,
href: route('environments.show', {
organisation: $page.props.organisation.id,
application: application.id,
environment: environment.id,
}),
},
]
: [
{
title: 'Servers',
href: route('servers.index', { organisation: $page.props.organisation.id }),
},
{
title: server?.name ?? 'Server',
href: route('servers.show', {
organisation: $page.props.organisation.id,
server: server?.id,
}),
},
]),
{ title: service.name },
]"
>
@@ -43,6 +70,7 @@ const props = defineProps({
</p>
</div>
<Button
v-if="server"
:as="Link"
variant="secondary"
:href="
@@ -70,7 +98,21 @@ const props = defineProps({
:key="replica.id"
class="rounded-md border p-3 text-sm"
>
<div class="font-medium">{{ replica.container_name }}</div>
<Link
v-if="server"
:href="
route('service-replicas.show', {
organisation: $page.props.organisation.id,
server: server?.id,
service: service.id,
replica: replica.id,
})
"
class="font-medium hover:underline"
>
{{ replica.container_name }}
</Link>
<div v-else class="font-medium">{{ replica.container_name }}</div>
<div class="text-muted-foreground">
{{ replica.status }} · {{ replica.health_status }}
</div>
@@ -80,7 +122,40 @@ const props = defineProps({
<Card>
<CardHeader>
<CardTitle>Slices</CardTitle>
<div class="flex items-center justify-between gap-3">
<CardTitle>Slices</CardTitle>
<div v-if="server" class="flex items-center gap-2">
<Button
:as="Link"
size="xs"
variant="ghost"
:href="
route('service-slices.index', {
organisation: $page.props.organisation.id,
server: server?.id,
service: service.id,
})
"
>
View all
</Button>
<Button
:as="Link"
size="xs"
variant="secondary"
:href="
route('service-slices.create', {
organisation: $page.props.organisation.id,
server: server?.id,
service: service.id,
})
"
>
<PlusIcon class="size-4" />
Add
</Button>
</div>
</div>
</CardHeader>
<CardContent class="grid gap-2">
<div
@@ -88,7 +163,21 @@ const props = defineProps({
:key="slice.id"
class="rounded-md border p-3 text-sm"
>
<div class="font-medium">{{ slice.name }}</div>
<Link
v-if="server"
:href="
route('service-slices.show', {
organisation: $page.props.organisation.id,
server: server?.id,
service: service.id,
slice: slice.id,
})
"
class="font-medium hover:underline"
>
{{ slice.name }}
</Link>
<div v-else class="font-medium">{{ slice.name }}</div>
<div class="text-muted-foreground">{{ slice.type }}</div>
</div>
</CardContent>
@@ -98,20 +187,58 @@ const props = defineProps({
<CardHeader>
<CardTitle>Operations</CardTitle>
</CardHeader>
<CardContent>
<OperationTimeline :operations="service.operations" />
</CardContent>
</Card>
</div>
<div class="grid gap-4 lg:grid-cols-2">
<Card>
<CardHeader>
<CardTitle>Endpoints</CardTitle>
<CardDescription>Network endpoints registered for this service.</CardDescription>
</CardHeader>
<CardContent class="grid gap-2">
<div
v-for="operation in service.operations"
:key="operation.id"
class="flex items-center justify-between rounded-md border p-3 text-sm"
v-for="endpoint in service.endpoints"
:key="endpoint.id"
class="rounded-md border p-3 text-sm"
>
<span>{{ operation.kind.replace("_", " ") }}</span>
<Badge
:variant="
operation.status === 'completed' ? 'success' : 'secondary'
"
>{{ operation.status.replace("_", " ") }}</Badge
>
<div class="font-medium">
{{ endpoint.scope }} · {{ endpoint.hostname }}:{{ endpoint.port }}
</div>
<div class="text-muted-foreground">
{{ endpoint.ip_address ?? "no IP" }} · priority
{{ endpoint.priority }} · {{ endpoint.health_status }}
</div>
</div>
<div
v-if="service.endpoints.length === 0"
class="rounded-md border border-dashed p-3 text-sm text-muted-foreground"
>
No endpoints registered.
</div>
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle>Compose</CardTitle>
<CardDescription>Generated artifact location on the target server.</CardDescription>
</CardHeader>
<CardContent>
<pre class="overflow-x-auto rounded-md bg-muted p-3 text-xs">/home/keystone/services/{{ service.id }}/compose.yml</pre>
</CardContent>
</Card>
<Card v-if="service.type === 'caddy'">
<CardHeader>
<CardTitle>Caddyfile</CardTitle>
<CardDescription>Gateway route configuration generated on the server.</CardDescription>
</CardHeader>
<CardContent>
<pre class="overflow-x-auto rounded-md bg-muted p-3 text-xs">/home/keystone/gateway/Caddyfile</pre>
</CardContent>
</Card>
</div>