-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff0a27e
commit e41e93f
Showing
11 changed files
with
199 additions
and
68 deletions.
There are no files selected for viewing
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
66 changes: 66 additions & 0 deletions
66
src/apps/console/routes/_main+/$account+/settings+/images/handle-image-discovery.tsx
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,66 @@ | ||
import { useParams } from '@remix-run/react'; | ||
import { Button } from '~/components/atoms/button'; | ||
import Popup from '~/components/molecule/popup'; | ||
import CodeView from '~/console/components/code-view'; | ||
import { LoadingPlaceHolder } from '~/console/components/loading'; | ||
import { useConsoleApi } from '~/console/server/gql/api-provider'; | ||
import { ensureAccountClientSide } from '~/console/server/utils/auth-utils'; | ||
import useCustomSwr from '~/root/lib/client/hooks/use-custom-swr'; | ||
|
||
export const RegistryImageInstruction = ({ | ||
show, | ||
onClose, | ||
}: { | ||
show: boolean; | ||
onClose: () => void; | ||
}) => { | ||
const params = useParams(); | ||
ensureAccountClientSide(params); | ||
const api = useConsoleApi(); | ||
|
||
const { data, isLoading, error } = useCustomSwr( | ||
'registry-image-instructions', | ||
async () => { | ||
return api.getRegistryImageUrl({ | ||
image: '<image_name:image_tag>', | ||
meta: {}, | ||
}); | ||
} | ||
); | ||
|
||
return ( | ||
<Popup.Root onOpenChange={onClose} show={show} className="!w-[800px]"> | ||
<Popup.Header>Instructions to add image on registry</Popup.Header> | ||
<Popup.Content> | ||
<form className="flex flex-col gap-2xl"> | ||
{error && ( | ||
<span className="bodyMd-medium text-text-strong"> | ||
Error while fetching instructions | ||
</span> | ||
)} | ||
{isLoading ? ( | ||
<LoadingPlaceHolder /> | ||
) : ( | ||
data && ( | ||
<div className="flex flex-col gap-sm text-start "> | ||
<span className="flex flex-wrap items-center gap-md py-lg"> | ||
Please follow below instruction for further steps | ||
</span> | ||
<CodeView | ||
preClassName="!overflow-none text-wrap break-words" | ||
copy | ||
data={data.url || ''} | ||
/> | ||
|
||
{/* {data.url} */} | ||
</div> | ||
) | ||
)} | ||
</form> | ||
</Popup.Content> | ||
<Popup.Footer> | ||
<Button variant="primary-outline" content="close" onClick={onClose} /> | ||
</Popup.Footer> | ||
</Popup.Root> | ||
); | ||
}; |
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
Oops, something went wrong.