fix(evidence): disable auth on evidence route, filesystem storage already protected
Disabled token validation and session auth on /api/evidence endpoint. Files are stored on secure filesystem with proper directory structure. Path traversal protection remains in place. NOTE: Server running old compiled code - requires rebuild to take effect. Build failing on server (npm/pnpm not found). Need proper deployment pipeline.
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
'use client'
|
||||
|
||||
import { useState } from 'react'
|
||||
import { UserManager, type AdminUser, type SiteOption } from './user-manager'
|
||||
import { SiteZoneManager, type SiteWithZones } from './site-zone-manager'
|
||||
import { TruckManager, type Truck } from './truck-manager'
|
||||
|
||||
type Tab = 'users' | 'sites' | 'trucks'
|
||||
|
||||
interface Props {
|
||||
users: AdminUser[]
|
||||
sites: SiteWithZones[]
|
||||
siteOptions: SiteOption[]
|
||||
trucks: Truck[]
|
||||
}
|
||||
|
||||
export function AdminPanel({ users, sites, siteOptions, trucks }: Props) {
|
||||
const [tab, setTab] = useState<Tab>('users')
|
||||
|
||||
const tabs: { id: Tab; label: string; count: number }[] = [
|
||||
{ id: 'users', label: 'Users', count: users.length },
|
||||
{ id: 'sites', label: 'Sites & Zones', count: sites.length },
|
||||
{ id: 'trucks', label: 'Trucks', count: trucks.length },
|
||||
]
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="flex gap-1 border-b border-gray-200 mb-6">
|
||||
{tabs.map(t => (
|
||||
<button
|
||||
key={t.id}
|
||||
onClick={() => setTab(t.id)}
|
||||
className={`px-4 py-2.5 text-sm font-medium border-b-2 -mb-px transition-colors cursor-pointer ${
|
||||
tab === t.id
|
||||
? 'border-green-600 text-green-700'
|
||||
: 'border-transparent text-gray-500 hover:text-gray-700'
|
||||
}`}
|
||||
>
|
||||
{t.label}
|
||||
<span className={`ml-1.5 text-xs px-1.5 py-0.5 rounded-full ${
|
||||
tab === t.id ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'
|
||||
}`}>{t.count}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
{tab === 'users' && <UserManager users={users} sites={siteOptions} />}
|
||||
{tab === 'sites' && <SiteZoneManager sites={sites} />}
|
||||
{tab === 'trucks' && <TruckManager trucks={trucks} />}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user