re-add theme as ptrs broken fixed ipad theme

This commit is contained in:
Mark Gregory
2026-09-07 17:56:58 +01:00
parent ab85c4a575
commit c6b7510f05
12 changed files with 341 additions and 49 deletions
@@ -7,23 +7,29 @@
$priorityTotal = max(1, $priorityBreakdown->sum('count'));
$offset = 0;
$segments = [];
$donutSegments = [];
foreach($priorityBreakdown as $index => $priority) {
$percent = ($priority['count'] / $priorityTotal) * 100;
$segments[] = $palette[$index % count($palette)].' '.$offset.'% '.($offset + $percent).'%';
$donutSegments[] = [
'colour' => $palette[$index % count($palette)],
'length' => $percent,
'offset' => -$offset,
];
$offset += $percent;
}
@endphp
<div class="hd-dashboard space-y-5" dusk="helpdesk-dashboard-widget">
<section class="hd-dashboard-heading">
<div><h1>Dashboard</h1><p>Overview of your helpdesk system</p></div>
<label class="hd-range-select"><i class="fa-regular fa-calendar"></i><select wire:model.live="days"><option value="7">Last 7 days</option><option value="14">Last 14 days</option><option value="30">Last 30 days</option></select></label>
<label class="hd-range-select"><svg class="hd-svg-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3h2v2h10V3h2v2h2v16H3V5h2V3zm0 6v10h14V9H5z"/></svg><select wire:model.live="days"><option value="7">Last 7 days</option><option value="14">Last 14 days</option><option value="30">Last 30 days</option></select></label>
</section>
<div class="hd-metric-grid">
<article class="hd-metric-card hd-metric-blue"><span class="hd-metric-icon"><i class="fa-regular fa-clipboard"></i></span><div><small>Total Tickets</small><strong>{{ $totalCount }}</strong><em>All visible tickets</em></div></article>
<article class="hd-metric-card hd-metric-green"><span class="hd-metric-icon"><i class="fa-regular fa-circle-check"></i></span><div><small>Resolved</small><strong>{{ $closedCount }}</strong><em>Completed workload</em></div></article>
<article class="hd-metric-card hd-metric-amber"><span class="hd-metric-icon"><i class="fa-regular fa-clock"></i></span><div><small>In Progress</small><strong>{{ $inProgressCount }}</strong><em>Actively being worked</em></div></article>
<article class="hd-metric-card hd-metric-red"><span class="hd-metric-icon"><i class="fa-solid fa-circle-exclamation"></i></span><div><small>Open</small><strong>{{ $openCount }}</strong><em>Awaiting resolution</em></div></article>
<article class="hd-metric-card hd-metric-blue"><span class="hd-metric-icon"><svg class="hd-svg-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M9 2h6l1 2h3v18H5V4h3l1-2zm1 2-.5 1h5L14 4h-4zM8 9v2h8V9H8zm0 4v2h8v-2H8z"/></svg></span><div><small>Total Tickets</small><strong>{{ $totalCount }}</strong><em>All visible tickets</em></div></article>
<article class="hd-metric-card hd-metric-green"><span class="hd-metric-icon"><svg class="hd-svg-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.2 14.2-4-4 1.4-1.4 2.6 2.6 5-5 1.4 1.4-6.4 6.4z"/></svg></span><div><small>Resolved</small><strong>{{ $closedCount }}</strong><em>Completed workload</em></div></article>
<article class="hd-metric-card hd-metric-amber"><span class="hd-metric-icon"><svg class="hd-svg-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm1 5v4.6l3.2 2-1 1.7-4.2-2.6V7h2z"/></svg></span><div><small>In Progress</small><strong>{{ $inProgressCount }}</strong><em>Actively being worked</em></div></article>
<article class="hd-metric-card hd-metric-red"><span class="hd-metric-icon"><svg class="hd-svg-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1 5h2v7h-2V7zm0 9h2v2h-2v-2z"/></svg></span><div><small>Open</small><strong>{{ $openCount }}</strong><em>Awaiting resolution</em></div></article>
</div>
<div class="hd-dashboard-grid">
@@ -36,7 +42,7 @@
<section class="hd-dashboard-card hd-priority-card">
<header><h2>Tickets by Priority</h2></header>
<div class="hd-priority-body"><div class="hd-donut" style="background: conic-gradient({{ implode(', ', $segments) ?: '#334155 0 100%' }})"><span>{{ $priorityTotal }}</span></div><div class="hd-priority-legend">@foreach($priorityBreakdown as $i => $priority)<div><span><b style="background: {{ $palette[$i % count($palette)] }}"></b>{{ $priority['name'] }}</span><strong>{{ $priority['count'] }} ({{ round(($priority['count']/$priorityTotal)*100, 1) }}%)</strong></div>@endforeach</div></div>
<div class="hd-priority-body"><div class="hd-donut"><svg class="hd-donut-svg" viewBox="0 0 42 42" aria-hidden="true"><circle class="hd-donut-track" cx="21" cy="21" r="15.9155" fill="none" stroke-width="10"></circle>@foreach($donutSegments as $segment)<circle cx="21" cy="21" r="15.9155" fill="none" stroke="{{ $segment['colour'] }}" stroke-width="10" stroke-dasharray="{{ $segment['length'] }} {{ 100 - $segment['length'] }}" stroke-dashoffset="{{ $segment['offset'] }}" transform="rotate(-90 21 21)"></circle>@endforeach</svg><span>{{ $priorityTotal }}</span></div><div class="hd-priority-legend">@foreach($priorityBreakdown as $i => $priority)<div><span><b style="background: {{ $palette[$i % count($palette)] }}"></b>{{ $priority['name'] }}</span><strong>{{ $priority['count'] }} ({{ round(($priority['count']/$priorityTotal)*100, 1) }}%)</strong></div>@endforeach</div></div>
</section>
<section class="hd-dashboard-card hd-latest-card">