This commit is contained in:
@@ -75,6 +75,7 @@ export function MigrationManagementPage() {
|
||||
const [selectedJob, setSelectedJob] = useState<RuntimeControlJob | null>(null);
|
||||
const [confirmOpen, setConfirmOpen] = useState(false);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [runningMigration, setRunningMigration] = useState(false);
|
||||
const [page, setPage] = useState(1);
|
||||
const [range, setRange] = useState<MigrationRange>('week');
|
||||
const [totalJobs, setTotalJobs] = useState(0);
|
||||
@@ -152,6 +153,8 @@ export function MigrationManagementPage() {
|
||||
}, [range]);
|
||||
|
||||
const runMigration = async () => {
|
||||
if (runningMigration) return;
|
||||
setRunningMigration(true);
|
||||
try {
|
||||
setConfirmOpen(false);
|
||||
const result = await createMigration({ releaseId, migrationComponentId, imageComponentName, namespace, command, envSecretName });
|
||||
@@ -160,6 +163,8 @@ export function MigrationManagementPage() {
|
||||
await refresh();
|
||||
} catch (error) {
|
||||
toast({ type: 'error', message: error instanceof Error ? error.message : '마이그레이션 실행에 실패했습니다.' });
|
||||
} finally {
|
||||
setRunningMigration(false);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -364,11 +369,13 @@ export function MigrationManagementPage() {
|
||||
<Modal
|
||||
open={confirmOpen}
|
||||
title="마이그레이션 실행"
|
||||
onClose={() => setConfirmOpen(false)}
|
||||
onClose={() => {
|
||||
if (!runningMigration) setConfirmOpen(false);
|
||||
}}
|
||||
footer={(
|
||||
<>
|
||||
<Button variant="outline" onClick={() => setConfirmOpen(false)}>취소</Button>
|
||||
<Button disabled={!canRun || loading} onClick={runMigration}>실행</Button>
|
||||
<Button variant="outline" disabled={runningMigration} onClick={() => setConfirmOpen(false)}>취소</Button>
|
||||
<Button disabled={!canRun || loading || runningMigration} onClick={runMigration}>{runningMigration ? '실행 중' : '실행'}</Button>
|
||||
</>
|
||||
)}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user