diff --git a/apps/dokploy/components/dashboard/settings/servers/actions/show-server-actions.tsx b/apps/dokploy/components/dashboard/settings/servers/actions/show-server-actions.tsx index 334d25b20..eddfc7601 100644 --- a/apps/dokploy/components/dashboard/settings/servers/actions/show-server-actions.tsx +++ b/apps/dokploy/components/dashboard/settings/servers/actions/show-server-actions.tsx @@ -1,6 +1,4 @@ -import { Activity } from "lucide-react"; import { useState } from "react"; -import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, @@ -15,29 +13,26 @@ import { ToggleDockerCleanup } from "./toggle-docker-cleanup"; interface Props { serverId: string; - asButton?: boolean; + children?: React.ReactNode; } -export const ShowServerActions = ({ serverId, asButton = false }: Props) => { +export const ShowServerActions = ({ serverId, children }: Props) => { const [isOpen, setIsOpen] = useState(false); return ( - {asButton ? ( - - - + {children ? ( + {children} ) : ( - { - e.preventDefault(); - setIsOpen(true); - }} - > - View Actions - + + { + e.preventDefault(); + }} + > + View Actions + + )}
diff --git a/apps/dokploy/components/dashboard/settings/servers/handle-servers.tsx b/apps/dokploy/components/dashboard/settings/servers/handle-servers.tsx index d2c158f91..9c59521e0 100644 --- a/apps/dokploy/components/dashboard/settings/servers/handle-servers.tsx +++ b/apps/dokploy/components/dashboard/settings/servers/handle-servers.tsx @@ -1,5 +1,5 @@ import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema"; -import { Pencil, PlusIcon } from "lucide-react"; +import { PlusIcon } from "lucide-react"; import Link from "next/link"; import { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; @@ -61,10 +61,10 @@ type Schema = z.infer; interface Props { serverId?: string; - asButton?: boolean; + children?: React.ReactNode; } -export const HandleServers = ({ serverId, asButton = false }: Props) => { +export const HandleServers = ({ serverId, children }: Props) => { const utils = api.useUtils(); const [isOpen, setIsOpen] = useState(false); const { data: canCreateMoreServers, refetch } = @@ -141,24 +141,19 @@ export const HandleServers = ({ serverId, asButton = false }: Props) => { return ( - {serverId ? ( - asButton ? ( - - - - ) : ( + {children ? ( + {children} + ) : serverId ? ( + { e.preventDefault(); - setIsOpen(true); }} > Edit Server - ) + ) : ( - ) : ( - )} diff --git a/apps/dokploy/components/dashboard/settings/servers/show-monitoring-modal.tsx b/apps/dokploy/components/dashboard/settings/servers/show-monitoring-modal.tsx index a318d0b40..2a220cd4a 100644 --- a/apps/dokploy/components/dashboard/settings/servers/show-monitoring-modal.tsx +++ b/apps/dokploy/components/dashboard/settings/servers/show-monitoring-modal.tsx @@ -7,18 +7,23 @@ import { ShowPaidMonitoring } from "../../monitoring/paid/servers/show-paid-moni interface Props { url: string; token: string; + children?: React.ReactNode; } -export const ShowMonitoringModal = ({ url, token }: Props) => { +export const ShowMonitoringModal = ({ url, token, children }: Props) => { const [isOpen, setIsOpen] = useState(false); return ( - - - + {children ? ( + {children} + ) : ( + + + + )}
diff --git a/apps/dokploy/components/dashboard/settings/servers/show-servers.tsx b/apps/dokploy/components/dashboard/settings/servers/show-servers.tsx index 735626354..6931319bd 100644 --- a/apps/dokploy/components/dashboard/settings/servers/show-servers.tsx +++ b/apps/dokploy/components/dashboard/settings/servers/show-servers.tsx @@ -1,11 +1,15 @@ import { format } from "date-fns"; import { + Activity, + BarChartHorizontalBigIcon, Clock, Key, KeyIcon, Loader2, Network, + Pencil, ServerIcon, + Settings, Terminal, Trash2, User, @@ -224,11 +228,19 @@ export const ShowServers = () => {
- - - + + + + + { {server.sshKeyId && permissions?.server.terminal && ( - -
- + + - -
-
+ + + +

Terminal

@@ -274,14 +284,19 @@ export const ShowServers = () => { )} - -
- -
-
+ + + + +

Edit Server

@@ -289,14 +304,19 @@ export const ShowServers = () => { {server.sshKeyId && !isBuildServer && ( - -
- -
-
+ + + + +

Web Server Actions

@@ -307,17 +327,23 @@ export const ShowServers = () => { server.sshKeyId && !isBuildServer && ( - -
- -
-
+ + + + +

Monitoring

@@ -328,22 +354,20 @@ export const ShowServers = () => { {permissions?.server.delete && ( - -
- + + - -
-
+ + + +

Delete Server