From 0077954c789a55dd258c37b19c9c5492a89955e5 Mon Sep 17 00:00:00 2001 From: HarikrishnanD Date: Tue, 21 Oct 2025 13:50:56 +0530 Subject: [PATCH 1/2] feat: add Ctrl+S/CMD+S shortcuts to .env file editing --- .../application/environment/show-enviroment.tsx | 15 +++++++++++++++ .../dashboard/application/environment/show.tsx | 15 +++++++++++++++ .../dashboard/project/environment-variables.tsx | 15 +++++++++++++++ .../dashboard/projects/project-environment.tsx | 15 +++++++++++++++ .../settings/web-server/edit-traefik-env.tsx | 15 +++++++++++++++ 5 files changed, 75 insertions(+) diff --git a/apps/dokploy/components/dashboard/application/environment/show-enviroment.tsx b/apps/dokploy/components/dashboard/application/environment/show-enviroment.tsx index 4a5d0270b..797a317a8 100644 --- a/apps/dokploy/components/dashboard/application/environment/show-enviroment.tsx +++ b/apps/dokploy/components/dashboard/application/environment/show-enviroment.tsx @@ -108,6 +108,21 @@ export const ShowEnvironment = ({ id, type }: Props) => { }); }; + // Add keyboard shortcut for Ctrl+S/Cmd+S + useEffect(() => { + const handleKeyDown = (e: KeyboardEvent) => { + if ((e.ctrlKey || e.metaKey) && e.key === "s" && !isLoading) { + e.preventDefault(); + form.handleSubmit(onSubmit)(); + } + }; + + document.addEventListener("keydown", handleKeyDown); + return () => { + document.removeEventListener("keydown", handleKeyDown); + }; + }, [form, onSubmit, isLoading]); + return (
diff --git a/apps/dokploy/components/dashboard/application/environment/show.tsx b/apps/dokploy/components/dashboard/application/environment/show.tsx index 78edb1aaa..0e4c8ffb5 100644 --- a/apps/dokploy/components/dashboard/application/environment/show.tsx +++ b/apps/dokploy/components/dashboard/application/environment/show.tsx @@ -79,6 +79,21 @@ export const ShowEnvironment = ({ applicationId }: Props) => { }); }; + // Add keyboard shortcut for Ctrl+S/Cmd+S + useEffect(() => { + const handleKeyDown = (e: KeyboardEvent) => { + if ((e.ctrlKey || e.metaKey) && e.key === "s" && !isLoading) { + e.preventDefault(); + form.handleSubmit(onSubmit)(); + } + }; + + document.addEventListener("keydown", handleKeyDown); + return () => { + document.removeEventListener("keydown", handleKeyDown); + }; + }, [form, onSubmit, isLoading]); + return (
diff --git a/apps/dokploy/components/dashboard/project/environment-variables.tsx b/apps/dokploy/components/dashboard/project/environment-variables.tsx index 8cafc8073..e833fa779 100644 --- a/apps/dokploy/components/dashboard/project/environment-variables.tsx +++ b/apps/dokploy/components/dashboard/project/environment-variables.tsx @@ -82,6 +82,21 @@ export const EnvironmentVariables = ({ environmentId, children }: Props) => { .finally(() => {}); }; + // Add keyboard shortcut for Ctrl+S/Cmd+S + useEffect(() => { + const handleKeyDown = (e: KeyboardEvent) => { + if ((e.ctrlKey || e.metaKey) && e.key === "s" && !isLoading && isOpen) { + e.preventDefault(); + form.handleSubmit(onSubmit)(); + } + }; + + document.addEventListener("keydown", handleKeyDown); + return () => { + document.removeEventListener("keydown", handleKeyDown); + }; + }, [form, onSubmit, isLoading, isOpen]); + return ( diff --git a/apps/dokploy/components/dashboard/projects/project-environment.tsx b/apps/dokploy/components/dashboard/projects/project-environment.tsx index 86dfd2433..cb6245f08 100644 --- a/apps/dokploy/components/dashboard/projects/project-environment.tsx +++ b/apps/dokploy/components/dashboard/projects/project-environment.tsx @@ -81,6 +81,21 @@ export const ProjectEnvironment = ({ projectId, children }: Props) => { .finally(() => {}); }; + // Add keyboard shortcut for Ctrl+S/Cmd+S + useEffect(() => { + const handleKeyDown = (e: KeyboardEvent) => { + if ((e.ctrlKey || e.metaKey) && e.key === "s" && !isLoading && isOpen) { + e.preventDefault(); + form.handleSubmit(onSubmit)(); + } + }; + + document.addEventListener("keydown", handleKeyDown); + return () => { + document.removeEventListener("keydown", handleKeyDown); + }; + }, [form, onSubmit, isLoading, isOpen]); + return ( diff --git a/apps/dokploy/components/dashboard/settings/web-server/edit-traefik-env.tsx b/apps/dokploy/components/dashboard/settings/web-server/edit-traefik-env.tsx index e222b9f3d..f1f7bce32 100644 --- a/apps/dokploy/components/dashboard/settings/web-server/edit-traefik-env.tsx +++ b/apps/dokploy/components/dashboard/settings/web-server/edit-traefik-env.tsx @@ -75,6 +75,21 @@ export const EditTraefikEnv = ({ children, serverId }: Props) => { }); }; + // Add keyboard shortcut for Ctrl+S/Cmd+S + useEffect(() => { + const handleKeyDown = (e: KeyboardEvent) => { + if ((e.ctrlKey || e.metaKey) && e.key === "s" && !isLoading && !canEdit) { + e.preventDefault(); + form.handleSubmit(onSubmit)(); + } + }; + + document.addEventListener("keydown", handleKeyDown); + return () => { + document.removeEventListener("keydown", handleKeyDown); + }; + }, [form, onSubmit, isLoading, canEdit]); + return ( {children} From b6626290755d78504cc0ba56f9f2d0170f2c099a Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 08:22:36 +0000 Subject: [PATCH 2/2] [autofix.ci] apply automated fixes --- .../components/dashboard/impersonation/impersonation-bar.tsx | 2 +- apps/dokploy/components/layouts/user-nav.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/dokploy/components/dashboard/impersonation/impersonation-bar.tsx b/apps/dokploy/components/dashboard/impersonation/impersonation-bar.tsx index a5aae598c..b96b7c866 100644 --- a/apps/dokploy/components/dashboard/impersonation/impersonation-bar.tsx +++ b/apps/dokploy/components/dashboard/impersonation/impersonation-bar.tsx @@ -281,7 +281,7 @@ export const ImpersonationBar = () => {
diff --git a/apps/dokploy/components/layouts/user-nav.tsx b/apps/dokploy/components/layouts/user-nav.tsx index ca5854196..337e8f483 100644 --- a/apps/dokploy/components/layouts/user-nav.tsx +++ b/apps/dokploy/components/layouts/user-nav.tsx @@ -44,7 +44,7 @@ export const UserNav = () => { >