feat: add backend API for flexible account record upload and validation, including concurrent account_id fetching, and a new frontend upload page.

This commit is contained in:
2026-01-30 13:14:12 +08:00
parent 2b9831539c
commit 2a0a8941c2
2 changed files with 15 additions and 7 deletions

View File

@@ -58,6 +58,7 @@ export default function Upload() {
const [status, setStatus] = useState<ProcessStatus | null>(null)
const [polling, setPolling] = useState(false)
const [loading, setLoading] = useState(false)
const [refreshing, setRefreshing] = useState(false)
const [importResult, setImportResult] = useState<{
imported: number
total: number
@@ -232,8 +233,13 @@ export default function Upload() {
<Button
variant="outline"
size="sm"
onClick={() => { loadStats(); fetchStatus(); }}
icon={<RefreshCw className={`h-4 w-4 ${polling ? 'animate-spin' : ''}`} />}
disabled={refreshing}
onClick={async () => {
setRefreshing(true)
await Promise.all([loadStats(), fetchStatus()])
setTimeout(() => setRefreshing(false), 500)
}}
icon={<RefreshCw className={`h-4 w-4 ${refreshing || polling ? 'animate-spin' : ''}`} />}
>
</Button>