77 lines
5.6 KiB
PHP
77 lines
5.6 KiB
PHP
<div class="space-y-5">
|
|
<div class="animate-rise">
|
|
<h1 class="text-2xl font-bold tracking-tight text-ink sm:text-3xl">{{ __('admin.nav.customers') }}</h1>
|
|
<p class="mt-1 text-sm text-muted">{{ __('admin.customers_sub') }}</p>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 gap-5 lg:grid-cols-[1fr_300px] lg:items-start">
|
|
<div class="overflow-hidden rounded-lg border border-line bg-surface shadow-xs animate-rise [animation-delay:60ms]">
|
|
<div class="overflow-x-auto">
|
|
<table class="w-full text-sm">
|
|
<thead>
|
|
<tr class="border-b border-line bg-surface-2 text-left text-xs font-semibold text-muted">
|
|
<th class="px-4 py-3 font-semibold">{{ __('admin.col.customer') }}</th>
|
|
<th class="px-4 py-3 font-semibold">{{ __('admin.col.plan') }}</th>
|
|
<th class="px-4 py-3 font-semibold">{{ __('admin.col.mrr') }}</th>
|
|
<th class="px-4 py-3 font-semibold">{{ __('admin.col.status') }}</th>
|
|
<th class="px-4 py-3 text-right font-semibold">{{ __('admin.col.actions') }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@forelse ($rows as $r)
|
|
<tr class="border-b border-line last:border-0 hover:bg-surface-hover">
|
|
<td class="px-4 py-3">
|
|
<p class="font-medium text-ink">{{ $r['name'] }}</p>
|
|
<p class="font-mono text-xs text-muted">{{ $r['instance'] }}.clupilot.com</p>
|
|
</td>
|
|
<td class="px-4 py-3 text-body">{{ $r['plan'] }}</td>
|
|
<td class="px-4 py-3 font-mono text-body">{{ $r['mrr'] }}</td>
|
|
<td class="px-4 py-3"><x-ui.badge :status="$r['status']">{{ __('admin.status.'.$r['status']) }}</x-ui.badge></td>
|
|
<td class="px-4 py-3">
|
|
<div class="flex items-center justify-end gap-1.5">
|
|
@unless ($r['closed'])
|
|
<button type="button" wire:click="toggleSuspend('{{ $r['uuid'] }}')"
|
|
class="inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs font-semibold
|
|
{{ $r['suspended'] ? 'border-success-border text-success hover:bg-success-bg' : 'border-line text-muted hover:border-warning hover:text-warning' }}">
|
|
{{ $r['suspended'] ? __('admin.reactivate') : __('admin.suspend') }}
|
|
</button>
|
|
@endunless
|
|
{{-- Impersonation borrows the customer's PORTAL session; this
|
|
is administrator access to their Nextcloud itself. Two
|
|
different things, so two buttons. --}}
|
|
@if ($r['instance_uuid'] && auth()->user()?->can('instances.adminlogin'))
|
|
<button type="button" title="{{ __('instances.admin_action') }}"
|
|
x-on:click="$dispatch('openModal', { component: 'admin.instance-admin-access', arguments: { uuid: '{{ $r['instance_uuid'] }}' } })"
|
|
class="inline-flex items-center gap-1.5 rounded-md border border-line px-3 py-1.5 text-xs font-semibold text-body hover:border-accent-border hover:text-accent-text">
|
|
<x-ui.icon name="shield" class="size-3.5" />
|
|
{{ __('instances.admin_action') }}
|
|
</button>
|
|
@endif
|
|
<form method="POST" action="{{ route('admin.impersonate', $r['uuid']) }}" class="inline">
|
|
@csrf
|
|
<button type="submit"
|
|
class="inline-flex items-center gap-1.5 rounded-md border border-line px-3 py-1.5 text-xs font-semibold text-body hover:border-accent-border hover:text-accent-text">
|
|
<x-ui.icon name="log-out" class="size-3.5" />
|
|
{{ __('admin.impersonate') }}
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="5" class="px-4 py-10 text-center text-sm text-muted">{{ __('admin.customers_empty') }}</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="rounded-lg border border-line bg-surface p-5 shadow-xs animate-rise [animation-delay:120ms]">
|
|
<h2 class="font-semibold text-ink">{{ __('admin.by_plan') }}</h2>
|
|
<div class="mt-3 h-56" wire:ignore><x-ui.chart :config="$plansChart" class="h-56" :label="__('admin.by_plan')" /></div>
|
|
</div>
|
|
</div>
|
|
</div>
|