diff --git a/components/dashboard/settings/cluster/registry/add-docker-registry.tsx b/components/dashboard/settings/cluster/registry/add-docker-registry.tsx index 04ac3270..8d9eab16 100644 --- a/components/dashboard/settings/cluster/registry/add-docker-registry.tsx +++ b/components/dashboard/settings/cluster/registry/add-docker-registry.tsx @@ -201,7 +201,7 @@ export const AddRegistry = () => { Registry URL diff --git a/components/dashboard/settings/cluster/registry/add-self-docker-registry.tsx b/components/dashboard/settings/cluster/registry/add-self-docker-registry.tsx index 52e8c1e7..ef4ad03f 100644 --- a/components/dashboard/settings/cluster/registry/add-self-docker-registry.tsx +++ b/components/dashboard/settings/cluster/registry/add-self-docker-registry.tsx @@ -157,10 +157,7 @@ export const AddSelfHostedRegistry = () => { Registry URL - + Point a DNS record to the VPS IP address. diff --git a/components/dashboard/settings/users/delete-user.tsx b/components/dashboard/settings/users/delete-user.tsx index f3904795..36f5de2c 100644 --- a/components/dashboard/settings/users/delete-user.tsx +++ b/components/dashboard/settings/users/delete-user.tsx @@ -26,7 +26,7 @@ export const DeleteUser = ({ authId }: Props) => { e.preventDefault()} > Delete User diff --git a/components/dashboard/settings/web-server.tsx b/components/dashboard/settings/web-server.tsx index f892ec1e..32656581 100644 --- a/components/dashboard/settings/web-server.tsx +++ b/components/dashboard/settings/web-server.tsx @@ -27,10 +27,9 @@ import { DockerTerminalModal } from "./web-server/docker-terminal-modal"; import { ShowMainTraefikConfig } from "./web-server/show-main-traefik-config"; import { ShowServerTraefikConfig } from "./web-server/show-server-traefik-config"; import { ShowServerMiddlewareConfig } from "./web-server/show-server-middleware-config"; -import { UpdateWebServer } from "./web-server/update-webserver"; +import { UpdateServer } from "./web-server/update-server"; export const WebServer = () => { - const [fetchAfterFirstRender, setFetchAfterFirstRender] = useState(false); const { data, refetch } = api.admin.one.useQuery(); const { mutateAsync: reloadServer, isLoading } = api.settings.reloadServer.useMutation(); @@ -61,13 +60,6 @@ export const WebServer = () => { const { mutateAsync: updateDockerCleanup } = api.settings.updateDockerCleanup.useMutation(); - const { data: query } = api.settings.checkAndUpdateImage.useQuery(void 0, { - enabled: fetchAfterFirstRender, - }); - - useEffect(() => { - setFetchAfterFirstRender(true); - }, []); return ( @@ -279,7 +271,7 @@ export const WebServer = () => { - {query ? : null} +
diff --git a/components/dashboard/settings/web-server/update-server.tsx b/components/dashboard/settings/web-server/update-server.tsx new file mode 100644 index 00000000..bbca5ece --- /dev/null +++ b/components/dashboard/settings/web-server/update-server.tsx @@ -0,0 +1,98 @@ +import { Button } from "@/components/ui/button"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/components/ui/dialog"; +import { api } from "@/utils/api"; +import { AlertBlock } from "@/components/shared/alert-block"; +import { RefreshCcw } from "lucide-react"; +import { useState } from "react"; +import { toast } from "sonner"; +import Link from "next/link"; +import { UpdateWebServer } from "./update-webserver"; + +export const UpdateServer = () => { + const [isUpdateAvailable, setIsUpdateAvailable] = useState( + null, + ); + const { mutateAsync: checkAndUpdateImage, isLoading } = + api.settings.checkAndUpdateImage.useMutation(); + const [isOpen, setIsOpen] = useState(false); + + return ( + + + + + + + Web Server Update + + Check new releases and update your dokploy + + + +
+ + We suggest to update your dokploy to the latest version only if you: + +
    +
  • Want to try the latest features
  • +
  • Some bug that is blocking to use some features
  • +
+ + Please we recommend to see the latest version to see if there are + any breaking changes before updating. Go to{" "} + + Dokploy Releases + {" "} + to check the latest version. + + +
+ {isUpdateAvailable === false && ( +
+ + + You are using the latest version + +
+ )} + {isUpdateAvailable ? ( + + ) : ( + + )} +
+
+
+
+ ); +}; diff --git a/components/dashboard/settings/web-server/update-webserver.tsx b/components/dashboard/settings/web-server/update-webserver.tsx index fd76db58..47d38310 100644 --- a/components/dashboard/settings/web-server/update-webserver.tsx +++ b/components/dashboard/settings/web-server/update-webserver.tsx @@ -19,7 +19,11 @@ export const UpdateWebServer = () => { return ( -