From d539b80ef786ca0ff1dfa448f376f18c3cece53f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E5=A4=B4981?= Date: Sat, 18 May 2024 11:43:52 +0800 Subject: [PATCH] fix: dashboard layout styles (#86) * fix: dashboard layout scroll * feat: dashboard nav style animation * chore: code input font * style: format code * pref: alert component extraction * fix: global font var not found * fix: code path beak line * chore: remove framer-motion * fix: status color --- .gitignore | 3 +- components/auth/login-2fa.tsx | 2 +- .../advanced/general/add-command.tsx | 6 +- .../application/advanced/ports/add-port.tsx | 17 +- .../advanced/ports/update-port.tsx | 12 +- .../advanced/redirects/add-redirect.tsx | 11 +- .../advanced/redirects/update-redirect.tsx | 12 +- .../advanced/security/add-security.tsx | 11 +- .../advanced/security/update-security.tsx | 12 +- .../traefik/update-traefik-config.tsx | 13 +- .../advanced/volumes/add-volumes.tsx | 2 +- .../application/domains/add-domain.tsx | 12 +- .../application/domains/update-domain.tsx | 12 +- .../application/environment/show.tsx | 2 +- .../application/update-application.tsx | 10 +- .../docker/config/show-container-config.tsx | 4 +- .../dashboard/docker/logs/docker-logs-id.tsx | 7 +- .../docker/terminal/docker-terminal-modal.tsx | 1 - .../docker/terminal/docker-terminal.tsx | 21 +- .../file-system/show-traefik-file.tsx | 21 +- .../file-system/show-traefik-system.tsx | 2 +- .../environment/show-mariadb-environment.tsx | 2 +- .../dashboard/mariadb/update-mariadb.tsx | 10 +- .../environment/show-mongo-environment.tsx | 2 +- components/dashboard/mongo/update-mongo.tsx | 10 +- .../environment/show-mysql-environment.tsx | 2 +- components/dashboard/mysql/update-mysql.tsx | 10 +- .../environment/show-postgres-environment.tsx | 2 +- .../dashboard/postgres/update-postgres.tsx | 10 +- .../dashboard/project/add-application.tsx | 12 +- components/dashboard/project/add-database.tsx | 2 +- components/dashboard/projects/add.tsx | 12 +- components/dashboard/projects/show.tsx | 6 +- components/dashboard/projects/update.tsx | 10 +- components/dashboard/redis/update-redis.tsx | 10 +- .../settings/certificates/add-certificate.tsx | 272 +++++++++--------- .../settings/destination/add-destination.tsx | 11 +- .../destination/update-destination.tsx | 12 +- .../settings/users/add-permissions.tsx | 12 +- .../dashboard/settings/users/add-user.tsx | 11 +- .../dashboard/settings/users/show-users.tsx | 2 +- .../dashboard/settings/users/update-user.tsx | 12 +- .../web-server/show-main-traefik-config.tsx | 17 +- .../show-server-middleware-config.tsx | 17 +- .../web-server/show-server-traefik-config.tsx | 17 +- components/layouts/dashboard-layout.tsx | 16 +- components/layouts/navbar.tsx | 2 +- components/layouts/navigation-tabs.tsx | 135 +++++---- components/shared/alert-block.tsx | 51 ++++ components/shared/status-tooltip.tsx | 8 +- components/ui/alert.tsx | 59 ++++ components/ui/file-tree.tsx | 4 +- package.json | 4 +- pages/_app.tsx | 59 ++-- pages/_document.tsx | 15 +- styles/globals.css | 5 - tailwind.config.ts | 4 + 57 files changed, 502 insertions(+), 536 deletions(-) create mode 100644 components/shared/alert-block.tsx create mode 100644 components/ui/alert.tsx diff --git a/.gitignore b/.gitignore index bfbda236c..61e009710 100644 --- a/.gitignore +++ b/.gitignore @@ -53,4 +53,5 @@ yarn-error.log* /.data /.main -*.lockb \ No newline at end of file +*.lockb +*.rdb diff --git a/components/auth/login-2fa.tsx b/components/auth/login-2fa.tsx index 17b2d483e..6bf03d0c3 100644 --- a/components/auth/login-2fa.tsx +++ b/components/auth/login-2fa.tsx @@ -61,7 +61,7 @@ export const Login2FA = ({ authId }: Props) => { id: authId, }) .then(() => { - toast.success("Signin succesfully", { + toast.success("Signin successfully", { duration: 2000, }); diff --git a/components/dashboard/application/advanced/general/add-command.tsx b/components/dashboard/application/advanced/general/add-command.tsx index b7de2ae62..a898607d7 100644 --- a/components/dashboard/application/advanced/general/add-command.tsx +++ b/components/dashboard/application/advanced/general/add-command.tsx @@ -26,11 +26,11 @@ interface Props { applicationId: string; } -const AddRedirectchema = z.object({ +const AddRedirectSchema = z.object({ command: z.string(), }); -type AddCommand = z.infer; +type AddCommand = z.infer; export const AddCommand = ({ applicationId }: Props) => { const { data } = api.application.one.useQuery( @@ -48,7 +48,7 @@ export const AddCommand = ({ applicationId }: Props) => { defaultValues: { command: "", }, - resolver: zodResolver(AddRedirectchema), + resolver: zodResolver(AddRedirectSchema), }); useEffect(() => { diff --git a/components/dashboard/application/advanced/ports/add-port.tsx b/components/dashboard/application/advanced/ports/add-port.tsx index ceb9657cb..52b303a57 100644 --- a/components/dashboard/application/advanced/ports/add-port.tsx +++ b/components/dashboard/application/advanced/ports/add-port.tsx @@ -18,8 +18,8 @@ import { } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; import { api } from "@/utils/api"; +import { AlertBlock } from "@/components/shared/alert-block"; import { zodResolver } from "@hookform/resolvers/zod"; -import { AlertTriangle } from "lucide-react"; import { useEffect } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; @@ -33,7 +33,7 @@ import { } from "@/components/ui/select"; import { z } from "zod"; -const AddPortchema = z.object({ +const AddPortSchema = z.object({ publishedPort: z.number().int().min(1).max(65535), targetPort: z.number().int().min(1).max(65535), protocol: z.enum(["tcp", "udp"], { @@ -41,7 +41,7 @@ const AddPortchema = z.object({ }), }); -type AddPort = z.infer; +type AddPort = z.infer; interface Props { applicationId: string; @@ -62,7 +62,7 @@ export const AddPort = ({ publishedPort: 0, targetPort: 0, }, - resolver: zodResolver(AddPortchema), + resolver: zodResolver(AddPortSchema), }); useEffect(() => { @@ -100,14 +100,7 @@ export const AddPort = ({ Ports are used to expose your application to the internet. - {isError && ( -
- - - {error?.message} - -
- )} + {isError && {error?.message}}
{ Update Update the port - {isError && ( -
- - - {error?.message} - -
- )} + {isError && {error?.message}} - {isError && ( -
- - - {error?.message} - -
- )} + {isError && {error?.message}} { Update Update the redirect - {isError && ( -
- - - {error?.message} - -
- )} + {isError && {error?.message}} - {isError && ( -
- - - {error?.message} - -
- )} + {isError && {error?.message}} { Update Update the security - {isError && ( -
- - - {error?.message} - -
- )} + {isError && {error?.message}} { Update traefik config Update the traefik config - {isError && ( -
- - - {error?.message} - -
- )} + {isError && {error?.message}} { Traefik config