diff --git a/apps/dokploy/components/dashboard/docker/show/show-containers.tsx b/apps/dokploy/components/dashboard/docker/show/show-containers.tsx index e55e6271f..95f947d41 100644 --- a/apps/dokploy/components/dashboard/docker/show/show-containers.tsx +++ b/apps/dokploy/components/dashboard/docker/show/show-containers.tsx @@ -30,6 +30,7 @@ import { } from "@/components/ui/table"; import { type RouterOutputs, api } from "@/utils/api"; import { columns } from "./colums"; +import { Skeleton } from "@/components/ui/skeleton"; export type Container = NonNullable< RouterOutputs["docker"]["getContainers"] >[0]; @@ -70,6 +71,47 @@ export const ShowContainers = ({ serverId }: Props) => { }, }); + if (isLoading) { + return ( +
+
+
+ + +
+
+ + + + + + + + + + + {Array.from({ length: 12 }).map((_, i) => ( + + + + + + + ))} + +
+
+
+
+ + +
+
+
+
+ ) + } + return (
@@ -110,13 +152,7 @@ export const ShowContainers = ({ serverId }: Props) => {
- {isLoading ? ( -
- - Loading... - -
- ) : data?.length === 0 ? ( + {data?.length === 0 ? (
No results. diff --git a/apps/dokploy/components/dashboard/projects/show.tsx b/apps/dokploy/components/dashboard/projects/show.tsx index 592621835..4aaf04f68 100644 --- a/apps/dokploy/components/dashboard/projects/show.tsx +++ b/apps/dokploy/components/dashboard/projects/show.tsx @@ -36,10 +36,11 @@ import { Fragment } from "react"; import { toast } from "sonner"; import { ProjectEnvironment } from "./project-environment"; import { UpdateProject } from "./update"; +import { Skeleton } from "@/components/ui/skeleton"; export const ShowProjects = () => { const utils = api.useUtils(); - const { data } = api.project.all.useQuery(); + const { data, isLoading } = api.project.all.useQuery(); const { data: auth } = api.auth.get.useQuery(); const { data: user } = api.user.byAuthId.useQuery( { @@ -51,6 +52,38 @@ export const ShowProjects = () => { ); const { mutateAsync } = api.project.remove.useMutation(); + if (isLoading) { + return ( +
+ {Array.from({ length: 12 }).map((_, i) => ( +
+ + + + +
+ + +
+ +
+ +
+
+ +
+ + +
+
+
+
+ ))} +
+ ); + + } + return ( <> {data?.length === 0 && ( @@ -61,7 +94,7 @@ export const ShowProjects = () => {
)} -
+
{data?.map((project) => { const emptyServices = project?.mariadb.length === 0 && diff --git a/apps/dokploy/components/dashboard/swarm/details/details-card.tsx b/apps/dokploy/components/dashboard/swarm/details/details-card.tsx index 2de0901a0..64d557320 100644 --- a/apps/dokploy/components/dashboard/swarm/details/details-card.tsx +++ b/apps/dokploy/components/dashboard/swarm/details/details-card.tsx @@ -11,6 +11,7 @@ import { } from "lucide-react"; import { ShowNodeApplications } from "../applications/show-applications"; import { ShowNodeConfig } from "./show-node-config"; +import { Skeleton } from "@/components/ui/skeleton"; export interface SwarmList { ID: string; @@ -33,29 +34,6 @@ export function NodeCard({ node, serverId }: Props) { serverId, }); - - if (isLoading) { - return ( - - - - - {node.Hostname} - - - {node.ManagerStatus || "Worker"} - - - - -
- -
-
-
- ); - } - return ( @@ -117,7 +95,7 @@ export function NodeCard({ node, serverId }: Props) {
- +
diff --git a/apps/dokploy/components/dashboard/swarm/monitoring-card.tsx b/apps/dokploy/components/dashboard/swarm/monitoring-card.tsx index bd8570db9..2f64a76b6 100644 --- a/apps/dokploy/components/dashboard/swarm/monitoring-card.tsx +++ b/apps/dokploy/components/dashboard/swarm/monitoring-card.tsx @@ -16,6 +16,8 @@ import { Server, } from "lucide-react"; import { NodeCard } from "./details/details-card"; +import { Skeleton } from "@/components/ui/skeleton"; +import { Separator } from "@/components/ui/separator"; interface Props { serverId?: string; @@ -28,13 +30,68 @@ export default function SwarmMonitorCard({ serverId }: Props) { if (isLoading) { return ( -
-
-
- -
+
+
+
+ +
+ +
+ {Array.from({ length: 3 }).map((_, i) => ( +
+
+ + +
+ +
+ ))} +
+ + + + + + + + +
+
+
+ + + +
+
+ + +
+
+ + + +
+ {Array.from({ length: 4 }).map((_, i) => ( +
+
+ + +
+ +
+ ))} +
+ +
+ + +
+
+
+
+
); } diff --git a/apps/dokploy/components/ui/skeleton.tsx b/apps/dokploy/components/ui/skeleton.tsx new file mode 100644 index 000000000..01b8b6d4f --- /dev/null +++ b/apps/dokploy/components/ui/skeleton.tsx @@ -0,0 +1,15 @@ +import { cn } from "@/lib/utils" + +function Skeleton({ + className, + ...props +}: React.HTMLAttributes) { + return ( +
+ ) +} + +export { Skeleton }