feat: implement trash auto-purge, settings layout update, larger folder icons, and legacy version cleanup
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m18s
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m18s
This commit is contained in:
parent
c3b1fe8de1
commit
71ba029fbc
8 changed files with 256 additions and 103 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import { useState, useEffect } from 'react';
|
||||
import { motion } from 'framer-motion';
|
||||
import { Settings, Shield, Image as ImageIcon, History, Trash2, Save, Loader2 } from 'lucide-react';
|
||||
import { Settings, Shield, Image as ImageIcon, History, Trash2, Save, Loader2, LogOut } from 'lucide-react';
|
||||
import api from '@/lib/api';
|
||||
|
||||
interface SettingsData {
|
||||
|
|
@ -10,11 +10,14 @@ interface SettingsData {
|
|||
grid_size: string;
|
||||
thumbnail_images: string;
|
||||
thumbnail_videos: string;
|
||||
max_versions: string;
|
||||
trash_auto_purge_days: string;
|
||||
}
|
||||
|
||||
export default function SettingsPage() {
|
||||
interface SettingsPageProps {
|
||||
onLogout: () => void;
|
||||
}
|
||||
|
||||
export default function SettingsPage({ onLogout }: SettingsPageProps) {
|
||||
const [settings, setSettings] = useState<SettingsData | null>(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [saving, setSaving] = useState(false);
|
||||
|
|
@ -54,7 +57,6 @@ export default function SettingsPage() {
|
|||
grid_size: s.grid_size || '200',
|
||||
thumbnail_images: s.thumbnail_images || 'true',
|
||||
thumbnail_videos: s.thumbnail_videos || 'true',
|
||||
max_versions: s.max_versions || '1',
|
||||
trash_auto_purge_days: s.trash_auto_purge_days || '14',
|
||||
};
|
||||
setSettings(loaded);
|
||||
|
|
@ -227,30 +229,7 @@ export default function SettingsPage() {
|
|||
</div>
|
||||
)
|
||||
},
|
||||
{
|
||||
id: 'versioning',
|
||||
title: 'File Versioning',
|
||||
icon: <History className="w-5 h-5" />,
|
||||
content: (
|
||||
<div className="space-y-4">
|
||||
<div>
|
||||
<label className="block text-sm font-medium mb-2" style={{ color: 'var(--color-text-primary)' }}>Maximum Versions to Keep</label>
|
||||
<p className="text-xs mb-3" style={{ color: 'var(--color-text-secondary)' }}>
|
||||
Older versions will be automatically deleted when a file is overwritten more times than this limit. Set to 0 to disable versioning.
|
||||
</p>
|
||||
<input
|
||||
type="number"
|
||||
min="0"
|
||||
max="100"
|
||||
value={settings.max_versions}
|
||||
onChange={(e) => setSettings({ ...settings, max_versions: e.target.value })}
|
||||
className="w-full max-w-xs px-3 py-2 rounded-lg text-sm outline-none"
|
||||
style={{ backgroundColor: 'var(--color-bg-primary)', border: '1px solid var(--color-border)', color: 'var(--color-text-primary)' }}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
},
|
||||
|
||||
{
|
||||
id: 'trash',
|
||||
title: 'Trash Auto-Purge',
|
||||
|
|
@ -322,7 +301,16 @@ export default function SettingsPage() {
|
|||
|
||||
|
||||
|
||||
<div className="mt-8 flex justify-end">
|
||||
<div className="mt-8 flex justify-between items-center">
|
||||
<button
|
||||
onClick={onLogout}
|
||||
className="flex items-center gap-2 px-6 py-2.5 rounded-xl text-sm font-medium transition-all hover:opacity-80"
|
||||
style={{ backgroundColor: 'rgba(239, 68, 68, 0.1)', color: 'var(--color-danger)' }}
|
||||
>
|
||||
<LogOut className="w-4 h-4" />
|
||||
Sign Out
|
||||
</button>
|
||||
|
||||
<button
|
||||
onClick={handleSave}
|
||||
disabled={saving}
|
||||
|
|
|
|||
Reference in a new issue