@extends('admin.layouts.app') @section('title', ($service->product?->name ?? 'Service') . ($service->domain ? ' - ' . $service->domain : '')) @section('content')
{{ __('admin.services.manage_status') }}
@php $statusBtns = ['active', 'suspended', 'terminated', 'pending', 'cancelled']; @endphp @foreach($statusBtns as $btn)
@csrf @method('PUT') @if($service->status === $btn) @else @endif
@endforeach
@csrf @method('DELETE')
{{ __('admin.services.service_info') }}
@if($service->order_id) @endif
{{ __('admin.services.product') }}{{ $service->product?->name ?? 'N/A' }}
{{ __('admin.services.domain') }}{{ $service->domain ?? '-' }}
{{ __('admin.services.username') }}{{ $service->username ?? '-' }}
{{ __('admin.services.client') }}{{ $service->client->full_name ?? 'N/A' }}
{{ __('admin.services.order') }}#{{ $service->order_id }}
{{ __('admin.services.server_module') }}
@if($service->suspension_date) @endif @if($service->suspension_reason) @endif @if($service->termination_date) @endif
{{ __('admin.services.server') }}{{ $service->server->name ?? __('admin.services.none_assigned') }}
{{ __('admin.services.module') }}{{ $service->product?->server_type ?: ($service->product?->ssl_module ?: __('admin.services.none_label')) }}
{{ __('admin.services.suspended') }}{{ $service->suspension_date->format(date_fmt()) }}
{{ __('admin.services.reason') }}{{ $service->suspension_reason }}
{{ __('admin.services.terminated') }}{{ $service->termination_date->format(date_fmt()) }}
{{ __('admin.services.billing') }}
{{ __('admin.services.amount') }}{{ money_fmt($service->amount) }}/{{ $service->billing_cycle }}
{{ __('admin.services.first_payment') }}{{ money_fmt($service->first_payment_amount) }}
{{ __('admin.services.registered') }}{{ $service->registration_date?->format(date_fmt()) ?? '-' }}
{{ __('admin.services.next_due') }}
@csrf @method('PUT') status === 'terminated' ? 'disabled' : '' }}> @if($service->status !== 'terminated') @endif
{{ __('admin.services.payment') }}{{ $service->payment_method ? payment_method_label((string) $service->payment_method) : '-' }}
{{-- Edit the service's record. --}}
any()) open @endif> {{ __('admin.services.edit_service') }}
@csrf @method('PUT')
@if($service->disk_limit > 0 || $service->bw_limit > 0 || $service->disk_usage > 0 || $service->bw_usage > 0)
{{ __('admin.services.resource_usage') }}
@php $diskPct = $service->disk_limit > 0 ? min(100, ($service->disk_usage / $service->disk_limit) * 100) : 0; @endphp
{{ __('admin.services.disk_usage') }} {{ mb_fmt($service->disk_usage) }} / {{ $service->disk_limit > 0 ? mb_fmt($service->disk_limit) : '∞' }}
@php $bwPct = $service->bw_limit > 0 ? min(100, ($service->bw_usage / $service->bw_limit) * 100) : 0; @endphp
{{ __('admin.services.bandwidth') }} {{ mb_fmt($service->bw_usage) }} / {{ $service->bw_limit > 0 ? mb_fmt($service->bw_limit) : '∞' }}
@endif
{{ __('admin.services.module_actions') }} @if(auth('admin')->user()?->hasPermission('view_activity_log')){{ __('admin.logs.view_module_log') }}@endif
@if(!$service->product?->server_type && !$service->product?->ssl_module)

{{ __('admin.services.no_module') }}

@elseif($service->product?->ssl_module)

{{ __('admin.products.ssl_module') }}: {{ $service->product->ssl_module }}

@if($service->sslOrder) {{ __('admin.ssl.order_details') }} @else

{{ __('admin.services.no_ssl_order') }}

@endif @else
{{-- Only while there is something to create. An active service with an account already provisioned made this button a trap: pressing it again just produced "domain already exists" errors. --}} @unless(strtolower((string) $service->status) === 'active' && (string) $service->username !== '')
@csrf
@endunless
@csrf
@csrf
@csrf
@csrf

{{ __('admin.services.module_label') }}: {{ $service->product?->server_type }}

@endif
@if(strtolower((string) ($service->server?->type ?? $service->product?->server_type)) === 'proxmox') @php $pveData = $service->module_data ?? []; @endphp
{{ __('proxmox.admin.vm_title') }} @if(empty($pveData['proxmox_vmid'])){{ __('proxmox.admin.no_vm') }}@endif
@if(!empty($pveData['proxmox_vmid'])) @php $vpsUrls = []; foreach (['status', 'graphs', 'power', 'password', 'reinstall', 'snapshots', 'backups'] as $name) { $vpsUrls[$name] = route('admin.services.vps.'.$name, $service); } $vpsUrls['snapshotAction'] = route('admin.services.vps.snapshots.action', $service); $vpsUrls['backupAction'] = route('admin.services.vps.backups.action', $service); $vpsCanChange = in_array(strtolower((string) $service->status), ['active', 'suspended'], true); @endphp
@include('admin.services.partials.pve-claim')
@else
@include('admin.services.partials.pve-claim')
@endif
@endif @if(($productFields ?? collect())->isNotEmpty())
{{ __('admin.products.fields_title') }}
@csrf @method('PUT')
@foreach($productFields as $field) @php($value = old("custom_fields.{$field->id}", $field->valueFor($service->id)))
@if($field->field_type === 'select') @elseif($field->field_type === 'textarea') @elseif($field->field_type === 'checkbox') @else @endif @error("custom_fields.{$field->id}")
{{ $message }}
@enderror
@endforeach
@endif @if($service->notes)
{{ __('admin.services.notes') }}
{{ $service->notes }}
@endif
{{ __('admin.addons.title') }}
@if($service->addons->isNotEmpty()) @foreach($service->addons as $addon) @endforeach
{{ __('common.table.name') }} {{ __('common.table.amount') }} {{ __('common.table.billing_cycle') }} {{ __('client.services.next_due_date') }} {{ __('common.table.status') }} {{ __('common.table.actions') }}
{{ $addon->label() }} {{ number_format((float) $addon->amount, 2) }} {{ $addon->billing_cycle }} {{ $addon->next_due_date?->format(date_fmt()) ?? '-' }} {{ $addon->status }} @if(in_array(strtolower($addon->status), ['active', 'pending'], true))
@csrf
@endif
@endif @if(($availableAddons ?? collect())->isNotEmpty())
@csrf
@else

{{ __('admin.addons.no_addons') }}

@endif
@endsection