feat: add audit log viewing for vendor and tenant personas
Vendor sees all audit events with tenant filter at /vendor/audit. Tenant admin sees only their own events at /tenant/audit. Both support pagination, action/result filters, and text search. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
23
ui/src/pages/tenant/TenantAuditPage.tsx
Normal file
23
ui/src/pages/tenant/TenantAuditPage.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import { useState } from 'react';
|
||||
import { useTenantAuditLog } from '../../api/tenant-hooks';
|
||||
import { AuditLogTable } from '../../components/AuditLogTable';
|
||||
import type { AuditLogFilters } from '../../types/api';
|
||||
|
||||
export function TenantAuditPage() {
|
||||
const [filters, setFilters] = useState<AuditLogFilters>({ page: 0, size: 25 });
|
||||
const { data, isLoading } = useTenantAuditLog(filters);
|
||||
|
||||
return (
|
||||
<div style={{ padding: 24, display: 'flex', flexDirection: 'column', gap: 20 }}>
|
||||
<h1 style={{ margin: 0, fontSize: '1.25rem', fontWeight: 600 }}>Audit Log</h1>
|
||||
<AuditLogTable
|
||||
data={data}
|
||||
isLoading={isLoading}
|
||||
filters={filters}
|
||||
onFiltersChange={setFilters}
|
||||
showTenantColumn={false}
|
||||
showTenantFilter={false}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
25
ui/src/pages/vendor/VendorAuditPage.tsx
vendored
Normal file
25
ui/src/pages/vendor/VendorAuditPage.tsx
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
import { useState } from 'react';
|
||||
import { useVendorAuditLog, useVendorTenants } from '../../api/vendor-hooks';
|
||||
import { AuditLogTable } from '../../components/AuditLogTable';
|
||||
import type { AuditLogFilters } from '../../types/api';
|
||||
|
||||
export function VendorAuditPage() {
|
||||
const [filters, setFilters] = useState<AuditLogFilters>({ page: 0, size: 25 });
|
||||
const { data, isLoading } = useVendorAuditLog(filters);
|
||||
const { data: tenants } = useVendorTenants();
|
||||
|
||||
return (
|
||||
<div style={{ padding: 24, display: 'flex', flexDirection: 'column', gap: 20 }}>
|
||||
<h1 style={{ margin: 0, fontSize: '1.25rem', fontWeight: 600 }}>Audit Log</h1>
|
||||
<AuditLogTable
|
||||
data={data}
|
||||
isLoading={isLoading}
|
||||
filters={filters}
|
||||
onFiltersChange={setFilters}
|
||||
showTenantColumn
|
||||
showTenantFilter
|
||||
tenants={tenants}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user