mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
wip volume tabs
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
import type { GetVolumeResponse } from "~/api-client";
|
import type { GetVolumeResponse } from "~/api-client";
|
||||||
|
|
||||||
export type VolumeStatus = GetVolumeResponse["status"];
|
export type Volume = GetVolumeResponse;
|
||||||
|
export type VolumeStatus = Volume["status"];
|
||||||
|
|||||||
22
apps/client/app/modules/details/tabs/info.tsx
Normal file
22
apps/client/app/modules/details/tabs/info.tsx
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import { CreateVolumeForm } from "~/components/create-volume-form";
|
||||||
|
import { Card } from "~/components/ui/card";
|
||||||
|
import { HealthchecksCard } from "../components/healthchecks-card";
|
||||||
|
import type { Volume } from "~/lib/types";
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
volume: Volume;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const VolumeInfoTabContent = ({ volume }: Props) => {
|
||||||
|
return (
|
||||||
|
<div className="grid gap-4 grid-cols-1 lg:grid-cols-3 lg:grid-rows-[auto_1fr]">
|
||||||
|
<Card className="p-6 lg:col-span-2 lg:row-span-2">
|
||||||
|
<CreateVolumeForm initialValues={{ ...volume, ...volume.config }} onSubmit={console.log} />
|
||||||
|
</Card>
|
||||||
|
<HealthchecksCard volume={volume} />
|
||||||
|
<Card className="p-6 h-full">
|
||||||
|
<h2 className="text-lg font-medium">Volume Information</h2>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -17,6 +17,8 @@ import { HealthchecksCard } from "~/modules/details/components/healthchecks-card
|
|||||||
import type { Route } from "./+types/details";
|
import type { Route } from "./+types/details";
|
||||||
import { cn } from "~/lib/utils";
|
import { cn } from "~/lib/utils";
|
||||||
import { StatusDot } from "~/components/status-dot";
|
import { StatusDot } from "~/components/status-dot";
|
||||||
|
import { VolumeInfoTabContent } from "~/modules/details/tabs/info";
|
||||||
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "~/components/ui/tabs";
|
||||||
|
|
||||||
export const clientLoader = async ({ params }: Route.ClientLoaderArgs) => {
|
export const clientLoader = async ({ params }: Route.ClientLoaderArgs) => {
|
||||||
const volume = await getVolume({ path: { name: params.name ?? "" } });
|
const volume = await getVolume({ path: { name: params.name ?? "" } });
|
||||||
@@ -116,15 +118,17 @@ export default function DetailsPage({ loaderData }: Route.ComponentProps) {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid gap-4 grid-cols-1 lg:grid-cols-3 lg:grid-rows-[auto_1fr]">
|
<Tabs defaultValue="info" className="mt-0">
|
||||||
<Card className="p-6 lg:col-span-2 lg:row-span-2">
|
<TabsList>
|
||||||
<CreateVolumeForm initialValues={{ ...data, ...data?.config }} onSubmit={console.log} />
|
<TabsTrigger value="info">Configuration</TabsTrigger>
|
||||||
</Card>
|
<TabsTrigger value="backups">Backups</TabsTrigger>
|
||||||
<HealthchecksCard volume={data} />
|
<TabsTrigger value="explorer">Eplorer</TabsTrigger>
|
||||||
<Card className="p-6 h-full">
|
</TabsList>
|
||||||
<h2 className="text-lg font-medium">Volume Information</h2>
|
<TabsContent value="info">
|
||||||
</Card>
|
<VolumeInfoTabContent volume={data} />
|
||||||
</div>
|
</TabsContent>
|
||||||
|
<TabsContent value="password">Change your password here.</TabsContent>
|
||||||
|
</Tabs>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user