()
| 83 | }, [hasLegacyData]); |
| 84 | |
| 85 | const handleMigrate = async () => { |
| 86 | try { |
| 87 | setLoading(true); |
| 88 | await API.post('/api/option/migrate_console_setting'); |
| 89 | showSuccess('旧配置迁移完成'); |
| 90 | await onRefresh(); |
| 91 | setShowMigrateModal(false); |
| 92 | } catch (err) { |
| 93 | console.error(err); |
| 94 | showError('迁移失败: ' + (err.message || '未知错误')); |
| 95 | } finally { |
| 96 | setLoading(false); |
| 97 | } |
| 98 | }; |
| 99 | |
| 100 | return ( |
| 101 | <> |
nothing calls this directly
no test coverage detected