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,11 @@
|
||||
<script setup>
|
||||
import InputError from '@/components/InputError.vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import { Head, useForm } from '@inertiajs/vue3';
|
||||
import { computed, watch } from 'vue';
|
||||
import InputError from "@/components/InputError.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import AppLayout from "@/layouts/AppLayout.vue";
|
||||
import { Head, useForm } from "@inertiajs/vue3";
|
||||
import { computed, watch } from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
application: {
|
||||
@@ -28,38 +28,42 @@ const props = defineProps({
|
||||
|
||||
const form = useForm({
|
||||
service_id: props.services[0]?.id ?? null,
|
||||
role: 'database',
|
||||
name: '',
|
||||
env_prefix: '',
|
||||
role: "database",
|
||||
name: "",
|
||||
env_prefix: "",
|
||||
is_primary: true,
|
||||
});
|
||||
|
||||
const compatibleServices = computed(() => {
|
||||
const roleTypes = {
|
||||
database: ['postgres'],
|
||||
cache: ['valkey'],
|
||||
queue: ['valkey'],
|
||||
gateway: ['caddy'],
|
||||
database: ["postgres"],
|
||||
cache: ["valkey"],
|
||||
queue: ["valkey"],
|
||||
gateway: ["caddy"],
|
||||
};
|
||||
|
||||
return props.services.filter((service) => (roleTypes[form.role] ?? props.services.map((item) => item.type)).includes(service.type));
|
||||
return props.services.filter((service) =>
|
||||
(roleTypes[form.role] ?? props.services.map((item) => item.type)).includes(service.type),
|
||||
);
|
||||
});
|
||||
|
||||
const selectedService = computed(() => props.services.find((service) => service.id === form.service_id));
|
||||
const selectedService = computed(() =>
|
||||
props.services.find((service) => service.id === form.service_id),
|
||||
);
|
||||
const generatedSliceType = computed(() => {
|
||||
if (selectedService.value?.type === 'postgres') {
|
||||
return 'database user';
|
||||
if (selectedService.value?.type === "postgres") {
|
||||
return "database user";
|
||||
}
|
||||
|
||||
if (selectedService.value?.type === 'valkey') {
|
||||
return 'logical database';
|
||||
if (selectedService.value?.type === "valkey") {
|
||||
return "logical database";
|
||||
}
|
||||
|
||||
if (selectedService.value?.type === 'caddy') {
|
||||
return 'route';
|
||||
if (selectedService.value?.type === "caddy") {
|
||||
return "route";
|
||||
}
|
||||
|
||||
return 'service link';
|
||||
return "service link";
|
||||
});
|
||||
|
||||
watch(
|
||||
@@ -114,8 +118,16 @@ watch(
|
||||
|
||||
<div class="grid gap-2">
|
||||
<Label for="service_id">Service</Label>
|
||||
<select id="service_id" v-model="form.service_id" class="h-9 rounded-md border border-input bg-transparent px-3 text-sm">
|
||||
<option v-for="service in compatibleServices" :key="service.id" :value="service.id">
|
||||
<select
|
||||
id="service_id"
|
||||
v-model="form.service_id"
|
||||
class="h-9 rounded-md border border-input bg-transparent px-3 text-sm"
|
||||
>
|
||||
<option
|
||||
v-for="service in compatibleServices"
|
||||
:key="service.id"
|
||||
:value="service.id"
|
||||
>
|
||||
{{ service.name }} · {{ service.type }}
|
||||
</option>
|
||||
</select>
|
||||
@@ -124,14 +136,21 @@ watch(
|
||||
|
||||
<div class="rounded-md border bg-muted/30 p-3 text-sm">
|
||||
<div class="font-medium">Generated {{ generatedSliceType }}</div>
|
||||
<div class="mt-1 text-muted-foreground">{{ selectedService?.name ?? 'No compatible service' }} · {{ form.role.replace('_', ' ') }}</div>
|
||||
<div class="mt-1 text-muted-foreground">
|
||||
{{ selectedService?.name ?? "No compatible service" }} ·
|
||||
{{ form.role.replace("_", " ") }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid gap-2">
|
||||
<Label for="role">Role</Label>
|
||||
<select id="role" v-model="form.role" class="h-9 rounded-md border border-input bg-transparent px-3 text-sm">
|
||||
<select
|
||||
id="role"
|
||||
v-model="form.role"
|
||||
class="h-9 rounded-md border border-input bg-transparent px-3 text-sm"
|
||||
>
|
||||
<option v-for="role in roles" :key="role" :value="role">
|
||||
{{ role.replace('_', ' ') }}
|
||||
{{ role.replace("_", " ") }}
|
||||
</option>
|
||||
</select>
|
||||
<InputError :message="form.errors.role" />
|
||||
@@ -140,13 +159,23 @@ watch(
|
||||
<div class="grid gap-4 md:grid-cols-2">
|
||||
<div class="grid gap-2">
|
||||
<Label for="name">Slice name</Label>
|
||||
<Input id="name" v-model="form.name" type="text" placeholder="billing_api_production" />
|
||||
<Input
|
||||
id="name"
|
||||
v-model="form.name"
|
||||
type="text"
|
||||
placeholder="billing_api_production"
|
||||
/>
|
||||
<InputError :message="form.errors.name" />
|
||||
</div>
|
||||
|
||||
<div class="grid gap-2">
|
||||
<Label for="env_prefix">Env prefix</Label>
|
||||
<Input id="env_prefix" v-model="form.env_prefix" type="text" placeholder="READONLY" />
|
||||
<Input
|
||||
id="env_prefix"
|
||||
v-model="form.env_prefix"
|
||||
type="text"
|
||||
placeholder="READONLY"
|
||||
/>
|
||||
<InputError :message="form.errors.env_prefix" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -157,7 +186,9 @@ watch(
|
||||
</label>
|
||||
|
||||
<div class="flex items-center justify-end">
|
||||
<Button type="submit" :disabled="form.processing || !services.length">Attach</Button>
|
||||
<Button type="submit" :disabled="form.processing || !services.length"
|
||||
>Attach</Button
|
||||
>
|
||||
</div>
|
||||
</form>
|
||||
</AppLayout>
|
||||
|
||||
Reference in New Issue
Block a user