multiple domain support

This commit is contained in:
yoan
2024-10-08 22:02:00 +08:00
parent f036eb1cf2
commit 71e2555391
14 changed files with 788 additions and 446 deletions

View File

@@ -40,20 +40,17 @@ const History = () => {
return (
<ScrollArea className="h-[80vh] overflow-hidden">
<div className="text-muted-foreground">{t('deployment.log.name')}</div>
<div className="text-muted-foreground">{t("deployment.log.name")}</div>
{!deployments?.length ? (
<>
<Alert className="max-w-[40em] mx-auto mt-20">
<AlertTitle>{t('no.data')}</AlertTitle>
<AlertTitle>{t("no.data")}</AlertTitle>
<AlertDescription>
<div className="flex items-center mt-5">
<div>
<Smile className="text-yellow-400" size={36} />
</div>
<div className="ml-2">
{" "}
{t('deployment.log.empty')}
</div>
<div className="ml-2"> {t("deployment.log.empty")}</div>
</div>
<div className="mt-2 flex justify-end">
<Button
@@ -61,7 +58,7 @@ const History = () => {
navigate("/");
}}
>
{t('domain.add')}
{t("domain.add")}
</Button>
</div>
</AlertDescription>
@@ -70,16 +67,18 @@ const History = () => {
) : (
<>
<div className="hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5">
<div className="w-48">{t('domain')}</div>
<div className="w-48">{t("domain")}</div>
<div className="w-24">{t('deployment.log.status')}</div>
<div className="w-56">{t('deployment.log.stage')}</div>
<div className="w-56 sm:ml-2 text-center">{t('deployment.log.last.execution.time')}</div>
<div className="w-24">{t("deployment.log.status")}</div>
<div className="w-56">{t("deployment.log.stage")}</div>
<div className="w-56 sm:ml-2 text-center">
{t("deployment.log.last.execution.time")}
</div>
<div className="grow">{t('operation')}</div>
<div className="grow">{t("operation")}</div>
</div>
<div className="sm:hidden flex text-sm text-muted-foreground">
{t('deployment.log.name')}
{t("deployment.log.name")}
</div>
{deployments?.map((deployment) => (
@@ -88,7 +87,14 @@ const History = () => {
className="flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm"
>
<div className="sm:w-48 w-full pt-1 sm:pt-0 flex items-center">
{deployment.expand.domain?.domain}
{deployment.expand.domain?.domain
.split(";")
.map((domain: string) => (
<>
{domain}
<br />
</>
))}
</div>
<div className="sm:w-24 w-full pt-1 sm:pt-0 flex items-center">
<DeployState deployment={deployment} />
@@ -106,14 +112,14 @@ const History = () => {
<Sheet>
<SheetTrigger asChild>
<Button variant={"link"} className="p-0">
{t('deployment.log.detail.button.text')}
{t("deployment.log.detail.button.text")}
</Button>
</SheetTrigger>
<SheetContent className="sm:max-w-5xl">
<SheetHeader>
<SheetTitle>
{deployment.expand.domain?.domain}-{deployment.id}
{t('deployment.log.detail')}
{t("deployment.log.detail")}
</SheetTitle>
</SheetHeader>
<div className="bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]">