From 21a646ce66fb6a571877483472bbc78183ac9a81 Mon Sep 17 00:00:00 2001 From: sashagoncharov19 <0976053529@ukr.net> Date: Wed, 4 Sep 2024 10:49:38 +0000 Subject: [PATCH] fix: linting --- .../dashboard/compose/monitoring/show.tsx | 198 +++++++++--------- apps/dokploy/server/api/routers/docker.ts | 5 +- 2 files changed, 102 insertions(+), 101 deletions(-) diff --git a/apps/dokploy/components/dashboard/compose/monitoring/show.tsx b/apps/dokploy/components/dashboard/compose/monitoring/show.tsx index 4565c1a77..428c74e4c 100644 --- a/apps/dokploy/components/dashboard/compose/monitoring/show.tsx +++ b/apps/dokploy/components/dashboard/compose/monitoring/show.tsx @@ -1,118 +1,118 @@ -import { - Card, - CardContent, - CardDescription, - CardHeader, - CardTitle, -} from "@/components/ui/card"; import { Button } from "@/components/ui/button"; +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, +} from "@/components/ui/card"; import { Label } from "@/components/ui/label"; import { - Select, - SelectContent, - SelectGroup, - SelectItem, - SelectLabel, - SelectTrigger, - SelectValue, + Select, + SelectContent, + SelectGroup, + SelectItem, + SelectLabel, + SelectTrigger, + SelectValue, } from "@/components/ui/select"; import { api } from "@/utils/api"; import { useEffect, useState } from "react"; -import { DockerMonitoring } from "../../monitoring/docker/show"; import { toast } from "sonner"; +import { DockerMonitoring } from "../../monitoring/docker/show"; interface Props { - appName: string; - appType: "stack" | "docker-compose"; + appName: string; + appType: "stack" | "docker-compose"; } export const ShowMonitoringCompose = ({ - appName, - appType = "stack", + appName, + appType = "stack", }: Props) => { - const { data } = api.docker.getContainersByAppNameMatch.useQuery( - { - appName: appName, - appType, - }, - { - enabled: !!appName, - }, - ); + const { data } = api.docker.getContainersByAppNameMatch.useQuery( + { + appName: appName, + appType, + }, + { + enabled: !!appName, + }, + ); - const [containerAppName, setContainerAppName] = useState< - string | undefined - >(); + const [containerAppName, setContainerAppName] = useState< + string | undefined + >(); - const [containerId, setContainerId] = useState(); + const [containerId, setContainerId] = useState(); - const { mutateAsync: restart, isLoading } = - api.docker.restartContainer.useMutation(); + const { mutateAsync: restart, isLoading } = + api.docker.restartContainer.useMutation(); - useEffect(() => { - if (data && data?.length > 0) { - setContainerAppName(data[0]?.name); - setContainerId(data[0]?.containerId); - } - }, [data]); + useEffect(() => { + if (data && data?.length > 0) { + setContainerAppName(data[0]?.name); + setContainerId(data[0]?.containerId); + } + }, [data]); - return ( -
- - - Monitoring - Watch the usage of your compose - - - -
- - -
- -
-
-
- ); + return ( +
+ + + Monitoring + Watch the usage of your compose + + + +
+ + +
+ +
+
+
+ ); }; diff --git a/apps/dokploy/server/api/routers/docker.ts b/apps/dokploy/server/api/routers/docker.ts index f0725b8a8..227200951 100644 --- a/apps/dokploy/server/api/routers/docker.ts +++ b/apps/dokploy/server/api/routers/docker.ts @@ -1,7 +1,7 @@ import { z } from "zod"; import { - getConfig, containerRestart, + getConfig, getContainers, getContainersByAppLabel, getContainersByAppNameMatch, @@ -18,7 +18,8 @@ export const dockerRouter = createTRPCRouter({ z.object({ containerId: z.string().min(1), }), - ).mutation(async ({ input }) => { + ) + .mutation(async ({ input }) => { return await containerRestart(input.containerId); }),