feat(infisical-pg): added migration mode env and page

This commit is contained in:
Akhil Mohan
2024-01-20 01:20:14 +05:30
parent 829e906650
commit 34de6d4e29
7 changed files with 41 additions and 12 deletions
@@ -27,7 +27,7 @@ export const ServerConfigProvider = ({ children }: Props): JSX.Element => {
}, [data]);
useEffect(() => {
if (!isLoading && data && !data.initialized) {
if (!isLoading && data && !data.initialized && !data.isMigrationModeOn) {
router.push("/admin/signup");
}
}, [isLoading, data]);
@@ -40,6 +40,17 @@ export const ServerConfigProvider = ({ children }: Props): JSX.Element => {
);
}
if (data?.isMigrationModeOn) {
return (
<div className="relative mx-auto flex h-screen w-full flex-col items-center justify-center space-y-8 bg-bunker-800 px-8 text-mineshaft-50 dark:[color-scheme:dark]">
<img src="/images/loading/loading.gif" height={70} width={120} alt="loading animation" />
<div className="mt-4 text-center text-xl">
Infisical under migration. See you in some time. <br /> All read operations are allowed
</div>
</div>
);
}
return <ServerConfigContext.Provider value={value}>{children}</ServerConfigContext.Provider>;
};