Rework the dashboard, environment topology view, header navigation, and status rendering, and standardise selects on a shadcn-vue component. Replace the thin database seeder with a SimulatedEnvironmentSeeder that builds a fully wired, mostly-running organisation (ACTIVE server fleet, managed + GHCR registries, Gitea source provider, ClipBin app with production/staging environments, services, slices, endpoints, managed variables, build artifacts, and a completed/in-progress/failed operations history) so the new UI renders against realistic data.
120 lines
4.0 KiB
Vue
120 lines
4.0 KiB
Vue
<script setup lang="ts">
|
|
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 {
|
|
Select,
|
|
SelectContent,
|
|
SelectItem,
|
|
SelectTrigger,
|
|
SelectValue,
|
|
} from "@/components/ui/select";
|
|
import AppLayout from "@/layouts/AppLayout.vue";
|
|
import { Head, useForm } from "@inertiajs/vue3";
|
|
|
|
defineProps<{
|
|
server: Record<string, any>;
|
|
service: Record<string, any>;
|
|
environments: Record<string, any>[];
|
|
}>();
|
|
|
|
const form = useForm({
|
|
name: "",
|
|
type: "manual",
|
|
environment_id: "",
|
|
status: "pending",
|
|
config: "{}",
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<Head title="Create Slice" />
|
|
|
|
<AppLayout
|
|
:breadcrumbs="[
|
|
{
|
|
title: service.name,
|
|
href: route('services.show', {
|
|
organisation: $page.props.organisation.id,
|
|
server: server.id,
|
|
service: service.id,
|
|
}),
|
|
},
|
|
{ title: 'Create Slice' },
|
|
]"
|
|
>
|
|
<form
|
|
class="flex h-full max-w-2xl flex-1 flex-col gap-5 p-4"
|
|
@submit.prevent="
|
|
form.post(
|
|
route('service-slices.store', {
|
|
organisation: $page.props.organisation.id,
|
|
server: server.id,
|
|
service: service.id,
|
|
}),
|
|
)
|
|
"
|
|
>
|
|
<div>
|
|
<h2 class="text-3xl font-bold tracking-tight">Create Slice</h2>
|
|
<p class="mt-1 text-sm text-muted-foreground">
|
|
Advanced manual slice creation for service-level resources.
|
|
</p>
|
|
</div>
|
|
|
|
<div class="grid gap-2">
|
|
<Label for="name">Name</Label>
|
|
<Input id="name" v-model="form.name" required />
|
|
<InputError :message="form.errors.name" />
|
|
</div>
|
|
|
|
<div class="grid gap-4 md:grid-cols-2">
|
|
<div class="grid gap-2">
|
|
<Label for="type">Type</Label>
|
|
<Input id="type" v-model="form.type" required />
|
|
<InputError :message="form.errors.type" />
|
|
</div>
|
|
<div class="grid gap-2">
|
|
<Label for="status">Status</Label>
|
|
<Input id="status" v-model="form.status" required />
|
|
<InputError :message="form.errors.status" />
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid gap-2">
|
|
<Label for="environment_id">Environment</Label>
|
|
<Select v-model="form.environment_id">
|
|
<SelectTrigger id="environment_id">
|
|
<SelectValue placeholder="Service-level" />
|
|
</SelectTrigger>
|
|
<SelectContent>
|
|
<SelectItem
|
|
v-for="environment in environments"
|
|
:key="environment.id"
|
|
:value="String(environment.id)"
|
|
>
|
|
{{ environment.name }}
|
|
</SelectItem>
|
|
</SelectContent>
|
|
</Select>
|
|
<InputError :message="form.errors.environment_id" />
|
|
</div>
|
|
|
|
<div class="grid gap-2">
|
|
<Label for="config">Config JSON</Label>
|
|
<textarea
|
|
id="config"
|
|
v-model="form.config"
|
|
class="min-h-28 rounded-md border border-input bg-transparent px-3 py-2 text-sm"
|
|
></textarea>
|
|
<InputError :message="form.errors.config" />
|
|
</div>
|
|
|
|
<div class="flex justify-end">
|
|
<Button type="submit" :disabled="form.processing">Create slice</Button>
|
|
</div>
|
|
</form>
|
|
</AppLayout>
|
|
</template>
|