Files
keystone/resources/js/pages/services/Show.vue
Harry Bayliss 66f0ee9e50
All checks were successful
CI / Tests (push) Successful in 43s
CI / Lint (push) Successful in 1m3s
Migrate to Gitea, switch JS tooling to oxlint/oxfmt, lift test coverage to 95%
- Add .gitea/workflows/ci.yml ported from lifeos (lint + tests with coverage gate)
- Set up phpstan (larastan + peststan, baseline at level max)
- Replace eslint/prettier with oxlint/oxfmt; reformat resources/
- Add composer phpstan/coverage/quality scripts; restore --min=95 coverage gate
- Exclude integration plumbing (Saloon Hetzner classes, SSH wrappers, console
  commands, DTOs) from coverage to keep the gate focused on business logic
- Add ~12 new test files covering models, drivers, controllers, jobs, auth
  flows, request validators, and the IP CIDR helper
- Fix Support\Ip::inNetwork PHP 8.4 TypeError in CIDR mask check
- Fix FirewallRule::command comparing the enum-cast type column to a string
- Fix Server::network using the wrong foreign key column
- Remove unreachable code under abort(403) in RegisteredUserController
2026-05-13 16:51:07 +01:00

121 lines
4.7 KiB
Vue

<script setup>
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";
const props = defineProps({
server: { type: Object, required: true },
service: { type: Object, required: true },
});
</script>
<template>
<Head :title="service.name" />
<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,
}),
},
{ title: service.name },
]"
>
<div class="flex h-full flex-1 flex-col gap-4 p-4">
<div class="flex flex-wrap items-center justify-between gap-3">
<div>
<div class="flex items-center gap-2">
<h2 class="text-3xl font-bold tracking-tight">{{ service.name }}</h2>
<Badge variant="outline">{{ service.type }}</Badge>
</div>
<p class="mt-1 text-sm text-muted-foreground">
{{ service.category }} · {{ service.version }}
</p>
</div>
<Button
:as="Link"
variant="secondary"
:href="
route('services.edit', {
organisation: $page.props.organisation.id,
server: server.id,
service: service.id,
})
"
>
<PencilIcon class="size-4" />
Edit
</Button>
</div>
<div class="grid gap-4 lg:grid-cols-3">
<Card>
<CardHeader>
<CardTitle>Replicas</CardTitle>
<CardDescription>Desired: {{ service.desired_replicas }}</CardDescription>
</CardHeader>
<CardContent class="grid gap-2">
<div
v-for="replica in service.replicas"
:key="replica.id"
class="rounded-md border p-3 text-sm"
>
<div class="font-medium">{{ replica.container_name }}</div>
<div class="text-muted-foreground">
{{ replica.status }} · {{ replica.health_status }}
</div>
</div>
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle>Slices</CardTitle>
</CardHeader>
<CardContent class="grid gap-2">
<div
v-for="slice in service.slices"
:key="slice.id"
class="rounded-md border p-3 text-sm"
>
<div class="font-medium">{{ slice.name }}</div>
<div class="text-muted-foreground">{{ slice.type }}</div>
</div>
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle>Operations</CardTitle>
</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"
>
<span>{{ operation.kind.replace("_", " ") }}</span>
<Badge
:variant="
operation.status === 'completed' ? 'success' : 'secondary'
"
>{{ operation.status.replace("_", " ") }}</Badge
>
</div>
</CardContent>
</Card>
</div>
</div>
</AppLayout>
</template>