Commit awal: prototipe UI SIAKAD Untan
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
@php
|
||||
$tgl = fn (string $w): string => \Illuminate\Support\Carbon::parse($w)->locale('id')->isoFormat('D MMM YYYY, HH.mm');
|
||||
@endphp
|
||||
|
||||
<x-layouts.app title="Cadangan data">
|
||||
<x-ui.page-header title="Cadangan data" description="Riwayat cadangan basis data dan jadwal pencadangan otomatis.">
|
||||
<x-slot:actions>
|
||||
<x-ui.confirm
|
||||
:action="route('superuser.cadangan.store')"
|
||||
title="Buat cadangan sekarang?"
|
||||
message="Pencadangan manual berjalan di latar belakang dan dapat memperlambat sistem beberapa menit."
|
||||
trigger-label="Buat cadangan sekarang"
|
||||
confirm-label="Ya, buat cadangan"
|
||||
variant="secondary"
|
||||
icon="circle-stack"
|
||||
/>
|
||||
</x-slot:actions>
|
||||
</x-ui.page-header>
|
||||
|
||||
<div class="stack">
|
||||
<x-ui.stats aria-label="Ringkasan cadangan">
|
||||
<x-ui.stat label="Cadangan berhasil" :value="$jumlah" icon="check-circle" hint="Tersimpan di penyimpanan lokal" />
|
||||
<x-ui.stat label="Cadangan terakhir" :value="$terakhir ? \Illuminate\Support\Carbon::parse($terakhir['waktu'])->locale('id')->isoFormat('D MMM') : '-'" icon="clock" :hint="$terakhir['berkas'] ?? 'Belum ada'" />
|
||||
<x-ui.stat label="Total ukuran" :value="number_format($totalMb, 1, ',', '.').' MB'" icon="server-stack" hint="Seluruh cadangan berhasil" />
|
||||
</x-ui.stats>
|
||||
|
||||
<div class="split">
|
||||
<x-glass.panel padding="none">
|
||||
<x-ui.table label="Riwayat cadangan">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Berkas</th>
|
||||
<th scope="col">Waktu</th>
|
||||
<th scope="col" class="num">Ukuran</th>
|
||||
<th scope="col">Status</th>
|
||||
<th scope="col" class="table__actions"><span class="visually-hidden">Aksi</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($riwayat as $b)
|
||||
<tr>
|
||||
<td>
|
||||
<span class="table__title">{{ $b['berkas'] }}</span>
|
||||
<span class="table__meta block">{{ $b['jenis'] }}, {{ $b['durasi'] }}</span>
|
||||
</td>
|
||||
<td>{{ $tgl($b['waktu']) }}</td>
|
||||
<td class="num">{{ $b['ukuran'] > 0 ? number_format($b['ukuran'], 1, ',', '.').' MB' : '-' }}</td>
|
||||
<td><x-ui.badge :tone="$b['status'] === 'Berhasil' ? 'success' : 'danger'">{{ $b['status'] }}</x-ui.badge></td>
|
||||
<td class="table__actions">
|
||||
@if ($b['status'] === 'Berhasil')
|
||||
<x-ui.confirm
|
||||
class="inline-flex"
|
||||
:action="route('superuser.cadangan.pulihkan', $b['id'])"
|
||||
title="Pulihkan dari cadangan ini?"
|
||||
message="Data saat ini akan diganti dengan isi cadangan. Tindakan ini tidak dapat dibatalkan."
|
||||
trigger-label="Pulihkan"
|
||||
confirm-label="Ya, pulihkan"
|
||||
tone="danger"
|
||||
icon="arrow-down-tray"
|
||||
/>
|
||||
@endif
|
||||
<x-ui.confirm
|
||||
class="inline-flex"
|
||||
:action="route('superuser.cadangan.destroy', $b['id'])"
|
||||
method="DELETE"
|
||||
title="Hapus cadangan ini?"
|
||||
:message="$b['berkas'].' akan dihapus permanen.'"
|
||||
confirm-label="Ya, hapus"
|
||||
tone="danger"
|
||||
icon="trash"
|
||||
:icon-only="true"
|
||||
label="Hapus cadangan"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</x-ui.table>
|
||||
</x-glass.panel>
|
||||
|
||||
<form method="POST" action="{{ route('superuser.cadangan.jadwal') }}" novalidate>
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<x-glass.panel padding="lg" class="grid gap-4">
|
||||
<x-form.section title="Jadwal otomatis" description="Cadangan dibuat otomatis sesuai jadwal ini." :columns="1">
|
||||
<x-form.select name="frekuensi" label="Frekuensi" :options="['harian' => 'Setiap hari', 'mingguan' => 'Setiap minggu', 'bulanan' => 'Setiap bulan']" :value="$jadwal['frekuensi']" />
|
||||
<x-form.field name="jam" label="Jam pencadangan" type="time" :value="$jadwal['jam']" />
|
||||
<x-form.field name="retensi" label="Masa simpan" type="number" :value="$jadwal['retensi']" suffix="hari" min="1" max="365" hint="Cadangan lebih lama dari ini dihapus otomatis." />
|
||||
</x-form.section>
|
||||
<x-ui.button type="submit" icon="check" :block="true">Simpan jadwal</x-ui.button>
|
||||
</x-glass.panel>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</x-layouts.app>
|
||||
Reference in New Issue
Block a user