Refactor to remove slices and environments, replace with instances.
This commit is contained in:
@@ -3,7 +3,7 @@ import { Badge } from '@/components/ui/badge';
|
||||
import { Card, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import { Head, Link } from '@inertiajs/vue3';
|
||||
import { Layers2Icon } from 'lucide-vue-next';
|
||||
import { ServerIcon } from 'lucide-vue-next';
|
||||
|
||||
const props = defineProps({
|
||||
application: {
|
||||
@@ -38,43 +38,35 @@ const props = defineProps({
|
||||
|
||||
<div>
|
||||
<div class="mb-3 flex items-center justify-between">
|
||||
<h3 class="text-2xl font-semibold tracking-tight">Environments</h3>
|
||||
<h3 class="text-2xl font-semibold tracking-tight">Server Instances</h3>
|
||||
<div>
|
||||
<!-- <Button
|
||||
:as="Link"
|
||||
:href="
|
||||
route('environments.create', {
|
||||
organisation: $page.props.organisation.id,
|
||||
server: application.id,
|
||||
})
|
||||
"
|
||||
size="xs"
|
||||
>
|
||||
<PlusIcon class="size-4" />
|
||||
Add
|
||||
</Button> -->
|
||||
<!-- Add instance button would go here -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
|
||||
<Card v-for="environment in application.environments" :key="environment.id" class="relative">
|
||||
<Link class="absolute inset-0" :href="route('environments.show', {
|
||||
organisation: $page.props.organisation.id,
|
||||
application: application.id,
|
||||
environment: environment.id,
|
||||
})"></Link>
|
||||
<Card v-for="instance in application.instances" :key="instance.id" class="relative">
|
||||
<Link
|
||||
class="absolute inset-0"
|
||||
:href="
|
||||
route('servers.show', {
|
||||
organisation: $page.props.organisation.id,
|
||||
server: instance.server.id,
|
||||
})
|
||||
"
|
||||
></Link>
|
||||
<CardHeader>
|
||||
<div class="flex items-center gap-2">
|
||||
<CardTitle>{{ environment.name }}</CardTitle>
|
||||
<Badge :variant="environment.status === 'active' ? 'success' : 'secondary'">{{ environment.status.replace('-', ' ') }}</Badge>
|
||||
<ServerIcon class="size-4" />
|
||||
<CardTitle>{{ instance.server.name }}</CardTitle>
|
||||
<Badge :variant="instance.status === 'active' ? 'success' : 'secondary'">{{
|
||||
instance.status.replace('-', ' ')
|
||||
}}</Badge>
|
||||
</div>
|
||||
<CardDescription>
|
||||
<span class="capitalize">{{ environment.type }}</span> {{ environment.version }}
|
||||
</CardDescription>
|
||||
<CardDescription> Branch: {{ instance.branch }} </CardDescription>
|
||||
</CardHeader>
|
||||
</Card>
|
||||
</div>
|
||||
</div>
|
||||
{{ application }}
|
||||
</div>
|
||||
</AppLayout>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user