step name
This commit is contained in:
@@ -143,7 +143,7 @@ class ServerController extends Controller
|
|||||||
$server = $organisation->servers()->findOrFail($request->route('server'));
|
$server = $organisation->servers()->findOrFail($request->route('server'));
|
||||||
|
|
||||||
return inertia('servers/Show', [
|
return inertia('servers/Show', [
|
||||||
'server' => $server->load('services.slices'),
|
'server' => $server->load('services.slices', 'serviceDeployments.steps', 'serviceDeployments.target'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ class DeployService implements ShouldQueue
|
|||||||
$deploymentPlan = $driver->getDeploymentPlan($this->deployment->hash);
|
$deploymentPlan = $driver->getDeploymentPlan($this->deployment->hash);
|
||||||
foreach ($deploymentPlan->steps as $index => $plannedStep) {
|
foreach ($deploymentPlan->steps as $index => $plannedStep) {
|
||||||
$step = $this->deployment->steps()->create([
|
$step = $this->deployment->steps()->create([
|
||||||
|
'name' => $plannedStep->name,
|
||||||
'order' => $index + 1,
|
'order' => $index + 1,
|
||||||
'status' => DeploymentStatus::PENDING,
|
'status' => DeploymentStatus::PENDING,
|
||||||
'script' => $plannedStep->getSafeScript(),
|
'script' => $plannedStep->getSafeScript(),
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ return new class extends Migration
|
|||||||
Schema::create('steps', function (Blueprint $table) {
|
Schema::create('steps', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->foreignIdFor(Deployment::class);
|
$table->foreignIdFor(Deployment::class);
|
||||||
|
$table->string('name');
|
||||||
$table->integer('order');
|
$table->integer('order');
|
||||||
$table->string('status');
|
$table->string('status');
|
||||||
$table->longText('script');
|
$table->longText('script');
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import { Card, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
|
import { Card, CardDescription, CardHeader, CardTitle, CardContent } from '@/components/ui/card';
|
||||||
import AppLayout from '@/layouts/AppLayout.vue';
|
import AppLayout from '@/layouts/AppLayout.vue';
|
||||||
import { Head, Link } from '@inertiajs/vue3';
|
import { Head, Link } from '@inertiajs/vue3';
|
||||||
import { useCycleList, useInterval } from '@vueuse/core';
|
import { useCycleList, useInterval } from '@vueuse/core';
|
||||||
@@ -64,10 +64,16 @@ watch(counter, () => {
|
|||||||
<div class="mb-3 flex items-center justify-between">
|
<div class="mb-3 flex items-center justify-between">
|
||||||
<h3 class="text-2xl font-semibold tracking-tight">Services</h3>
|
<h3 class="text-2xl font-semibold tracking-tight">Services</h3>
|
||||||
<div>
|
<div>
|
||||||
<Button :as="Link" :href="route('services.create', {
|
<Button
|
||||||
|
:as="Link"
|
||||||
|
:href="
|
||||||
|
route('services.create', {
|
||||||
organisation: $page.props.organisation.id,
|
organisation: $page.props.organisation.id,
|
||||||
server: server.id,
|
server: server.id,
|
||||||
})" size="xs">
|
})
|
||||||
|
"
|
||||||
|
size="xs"
|
||||||
|
>
|
||||||
<PlusIcon class="size-4" />
|
<PlusIcon class="size-4" />
|
||||||
Add
|
Add
|
||||||
</Button>
|
</Button>
|
||||||
@@ -91,6 +97,21 @@ watch(counter, () => {
|
|||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3 class="mb-3 text-2xl font-semibold tracking-tight">Deployments</h3>
|
||||||
|
<Card>
|
||||||
|
<CardContent class="py-4">
|
||||||
|
<div v-for="deployment in server.service_deployments" class="flex gap-4">
|
||||||
|
<div class="w-48">{{ deployment.target.name }}</div>
|
||||||
|
<div>
|
||||||
|
<div v-for="step in deployment.steps">
|
||||||
|
{{ step }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="server.status === 'provisioning'">
|
<template v-else-if="server.status === 'provisioning'">
|
||||||
<div class="flex items-center gap-4 py-6">
|
<div class="flex items-center gap-4 py-6">
|
||||||
|
|||||||
Reference in New Issue
Block a user