diff --git a/apps/dokploy/components/dashboard/projects/show.tsx b/apps/dokploy/components/dashboard/projects/show.tsx
index b4c86143..d05bbba2 100644
--- a/apps/dokploy/components/dashboard/projects/show.tsx
+++ b/apps/dokploy/components/dashboard/projects/show.tsx
@@ -36,7 +36,6 @@ import { Fragment } from "react";
import { toast } from "sonner";
import { ProjectEnviroment } from "./project-enviroment";
import { UpdateProject } from "./update";
-import { SearchCommand } from "@/components/dashboard/search-command";
export const ShowProjects = () => {
const utils = api.useUtils();
@@ -54,9 +53,6 @@ export const ShowProjects = () => {
return (
<>
- {/*@ts-expect-error Type mismatch*/}
-
-
{data?.length === 0 && (
diff --git a/apps/dokploy/components/dashboard/search-command.tsx b/apps/dokploy/components/dashboard/search-command.tsx
index 69813d7f..3bbacae9 100644
--- a/apps/dokploy/components/dashboard/search-command.tsx
+++ b/apps/dokploy/components/dashboard/search-command.tsx
@@ -25,17 +25,17 @@ import {
PostgresqlIcon,
RedisIcon,
} from "@/components/icons/data-tools-icons";
+import { api } from "@/utils/api";
+import { truncate } from "lodash";
type Project = Awaited
>;
-interface Props {
- data: Project[];
-}
-
-export const SearchCommand = ({ data }: Props) => {
+export const SearchCommand = () => {
const router = useRouter();
const [open, setOpen] = React.useState(false);
+ const { data } = api.project.all.useQuery();
+
React.useEffect(() => {
const down = (e: KeyboardEvent) => {
if (e.key === "j" && (e.metaKey || e.ctrlKey)) {
@@ -53,61 +53,11 @@ export const SearchCommand = ({ data }: Props) => {
return (
-
+
No projects added yet. Click on Create project.
-
- {
- router.push("/dashboard/projects");
- setOpen(false);
- }}
- >
- Projects
-
- {
- router.push("/dashboard/monitoring");
- setOpen(false);
- }}
- >
- Monitoring
-
- {
- router.push("/dashboard/traefik");
- setOpen(false);
- }}
- >
- Treafik
-
- {
- router.push("/dashboard/docker");
- setOpen(false);
- }}
- >
- Docker
-
- {
- router.push("/dashboard/requests");
- setOpen(false);
- }}
- >
- Requests
-
- {
- router.push("/dashboard/profile");
- setOpen(false);
- }}
- >
- Settings
-
-
{data?.map((project) => (
@@ -162,6 +112,57 @@ export const SearchCommand = ({ data }: Props) => {
})}
+
+
+ {
+ router.push("/dashboard/projects");
+ setOpen(false);
+ }}
+ >
+ Projects
+
+ {
+ router.push("/dashboard/monitoring");
+ setOpen(false);
+ }}
+ >
+ Monitoring
+
+ {
+ router.push("/dashboard/traefik");
+ setOpen(false);
+ }}
+ >
+ Traefik
+
+ {
+ router.push("/dashboard/docker");
+ setOpen(false);
+ }}
+ >
+ Docker
+
+ {
+ router.push("/dashboard/requests");
+ setOpen(false);
+ }}
+ >
+ Requests
+
+ {
+ router.push("/dashboard/profile");
+ setOpen(false);
+ }}
+ >
+ Settings
+
+
diff --git a/apps/dokploy/pages/_app.tsx b/apps/dokploy/pages/_app.tsx
index e7c0befc..f91f378a 100644
--- a/apps/dokploy/pages/_app.tsx
+++ b/apps/dokploy/pages/_app.tsx
@@ -11,72 +11,74 @@ import { Inter } from "next/font/google";
import Head from "next/head";
import Script from "next/script";
import type { ReactElement, ReactNode } from "react";
+import { SearchCommand } from "@/components/dashboard/search-command";
const inter = Inter({ subsets: ["latin"] });
export type NextPageWithLayout = NextPage
& {
- getLayout?: (page: ReactElement) => ReactNode;
- // session: Session | null;
- theme?: string;
+ getLayout?: (page: ReactElement) => ReactNode;
+ // session: Session | null;
+ theme?: string;
};
type AppPropsWithLayout = AppProps & {
- Component: NextPageWithLayout;
+ Component: NextPageWithLayout;
};
const MyApp = ({
- Component,
- pageProps: { ...pageProps },
+ Component,
+ pageProps: { ...pageProps },
}: AppPropsWithLayout) => {
- const getLayout = Component.getLayout ?? ((page) => page);
+ const getLayout = Component.getLayout ?? ((page) => page);
- return (
- <>
-
-
- Dokploy
-
- {process.env.NEXT_PUBLIC_UMAMI_HOST &&
- process.env.NEXT_PUBLIC_UMAMI_WEBSITE_ID && (
-
- )}
+ return (
+ <>
+
+
+ Dokploy
+
+ {process.env.NEXT_PUBLIC_UMAMI_HOST &&
+ process.env.NEXT_PUBLIC_UMAMI_WEBSITE_ID && (
+
+ )}
-
-
- {getLayout()}
-
- >
- );
+
+
+
+ {getLayout()}
+
+ >
+ );
};
export default api.withTRPC(
- appWithTranslation(
- MyApp,
- // keep this in sync with next-i18next.config.js
- // if you want to know why don't just import the config file, this because next-i18next.config.js must be a CJS, but the rest of the code is ESM.
- // Add the config here is due to the issue: https://github.com/i18next/next-i18next/issues/2259
- // if one day every page is translated, we can safely remove this config.
- {
- i18n: {
- defaultLocale: "en",
- locales: Object.values(Languages),
- localeDetection: false,
- },
- fallbackLng: "en",
- keySeparator: false,
- },
- ),
+ appWithTranslation(
+ MyApp,
+ // keep this in sync with next-i18next.config.js
+ // if you want to know why don't just import the config file, this because next-i18next.config.js must be a CJS, but the rest of the code is ESM.
+ // Add the config here is due to the issue: https://github.com/i18next/next-i18next/issues/2259
+ // if one day every page is translated, we can safely remove this config.
+ {
+ i18n: {
+ defaultLocale: "en",
+ locales: Object.values(Languages),
+ localeDetection: false,
+ },
+ fallbackLng: "en",
+ keySeparator: false,
+ }
+ )
);