Update dashboard filters and packet views
This commit is contained in:
@@ -18,20 +18,21 @@
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
<a href="{{b "/projects"}}" class="rounded-lg border border-slate-200 bg-white px-3 py-1.5 text-xs font-semibold text-slate-600 transition hover:border-brand-400 hover:text-brand-600">
|
||||
Ganti project
|
||||
Change Project
|
||||
</a>
|
||||
<form method="get" action="{{b "/arrival"}}" class="flex flex-wrap items-center gap-2">
|
||||
<input type="hidden" name="search" value="{{.Search}}"/>
|
||||
<input type="hidden" name="dept" value="{{.Department}}"/>
|
||||
<label class="text-xs font-medium text-slate-500">Tanggal Check-in</label>
|
||||
<label class="text-xs font-medium text-slate-500">Check-in Date</label>
|
||||
<select name="date"
|
||||
onchange="this.form.submit()"
|
||||
class="num rounded-lg border border-slate-200 bg-slate-50 px-3 py-1.5 text-sm text-slate-700 focus:border-brand-400 focus:outline-none focus:ring-2 focus:ring-brand-200">
|
||||
{{range .AvailableDates}}
|
||||
<option value="{{.}}" {{if eq . $.Date}}selected{{end}}>{{. | fmtDate}}</option>
|
||||
{{end}}
|
||||
</select>
|
||||
<button type="submit" class="rounded-lg bg-brand-500 px-3 py-1.5 text-xs font-semibold text-white transition hover:bg-brand-600">
|
||||
Lihat
|
||||
View
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
@@ -74,26 +75,44 @@
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<section class="card p-5">
|
||||
<div class="mb-3">
|
||||
<p class="text-sm font-semibold text-slate-700">Per Paket Completion</p>
|
||||
<p class="text-xs text-slate-400">Total pasien per paket vs sudah menyelesaikan semua station</p>
|
||||
</div>
|
||||
<div id="paket-distribution-chart" class="h-72 w-full"></div>
|
||||
</section>
|
||||
|
||||
<section class="card p-4">
|
||||
<form id="arrival-filter-form" method="get" action="{{b "/arrival"}}" class="grid gap-3 md:grid-cols-3">
|
||||
<form id="arrival-filter-form" method="get" action="{{b "/arrival"}}" class="flex flex-wrap items-end gap-2">
|
||||
<input type="hidden" name="date" value="{{.Date}}"/>
|
||||
<div class="md:col-span-2">
|
||||
<label for="search" class="mb-2 block text-sm font-medium text-slate-600">Search Participant</label>
|
||||
<div class="min-w-[160px] flex-1">
|
||||
<label for="search" class="mb-1 block text-xs font-medium text-slate-500">Search</label>
|
||||
<input id="search" name="search" value="{{.Search}}" type="text" placeholder="Name or Employee ID"
|
||||
class="w-full rounded-xl border border-slate-200 px-4 py-3 text-sm outline-none transition focus:border-brand-400 focus:ring-2 focus:ring-brand-200"/>
|
||||
class="w-full rounded-lg border border-slate-200 px-3 py-2 text-sm outline-none transition focus:border-brand-400 focus:ring-2 focus:ring-brand-200"/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="dept" class="mb-2 block text-sm font-medium text-slate-600">Department</label>
|
||||
<div class="min-w-[160px] flex-1">
|
||||
<label for="paket" class="mb-1 block text-xs font-medium text-slate-500">Paket</label>
|
||||
<select id="paket" name="paket"
|
||||
class="w-full rounded-lg border border-slate-200 px-3 py-2 text-sm outline-none transition focus:border-brand-400 focus:ring-2 focus:ring-brand-200">
|
||||
<option value="" {{if eq .Paket ""}}selected{{end}}>All Paket</option>
|
||||
{{range .PaketOptions}}
|
||||
<option value="{{.Code}}" {{if eq .Code $.Paket}}selected{{end}}>{{.Name}}</option>
|
||||
{{end}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="min-w-[140px] flex-1">
|
||||
<label for="dept" class="mb-1 block text-xs font-medium text-slate-500">Department</label>
|
||||
<select id="dept" name="dept"
|
||||
class="w-full rounded-xl border border-slate-200 px-4 py-3 text-sm outline-none transition focus:border-brand-400 focus:ring-2 focus:ring-brand-200">
|
||||
class="w-full rounded-lg border border-slate-200 px-3 py-2 text-sm outline-none transition focus:border-brand-400 focus:ring-2 focus:ring-brand-200">
|
||||
<option value="" {{if eq .Department ""}}selected{{end}}>All Departments</option>
|
||||
{{range .DepartmentOptions}}
|
||||
<option value="{{.}}" {{if eq . $.Department}}selected{{end}}>{{.}}</option>
|
||||
{{end}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="md:col-span-3 flex justify-end">
|
||||
<button type="submit" class="rounded-xl bg-brand-500 px-4 py-2 text-sm font-semibold text-white transition hover:bg-brand-600">
|
||||
<div class="shrink-0">
|
||||
<button type="submit" class="rounded-lg bg-brand-500 px-4 py-2 text-sm font-semibold text-white transition hover:bg-brand-600">
|
||||
Filter
|
||||
</button>
|
||||
</div>
|
||||
@@ -109,15 +128,8 @@
|
||||
<span class="text-xs font-medium text-slate-400">{{.VisibleCount}} / {{.TotalFiltered}} ditampilkan</span>
|
||||
</div>
|
||||
|
||||
<div class="border-b border-slate-100 px-5 py-3">
|
||||
<div class="flex flex-wrap items-center gap-2 text-xs">
|
||||
<span class="rounded-full border border-slate-200 bg-slate-100 px-2 py-1 font-medium text-slate-600">Not Performed Yet</span>
|
||||
<span class="rounded-full border border-amber-200 bg-amber-50 px-2 py-1 font-medium text-amber-700">In Progress</span>
|
||||
<span class="rounded-full border border-emerald-200 bg-emerald-50 px-2 py-1 font-medium text-emerald-700">Performed</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if .FilteredRows}}
|
||||
{{if .FilteredRows}}
|
||||
<div class="hidden overflow-x-auto md:block">
|
||||
<table class="min-w-full text-sm">
|
||||
<thead class="bg-slate-50 text-left text-slate-500">
|
||||
@@ -126,6 +138,7 @@
|
||||
<th class="px-4 py-3 font-medium">Employee ID</th>
|
||||
<th class="px-4 py-3 font-medium">Name</th>
|
||||
<th class="px-4 py-3 font-medium">Department</th>
|
||||
<th class="px-4 py-3 font-medium">Tests</th>
|
||||
<th class="px-4 py-3 font-medium">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -136,21 +149,30 @@
|
||||
<td class="px-4 py-3 num">{{.NIP}}</td>
|
||||
<td class="px-4 py-3 font-medium text-slate-700">{{.Name}}</td>
|
||||
<td class="px-4 py-3 text-slate-500">{{.Department}}</td>
|
||||
<td class="px-4 py-3 text-slate-500 text-xs max-w-[160px]">
|
||||
{{if .Pemeriksaan}}<span title="{{.Pemeriksaan}}" class="line-clamp-2">{{.Pemeriksaan}}</span>{{else}}-{{end}}
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
{{if .Stations}}
|
||||
<div class="flex flex-wrap gap-1.5">
|
||||
{{range .Stations}}
|
||||
{{if eq .Tone "success"}}
|
||||
<span class="rounded-full border border-emerald-200 bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700">{{.Name}}</span>
|
||||
{{else if eq .Tone "warning"}}
|
||||
<span class="rounded-full border border-amber-200 bg-amber-50 px-2 py-1 text-xs font-medium text-amber-700">{{.Name}}</span>
|
||||
{{else if eq .Tone "danger"}}
|
||||
<span class="rounded-full border border-rose-200 bg-rose-50 px-2 py-1 text-xs font-medium text-rose-700">{{.Name}}</span>
|
||||
{{else}}
|
||||
<span class="rounded-full border border-slate-200 bg-slate-100 px-2 py-1 text-xs font-medium text-slate-600">{{.Name}}</span>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{if not .InTime}}
|
||||
<span class="rounded-full border border-slate-200 bg-slate-100 px-2 py-1 text-xs font-medium text-slate-600">Not Check-In Yet</span>
|
||||
{{else if .Stations}}
|
||||
<details class="group">
|
||||
<summary class="list-none cursor-pointer">
|
||||
<div class="flex flex-wrap gap-1.5 items-center">
|
||||
{{if gt .DoneCount 0}}<span class="rounded-full border border-emerald-200 bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700">Done ({{.DoneCount}})</span>{{end}}
|
||||
{{if gt .ProgressCount 0}}<span class="rounded-full border border-amber-200 bg-amber-50 px-2 py-1 text-xs font-medium text-amber-700">In Progress ({{.ProgressCount}})</span>{{end}}
|
||||
{{if gt .PendingCount 0}}<span class="rounded-full border border-slate-200 bg-slate-100 px-2 py-1 text-xs font-medium text-slate-600">Pending ({{.PendingCount}})</span>{{end}}
|
||||
<svg class="h-3 w-3 shrink-0 text-slate-400 transition-transform group-open:rotate-180" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"/></svg>
|
||||
</div>
|
||||
</summary>
|
||||
<div class="mt-2 flex flex-wrap gap-1.5">
|
||||
{{range .Stations}}
|
||||
{{if eq .Tone "success"}}<span class="rounded-full border border-emerald-200 bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700">{{.Name}}</span>
|
||||
{{else if eq .Tone "warning"}}<span class="rounded-full border border-amber-200 bg-amber-50 px-2 py-1 text-xs font-medium text-amber-700">{{.Name}}</span>
|
||||
{{else}}<span class="rounded-full border border-slate-200 bg-slate-100 px-2 py-1 text-xs font-medium text-slate-600">{{.Name}}</span>{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</details>
|
||||
{{else}}
|
||||
{{if eq .StatusTone "success"}}
|
||||
<span class="rounded-full border border-emerald-200 bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700">{{.Status}}</span>
|
||||
@@ -172,61 +194,48 @@
|
||||
<article class="rounded-xl border border-slate-200 p-3">
|
||||
<p class="font-semibold text-slate-700">{{.Name}}</p>
|
||||
<p class="mt-1 text-xs text-slate-400">{{if .InTime}}{{.InTime}}{{else}}-{{end}} • {{.NIP}} • {{.Department}}</p>
|
||||
<div class="mt-3 flex flex-col gap-1.5">
|
||||
{{if .Stations}}
|
||||
{{range .Stations}}
|
||||
{{if eq .Tone "success"}}
|
||||
<span class="flex w-full items-center gap-2 border border-emerald-200 bg-emerald-50 px-3 py-2 text-xs font-medium text-emerald-700">
|
||||
<svg class="h-3.5 w-3.5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7"/>
|
||||
</svg>
|
||||
<span class="truncate">{{.Name}}</span>
|
||||
</span>
|
||||
{{else if eq .Tone "warning"}}
|
||||
<span class="flex w-full items-center gap-2 border border-amber-200 bg-amber-50 px-3 py-2 text-xs font-medium text-amber-700">
|
||||
<svg class="h-3.5 w-3.5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/>
|
||||
</svg>
|
||||
<span class="truncate">{{.Name}}</span>
|
||||
</span>
|
||||
{{else if eq .Tone "danger"}}
|
||||
<span class="flex w-full items-center gap-2 border border-rose-200 bg-rose-50 px-3 py-2 text-xs font-medium text-rose-700">
|
||||
<svg class="h-3.5 w-3.5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/>
|
||||
</svg>
|
||||
<span class="truncate">{{.Name}}</span>
|
||||
</span>
|
||||
{{else}}
|
||||
<span class="flex w-full items-center gap-2 border border-slate-200 bg-slate-100 px-3 py-2 text-xs font-medium text-slate-600">
|
||||
<svg class="h-3.5 w-3.5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/>
|
||||
</svg>
|
||||
<span class="truncate">{{.Name}}</span>
|
||||
</span>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if .Pemeriksaan}}<p class="mt-1 text-xs text-slate-500 line-clamp-1">{{.Pemeriksaan}}</p>{{end}}
|
||||
<div class="mt-3">
|
||||
{{if not .InTime}}
|
||||
<span class="rounded-full border border-slate-200 bg-slate-100 px-2 py-1 text-xs font-medium text-slate-600">Not Check-In Yet</span>
|
||||
{{else if .Stations}}
|
||||
<details class="group">
|
||||
<summary class="list-none cursor-pointer">
|
||||
<div class="flex flex-wrap gap-1.5 items-center">
|
||||
{{if gt .DoneCount 0}}<span class="rounded-full border border-emerald-200 bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700">Done ({{.DoneCount}})</span>{{end}}
|
||||
{{if gt .ProgressCount 0}}<span class="rounded-full border border-amber-200 bg-amber-50 px-2 py-1 text-xs font-medium text-amber-700">In Progress ({{.ProgressCount}})</span>{{end}}
|
||||
{{if gt .PendingCount 0}}<span class="rounded-full border border-slate-200 bg-slate-100 px-2 py-1 text-xs font-medium text-slate-600">Pending ({{.PendingCount}})</span>{{end}}
|
||||
<svg class="h-3 w-3 shrink-0 text-slate-400 transition-transform group-open:rotate-180" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"/></svg>
|
||||
</div>
|
||||
</summary>
|
||||
<div class="mt-2 flex flex-col gap-1.5">
|
||||
{{range .Stations}}
|
||||
{{if eq .Tone "success"}}
|
||||
<span class="flex w-full items-center gap-2 border border-emerald-200 bg-emerald-50 px-3 py-2 text-xs font-medium text-emerald-700">
|
||||
<svg class="h-3.5 w-3.5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7"/></svg>
|
||||
<span class="truncate">{{.Name}}</span>
|
||||
</span>
|
||||
{{else if eq .Tone "warning"}}
|
||||
<span class="flex w-full items-center gap-2 border border-amber-200 bg-amber-50 px-3 py-2 text-xs font-medium text-amber-700">
|
||||
<svg class="h-3.5 w-3.5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/></svg>
|
||||
<span class="truncate">{{.Name}}</span>
|
||||
</span>
|
||||
{{else}}
|
||||
<span class="flex w-full items-center gap-2 border border-slate-200 bg-slate-100 px-3 py-2 text-xs font-medium text-slate-600">
|
||||
<svg class="h-3.5 w-3.5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/></svg>
|
||||
<span class="truncate">{{.Name}}</span>
|
||||
</span>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</details>
|
||||
{{else}}
|
||||
{{if eq .StatusTone "success"}}
|
||||
<span class="flex w-full items-center gap-2 border border-emerald-200 bg-emerald-50 px-3 py-2 text-xs font-medium text-emerald-700">
|
||||
<svg class="h-3.5 w-3.5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7"/>
|
||||
</svg>
|
||||
<span class="truncate">{{.Status}}</span>
|
||||
</span>
|
||||
<span class="rounded-full border border-emerald-200 bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700">{{.Status}}</span>
|
||||
{{else if eq .StatusTone "warning"}}
|
||||
<span class="flex w-full items-center gap-2 border border-amber-200 bg-amber-50 px-3 py-2 text-xs font-medium text-amber-700">
|
||||
<svg class="h-3.5 w-3.5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/>
|
||||
</svg>
|
||||
<span class="truncate">{{.Status}}</span>
|
||||
</span>
|
||||
<span class="rounded-full border border-amber-200 bg-amber-50 px-2 py-1 text-xs font-medium text-amber-700">{{.Status}}</span>
|
||||
{{else}}
|
||||
<span class="flex w-full items-center gap-2 border border-slate-200 bg-slate-100 px-3 py-2 text-xs font-medium text-slate-600">
|
||||
<svg class="h-3.5 w-3.5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/>
|
||||
</svg>
|
||||
<span class="truncate">{{.Status}}</span>
|
||||
</span>
|
||||
<span class="rounded-full border border-slate-200 bg-slate-100 px-2 py-1 text-xs font-medium text-slate-600">{{.Status}}</span>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
@@ -236,7 +245,7 @@
|
||||
<div id="arrival-load-more" class="px-4 pb-4">
|
||||
{{if .HasMore}}
|
||||
<div
|
||||
hx-get='{{b "/arrival/list"}}?date={{.Date}}&search={{.Search}}&dept={{.Department}}&page={{.NextPage}}'
|
||||
hx-get='{{b "/arrival/list"}}?date={{.Date}}&search={{.Search}}&paket={{.Paket}}&dept={{.Department}}&page={{.NextPage}}'
|
||||
hx-trigger="revealed"
|
||||
hx-swap="outerHTML"
|
||||
class="rounded-lg border border-slate-200 bg-slate-50 px-3 py-2 text-center text-xs font-medium text-slate-500">
|
||||
@@ -274,6 +283,7 @@
|
||||
|
||||
const overviewData = {{.OverviewJSON}};
|
||||
const stationData = {{.DepartmentJSON}};
|
||||
const paketData = {{.PaketChartJSON}};
|
||||
const deptColors = ['#f59e0b', '#8b5cf6', '#f97316', '#06b6d4', '#ec4899', '#84cc16', '#14b8a6'];
|
||||
|
||||
const overviewEl = document.getElementById('arrival-overview-chart');
|
||||
@@ -307,7 +317,7 @@
|
||||
show: !isMobile,
|
||||
type: 'scroll',
|
||||
orient: 'vertical',
|
||||
left: '58%',
|
||||
left: '68%',
|
||||
right: 0,
|
||||
top: 'middle',
|
||||
textStyle: { color: '#64748b', fontSize: 11 },
|
||||
@@ -321,7 +331,7 @@
|
||||
name: 'Check-in Summary',
|
||||
type: 'pie',
|
||||
radius: ['28%', '45%'],
|
||||
center: isMobile ? ['50%', '50%'] : ['38%', '48%'],
|
||||
center: isMobile ? ['50%', '50%'] : ['30%', '48%'],
|
||||
label: { show: false },
|
||||
labelLine: { show: false },
|
||||
data: [
|
||||
@@ -333,7 +343,7 @@
|
||||
name: 'Dept Detail',
|
||||
type: 'pie',
|
||||
radius: ['55%', '72%'],
|
||||
center: isMobile ? ['50%', '50%'] : ['38%', '48%'],
|
||||
center: isMobile ? ['50%', '50%'] : ['30%', '48%'],
|
||||
label: { show: false },
|
||||
labelLine: { show: false },
|
||||
data: outerData
|
||||
@@ -370,6 +380,63 @@
|
||||
});
|
||||
window.addEventListener('resize', () => stationChart.resize());
|
||||
}
|
||||
|
||||
const paketEl = document.getElementById('paket-distribution-chart');
|
||||
if (paketEl && paketData && typeof echarts !== 'undefined') {
|
||||
const paketChart = echarts.init(paketEl);
|
||||
var paketLabels = (paketData.labels || []).slice().reverse();
|
||||
var paketDone = (paketData.done || []).slice().reverse();
|
||||
var paketRemaining = (paketData.remaining || []).slice().reverse();
|
||||
paketChart.setOption({
|
||||
color: ['#10b981', '#cbd5e1'],
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: { type: 'shadow' },
|
||||
formatter: function (params) {
|
||||
var done = 0;
|
||||
var remaining = 0;
|
||||
for (var i = 0; i < params.length; i++) {
|
||||
if (params[i].seriesName === 'Completed') done = params[i].value || 0;
|
||||
if (params[i].seriesName === 'Not Completed') remaining = params[i].value || 0;
|
||||
}
|
||||
var total = done + remaining;
|
||||
return params[0].name + '<br/>Total: ' + total + '<br/>Completed: ' + done + '<br/>Not Completed: ' + remaining;
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
bottom: 0,
|
||||
textStyle: { color: '#64748b', fontSize: 11 }
|
||||
},
|
||||
grid: { left: 10, right: 20, top: 10, bottom: 32, containLabel: true },
|
||||
xAxis: {
|
||||
type: 'value',
|
||||
axisLabel: { color: '#64748b' }
|
||||
},
|
||||
yAxis: {
|
||||
type: 'category',
|
||||
axisLabel: { color: '#64748b' },
|
||||
data: paketLabels
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: 'Completed',
|
||||
type: 'bar',
|
||||
stack: 'total',
|
||||
barWidth: 18,
|
||||
data: paketDone
|
||||
},
|
||||
{
|
||||
name: 'Not Completed',
|
||||
type: 'bar',
|
||||
stack: 'total',
|
||||
barWidth: 18,
|
||||
data: paketRemaining,
|
||||
itemStyle: { borderRadius: [0, 6, 6, 0] }
|
||||
}
|
||||
]
|
||||
});
|
||||
window.addEventListener('resize', () => paketChart.resize());
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
{{end}}
|
||||
@@ -382,21 +449,30 @@
|
||||
<td class="px-4 py-3 num">{{.NIP}}</td>
|
||||
<td class="px-4 py-3 font-medium text-slate-700">{{.Name}}</td>
|
||||
<td class="px-4 py-3 text-slate-500">{{.Department}}</td>
|
||||
<td class="px-4 py-3 text-slate-500 text-xs max-w-[160px]">
|
||||
{{if .Pemeriksaan}}<span title="{{.Pemeriksaan}}" class="line-clamp-2">{{.Pemeriksaan}}</span>{{else}}-{{end}}
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
{{if .Stations}}
|
||||
<div class="flex flex-wrap gap-1.5">
|
||||
{{range .Stations}}
|
||||
{{if eq .Tone "success"}}
|
||||
<span class="rounded-full border border-emerald-200 bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700">{{.Name}}</span>
|
||||
{{else if eq .Tone "warning"}}
|
||||
<span class="rounded-full border border-amber-200 bg-amber-50 px-2 py-1 text-xs font-medium text-amber-700">{{.Name}}</span>
|
||||
{{else if eq .Tone "danger"}}
|
||||
<span class="rounded-full border border-rose-200 bg-rose-50 px-2 py-1 text-xs font-medium text-rose-700">{{.Name}}</span>
|
||||
{{else}}
|
||||
<span class="rounded-full border border-slate-200 bg-slate-100 px-2 py-1 text-xs font-medium text-slate-600">{{.Name}}</span>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{if not .InTime}}
|
||||
<span class="rounded-full border border-slate-200 bg-slate-100 px-2 py-1 text-xs font-medium text-slate-600">Not Check-In Yet</span>
|
||||
{{else if .Stations}}
|
||||
<details class="group">
|
||||
<summary class="list-none cursor-pointer">
|
||||
<div class="flex flex-wrap gap-1.5 items-center">
|
||||
{{if gt .DoneCount 0}}<span class="rounded-full border border-emerald-200 bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700">Done ({{.DoneCount}})</span>{{end}}
|
||||
{{if gt .ProgressCount 0}}<span class="rounded-full border border-amber-200 bg-amber-50 px-2 py-1 text-xs font-medium text-amber-700">In Progress ({{.ProgressCount}})</span>{{end}}
|
||||
{{if gt .PendingCount 0}}<span class="rounded-full border border-slate-200 bg-slate-100 px-2 py-1 text-xs font-medium text-slate-600">Pending ({{.PendingCount}})</span>{{end}}
|
||||
<svg class="h-3 w-3 shrink-0 text-slate-400 transition-transform group-open:rotate-180" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"/></svg>
|
||||
</div>
|
||||
</summary>
|
||||
<div class="mt-2 flex flex-wrap gap-1.5">
|
||||
{{range .Stations}}
|
||||
{{if eq .Tone "success"}}<span class="rounded-full border border-emerald-200 bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700">{{.Name}}</span>
|
||||
{{else if eq .Tone "warning"}}<span class="rounded-full border border-amber-200 bg-amber-50 px-2 py-1 text-xs font-medium text-amber-700">{{.Name}}</span>
|
||||
{{else}}<span class="rounded-full border border-slate-200 bg-slate-100 px-2 py-1 text-xs font-medium text-slate-600">{{.Name}}</span>{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</details>
|
||||
{{else}}
|
||||
{{if eq .StatusTone "success"}}
|
||||
<span class="rounded-full border border-emerald-200 bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700">{{.Status}}</span>
|
||||
@@ -411,52 +487,53 @@
|
||||
{{end}}
|
||||
</tbody>
|
||||
|
||||
<div id="arrival-mobile-rows" hx-swap-oob="beforeend">
|
||||
<div id="arrival-mobile-rows" hx-swap-oob="beforeend" style="display:contents">
|
||||
{{range .FilteredRows}}
|
||||
<article class="rounded-xl border border-slate-200 p-3">
|
||||
<article class="rounded-xl border border-slate-200 p-3 md:hidden">
|
||||
<p class="font-semibold text-slate-700">{{.Name}}</p>
|
||||
<p class="mt-1 text-xs text-slate-400">{{if .InTime}}{{.InTime}}{{else}}-{{end}} • {{.NIP}} • {{.Department}}</p>
|
||||
<div class="mt-3 flex flex-col gap-1.5">
|
||||
{{if .Stations}}
|
||||
{{range .Stations}}
|
||||
{{if eq .Tone "success"}}
|
||||
<span class="flex w-full items-center gap-2 border border-emerald-200 bg-emerald-50 px-3 py-2 text-xs font-medium text-emerald-700">
|
||||
<svg class="h-3.5 w-3.5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7"/></svg>
|
||||
<span class="truncate">{{.Name}}</span>
|
||||
</span>
|
||||
{{else if eq .Tone "warning"}}
|
||||
<span class="flex w-full items-center gap-2 border border-amber-200 bg-amber-50 px-3 py-2 text-xs font-medium text-amber-700">
|
||||
<svg class="h-3.5 w-3.5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/></svg>
|
||||
<span class="truncate">{{.Name}}</span>
|
||||
</span>
|
||||
{{else if eq .Tone "danger"}}
|
||||
<span class="flex w-full items-center gap-2 border border-rose-200 bg-rose-50 px-3 py-2 text-xs font-medium text-rose-700">
|
||||
<svg class="h-3.5 w-3.5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/></svg>
|
||||
<span class="truncate">{{.Name}}</span>
|
||||
</span>
|
||||
{{else}}
|
||||
<span class="flex w-full items-center gap-2 border border-slate-200 bg-slate-100 px-3 py-2 text-xs font-medium text-slate-600">
|
||||
<svg class="h-3.5 w-3.5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/></svg>
|
||||
<span class="truncate">{{.Name}}</span>
|
||||
</span>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if .Pemeriksaan}}<p class="mt-1 text-xs text-slate-500 line-clamp-1">{{.Pemeriksaan}}</p>{{end}}
|
||||
<div class="mt-3">
|
||||
{{if not .InTime}}
|
||||
<span class="rounded-full border border-slate-200 bg-slate-100 px-2 py-1 text-xs font-medium text-slate-600">Not Check-In Yet</span>
|
||||
{{else if .Stations}}
|
||||
<details class="group">
|
||||
<summary class="list-none cursor-pointer">
|
||||
<div class="flex flex-wrap gap-1.5 items-center">
|
||||
{{if gt .DoneCount 0}}<span class="rounded-full border border-emerald-200 bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700">Done ({{.DoneCount}})</span>{{end}}
|
||||
{{if gt .ProgressCount 0}}<span class="rounded-full border border-amber-200 bg-amber-50 px-2 py-1 text-xs font-medium text-amber-700">In Progress ({{.ProgressCount}})</span>{{end}}
|
||||
{{if gt .PendingCount 0}}<span class="rounded-full border border-slate-200 bg-slate-100 px-2 py-1 text-xs font-medium text-slate-600">Pending ({{.PendingCount}})</span>{{end}}
|
||||
<svg class="h-3 w-3 shrink-0 text-slate-400 transition-transform group-open:rotate-180" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"/></svg>
|
||||
</div>
|
||||
</summary>
|
||||
<div class="mt-2 flex flex-col gap-1.5">
|
||||
{{range .Stations}}
|
||||
{{if eq .Tone "success"}}
|
||||
<span class="flex w-full items-center gap-2 border border-emerald-200 bg-emerald-50 px-3 py-2 text-xs font-medium text-emerald-700">
|
||||
<svg class="h-3.5 w-3.5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7"/></svg>
|
||||
<span class="truncate">{{.Name}}</span>
|
||||
</span>
|
||||
{{else if eq .Tone "warning"}}
|
||||
<span class="flex w-full items-center gap-2 border border-amber-200 bg-amber-50 px-3 py-2 text-xs font-medium text-amber-700">
|
||||
<svg class="h-3.5 w-3.5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/></svg>
|
||||
<span class="truncate">{{.Name}}</span>
|
||||
</span>
|
||||
{{else}}
|
||||
<span class="flex w-full items-center gap-2 border border-slate-200 bg-slate-100 px-3 py-2 text-xs font-medium text-slate-600">
|
||||
<svg class="h-3.5 w-3.5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/></svg>
|
||||
<span class="truncate">{{.Name}}</span>
|
||||
</span>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</details>
|
||||
{{else}}
|
||||
{{if eq .StatusTone "success"}}
|
||||
<span class="flex w-full items-center gap-2 border border-emerald-200 bg-emerald-50 px-3 py-2 text-xs font-medium text-emerald-700">
|
||||
<svg class="h-3.5 w-3.5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7"/></svg>
|
||||
<span class="truncate">{{.Status}}</span>
|
||||
</span>
|
||||
<span class="rounded-full border border-emerald-200 bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700">{{.Status}}</span>
|
||||
{{else if eq .StatusTone "warning"}}
|
||||
<span class="flex w-full items-center gap-2 border border-amber-200 bg-amber-50 px-3 py-2 text-xs font-medium text-amber-700">
|
||||
<svg class="h-3.5 w-3.5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/></svg>
|
||||
<span class="truncate">{{.Status}}</span>
|
||||
</span>
|
||||
<span class="rounded-full border border-amber-200 bg-amber-50 px-2 py-1 text-xs font-medium text-amber-700">{{.Status}}</span>
|
||||
{{else}}
|
||||
<span class="flex w-full items-center gap-2 border border-slate-200 bg-slate-100 px-3 py-2 text-xs font-medium text-slate-600">
|
||||
<svg class="h-3.5 w-3.5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/></svg>
|
||||
<span class="truncate">{{.Status}}</span>
|
||||
</span>
|
||||
<span class="rounded-full border border-slate-200 bg-slate-100 px-2 py-1 text-xs font-medium text-slate-600">{{.Status}}</span>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
@@ -467,7 +544,7 @@
|
||||
<div id="arrival-load-more" hx-swap-oob="outerHTML">
|
||||
{{if .HasMore}}
|
||||
<div
|
||||
hx-get='{{b "/arrival/list"}}?date={{.Date}}&search={{.Search}}&dept={{.Department}}&page={{.NextPage}}'
|
||||
hx-get='{{b "/arrival/list"}}?date={{.Date}}&search={{.Search}}&paket={{.Paket}}&dept={{.Department}}&page={{.NextPage}}'
|
||||
hx-trigger="revealed"
|
||||
hx-swap="outerHTML"
|
||||
class="rounded-lg border border-slate-200 bg-slate-50 px-3 py-2 text-center text-xs font-medium text-slate-500">
|
||||
|
||||
Reference in New Issue
Block a user