Skip to content

Commit f5f1238

Browse files
chore: wip
1 parent 0defec8 commit f5f1238

File tree

3 files changed

+20
-33
lines changed

3 files changed

+20
-33
lines changed

packages/devtools/src/layouts/app.stx

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
.sidebar.collapsed .nav-label { opacity: 0; height: 0; padding: 0; overflow: hidden; }
1717
.sidebar.collapsed .nav-item-text { display: none; }
1818
.main-wrapper.sidebar-collapsed { margin-left: 56px !important; }
19+
20+
/* Active states */
21+
.nav-item.active { background: #6366f1; color: white; }
22+
.nav-item.active svg { opacity: 1; }
1923
</style>
2024
@stack('styles')
2125
</head>
@@ -46,20 +50,11 @@
4650

4751
// Active nav highlighting based on current route
4852
const currentPath = useRoute().path
49-
const navItems = document.querySelectorAll('#sidebar .nav-item')
50-
navItems.forEach((item) => {
53+
document.querySelectorAll('#sidebar .nav-item').forEach((item) => {
5154
const href = item.getAttribute('href')
5255
if (!href) return
5356
const isActive = href === '/' ? currentPath === '/' : currentPath.startsWith(href)
54-
if (isActive) {
55-
item.classList.remove('text-zinc-400', 'hover:bg-[#1e1e26]', 'hover:text-zinc-50')
56-
item.classList.add('bg-indigo-500', 'text-white')
57-
const icon = item.querySelector('svg')
58-
if (icon) {
59-
icon.classList.remove('opacity-70')
60-
icon.classList.add('opacity-100')
61-
}
62-
}
57+
if (isActive) item.classList.add('active')
6358
})
6459
</script>
6560
@stack('scripts')

packages/devtools/src/pages/jobs.stx

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
@push('styles')
66
<style>
77
.search-input::placeholder { color: #71717a; }
8+
.filter-btn.active { background: #6366f1; color: white; }
89
</style>
910
@endpush
1011

@@ -20,11 +21,11 @@
2021
<!-- Toolbar -->
2122
<div class="flex items-center gap-3 mb-6 flex-wrap">
2223
<div class="flex gap-1 bg-[#141419] border border-zinc-800 rounded-md p-1" ref="filter-bar">
23-
<button class="filter-btn px-3 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150 bg-indigo-500 !text-white active" data-status="all">All</button>
24-
<button class="filter-btn px-3 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150 bg-transparent" data-status="waiting">Waiting</button>
25-
<button class="filter-btn px-3 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150 bg-transparent" data-status="active">Active</button>
26-
<button class="filter-btn px-3 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150 bg-transparent" data-status="completed">Completed</button>
27-
<button class="filter-btn px-3 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150 bg-transparent" data-status="failed">Failed</button>
24+
<button class="filter-btn px-3 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150 active" data-status="all">All</button>
25+
<button class="filter-btn px-3 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150" data-status="waiting">Waiting</button>
26+
<button class="filter-btn px-3 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150" data-status="active">Active</button>
27+
<button class="filter-btn px-3 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150" data-status="completed">Completed</button>
28+
<button class="filter-btn px-3 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150" data-status="failed">Failed</button>
2829
</div>
2930
<div class="relative flex-1 max-w-[280px]">
3031
<svg class="absolute left-3 top-1/2 -translate-y-1/2 text-zinc-500 pointer-events-none" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
@@ -125,13 +126,8 @@
125126
useEventListener('click', (e: Event) => {
126127
const target = (e.target as HTMLElement).closest('.filter-btn') as HTMLButtonElement | null
127128
if (!target) return
128-
const filterBar = useRef('filter-bar')
129-
filterBar.querySelectorAll('.filter-btn').forEach((b: Element) => {
130-
b.classList.remove('active', 'bg-indigo-500', '!text-white')
131-
b.classList.add('bg-transparent')
132-
})
133-
target.classList.add('active', 'bg-indigo-500', '!text-white')
134-
target.classList.remove('bg-transparent')
129+
useRef('filter-bar').querySelectorAll('.filter-btn').forEach((b: Element) => b.classList.remove('active'))
130+
target.classList.add('active')
135131
currentStatus = target.dataset.status!
136132
filterJobs()
137133
}, { target: '[ref="filter-bar"]' })

packages/devtools/src/pages/metrics.stx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
@push('styles')
1010
<style>
1111
.chart-container { position: relative; height: 280px; width: 100%; }
12+
.time-range-btn.active { background: #6366f1; color: white; }
1213
</style>
1314
@endpush
1415

@@ -20,9 +21,9 @@
2021
<p class="text-sm text-zinc-500 mt-1">Job throughput, latency, and error analysis</p>
2122
</div>
2223
<div class="flex gap-1 bg-[#141419] border border-zinc-800 rounded-md p-1" ref="time-range-bar">
23-
<button class="time-range-btn px-3.5 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150 bg-indigo-500 !text-white active" data-range="24h">24h</button>
24-
<button class="time-range-btn px-3.5 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150 bg-transparent" data-range="7d">7d</button>
25-
<button class="time-range-btn px-3.5 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150 bg-transparent" data-range="30d">30d</button>
24+
<button class="time-range-btn px-3.5 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150 active" data-range="24h">24h</button>
25+
<button class="time-range-btn px-3.5 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150" data-range="7d">7d</button>
26+
<button class="time-range-btn px-3.5 py-1.5 border-none rounded text-zinc-400 text-sm font-medium cursor-pointer hover:text-zinc-50 hover:bg-[#1e1e26] transition-all duration-150" data-range="30d">30d</button>
2627
</div>
2728
</div>
2829

@@ -190,13 +191,8 @@
190191

191192
// Time range button handling via event delegation
192193
function setActiveButton(activeBtn: HTMLButtonElement): void {
193-
const timeRangeBar = useRef('time-range-bar')
194-
timeRangeBar.querySelectorAll('.time-range-btn').forEach((b: Element) => {
195-
b.classList.remove('active', 'bg-indigo-500', '!text-white')
196-
b.classList.add('bg-transparent')
197-
})
198-
activeBtn.classList.add('active', 'bg-indigo-500', '!text-white')
199-
activeBtn.classList.remove('bg-transparent')
194+
useRef('time-range-bar').querySelectorAll('.time-range-btn').forEach((b: Element) => b.classList.remove('active'))
195+
activeBtn.classList.add('active')
200196
}
201197

202198
useEventListener('click', (e: Event) => {

0 commit comments

Comments
 (0)