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
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
<script setup lang="ts">
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import { Head, Link, WhenVisible } from '@inertiajs/vue3';
|
||||
import { AppWindowIcon, GitBranchIcon, ServerIcon, ShieldCheckIcon, UserIcon } from 'lucide-vue-next';
|
||||
import { ref, watch } from 'vue';
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import AppLayout from "@/layouts/AppLayout.vue";
|
||||
import { Head, Link, WhenVisible } from "@inertiajs/vue3";
|
||||
import {
|
||||
AppWindowIcon,
|
||||
GitBranchIcon,
|
||||
ServerIcon,
|
||||
ShieldCheckIcon,
|
||||
UserIcon,
|
||||
} from "lucide-vue-next";
|
||||
import { ref, watch } from "vue";
|
||||
|
||||
defineProps({
|
||||
organisation: {
|
||||
@@ -26,15 +32,15 @@ defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
const tabValue = ref(new URL(window.location.href).hash?.replace('#', '') || 'dashboard');
|
||||
const tabValue = ref(new URL(window.location.href).hash?.replace("#", "") || "dashboard");
|
||||
watch(tabValue, () => {
|
||||
window.history.pushState({}, '', `#${tabValue.value}`);
|
||||
window.history.pushState({}, "", `#${tabValue.value}`);
|
||||
});
|
||||
watch(
|
||||
() => window.location.hash,
|
||||
(newHash) => {
|
||||
if (newHash) {
|
||||
tabValue.value = newHash.replace('#', '');
|
||||
tabValue.value = newHash.replace("#", "");
|
||||
}
|
||||
},
|
||||
);
|
||||
@@ -53,7 +59,9 @@ watch(
|
||||
</TabsList>
|
||||
<TabsContent value="dashboard">
|
||||
<h3 class="mt-4 text-2xl font-bold tracking-tight">Your Resources</h3>
|
||||
<p class="mb-4 text-sm text-muted-foreground">Your organisation, at a glance.</p>
|
||||
<p class="mb-4 text-sm text-muted-foreground">
|
||||
Your organisation, at a glance.
|
||||
</p>
|
||||
<div class="grid w-full gap-4 md:grid-cols-3">
|
||||
<Card class="relative">
|
||||
<Link
|
||||
@@ -63,12 +71,18 @@ watch(
|
||||
})
|
||||
"
|
||||
class="absolute inset-0"
|
||||
/>
|
||||
/>
|
||||
<CardContent class="flex items-center gap-4 p-4">
|
||||
<AppWindowIcon class="size-6 text-muted-foreground" />
|
||||
<div>
|
||||
<h4 class="mb-1 text-3xl font-medium leading-none">{{ organisation.applications_count }}</h4>
|
||||
<p class="text-sm text-muted-foreground">Application{{ organisation.applications_count === 1 ? '' : 's' }}</p>
|
||||
<h4 class="mb-1 text-3xl font-medium leading-none">
|
||||
{{ organisation.applications_count }}
|
||||
</h4>
|
||||
<p class="text-sm text-muted-foreground">
|
||||
Application{{
|
||||
organisation.applications_count === 1 ? "" : "s"
|
||||
}}
|
||||
</p>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
@@ -84,8 +98,12 @@ watch(
|
||||
<CardContent class="flex items-center gap-4 p-4">
|
||||
<ServerIcon class="size-6 text-muted-foreground" />
|
||||
<div>
|
||||
<h4 class="mb-1 text-3xl font-medium leading-none">{{ organisation.servers_count }}</h4>
|
||||
<p class="text-sm text-muted-foreground">Server{{ organisation.servers_count === 1 ? '' : 's' }}</p>
|
||||
<h4 class="mb-1 text-3xl font-medium leading-none">
|
||||
{{ organisation.servers_count }}
|
||||
</h4>
|
||||
<p class="text-sm text-muted-foreground">
|
||||
Server{{ organisation.servers_count === 1 ? "" : "s" }}
|
||||
</p>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
@@ -93,8 +111,12 @@ watch(
|
||||
<CardContent class="flex items-center gap-4 p-4">
|
||||
<UserIcon class="size-6 text-muted-foreground" />
|
||||
<div>
|
||||
<h4 class="mb-1 text-3xl font-medium leading-none">{{ organisation.members_count }}</h4>
|
||||
<p class="text-sm text-muted-foreground">Member{{ organisation.members_count === 1 ? '' : 's' }}</p>
|
||||
<h4 class="mb-1 text-3xl font-medium leading-none">
|
||||
{{ organisation.members_count }}
|
||||
</h4>
|
||||
<p class="text-sm text-muted-foreground">
|
||||
Member{{ organisation.members_count === 1 ? "" : "s" }}
|
||||
</p>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
@@ -116,13 +138,26 @@ watch(
|
||||
Add
|
||||
</Button>
|
||||
</div>
|
||||
<div class="border-muted-background divide-y-muted-background mb-6 max-w-96 divide-y rounded-md border">
|
||||
<div v-for="registry in registries" :key="registry.id" class="flex items-center gap-2 px-2 py-1">
|
||||
<div
|
||||
class="border-muted-background divide-y-muted-background mb-6 max-w-96 divide-y rounded-md border"
|
||||
>
|
||||
<div
|
||||
v-for="registry in registries"
|
||||
:key="registry.id"
|
||||
class="flex items-center gap-2 px-2 py-1"
|
||||
>
|
||||
<ShieldCheckIcon class="size-4 text-muted-foreground" />
|
||||
{{ registry.name }}
|
||||
<span class="ml-auto text-xs uppercase text-muted-foreground">{{ registry.type }}</span>
|
||||
<span class="ml-auto text-xs uppercase text-muted-foreground">{{
|
||||
registry.type
|
||||
}}</span>
|
||||
</div>
|
||||
<div
|
||||
v-if="!registries?.length"
|
||||
class="px-2 py-1 text-sm text-muted-foreground"
|
||||
>
|
||||
No registries configured
|
||||
</div>
|
||||
<div v-if="!registries?.length" class="px-2 py-1 text-sm text-muted-foreground">No registries configured</div>
|
||||
</div>
|
||||
</WhenVisible>
|
||||
<WhenVisible data="sourceProviders">
|
||||
@@ -141,13 +176,24 @@ watch(
|
||||
Add
|
||||
</Button>
|
||||
</div>
|
||||
<div class="border-muted-background divide-y-muted-background max-w-96 divide-y rounded-md border">
|
||||
<div v-for="sourceProvider in sourceProviders" :key="sourceProvider.id" class="flex items-center gap-2 px-2 py-1">
|
||||
<div
|
||||
class="border-muted-background divide-y-muted-background max-w-96 divide-y rounded-md border"
|
||||
>
|
||||
<div
|
||||
v-for="sourceProvider in sourceProviders"
|
||||
:key="sourceProvider.id"
|
||||
class="flex items-center gap-2 px-2 py-1"
|
||||
>
|
||||
<GitBranchIcon class="size-4 text-muted-foreground" />
|
||||
{{ sourceProvider.name }}
|
||||
<span class="ml-auto text-xs uppercase text-muted-foreground">{{ sourceProvider.type }}</span>
|
||||
<span class="ml-auto text-xs uppercase text-muted-foreground">{{
|
||||
sourceProvider.type
|
||||
}}</span>
|
||||
</div>
|
||||
<div v-if="!sourceProviders?.length" class="px-2 py-1 text-sm text-muted-foreground">
|
||||
<div
|
||||
v-if="!sourceProviders?.length"
|
||||
class="px-2 py-1 text-sm text-muted-foreground"
|
||||
>
|
||||
No source providers configured
|
||||
</div>
|
||||
</div>
|
||||
@@ -156,11 +202,20 @@ watch(
|
||||
<WhenVisible data="providers">
|
||||
<template #fallback> Loading... </template>
|
||||
<h3 class="mt-4 text-2xl font-bold tracking-tight">Server Providers</h3>
|
||||
<p class="mb-4 text-sm text-muted-foreground">Manage your server providers.</p>
|
||||
<div class="border-muted-background divide-y-muted-background max-w-80 divide-y rounded-md border">
|
||||
<div v-for="provider in providers" class="flex items-center gap-2 px-2 py-1">
|
||||
<p class="mb-4 text-sm text-muted-foreground">
|
||||
Manage your server providers.
|
||||
</p>
|
||||
<div
|
||||
class="border-muted-background divide-y-muted-background max-w-80 divide-y rounded-md border"
|
||||
>
|
||||
<div
|
||||
v-for="provider in providers"
|
||||
class="flex items-center gap-2 px-2 py-1"
|
||||
>
|
||||
{{ provider.name }}
|
||||
<span class="ml-auto text-xs uppercase text-muted-foreground">{{ provider.type }}</span>
|
||||
<span class="ml-auto text-xs uppercase text-muted-foreground">{{
|
||||
provider.type
|
||||
}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</WhenVisible>
|
||||
|
||||
Reference in New Issue
Block a user