242 lines
12 KiB
PHP
242 lines
12 KiB
PHP
<x-filament-panels::page>
|
|
<x-filament::section>
|
|
<x-slot name="heading">
|
|
Service #{{ $this->service->id }}
|
|
</x-slot>
|
|
<x-slot name="description">
|
|
Server deployment management
|
|
</x-slot>
|
|
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
<x-filament::section>
|
|
<x-slot name="heading">Client</x-slot>
|
|
<div class="text-sm">
|
|
<p class="font-medium">{{ $this->service->user->name }}</p>
|
|
<p class="text-gray-500 dark:text-gray-400">{{ $this->service->user->email }}</p>
|
|
</div>
|
|
</x-filament::section>
|
|
|
|
<x-filament::section>
|
|
<x-slot name="heading">Product</x-slot>
|
|
<div class="text-sm">
|
|
<p class="font-medium">{{ $this->service->product->name }}</p>
|
|
</div>
|
|
</x-filament::section>
|
|
|
|
<x-filament::section>
|
|
<x-slot name="heading">Service Status</x-slot>
|
|
<div class="text-sm">
|
|
<x-filament::badge :color="match($this->service->status) { 'active' => 'success', 'suspended' => 'danger', 'cancelled' => 'gray', default => 'warning' }">
|
|
{{ ucfirst($this->service->status) }}
|
|
</x-filament::badge>
|
|
</div>
|
|
</x-filament::section>
|
|
|
|
<x-filament::section>
|
|
<x-slot name="heading">Deployment Status</x-slot>
|
|
<div class="text-sm">
|
|
<x-filament::badge :color="match($this->deployStatus) { 'deployed' => 'success', 'suspended' => 'danger', 'terminated' => 'gray', default => 'warning' }">
|
|
{{ ucfirst($this->deployStatus) }}
|
|
</x-filament::badge>
|
|
</div>
|
|
</x-filament::section>
|
|
</div>
|
|
</x-filament::section>
|
|
|
|
<x-filament::section>
|
|
<x-slot name="heading">Client Communication</x-slot>
|
|
<x-slot name="description">
|
|
Send messages to the client about their server setup
|
|
</x-slot>
|
|
|
|
<div class="flex items-start justify-between gap-4">
|
|
<div class="flex-1">
|
|
@if($this->feedback)
|
|
<div class="text-sm whitespace-pre-wrap p-4 rounded-lg border border-gray-200 dark:border-white/10 bg-gray-50 dark:bg-white/5">
|
|
{{ $this->feedback }}
|
|
</div>
|
|
@else
|
|
<p class="text-sm text-gray-500 dark:text-gray-400">No message sent yet</p>
|
|
@endif
|
|
</div>
|
|
<div>
|
|
{{ $this->feedbackAction }}
|
|
</div>
|
|
</div>
|
|
</x-filament::section>
|
|
|
|
@if(!empty($this->credentialData))
|
|
<x-filament::section>
|
|
<x-slot name="heading">User-Provided Information</x-slot>
|
|
<x-slot name="description">
|
|
Information entered by the client during checkout
|
|
</x-slot>
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
@foreach($this->credentialData as $key => $value)
|
|
@php
|
|
$fieldConfig = collect($this->credentialFields)->where('name', $key)->first();
|
|
$label = $fieldConfig['label'] ?? ucfirst(str_replace('_', ' ', $key));
|
|
$isPassword = ($fieldConfig['type'] ?? 'text') === 'password';
|
|
@endphp
|
|
<div class="p-4 rounded-lg border border-gray-200 dark:border-white/10 bg-gray-50 dark:bg-white/5">
|
|
<p class="text-xs font-medium text-gray-500 dark:text-gray-400 mb-2">{{ $label }}</p>
|
|
|
|
<div class="flex items-start justify-between gap-3">
|
|
<div class="flex-1 min-w-0">
|
|
@if($isPassword)
|
|
<p class="font-mono text-sm" x-data="{ show: false }">
|
|
<span x-show="!show" class="text-gray-400">••••••••</span>
|
|
<span x-show="show" class="break-all">{{ $value }}</span>
|
|
<x-filament::link @click="show = !show" size="xs" class="ml-2">
|
|
<span x-show="!show">Show</span>
|
|
<span x-show="show">Hide</span>
|
|
</x-filament::link>
|
|
</p>
|
|
@else
|
|
<p class="font-mono text-sm break-all">{{ $value ?: 'N/A' }}</p>
|
|
@endif
|
|
</div>
|
|
|
|
<x-filament::button
|
|
size="xs"
|
|
color="gray"
|
|
x-data
|
|
x-on:click="navigator.clipboard.writeText('{{ addslashes($value) }}'); $tooltip('Copied!')">
|
|
Copy
|
|
</x-filament::button>
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
</x-filament::section>
|
|
@endif
|
|
|
|
@if(empty($this->processData))
|
|
<x-filament::section>
|
|
<x-slot name="heading">Initialize Setup Flow</x-slot>
|
|
<x-slot name="description">This order has no deployment checklist yet.</x-slot>
|
|
|
|
<div class="flex items-start justify-between gap-4">
|
|
<div class="flex-1">
|
|
<p class="font-medium">Setup not initialized</p>
|
|
<p class="text-sm text-gray-500 dark:text-gray-400 mt-1">Create the checklist using the product configuration so staff can track progress.</p>
|
|
</div>
|
|
<div>
|
|
@if(auth()->user()?->can('manage', \Paymenter\Extensions\Servers\ManualServers\ManualServers::class))
|
|
<x-filament::button wire:click="initializeProcesses" color="primary">
|
|
Initialize Setup Steps
|
|
</x-filament::button>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</x-filament::section>
|
|
@else
|
|
<x-filament::section>
|
|
<x-slot name="heading">Deployment Workflow</x-slot>
|
|
<x-slot name="description">Track each setup step</x-slot>
|
|
|
|
<div class="space-y-4">
|
|
@foreach($this->processData as $index => $process)
|
|
@php
|
|
$isCompleted = $process['completed'] ?? false;
|
|
$previousCompleted = $index === 0 ? true : ($this->processData[$index - 1]['completed'] ?? false);
|
|
$canToggle = $this->deployStatus !== 'deployed' && ($isCompleted || $previousCompleted);
|
|
@endphp
|
|
|
|
<div class="flex items-start justify-between gap-4 p-4 rounded-lg border border-gray-200 dark:border-white/10 bg-transparent">
|
|
<div>
|
|
<p class="font-medium">{{ $process['name'] }}</p>
|
|
@if($isCompleted && ($process['completed_at'] ?? null))
|
|
<p class="text-xs text-gray-500 dark:text-gray-400 mt-1">Completed {{ \Carbon\Carbon::parse($process['completed_at'])->format('M d, Y \a\t H:i') }}</p>
|
|
@elseif(!$previousCompleted && !$isCompleted)
|
|
<p class="text-xs text-gray-500 dark:text-gray-400 mt-1">Complete the previous step first</p>
|
|
@endif
|
|
</div>
|
|
|
|
<div>
|
|
@if($this->deployStatus !== 'deployed')
|
|
@if($canToggle && auth()->user()?->can('manage', \Paymenter\Extensions\Servers\ManualServers\ManualServers::class))
|
|
<x-filament::button
|
|
wire:click="toggleProcess({{ $index }})"
|
|
:color="$isCompleted ? 'danger' : 'success'"
|
|
size="sm">
|
|
{{ $isCompleted ? 'Undo' : 'Complete' }}
|
|
</x-filament::button>
|
|
@else
|
|
<x-filament::badge color="gray">Locked</x-filament::badge>
|
|
@endif
|
|
@else
|
|
<x-filament::badge color="success">Done</x-filament::badge>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
|
|
@if($this->areAllProcessesCompleted() && $this->deployStatus !== 'deployed')
|
|
<div class="mt-4">
|
|
{{ $this->deployAction }}
|
|
</div>
|
|
@endif
|
|
|
|
@if($this->deployStatus === 'deployed')
|
|
<div class="mt-4">
|
|
{{ $this->reverseDeploymentAction }}
|
|
</div>
|
|
@endif
|
|
</x-filament::section>
|
|
|
|
@if($this->deployStatus === 'deployed' && !empty($this->credentialData))
|
|
<x-filament::section>
|
|
<x-slot name="heading">Server Credentials</x-slot>
|
|
<x-slot name="description">
|
|
Server credentials that have been provided to the client
|
|
</x-slot>
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
@foreach($this->credentialData as $key => $value)
|
|
@php
|
|
$fieldConfig = collect($this->credentialFields)->where('name', $key)->first();
|
|
$label = $fieldConfig['label'] ?? ucfirst(str_replace('_', ' ', $key));
|
|
$isPassword = ($fieldConfig['type'] ?? 'text') === 'password';
|
|
@endphp
|
|
<div class="p-4 rounded-lg border border-gray-200 dark:border-white/10">
|
|
<p class="text-xs font-medium text-gray-500 dark:text-gray-400 mb-2">{{ $label }}</p>
|
|
|
|
<div class="flex items-start justify-between gap-3">
|
|
<div class="flex-1 min-w-0">
|
|
@if($isPassword)
|
|
<p class="font-mono text-sm" x-data="{ show: false }">
|
|
<span x-show="!show" class="text-gray-400">••••••••</span>
|
|
<span x-show="show" class="break-all">{{ $value }}</span>
|
|
<x-filament::link @click="show = !show" size="xs" class="ml-2">
|
|
<span x-show="!show">Show</span>
|
|
<span x-show="show">Hide</span>
|
|
</x-filament::link>
|
|
</p>
|
|
@else
|
|
<p class="font-mono text-sm break-all">{{ $value ?: 'N/A' }}</p>
|
|
@endif
|
|
</div>
|
|
|
|
<x-filament::button
|
|
size="xs"
|
|
color="gray"
|
|
x-data
|
|
x-on:click="navigator.clipboard.writeText('{{ addslashes($value) }}'); $tooltip('Copied!')">
|
|
Copy
|
|
</x-filament::button>
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
|
|
@if($this->deployStatus === 'deployed' && !empty($this->credentialData))
|
|
<div class="mt-4">
|
|
{{ $this->editCredentialsAction }}
|
|
</div>
|
|
@endif
|
|
</x-filament::section>
|
|
@endif
|
|
@endif
|
|
</x-filament-panels::page>
|