Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b0ac7426b7 | |||
| 941761ad83 | |||
| c21ed699ec | |||
| f77582fdcd | |||
| 654becfd86 | |||
| dcc3f692f3 | |||
| 1d22f1e85e | |||
| b87b1eceae | |||
| f2fb81024e | |||
| 76f0e83a65 |
@@ -1,3 +1,3 @@
|
||||
831457
|
||||
831458
|
||||
831472
|
||||
836027
|
||||
836028
|
||||
836042
|
||||
|
||||
@@ -17,7 +17,15 @@ https://:8919 {
|
||||
}
|
||||
|
||||
# Next.js HMR Support (WebSocket)
|
||||
header_up X-Forwarded-For {remote_host}
|
||||
handle /_next/webpack-hmr {
|
||||
reverse_proxy http://localhost:8917 {
|
||||
header_up Upgrade {>Upgrade}
|
||||
header_up Connection {>Connection}
|
||||
}
|
||||
}
|
||||
|
||||
reverse_proxy http://localhost:8917 {
|
||||
header_up X-Forwarded-For {remote_host}
|
||||
header_up X-Forwarded-Proto https
|
||||
header_up X-Forwarded-Host {host}
|
||||
}
|
||||
@@ -37,7 +45,7 @@ https://:8918 {
|
||||
}
|
||||
|
||||
reverse_proxy http://localhost:8916 {
|
||||
header_up X-Forwarded-For {remote_host}
|
||||
header_up X-Forwarded-For {remote_host}
|
||||
header_up X-Forwarded-Proto https
|
||||
header_up X-Forwarded-Host {host}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ async def export_inventory_snapshot(
|
||||
# Log export action
|
||||
from backend.models import AuditLog
|
||||
audit_entry = AuditLog(
|
||||
user_id=admin_user.id,
|
||||
user_id=admin_user.sub,
|
||||
action="EXPORT_INVENTORY_SNAPSHOT",
|
||||
details=f"Exported in {format_type} format",
|
||||
)
|
||||
@@ -113,7 +113,7 @@ async def export_audit_trail(
|
||||
|
||||
# Log export action
|
||||
audit_entry = AuditLog(
|
||||
user_id=admin_user.id,
|
||||
user_id=admin_user.sub,
|
||||
action="EXPORT_AUDIT_TRAIL",
|
||||
details=f"Exported in {format_type} format",
|
||||
)
|
||||
@@ -211,7 +211,7 @@ async def export_db(
|
||||
|
||||
# Log export action
|
||||
audit_entry = AuditLog(
|
||||
user_id=admin_user.id,
|
||||
user_id=admin_user.sub,
|
||||
action="EXPORT_DB",
|
||||
details=f"Exported {type} in {format_type} format",
|
||||
)
|
||||
|
||||
BIN
backups/ainventory_2026-04-23_15-08-46.tar.gz
Normal file
BIN
backups/ainventory_2026-04-23_15-08-46.tar.gz
Normal file
Binary file not shown.
BIN
backups/ainventory_2026-04-23_15-15-00.tar.gz
Normal file
BIN
backups/ainventory_2026-04-23_15-15-00.tar.gz
Normal file
Binary file not shown.
BIN
backups/ainventory_2026-04-23_15-18-15.tar.gz
Normal file
BIN
backups/ainventory_2026-04-23_15-18-15.tar.gz
Normal file
Binary file not shown.
BIN
backups/ainventory_2026-04-23_15-19-55.tar.gz
Normal file
BIN
backups/ainventory_2026-04-23_15-19-55.tar.gz
Normal file
Binary file not shown.
BIN
backups/ainventory_2026-04-23_15-24-28.tar.gz
Normal file
BIN
backups/ainventory_2026-04-23_15-24-28.tar.gz
Normal file
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": "1.14.14",
|
||||
"last_build": "2026-04-23-1508",
|
||||
"version": "1.14.19",
|
||||
"last_build": "2026-04-23-1527",
|
||||
"codename": "ConfigCore",
|
||||
"commit": "6f9716c3"
|
||||
"commit": "941761ad"
|
||||
}
|
||||
@@ -29,26 +29,27 @@ export function ExportPanel() {
|
||||
};
|
||||
|
||||
return (
|
||||
<div data-testid="admin-tab-exports" className="p-4 md:p-6 bg-surface border border-slate-800 rounded-3xl space-y-4 md:space-y-6">
|
||||
<header className="flex items-center gap-3">
|
||||
<div className="p-2 md:p-3 bg-emerald-500/10 rounded-2xl text-emerald-400 border border-emerald-500/20 shadow-inner">
|
||||
<FileDown size={24} className="md:w-7 md:h-7" />
|
||||
<div data-testid="admin-tab-exports" className="bg-surface/50 border border-slate-800/50 rounded-[2.5rem] p-4 md:p-6 flex flex-col shadow-2xl transition-all h-full">
|
||||
<div className="flex items-center gap-3 mb-4 md:mb-6">
|
||||
<div className="w-10 h-10 rounded-xl bg-indigo-500/10 flex items-center justify-center text-indigo-400 border border-indigo-500/20">
|
||||
<FileDown size={20} />
|
||||
</div>
|
||||
<div>
|
||||
<h2 className="text-xl md:text-2xl font-normal text-white">Export & Reports</h2>
|
||||
<p className="text-[10px] md:text-xs text-muted font-normal tracking-tight mt-0.5">
|
||||
Download inventory snapshots and audit trails
|
||||
</p>
|
||||
<h2 className="text-xl font-normal text-white tracking-tight">Export & Reports</h2>
|
||||
<p className="text-[10px] md:text-xs text-muted font-normal tracking-tight">Download system snapshots and action logs</p>
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
|
||||
<div className="grid md:grid-cols-2 gap-4">
|
||||
{/* Inventory Snapshot Section */}
|
||||
<div className="p-4 bg-slate-800/30 border border-slate-800 rounded-2xl space-y-4">
|
||||
<div>
|
||||
<h3 className="text-sm font-normal text-secondary">Inventory Snapshot</h3>
|
||||
<p className="text-xs text-muted mt-0.5">
|
||||
Export current inventory state with all item details
|
||||
<div className="p-4 bg-background/40 border border-slate-800/40 rounded-2xl hover:border-primary/20 transition-all group flex flex-col justify-between">
|
||||
<div className="mb-4">
|
||||
<h3 className="text-sm font-normal text-secondary flex items-center gap-2">
|
||||
<FileSpreadsheet size={14} className="text-primary" />
|
||||
Inventory Snapshot
|
||||
</h3>
|
||||
<p className="text-xs text-muted mt-1 leading-relaxed">
|
||||
Export current inventory state with all item details and locations.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -56,66 +57,52 @@ export function ExportPanel() {
|
||||
<button
|
||||
onClick={() => handleExportSnapshot("csv")}
|
||||
disabled={isLoading}
|
||||
className="bg-surface border border-slate-800 hover:bg-slate-800/50 text-white font-normal py-2 px-3 rounded-xl transition-all active:scale-[0.98] disabled:opacity-50 disabled:pointer-events-none flex items-center justify-center gap-2 text-xs focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none"
|
||||
className="px-5 py-1.5 bg-primary hover:bg-primary/90 text-white rounded-xl text-sm font-normal transition-all active:scale-95 shadow-xl shadow-primary/10 tracking-tight border border-primary/30 flex items-center justify-center gap-2 disabled:opacity-50"
|
||||
aria-label="Export inventory snapshot as CSV"
|
||||
>
|
||||
{isLoading ? (
|
||||
<Loader2 size={14} className="animate-spin" />
|
||||
) : (
|
||||
<FileText size={14} />
|
||||
)}
|
||||
{isLoading ? <Loader2 size={14} className="animate-spin" /> : <FileText size={14} />}
|
||||
CSV
|
||||
</button>
|
||||
<button
|
||||
onClick={() => handleExportSnapshot("xlsx")}
|
||||
disabled={isLoading}
|
||||
className="bg-surface border border-slate-800 hover:bg-slate-800/50 text-white font-normal py-2 px-3 rounded-xl transition-all active:scale-[0.98] disabled:opacity-50 disabled:pointer-events-none flex items-center justify-center gap-2 text-xs focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none"
|
||||
className="px-5 py-1.5 bg-primary hover:bg-primary/90 text-white rounded-xl text-sm font-normal transition-all active:scale-95 shadow-xl shadow-primary/10 tracking-tight border border-primary/30 flex items-center justify-center gap-2 disabled:opacity-50"
|
||||
aria-label="Export inventory snapshot as Excel"
|
||||
>
|
||||
{isLoading ? (
|
||||
<Loader2 size={14} className="animate-spin" />
|
||||
) : (
|
||||
<FileSpreadsheet size={14} />
|
||||
)}
|
||||
{isLoading ? <Loader2 size={14} className="animate-spin" /> : <FileSpreadsheet size={14} />}
|
||||
Excel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Audit Trail Section */}
|
||||
<div className="p-4 bg-slate-800/30 border border-slate-800 rounded-2xl space-y-4">
|
||||
<div>
|
||||
<h3 className="text-sm font-normal text-secondary">Audit Trail</h3>
|
||||
<p className="text-xs text-muted mt-0.5">
|
||||
Complete log of system actions and changes
|
||||
<div className="p-4 bg-background/40 border border-slate-800/40 rounded-2xl hover:border-primary/20 transition-all group flex flex-col justify-between">
|
||||
<div className="mb-4">
|
||||
<h3 className="text-sm font-normal text-secondary flex items-center gap-2">
|
||||
<FileText size={14} className="text-indigo-400" />
|
||||
Audit Trail
|
||||
</h3>
|
||||
<p className="text-xs text-muted mt-1 leading-relaxed">
|
||||
Complete history of system actions, changes, and user operations.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-2 gap-2">
|
||||
<button
|
||||
onClick={() => handleExportAuditTrail("csv")}
|
||||
disabled={isLoading}
|
||||
className="bg-surface border border-slate-800 hover:bg-slate-800/50 text-white font-normal py-2 px-3 rounded-xl transition-all active:scale-[0.98] disabled:opacity-50 disabled:pointer-events-none flex items-center justify-center gap-2 text-xs focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none"
|
||||
className="px-5 py-1.5 bg-primary hover:bg-primary/90 text-white rounded-xl text-sm font-normal transition-all active:scale-95 shadow-xl shadow-primary/10 tracking-tight border border-primary/30 flex items-center justify-center gap-2 disabled:opacity-50"
|
||||
aria-label="Export audit trail as CSV"
|
||||
>
|
||||
{isLoading ? (
|
||||
<Loader2 size={14} className="animate-spin" />
|
||||
) : (
|
||||
<FileText size={14} />
|
||||
)}
|
||||
{isLoading ? <Loader2 size={14} className="animate-spin" /> : <FileText size={14} />}
|
||||
CSV
|
||||
</button>
|
||||
<button
|
||||
onClick={() => handleExportAuditTrail("xlsx")}
|
||||
disabled={isLoading}
|
||||
className="bg-surface border border-slate-800 hover:bg-slate-800/50 text-white font-normal py-2 px-3 rounded-xl transition-all active:scale-[0.98] disabled:opacity-50 disabled:pointer-events-none flex items-center justify-center gap-2 text-xs focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none"
|
||||
className="px-5 py-1.5 bg-primary hover:bg-primary/90 text-white rounded-xl text-sm font-normal transition-all active:scale-95 shadow-xl shadow-primary/10 tracking-tight border border-primary/30 flex items-center justify-center gap-2 disabled:opacity-50"
|
||||
aria-label="Export audit trail as Excel"
|
||||
>
|
||||
{isLoading ? (
|
||||
<Loader2 size={14} className="animate-spin" />
|
||||
) : (
|
||||
<FileSpreadsheet size={14} />
|
||||
)}
|
||||
{isLoading ? <Loader2 size={14} className="animate-spin" /> : <FileSpreadsheet size={14} />}
|
||||
Excel
|
||||
</button>
|
||||
</div>
|
||||
@@ -123,8 +110,9 @@ export function ExportPanel() {
|
||||
</div>
|
||||
|
||||
{error && (
|
||||
<div className="p-3 bg-rose-500/10 border border-rose-500/20 rounded-xl text-rose-500 text-xs flex items-center gap-2">
|
||||
<span>Error: {error}</span>
|
||||
<div className="mt-4 p-3 bg-rose-500/10 border border-rose-500/20 rounded-xl text-rose-500 text-[10px] flex items-center gap-2 animate-in slide-in-from-top-2 duration-300">
|
||||
<div className="w-1.5 h-1.5 bg-rose-500 rounded-full animate-pulse" />
|
||||
<span className="font-normal truncate">Error: {error}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user