-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:db add database type for migration and external network access (#…
…4317) * feat:db add database type for migration and external network access Signed-off-by: jingyang <[email protected]> * fix ci Signed-off-by: jingyang <[email protected]> --------- Signed-off-by: jingyang <[email protected]>
- Loading branch information
Showing
77 changed files
with
4,678 additions
and
367 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { DELETE, GET, POST } from '@/services/request'; | ||
import { InternetMigrationCR } from '@/types/migrate'; | ||
import { adaptMigrateList } from '@/utils/adapt'; | ||
import { V1Pod } from '@kubernetes/client-node'; | ||
|
||
export const getMigrateList = (migrateName: string) => | ||
GET<InternetMigrationCR[]>('/api/migrate/list', { migrateName }).then((res) => | ||
res.map(adaptMigrateList).sort((a, b) => { | ||
const startTimeA = new Date(a.startTime).getTime(); | ||
const startTimeB = new Date(b.startTime).getTime(); | ||
return startTimeB - startTimeA; | ||
}) | ||
); | ||
|
||
export const deleteMigrateByName = (migrateName: string) => | ||
DELETE<InternetMigrationCR[]>('/api/migrate/delete', { migrateName }); | ||
|
||
export const getMigratePodList = ( | ||
migrateName: string, | ||
migrateType: 'network' | 'file' = 'network' | ||
) => | ||
GET<V1Pod[]>('/api/migrate/getPodList', { migrateName, migrateType }).then((res) => { | ||
return res.sort((a, b) => { | ||
const startTimeA = new Date(a.metadata?.creationTimestamp || '').getTime(); | ||
const startTimeB = new Date(b.metadata?.creationTimestamp || '').getTime(); | ||
return startTimeA - startTimeB; | ||
}); | ||
}); | ||
|
||
export const getLogByNameAndContainerName = (data: { | ||
containerName: string; | ||
podName: string; | ||
stream: boolean; | ||
logSize?: number; | ||
}) => POST<string>('/api/migrate/getLogByName', data); | ||
|
||
export const getPodStatusByName = (podName: string) => | ||
GET(`/api/pod/getPodStatus?podName=${podName}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.