Improve soundbox ops dashboard and registry editing

This commit is contained in:
Wira Basalamah
2026-06-08 15:56:12 +07:00
parent 836eb7db85
commit 67dc286c1a
18 changed files with 768 additions and 120 deletions

View File

@ -182,7 +182,7 @@
<div class="flex items-center gap-3 lg:gap-6 flex-1 min-w-0">
<div class="relative w-full max-w-md hidden sm:block">
<span class="material-symbols-outlined absolute left-3 top-1/2 -translate-y-1/2 text-on-surface-variant text-body-lg">search</span>
<input class="w-full pl-10 pr-4 py-2 bg-slate-100 dark:bg-slate-800 border-none rounded-full focus:ring-2 focus:ring-primary/20 text-body-md" placeholder="Search devices, merchants, or transactions..." type="text"/>
<input id="dashboard-global-search" class="w-full pl-10 pr-4 py-2 bg-slate-100 dark:bg-slate-800 border-none rounded-full focus:ring-2 focus:ring-primary/20 text-body-md" placeholder="Search devices, merchants, or transactions..." type="text"/>
</div>
<div class="flex items-center gap-4 overflow-x-auto whitespace-nowrap">
<a class="text-primary dark:text-primary-fixed border-b-2 border-primary h-[72px] flex items-center px-2 font-bold" href="/ui/admin-dashboard-overview">Dashboard</a>
@ -1004,6 +1004,23 @@
AdminDashboard.load();
const dashboardSearch = document.getElementById("dashboard-global-search");
dashboardSearch?.addEventListener("keydown", (event) => {
if (event.key === "Escape" && dashboardSearch.value) {
dashboardSearch.value = "";
return;
}
if (event.key !== "Enter") return;
const q = dashboardSearch.value.trim();
if (!q) return;
const target = /^(tx|txn|rrn|pay|ref)/i.test(q)
? "/ui/transaction-history-monitoring"
: /^(mch|merchant|biz|store)/i.test(q)
? "/ui/merchant-list-management"
: "/ui/device-registry-monitoring";
window.location.href = `${target}?q=${encodeURIComponent(q)}`;
});
// Micro-interactions for hovering and state visual feedback
document.querySelectorAll(".hover\\:shadow-lg").forEach((card) => {
card.addEventListener("mouseenter", () => {