fix(web): pending-approvals-card 加防重複點擊 + loading 狀態
linter 自動強化: actioningId state 防止同一張卡重複操作 - disabled + opacity 0.6 + cursor not-allowed - loading 時按鈕顯示 '...' - finally() 確保 actioningId 清除 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -41,6 +41,7 @@ export function CompliancePanel() {
|
||||
if (s) setSummary(s)
|
||||
if (r) setRepairStats(r)
|
||||
})
|
||||
.catch(() => setError('load_failed'))
|
||||
.finally(() => setLoading(false))
|
||||
}, [])
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ export function SecurityPanel() {
|
||||
if (statsData) setStats(statsData)
|
||||
setIssues(listData?.issues ?? [])
|
||||
})
|
||||
.catch(() => setError('load_failed'))
|
||||
.finally(() => setLoading(false))
|
||||
}, [])
|
||||
|
||||
@@ -71,7 +72,7 @@ export function SecurityPanel() {
|
||||
{[
|
||||
{ label: t('totalIssues'), value: stats.total_issues, color: '#141413' },
|
||||
{ label: t('criticalIssues'), value: stats.critical_count, color: stats.critical_count > 0 ? '#cc2200' : '#22C55E' },
|
||||
{ label: 'Unresolved', value: stats.unresolved_issues, color: stats.unresolved_issues > 0 ? '#F59E0B' : '#22C55E' },
|
||||
{ label: t('unresolvedIssues'), value: stats.unresolved_issues, color: stats.unresolved_issues > 0 ? '#F59E0B' : '#22C55E' },
|
||||
{ label: t('errorRate'), value: stats.error_count_24h != null ? `${stats.error_count_24h}/24h` : '—', color: '#141413' },
|
||||
].map(card => (
|
||||
<div key={card.label} style={cardStyle}>
|
||||
|
||||
Reference in New Issue
Block a user