diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 36491813..27805973 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -2,7 +2,7 @@ name: Pull request on: pull_request: branches: - - main + - main - canary push: @@ -12,24 +12,37 @@ on: jobs: build-app: if: github.event_name == 'pull_request' - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: node-version: [18.18.0] steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v3 + - name: Check out the code + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 with: version: 8 + - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: 'pnpm' + - name: Install dependencies run: pnpm install + + - name: Run format and lint + run: pnpm biome ci + + - name: Run type check + run: pnpm typecheck + - name: Run Build run: pnpm build + - name: Run Tests run: pnpm run test @@ -38,7 +51,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out the code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -56,4 +69,4 @@ jobs: - name: Build and push Docker image using custom script run: | chmod +x ./docker/push.sh - ./docker/push.sh ${{ github.ref_name == 'canary' && 'canary' || '' }} \ No newline at end of file + ./docker/push.sh ${{ github.ref_name == 'canary' && 'canary' || '' }} diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 00000000..cb2c84d5 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +pnpm lint-staged diff --git a/README.md b/README.md index ade68e82..9353e9de 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -

Dokploy

@@ -11,74 +10,67 @@
Dokploy is a free self-hostable Platform as a Service (PaaS) that simplifies the deployment and management of applications and databases. - ### Features Dokploy include multiples features to make your life easier. - -* **Applications**: Deploy any type of application (Node.js, PHP, Python, Go, Ruby, etc.). -* **Databases**: Create and manage databases with support for MySQL, PostgreSQL, MongoDB, MariaDB, Redis. -* **Backups**: Automate backups for databases to a external storage destination. -* **Docker Compose**: Native support for Docker Compose to manage complex applications. -* **Multi Node**: Scale applications to multiples nodes using docker swarm to manage the cluster. -* **Templates**: Deploy in a single click open source templates (Plausible, Pocketbase, Calcom, etc.). -* **Traefik Integration**: Automatically integrates with Traefik for routing and load balancing. -* **Real-time Monitoring**: Monitor CPU, memory, storage, and network usage, for every resource. -* **Docker Management**: Easily deploy and manage Docker containers. -* **CLI/API**: Manage your applications and databases using the command line or trought the API. -* **Self-Hosted**: Self-host Dokploy on your VPS. - - - +- **Applications**: Deploy any type of application (Node.js, PHP, Python, Go, Ruby, etc.). +- **Databases**: Create and manage databases with support for MySQL, PostgreSQL, MongoDB, MariaDB, Redis. +- **Backups**: Automate backups for databases to a external storage destination. +- **Docker Compose**: Native support for Docker Compose to manage complex applications. +- **Multi Node**: Scale applications to multiples nodes using docker swarm to manage the cluster. +- **Templates**: Deploy in a single click open source templates (Plausible, Pocketbase, Calcom, etc.). +- **Traefik Integration**: Automatically integrates with Traefik for routing and load balancing. +- **Real-time Monitoring**: Monitor CPU, memory, storage, and network usage, for every resource. +- **Docker Management**: Easily deploy and manage Docker containers. +- **CLI/API**: Manage your applications and databases using the command line or trought the API. +- **Self-Hosted**: Self-host Dokploy on your VPS. ## 🚀 Getting Started To get started run the following command in a VPS: - ```bash curl -sSL https://dokploy.com/install.sh | sh ``` - ## 📄 Documentation For detailed documentation, visit [docs.dokploy.com](https://docs.dokploy.com). - ## Video Tutorial + Watch the video - ## Donations If you like dokploy, and want to support the project to cover the costs of hosting, testing and development new features, you can donate to the project using the following link: Thanks to all the supporters! -https://opencollective.com/dokploy +[Dokploy Open Collective](https://opencollective.com/dokploy) +Organizations: + + +Individuals: - ## Contributors - - ## Support OS -- Ubuntu 24.04 LTS +- Ubuntu 24.04 LTS - Ubuntu 23.10 -- Ubuntu 22.04 LTS -- Ubuntu 20.04 LTS +- Ubuntu 22.04 LTS +- Ubuntu 20.04 LTS - Ubuntu 18.04 LTS - Debian 12 - Debian 11 @@ -86,9 +78,6 @@ https://opencollective.com/dokploy - Centos 9 - Centos 8 - - ## Explanation + [English](README.md) | [中文](README-zh.md) | [Deutsch](README-de.md) | [Русский Язык](README-ru.md) - - diff --git a/__test__/compose/compose.test.ts b/__test__/compose/compose.test.ts index 675cb772..1e728b99 100644 --- a/__test__/compose/compose.test.ts +++ b/__test__/compose/compose.test.ts @@ -1,7 +1,7 @@ -import { expect, test } from "vitest"; -import { load } from "js-yaml"; import { addPrefixToAllProperties } from "@/server/utils/docker/compose"; import type { ComposeSpecification } from "@/server/utils/docker/types"; +import { load } from "js-yaml"; +import { expect, test } from "vitest"; const composeFile1 = ` version: "3.8" diff --git a/__test__/compose/network/network-service.test.ts b/__test__/compose/network/network-service.test.ts index 92df7a73..d592811b 100644 --- a/__test__/compose/network/network-service.test.ts +++ b/__test__/compose/network/network-service.test.ts @@ -79,10 +79,11 @@ test("Add prefix to networks in services with aliases", () => { `frontend-${prefix}`, ); - const networkConfig = - actualComposeData?.services?.api?.networks[`frontend-${prefix}`]; - expect(networkConfig).toBeDefined(); - expect(networkConfig?.aliases).toContain("api"); + const networkConfig = actualComposeData?.services?.api?.networks as { + [key: string]: { aliases?: string[] }; + }; + expect(networkConfig[`frontend-${prefix}`]).toBeDefined(); + expect(networkConfig[`frontend-${prefix}`]?.aliases).toContain("api"); expect(actualComposeData.services?.api?.networks).not.toHaveProperty( "frontend-ash", @@ -169,7 +170,9 @@ test("Add prefix to networks in services (combined case)", () => { ); // Caso 2: Objeto con aliases - const apiNetworks = actualComposeData.services?.api?.networks; + const apiNetworks = actualComposeData.services?.api?.networks as { + [key: string]: unknown; + }; expect(apiNetworks).toHaveProperty(`frontend-${prefix}`); expect(apiNetworks[`frontend-${prefix}`]).toBeDefined(); expect(apiNetworks).not.toHaveProperty("frontend"); diff --git a/__test__/compose/network/network.test.ts b/__test__/compose/network/network.test.ts index ae938775..f86cabfd 100644 --- a/__test__/compose/network/network.test.ts +++ b/__test__/compose/network/network.test.ts @@ -76,9 +76,11 @@ test("Add prefix to networks in services and root (combined case)", () => { ); // Caso 2: Objeto con aliases - const apiNetworks = actualComposeData.services?.api?.networks; + const apiNetworks = actualComposeData.services?.api?.networks as { + [key: string]: { aliases?: string[] }; + }; expect(apiNetworks).toHaveProperty(`frontend-${prefix}`); - expect(apiNetworks[`frontend-${prefix}`]?.aliases).toContain("api"); + expect(apiNetworks?.[`frontend-${prefix}`]?.aliases).toContain("api"); expect(apiNetworks).not.toHaveProperty("frontend"); // Caso 3: Objeto con redes simples diff --git a/__test__/compose/secrets/secret-root.test.ts b/__test__/compose/secrets/secret-root.test.ts index 861343a2..61f9f818 100644 --- a/__test__/compose/secrets/secret-root.test.ts +++ b/__test__/compose/secrets/secret-root.test.ts @@ -1,8 +1,8 @@ -import { expect, test } from "vitest"; -import { load, dump } from "js-yaml"; import { generateRandomHash } from "@/server/utils/docker/compose"; -import type { ComposeSpecification } from "@/server/utils/docker/types"; import { addPrefixToSecretsRoot } from "@/server/utils/docker/compose/secrets"; +import type { ComposeSpecification } from "@/server/utils/docker/types"; +import { dump, load } from "js-yaml"; +import { expect, test } from "vitest"; test("Generate random hash with 8 characters", () => { const hash = generateRandomHash(); diff --git a/__test__/compose/service/service-container-name.test.ts b/__test__/compose/service/service-container-name.test.ts index 9e3bfa80..9f5fe9ed 100644 --- a/__test__/compose/service/service-container-name.test.ts +++ b/__test__/compose/service/service-container-name.test.ts @@ -42,7 +42,7 @@ test("Add prefix to service names with container_name in compose file", () => { const actualComposeData = { ...composeData, services: updatedComposeData }; // Verificar que el nombre del contenedor ha cambiado correctamente - expect(actualComposeData.services[`web-${prefix}`].container_name).toBe( + expect(actualComposeData.services?.[`web-${prefix}`]?.container_name).toBe( `web_container-${prefix}`, ); // Verificar que la nueva clave del servicio tiene el prefijo y la vieja clave no existe @@ -50,10 +50,10 @@ test("Add prefix to service names with container_name in compose file", () => { expect(actualComposeData.services).not.toHaveProperty("web"); // Verificar que la configuración de la imagen sigue igual - expect(actualComposeData.services[`web-${prefix}`].image).toBe( + expect(actualComposeData.services?.[`web-${prefix}`]?.image).toBe( "nginx:latest", ); - expect(actualComposeData.services[`api-${prefix}`].image).toBe( + expect(actualComposeData.services?.[`api-${prefix}`]?.image).toBe( "myapi:latest", ); }); diff --git a/__test__/compose/service/service-depends-on.test.ts b/__test__/compose/service/service-depends-on.test.ts index cf4ca132..e339ee65 100644 --- a/__test__/compose/service/service-depends-on.test.ts +++ b/__test__/compose/service/service-depends-on.test.ts @@ -51,30 +51,30 @@ test("Add prefix to service names with depends_on (array) in compose file", () = expect(actualComposeData.services).not.toHaveProperty("web"); // Verificar que la configuración de la imagen sigue igual - expect(actualComposeData.services[`web-${prefix}`].image).toBe( + expect(actualComposeData.services?.[`web-${prefix}`]?.image).toBe( "nginx:latest", ); - expect(actualComposeData.services[`api-${prefix}`].image).toBe( + expect(actualComposeData.services?.[`api-${prefix}`]?.image).toBe( "myapi:latest", ); // Verificar que los nombres en depends_on tienen el prefijo - expect(actualComposeData.services[`web-${prefix}`].depends_on).toContain( + expect(actualComposeData.services?.[`web-${prefix}`]?.depends_on).toContain( `db-${prefix}`, ); - expect(actualComposeData.services[`web-${prefix}`].depends_on).toContain( + expect(actualComposeData.services?.[`web-${prefix}`]?.depends_on).toContain( `api-${prefix}`, ); // Verificar que los servicios `db` y `api` también tienen el prefijo expect(actualComposeData.services).toHaveProperty(`db-${prefix}`); expect(actualComposeData.services).not.toHaveProperty("db"); - expect(actualComposeData.services[`db-${prefix}`].image).toBe( + expect(actualComposeData.services?.[`db-${prefix}`]?.image).toBe( "postgres:latest", ); expect(actualComposeData.services).toHaveProperty(`api-${prefix}`); expect(actualComposeData.services).not.toHaveProperty("api"); - expect(actualComposeData.services[`api-${prefix}`].image).toBe( + expect(actualComposeData.services?.[`api-${prefix}`]?.image).toBe( "myapi:latest", ); }); @@ -121,16 +121,16 @@ test("Add prefix to service names with depends_on (object) in compose file", () expect(actualComposeData.services).not.toHaveProperty("web"); // Verificar que la configuración de la imagen sigue igual - expect(actualComposeData.services[`web-${prefix}`].image).toBe( + expect(actualComposeData.services?.[`web-${prefix}`]?.image).toBe( "nginx:latest", ); - expect(actualComposeData.services[`api-${prefix}`].image).toBe( + expect(actualComposeData.services?.[`api-${prefix}`]?.image).toBe( "myapi:latest", ); // Verificar que los nombres en depends_on tienen el prefijo - const webDependsOn = actualComposeData.services[`web-${prefix}`] - .depends_on as Record; + const webDependsOn = actualComposeData.services?.[`web-${prefix}`] + ?.depends_on as Record; expect(webDependsOn).toHaveProperty(`db-${prefix}`); expect(webDependsOn).toHaveProperty(`api-${prefix}`); expect(webDependsOn[`db-${prefix}`].condition).toBe("service_healthy"); @@ -139,12 +139,12 @@ test("Add prefix to service names with depends_on (object) in compose file", () // Verificar que los servicios `db` y `api` también tienen el prefijo expect(actualComposeData.services).toHaveProperty(`db-${prefix}`); expect(actualComposeData.services).not.toHaveProperty("db"); - expect(actualComposeData.services[`db-${prefix}`].image).toBe( + expect(actualComposeData.services?.[`db-${prefix}`]?.image).toBe( "postgres:latest", ); expect(actualComposeData.services).toHaveProperty(`api-${prefix}`); expect(actualComposeData.services).not.toHaveProperty("api"); - expect(actualComposeData.services[`api-${prefix}`].image).toBe( + expect(actualComposeData.services?.[`api-${prefix}`]?.image).toBe( "myapi:latest", ); }); diff --git a/__test__/compose/service/service-extends.test.ts b/__test__/compose/service/service-extends.test.ts index 6188e4a8..e8f31aab 100644 --- a/__test__/compose/service/service-extends.test.ts +++ b/__test__/compose/service/service-extends.test.ts @@ -49,22 +49,22 @@ test("Add prefix to service names with extends (string) in compose file", () => expect(actualComposeData.services).not.toHaveProperty("web"); // Verificar que la configuración de la imagen sigue igual - expect(actualComposeData.services[`web-${prefix}`].image).toBe( + expect(actualComposeData.services?.[`web-${prefix}`]?.image).toBe( "nginx:latest", ); - expect(actualComposeData.services[`api-${prefix}`].image).toBe( + expect(actualComposeData.services?.[`api-${prefix}`]?.image).toBe( "myapi:latest", ); // Verificar que el nombre en extends tiene el prefijo - expect(actualComposeData.services[`web-${prefix}`].extends).toBe( + expect(actualComposeData.services?.[`web-${prefix}`]?.extends).toBe( `base_service-${prefix}`, ); // Verificar que el servicio `base_service` también tiene el prefijo expect(actualComposeData.services).toHaveProperty(`base_service-${prefix}`); expect(actualComposeData.services).not.toHaveProperty("base_service"); - expect(actualComposeData.services[`base_service-${prefix}`].image).toBe( + expect(actualComposeData.services?.[`base_service-${prefix}`]?.image).toBe( "base:latest", ); }); @@ -109,23 +109,23 @@ test("Add prefix to service names with extends (object) in compose file", () => expect(actualComposeData.services).not.toHaveProperty("web"); // Verificar que la configuración de la imagen sigue igual - expect(actualComposeData.services[`web-${prefix}`].image).toBe( + expect(actualComposeData.services?.[`web-${prefix}`]?.image).toBe( "nginx:latest", ); - expect(actualComposeData.services[`api-${prefix}`].image).toBe( + expect(actualComposeData.services?.[`api-${prefix}`]?.image).toBe( "myapi:latest", ); // Verificar que el nombre en extends.service tiene el prefijo - const webExtends = actualComposeData.services[`web-${prefix}`].extends; + const webExtends = actualComposeData.services?.[`web-${prefix}`]?.extends; if (typeof webExtends !== "string") { - expect(webExtends.service).toBe(`base_service-${prefix}`); + expect(webExtends?.service).toBe(`base_service-${prefix}`); } // Verificar que el servicio `base_service` también tiene el prefijo expect(actualComposeData.services).toHaveProperty(`base_service-${prefix}`); expect(actualComposeData.services).not.toHaveProperty("base_service"); - expect(actualComposeData.services[`base_service-${prefix}`].image).toBe( + expect(actualComposeData.services?.[`base_service-${prefix}`]?.image).toBe( "base:latest", ); }); diff --git a/__test__/compose/service/service-links.test.ts b/__test__/compose/service/service-links.test.ts index b9b22fdf..08252649 100644 --- a/__test__/compose/service/service-links.test.ts +++ b/__test__/compose/service/service-links.test.ts @@ -50,27 +50,27 @@ test("Add prefix to service names with links in compose file", () => { expect(actualComposeData.services).not.toHaveProperty("web"); // Verificar que la configuración de la imagen sigue igual - expect(actualComposeData.services[`web-${prefix}`].image).toBe( + expect(actualComposeData.services?.[`web-${prefix}`]?.image).toBe( "nginx:latest", ); - expect(actualComposeData.services[`api-${prefix}`].image).toBe( + expect(actualComposeData.services?.[`api-${prefix}`]?.image).toBe( "myapi:latest", ); // Verificar que los nombres en links tienen el prefijo - expect(actualComposeData.services[`web-${prefix}`].links).toContain( + expect(actualComposeData.services?.[`web-${prefix}`]?.links).toContain( `db-${prefix}`, ); // Verificar que los servicios `db` y `api` también tienen el prefijo expect(actualComposeData.services).toHaveProperty(`db-${prefix}`); expect(actualComposeData.services).not.toHaveProperty("db"); - expect(actualComposeData.services[`db-${prefix}`].image).toBe( + expect(actualComposeData.services?.[`db-${prefix}`]?.image).toBe( "postgres:latest", ); expect(actualComposeData.services).toHaveProperty(`api-${prefix}`); expect(actualComposeData.services).not.toHaveProperty("api"); - expect(actualComposeData.services[`api-${prefix}`].image).toBe( + expect(actualComposeData.services?.[`api-${prefix}`]?.image).toBe( "myapi:latest", ); }); diff --git a/__test__/compose/service/sevice-volumes-from.test.ts b/__test__/compose/service/sevice-volumes-from.test.ts index 90905a00..00d75fe8 100644 --- a/__test__/compose/service/sevice-volumes-from.test.ts +++ b/__test__/compose/service/sevice-volumes-from.test.ts @@ -54,23 +54,25 @@ test("Add prefix to service names with volumes_from in compose file", () => { expect(actualComposeData.services).not.toHaveProperty("web"); // Verificar que la configuración de la imagen sigue igual - expect(actualComposeData.services[`web-${prefix}`].image).toBe( + expect(actualComposeData.services?.[`web-${prefix}`]?.image).toBe( "nginx:latest", ); - expect(actualComposeData.services[`api-${prefix}`].image).toBe( + expect(actualComposeData.services?.[`api-${prefix}`]?.image).toBe( "myapi:latest", ); // Verificar que los nombres en volumes_from tienen el prefijo - expect(actualComposeData.services[`web-${prefix}`].volumes_from).toContain( + expect(actualComposeData.services?.[`web-${prefix}`]?.volumes_from).toContain( `shared-${prefix}`, ); - expect(actualComposeData.services[`api-${prefix}`].volumes_from).toContain( + expect(actualComposeData.services?.[`api-${prefix}`]?.volumes_from).toContain( `shared-${prefix}`, ); // Verificar que el servicio shared también tiene el prefijo expect(actualComposeData.services).toHaveProperty(`shared-${prefix}`); expect(actualComposeData.services).not.toHaveProperty("shared"); - expect(actualComposeData.services[`shared-${prefix}`].image).toBe("busybox"); + expect(actualComposeData.services?.[`shared-${prefix}`]?.image).toBe( + "busybox", + ); }); diff --git a/__test__/compose/volume/volume-2.test.ts b/__test__/compose/volume/volume-2.test.ts index 41581844..57bfb761 100644 --- a/__test__/compose/volume/volume-2.test.ts +++ b/__test__/compose/volume/volume-2.test.ts @@ -1,7 +1,7 @@ import { generateRandomHash } from "@/server/utils/docker/compose"; import { - addPrefixToVolumesRoot, addPrefixToAllVolumes, + addPrefixToVolumesRoot, } from "@/server/utils/docker/compose/volume"; import type { ComposeSpecification } from "@/server/utils/docker/types"; import { load } from "js-yaml"; diff --git a/__test__/vitest.config.ts b/__test__/vitest.config.ts index 4127903f..71749b6c 100644 --- a/__test__/vitest.config.ts +++ b/__test__/vitest.config.ts @@ -1,5 +1,5 @@ -import { defineConfig } from "vitest/config"; import tsconfigPaths from "vite-tsconfig-paths"; +import { defineConfig } from "vitest/config"; export default defineConfig({ plugins: [ diff --git a/biome.json b/biome.json index dd7c1eb7..fd2d79a3 100644 --- a/biome.json +++ b/biome.json @@ -1,17 +1,34 @@ { - "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", - "linter":{ - "rules": { - "correctness":{ - "useExhaustiveDependencies": "off" - }, - "suspicious":{ - "noArrayIndexKey": "off" - }, - "a11y":{ - "noSvgWithoutTitle":"off" - } - } - } - -} \ No newline at end of file + "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", + "files": { + "ignore": ["node_modules/**", ".next/**", "drizzle/**", ".docker"] + }, + "organizeImports": { + "enabled": true + }, + "linter": { + "rules": { + "complexity": { + "noUselessCatch": "off", + "noBannedTypes": "off" + }, + "correctness": { + "useExhaustiveDependencies": "off", + "noUnsafeOptionalChaining": "off" + }, + "style": { + "noNonNullAssertion": "off" + }, + "suspicious": { + "noArrayIndexKey": "off", + "noExplicitAny": "off", + "noRedeclare": "off" + }, + "a11y": { + "noSvgWithoutTitle": "off", + "useKeyWithClickEvents": "off", + "useAriaPropsForRole": "off" + } + } + } +} diff --git a/components.json b/components.json index b4baac4f..81104c1e 100644 --- a/components.json +++ b/components.json @@ -1,17 +1,17 @@ { - "$schema": "https://ui.shadcn.com/schema.json", - "style": "default", - "rsc": false, - "tsx": true, - "tailwind": { - "config": "tailwind.config.ts", - "css": "styles/globals.css", - "baseColor": "zinc", - "cssVariables": true, - "prefix": "" - }, - "aliases": { - "components": "@/components", - "utils": "@/lib/utils" - } -} \ No newline at end of file + "$schema": "https://ui.shadcn.com/schema.json", + "style": "default", + "rsc": false, + "tsx": true, + "tailwind": { + "config": "tailwind.config.ts", + "css": "styles/globals.css", + "baseColor": "zinc", + "cssVariables": true, + "prefix": "" + }, + "aliases": { + "components": "@/components", + "utils": "@/lib/utils" + } +} diff --git a/components/auth/login-2fa.tsx b/components/auth/login-2fa.tsx index 6bf03d0c..7c4915fa 100644 --- a/components/auth/login-2fa.tsx +++ b/components/auth/login-2fa.tsx @@ -10,19 +10,19 @@ import { } from "@/components/ui/form"; import { CardTitle } from "@/components/ui/card"; -import { api } from "@/utils/api"; -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"; -import { z } from "zod"; import { InputOTP, InputOTPGroup, InputOTPSlot, } from "@/components/ui/input-otp"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { AlertTriangle } from "lucide-react"; import { useRouter } from "next/router"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; const Login2FASchema = z.object({ pin: z.string().min(6, { diff --git a/components/dashboard/application/advanced/cluster/modify-swarm-settings.tsx b/components/dashboard/application/advanced/cluster/modify-swarm-settings.tsx index 3e2730c9..fd91703b 100644 --- a/components/dashboard/application/advanced/cluster/modify-swarm-settings.tsx +++ b/components/dashboard/application/advanced/cluster/modify-swarm-settings.tsx @@ -1,3 +1,5 @@ +import { AlertBlock } from "@/components/shared/alert-block"; +import { CodeEditor } from "@/components/shared/code-editor"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -17,21 +19,19 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; -import { api } from "@/utils/api"; -import { AlertBlock } from "@/components/shared/alert-block"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useEffect } from "react"; -import { useForm } from "react-hook-form"; -import { toast } from "sonner"; -import { z } from "zod"; -import { HelpCircle, Settings } from "lucide-react"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip"; -import { CodeEditor } from "@/components/shared/code-editor"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { HelpCircle, Settings } from "lucide-react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; const HealthCheckSwarmSchema = z .object({ diff --git a/components/dashboard/application/advanced/cluster/show-cluster-settings.tsx b/components/dashboard/application/advanced/cluster/show-cluster-settings.tsx index da69aedb..4078ae4c 100644 --- a/components/dashboard/application/advanced/cluster/show-cluster-settings.tsx +++ b/components/dashboard/application/advanced/cluster/show-cluster-settings.tsx @@ -1,4 +1,5 @@ -import React from "react"; +import { AlertBlock } from "@/components/shared/alert-block"; +import { Button } from "@/components/ui/button"; import { Card, CardContent, @@ -6,8 +7,6 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; -import { api } from "@/utils/api"; -import { z } from "zod"; import { Form, FormControl, @@ -16,11 +15,6 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; -import { toast } from "sonner"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useForm } from "react-hook-form"; -import { useEffect } from "react"; -import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Select, @@ -31,10 +25,16 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; -import Link from "next/link"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; import { Server } from "lucide-react"; +import Link from "next/link"; +import React from "react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; import { AddSwarmSettings } from "./modify-swarm-settings"; -import { AlertBlock } from "@/components/shared/alert-block"; interface Props { applicationId: string; diff --git a/components/dashboard/application/advanced/general/add-command.tsx b/components/dashboard/application/advanced/general/add-command.tsx index a898607d..979660bc 100644 --- a/components/dashboard/application/advanced/general/add-command.tsx +++ b/components/dashboard/application/advanced/general/add-command.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import { Button } from "@/components/ui/button"; import { Card, CardContent, @@ -6,8 +6,6 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; -import { api } from "@/utils/api"; -import { z } from "zod"; import { Form, FormControl, @@ -16,12 +14,14 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; -import { toast } from "sonner"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useForm } from "react-hook-form"; -import { useEffect } from "react"; -import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import React from "react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; interface Props { applicationId: string; } diff --git a/components/dashboard/application/advanced/ports/add-port.tsx b/components/dashboard/application/advanced/ports/add-port.tsx index 76939d82..873baa67 100644 --- a/components/dashboard/application/advanced/ports/add-port.tsx +++ b/components/dashboard/application/advanced/ports/add-port.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -17,13 +18,6 @@ import { FormMessage, } 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 { useEffect } from "react"; -import { useForm } from "react-hook-form"; -import { toast } from "sonner"; -import { PlusIcon } from "lucide-react"; import { Select, SelectContent, @@ -31,6 +25,12 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { PlusIcon } from "lucide-react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; import { z } from "zod"; const AddPortSchema = z.object({ diff --git a/components/dashboard/application/advanced/ports/show-port.tsx b/components/dashboard/application/advanced/ports/show-port.tsx index ab5f4097..1ab804fb 100644 --- a/components/dashboard/application/advanced/ports/show-port.tsx +++ b/components/dashboard/application/advanced/ports/show-port.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import { AlertBlock } from "@/components/shared/alert-block"; import { Card, CardContent, @@ -8,10 +8,10 @@ import { } from "@/components/ui/card"; import { api } from "@/utils/api"; import { Rss } from "lucide-react"; +import React from "react"; import { AddPort } from "./add-port"; import { DeletePort } from "./delete-port"; import { UpdatePort } from "./update-port"; -import { AlertBlock } from "@/components/shared/alert-block"; interface Props { applicationId: string; } diff --git a/components/dashboard/application/advanced/ports/update-port.tsx b/components/dashboard/application/advanced/ports/update-port.tsx index 9742964e..8f9d9cd7 100644 --- a/components/dashboard/application/advanced/ports/update-port.tsx +++ b/components/dashboard/application/advanced/ports/update-port.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -17,14 +18,6 @@ import { FormMessage, } 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 { PenBoxIcon, Pencil } from "lucide-react"; -import { useEffect } from "react"; -import { useForm } from "react-hook-form"; -import { toast } from "sonner"; -import { z } from "zod"; import { Select, SelectContent, @@ -32,6 +25,13 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { PenBoxIcon, Pencil } from "lucide-react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; const UpdatePortSchema = z.object({ publishedPort: z.number().int().min(1).max(65535), diff --git a/components/dashboard/application/advanced/redirects/add-redirect.tsx b/components/dashboard/application/advanced/redirects/add-redirect.tsx index 4bcf2c56..661990a9 100644 --- a/components/dashboard/application/advanced/redirects/add-redirect.tsx +++ b/components/dashboard/application/advanced/redirects/add-redirect.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -11,22 +12,21 @@ import { import { Form, FormControl, + FormDescription, FormField, FormItem, FormLabel, - FormDescription, FormMessage, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; +import { Switch } from "@/components/ui/switch"; import { api } from "@/utils/api"; -import { AlertBlock } from "@/components/shared/alert-block"; import { zodResolver } from "@hookform/resolvers/zod"; +import { PlusIcon } from "lucide-react"; import { useEffect } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; -import { PlusIcon } from "lucide-react"; import { z } from "zod"; -import { Switch } from "@/components/ui/switch"; const AddRedirectchema = z.object({ regex: z.string().min(1, "Regex required"), diff --git a/components/dashboard/application/advanced/redirects/show-redirects.tsx b/components/dashboard/application/advanced/redirects/show-redirects.tsx index 2a6e80a2..9a8325fc 100644 --- a/components/dashboard/application/advanced/redirects/show-redirects.tsx +++ b/components/dashboard/application/advanced/redirects/show-redirects.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { Card, CardContent, @@ -8,6 +7,7 @@ import { } from "@/components/ui/card"; import { api } from "@/utils/api"; import { Split } from "lucide-react"; +import React from "react"; import { AddRedirect } from "./add-redirect"; import { DeleteRedirect } from "./delete-redirect"; import { UpdateRedirect } from "./update-redirect"; diff --git a/components/dashboard/application/advanced/redirects/update-redirect.tsx b/components/dashboard/application/advanced/redirects/update-redirect.tsx index 9643938b..855f5c8c 100644 --- a/components/dashboard/application/advanced/redirects/update-redirect.tsx +++ b/components/dashboard/application/advanced/redirects/update-redirect.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -11,22 +12,21 @@ import { import { Form, FormControl, + FormDescription, FormField, FormItem, FormLabel, - FormDescription, FormMessage, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; +import { Switch } from "@/components/ui/switch"; import { api } from "@/utils/api"; -import { AlertBlock } from "@/components/shared/alert-block"; import { zodResolver } from "@hookform/resolvers/zod"; import { PenBoxIcon, Pencil } from "lucide-react"; import { useEffect } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; -import { Switch } from "@/components/ui/switch"; const UpdateRedirectSchema = z.object({ regex: z.string().min(1, "Regex required"), permanent: z.boolean().default(false), diff --git a/components/dashboard/application/advanced/security/add-security.tsx b/components/dashboard/application/advanced/security/add-security.tsx index 1f7c0d39..64dfd57a 100644 --- a/components/dashboard/application/advanced/security/add-security.tsx +++ b/components/dashboard/application/advanced/security/add-security.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -18,12 +19,11 @@ 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 { PlusIcon } from "lucide-react"; import { useEffect } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; -import { PlusIcon } from "lucide-react"; import { z } from "zod"; const AddSecuritychema = z.object({ diff --git a/components/dashboard/application/advanced/security/show-security.tsx b/components/dashboard/application/advanced/security/show-security.tsx index ef51e2c9..5c02bf76 100644 --- a/components/dashboard/application/advanced/security/show-security.tsx +++ b/components/dashboard/application/advanced/security/show-security.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { Card, CardContent, @@ -8,6 +7,7 @@ import { } from "@/components/ui/card"; import { api } from "@/utils/api"; import { LockKeyhole } from "lucide-react"; +import React from "react"; import { AddSecurity } from "./add-security"; import { DeleteSecurity } from "./delete-security"; import { UpdateSecurity } from "./update-security"; diff --git a/components/dashboard/application/advanced/security/update-security.tsx b/components/dashboard/application/advanced/security/update-security.tsx index 9ff53c2e..bb6e59ae 100644 --- a/components/dashboard/application/advanced/security/update-security.tsx +++ b/components/dashboard/application/advanced/security/update-security.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -18,7 +19,6 @@ 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 { PenBoxIcon, Pencil } from "lucide-react"; import { useEffect } from "react"; diff --git a/components/dashboard/application/advanced/show-application-advanced-settings.tsx b/components/dashboard/application/advanced/show-application-advanced-settings.tsx index d0177331..56513465 100644 --- a/components/dashboard/application/advanced/show-application-advanced-settings.tsx +++ b/components/dashboard/application/advanced/show-application-advanced-settings.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Card, @@ -21,7 +22,6 @@ import React, { useEffect } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; -import { AlertBlock } from "@/components/shared/alert-block"; const addResourcesApplication = z.object({ memoryReservation: z.number().nullable().optional(), diff --git a/components/dashboard/application/advanced/traefik/show-traefik-config.tsx b/components/dashboard/application/advanced/traefik/show-traefik-config.tsx index 6b541504..28d44264 100644 --- a/components/dashboard/application/advanced/traefik/show-traefik-config.tsx +++ b/components/dashboard/application/advanced/traefik/show-traefik-config.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import { CodeEditor } from "@/components/shared/code-editor"; import { Card, CardContent, @@ -8,8 +8,8 @@ import { } from "@/components/ui/card"; import { api } from "@/utils/api"; import { File } from "lucide-react"; +import React from "react"; import { UpdateTraefikConfig } from "./update-traefik-config"; -import { CodeEditor } from "@/components/shared/code-editor"; interface Props { applicationId: string; } @@ -29,7 +29,7 @@ export const ShowTraefikConfig = ({ applicationId }: Props) => { Traefik Modify the traefik config, in rare cases you may need to add - specific config, becarefull because modifying incorrectly can break + specific config, be careful because modifying incorrectly can break traefik and your application
diff --git a/components/dashboard/application/advanced/traefik/update-traefik-config.tsx b/components/dashboard/application/advanced/traefik/update-traefik-config.tsx index 659353ec..a185082b 100644 --- a/components/dashboard/application/advanced/traefik/update-traefik-config.tsx +++ b/components/dashboard/application/advanced/traefik/update-traefik-config.tsx @@ -1,3 +1,5 @@ +import { AlertBlock } from "@/components/shared/alert-block"; +import { CodeEditor } from "@/components/shared/code-editor"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -17,14 +19,12 @@ import { FormMessage, } from "@/components/ui/form"; import { api } from "@/utils/api"; -import { AlertBlock } from "@/components/shared/alert-block"; import { zodResolver } from "@hookform/resolvers/zod"; +import jsyaml from "js-yaml"; import { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; -import jsyaml from "js-yaml"; -import { CodeEditor } from "@/components/shared/code-editor"; const UpdateTraefikConfigSchema = z.object({ traefikConfig: z.string(), @@ -110,12 +110,15 @@ export const UpdateTraefikConfig = ({ applicationId }: Props) => { }; return ( - { - setOpen(open) - if (!open) { - form.reset(); - } - }}> + { + setOpen(open); + if (!open) { + form.reset(); + } + }} + > diff --git a/components/dashboard/application/advanced/volumes/add-volumes.tsx b/components/dashboard/application/advanced/volumes/add-volumes.tsx index 6b29bd7e..6b882b7c 100644 --- a/components/dashboard/application/advanced/volumes/add-volumes.tsx +++ b/components/dashboard/application/advanced/volumes/add-volumes.tsx @@ -1,8 +1,4 @@ -import { zodResolver } from "@hookform/resolvers/zod"; -import type React from "react"; -import { useEffect } from "react"; -import { useForm } from "react-hook-form"; -import { z } from "zod"; +import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, @@ -22,12 +18,16 @@ import { import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; -import { Button } from "@/components/ui/button"; -import { PlusIcon } from "lucide-react"; import { Textarea } from "@/components/ui/textarea"; -import { api } from "@/utils/api"; -import { toast } from "sonner"; import { cn } from "@/lib/utils"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { PlusIcon } from "lucide-react"; +import type React from "react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; interface Props { serviceId: string; serviceType: diff --git a/components/dashboard/application/advanced/volumes/delete-volume.tsx b/components/dashboard/application/advanced/volumes/delete-volume.tsx index 89e81f93..020a6c36 100644 --- a/components/dashboard/application/advanced/volumes/delete-volume.tsx +++ b/components/dashboard/application/advanced/volumes/delete-volume.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { AlertDialog, AlertDialogAction, @@ -13,6 +12,7 @@ import { import { Button } from "@/components/ui/button"; import { api } from "@/utils/api"; import { TrashIcon } from "lucide-react"; +import React from "react"; import { toast } from "sonner"; interface Props { diff --git a/components/dashboard/application/advanced/volumes/show-volumes.tsx b/components/dashboard/application/advanced/volumes/show-volumes.tsx index 2d419e9e..6c9b5398 100644 --- a/components/dashboard/application/advanced/volumes/show-volumes.tsx +++ b/components/dashboard/application/advanced/volumes/show-volumes.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import { AlertBlock } from "@/components/shared/alert-block"; import { Card, CardContent, @@ -8,10 +8,10 @@ import { } from "@/components/ui/card"; import { api } from "@/utils/api"; import { AlertTriangle, Package } from "lucide-react"; +import React from "react"; import { AddVolumes } from "./add-volumes"; import { DeleteVolume } from "./delete-volume"; import { UpdateVolume } from "./update-volume"; -import { AlertBlock } from "@/components/shared/alert-block"; interface Props { applicationId: string; } diff --git a/components/dashboard/application/advanced/volumes/update-volume.tsx b/components/dashboard/application/advanced/volumes/update-volume.tsx index d11ee142..34c17128 100644 --- a/components/dashboard/application/advanced/volumes/update-volume.tsx +++ b/components/dashboard/application/advanced/volumes/update-volume.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -17,15 +18,14 @@ import { FormMessage, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; +import { Textarea } from "@/components/ui/textarea"; import { api } from "@/utils/api"; -import { AlertBlock } from "@/components/shared/alert-block"; import { zodResolver } from "@hookform/resolvers/zod"; import { Pencil } from "lucide-react"; import { useEffect } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; -import { Textarea } from "@/components/ui/textarea"; const mountSchema = z.object({ mountPath: z.string().min(1, "Mount path required"), diff --git a/components/dashboard/application/build/show.tsx b/components/dashboard/application/build/show.tsx index d5c41a1b..aab78871 100644 --- a/components/dashboard/application/build/show.tsx +++ b/components/dashboard/application/build/show.tsx @@ -1,213 +1,213 @@ -import { - Form, - FormControl, - FormField, - FormItem, - FormLabel, - FormMessage, -} from "@/components/ui/form"; +import { Button } from "@/components/ui/button"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { + Form, + FormControl, + FormField, + FormItem, + FormLabel, + FormMessage, +} from "@/components/ui/form"; +import { Input } from "@/components/ui/input"; +import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; import { api } from "@/utils/api"; import { zodResolver } from "@hookform/resolvers/zod"; import { Cog } from "lucide-react"; import { useEffect } from "react"; import { useForm } from "react-hook-form"; -import { z } from "zod"; -import { Button } from "@/components/ui/button"; -import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; import { toast } from "sonner"; -import { Input } from "@/components/ui/input"; +import { z } from "zod"; enum BuildType { - dockerfile = "dockerfile", - heroku_buildpacks = "heroku_buildpacks", - paketo_buildpacks = "paketo_buildpacks", - nixpacks = "nixpacks", + dockerfile = "dockerfile", + heroku_buildpacks = "heroku_buildpacks", + paketo_buildpacks = "paketo_buildpacks", + nixpacks = "nixpacks", } const mySchema = z.discriminatedUnion("buildType", [ - z.object({ - buildType: z.literal("dockerfile"), - dockerfile: z - .string({ - required_error: "Dockerfile path is required", - invalid_type_error: "Dockerfile path is required", - }) - .min(1, "Dockerfile required"), - }), - z.object({ - buildType: z.literal("heroku_buildpacks"), - }), - z.object({ - buildType: z.literal("paketo_buildpacks"), - }), - z.object({ - buildType: z.literal("nixpacks"), - }), + z.object({ + buildType: z.literal("dockerfile"), + dockerfile: z + .string({ + required_error: "Dockerfile path is required", + invalid_type_error: "Dockerfile path is required", + }) + .min(1, "Dockerfile required"), + }), + z.object({ + buildType: z.literal("heroku_buildpacks"), + }), + z.object({ + buildType: z.literal("paketo_buildpacks"), + }), + z.object({ + buildType: z.literal("nixpacks"), + }), ]); type AddTemplate = z.infer; interface Props { - applicationId: string; + applicationId: string; } export const ShowBuildChooseForm = ({ applicationId }: Props) => { - const { mutateAsync, isLoading } = - api.application.saveBuildType.useMutation(); - const { data, refetch } = api.application.one.useQuery( - { - applicationId, - }, - { - enabled: !!applicationId, - }, - ); + const { mutateAsync, isLoading } = + api.application.saveBuildType.useMutation(); + const { data, refetch } = api.application.one.useQuery( + { + applicationId, + }, + { + enabled: !!applicationId, + }, + ); - const form = useForm({ - defaultValues: { - buildType: BuildType.nixpacks, - }, - resolver: zodResolver(mySchema), - }); + const form = useForm({ + defaultValues: { + buildType: BuildType.nixpacks, + }, + resolver: zodResolver(mySchema), + }); - const buildType = form.watch("buildType"); - useEffect(() => { - if (data) { - // TODO: refactor this - if (data.buildType === "dockerfile") { - form.reset({ - buildType: data.buildType, - ...(data.buildType && { - dockerfile: data.dockerfile || "", - }), - }); - } else { - form.reset({ - buildType: data.buildType, - }); - } - } - }, [form.formState.isSubmitSuccessful, form.reset, data, form]); + const buildType = form.watch("buildType"); + useEffect(() => { + if (data) { + // TODO: refactor this + if (data.buildType === "dockerfile") { + form.reset({ + buildType: data.buildType, + ...(data.buildType && { + dockerfile: data.dockerfile || "", + }), + }); + } else { + form.reset({ + buildType: data.buildType, + }); + } + } + }, [form.formState.isSubmitSuccessful, form.reset, data, form]); - const onSubmit = async (data: AddTemplate) => { - await mutateAsync({ - applicationId, - buildType: data.buildType, - dockerfile: data.buildType === "dockerfile" ? data.dockerfile : null, - }) - .then(async () => { - toast.success("Build type saved"); - await refetch(); - }) - .catch(() => { - toast.error("Error to save the build type"); - }); - }; + const onSubmit = async (data: AddTemplate) => { + await mutateAsync({ + applicationId, + buildType: data.buildType, + dockerfile: data.buildType === "dockerfile" ? data.dockerfile : null, + }) + .then(async () => { + toast.success("Build type saved"); + await refetch(); + }) + .catch(() => { + toast.error("Error to save the build type"); + }); + }; - return ( - - - -
- Build Type -

- Select the way of building your code -

-
-
- -
-
-
- -
- - { - return ( - - Build Type - - - - - - - - Dockerfile - - - - - - - - Nixpacks - - - - - - - - Heroku Buildpacks - - - - - - - - Paketo Buildpacks - - - - - - - ); - }} - /> - {buildType === "dockerfile" && ( - { - return ( - - Docker File - - - + return ( + + + +
+ Build Type +

+ Select the way of building your code +

+
+
+ +
+
+
+ + + + { + return ( + + Build Type + + + + + + + + Dockerfile + + + + + + + + Nixpacks + + + + + + + + Heroku Buildpacks + + + + + + + + Paketo Buildpacks + + + + + + + ); + }} + /> + {buildType === "dockerfile" && ( + { + return ( + + Docker File + + + - - - ); - }} - /> - )} -
- -
- - -
-
- ); + +
+ ); + }} + /> + )} +
+ +
+ + +
+
+ ); }; diff --git a/components/dashboard/application/deployments/refresh-token.tsx b/components/dashboard/application/deployments/refresh-token.tsx index c0d32db9..e633a9f4 100644 --- a/components/dashboard/application/deployments/refresh-token.tsx +++ b/components/dashboard/application/deployments/refresh-token.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { AlertDialog, AlertDialogAction, @@ -12,6 +11,7 @@ import { } from "@/components/ui/alert-dialog"; import { api } from "@/utils/api"; import { RefreshCcw } from "lucide-react"; +import React from "react"; import { toast } from "sonner"; interface Props { diff --git a/components/dashboard/application/deployments/show-deployments.tsx b/components/dashboard/application/deployments/show-deployments.tsx index ff26dc84..31ed4e2b 100644 --- a/components/dashboard/application/deployments/show-deployments.tsx +++ b/components/dashboard/application/deployments/show-deployments.tsx @@ -1,3 +1,5 @@ +import { DateTooltip } from "@/components/shared/date-tooltip"; +import { StatusTooltip } from "@/components/shared/status-tooltip"; import { Button } from "@/components/ui/button"; import { Card, @@ -10,10 +12,8 @@ import { api } from "@/utils/api"; import { RocketIcon } from "lucide-react"; import React, { useEffect, useState } from "react"; import { CancelQueues } from "./cancel-queues"; -import { ShowDeployment } from "./show-deployment"; -import { StatusTooltip } from "@/components/shared/status-tooltip"; -import { DateTooltip } from "@/components/shared/date-tooltip"; import { RefreshToken } from "./refresh-token"; +import { ShowDeployment } from "./show-deployment"; interface Props { applicationId: string; diff --git a/components/dashboard/application/domains/add-domain.tsx b/components/dashboard/application/domains/add-domain.tsx index 0cdc6486..17adf275 100644 --- a/components/dashboard/application/domains/add-domain.tsx +++ b/components/dashboard/application/domains/add-domain.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -27,7 +28,6 @@ import { } from "@/components/ui/select"; import { Switch } from "@/components/ui/switch"; import { api } from "@/utils/api"; -import { AlertBlock } from "@/components/shared/alert-block"; import { zodResolver } from "@hookform/resolvers/zod"; import { PlusIcon } from "lucide-react"; import { useEffect } from "react"; diff --git a/components/dashboard/application/domains/delete-domain.tsx b/components/dashboard/application/domains/delete-domain.tsx index 80c2f194..63bd3f30 100644 --- a/components/dashboard/application/domains/delete-domain.tsx +++ b/components/dashboard/application/domains/delete-domain.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { AlertDialog, AlertDialogAction, @@ -13,6 +12,7 @@ import { import { Button } from "@/components/ui/button"; import { api } from "@/utils/api"; import { TrashIcon } from "lucide-react"; +import React from "react"; import { toast } from "sonner"; interface Props { diff --git a/components/dashboard/application/domains/generate-domain.tsx b/components/dashboard/application/domains/generate-domain.tsx index 92ca19bd..9ebe8e30 100644 --- a/components/dashboard/application/domains/generate-domain.tsx +++ b/components/dashboard/application/domains/generate-domain.tsx @@ -7,11 +7,11 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; +import { api } from "@/utils/api"; import { RefreshCcw } from "lucide-react"; +import Link from "next/link"; import { GenerateTraefikMe } from "./generate-traefikme"; import { GenerateWildCard } from "./generate-wildcard"; -import Link from "next/link"; -import { api } from "@/utils/api"; interface Props { applicationId: string; diff --git a/components/dashboard/application/domains/generate-traefikme.tsx b/components/dashboard/application/domains/generate-traefikme.tsx index 264a626f..3085b3a8 100644 --- a/components/dashboard/application/domains/generate-traefikme.tsx +++ b/components/dashboard/application/domains/generate-traefikme.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { AlertDialog, AlertDialogAction, @@ -13,6 +12,7 @@ import { import { Button } from "@/components/ui/button"; import { api } from "@/utils/api"; import { RefreshCcw } from "lucide-react"; +import React from "react"; import { toast } from "sonner"; interface Props { diff --git a/components/dashboard/application/domains/generate-wildcard.tsx b/components/dashboard/application/domains/generate-wildcard.tsx index 11babebd..da444552 100644 --- a/components/dashboard/application/domains/generate-wildcard.tsx +++ b/components/dashboard/application/domains/generate-wildcard.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { AlertDialog, AlertDialogAction, @@ -13,6 +12,7 @@ import { import { Button } from "@/components/ui/button"; import { api } from "@/utils/api"; import { SquareAsterisk } from "lucide-react"; +import React from "react"; import { toast } from "sonner"; interface Props { diff --git a/components/dashboard/application/domains/show-domains.tsx b/components/dashboard/application/domains/show-domains.tsx index d4df0366..5aed3524 100644 --- a/components/dashboard/application/domains/show-domains.tsx +++ b/components/dashboard/application/domains/show-domains.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import { Button } from "@/components/ui/button"; import { Card, CardContent, @@ -6,15 +6,15 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; -import { ExternalLink, GlobeIcon, RefreshCcw } from "lucide-react"; -import { Button } from "@/components/ui/button"; -import { api } from "@/utils/api"; import { Input } from "@/components/ui/input"; -import { DeleteDomain } from "./delete-domain"; +import { api } from "@/utils/api"; +import { ExternalLink, GlobeIcon, RefreshCcw } from "lucide-react"; import Link from "next/link"; +import React from "react"; import { AddDomain } from "./add-domain"; -import { UpdateDomain } from "./update-domain"; +import { DeleteDomain } from "./delete-domain"; import { GenerateDomain } from "./generate-domain"; +import { UpdateDomain } from "./update-domain"; interface Props { applicationId: string; diff --git a/components/dashboard/application/domains/update-domain.tsx b/components/dashboard/application/domains/update-domain.tsx index 7262c35b..6614a480 100644 --- a/components/dashboard/application/domains/update-domain.tsx +++ b/components/dashboard/application/domains/update-domain.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -27,7 +28,6 @@ import { } from "@/components/ui/select"; import { Switch } from "@/components/ui/switch"; import { api } from "@/utils/api"; -import { AlertBlock } from "@/components/shared/alert-block"; import { zodResolver } from "@hookform/resolvers/zod"; import { PenBoxIcon } from "lucide-react"; import { useEffect } from "react"; diff --git a/components/dashboard/application/environment/show.tsx b/components/dashboard/application/environment/show.tsx index 1e91e491..359142c5 100644 --- a/components/dashboard/application/environment/show.tsx +++ b/components/dashboard/application/environment/show.tsx @@ -1,4 +1,5 @@ -import React, { useEffect, useState } from "react"; +import { CodeEditor } from "@/components/shared/code-editor"; +import { Button } from "@/components/ui/button"; import { Card, CardContent, @@ -6,10 +7,6 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; -import { Button } from "@/components/ui/button"; -import { z } from "zod"; -import { useForm } from "react-hook-form"; -import { zodResolver } from "@hookform/resolvers/zod"; import { Form, FormControl, @@ -17,11 +14,14 @@ import { FormItem, FormMessage, } from "@/components/ui/form"; -import { api } from "@/utils/api"; -import { toast } from "sonner"; import { Toggle } from "@/components/ui/toggle"; -import { CodeEditor } from "@/components/shared/code-editor"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; import { EyeIcon, EyeOffIcon } from "lucide-react"; +import React, { useEffect, useState } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; const addEnvironmentSchema = z.object({ environment: z.string(), diff --git a/components/dashboard/application/general/generic/save-docker-provider.tsx b/components/dashboard/application/general/generic/save-docker-provider.tsx index ed129a4d..d2a39e19 100644 --- a/components/dashboard/application/general/generic/save-docker-provider.tsx +++ b/components/dashboard/application/general/generic/save-docker-provider.tsx @@ -1,8 +1,4 @@ import { Button } from "@/components/ui/button"; -import { Input } from "@/components/ui/input"; -import { z } from "zod"; -import { useForm } from "react-hook-form"; -import { zodResolver } from "@hookform/resolvers/zod"; import { Form, FormControl, @@ -11,9 +7,13 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; -import { useEffect } from "react"; +import { Input } from "@/components/ui/input"; import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; import { toast } from "sonner"; +import { z } from "zod"; const DockerProviderSchema = z.object({ dockerImage: z.string().min(1, { diff --git a/components/dashboard/application/general/show.tsx b/components/dashboard/application/general/show.tsx index b880eded..870f5d54 100644 --- a/components/dashboard/application/general/show.tsx +++ b/components/dashboard/application/general/show.tsx @@ -4,13 +4,13 @@ import { Button } from "@/components/ui/button"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Toggle } from "@/components/ui/toggle"; import { api } from "@/utils/api"; +import { CheckCircle2, Terminal } from "lucide-react"; import React from "react"; import { toast } from "sonner"; +import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal"; import { RedbuildApplication } from "../rebuild-application"; import { StartApplication } from "../start-application"; import { StopApplication } from "../stop-application"; -import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal"; -import { CheckCircle2, Terminal } from "lucide-react"; import { DeployApplication } from "./deploy-application"; import { ResetApplication } from "./reset-application"; interface Props { diff --git a/components/dashboard/application/logs/show.tsx b/components/dashboard/application/logs/show.tsx index 94288f24..780eac40 100644 --- a/components/dashboard/application/logs/show.tsx +++ b/components/dashboard/application/logs/show.tsx @@ -1,4 +1,3 @@ -import dynamic from "next/dynamic"; import { Card, CardContent, @@ -6,6 +5,7 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; +import { Label } from "@/components/ui/label"; import { Select, SelectContent, @@ -16,8 +16,8 @@ import { SelectValue, } from "@/components/ui/select"; import { api } from "@/utils/api"; +import dynamic from "next/dynamic"; import { useEffect, useState } from "react"; -import { Label } from "@/components/ui/label"; export const DockerLogs = dynamic( () => import("@/components/dashboard/docker/logs/docker-logs-id").then( diff --git a/components/dashboard/application/update-application.tsx b/components/dashboard/application/update-application.tsx index 5dd58df0..a769804d 100644 --- a/components/dashboard/application/update-application.tsx +++ b/components/dashboard/application/update-application.tsx @@ -1,3 +1,5 @@ +import { AlertBlock } from "@/components/shared/alert-block"; +import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, @@ -7,7 +9,6 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; -import { Button } from "@/components/ui/button"; import { Form, FormControl, @@ -16,16 +17,15 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; -import { useForm } from "react-hook-form"; -import { z } from "zod"; -import { AlertBlock } from "@/components/shared/alert-block"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useEffect } from "react"; -import { toast } from "sonner"; import { Input } from "@/components/ui/input"; -import { AlertTriangle, SquarePen } from "lucide-react"; import { Textarea } from "@/components/ui/textarea"; import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { AlertTriangle, SquarePen } from "lucide-react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; const updateApplicationSchema = z.object({ name: z.string().min(1, { diff --git a/components/dashboard/compose/advanced/add-command.tsx b/components/dashboard/compose/advanced/add-command.tsx index a16ed173..44ce15c0 100644 --- a/components/dashboard/compose/advanced/add-command.tsx +++ b/components/dashboard/compose/advanced/add-command.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import { Button } from "@/components/ui/button"; import { Card, CardContent, @@ -6,8 +6,6 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; -import { api } from "@/utils/api"; -import { z } from "zod"; import { Form, FormControl, @@ -17,12 +15,14 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; -import { toast } from "sonner"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useForm } from "react-hook-form"; -import { useEffect } from "react"; -import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import React from "react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; interface Props { composeId: string; } diff --git a/components/dashboard/compose/advanced/show-volumes.tsx b/components/dashboard/compose/advanced/show-volumes.tsx index 4756bb2a..57b5ec57 100644 --- a/components/dashboard/compose/advanced/show-volumes.tsx +++ b/components/dashboard/compose/advanced/show-volumes.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import { AlertBlock } from "@/components/shared/alert-block"; import { Card, CardContent, @@ -8,10 +8,10 @@ import { } from "@/components/ui/card"; import { api } from "@/utils/api"; import { Package } from "lucide-react"; -import { DeleteVolume } from "../../application/advanced/volumes/delete-volume"; +import React from "react"; import { AddVolumes } from "../../application/advanced/volumes/add-volumes"; +import { DeleteVolume } from "../../application/advanced/volumes/delete-volume"; import { UpdateVolume } from "../../application/advanced/volumes/update-volume"; -import { AlertBlock } from "@/components/shared/alert-block"; interface Props { composeId: string; } diff --git a/components/dashboard/compose/deployments/refresh-token-compose.tsx b/components/dashboard/compose/deployments/refresh-token-compose.tsx index 57a11d71..66d690e7 100644 --- a/components/dashboard/compose/deployments/refresh-token-compose.tsx +++ b/components/dashboard/compose/deployments/refresh-token-compose.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { AlertDialog, AlertDialogAction, @@ -12,6 +11,7 @@ import { } from "@/components/ui/alert-dialog"; import { api } from "@/utils/api"; import { RefreshCcw } from "lucide-react"; +import React from "react"; import { toast } from "sonner"; interface Props { diff --git a/components/dashboard/compose/deployments/show-deployments-compose.tsx b/components/dashboard/compose/deployments/show-deployments-compose.tsx index b4de30b6..cb4210b3 100644 --- a/components/dashboard/compose/deployments/show-deployments-compose.tsx +++ b/components/dashboard/compose/deployments/show-deployments-compose.tsx @@ -1,3 +1,5 @@ +import { DateTooltip } from "@/components/shared/date-tooltip"; +import { StatusTooltip } from "@/components/shared/status-tooltip"; import { Button } from "@/components/ui/button"; import { Card, @@ -9,11 +11,9 @@ import { import { api } from "@/utils/api"; import { RocketIcon } from "lucide-react"; import React, { useEffect, useState } from "react"; -import { StatusTooltip } from "@/components/shared/status-tooltip"; -import { DateTooltip } from "@/components/shared/date-tooltip"; -import { ShowDeploymentCompose } from "./show-deployment-compose"; -import { RefreshTokenCompose } from "./refresh-token-compose"; import { CancelQueuesCompose } from "./cancel-queues-compose"; +import { RefreshTokenCompose } from "./refresh-token-compose"; +import { ShowDeploymentCompose } from "./show-deployment-compose"; interface Props { composeId: string; diff --git a/components/dashboard/compose/enviroment/show.tsx b/components/dashboard/compose/enviroment/show.tsx index 956443ef..4e9b2dfd 100644 --- a/components/dashboard/compose/enviroment/show.tsx +++ b/components/dashboard/compose/enviroment/show.tsx @@ -1,4 +1,5 @@ -import React, { useEffect, useState } from "react"; +import { CodeEditor } from "@/components/shared/code-editor"; +import { Button } from "@/components/ui/button"; import { Card, CardContent, @@ -6,10 +7,6 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; -import { Button } from "@/components/ui/button"; -import { z } from "zod"; -import { useForm } from "react-hook-form"; -import { zodResolver } from "@hookform/resolvers/zod"; import { Form, FormControl, @@ -17,11 +14,14 @@ import { FormItem, FormMessage, } from "@/components/ui/form"; -import { api } from "@/utils/api"; -import { toast } from "sonner"; -import { CodeEditor } from "@/components/shared/code-editor"; import { Toggle } from "@/components/ui/toggle"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; import { EyeIcon, EyeOffIcon } from "lucide-react"; +import React, { useEffect, useState } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; const addEnvironmentSchema = z.object({ environment: z.string(), diff --git a/components/dashboard/compose/general/actions.tsx b/components/dashboard/compose/general/actions.tsx index 0df18807..85ad4506 100644 --- a/components/dashboard/compose/general/actions.tsx +++ b/components/dashboard/compose/general/actions.tsx @@ -1,12 +1,4 @@ import { Button } from "@/components/ui/button"; -import { ExternalLink, Globe, Terminal } from "lucide-react"; -import { api } from "@/utils/api"; -import { toast } from "sonner"; -import { Toggle } from "@/components/ui/toggle"; -import { RedbuildCompose } from "./rebuild-compose"; -import { DeployCompose } from "./deploy-compose"; -import { StopCompose } from "./stop-compose"; -import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal"; import { DropdownMenu, DropdownMenuContent, @@ -16,7 +8,15 @@ import { DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; +import { Toggle } from "@/components/ui/toggle"; +import { api } from "@/utils/api"; +import { ExternalLink, Globe, Terminal } from "lucide-react"; import Link from "next/link"; +import { toast } from "sonner"; +import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal"; +import { DeployCompose } from "./deploy-compose"; +import { RedbuildCompose } from "./rebuild-compose"; +import { StopCompose } from "./stop-compose"; interface Props { composeId: string; diff --git a/components/dashboard/compose/general/compose-file-editor.tsx b/components/dashboard/compose/general/compose-file-editor.tsx index b7815269..035d6c41 100644 --- a/components/dashboard/compose/general/compose-file-editor.tsx +++ b/components/dashboard/compose/general/compose-file-editor.tsx @@ -1,5 +1,5 @@ -import { api } from "@/utils/api"; -import { useEffect } from "react"; +import { CodeEditor } from "@/components/shared/code-editor"; +import { Button } from "@/components/ui/button"; import { Form, FormControl, @@ -7,14 +7,14 @@ import { FormItem, FormMessage, } from "@/components/ui/form"; +import { api } from "@/utils/api"; import { zodResolver } from "@hookform/resolvers/zod"; +import { useEffect } from "react"; import { useForm } from "react-hook-form"; +import { toast } from "sonner"; import { z } from "zod"; import { validateAndFormatYAML } from "../../application/advanced/traefik/update-traefik-config"; -import { toast } from "sonner"; -import { Button } from "@/components/ui/button"; import { RandomizeCompose } from "./randomize-compose"; -import { CodeEditor } from "@/components/shared/code-editor"; interface Props { composeId: string; diff --git a/components/dashboard/compose/general/generic/show.tsx b/components/dashboard/compose/general/generic/show.tsx index 660a994c..2db4248d 100644 --- a/components/dashboard/compose/general/generic/show.tsx +++ b/components/dashboard/compose/general/generic/show.tsx @@ -4,9 +4,9 @@ import { api } from "@/utils/api"; import { GitBranch, LockIcon } from "lucide-react"; import Link from "next/link"; import { useState } from "react"; -import { SaveGithubProviderCompose } from "./save-github-provider-compose"; import { ComposeFileEditor } from "../compose-file-editor"; import { SaveGitProviderCompose } from "./save-git-provider-compose"; +import { SaveGithubProviderCompose } from "./save-github-provider-compose"; type TabState = "github" | "git" | "raw"; interface Props { diff --git a/components/dashboard/compose/general/randomize-compose.tsx b/components/dashboard/compose/general/randomize-compose.tsx index 76a9fd33..977dd2f6 100644 --- a/components/dashboard/compose/general/randomize-compose.tsx +++ b/components/dashboard/compose/general/randomize-compose.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -7,12 +8,11 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; +import { Input } from "@/components/ui/input"; import { api } from "@/utils/api"; -import { AlertBlock } from "@/components/shared/alert-block"; import { Dices } from "lucide-react"; import { useState } from "react"; import { toast } from "sonner"; -import { Input } from "@/components/ui/input"; interface Props { composeId: string; diff --git a/components/dashboard/compose/general/show.tsx b/components/dashboard/compose/general/show.tsx index 39ea5ae9..d002b409 100644 --- a/components/dashboard/compose/general/show.tsx +++ b/components/dashboard/compose/general/show.tsx @@ -1,3 +1,4 @@ +import { Badge } from "@/components/ui/badge"; import { Card, CardContent, @@ -5,11 +6,10 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; -import React from "react"; -import { ShowProviderFormCompose } from "./generic/show"; -import { ComposeActions } from "./actions"; -import { Badge } from "@/components/ui/badge"; import { api } from "@/utils/api"; +import React from "react"; +import { ComposeActions } from "./actions"; +import { ShowProviderFormCompose } from "./generic/show"; interface Props { composeId: string; } diff --git a/components/dashboard/compose/logs/show.tsx b/components/dashboard/compose/logs/show.tsx index f8b0d80a..546b7cc7 100644 --- a/components/dashboard/compose/logs/show.tsx +++ b/components/dashboard/compose/logs/show.tsx @@ -1,4 +1,3 @@ -import dynamic from "next/dynamic"; import { Card, CardContent, @@ -6,6 +5,7 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; +import { Label } from "@/components/ui/label"; import { Select, SelectContent, @@ -16,8 +16,8 @@ import { SelectValue, } from "@/components/ui/select"; import { api } from "@/utils/api"; +import dynamic from "next/dynamic"; import { useEffect, useState } from "react"; -import { Label } from "@/components/ui/label"; export const DockerLogs = dynamic( () => import("@/components/dashboard/docker/logs/docker-logs-id").then( diff --git a/components/dashboard/compose/monitoring/show.tsx b/components/dashboard/compose/monitoring/show.tsx index 15c824f9..0bb959c1 100644 --- a/components/dashboard/compose/monitoring/show.tsx +++ b/components/dashboard/compose/monitoring/show.tsx @@ -5,8 +5,7 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; -import { api } from "@/utils/api"; -import { useEffect, useState } from "react"; +import { Label } from "@/components/ui/label"; import { Select, SelectContent, @@ -16,7 +15,8 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; -import { Label } from "@/components/ui/label"; +import { api } from "@/utils/api"; +import { useEffect, useState } from "react"; import { DockerMonitoring } from "../../monitoring/docker/show"; interface Props { diff --git a/components/dashboard/compose/update-compose.tsx b/components/dashboard/compose/update-compose.tsx index e2651c28..39180179 100644 --- a/components/dashboard/compose/update-compose.tsx +++ b/components/dashboard/compose/update-compose.tsx @@ -1,3 +1,5 @@ +import { AlertBlock } from "@/components/shared/alert-block"; +import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, @@ -7,7 +9,6 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; -import { Button } from "@/components/ui/button"; import { Form, FormControl, @@ -16,16 +17,15 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; -import { useForm } from "react-hook-form"; -import { z } from "zod"; -import { AlertBlock } from "@/components/shared/alert-block"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useEffect } from "react"; -import { toast } from "sonner"; import { Input } from "@/components/ui/input"; -import { SquarePen } from "lucide-react"; import { Textarea } from "@/components/ui/textarea"; import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { SquarePen } from "lucide-react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; const updateComposeSchema = z.object({ name: z.string().min(1, { diff --git a/components/dashboard/database/backups/add-backup.tsx b/components/dashboard/database/backups/add-backup.tsx index bfed02fd..21f87fd5 100644 --- a/components/dashboard/database/backups/add-backup.tsx +++ b/components/dashboard/database/backups/add-backup.tsx @@ -1,4 +1,11 @@ import { Button } from "@/components/ui/button"; +import { + Command, + CommandEmpty, + CommandGroup, + CommandInput, + CommandItem, +} from "@/components/ui/command"; import { Dialog, DialogContent, @@ -11,36 +18,29 @@ import { import { Form, FormControl, + FormDescription, FormField, FormItem, FormLabel, - FormDescription, FormMessage, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; -import { api } from "@/utils/api"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { PlusIcon } from "lucide-react"; -import { useEffect } from "react"; -import { useForm } from "react-hook-form"; -import { toast } from "sonner"; -import { CheckIcon, ChevronsUpDown } from "lucide-react"; -import { ScrollArea } from "@/components/ui/scroll-area"; -import { - Command, - CommandEmpty, - CommandGroup, - CommandInput, - CommandItem, -} from "@/components/ui/command"; import { Popover, PopoverContent, PopoverTrigger, } from "@/components/ui/popover"; -import { z } from "zod"; -import { cn } from "@/lib/utils"; +import { ScrollArea } from "@/components/ui/scroll-area"; import { Switch } from "@/components/ui/switch"; +import { cn } from "@/lib/utils"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { PlusIcon } from "lucide-react"; +import { CheckIcon, ChevronsUpDown } from "lucide-react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; const AddPostgresBackup1Schema = z.object({ destinationId: z.string().min(1, "Destination required"), diff --git a/components/dashboard/database/backups/update-backup.tsx b/components/dashboard/database/backups/update-backup.tsx index 64b878ef..b18a663d 100644 --- a/components/dashboard/database/backups/update-backup.tsx +++ b/components/dashboard/database/backups/update-backup.tsx @@ -1,4 +1,11 @@ import { Button } from "@/components/ui/button"; +import { + Command, + CommandEmpty, + CommandGroup, + CommandInput, + CommandItem, +} from "@/components/ui/command"; import { Dialog, DialogContent, @@ -18,28 +25,21 @@ import { FormMessage, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; -import { api } from "@/utils/api"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { Pencil, CheckIcon, ChevronsUpDown, PenBoxIcon } from "lucide-react"; -import { useEffect } from "react"; -import { useForm } from "react-hook-form"; -import { toast } from "sonner"; -import { ScrollArea } from "@/components/ui/scroll-area"; -import { z } from "zod"; -import { Switch } from "@/components/ui/switch"; -import { - Command, - CommandEmpty, - CommandGroup, - CommandInput, - CommandItem, -} from "@/components/ui/command"; import { Popover, PopoverContent, PopoverTrigger, } from "@/components/ui/popover"; +import { ScrollArea } from "@/components/ui/scroll-area"; +import { Switch } from "@/components/ui/switch"; import { cn } from "@/lib/utils"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { CheckIcon, ChevronsUpDown, PenBoxIcon, Pencil } from "lucide-react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; const UpdateBackupSchema = z.object({ destinationId: z.string().min(1, "Destination required"), diff --git a/components/dashboard/docker/logs/docker-logs-id.tsx b/components/dashboard/docker/logs/docker-logs-id.tsx index d819e1a4..be27aeda 100644 --- a/components/dashboard/docker/logs/docker-logs-id.tsx +++ b/components/dashboard/docker/logs/docker-logs-id.tsx @@ -1,7 +1,7 @@ import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; -import React, { useEffect } from "react"; import { Terminal } from "@xterm/xterm"; +import React, { useEffect } from "react"; import { FitAddon } from "xterm-addon-fit"; import "@xterm/xterm/css/xterm.css"; diff --git a/components/dashboard/docker/logs/show-docker-modal-logs.tsx b/components/dashboard/docker/logs/show-docker-modal-logs.tsx index f8d52aa4..07678b6f 100644 --- a/components/dashboard/docker/logs/show-docker-modal-logs.tsx +++ b/components/dashboard/docker/logs/show-docker-modal-logs.tsx @@ -1,5 +1,3 @@ -import dynamic from "next/dynamic"; -import React from "react"; import { Dialog, DialogContent, @@ -9,6 +7,8 @@ import { DialogTrigger, } from "@/components/ui/dialog"; import { DropdownMenuItem } from "@/components/ui/dropdown-menu"; +import dynamic from "next/dynamic"; +import type React from "react"; export const DockerLogsId = dynamic( () => import("@/components/dashboard/docker/logs/docker-logs-id").then( diff --git a/components/dashboard/docker/show/colums.tsx b/components/dashboard/docker/show/colums.tsx index 538dd685..243ea4b3 100644 --- a/components/dashboard/docker/show/colums.tsx +++ b/components/dashboard/docker/show/colums.tsx @@ -1,6 +1,6 @@ -import * as React from "react"; import type { ColumnDef } from "@tanstack/react-table"; import { ArrowUpDown, MoreHorizontal } from "lucide-react"; +import * as React from "react"; import { Button } from "@/components/ui/button"; import { diff --git a/components/dashboard/docker/show/show-containers.tsx b/components/dashboard/docker/show/show-containers.tsx index e8531de5..e8b56dae 100644 --- a/components/dashboard/docker/show/show-containers.tsx +++ b/components/dashboard/docker/show/show-containers.tsx @@ -1,4 +1,3 @@ -import * as React from "react"; import { type ColumnFiltersState, type SortingState, @@ -11,6 +10,7 @@ import { useReactTable, } from "@tanstack/react-table"; import { ChevronDown } from "lucide-react"; +import * as React from "react"; import { Button } from "@/components/ui/button"; import { @@ -28,7 +28,7 @@ import { TableHeader, TableRow, } from "@/components/ui/table"; -import { api, type RouterOutputs } from "@/utils/api"; +import { type RouterOutputs, api } from "@/utils/api"; import { columns } from "./colums"; export type Container = NonNullable< RouterOutputs["docker"]["getContainers"] diff --git a/components/dashboard/docker/terminal/docker-terminal-modal.tsx b/components/dashboard/docker/terminal/docker-terminal-modal.tsx index c4b6deef..d8f87f39 100644 --- a/components/dashboard/docker/terminal/docker-terminal-modal.tsx +++ b/components/dashboard/docker/terminal/docker-terminal-modal.tsx @@ -6,8 +6,8 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; -import dynamic from "next/dynamic"; import { DropdownMenuItem } from "@/components/ui/dropdown-menu"; +import dynamic from "next/dynamic"; const Terminal = dynamic( () => import("./docker-terminal").then((e) => e.DockerTerminal), diff --git a/components/dashboard/docker/terminal/docker-terminal.tsx b/components/dashboard/docker/terminal/docker-terminal.tsx index 06244940..03001af7 100644 --- a/components/dashboard/docker/terminal/docker-terminal.tsx +++ b/components/dashboard/docker/terminal/docker-terminal.tsx @@ -1,9 +1,9 @@ -import React, { useEffect, useRef } from "react"; import { Terminal } from "@xterm/xterm"; +import React, { useEffect, useRef } from "react"; import { FitAddon } from "xterm-addon-fit"; import "@xterm/xterm/css/xterm.css"; -import { AttachAddon } from "@xterm/addon-attach"; import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import { AttachAddon } from "@xterm/addon-attach"; interface Props { id: string; diff --git a/components/dashboard/file-system/show-traefik-file.tsx b/components/dashboard/file-system/show-traefik-file.tsx index a739ff4a..34d94e62 100644 --- a/components/dashboard/file-system/show-traefik-file.tsx +++ b/components/dashboard/file-system/show-traefik-file.tsx @@ -1,5 +1,7 @@ import { Button } from "@/components/ui/button"; +import { AlertBlock } from "@/components/shared/alert-block"; +import { CodeEditor } from "@/components/shared/code-editor"; import { Form, FormControl, @@ -10,14 +12,12 @@ import { FormMessage, } from "@/components/ui/form"; import { api } from "@/utils/api"; -import { AlertBlock } from "@/components/shared/alert-block"; import { zodResolver } from "@hookform/resolvers/zod"; import { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; import { validateAndFormatYAML } from "../application/advanced/traefik/update-traefik-config"; -import { CodeEditor } from "@/components/shared/code-editor"; const UpdateServerMiddlewareConfigSchema = z.object({ traefikConfig: z.string(), diff --git a/components/dashboard/file-system/show-traefik-system.tsx b/components/dashboard/file-system/show-traefik-system.tsx index 0c153b4c..e3e874c5 100644 --- a/components/dashboard/file-system/show-traefik-system.tsx +++ b/components/dashboard/file-system/show-traefik-system.tsx @@ -1,8 +1,8 @@ import React from "react"; -import { api } from "@/utils/api"; -import { Workflow, Folder, FileIcon } from "lucide-react"; import { Tree } from "@/components/ui/file-tree"; +import { api } from "@/utils/api"; +import { FileIcon, Folder, Workflow } from "lucide-react"; import { cn } from "@/lib/utils"; import { ShowTraefikFile } from "./show-traefik-file"; diff --git a/components/dashboard/mariadb/advanced/show-mariadb-advanced-settings.tsx b/components/dashboard/mariadb/advanced/show-mariadb-advanced-settings.tsx index ae80d330..062fffcd 100644 --- a/components/dashboard/mariadb/advanced/show-mariadb-advanced-settings.tsx +++ b/components/dashboard/mariadb/advanced/show-mariadb-advanced-settings.tsx @@ -1,12 +1,5 @@ -import React, { useEffect } from "react"; -import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; -import { api } from "@/utils/api"; -import { z } from "zod"; -import { Input } from "@/components/ui/input"; -import { ShowMariadbResources } from "./show-mariadb-resources"; -import { toast } from "sonner"; -import { zodResolver } from "@hookform/resolvers/zod"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Form, FormControl, @@ -15,8 +8,15 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; +import { Input } from "@/components/ui/input"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import React, { useEffect } from "react"; import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; import { ShowVolumes } from "../volumes/show-volumes"; +import { ShowMariadbResources } from "./show-mariadb-resources"; const addDockerImage = z.object({ dockerImage: z.string().min(1, "Docker image is required"), diff --git a/components/dashboard/mariadb/advanced/show-mariadb-resources.tsx b/components/dashboard/mariadb/advanced/show-mariadb-resources.tsx index e6392760..bbc5d2f5 100644 --- a/components/dashboard/mariadb/advanced/show-mariadb-resources.tsx +++ b/components/dashboard/mariadb/advanced/show-mariadb-resources.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Card, @@ -21,7 +22,6 @@ import React, { useEffect } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; -import { AlertBlock } from "@/components/shared/alert-block"; const addResourcesMariadb = z.object({ memoryReservation: z.number().nullable().optional(), diff --git a/components/dashboard/mariadb/backups/show-backup-mariadb.tsx b/components/dashboard/mariadb/backups/show-backup-mariadb.tsx index c3592227..85353e8b 100644 --- a/components/dashboard/mariadb/backups/show-backup-mariadb.tsx +++ b/components/dashboard/mariadb/backups/show-backup-mariadb.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import { Button } from "@/components/ui/button"; import { Card, CardContent, @@ -6,20 +6,20 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; -import { Button } from "@/components/ui/button"; -import { api } from "@/utils/api"; -import { DatabaseBackup, Play } from "lucide-react"; -import Link from "next/link"; -import { AddBackup } from "../../database/backups/add-backup"; -import { DeleteBackup } from "../../database/backups/delete-backup"; -import { UpdateBackup } from "../../database/backups/update-backup"; -import { toast } from "sonner"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip"; +import { api } from "@/utils/api"; +import { DatabaseBackup, Play } from "lucide-react"; +import Link from "next/link"; +import React from "react"; +import { toast } from "sonner"; +import { AddBackup } from "../../database/backups/add-backup"; +import { DeleteBackup } from "../../database/backups/delete-backup"; +import { UpdateBackup } from "../../database/backups/update-backup"; interface Props { mariadbId: string; } diff --git a/components/dashboard/mariadb/environment/show-mariadb-environment.tsx b/components/dashboard/mariadb/environment/show-mariadb-environment.tsx index 2bb2fb2f..807dcae0 100644 --- a/components/dashboard/mariadb/environment/show-mariadb-environment.tsx +++ b/components/dashboard/mariadb/environment/show-mariadb-environment.tsx @@ -1,4 +1,5 @@ -import React, { useEffect } from "react"; +import { CodeEditor } from "@/components/shared/code-editor"; +import { Button } from "@/components/ui/button"; import { Card, CardContent, @@ -6,10 +7,6 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; -import { Button } from "@/components/ui/button"; -import { z } from "zod"; -import { useForm } from "react-hook-form"; -import { zodResolver } from "@hookform/resolvers/zod"; import { Form, FormControl, @@ -18,8 +15,11 @@ import { FormMessage, } from "@/components/ui/form"; import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import React, { useEffect } from "react"; +import { useForm } from "react-hook-form"; import { toast } from "sonner"; -import { CodeEditor } from "@/components/shared/code-editor"; +import { z } from "zod"; const addEnvironmentSchema = z.object({ environment: z.string(), diff --git a/components/dashboard/mariadb/general/show-external-mariadb-credentials.tsx b/components/dashboard/mariadb/general/show-external-mariadb-credentials.tsx index 2f19d78b..176ab7d0 100644 --- a/components/dashboard/mariadb/general/show-external-mariadb-credentials.tsx +++ b/components/dashboard/mariadb/general/show-external-mariadb-credentials.tsx @@ -1,3 +1,4 @@ +import { ToggleVisibilityInput } from "@/components/shared/toggle-visibility-input"; import { Button } from "@/components/ui/button"; import { Card, @@ -22,7 +23,6 @@ import React, { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; -import { ToggleVisibilityInput } from "@/components/shared/toggle-visibility-input"; const DockerProviderSchema = z.object({ externalPort: z.preprocess((a) => { diff --git a/components/dashboard/mariadb/general/show-general-mariadb.tsx b/components/dashboard/mariadb/general/show-general-mariadb.tsx index 77bc95ca..44b6e39c 100644 --- a/components/dashboard/mariadb/general/show-general-mariadb.tsx +++ b/components/dashboard/mariadb/general/show-general-mariadb.tsx @@ -1,13 +1,13 @@ -import React from "react"; -import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { api } from "@/utils/api"; -import { StopMariadb } from "./stop-mariadb"; -import { StartMariadb } from "../start-mariadb"; -import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal"; import { Terminal } from "lucide-react"; +import React from "react"; +import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal"; +import { StartMariadb } from "../start-mariadb"; import { DeployMariadb } from "./deploy-mariadb"; import { ResetMariadb } from "./reset-mariadb"; +import { StopMariadb } from "./stop-mariadb"; interface Props { mariadbId: string; diff --git a/components/dashboard/mariadb/general/show-internal-mariadb-credentials.tsx b/components/dashboard/mariadb/general/show-internal-mariadb-credentials.tsx index 869409d5..b409ac4d 100644 --- a/components/dashboard/mariadb/general/show-internal-mariadb-credentials.tsx +++ b/components/dashboard/mariadb/general/show-internal-mariadb-credentials.tsx @@ -1,9 +1,9 @@ -import React from "react"; +import { ToggleVisibilityInput } from "@/components/shared/toggle-visibility-input"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { api } from "@/utils/api"; -import { ToggleVisibilityInput } from "@/components/shared/toggle-visibility-input"; +import React from "react"; interface Props { mariadbId: string; diff --git a/components/dashboard/mariadb/general/stop-mariadb.tsx b/components/dashboard/mariadb/general/stop-mariadb.tsx index 3dcc3cf3..17eb4bcd 100644 --- a/components/dashboard/mariadb/general/stop-mariadb.tsx +++ b/components/dashboard/mariadb/general/stop-mariadb.tsx @@ -1,13 +1,13 @@ import { - AlertDialog, - AlertDialogAction, - AlertDialogCancel, - AlertDialogContent, - AlertDialogDescription, - AlertDialogFooter, - AlertDialogHeader, - AlertDialogTitle, - AlertDialogTrigger, + AlertDialog, + AlertDialogAction, + AlertDialogCancel, + AlertDialogContent, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogTitle, + AlertDialogTrigger, } from "@/components/ui/alert-dialog"; import { Button } from "@/components/ui/button"; import { api } from "@/utils/api"; @@ -15,51 +15,51 @@ import { Ban } from "lucide-react"; import { toast } from "sonner"; interface Props { - mariadbId: string; + mariadbId: string; } export const StopMariadb = ({ mariadbId }: Props) => { - const { mutateAsync, isLoading } = api.mariadb.stop.useMutation(); - const utils = api.useUtils(); - return ( - - - - - - - - Are you absolutely sure to stop the database? - - - This will stop the database - - - - Cancel - { - await mutateAsync({ - mariadbId, - }) - .then(async () => { - await utils.mariadb.one.invalidate({ - mariadbId, - }); - toast.success("Application stopped succesfully"); - }) - .catch(() => { - toast.error("Error to stop the Application"); - }); - }} - > - Confirm - - - - - ); + const { mutateAsync, isLoading } = api.mariadb.stop.useMutation(); + const utils = api.useUtils(); + return ( + + + + + + + + Are you absolutely sure to stop the database? + + + This will stop the database + + + + Cancel + { + await mutateAsync({ + mariadbId, + }) + .then(async () => { + await utils.mariadb.one.invalidate({ + mariadbId, + }); + toast.success("Application stopped succesfully"); + }) + .catch(() => { + toast.error("Error to stop the Application"); + }); + }} + > + Confirm + + + + + ); }; diff --git a/components/dashboard/mariadb/start-mariadb.tsx b/components/dashboard/mariadb/start-mariadb.tsx index 156322e4..dff62cec 100644 --- a/components/dashboard/mariadb/start-mariadb.tsx +++ b/components/dashboard/mariadb/start-mariadb.tsx @@ -1,13 +1,13 @@ import { - AlertDialog, - AlertDialogAction, - AlertDialogCancel, - AlertDialogContent, - AlertDialogDescription, - AlertDialogFooter, - AlertDialogHeader, - AlertDialogTitle, - AlertDialogTrigger, + AlertDialog, + AlertDialogAction, + AlertDialogCancel, + AlertDialogContent, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogTitle, + AlertDialogTrigger, } from "@/components/ui/alert-dialog"; import { Button } from "@/components/ui/button"; import { api } from "@/utils/api"; @@ -15,51 +15,51 @@ import { CheckCircle2 } from "lucide-react"; import { toast } from "sonner"; interface Props { - mariadbId: string; + mariadbId: string; } export const StartMariadb = ({ mariadbId }: Props) => { - const { mutateAsync, isLoading } = api.mariadb.start.useMutation(); - const utils = api.useUtils(); - return ( - - - - - - - - Are you sure to start the database? - - - This will start the database - - - - Cancel - { - await mutateAsync({ - mariadbId, - }) - .then(async () => { - await utils.mariadb.one.invalidate({ - mariadbId, - }); - toast.success("Database started succesfully"); - }) - .catch(() => { - toast.error("Error to start the Database"); - }); - }} - > - Confirm - - - - - ); + const { mutateAsync, isLoading } = api.mariadb.start.useMutation(); + const utils = api.useUtils(); + return ( + + + + + + + + Are you sure to start the database? + + + This will start the database + + + + Cancel + { + await mutateAsync({ + mariadbId, + }) + .then(async () => { + await utils.mariadb.one.invalidate({ + mariadbId, + }); + toast.success("Database started succesfully"); + }) + .catch(() => { + toast.error("Error to start the Database"); + }); + }} + > + Confirm + + + + + ); }; diff --git a/components/dashboard/mariadb/update-mariadb.tsx b/components/dashboard/mariadb/update-mariadb.tsx index 46ca19bd..55b7e7e6 100644 --- a/components/dashboard/mariadb/update-mariadb.tsx +++ b/components/dashboard/mariadb/update-mariadb.tsx @@ -1,3 +1,5 @@ +import { AlertBlock } from "@/components/shared/alert-block"; +import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, @@ -7,7 +9,6 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; -import { Button } from "@/components/ui/button"; import { Form, FormControl, @@ -16,16 +17,15 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; -import { useForm } from "react-hook-form"; -import { z } from "zod"; -import { AlertBlock } from "@/components/shared/alert-block"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useEffect } from "react"; -import { toast } from "sonner"; import { Input } from "@/components/ui/input"; -import { AlertTriangle, SquarePen } from "lucide-react"; import { Textarea } from "@/components/ui/textarea"; import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { AlertTriangle, SquarePen } from "lucide-react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; const updateMariadbSchema = z.object({ name: z.string().min(1, { diff --git a/components/dashboard/mariadb/volumes/show-volumes.tsx b/components/dashboard/mariadb/volumes/show-volumes.tsx index cc7fb393..1f1b909b 100644 --- a/components/dashboard/mariadb/volumes/show-volumes.tsx +++ b/components/dashboard/mariadb/volumes/show-volumes.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import { AlertBlock } from "@/components/shared/alert-block"; import { Card, CardContent, @@ -8,10 +8,10 @@ import { } from "@/components/ui/card"; import { api } from "@/utils/api"; import { AlertTriangle, Package } from "lucide-react"; -import { DeleteVolume } from "../../application/advanced/volumes/delete-volume"; +import React from "react"; import { AddVolumes } from "../../application/advanced/volumes/add-volumes"; +import { DeleteVolume } from "../../application/advanced/volumes/delete-volume"; import { UpdateVolume } from "../../application/advanced/volumes/update-volume"; -import { AlertBlock } from "@/components/shared/alert-block"; interface Props { mariadbId: string; } diff --git a/components/dashboard/mongo/advanced/show-mongo-advanced-settings.tsx b/components/dashboard/mongo/advanced/show-mongo-advanced-settings.tsx index 616634d0..cbb178f3 100644 --- a/components/dashboard/mongo/advanced/show-mongo-advanced-settings.tsx +++ b/components/dashboard/mongo/advanced/show-mongo-advanced-settings.tsx @@ -1,11 +1,5 @@ -import React, { useEffect } from "react"; -import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; -import { api } from "@/utils/api"; -import { z } from "zod"; -import { Input } from "@/components/ui/input"; -import { toast } from "sonner"; -import { zodResolver } from "@hookform/resolvers/zod"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Form, FormControl, @@ -14,9 +8,15 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; +import { Input } from "@/components/ui/input"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import React, { useEffect } from "react"; import { useForm } from "react-hook-form"; -import { ShowMongoResources } from "./show-mongo-resources"; +import { toast } from "sonner"; +import { z } from "zod"; import { ShowVolumes } from "../volumes/show-volumes"; +import { ShowMongoResources } from "./show-mongo-resources"; const addDockerImage = z.object({ dockerImage: z.string().min(1, "Docker image is required"), diff --git a/components/dashboard/mongo/advanced/show-mongo-resources.tsx b/components/dashboard/mongo/advanced/show-mongo-resources.tsx index 4036bf76..85fbc5e1 100644 --- a/components/dashboard/mongo/advanced/show-mongo-resources.tsx +++ b/components/dashboard/mongo/advanced/show-mongo-resources.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Card, @@ -21,7 +22,6 @@ import React, { useEffect } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; -import { AlertBlock } from "@/components/shared/alert-block"; const addResourcesMongo = z.object({ memoryReservation: z.number().nullable().optional(), diff --git a/components/dashboard/mongo/backups/show-backup-mongo.tsx b/components/dashboard/mongo/backups/show-backup-mongo.tsx index 26610562..e54fe70d 100644 --- a/components/dashboard/mongo/backups/show-backup-mongo.tsx +++ b/components/dashboard/mongo/backups/show-backup-mongo.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import { Button } from "@/components/ui/button"; import { Card, CardContent, @@ -6,20 +6,20 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; -import { Button } from "@/components/ui/button"; -import { api } from "@/utils/api"; -import { DatabaseBackup, Play } from "lucide-react"; -import Link from "next/link"; -import { AddBackup } from "../../database/backups/add-backup"; -import { DeleteBackup } from "../../database/backups/delete-backup"; -import { UpdateBackup } from "../../database/backups/update-backup"; -import { toast } from "sonner"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip"; +import { api } from "@/utils/api"; +import { DatabaseBackup, Play } from "lucide-react"; +import Link from "next/link"; +import React from "react"; +import { toast } from "sonner"; +import { AddBackup } from "../../database/backups/add-backup"; +import { DeleteBackup } from "../../database/backups/delete-backup"; +import { UpdateBackup } from "../../database/backups/update-backup"; interface Props { mongoId: string; } diff --git a/components/dashboard/mongo/general/show-general-mongo.tsx b/components/dashboard/mongo/general/show-general-mongo.tsx index c6fcbc1b..2e181c5f 100644 --- a/components/dashboard/mongo/general/show-general-mongo.tsx +++ b/components/dashboard/mongo/general/show-general-mongo.tsx @@ -1,13 +1,13 @@ -import React from "react"; -import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { api } from "@/utils/api"; -import { StopMongo } from "./stop-mongo"; -import { StartMongo } from "../start-mongo"; -import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal"; import { Terminal } from "lucide-react"; +import React from "react"; +import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal"; +import { StartMongo } from "../start-mongo"; import { DeployMongo } from "./deploy-mongo"; import { ResetMongo } from "./reset-mongo"; +import { StopMongo } from "./stop-mongo"; interface Props { mongoId: string; } diff --git a/components/dashboard/mongo/general/show-internal-mongo-credentials.tsx b/components/dashboard/mongo/general/show-internal-mongo-credentials.tsx index 9fab4a8a..6636688d 100644 --- a/components/dashboard/mongo/general/show-internal-mongo-credentials.tsx +++ b/components/dashboard/mongo/general/show-internal-mongo-credentials.tsx @@ -1,9 +1,9 @@ -import React from "react"; +import { ToggleVisibilityInput } from "@/components/shared/toggle-visibility-input"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { api } from "@/utils/api"; -import { ToggleVisibilityInput } from "@/components/shared/toggle-visibility-input"; +import React from "react"; interface Props { mongoId: string; diff --git a/components/dashboard/mongo/general/stop-mongo.tsx b/components/dashboard/mongo/general/stop-mongo.tsx index b234a701..09d2c372 100644 --- a/components/dashboard/mongo/general/stop-mongo.tsx +++ b/components/dashboard/mongo/general/stop-mongo.tsx @@ -1,13 +1,13 @@ import { - AlertDialog, - AlertDialogAction, - AlertDialogCancel, - AlertDialogContent, - AlertDialogDescription, - AlertDialogFooter, - AlertDialogHeader, - AlertDialogTitle, - AlertDialogTrigger, + AlertDialog, + AlertDialogAction, + AlertDialogCancel, + AlertDialogContent, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogTitle, + AlertDialogTrigger, } from "@/components/ui/alert-dialog"; import { Button } from "@/components/ui/button"; import { api } from "@/utils/api"; @@ -15,51 +15,51 @@ import { Ban } from "lucide-react"; import { toast } from "sonner"; interface Props { - mongoId: string; + mongoId: string; } export const StopMongo = ({ mongoId }: Props) => { - const { mutateAsync, isLoading } = api.mongo.stop.useMutation(); - const utils = api.useUtils(); - return ( - - - - - - - - Are you absolutely sure to stop the database? - - - This will stop the database - - - - Cancel - { - await mutateAsync({ - mongoId, - }) - .then(async () => { - await utils.mongo.one.invalidate({ - mongoId, - }); - toast.success("Application stopped succesfully"); - }) - .catch(() => { - toast.error("Error to stop the Application"); - }); - }} - > - Confirm - - - - - ); + const { mutateAsync, isLoading } = api.mongo.stop.useMutation(); + const utils = api.useUtils(); + return ( + + + + + + + + Are you absolutely sure to stop the database? + + + This will stop the database + + + + Cancel + { + await mutateAsync({ + mongoId, + }) + .then(async () => { + await utils.mongo.one.invalidate({ + mongoId, + }); + toast.success("Application stopped succesfully"); + }) + .catch(() => { + toast.error("Error to stop the Application"); + }); + }} + > + Confirm + + + + + ); }; diff --git a/components/dashboard/mongo/start-mongo.tsx b/components/dashboard/mongo/start-mongo.tsx index 74c5c601..3bc30862 100644 --- a/components/dashboard/mongo/start-mongo.tsx +++ b/components/dashboard/mongo/start-mongo.tsx @@ -1,13 +1,13 @@ import { - AlertDialog, - AlertDialogAction, - AlertDialogCancel, - AlertDialogContent, - AlertDialogDescription, - AlertDialogFooter, - AlertDialogHeader, - AlertDialogTitle, - AlertDialogTrigger, + AlertDialog, + AlertDialogAction, + AlertDialogCancel, + AlertDialogContent, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogTitle, + AlertDialogTrigger, } from "@/components/ui/alert-dialog"; import { Button } from "@/components/ui/button"; import { api } from "@/utils/api"; @@ -15,51 +15,51 @@ import { CheckCircle2 } from "lucide-react"; import { toast } from "sonner"; interface Props { - mongoId: string; + mongoId: string; } export const StartMongo = ({ mongoId }: Props) => { - const { mutateAsync, isLoading } = api.mongo.start.useMutation(); - const utils = api.useUtils(); - return ( - - - - - - - - Are you sure to start the database? - - - This will start the database - - - - Cancel - { - await mutateAsync({ - mongoId, - }) - .then(async () => { - await utils.mongo.one.invalidate({ - mongoId, - }); - toast.success("Database started succesfully"); - }) - .catch(() => { - toast.error("Error to start the Database"); - }); - }} - > - Confirm - - - - - ); + const { mutateAsync, isLoading } = api.mongo.start.useMutation(); + const utils = api.useUtils(); + return ( + + + + + + + + Are you sure to start the database? + + + This will start the database + + + + Cancel + { + await mutateAsync({ + mongoId, + }) + .then(async () => { + await utils.mongo.one.invalidate({ + mongoId, + }); + toast.success("Database started succesfully"); + }) + .catch(() => { + toast.error("Error to start the Database"); + }); + }} + > + Confirm + + + + + ); }; diff --git a/components/dashboard/mongo/update-mongo.tsx b/components/dashboard/mongo/update-mongo.tsx index fa7a5283..3b7ec5a7 100644 --- a/components/dashboard/mongo/update-mongo.tsx +++ b/components/dashboard/mongo/update-mongo.tsx @@ -1,3 +1,5 @@ +import { AlertBlock } from "@/components/shared/alert-block"; +import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, @@ -7,7 +9,6 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; -import { Button } from "@/components/ui/button"; import { Form, FormControl, @@ -16,16 +17,15 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; -import { useForm } from "react-hook-form"; -import { z } from "zod"; -import { AlertBlock } from "@/components/shared/alert-block"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useEffect } from "react"; -import { toast } from "sonner"; import { Input } from "@/components/ui/input"; -import { AlertTriangle, SquarePen } from "lucide-react"; import { Textarea } from "@/components/ui/textarea"; import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { AlertTriangle, SquarePen } from "lucide-react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; const updateMongoSchema = z.object({ name: z.string().min(1, { diff --git a/components/dashboard/mongo/volumes/show-volumes.tsx b/components/dashboard/mongo/volumes/show-volumes.tsx index 29d0035a..48cada9f 100644 --- a/components/dashboard/mongo/volumes/show-volumes.tsx +++ b/components/dashboard/mongo/volumes/show-volumes.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import { AlertBlock } from "@/components/shared/alert-block"; import { Card, CardContent, @@ -8,10 +8,10 @@ import { } from "@/components/ui/card"; import { api } from "@/utils/api"; import { AlertTriangle, Package } from "lucide-react"; -import { DeleteVolume } from "../../application/advanced/volumes/delete-volume"; +import React from "react"; import { AddVolumes } from "../../application/advanced/volumes/add-volumes"; +import { DeleteVolume } from "../../application/advanced/volumes/delete-volume"; import { UpdateVolume } from "../../application/advanced/volumes/update-volume"; -import { AlertBlock } from "@/components/shared/alert-block"; interface Props { mongoId: string; } diff --git a/components/dashboard/monitoring/docker/docker-block-chart.tsx b/components/dashboard/monitoring/docker/docker-block-chart.tsx index d5b28c2f..57a3cbe2 100644 --- a/components/dashboard/monitoring/docker/docker-block-chart.tsx +++ b/components/dashboard/monitoring/docker/docker-block-chart.tsx @@ -1,14 +1,14 @@ +import { format } from "date-fns"; import { - AreaChart, Area, - YAxis, + AreaChart, CartesianGrid, - Tooltip, - ResponsiveContainer, Legend, + ResponsiveContainer, + Tooltip, + YAxis, } from "recharts"; import type { DockerStatsJSON } from "./show"; -import { format } from "date-fns"; interface Props { acummulativeData: DockerStatsJSON["block"]; diff --git a/components/dashboard/monitoring/docker/docker-cpu-chart.tsx b/components/dashboard/monitoring/docker/docker-cpu-chart.tsx index fd46a182..41f20f8f 100644 --- a/components/dashboard/monitoring/docker/docker-cpu-chart.tsx +++ b/components/dashboard/monitoring/docker/docker-cpu-chart.tsx @@ -1,14 +1,14 @@ +import { format } from "date-fns"; import { - AreaChart, Area, - YAxis, + AreaChart, CartesianGrid, - Tooltip, - ResponsiveContainer, Legend, + ResponsiveContainer, + Tooltip, + YAxis, } from "recharts"; import type { DockerStatsJSON } from "./show"; -import { format } from "date-fns"; interface Props { acummulativeData: DockerStatsJSON["cpu"]; diff --git a/components/dashboard/monitoring/docker/docker-disk-chart.tsx b/components/dashboard/monitoring/docker/docker-disk-chart.tsx index fdfa52ea..a97fcfed 100644 --- a/components/dashboard/monitoring/docker/docker-disk-chart.tsx +++ b/components/dashboard/monitoring/docker/docker-disk-chart.tsx @@ -1,14 +1,14 @@ +import { format } from "date-fns"; import { - AreaChart, Area, - YAxis, + AreaChart, CartesianGrid, - Tooltip, - ResponsiveContainer, Legend, + ResponsiveContainer, + Tooltip, + YAxis, } from "recharts"; import type { DockerStatsJSON } from "./show"; -import { format } from "date-fns"; interface Props { acummulativeData: DockerStatsJSON["disk"]; diff --git a/components/dashboard/monitoring/docker/docker-memory-chart.tsx b/components/dashboard/monitoring/docker/docker-memory-chart.tsx index 51dc80cf..78791ce1 100644 --- a/components/dashboard/monitoring/docker/docker-memory-chart.tsx +++ b/components/dashboard/monitoring/docker/docker-memory-chart.tsx @@ -1,14 +1,14 @@ +import { format } from "date-fns"; import { - AreaChart, Area, - YAxis, + AreaChart, CartesianGrid, - Tooltip, - ResponsiveContainer, Legend, + ResponsiveContainer, + Tooltip, + YAxis, } from "recharts"; import type { DockerStatsJSON } from "./show"; -import { format } from "date-fns"; interface Props { acummulativeData: DockerStatsJSON["memory"]; diff --git a/components/dashboard/monitoring/docker/docker-network-chart.tsx b/components/dashboard/monitoring/docker/docker-network-chart.tsx index 9720ae5d..b522603d 100644 --- a/components/dashboard/monitoring/docker/docker-network-chart.tsx +++ b/components/dashboard/monitoring/docker/docker-network-chart.tsx @@ -1,14 +1,14 @@ +import { format } from "date-fns"; import { - AreaChart, Area, - YAxis, + AreaChart, CartesianGrid, - Tooltip, - ResponsiveContainer, Legend, + ResponsiveContainer, + Tooltip, + YAxis, } from "recharts"; import type { DockerStatsJSON } from "./show"; -import { format } from "date-fns"; 1; interface Props { acummulativeData: DockerStatsJSON["network"]; diff --git a/components/dashboard/monitoring/docker/show.tsx b/components/dashboard/monitoring/docker/show.tsx index ea7556b5..c54e7c0c 100644 --- a/components/dashboard/monitoring/docker/show.tsx +++ b/components/dashboard/monitoring/docker/show.tsx @@ -6,13 +6,13 @@ import { CardTitle, } from "@/components/ui/card"; import { Progress } from "@/components/ui/progress"; -import React, { useEffect, useState } from "react"; -import { DockerCpuChart } from "./docker-cpu-chart"; -import { DockerMemoryChart } from "./docker-memory-chart"; -import { DockerBlockChart } from "./docker-block-chart"; -import { DockerNetworkChart } from "./docker-network-chart"; -import { DockerDiskChart } from "./docker-disk-chart"; import { api } from "@/utils/api"; +import React, { useEffect, useState } from "react"; +import { DockerBlockChart } from "./docker-block-chart"; +import { DockerCpuChart } from "./docker-cpu-chart"; +import { DockerDiskChart } from "./docker-disk-chart"; +import { DockerMemoryChart } from "./docker-memory-chart"; +import { DockerNetworkChart } from "./docker-network-chart"; const defaultData = { cpu: { @@ -210,9 +210,7 @@ export const DockerMonitoring = ({ {`Used: ${(currentData.memory.value.used / 1024).toFixed( 2, - )} GB / Limit: ${( - currentData.memory.value.total / 1024 - ).toFixed(2)} GB`} + )} GB / Limit: ${(currentData.memory.value.total / 1024).toFixed(2)} GB`} { - const { mutateAsync, isLoading } = api.mysql.stop.useMutation(); - const utils = api.useUtils(); - return ( - - - - - - - - Are you absolutely sure to stop the database? - - - This will stop the database - - - - Cancel - { - await mutateAsync({ - mysqlId, - }) - .then(async () => { - await utils.mysql.one.invalidate({ - mysqlId, - }); - toast.success("Application stopped succesfully"); - }) - .catch(() => { - toast.error("Error to stop the Application"); - }); - }} - > - Confirm - - - - - ); + const { mutateAsync, isLoading } = api.mysql.stop.useMutation(); + const utils = api.useUtils(); + return ( + + + + + + + + Are you absolutely sure to stop the database? + + + This will stop the database + + + + Cancel + { + await mutateAsync({ + mysqlId, + }) + .then(async () => { + await utils.mysql.one.invalidate({ + mysqlId, + }); + toast.success("Application stopped succesfully"); + }) + .catch(() => { + toast.error("Error to stop the Application"); + }); + }} + > + Confirm + + + + + ); }; diff --git a/components/dashboard/mysql/start-mysql.tsx b/components/dashboard/mysql/start-mysql.tsx index 33607674..60ebc08b 100644 --- a/components/dashboard/mysql/start-mysql.tsx +++ b/components/dashboard/mysql/start-mysql.tsx @@ -1,13 +1,13 @@ import { - AlertDialog, - AlertDialogAction, - AlertDialogCancel, - AlertDialogContent, - AlertDialogDescription, - AlertDialogFooter, - AlertDialogHeader, - AlertDialogTitle, - AlertDialogTrigger, + AlertDialog, + AlertDialogAction, + AlertDialogCancel, + AlertDialogContent, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogTitle, + AlertDialogTrigger, } from "@/components/ui/alert-dialog"; import { Button } from "@/components/ui/button"; import { api } from "@/utils/api"; @@ -15,51 +15,51 @@ import { CheckCircle2 } from "lucide-react"; import { toast } from "sonner"; interface Props { - mysqlId: string; + mysqlId: string; } export const StartMysql = ({ mysqlId }: Props) => { - const { mutateAsync, isLoading } = api.mysql.start.useMutation(); - const utils = api.useUtils(); - return ( - - - - - - - - Are you sure to start the database? - - - This will start the database - - - - Cancel - { - await mutateAsync({ - mysqlId, - }) - .then(async () => { - await utils.mysql.one.invalidate({ - mysqlId, - }); - toast.success("Database started succesfully"); - }) - .catch(() => { - toast.error("Error to start the Database"); - }); - }} - > - Confirm - - - - - ); + const { mutateAsync, isLoading } = api.mysql.start.useMutation(); + const utils = api.useUtils(); + return ( + + + + + + + + Are you sure to start the database? + + + This will start the database + + + + Cancel + { + await mutateAsync({ + mysqlId, + }) + .then(async () => { + await utils.mysql.one.invalidate({ + mysqlId, + }); + toast.success("Database started succesfully"); + }) + .catch(() => { + toast.error("Error to start the Database"); + }); + }} + > + Confirm + + + + + ); }; diff --git a/components/dashboard/mysql/update-mysql.tsx b/components/dashboard/mysql/update-mysql.tsx index cd281281..37b71b6c 100644 --- a/components/dashboard/mysql/update-mysql.tsx +++ b/components/dashboard/mysql/update-mysql.tsx @@ -1,3 +1,5 @@ +import { AlertBlock } from "@/components/shared/alert-block"; +import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, @@ -7,7 +9,6 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; -import { Button } from "@/components/ui/button"; import { Form, FormControl, @@ -16,16 +17,15 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; -import { useForm } from "react-hook-form"; -import { z } from "zod"; -import { AlertBlock } from "@/components/shared/alert-block"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useEffect } from "react"; -import { toast } from "sonner"; import { Input } from "@/components/ui/input"; -import { AlertTriangle, SquarePen } from "lucide-react"; import { Textarea } from "@/components/ui/textarea"; import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { AlertTriangle, SquarePen } from "lucide-react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; const updateMysqlSchema = z.object({ name: z.string().min(1, { diff --git a/components/dashboard/mysql/volumes/show-volumes.tsx b/components/dashboard/mysql/volumes/show-volumes.tsx index 98ee1342..9e39360b 100644 --- a/components/dashboard/mysql/volumes/show-volumes.tsx +++ b/components/dashboard/mysql/volumes/show-volumes.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import { AlertBlock } from "@/components/shared/alert-block"; import { Card, CardContent, @@ -8,10 +8,10 @@ import { } from "@/components/ui/card"; import { api } from "@/utils/api"; import { AlertTriangle, Package } from "lucide-react"; -import { DeleteVolume } from "../../application/advanced/volumes/delete-volume"; +import React from "react"; import { AddVolumes } from "../../application/advanced/volumes/add-volumes"; +import { DeleteVolume } from "../../application/advanced/volumes/delete-volume"; import { UpdateVolume } from "../../application/advanced/volumes/update-volume"; -import { AlertBlock } from "@/components/shared/alert-block"; interface Props { mysqlId: string; } diff --git a/components/dashboard/postgres/advanced/show-postgres-advanced-settings.tsx b/components/dashboard/postgres/advanced/show-postgres-advanced-settings.tsx index 7cd34aef..c8002fa2 100644 --- a/components/dashboard/postgres/advanced/show-postgres-advanced-settings.tsx +++ b/components/dashboard/postgres/advanced/show-postgres-advanced-settings.tsx @@ -1,12 +1,5 @@ -import React, { useEffect } from "react"; -import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; -import { api } from "@/utils/api"; -import { z } from "zod"; -import { Input } from "@/components/ui/input"; -import { ShowPostgresResources } from "./show-postgres-resources"; -import { toast } from "sonner"; -import { zodResolver } from "@hookform/resolvers/zod"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Form, FormControl, @@ -15,8 +8,15 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; +import { Input } from "@/components/ui/input"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import React, { useEffect } from "react"; import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; import { ShowVolumes } from "../volumes/show-volumes"; +import { ShowPostgresResources } from "./show-postgres-resources"; const addDockerImage = z.object({ dockerImage: z.string().min(1, "Docker image is required"), diff --git a/components/dashboard/postgres/advanced/show-postgres-resources.tsx b/components/dashboard/postgres/advanced/show-postgres-resources.tsx index a86a2e25..442d4f65 100644 --- a/components/dashboard/postgres/advanced/show-postgres-resources.tsx +++ b/components/dashboard/postgres/advanced/show-postgres-resources.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Card, @@ -21,7 +22,6 @@ import React, { useEffect } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; -import { AlertBlock } from "@/components/shared/alert-block"; const addResourcesPostgres = z.object({ memoryReservation: z.number().nullable().optional(), diff --git a/components/dashboard/postgres/backups/show-backup-postgres.tsx b/components/dashboard/postgres/backups/show-backup-postgres.tsx index eeb3cce2..877769b7 100644 --- a/components/dashboard/postgres/backups/show-backup-postgres.tsx +++ b/components/dashboard/postgres/backups/show-backup-postgres.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import { Button } from "@/components/ui/button"; import { Card, CardContent, @@ -6,20 +6,20 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; -import { Button } from "@/components/ui/button"; -import { api } from "@/utils/api"; -import { DatabaseBackup, Play } from "lucide-react"; -import Link from "next/link"; -import { AddBackup } from "../../database/backups/add-backup"; -import { DeleteBackup } from "../../database/backups/delete-backup"; -import { UpdateBackup } from "../../database/backups/update-backup"; -import { toast } from "sonner"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip"; +import { api } from "@/utils/api"; +import { DatabaseBackup, Play } from "lucide-react"; +import Link from "next/link"; +import React from "react"; +import { toast } from "sonner"; +import { AddBackup } from "../../database/backups/add-backup"; +import { DeleteBackup } from "../../database/backups/delete-backup"; +import { UpdateBackup } from "../../database/backups/update-backup"; interface Props { postgresId: string; } diff --git a/components/dashboard/postgres/environment/show-postgres-environment.tsx b/components/dashboard/postgres/environment/show-postgres-environment.tsx index 42133df8..2ab78397 100644 --- a/components/dashboard/postgres/environment/show-postgres-environment.tsx +++ b/components/dashboard/postgres/environment/show-postgres-environment.tsx @@ -1,4 +1,5 @@ -import React, { useEffect } from "react"; +import { CodeEditor } from "@/components/shared/code-editor"; +import { Button } from "@/components/ui/button"; import { Card, CardContent, @@ -6,10 +7,6 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; -import { Button } from "@/components/ui/button"; -import { z } from "zod"; -import { useForm } from "react-hook-form"; -import { zodResolver } from "@hookform/resolvers/zod"; import { Form, FormControl, @@ -18,8 +15,11 @@ import { FormMessage, } from "@/components/ui/form"; import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import React, { useEffect } from "react"; +import { useForm } from "react-hook-form"; import { toast } from "sonner"; -import { CodeEditor } from "@/components/shared/code-editor"; +import { z } from "zod"; const addEnvironmentSchema = z.object({ environment: z.string(), diff --git a/components/dashboard/postgres/general/show-general-postgres.tsx b/components/dashboard/postgres/general/show-general-postgres.tsx index 68db3f67..a2aa17cb 100644 --- a/components/dashboard/postgres/general/show-general-postgres.tsx +++ b/components/dashboard/postgres/general/show-general-postgres.tsx @@ -1,13 +1,13 @@ -import React from "react"; -import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { api } from "@/utils/api"; -import { StopPostgres } from "./stop-postgres"; -import { StartPostgres } from "../start-postgres"; -import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal"; import { Terminal } from "lucide-react"; +import React from "react"; +import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal"; +import { StartPostgres } from "../start-postgres"; import { DeployPostgres } from "./deploy-postgres"; import { ResetPostgres } from "./reset-postgres"; +import { StopPostgres } from "./stop-postgres"; interface Props { postgresId: string; } diff --git a/components/dashboard/postgres/general/show-internal-postgres-credentials.tsx b/components/dashboard/postgres/general/show-internal-postgres-credentials.tsx index a8b5270d..e0122610 100644 --- a/components/dashboard/postgres/general/show-internal-postgres-credentials.tsx +++ b/components/dashboard/postgres/general/show-internal-postgres-credentials.tsx @@ -1,9 +1,9 @@ -import React from "react"; +import { ToggleVisibilityInput } from "@/components/shared/toggle-visibility-input"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { api } from "@/utils/api"; -import { ToggleVisibilityInput } from "@/components/shared/toggle-visibility-input"; +import React from "react"; interface Props { postgresId: string; diff --git a/components/dashboard/postgres/general/stop-postgres.tsx b/components/dashboard/postgres/general/stop-postgres.tsx index bf3bb776..9bf1738f 100644 --- a/components/dashboard/postgres/general/stop-postgres.tsx +++ b/components/dashboard/postgres/general/stop-postgres.tsx @@ -1,13 +1,13 @@ import { - AlertDialog, - AlertDialogAction, - AlertDialogCancel, - AlertDialogContent, - AlertDialogDescription, - AlertDialogFooter, - AlertDialogHeader, - AlertDialogTitle, - AlertDialogTrigger, + AlertDialog, + AlertDialogAction, + AlertDialogCancel, + AlertDialogContent, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogTitle, + AlertDialogTrigger, } from "@/components/ui/alert-dialog"; import { Button } from "@/components/ui/button"; import { api } from "@/utils/api"; @@ -15,51 +15,51 @@ import { Ban } from "lucide-react"; import { toast } from "sonner"; interface Props { - postgresId: string; + postgresId: string; } export const StopPostgres = ({ postgresId }: Props) => { - const { mutateAsync, isLoading } = api.postgres.stop.useMutation(); - const utils = api.useUtils(); - return ( - - - - - - - - Are you absolutely sure to stop the database? - - - This will stop the database - - - - Cancel - { - await mutateAsync({ - postgresId, - }) - .then(async () => { - await utils.postgres.one.invalidate({ - postgresId, - }); - toast.success("Application stopped succesfully"); - }) - .catch(() => { - toast.error("Error to stop the Application"); - }); - }} - > - Confirm - - - - - ); + const { mutateAsync, isLoading } = api.postgres.stop.useMutation(); + const utils = api.useUtils(); + return ( + + + + + + + + Are you absolutely sure to stop the database? + + + This will stop the database + + + + Cancel + { + await mutateAsync({ + postgresId, + }) + .then(async () => { + await utils.postgres.one.invalidate({ + postgresId, + }); + toast.success("Application stopped succesfully"); + }) + .catch(() => { + toast.error("Error to stop the Application"); + }); + }} + > + Confirm + + + + + ); }; diff --git a/components/dashboard/postgres/start-postgres.tsx b/components/dashboard/postgres/start-postgres.tsx index 17f9faac..8d945082 100644 --- a/components/dashboard/postgres/start-postgres.tsx +++ b/components/dashboard/postgres/start-postgres.tsx @@ -1,13 +1,13 @@ import { - AlertDialog, - AlertDialogAction, - AlertDialogCancel, - AlertDialogContent, - AlertDialogDescription, - AlertDialogFooter, - AlertDialogHeader, - AlertDialogTitle, - AlertDialogTrigger, + AlertDialog, + AlertDialogAction, + AlertDialogCancel, + AlertDialogContent, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogTitle, + AlertDialogTrigger, } from "@/components/ui/alert-dialog"; import { Button } from "@/components/ui/button"; import { api } from "@/utils/api"; @@ -15,51 +15,51 @@ import { CheckCircle2 } from "lucide-react"; import { toast } from "sonner"; interface Props { - postgresId: string; + postgresId: string; } export const StartPostgres = ({ postgresId }: Props) => { - const { mutateAsync, isLoading } = api.postgres.start.useMutation(); - const utils = api.useUtils(); - return ( - - - - - - - - Are you sure to start the database? - - - This will start the database - - - - Cancel - { - await mutateAsync({ - postgresId, - }) - .then(async () => { - await utils.postgres.one.invalidate({ - postgresId, - }); - toast.success("Database started succesfully"); - }) - .catch(() => { - toast.error("Error to start the Database"); - }); - }} - > - Confirm - - - - - ); + const { mutateAsync, isLoading } = api.postgres.start.useMutation(); + const utils = api.useUtils(); + return ( + + + + + + + + Are you sure to start the database? + + + This will start the database + + + + Cancel + { + await mutateAsync({ + postgresId, + }) + .then(async () => { + await utils.postgres.one.invalidate({ + postgresId, + }); + toast.success("Database started succesfully"); + }) + .catch(() => { + toast.error("Error to start the Database"); + }); + }} + > + Confirm + + + + + ); }; diff --git a/components/dashboard/postgres/update-postgres.tsx b/components/dashboard/postgres/update-postgres.tsx index 45f0aa89..95bfed6a 100644 --- a/components/dashboard/postgres/update-postgres.tsx +++ b/components/dashboard/postgres/update-postgres.tsx @@ -1,3 +1,5 @@ +import { AlertBlock } from "@/components/shared/alert-block"; +import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, @@ -7,7 +9,6 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; -import { Button } from "@/components/ui/button"; import { Form, FormControl, @@ -16,16 +17,15 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; -import { useForm } from "react-hook-form"; -import { z } from "zod"; -import { AlertBlock } from "@/components/shared/alert-block"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useEffect } from "react"; -import { toast } from "sonner"; import { Input } from "@/components/ui/input"; -import { AlertTriangle, SquarePen } from "lucide-react"; import { Textarea } from "@/components/ui/textarea"; import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { AlertTriangle, SquarePen } from "lucide-react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; const updatePostgresSchema = z.object({ name: z.string().min(1, { diff --git a/components/dashboard/postgres/volumes/show-volumes.tsx b/components/dashboard/postgres/volumes/show-volumes.tsx index 4ba957d5..4c449c94 100644 --- a/components/dashboard/postgres/volumes/show-volumes.tsx +++ b/components/dashboard/postgres/volumes/show-volumes.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import { AlertBlock } from "@/components/shared/alert-block"; import { Card, CardContent, @@ -8,10 +8,10 @@ import { } from "@/components/ui/card"; import { api } from "@/utils/api"; import { AlertTriangle, Package } from "lucide-react"; +import React from "react"; import { AddVolumes } from "../../application/advanced/volumes/add-volumes"; import { DeleteVolume } from "../../application/advanced/volumes/delete-volume"; import { UpdateVolume } from "../../application/advanced/volumes/update-volume"; -import { AlertBlock } from "@/components/shared/alert-block"; interface Props { postgresId: string; } diff --git a/components/dashboard/project/add-application.tsx b/components/dashboard/project/add-application.tsx index ecf2a1af..cbe48b6d 100644 --- a/components/dashboard/project/add-application.tsx +++ b/components/dashboard/project/add-application.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -18,7 +19,8 @@ import { FormMessage, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; -import { AlertBlock } from "@/components/shared/alert-block"; +import { Textarea } from "@/components/ui/textarea"; +import { slugify } from "@/lib/slug"; import { api } from "@/utils/api"; import { zodResolver } from "@hookform/resolvers/zod"; import { Folder } from "lucide-react"; @@ -26,8 +28,6 @@ import { useState } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; -import { Textarea } from "@/components/ui/textarea"; -import { slugify } from "@/lib/slug"; const AddTemplateSchema = z.object({ name: z.string().min(1, { @@ -40,7 +40,7 @@ const AddTemplateSchema = z.object({ }) .regex(/^[a-z](?!.*--)([a-z0-9-]*[a-z])?$/, { message: - "App name supports letters, numbers, '-' and can only start and end letters, and does not support continuous '-'", + "App name supports lowercase letters, numbers, '-' and can only start and end letters, and does not support continuous '-'", }), description: z.string().optional(), }); diff --git a/components/dashboard/project/add-compose.tsx b/components/dashboard/project/add-compose.tsx index fd769c91..a6697eb6 100644 --- a/components/dashboard/project/add-compose.tsx +++ b/components/dashboard/project/add-compose.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -18,15 +19,6 @@ import { FormMessage, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; -import { AlertBlock } from "@/components/shared/alert-block"; -import { api } from "@/utils/api"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { CircuitBoard, Folder } from "lucide-react"; -import { useEffect } from "react"; -import { useForm } from "react-hook-form"; -import { toast } from "sonner"; -import { z } from "zod"; -import { Textarea } from "@/components/ui/textarea"; import { Select, SelectContent, @@ -34,7 +26,15 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; +import { Textarea } from "@/components/ui/textarea"; import { slugify } from "@/lib/slug"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { CircuitBoard, Folder } from "lucide-react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; const AddComposeSchema = z.object({ composeType: z.enum(["docker-compose", "stack"]).optional(), @@ -48,7 +48,7 @@ const AddComposeSchema = z.object({ }) .regex(/^[a-z](?!.*--)([a-z0-9-]*[a-z])?$/, { message: - "App name supports letters, numbers, '-' and can only start and end letters, and does not support continuous '-'", + "App name supports lowercase letters, numbers, '-' and can only start and end letters, and does not support continuous '-'", }), description: z.string().optional(), }); diff --git a/components/dashboard/project/add-database.tsx b/components/dashboard/project/add-database.tsx index 7ab90107..e6b36e63 100644 --- a/components/dashboard/project/add-database.tsx +++ b/components/dashboard/project/add-database.tsx @@ -30,7 +30,7 @@ import { Textarea } from "@/components/ui/textarea"; import { slugify } from "@/lib/slug"; import { api } from "@/utils/api"; import { zodResolver } from "@hookform/resolvers/zod"; -import { Database, AlertTriangle } from "lucide-react"; +import { AlertTriangle, Database } from "lucide-react"; import { useState } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; @@ -66,7 +66,7 @@ const baseDatabaseSchema = z.object({ }) .regex(/^[a-z](?!.*--)([a-z0-9-]*[a-z])?$/, { message: - "App name supports letters, numbers, '-' and can only start and end letters, and does not support continuous '-'", + "App name supports lowercase letters, numbers, '-' and can only start and end letters, and does not support continuous '-'", }), databasePassword: z.string(), dockerImage: z.string(), diff --git a/components/dashboard/project/add-template.tsx b/components/dashboard/project/add-template.tsx index 80774207..87ae6d29 100644 --- a/components/dashboard/project/add-template.tsx +++ b/components/dashboard/project/add-template.tsx @@ -1,20 +1,4 @@ -import { - Dialog, - DialogContent, - DialogDescription, - DialogHeader, - DialogTitle, - DialogTrigger, -} from "@/components/ui/dialog"; -import { DropdownMenuItem } from "@/components/ui/dropdown-menu"; import { AlertBlock } from "@/components/shared/alert-block"; -import { api } from "@/utils/api"; -import { Code, Github, Globe, PuzzleIcon } from "lucide-react"; -import Link from "next/link"; -import { Input } from "@/components/ui/input"; -import { useState } from "react"; -import { Badge } from "@/components/ui/badge"; -import { Button } from "@/components/ui/button"; import { AlertDialog, AlertDialogAction, @@ -26,6 +10,22 @@ import { AlertDialogTitle, AlertDialogTrigger, } from "@/components/ui/alert-dialog"; +import { Badge } from "@/components/ui/badge"; +import { Button } from "@/components/ui/button"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/components/ui/dialog"; +import { DropdownMenuItem } from "@/components/ui/dropdown-menu"; +import { Input } from "@/components/ui/input"; +import { api } from "@/utils/api"; +import { Code, Github, Globe, PuzzleIcon } from "lucide-react"; +import Link from "next/link"; +import { useState } from "react"; import { toast } from "sonner"; interface Props { projectId: string; diff --git a/components/dashboard/projects/add.tsx b/components/dashboard/projects/add.tsx index 8778a79d..1b9f37f8 100644 --- a/components/dashboard/projects/add.tsx +++ b/components/dashboard/projects/add.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -19,7 +20,6 @@ import { import { Input } from "@/components/ui/input"; import { Textarea } from "@/components/ui/textarea"; import { api } from "@/utils/api"; -import { AlertBlock } from "@/components/shared/alert-block"; import { zodResolver } from "@hookform/resolvers/zod"; import { PlusIcon } from "lucide-react"; import { useRouter } from "next/router"; diff --git a/components/dashboard/projects/show.tsx b/components/dashboard/projects/show.tsx index 8df23583..f80a24fb 100644 --- a/components/dashboard/projects/show.tsx +++ b/components/dashboard/projects/show.tsx @@ -1,3 +1,4 @@ +import { DateTooltip } from "@/components/shared/date-tooltip"; import { AlertDialog, AlertDialogAction, @@ -30,7 +31,6 @@ import { import Link from "next/link"; import { toast } from "sonner"; import { UpdateProject } from "./update"; -import { DateTooltip } from "@/components/shared/date-tooltip"; export const ShowProjects = () => { const utils = api.useUtils(); diff --git a/components/dashboard/projects/update.tsx b/components/dashboard/projects/update.tsx index 13442d1f..a7fe22c1 100644 --- a/components/dashboard/projects/update.tsx +++ b/components/dashboard/projects/update.tsx @@ -1,3 +1,5 @@ +import { AlertBlock } from "@/components/shared/alert-block"; +import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, @@ -7,7 +9,7 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; -import { Button } from "@/components/ui/button"; +import { DropdownMenuItem } from "@/components/ui/dropdown-menu"; import { Form, FormControl, @@ -16,17 +18,15 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; -import { useForm } from "react-hook-form"; -import { z } from "zod"; -import { AlertBlock } from "@/components/shared/alert-block"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useEffect } from "react"; -import { toast } from "sonner"; import { Input } from "@/components/ui/input"; -import { AlertTriangle, SquarePen } from "lucide-react"; import { Textarea } from "@/components/ui/textarea"; -import { DropdownMenuItem } from "@/components/ui/dropdown-menu"; import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { AlertTriangle, SquarePen } from "lucide-react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; const updateProjectSchema = z.object({ name: z.string().min(1, { diff --git a/components/dashboard/redis/advanced/show-redis-advanced-settings.tsx b/components/dashboard/redis/advanced/show-redis-advanced-settings.tsx index f3836bb8..8b595480 100644 --- a/components/dashboard/redis/advanced/show-redis-advanced-settings.tsx +++ b/components/dashboard/redis/advanced/show-redis-advanced-settings.tsx @@ -1,12 +1,5 @@ -import React, { useEffect } from "react"; -import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; -import { api } from "@/utils/api"; -import { z } from "zod"; -import { Input } from "@/components/ui/input"; -import { ShowRedisResources } from "./show-redis-resources"; -import { toast } from "sonner"; -import { zodResolver } from "@hookform/resolvers/zod"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Form, FormControl, @@ -15,8 +8,15 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; +import { Input } from "@/components/ui/input"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import React, { useEffect } from "react"; import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; import { ShowVolumes } from "../volumes/show-volumes"; +import { ShowRedisResources } from "./show-redis-resources"; const addDockerImage = z.object({ dockerImage: z.string().min(1, "Docker image is required"), diff --git a/components/dashboard/redis/advanced/show-redis-resources.tsx b/components/dashboard/redis/advanced/show-redis-resources.tsx index ad3f545e..cac15e0b 100644 --- a/components/dashboard/redis/advanced/show-redis-resources.tsx +++ b/components/dashboard/redis/advanced/show-redis-resources.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Card, @@ -21,7 +22,6 @@ import React, { useEffect } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; -import { AlertBlock } from "@/components/shared/alert-block"; const addResourcesRedis = z.object({ memoryReservation: z.number().nullable().optional(), diff --git a/components/dashboard/redis/environment/show-redis-environment.tsx b/components/dashboard/redis/environment/show-redis-environment.tsx index 24c40649..06a634c3 100644 --- a/components/dashboard/redis/environment/show-redis-environment.tsx +++ b/components/dashboard/redis/environment/show-redis-environment.tsx @@ -1,4 +1,5 @@ -import React, { useEffect } from "react"; +import { CodeEditor } from "@/components/shared/code-editor"; +import { Button } from "@/components/ui/button"; import { Card, CardContent, @@ -6,10 +7,6 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; -import { Button } from "@/components/ui/button"; -import { z } from "zod"; -import { useForm } from "react-hook-form"; -import { zodResolver } from "@hookform/resolvers/zod"; import { Form, FormControl, @@ -18,8 +15,11 @@ import { FormMessage, } from "@/components/ui/form"; import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import React, { useEffect } from "react"; +import { useForm } from "react-hook-form"; import { toast } from "sonner"; -import { CodeEditor } from "@/components/shared/code-editor"; +import { z } from "zod"; const addEnvironmentSchema = z.object({ environment: z.string(), diff --git a/components/dashboard/redis/general/show-general-redis.tsx b/components/dashboard/redis/general/show-general-redis.tsx index fef753e7..555451d9 100644 --- a/components/dashboard/redis/general/show-general-redis.tsx +++ b/components/dashboard/redis/general/show-general-redis.tsx @@ -1,14 +1,14 @@ -import React from "react"; -import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { api } from "@/utils/api"; +import React from "react"; -import { StopRedis } from "./stop-redis"; -import { StartRedis } from "../start-redis"; -import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal"; import { Terminal } from "lucide-react"; +import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal"; +import { StartRedis } from "../start-redis"; import { DeployRedis } from "./deploy-redis"; import { ResetRedis } from "./reset-redis"; +import { StopRedis } from "./stop-redis"; interface Props { redisId: string; } diff --git a/components/dashboard/redis/general/show-internal-redis-credentials.tsx b/components/dashboard/redis/general/show-internal-redis-credentials.tsx index 1f798144..09200674 100644 --- a/components/dashboard/redis/general/show-internal-redis-credentials.tsx +++ b/components/dashboard/redis/general/show-internal-redis-credentials.tsx @@ -1,9 +1,9 @@ -import React from "react"; +import { ToggleVisibilityInput } from "@/components/shared/toggle-visibility-input"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { api } from "@/utils/api"; -import { ToggleVisibilityInput } from "@/components/shared/toggle-visibility-input"; +import React from "react"; interface Props { redisId: string; diff --git a/components/dashboard/redis/general/stop-redis.tsx b/components/dashboard/redis/general/stop-redis.tsx index 92984551..67cc5e35 100644 --- a/components/dashboard/redis/general/stop-redis.tsx +++ b/components/dashboard/redis/general/stop-redis.tsx @@ -1,13 +1,13 @@ import { - AlertDialog, - AlertDialogAction, - AlertDialogCancel, - AlertDialogContent, - AlertDialogDescription, - AlertDialogFooter, - AlertDialogHeader, - AlertDialogTitle, - AlertDialogTrigger, + AlertDialog, + AlertDialogAction, + AlertDialogCancel, + AlertDialogContent, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogTitle, + AlertDialogTrigger, } from "@/components/ui/alert-dialog"; import { Button } from "@/components/ui/button"; import { api } from "@/utils/api"; @@ -15,51 +15,51 @@ import { Ban } from "lucide-react"; import { toast } from "sonner"; interface Props { - redisId: string; + redisId: string; } export const StopRedis = ({ redisId }: Props) => { - const { mutateAsync, isLoading } = api.redis.stop.useMutation(); - const utils = api.useUtils(); - return ( - - - - - - - - Are you absolutely sure to stop the database? - - - This will stop the database - - - - Cancel - { - await mutateAsync({ - redisId, - }) - .then(async () => { - await utils.redis.one.invalidate({ - redisId, - }); - toast.success("Application stopped succesfully"); - }) - .catch(() => { - toast.error("Error to stop the Application"); - }); - }} - > - Confirm - - - - - ); + const { mutateAsync, isLoading } = api.redis.stop.useMutation(); + const utils = api.useUtils(); + return ( + + + + + + + + Are you absolutely sure to stop the database? + + + This will stop the database + + + + Cancel + { + await mutateAsync({ + redisId, + }) + .then(async () => { + await utils.redis.one.invalidate({ + redisId, + }); + toast.success("Application stopped succesfully"); + }) + .catch(() => { + toast.error("Error to stop the Application"); + }); + }} + > + Confirm + + + + + ); }; diff --git a/components/dashboard/redis/start-redis.tsx b/components/dashboard/redis/start-redis.tsx index 2e81f629..e0a4aa97 100644 --- a/components/dashboard/redis/start-redis.tsx +++ b/components/dashboard/redis/start-redis.tsx @@ -1,13 +1,13 @@ import { - AlertDialog, - AlertDialogAction, - AlertDialogCancel, - AlertDialogContent, - AlertDialogDescription, - AlertDialogFooter, - AlertDialogHeader, - AlertDialogTitle, - AlertDialogTrigger, + AlertDialog, + AlertDialogAction, + AlertDialogCancel, + AlertDialogContent, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogTitle, + AlertDialogTrigger, } from "@/components/ui/alert-dialog"; import { Button } from "@/components/ui/button"; import { api } from "@/utils/api"; @@ -15,51 +15,51 @@ import { CheckCircle2 } from "lucide-react"; import { toast } from "sonner"; interface Props { - redisId: string; + redisId: string; } export const StartRedis = ({ redisId }: Props) => { - const { mutateAsync, isLoading } = api.redis.start.useMutation(); - const utils = api.useUtils(); - return ( - - - - - - - - Are you sure to start the database? - - - This will start the database - - - - Cancel - { - await mutateAsync({ - redisId, - }) - .then(async () => { - await utils.redis.one.invalidate({ - redisId, - }); - toast.success("Database started succesfully"); - }) - .catch(() => { - toast.error("Error to start the Database"); - }); - }} - > - Confirm - - - - - ); + const { mutateAsync, isLoading } = api.redis.start.useMutation(); + const utils = api.useUtils(); + return ( + + + + + + + + Are you sure to start the database? + + + This will start the database + + + + Cancel + { + await mutateAsync({ + redisId, + }) + .then(async () => { + await utils.redis.one.invalidate({ + redisId, + }); + toast.success("Database started succesfully"); + }) + .catch(() => { + toast.error("Error to start the Database"); + }); + }} + > + Confirm + + + + + ); }; diff --git a/components/dashboard/redis/update-redis.tsx b/components/dashboard/redis/update-redis.tsx index 8ac239b3..fdc08a73 100644 --- a/components/dashboard/redis/update-redis.tsx +++ b/components/dashboard/redis/update-redis.tsx @@ -1,3 +1,5 @@ +import { AlertBlock } from "@/components/shared/alert-block"; +import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, @@ -7,7 +9,6 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; -import { Button } from "@/components/ui/button"; import { Form, FormControl, @@ -16,16 +17,15 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; -import { useForm } from "react-hook-form"; -import { z } from "zod"; -import { AlertBlock } from "@/components/shared/alert-block"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useEffect } from "react"; -import { toast } from "sonner"; import { Input } from "@/components/ui/input"; -import { AlertTriangle, SquarePen } from "lucide-react"; import { Textarea } from "@/components/ui/textarea"; import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { AlertTriangle, SquarePen } from "lucide-react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; const updateRedisSchema = z.object({ name: z.string().min(1, { diff --git a/components/dashboard/redis/volumes/show-volumes.tsx b/components/dashboard/redis/volumes/show-volumes.tsx index f891e096..55f11c17 100644 --- a/components/dashboard/redis/volumes/show-volumes.tsx +++ b/components/dashboard/redis/volumes/show-volumes.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { Card, CardContent, @@ -8,8 +7,9 @@ import { } from "@/components/ui/card"; import { api } from "@/utils/api"; import { AlertTriangle, Package } from "lucide-react"; -import { DeleteVolume } from "../../application/advanced/volumes/delete-volume"; +import React from "react"; import { AddVolumes } from "../../application/advanced/volumes/add-volumes"; +import { DeleteVolume } from "../../application/advanced/volumes/delete-volume"; import { UpdateVolume } from "../../application/advanced/volumes/update-volume"; interface Props { redisId: string; diff --git a/components/dashboard/settings/appearance-form.tsx b/components/dashboard/settings/appearance-form.tsx index 75b5d0d9..52142fcd 100644 --- a/components/dashboard/settings/appearance-form.tsx +++ b/components/dashboard/settings/appearance-form.tsx @@ -2,6 +2,14 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { useForm } from "react-hook-form"; import * as z from "zod"; +import { Button } from "@/components/ui/button"; +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, +} from "@/components/ui/card"; import { Form, FormControl, @@ -15,14 +23,6 @@ import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; import { useTheme } from "next-themes"; import { useEffect } from "react"; import { toast } from "sonner"; -import { Button } from "@/components/ui/button"; -import { - Card, - CardContent, - CardDescription, - CardHeader, - CardTitle, -} from "@/components/ui/card"; const appearanceFormSchema = z.object({ theme: z.enum(["light", "dark", "system"], { diff --git a/components/dashboard/settings/certificates/add-certificate.tsx b/components/dashboard/settings/certificates/add-certificate.tsx index d0460e53..6572e3ba 100644 --- a/components/dashboard/settings/certificates/add-certificate.tsx +++ b/components/dashboard/settings/certificates/add-certificate.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -19,7 +20,6 @@ import { import { Input } from "@/components/ui/input"; import { Textarea } from "@/components/ui/textarea"; 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"; @@ -27,7 +27,8 @@ import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; -const certificateDataHolder = `-----BEGIN CERTIFICATE-----\nMIIFRDCCAyygAwIBAgIUEPOR47ys6VDwMVB9tYoeEka83uQwDQYJKoZIhvcNAQELBQAwGTEXMBUGA1UEAwwObWktZG9taW5pby5jb20wHhcNMjQwMzExMDQyNzU3WhcN\n------END CERTIFICATE-----`; +const certificateDataHolder = + "-----BEGIN CERTIFICATE-----\nMIIFRDCCAyygAwIBAgIUEPOR47ys6VDwMVB9tYoeEka83uQwDQYJKoZIhvcNAQELBQAwGTEXMBUGA1UEAwwObWktZG9taW5pby5jb20wHhcNMjQwMzExMDQyNzU3WhcN\n------END CERTIFICATE-----"; const addCertificate = z.object({ name: z.string().min(1, "Name is required"), diff --git a/components/dashboard/settings/certificates/delete-certificate.tsx b/components/dashboard/settings/certificates/delete-certificate.tsx index 54af315b..907b1dc0 100644 --- a/components/dashboard/settings/certificates/delete-certificate.tsx +++ b/components/dashboard/settings/certificates/delete-certificate.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { AlertDialog, AlertDialogAction, @@ -13,6 +12,7 @@ import { import { Button } from "@/components/ui/button"; import { api } from "@/utils/api"; import { TrashIcon } from "lucide-react"; +import React from "react"; import { toast } from "sonner"; interface Props { diff --git a/components/dashboard/settings/cluster/nodes/add-node.tsx b/components/dashboard/settings/cluster/nodes/add-node.tsx index fd923057..99c7a385 100644 --- a/components/dashboard/settings/cluster/nodes/add-node.tsx +++ b/components/dashboard/settings/cluster/nodes/add-node.tsx @@ -1,3 +1,4 @@ +import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, @@ -7,11 +8,10 @@ import { DialogTrigger, } from "@/components/ui/dialog"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; -import { Button } from "@/components/ui/button"; import { ExternalLink, PlusIcon } from "lucide-react"; -import { AddWorker } from "./workers/add-worker"; -import { AddManager } from "./manager/add-manager"; import Link from "next/link"; +import { AddManager } from "./manager/add-manager"; +import { AddWorker } from "./workers/add-worker"; export const AddNode = () => { return ( diff --git a/components/dashboard/settings/cluster/nodes/manager/add-manager.tsx b/components/dashboard/settings/cluster/nodes/manager/add-manager.tsx index ebb4c7f3..f0b9a773 100644 --- a/components/dashboard/settings/cluster/nodes/manager/add-manager.tsx +++ b/components/dashboard/settings/cluster/nodes/manager/add-manager.tsx @@ -1,12 +1,12 @@ +import { CardContent } from "@/components/ui/card"; import { DialogDescription, DialogHeader, DialogTitle, } from "@/components/ui/dialog"; import { api } from "@/utils/api"; -import { CardContent } from "@/components/ui/card"; -import { CopyIcon } from "lucide-react"; import copy from "copy-to-clipboard"; +import { CopyIcon } from "lucide-react"; import { toast } from "sonner"; export const AddManager = () => { diff --git a/components/dashboard/settings/cluster/nodes/show-nodes.tsx b/components/dashboard/settings/cluster/nodes/show-nodes.tsx index 95d105ab..e7ff2f7e 100644 --- a/components/dashboard/settings/cluster/nodes/show-nodes.tsx +++ b/components/dashboard/settings/cluster/nodes/show-nodes.tsx @@ -1,4 +1,6 @@ -import React from "react"; +import { DateTooltip } from "@/components/shared/date-tooltip"; +import { Badge } from "@/components/ui/badge"; +import { Button } from "@/components/ui/button"; import { Card, CardContent, @@ -6,10 +8,12 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; -import { api } from "@/utils/api"; -import { DateTooltip } from "@/components/shared/date-tooltip"; -import { Badge } from "@/components/ui/badge"; -import { DeleteWorker } from "./workers/delete-worker"; +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuLabel, + DropdownMenuTrigger, +} from "@/components/ui/dropdown-menu"; import { Table, TableBody, @@ -19,22 +23,18 @@ import { TableHeader, TableRow, } from "@/components/ui/table"; -import { HelpCircle, LockIcon, MoreHorizontal } from "lucide-react"; -import { Button } from "@/components/ui/button"; -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuLabel, - DropdownMenuTrigger, -} from "@/components/ui/dropdown-menu"; -import { ShowNodeData } from "./show-node-data"; -import { AddNode } from "./add-node"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip"; +import { api } from "@/utils/api"; +import { HelpCircle, LockIcon, MoreHorizontal } from "lucide-react"; +import React from "react"; +import { AddNode } from "./add-node"; +import { ShowNodeData } from "./show-node-data"; +import { DeleteWorker } from "./workers/delete-worker"; export const ShowNodes = () => { const { data, isLoading } = api.cluster.getNodes.useQuery(); diff --git a/components/dashboard/settings/cluster/nodes/workers/delete-worker.tsx b/components/dashboard/settings/cluster/nodes/workers/delete-worker.tsx index 2d3810ca..ab2d4d77 100644 --- a/components/dashboard/settings/cluster/nodes/workers/delete-worker.tsx +++ b/components/dashboard/settings/cluster/nodes/workers/delete-worker.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { AlertDialog, AlertDialogAction, @@ -11,10 +10,11 @@ import { AlertDialogTrigger, } from "@/components/ui/alert-dialog"; import { Button } from "@/components/ui/button"; +import { DropdownMenuItem } from "@/components/ui/dropdown-menu"; import { api } from "@/utils/api"; import { TrashIcon } from "lucide-react"; +import React from "react"; import { toast } from "sonner"; -import { DropdownMenuItem } from "@/components/ui/dropdown-menu"; interface Props { nodeId: string; diff --git a/components/dashboard/settings/cluster/registry/delete-registry.tsx b/components/dashboard/settings/cluster/registry/delete-registry.tsx index a87f2e4e..952a1831 100644 --- a/components/dashboard/settings/cluster/registry/delete-registry.tsx +++ b/components/dashboard/settings/cluster/registry/delete-registry.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { AlertDialog, AlertDialogAction, @@ -13,6 +12,7 @@ import { import { Button } from "@/components/ui/button"; import { api } from "@/utils/api"; import { TrashIcon } from "lucide-react"; +import React from "react"; import { toast } from "sonner"; interface Props { diff --git a/components/dashboard/settings/destination/add-destination.tsx b/components/dashboard/settings/destination/add-destination.tsx index 0612afbd..e8b42daf 100644 --- a/components/dashboard/settings/destination/add-destination.tsx +++ b/components/dashboard/settings/destination/add-destination.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -18,7 +19,6 @@ 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 { useEffect } from "react"; import { useForm } from "react-hook-form"; diff --git a/components/dashboard/settings/destination/delete-destination.tsx b/components/dashboard/settings/destination/delete-destination.tsx index c5a3bdfe..7069bde7 100644 --- a/components/dashboard/settings/destination/delete-destination.tsx +++ b/components/dashboard/settings/destination/delete-destination.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { AlertDialog, AlertDialogAction, @@ -13,6 +12,7 @@ import { import { Button } from "@/components/ui/button"; import { api } from "@/utils/api"; import { TrashIcon } from "lucide-react"; +import React from "react"; import { toast } from "sonner"; interface Props { diff --git a/components/dashboard/settings/destination/show-destinations.tsx b/components/dashboard/settings/destination/show-destinations.tsx index b5c0448f..d05d824b 100644 --- a/components/dashboard/settings/destination/show-destinations.tsx +++ b/components/dashboard/settings/destination/show-destinations.tsx @@ -8,8 +8,8 @@ import { import { api } from "@/utils/api"; import { FolderUp } from "lucide-react"; import { AddDestination } from "./add-destination"; -import { UpdateDestination } from "./update-destination"; import { DeleteDestination } from "./delete-destination"; +import { UpdateDestination } from "./update-destination"; export const ShowDestinations = () => { const { data } = api.destination.all.useQuery(); diff --git a/components/dashboard/settings/destination/update-destination.tsx b/components/dashboard/settings/destination/update-destination.tsx index 1aa9fce2..4b8bf19a 100644 --- a/components/dashboard/settings/destination/update-destination.tsx +++ b/components/dashboard/settings/destination/update-destination.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -18,7 +19,6 @@ 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 { PenBoxIcon } from "lucide-react"; import { useEffect } from "react"; diff --git a/components/dashboard/settings/github/remove-github-app.tsx b/components/dashboard/settings/github/remove-github-app.tsx index 8ab7ea79..783e68d8 100644 --- a/components/dashboard/settings/github/remove-github-app.tsx +++ b/components/dashboard/settings/github/remove-github-app.tsx @@ -1,5 +1,3 @@ -import { api } from "@/utils/api"; -import React from "react"; import { AlertDialog, AlertDialogAction, @@ -12,14 +10,16 @@ import { AlertDialogTrigger, } from "@/components/ui/alert-dialog"; import { Button } from "@/components/ui/button"; -import { toast } from "sonner"; import { Tooltip, TooltipContent, - TooltipTrigger, TooltipProvider, + TooltipTrigger, } from "@/components/ui/tooltip"; +import { api } from "@/utils/api"; import { InfoIcon } from "lucide-react"; +import React from "react"; +import { toast } from "sonner"; export const RemoveGithubApp = () => { const { refetch } = api.auth.get.useQuery(); diff --git a/components/dashboard/settings/profile/enable-2fa.tsx b/components/dashboard/settings/profile/enable-2fa.tsx index f6e14337..8c2a369f 100644 --- a/components/dashboard/settings/profile/enable-2fa.tsx +++ b/components/dashboard/settings/profile/enable-2fa.tsx @@ -17,6 +17,11 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; +import { + InputOTP, + InputOTPGroup, + InputOTPSlot, +} from "@/components/ui/input-otp"; import { api } from "@/utils/api"; import { zodResolver } from "@hookform/resolvers/zod"; import { AlertTriangle, Fingerprint } from "lucide-react"; @@ -24,11 +29,6 @@ import { useEffect } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; -import { - InputOTP, - InputOTPGroup, - InputOTPSlot, -} from "@/components/ui/input-otp"; const Enable2FASchema = z.object({ pin: z.string().min(6, { diff --git a/components/dashboard/settings/profile/generate-token.tsx b/components/dashboard/settings/profile/generate-token.tsx index f79e8eb1..55b28ec0 100644 --- a/components/dashboard/settings/profile/generate-token.tsx +++ b/components/dashboard/settings/profile/generate-token.tsx @@ -1,3 +1,4 @@ +import { ToggleVisibilityInput } from "@/components/shared/toggle-visibility-input"; import { Button } from "@/components/ui/button"; import { Card, @@ -6,12 +7,11 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; -import { api } from "@/utils/api"; -import { toast } from "sonner"; -import { ToggleVisibilityInput } from "@/components/shared/toggle-visibility-input"; import { Label } from "@/components/ui/label"; -import Link from "next/link"; +import { api } from "@/utils/api"; import { ExternalLinkIcon } from "lucide-react"; +import Link from "next/link"; +import { toast } from "sonner"; export const GenerateToken = () => { const { data, refetch } = api.auth.get.useQuery(); diff --git a/components/dashboard/settings/profile/profile-form.tsx b/components/dashboard/settings/profile/profile-form.tsx index 319c1b3b..1aa25903 100644 --- a/components/dashboard/settings/profile/profile-form.tsx +++ b/components/dashboard/settings/profile/profile-form.tsx @@ -6,10 +6,6 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; -import { Input } from "@/components/ui/input"; -import { z } from "zod"; -import { useForm } from "react-hook-form"; -import { zodResolver } from "@hookform/resolvers/zod"; import { Form, FormControl, @@ -18,12 +14,16 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; -import { useEffect } from "react"; -import { api } from "@/utils/api"; -import { toast } from "sonner"; +import { Input } from "@/components/ui/input"; import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; -import { Enable2FA } from "./enable-2fa"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; import { Disable2FA } from "./disable-2fa"; +import { Enable2FA } from "./enable-2fa"; const profileSchema = z.object({ email: z.string(), diff --git a/components/dashboard/settings/show.tsx b/components/dashboard/settings/show.tsx index c792861b..f193ab2b 100644 --- a/components/dashboard/settings/show.tsx +++ b/components/dashboard/settings/show.tsx @@ -1,14 +1,14 @@ +import { cn } from "@/lib/utils"; +import { api } from "@/utils/api"; import React from "react"; -import { ProfileForm } from "./profile/profile-form"; -import { GithubSetup } from "./github/github-setup"; import { AppearanceForm } from "./appearance-form"; -import { ShowDestinations } from "./destination/show-destinations"; import { ShowCertificates } from "./certificates/show-certificates"; +import { ShowDestinations } from "./destination/show-destinations"; +import { GithubSetup } from "./github/github-setup"; +import { ProfileForm } from "./profile/profile-form"; +import { ShowUsers } from "./users/show-users"; import { WebDomain } from "./web-domain"; import { WebServer } from "./web-server"; -import { api } from "@/utils/api"; -import { ShowUsers } from "./users/show-users"; -import { cn } from "@/lib/utils"; export const ShowSettings = () => { const { data } = api.auth.get.useQuery(); diff --git a/components/dashboard/settings/users/add-permissions.tsx b/components/dashboard/settings/users/add-permissions.tsx index b17f2004..c05918b0 100644 --- a/components/dashboard/settings/users/add-permissions.tsx +++ b/components/dashboard/settings/users/add-permissions.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Checkbox } from "@/components/ui/checkbox"; import { @@ -9,6 +10,7 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; +import { DropdownMenuItem } from "@/components/ui/dropdown-menu"; import { Form, FormControl, @@ -21,13 +23,11 @@ import { import { Switch } from "@/components/ui/switch"; import { extractServices } from "@/pages/dashboard/project/[projectId]"; import { api } from "@/utils/api"; -import { AlertBlock } from "@/components/shared/alert-block"; import { zodResolver } from "@hookform/resolvers/zod"; import { useEffect } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; -import { DropdownMenuItem } from "@/components/ui/dropdown-menu"; const addPermissions = z.object({ accesedProjects: z.array(z.string()).optional(), diff --git a/components/dashboard/settings/users/add-user.tsx b/components/dashboard/settings/users/add-user.tsx index ee8edfea..16af8787 100644 --- a/components/dashboard/settings/users/add-user.tsx +++ b/components/dashboard/settings/users/add-user.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -19,13 +20,12 @@ 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 { PlusIcon } from "lucide-react"; import { useEffect } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; -import { PlusIcon } from "lucide-react"; const addUser = z.object({ email: z diff --git a/components/dashboard/settings/users/delete-user.tsx b/components/dashboard/settings/users/delete-user.tsx index 36f5de2c..e8f708da 100644 --- a/components/dashboard/settings/users/delete-user.tsx +++ b/components/dashboard/settings/users/delete-user.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { AlertDialog, AlertDialogAction, @@ -11,10 +10,11 @@ import { AlertDialogTrigger, } from "@/components/ui/alert-dialog"; import { Button } from "@/components/ui/button"; +import { DropdownMenuItem } from "@/components/ui/dropdown-menu"; import { api } from "@/utils/api"; import { TrashIcon } from "lucide-react"; +import React from "react"; import { toast } from "sonner"; -import { DropdownMenuItem } from "@/components/ui/dropdown-menu"; interface Props { authId: string; diff --git a/components/dashboard/settings/users/show-users.tsx b/components/dashboard/settings/users/show-users.tsx index 55c30411..cad28487 100644 --- a/components/dashboard/settings/users/show-users.tsx +++ b/components/dashboard/settings/users/show-users.tsx @@ -1,3 +1,5 @@ +import { Badge } from "@/components/ui/badge"; +import { Button } from "@/components/ui/button"; import { Card, CardContent, @@ -5,15 +7,13 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; -import { api } from "@/utils/api"; -import { MoreHorizontal, Users } from "lucide-react"; -import { AddUser } from "./add-user"; -import { DeleteUser } from "./delete-user"; -import { format } from "date-fns"; -import { useEffect, useState } from "react"; -import { AddUserPermissions } from "./add-permissions"; -import copy from "copy-to-clipboard"; -import { toast } from "sonner"; +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuLabel, + DropdownMenuTrigger, +} from "@/components/ui/dropdown-menu"; import { Table, TableBody, @@ -23,15 +23,15 @@ import { TableHeader, TableRow, } from "@/components/ui/table"; -import { Badge } from "@/components/ui/badge"; -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuLabel, - DropdownMenuTrigger, -} from "@/components/ui/dropdown-menu"; -import { Button } from "@/components/ui/button"; +import { api } from "@/utils/api"; +import copy from "copy-to-clipboard"; +import { format } from "date-fns"; +import { MoreHorizontal, Users } from "lucide-react"; +import { useEffect, useState } from "react"; +import { toast } from "sonner"; +import { AddUserPermissions } from "./add-permissions"; +import { AddUser } from "./add-user"; +import { DeleteUser } from "./delete-user"; export const ShowUsers = () => { const { data } = api.user.all.useQuery(); diff --git a/components/dashboard/settings/users/update-user.tsx b/components/dashboard/settings/users/update-user.tsx index 843f572c..78ad2c1a 100644 --- a/components/dashboard/settings/users/update-user.tsx +++ b/components/dashboard/settings/users/update-user.tsx @@ -1,3 +1,5 @@ +import { AlertBlock } from "@/components/shared/alert-block"; +import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, @@ -7,7 +9,6 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; -import { Button } from "@/components/ui/button"; import { Form, FormControl, @@ -16,15 +17,14 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; -import { useForm } from "react-hook-form"; -import { z } from "zod"; -import { AlertBlock } from "@/components/shared/alert-block"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useEffect } from "react"; -import { toast } from "sonner"; import { Input } from "@/components/ui/input"; -import { SquarePen } from "lucide-react"; import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { SquarePen } from "lucide-react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; const updateUserSchema = z.object({ email: z diff --git a/components/dashboard/settings/web-server.tsx b/components/dashboard/settings/web-server.tsx index b2c0a6cb..61c4917f 100644 --- a/components/dashboard/settings/web-server.tsx +++ b/components/dashboard/settings/web-server.tsx @@ -1,7 +1,4 @@ -import React, { useEffect, useState } from "react"; import { Button } from "@/components/ui/button"; -import { Switch } from "@/components/ui/switch"; -import { Label } from "@/components/ui/label"; import { Card, CardContent, @@ -9,6 +6,9 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; +import { Label } from "@/components/ui/label"; +import { Switch } from "@/components/ui/switch"; +import React, { useEffect, useState } from "react"; import { DropdownMenu, @@ -21,12 +21,12 @@ import { } from "@/components/ui/dropdown-menu"; import { api } from "@/utils/api"; import { toast } from "sonner"; -import { ShowModalLogs } from "./web-server/show-modal-logs"; -import { TerminalModal } from "./web-server/terminal-modal"; 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 { ShowModalLogs } from "./web-server/show-modal-logs"; import { ShowServerMiddlewareConfig } from "./web-server/show-server-middleware-config"; +import { ShowServerTraefikConfig } from "./web-server/show-server-traefik-config"; +import { TerminalModal } from "./web-server/terminal-modal"; import { UpdateServer } from "./web-server/update-server"; export const WebServer = () => { diff --git a/components/dashboard/settings/web-server/docker-terminal-modal.tsx b/components/dashboard/settings/web-server/docker-terminal-modal.tsx index 0c3c9854..2fc21728 100644 --- a/components/dashboard/settings/web-server/docker-terminal-modal.tsx +++ b/components/dashboard/settings/web-server/docker-terminal-modal.tsx @@ -1,5 +1,3 @@ -import type React from "react"; -import { useEffect, useState } from "react"; import { Dialog, DialogContent, @@ -8,8 +6,7 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; -import dynamic from "next/dynamic"; -import { api } from "@/utils/api"; +import { Label } from "@/components/ui/label"; import { Select, SelectContent, @@ -19,7 +16,10 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; -import { Label } from "@/components/ui/label"; +import { api } from "@/utils/api"; +import dynamic from "next/dynamic"; +import type React from "react"; +import { useEffect, useState } from "react"; const Terminal = dynamic( () => diff --git a/components/dashboard/settings/web-server/show-main-traefik-config.tsx b/components/dashboard/settings/web-server/show-main-traefik-config.tsx index 16f69b77..e6e4866e 100644 --- a/components/dashboard/settings/web-server/show-main-traefik-config.tsx +++ b/components/dashboard/settings/web-server/show-main-traefik-config.tsx @@ -1,3 +1,5 @@ +import { AlertBlock } from "@/components/shared/alert-block"; +import { CodeEditor } from "@/components/shared/code-editor"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -17,13 +19,11 @@ import { FormMessage, } from "@/components/ui/form"; import { api } from "@/utils/api"; -import { AlertBlock } from "@/components/shared/alert-block"; import { zodResolver } from "@hookform/resolvers/zod"; import { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; -import { CodeEditor } from "@/components/shared/code-editor"; import { validateAndFormatYAML } from "../../application/advanced/traefik/update-traefik-config"; const UpdateMainTraefikConfigSchema = z.object({ diff --git a/components/dashboard/settings/web-server/show-modal-logs.tsx b/components/dashboard/settings/web-server/show-modal-logs.tsx index 575ebfb8..2a9cc0fa 100644 --- a/components/dashboard/settings/web-server/show-modal-logs.tsx +++ b/components/dashboard/settings/web-server/show-modal-logs.tsx @@ -1,4 +1,3 @@ -import React, { useEffect, useState } from "react"; import { Dialog, DialogContent, @@ -7,6 +6,8 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; +import { DropdownMenuItem } from "@/components/ui/dropdown-menu"; +import { Label } from "@/components/ui/label"; import { Select, SelectContent, @@ -16,10 +17,10 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; -import { DropdownMenuItem } from "@/components/ui/dropdown-menu"; -import { Label } from "@/components/ui/label"; import { api } from "@/utils/api"; import dynamic from "next/dynamic"; +import type React from "react"; +import { useEffect, useState } from "react"; export const DockerLogsId = dynamic( () => diff --git a/components/dashboard/settings/web-server/show-server-middleware-config.tsx b/components/dashboard/settings/web-server/show-server-middleware-config.tsx index 4facdce2..d65291e4 100644 --- a/components/dashboard/settings/web-server/show-server-middleware-config.tsx +++ b/components/dashboard/settings/web-server/show-server-middleware-config.tsx @@ -1,3 +1,5 @@ +import { AlertBlock } from "@/components/shared/alert-block"; +import { CodeEditor } from "@/components/shared/code-editor"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -17,13 +19,11 @@ import { FormMessage, } from "@/components/ui/form"; import { api } from "@/utils/api"; -import { AlertBlock } from "@/components/shared/alert-block"; import { zodResolver } from "@hookform/resolvers/zod"; import { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; -import { CodeEditor } from "@/components/shared/code-editor"; import { validateAndFormatYAML } from "../../application/advanced/traefik/update-traefik-config"; const UpdateServerMiddlewareConfigSchema = z.object({ diff --git a/components/dashboard/settings/web-server/show-server-traefik-config.tsx b/components/dashboard/settings/web-server/show-server-traefik-config.tsx index 71a80899..9f102a54 100644 --- a/components/dashboard/settings/web-server/show-server-traefik-config.tsx +++ b/components/dashboard/settings/web-server/show-server-traefik-config.tsx @@ -1,3 +1,5 @@ +import { AlertBlock } from "@/components/shared/alert-block"; +import { CodeEditor } from "@/components/shared/code-editor"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -17,13 +19,11 @@ import { FormMessage, } from "@/components/ui/form"; import { api } from "@/utils/api"; -import { AlertBlock } from "@/components/shared/alert-block"; import { zodResolver } from "@hookform/resolvers/zod"; import { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; -import { CodeEditor } from "@/components/shared/code-editor"; import { validateAndFormatYAML } from "../../application/advanced/traefik/update-traefik-config"; const UpdateServerTraefikConfigSchema = z.object({ diff --git a/components/dashboard/settings/web-server/terminal-modal.tsx b/components/dashboard/settings/web-server/terminal-modal.tsx index b2ecc192..d9485ee5 100644 --- a/components/dashboard/settings/web-server/terminal-modal.tsx +++ b/components/dashboard/settings/web-server/terminal-modal.tsx @@ -1,4 +1,4 @@ -import type React from "react"; +import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, @@ -7,7 +7,7 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; -import { Button } from "@/components/ui/button"; +import { DropdownMenuItem } from "@/components/ui/dropdown-menu"; import { Form, FormControl, @@ -17,18 +17,18 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; -import { useForm } from "react-hook-form"; -import { zodResolver } from "@hookform/resolvers/zod"; -import dynamic from "next/dynamic"; -import { DropdownMenuItem } from "@/components/ui/dropdown-menu"; -import { api } from "@/utils/api"; -import { toast } from "sonner"; -import { z } from "zod"; -import { useEffect, useState } from "react"; -import { Textarea } from "@/components/ui/textarea"; -import { RemoveSSHPrivateKey } from "./remove-ssh-private-key"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; +import { Textarea } from "@/components/ui/textarea"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import dynamic from "next/dynamic"; +import type React from "react"; +import { useEffect, useState } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; +import { RemoveSSHPrivateKey } from "./remove-ssh-private-key"; const Terminal = dynamic(() => import("./terminal").then((e) => e.Terminal), { ssr: false, diff --git a/components/dashboard/settings/web-server/terminal.tsx b/components/dashboard/settings/web-server/terminal.tsx index cdc5a907..c225be9c 100644 --- a/components/dashboard/settings/web-server/terminal.tsx +++ b/components/dashboard/settings/web-server/terminal.tsx @@ -1,6 +1,6 @@ -import React from "react"; -import { useEffect, useRef } from "react"; import { Terminal as XTerm } from "@xterm/xterm"; +import type React from "react"; +import { useEffect, useRef } from "react"; import { FitAddon } from "xterm-addon-fit"; import "@xterm/xterm/css/xterm.css"; import { AttachAddon } from "@xterm/addon-attach"; diff --git a/components/dashboard/settings/web-server/update-server.tsx b/components/dashboard/settings/web-server/update-server.tsx index bbca5ece..16591865 100644 --- a/components/dashboard/settings/web-server/update-server.tsx +++ b/components/dashboard/settings/web-server/update-server.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -8,11 +9,10 @@ import { DialogTrigger, } from "@/components/ui/dialog"; import { api } from "@/utils/api"; -import { AlertBlock } from "@/components/shared/alert-block"; import { RefreshCcw } from "lucide-react"; +import Link from "next/link"; import { useState } from "react"; import { toast } from "sonner"; -import Link from "next/link"; import { UpdateWebServer } from "./update-webserver"; export const UpdateServer = () => { diff --git a/components/icons/data-tools-icons.tsx b/components/icons/data-tools-icons.tsx index 8ecee7ef..c361b975 100644 --- a/components/icons/data-tools-icons.tsx +++ b/components/icons/data-tools-icons.tsx @@ -3,155 +3,155 @@ import React from "react"; // https://worldvectorlogo.com/downloaded/redis Ref interface Props { - className?: string; + className?: string; } export const PostgresqlIcon = ({ className }: Props) => { - return ( - - - - - - - - ); + return ( + + + + + + + + ); }; export const MysqlIcon = ({ className }: Props) => { - return ( - - - - - ); + return ( + + + + + ); }; export const MariadbIcon = ({ className }: Props) => { - return ( - - - - ); + return ( + + + + ); }; export const MongodbIcon = ({ className }: Props) => { - return ( - - - - - - ); + return ( + + + + + + ); }; export const RedisIcon = ({ className }: Props) => { - return ( - - - - - - - - - - - - ); + return ( + + + + + + + + + + + + ); }; diff --git a/components/layouts/navbar.tsx b/components/layouts/navbar.tsx index 847932da..0b0e38ff 100644 --- a/components/layouts/navbar.tsx +++ b/components/layouts/navbar.tsx @@ -8,13 +8,13 @@ import { DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { cn } from "@/lib/utils"; +import { api } from "@/utils/api"; +import { HeartIcon } from "lucide-react"; import Link from "next/link"; +import { useRouter } from "next/router"; import { Logo } from "../shared/logo"; import { Avatar, AvatarFallback, AvatarImage } from "../ui/avatar"; -import { useRouter } from "next/router"; -import { api } from "@/utils/api"; import { buttonVariants } from "../ui/button"; -import { HeartIcon } from "lucide-react"; export const Navbar = () => { const router = useRouter(); diff --git a/components/layouts/navigation-tabs.tsx b/components/layouts/navigation-tabs.tsx index fdd12188..b251a279 100644 --- a/components/layouts/navigation-tabs.tsx +++ b/components/layouts/navigation-tabs.tsx @@ -1,10 +1,10 @@ import { AddProject } from "@/components/dashboard/projects/add"; -import { Tabs, TabsContent, TabsList, TabsTrigger } from "../ui/tabs"; -import { useEffect, useMemo, useState } from "react"; -import { useRouter } from "next/router"; -import { api } from "@/utils/api"; import type { Auth } from "@/server/api/services/auth"; import type { User } from "@/server/api/services/user"; +import { api } from "@/utils/api"; +import { useRouter } from "next/router"; +import { useEffect, useMemo, useState } from "react"; +import { Tabs, TabsContent, TabsList, TabsTrigger } from "../ui/tabs"; interface TabInfo { label: string; diff --git a/components/layouts/settings-layout.tsx b/components/layouts/settings-layout.tsx index c814e8e7..b641a778 100644 --- a/components/layouts/settings-layout.tsx +++ b/components/layouts/settings-layout.tsx @@ -82,23 +82,23 @@ export const SettingsLayout = ({ children }: Props) => { ); }; -import Link from "next/link"; import { Activity, Bell, Database, + type LucideIcon, Route, Server, ShieldCheck, User2, Users, - type LucideIcon, } from "lucide-react"; +import Link from "next/link"; import { buttonVariants } from "@/components/ui/button"; -import { useRouter } from "next/router"; import { cn } from "@/lib/utils"; import { api } from "@/utils/api"; +import { useRouter } from "next/router"; interface NavProps { links: { diff --git a/components/shared/alert-block.tsx b/components/shared/alert-block.tsx index b0fec201..0295ca8b 100644 --- a/components/shared/alert-block.tsx +++ b/components/shared/alert-block.tsx @@ -4,7 +4,7 @@ interface Props extends React.ComponentPropsWithoutRef<"div"> { } import { cn } from "@/lib/utils"; -import { AlertTriangle, AlertCircle, CheckCircle2, Info } from "lucide-react"; +import { AlertCircle, AlertTriangle, CheckCircle2, Info } from "lucide-react"; const iconMap = { info: { diff --git a/components/shared/code-editor.tsx b/components/shared/code-editor.tsx index 6db8e50e..b20ef60a 100644 --- a/components/shared/code-editor.tsx +++ b/components/shared/code-editor.tsx @@ -1,11 +1,11 @@ -import CodeMirror, { type ReactCodeMirrorProps } from "@uiw/react-codemirror"; -import { yaml } from "@codemirror/lang-yaml"; -import { json } from "@codemirror/lang-json"; -import { githubLight, githubDark } from "@uiw/codemirror-theme-github"; import { cn } from "@/lib/utils"; -import { useTheme } from "next-themes"; +import { json } from "@codemirror/lang-json"; +import { yaml } from "@codemirror/lang-yaml"; import { StreamLanguage } from "@codemirror/language"; import { properties } from "@codemirror/legacy-modes/mode/properties"; +import { githubDark, githubLight } from "@uiw/codemirror-theme-github"; +import CodeMirror, { type ReactCodeMirrorProps } from "@uiw/react-codemirror"; +import { useTheme } from "next-themes"; interface Props extends ReactCodeMirrorProps { wrapperClassName?: string; disabled?: boolean; diff --git a/components/shared/status-tooltip.tsx b/components/shared/status-tooltip.tsx index e330affe..d5e9fcf1 100644 --- a/components/shared/status-tooltip.tsx +++ b/components/shared/status-tooltip.tsx @@ -17,7 +17,12 @@ export const StatusTooltip = ({ status, className }: Props) => { {status === "idle" && ( -
+
)} {status === "error" && (
{ const [isPasswordVisible, setIsPasswordVisible] = useState(false); diff --git a/components/support/show-support.tsx b/components/support/show-support.tsx index 8d6ab546..b43a1444 100644 --- a/components/support/show-support.tsx +++ b/components/support/show-support.tsx @@ -1,3 +1,4 @@ +import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, @@ -7,7 +8,6 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; -import { Button } from "@/components/ui/button"; import { HeartIcon } from "lucide-react"; export const ShowSupport = () => { diff --git a/components/ui/accordion.tsx b/components/ui/accordion.tsx index e6a723d0..45a31819 100644 --- a/components/ui/accordion.tsx +++ b/components/ui/accordion.tsx @@ -1,56 +1,56 @@ -import * as React from "react" -import * as AccordionPrimitive from "@radix-ui/react-accordion" -import { ChevronDown } from "lucide-react" +import * as AccordionPrimitive from "@radix-ui/react-accordion"; +import { ChevronDown } from "lucide-react"; +import * as React from "react"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; -const Accordion = AccordionPrimitive.Root +const Accordion = AccordionPrimitive.Root; const AccordionItem = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - -)) -AccordionItem.displayName = "AccordionItem" + +)); +AccordionItem.displayName = "AccordionItem"; const AccordionTrigger = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, children, ...props }, ref) => ( - - svg]:rotate-180", - className - )} - {...props} - > - {children} - - - -)) -AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName + + svg]:rotate-180", + className, + )} + {...props} + > + {children} + + + +)); +AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName; const AccordionContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, children, ...props }, ref) => ( - -
{children}
-
-)) + +
{children}
+
+)); -AccordionContent.displayName = AccordionPrimitive.Content.displayName +AccordionContent.displayName = AccordionPrimitive.Content.displayName; -export { Accordion, AccordionItem, AccordionTrigger, AccordionContent } +export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }; diff --git a/components/ui/alert-dialog.tsx b/components/ui/alert-dialog.tsx index 23500146..37147141 100644 --- a/components/ui/alert-dialog.tsx +++ b/components/ui/alert-dialog.tsx @@ -1,8 +1,8 @@ -import * as React from "react"; import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"; +import * as React from "react"; -import { cn } from "@/lib/utils"; import { buttonVariants } from "@/components/ui/button"; +import { cn } from "@/lib/utils"; const AlertDialog = AlertDialogPrimitive.Root; @@ -11,129 +11,129 @@ const AlertDialogTrigger = AlertDialogPrimitive.Trigger; const AlertDialogPortal = AlertDialogPrimitive.Portal; const AlertDialogOverlay = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )); AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName; const AlertDialogContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - - - - + + + + )); AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName; const AlertDialogHeader = ({ - className, - ...props + className, + ...props }: React.HTMLAttributes) => ( -
+
); AlertDialogHeader.displayName = "AlertDialogHeader"; const AlertDialogFooter = ({ - className, - ...props + className, + ...props }: React.HTMLAttributes) => ( -
+
); AlertDialogFooter.displayName = "AlertDialogFooter"; const AlertDialogTitle = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )); AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName; const AlertDialogDescription = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )); AlertDialogDescription.displayName = - AlertDialogPrimitive.Description.displayName; + AlertDialogPrimitive.Description.displayName; const AlertDialogAction = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )); AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName; const AlertDialogCancel = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )); AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName; export { - AlertDialog, - AlertDialogPortal, - AlertDialogOverlay, - AlertDialogTrigger, - AlertDialogContent, - AlertDialogHeader, - AlertDialogFooter, - AlertDialogTitle, - AlertDialogDescription, - AlertDialogAction, - AlertDialogCancel, + AlertDialog, + AlertDialogPortal, + AlertDialogOverlay, + AlertDialogTrigger, + AlertDialogContent, + AlertDialogHeader, + AlertDialogFooter, + AlertDialogTitle, + AlertDialogDescription, + AlertDialogAction, + AlertDialogCancel, }; diff --git a/components/ui/alert.tsx b/components/ui/alert.tsx index 41fa7e05..a9a84afd 100644 --- a/components/ui/alert.tsx +++ b/components/ui/alert.tsx @@ -1,59 +1,59 @@ -import * as React from "react" -import { cva, type VariantProps } from "class-variance-authority" +import { type VariantProps, cva } from "class-variance-authority"; +import * as React from "react"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const alertVariants = cva( - "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground", - { - variants: { - variant: { - default: "bg-background text-foreground", - destructive: - "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive", - }, - }, - defaultVariants: { - variant: "default", - }, - } -) + "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground", + { + variants: { + variant: { + default: "bg-background text-foreground", + destructive: + "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive", + }, + }, + defaultVariants: { + variant: "default", + }, + }, +); const Alert = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes & VariantProps + HTMLDivElement, + React.HTMLAttributes & VariantProps >(({ className, variant, ...props }, ref) => ( -
-)) -Alert.displayName = "Alert" +
+)); +Alert.displayName = "Alert"; const AlertTitle = React.forwardRef< - HTMLParagraphElement, - React.HTMLAttributes + HTMLParagraphElement, + React.HTMLAttributes >(({ className, ...props }, ref) => ( -
-)) -AlertTitle.displayName = "AlertTitle" +
+)); +AlertTitle.displayName = "AlertTitle"; const AlertDescription = React.forwardRef< - HTMLParagraphElement, - React.HTMLAttributes + HTMLParagraphElement, + React.HTMLAttributes >(({ className, ...props }, ref) => ( -
-)) -AlertDescription.displayName = "AlertDescription" +
+)); +AlertDescription.displayName = "AlertDescription"; -export { Alert, AlertTitle, AlertDescription } +export { Alert, AlertTitle, AlertDescription }; diff --git a/components/ui/avatar.tsx b/components/ui/avatar.tsx index 444b1dba..13b276cd 100644 --- a/components/ui/avatar.tsx +++ b/components/ui/avatar.tsx @@ -1,47 +1,47 @@ -import * as React from "react"; import * as AvatarPrimitive from "@radix-ui/react-avatar"; +import * as React from "react"; import { cn } from "@/lib/utils"; const Avatar = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )); Avatar.displayName = AvatarPrimitive.Root.displayName; const AvatarImage = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )); AvatarImage.displayName = AvatarPrimitive.Image.displayName; const AvatarFallback = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )); AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName; diff --git a/components/ui/badge.tsx b/components/ui/badge.tsx index d3d5d604..f38976c0 100644 --- a/components/ui/badge.tsx +++ b/components/ui/badge.tsx @@ -1,36 +1,36 @@ -import * as React from "react"; -import { cva, type VariantProps } from "class-variance-authority"; +import { type VariantProps, cva } from "class-variance-authority"; +import type * as React from "react"; import { cn } from "@/lib/utils"; const badgeVariants = cva( - "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", - { - variants: { - variant: { - default: - "border-transparent bg-primary text-primary-foreground hover:bg-primary/80", - secondary: - "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80", - destructive: - "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80", - outline: "text-foreground", - }, - }, - defaultVariants: { - variant: "default", - }, - }, + "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", + { + variants: { + variant: { + default: + "border-transparent bg-primary text-primary-foreground hover:bg-primary/80", + secondary: + "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80", + destructive: + "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80", + outline: "text-foreground", + }, + }, + defaultVariants: { + variant: "default", + }, + }, ); export interface BadgeProps - extends React.HTMLAttributes, - VariantProps {} + extends React.HTMLAttributes, + VariantProps {} function Badge({ className, variant, ...props }: BadgeProps) { - return ( -
- ); + return ( +
+ ); } export { Badge, badgeVariants }; diff --git a/components/ui/breadcrumb.tsx b/components/ui/breadcrumb.tsx index 459bd87f..92288ab9 100644 --- a/components/ui/breadcrumb.tsx +++ b/components/ui/breadcrumb.tsx @@ -1,153 +1,153 @@ -import * as React from "react"; import { ChevronRight } from "lucide-react"; +import * as React from "react"; import { cn } from "@/lib/utils"; export function getValidChildren(children: React.ReactNode) { - return React.Children.toArray(children).filter((child) => - React.isValidElement(child), - ) as React.ReactElement[]; + return React.Children.toArray(children).filter((child) => + React.isValidElement(child), + ) as React.ReactElement[]; } export interface BreadcrumbProps extends React.ComponentPropsWithoutRef<"nav"> { - /* The visual separator between each breadcrumb item */ - separator?: React.ReactNode; - /** - * If `true`, adds a separator between each breadcrumb item. - * @default true - */ - addSeparator?: boolean; + /* The visual separator between each breadcrumb item */ + separator?: React.ReactNode; + /** + * If `true`, adds a separator between each breadcrumb item. + * @default true + */ + addSeparator?: boolean; } export const Breadcrumb = React.forwardRef( - ( - { - children, - className, - separator = , - addSeparator = true, - ...props - }, - forwardedRef, - ) => { - const validChildren = getValidChildren(children); - const clones = validChildren.map((child, index) => { - return React.cloneElement(child, { - addSeparator, - separator, - isLastChild: validChildren.length === index + 1, - }); - }); + ( + { + children, + className, + separator = , + addSeparator = true, + ...props + }, + forwardedRef, + ) => { + const validChildren = getValidChildren(children); + const clones = validChildren.map((child, index) => { + return React.cloneElement(child, { + addSeparator, + separator, + isLastChild: validChildren.length === index + 1, + }); + }); - return ( - - ); - }, + return ( + + ); + }, ); Breadcrumb.displayName = "Breadcrumb"; export interface BreadcrumbItemProps extends BreadcrumbProps { - /** - * If `true`, indicates that the breadcrumb item is active, adds - * `aria-current=page` and renders a `span` - */ - isCurrentPage?: boolean; - isLastChild?: boolean; + /** + * If `true`, indicates that the breadcrumb item is active, adds + * `aria-current=page` and renders a `span` + */ + isCurrentPage?: boolean; + isLastChild?: boolean; } export const BreadcrumbItem = React.forwardRef< - HTMLLIElement, - BreadcrumbItemProps + HTMLLIElement, + BreadcrumbItemProps >( - ( - { - children, - className, - isCurrentPage, - isLastChild, - separator, - addSeparator, - ...props - }, - forwardedRef, - ) => { - const validChildren = getValidChildren(children); - const clones = validChildren.map((child) => { - if (child.type === BreadcrumbLink) { - return React.cloneElement(child, { isCurrentPage }); - } + ( + { + children, + className, + isCurrentPage, + isLastChild, + separator, + addSeparator, + ...props + }, + forwardedRef, + ) => { + const validChildren = getValidChildren(children); + const clones = validChildren.map((child) => { + if (child.type === BreadcrumbLink) { + return React.cloneElement(child, { isCurrentPage }); + } - if (child.type === BreadcrumbSeparator) { - return React.cloneElement(child, { - children: separator || child.props.children, - }); - } + if (child.type === BreadcrumbSeparator) { + return React.cloneElement(child, { + children: separator || child.props.children, + }); + } - return child; - }); + return child; + }); - return ( -
  • - {clones} - {!isLastChild && addSeparator && ( - {separator} - )} -
  • - ); - }, + return ( +
  • + {clones} + {!isLastChild && addSeparator && ( + {separator} + )} +
  • + ); + }, ); BreadcrumbItem.displayName = "BreadcrumbItem"; export interface BreadcrumbLinkProps - extends React.ComponentPropsWithoutRef<"a">, - Pick { - as?: React.ElementType; + extends React.ComponentPropsWithoutRef<"a">, + Pick { + as?: React.ElementType; } export const BreadcrumbLink = React.forwardRef< - HTMLAnchorElement, - BreadcrumbLinkProps + HTMLAnchorElement, + BreadcrumbLinkProps >(({ className, as: asComp, isCurrentPage, ...props }, forwardedRef) => { - const Comp = (isCurrentPage ? "span" : asComp || "a") as "a"; + const Comp = (isCurrentPage ? "span" : asComp || "a") as "a"; - return ( - - ); + return ( + + ); }); BreadcrumbLink.displayName = "BreadcrumbLink"; export type BreadcrumbSeparatorProps = React.ComponentPropsWithoutRef<"span">; export const BreadcrumbSeparator = React.forwardRef< - HTMLSpanElement, - BreadcrumbSeparatorProps + HTMLSpanElement, + BreadcrumbSeparatorProps >(({ className, ...props }, forwardedRef) => { - return ( - - ); + return ( + + ); }); BreadcrumbSeparator.displayName = "BreadcrumbSeparator"; diff --git a/components/ui/button.tsx b/components/ui/button.tsx index f4a456ef..d0a65f6f 100644 --- a/components/ui/button.tsx +++ b/components/ui/button.tsx @@ -1,78 +1,78 @@ -import * as React from "react"; import { Slot } from "@radix-ui/react-slot"; -import { cva, type VariantProps } from "class-variance-authority"; +import { type VariantProps, cva } from "class-variance-authority"; +import * as React from "react"; -import { Loader2 } from "lucide-react"; import { cn } from "@/lib/utils"; +import { Loader2 } from "lucide-react"; const buttonVariants = cva( - "inline-flex items-center justify-center whitespace-nowrap select-none rounded-lg transition-all will-change-transform active:hover:scale-[0.98] active:hover:transform text-sm font-medium ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", - { - variants: { - variant: { - default: "bg-primary text-primary-foreground hover:bg-primary/90", - destructive: - "bg-destructive text-destructive-foreground hover:bg-destructive/90", - outline: - "border border-input bg-background hover:bg-accent hover:text-accent-foreground", - secondary: - "bg-secondary text-secondary-foreground hover:bg-secondary/80", - ghost: "hover:bg-accent hover:text-accent-foreground", - link: "text-primary underline-offset-4 hover:underline", - }, - size: { - default: "h-10 px-4 py-2", - sm: "h-9 rounded-md px-3", - lg: "h-11 rounded-md px-8", - icon: "h-10 w-10", - }, - }, - defaultVariants: { - variant: "default", - size: "default", - }, - }, + "inline-flex items-center justify-center whitespace-nowrap select-none rounded-lg transition-all will-change-transform active:hover:scale-[0.98] active:hover:transform text-sm font-medium ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", + { + variants: { + variant: { + default: "bg-primary text-primary-foreground hover:bg-primary/90", + destructive: + "bg-destructive text-destructive-foreground hover:bg-destructive/90", + outline: + "border border-input bg-background hover:bg-accent hover:text-accent-foreground", + secondary: + "bg-secondary text-secondary-foreground hover:bg-secondary/80", + ghost: "hover:bg-accent hover:text-accent-foreground", + link: "text-primary underline-offset-4 hover:underline", + }, + size: { + default: "h-10 px-4 py-2", + sm: "h-9 rounded-md px-3", + lg: "h-11 rounded-md px-8", + icon: "h-10 w-10", + }, + }, + defaultVariants: { + variant: "default", + size: "default", + }, + }, ); export interface ButtonProps - extends React.ButtonHTMLAttributes, - VariantProps { - asChild?: boolean; - isLoading?: boolean; - children?: React.ReactNode; + extends React.ButtonHTMLAttributes, + VariantProps { + asChild?: boolean; + isLoading?: boolean; + children?: React.ReactNode; } const Button = React.forwardRef( - ( - { - className, - variant, - size, - children, - isLoading = false, - asChild = false, - ...props - }, - ref, - ) => { - const Comp = asChild ? Slot : "button"; - return ( - <> - - {isLoading && } - {children} - - - ); - }, + ( + { + className, + variant, + size, + children, + isLoading = false, + asChild = false, + ...props + }, + ref, + ) => { + const Comp = asChild ? Slot : "button"; + return ( + <> + + {isLoading && } + {children} + + + ); + }, ); Button.displayName = "Button"; diff --git a/components/ui/card.tsx b/components/ui/card.tsx index dc3b01de..9ebb4023 100644 --- a/components/ui/card.tsx +++ b/components/ui/card.tsx @@ -3,84 +3,84 @@ import * as React from "react"; import { cn } from "@/lib/utils"; const Card = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes + HTMLDivElement, + React.HTMLAttributes >(({ className, ...props }, ref) => ( -
    +
    )); Card.displayName = "Card"; const CardHeader = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes + HTMLDivElement, + React.HTMLAttributes >(({ className, ...props }, ref) => ( -
    +
    )); CardHeader.displayName = "CardHeader"; const CardTitle = React.forwardRef< - HTMLParagraphElement, - React.HTMLAttributes + HTMLParagraphElement, + React.HTMLAttributes >(({ className, ...props }, ref) => ( -

    +

    )); CardTitle.displayName = "CardTitle"; const CardDescription = React.forwardRef< - HTMLParagraphElement, - React.HTMLAttributes + HTMLParagraphElement, + React.HTMLAttributes >(({ className, ...props }, ref) => ( -

    +

    )); CardDescription.displayName = "CardDescription"; const CardContent = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes + HTMLDivElement, + React.HTMLAttributes >(({ className, ...props }, ref) => ( -

    +
    )); CardContent.displayName = "CardContent"; const CardFooter = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes + HTMLDivElement, + React.HTMLAttributes >(({ className, ...props }, ref) => ( -
    +
    )); CardFooter.displayName = "CardFooter"; export { - Card, - CardHeader, - CardFooter, - CardTitle, - CardDescription, - CardContent, + Card, + CardHeader, + CardFooter, + CardTitle, + CardDescription, + CardContent, }; diff --git a/components/ui/checkbox.tsx b/components/ui/checkbox.tsx index 58d17681..54cdffe7 100644 --- a/components/ui/checkbox.tsx +++ b/components/ui/checkbox.tsx @@ -1,27 +1,27 @@ -import * as React from "react"; import * as CheckboxPrimitive from "@radix-ui/react-checkbox"; import { Check } from "lucide-react"; +import * as React from "react"; import { cn } from "@/lib/utils"; const Checkbox = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - - - - - + + + + + )); Checkbox.displayName = CheckboxPrimitive.Root.displayName; diff --git a/components/ui/command.tsx b/components/ui/command.tsx index c3581a30..ffaff868 100644 --- a/components/ui/command.tsx +++ b/components/ui/command.tsx @@ -1,153 +1,153 @@ -import * as React from "react"; -import { type DialogProps } from "@radix-ui/react-dialog"; +import type { DialogProps } from "@radix-ui/react-dialog"; import { Command as CommandPrimitive } from "cmdk"; import { Search } from "lucide-react"; +import * as React from "react"; -import { cn } from "@/lib/utils"; import { Dialog, DialogContent } from "@/components/ui/dialog"; +import { cn } from "@/lib/utils"; const Command = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )); Command.displayName = CommandPrimitive.displayName; interface CommandDialogProps extends DialogProps {} const CommandDialog = ({ children, ...props }: CommandDialogProps) => { - return ( - - - - {children} - - - - ); + return ( + + + + {children} + + + + ); }; const CommandInput = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( -
    - - -
    +
    + + +
    )); CommandInput.displayName = CommandPrimitive.Input.displayName; const CommandList = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )); CommandList.displayName = CommandPrimitive.List.displayName; const CommandEmpty = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >((props, ref) => ( - + )); CommandEmpty.displayName = CommandPrimitive.Empty.displayName; const CommandGroup = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )); CommandGroup.displayName = CommandPrimitive.Group.displayName; const CommandSeparator = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )); CommandSeparator.displayName = CommandPrimitive.Separator.displayName; const CommandItem = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )); CommandItem.displayName = CommandPrimitive.Item.displayName; const CommandShortcut = ({ - className, - ...props + className, + ...props }: React.HTMLAttributes) => { - return ( - - ); + return ( + + ); }; CommandShortcut.displayName = "CommandShortcut"; export { - Command, - CommandDialog, - CommandInput, - CommandList, - CommandEmpty, - CommandGroup, - CommandItem, - CommandShortcut, - CommandSeparator, + Command, + CommandDialog, + CommandInput, + CommandList, + CommandEmpty, + CommandGroup, + CommandItem, + CommandShortcut, + CommandSeparator, }; diff --git a/components/ui/dialog.tsx b/components/ui/dialog.tsx index 3c9ec741..37e8f685 100644 --- a/components/ui/dialog.tsx +++ b/components/ui/dialog.tsx @@ -1,6 +1,6 @@ -import * as React from "react"; import * as DialogPrimitive from "@radix-ui/react-dialog"; import { X } from "lucide-react"; +import * as React from "react"; import { cn } from "@/lib/utils"; @@ -13,110 +13,108 @@ const DialogPortal = DialogPrimitive.Portal; const DialogClose = DialogPrimitive.Close; const DialogOverlay = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )); DialogOverlay.displayName = DialogPrimitive.Overlay.displayName; const DialogContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, children, ...props }, ref) => ( - - - -
    - {children} -
    - - - Close - -
    -
    + + + +
    {children}
    + + + Close + +
    +
    )); DialogContent.displayName = DialogPrimitive.Content.displayName; const DialogHeader = ({ - className, - ...props + className, + ...props }: React.HTMLAttributes) => ( -
    +
    ); DialogHeader.displayName = "DialogHeader"; const DialogFooter = ({ - className, - ...props + className, + ...props }: React.HTMLAttributes) => ( -
    +
    ); DialogFooter.displayName = "DialogFooter"; const DialogTitle = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )); DialogTitle.displayName = DialogPrimitive.Title.displayName; const DialogDescription = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )); DialogDescription.displayName = DialogPrimitive.Description.displayName; export { - Dialog, - DialogPortal, - DialogOverlay, - DialogClose, - DialogTrigger, - DialogContent, - DialogHeader, - DialogFooter, - DialogTitle, - DialogDescription, + Dialog, + DialogPortal, + DialogOverlay, + DialogClose, + DialogTrigger, + DialogContent, + DialogHeader, + DialogFooter, + DialogTitle, + DialogDescription, }; diff --git a/components/ui/dropdown-menu.tsx b/components/ui/dropdown-menu.tsx index 9af40e19..f71d5cb3 100644 --- a/components/ui/dropdown-menu.tsx +++ b/components/ui/dropdown-menu.tsx @@ -1,6 +1,6 @@ -import * as React from "react"; import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"; import { Check, ChevronRight, Circle } from "lucide-react"; +import * as React from "react"; import { cn } from "@/lib/utils"; @@ -17,182 +17,182 @@ const DropdownMenuSub = DropdownMenuPrimitive.Sub; const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup; const DropdownMenuSubTrigger = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef & { - inset?: boolean; - } + React.ElementRef, + React.ComponentPropsWithoutRef & { + inset?: boolean; + } >(({ className, inset, children, ...props }, ref) => ( - - {children} - - + + {children} + + )); DropdownMenuSubTrigger.displayName = - DropdownMenuPrimitive.SubTrigger.displayName; + DropdownMenuPrimitive.SubTrigger.displayName; const DropdownMenuSubContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )); DropdownMenuSubContent.displayName = - DropdownMenuPrimitive.SubContent.displayName; + DropdownMenuPrimitive.SubContent.displayName; const DropdownMenuContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, sideOffset = 4, ...props }, ref) => ( - - - + + + )); DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName; const DropdownMenuItem = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef & { - inset?: boolean; - } + React.ElementRef, + React.ComponentPropsWithoutRef & { + inset?: boolean; + } >(({ className, inset, ...props }, ref) => ( - + )); DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName; const DropdownMenuCheckboxItem = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, children, checked, ...props }, ref) => ( - - - - - - - {children} - + + + + + + + {children} + )); DropdownMenuCheckboxItem.displayName = - DropdownMenuPrimitive.CheckboxItem.displayName; + DropdownMenuPrimitive.CheckboxItem.displayName; const DropdownMenuRadioItem = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, children, ...props }, ref) => ( - - - - - - - {children} - + + + + + + + {children} + )); DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName; const DropdownMenuLabel = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef & { - inset?: boolean; - } + React.ElementRef, + React.ComponentPropsWithoutRef & { + inset?: boolean; + } >(({ className, inset, ...props }, ref) => ( - + )); DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName; const DropdownMenuSeparator = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )); DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName; const DropdownMenuShortcut = ({ - className, - ...props + className, + ...props }: React.HTMLAttributes) => { - return ( - - ); + return ( + + ); }; DropdownMenuShortcut.displayName = "DropdownMenuShortcut"; export { - DropdownMenu, - DropdownMenuTrigger, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuCheckboxItem, - DropdownMenuRadioItem, - DropdownMenuLabel, - DropdownMenuSeparator, - DropdownMenuShortcut, - DropdownMenuGroup, - DropdownMenuPortal, - DropdownMenuSub, - DropdownMenuSubContent, - DropdownMenuSubTrigger, - DropdownMenuRadioGroup, + DropdownMenu, + DropdownMenuTrigger, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuCheckboxItem, + DropdownMenuRadioItem, + DropdownMenuLabel, + DropdownMenuSeparator, + DropdownMenuShortcut, + DropdownMenuGroup, + DropdownMenuPortal, + DropdownMenuSub, + DropdownMenuSubContent, + DropdownMenuSubTrigger, + DropdownMenuRadioGroup, }; diff --git a/components/ui/file-tree.tsx b/components/ui/file-tree.tsx index 02e7ebec..a72ba8cd 100644 --- a/components/ui/file-tree.tsx +++ b/components/ui/file-tree.tsx @@ -1,13 +1,13 @@ "use client"; -import React from "react"; +import { cn } from "@/lib/utils"; import * as AccordionPrimitive from "@radix-ui/react-accordion"; // import { ScrollArea } from "@acme/components/ui/scroll-area"; // import { cn } from "@acme/components/lib/utils"; import { ChevronRight, type LucideIcon } from "lucide-react"; +import React from "react"; import useResizeObserver from "use-resize-observer"; import { ScrollArea } from "./scroll-area"; -import { cn } from "@/lib/utils"; interface TreeDataItem { id: string; @@ -164,7 +164,9 @@ const TreeItem = React.forwardRef( aria-hidden="true" /> )} - {item.name} + + {item.name} + {item.children.length === 0 && ( diff --git a/components/ui/form.tsx b/components/ui/form.tsx index bc3072b4..842f1c31 100644 --- a/components/ui/form.tsx +++ b/components/ui/form.tsx @@ -1,6 +1,6 @@ -import * as React from "react"; import type * as LabelPrimitive from "@radix-ui/react-label"; import { Slot } from "@radix-ui/react-slot"; +import * as React from "react"; import { Controller, type ControllerProps, @@ -10,8 +10,8 @@ import { useFormContext, } from "react-hook-form"; -import { cn } from "@/lib/utils"; import { Label } from "@/components/ui/label"; +import { cn } from "@/lib/utils"; const Form = FormProvider; diff --git a/components/ui/input-otp.tsx b/components/ui/input-otp.tsx index 5c62edd2..665a6a4f 100644 --- a/components/ui/input-otp.tsx +++ b/components/ui/input-otp.tsx @@ -1,6 +1,6 @@ -import * as React from "react"; import { OTPInput, OTPInputContext } from "input-otp"; import { Dot } from "lucide-react"; +import * as React from "react"; import { cn } from "@/lib/utils"; diff --git a/components/ui/input.tsx b/components/ui/input.tsx index d865f67a..55b46e6d 100644 --- a/components/ui/input.tsx +++ b/components/ui/input.tsx @@ -2,32 +2,32 @@ import { cn } from "@/lib/utils"; import * as React from "react"; export interface InputProps - extends React.InputHTMLAttributes { - errorMessage?: string; + extends React.InputHTMLAttributes { + errorMessage?: string; } const Input = React.forwardRef( - ({ className, errorMessage, type, ...props }, ref) => { - return ( - <> - - {errorMessage && ( - - {errorMessage} - - )} - - ); - }, + ({ className, errorMessage, type, ...props }, ref) => { + return ( + <> + + {errorMessage && ( + + {errorMessage} + + )} + + ); + }, ); Input.displayName = "Input"; diff --git a/components/ui/label.tsx b/components/ui/label.tsx index 44912aff..6e126e94 100644 --- a/components/ui/label.tsx +++ b/components/ui/label.tsx @@ -1,23 +1,23 @@ -import * as React from "react"; import * as LabelPrimitive from "@radix-ui/react-label"; -import { cva, type VariantProps } from "class-variance-authority"; +import { type VariantProps, cva } from "class-variance-authority"; +import * as React from "react"; import { cn } from "@/lib/utils"; const labelVariants = cva( - "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", + "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", ); const Label = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef & - VariantProps + React.ElementRef, + React.ComponentPropsWithoutRef & + VariantProps >(({ className, ...props }, ref) => ( - + )); Label.displayName = LabelPrimitive.Root.displayName; diff --git a/components/ui/popover.tsx b/components/ui/popover.tsx index 59dd5252..b4dac1f3 100644 --- a/components/ui/popover.tsx +++ b/components/ui/popover.tsx @@ -1,5 +1,5 @@ -import * as React from "react"; import * as PopoverPrimitive from "@radix-ui/react-popover"; +import * as React from "react"; import { cn } from "@/lib/utils"; @@ -8,21 +8,21 @@ const Popover = PopoverPrimitive.Root; const PopoverTrigger = PopoverPrimitive.Trigger; const PopoverContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, align = "center", sideOffset = 4, ...props }, ref) => ( - - - + + + )); PopoverContent.displayName = PopoverPrimitive.Content.displayName; diff --git a/components/ui/progress.tsx b/components/ui/progress.tsx index 105fb650..1010596f 100644 --- a/components/ui/progress.tsx +++ b/components/ui/progress.tsx @@ -1,26 +1,26 @@ -import * as React from "react" -import * as ProgressPrimitive from "@radix-ui/react-progress" +import * as ProgressPrimitive from "@radix-ui/react-progress"; +import * as React from "react"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const Progress = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, value, ...props }, ref) => ( - - - -)) -Progress.displayName = ProgressPrimitive.Root.displayName + + + +)); +Progress.displayName = ProgressPrimitive.Root.displayName; -export { Progress } +export { Progress }; diff --git a/components/ui/radio-group.tsx b/components/ui/radio-group.tsx index e4113050..4e8d82f1 100644 --- a/components/ui/radio-group.tsx +++ b/components/ui/radio-group.tsx @@ -1,41 +1,41 @@ -import * as React from "react"; import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"; import { Circle } from "lucide-react"; +import * as React from "react"; import { cn } from "@/lib/utils"; const RadioGroup = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => { - return ( - - ); + return ( + + ); }); RadioGroup.displayName = RadioGroupPrimitive.Root.displayName; const RadioGroupItem = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => { - return ( - - - - - - ); + return ( + + + + + + ); }); RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName; diff --git a/components/ui/scroll-area.tsx b/components/ui/scroll-area.tsx index e8b03cb0..5711db96 100644 --- a/components/ui/scroll-area.tsx +++ b/components/ui/scroll-area.tsx @@ -1,5 +1,5 @@ -import * as React from "react"; import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"; +import * as React from "react"; import { cn } from "@/lib/utils"; diff --git a/components/ui/select.tsx b/components/ui/select.tsx index ee801408..e9e5b35b 100644 --- a/components/ui/select.tsx +++ b/components/ui/select.tsx @@ -1,6 +1,6 @@ -import * as React from "react"; import * as SelectPrimitive from "@radix-ui/react-select"; import { Check, ChevronDown, ChevronUp } from "lucide-react"; +import * as React from "react"; import { cn } from "@/lib/utils"; @@ -11,148 +11,148 @@ const SelectGroup = SelectPrimitive.Group; const SelectValue = SelectPrimitive.Value; const SelectTrigger = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, children, ...props }, ref) => ( - span]:line-clamp-1", - className, - )} - {...props} - > - {children} - - - - + span]:line-clamp-1", + className, + )} + {...props} + > + {children} + + + + )); SelectTrigger.displayName = SelectPrimitive.Trigger.displayName; const SelectScrollUpButton = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - - - + + + )); SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName; const SelectScrollDownButton = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - - - + + + )); SelectScrollDownButton.displayName = - SelectPrimitive.ScrollDownButton.displayName; + SelectPrimitive.ScrollDownButton.displayName; const SelectContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, children, position = "popper", ...props }, ref) => ( - - - - - {children} - - - - + + + + + {children} + + + + )); SelectContent.displayName = SelectPrimitive.Content.displayName; const SelectLabel = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )); SelectLabel.displayName = SelectPrimitive.Label.displayName; const SelectItem = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, children, ...props }, ref) => ( - - - - - - + + + + + + - {children} - + {children} + )); SelectItem.displayName = SelectPrimitive.Item.displayName; const SelectSeparator = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )); SelectSeparator.displayName = SelectPrimitive.Separator.displayName; export { - Select, - SelectGroup, - SelectValue, - SelectTrigger, - SelectContent, - SelectLabel, - SelectItem, - SelectSeparator, - SelectScrollUpButton, - SelectScrollDownButton, + Select, + SelectGroup, + SelectValue, + SelectTrigger, + SelectContent, + SelectLabel, + SelectItem, + SelectSeparator, + SelectScrollUpButton, + SelectScrollDownButton, }; diff --git a/components/ui/separator.tsx b/components/ui/separator.tsx index 4407ae5f..a84ec004 100644 --- a/components/ui/separator.tsx +++ b/components/ui/separator.tsx @@ -1,28 +1,28 @@ -import * as React from "react"; import * as SeparatorPrimitive from "@radix-ui/react-separator"; +import * as React from "react"; import { cn } from "@/lib/utils"; const Separator = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >( - ( - { className, orientation = "horizontal", decorative = true, ...props }, - ref, - ) => ( - - ), + ( + { className, orientation = "horizontal", decorative = true, ...props }, + ref, + ) => ( + + ), ); Separator.displayName = SeparatorPrimitive.Root.displayName; diff --git a/components/ui/sheet.tsx b/components/ui/sheet.tsx index 774f5ea3..7ee0bada 100644 --- a/components/ui/sheet.tsx +++ b/components/ui/sheet.tsx @@ -1,7 +1,7 @@ -import * as React from "react"; import * as SheetPrimitive from "@radix-ui/react-dialog"; -import { cva, type VariantProps } from "class-variance-authority"; +import { type VariantProps, cva } from "class-variance-authority"; import { X } from "lucide-react"; +import * as React from "react"; import { cn } from "@/lib/utils"; @@ -14,125 +14,125 @@ const SheetClose = SheetPrimitive.Close; const SheetPortal = SheetPrimitive.Portal; const SheetOverlay = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )); SheetOverlay.displayName = SheetPrimitive.Overlay.displayName; const sheetVariants = cva( - "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500", - { - variants: { - side: { - top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top", - bottom: - "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom", - left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm", - right: - "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm", - }, - }, - defaultVariants: { - side: "right", - }, - }, + "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500", + { + variants: { + side: { + top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top", + bottom: + "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom", + left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm", + right: + "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm", + }, + }, + defaultVariants: { + side: "right", + }, + }, ); interface SheetContentProps - extends React.ComponentPropsWithoutRef, - VariantProps {} + extends React.ComponentPropsWithoutRef, + VariantProps {} const SheetContent = React.forwardRef< - React.ElementRef, - SheetContentProps + React.ElementRef, + SheetContentProps >(({ side = "right", className, children, ...props }, ref) => ( - - - - {children} - - - Close - - - + + + + {children} + + + Close + + + )); SheetContent.displayName = SheetPrimitive.Content.displayName; const SheetHeader = ({ - className, - ...props + className, + ...props }: React.HTMLAttributes) => ( -
    +
    ); SheetHeader.displayName = "SheetHeader"; const SheetFooter = ({ - className, - ...props + className, + ...props }: React.HTMLAttributes) => ( -
    +
    ); SheetFooter.displayName = "SheetFooter"; const SheetTitle = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )); SheetTitle.displayName = SheetPrimitive.Title.displayName; const SheetDescription = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - + )); SheetDescription.displayName = SheetPrimitive.Description.displayName; export { - Sheet, - SheetPortal, - SheetOverlay, - SheetTrigger, - SheetClose, - SheetContent, - SheetHeader, - SheetFooter, - SheetTitle, - SheetDescription, + Sheet, + SheetPortal, + SheetOverlay, + SheetTrigger, + SheetClose, + SheetContent, + SheetHeader, + SheetFooter, + SheetTitle, + SheetDescription, }; diff --git a/components/ui/sonner.tsx b/components/ui/sonner.tsx index b3000f0b..852502e1 100644 --- a/components/ui/sonner.tsx +++ b/components/ui/sonner.tsx @@ -4,25 +4,25 @@ import { Toaster as Sonner } from "sonner"; type ToasterProps = React.ComponentProps; const Toaster = ({ ...props }: ToasterProps) => { - const { theme = "system" } = useTheme(); - return ( - - ); + const { theme = "system" } = useTheme(); + return ( + + ); }; export { Toaster }; diff --git a/components/ui/switch.tsx b/components/ui/switch.tsx index 6be019d8..96809024 100644 --- a/components/ui/switch.tsx +++ b/components/ui/switch.tsx @@ -1,26 +1,26 @@ -import * as React from "react"; import * as SwitchPrimitives from "@radix-ui/react-switch"; +import * as React from "react"; import { cn } from "@/lib/utils"; const Switch = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - - - + + + )); Switch.displayName = SwitchPrimitives.Root.displayName; diff --git a/components/ui/table.tsx b/components/ui/table.tsx index 73cf6b4a..8f0f4089 100644 --- a/components/ui/table.tsx +++ b/components/ui/table.tsx @@ -3,115 +3,115 @@ import * as React from "react"; import { cn } from "@/lib/utils"; const Table = React.forwardRef< - HTMLTableElement, - React.HTMLAttributes + HTMLTableElement, + React.HTMLAttributes >(({ className, ...props }, ref) => ( -
    - - +
    +
    + )); Table.displayName = "Table"; const TableHeader = React.forwardRef< - HTMLTableSectionElement, - React.HTMLAttributes + HTMLTableSectionElement, + React.HTMLAttributes >(({ className, ...props }, ref) => ( - + )); TableHeader.displayName = "TableHeader"; const TableBody = React.forwardRef< - HTMLTableSectionElement, - React.HTMLAttributes + HTMLTableSectionElement, + React.HTMLAttributes >(({ className, ...props }, ref) => ( - + )); TableBody.displayName = "TableBody"; const TableFooter = React.forwardRef< - HTMLTableSectionElement, - React.HTMLAttributes + HTMLTableSectionElement, + React.HTMLAttributes >(({ className, ...props }, ref) => ( - tr]:last:border-b-0", - className, - )} - {...props} - /> + tr]:last:border-b-0", + className, + )} + {...props} + /> )); TableFooter.displayName = "TableFooter"; const TableRow = React.forwardRef< - HTMLTableRowElement, - React.HTMLAttributes + HTMLTableRowElement, + React.HTMLAttributes >(({ className, ...props }, ref) => ( - + )); TableRow.displayName = "TableRow"; const TableHead = React.forwardRef< - HTMLTableCellElement, - React.ThHTMLAttributes + HTMLTableCellElement, + React.ThHTMLAttributes >(({ className, ...props }, ref) => ( -
    + )); TableHead.displayName = "TableHead"; const TableCell = React.forwardRef< - HTMLTableCellElement, - React.TdHTMLAttributes + HTMLTableCellElement, + React.TdHTMLAttributes >(({ className, ...props }, ref) => ( - + )); TableCell.displayName = "TableCell"; const TableCaption = React.forwardRef< - HTMLTableCaptionElement, - React.HTMLAttributes + HTMLTableCaptionElement, + React.HTMLAttributes >(({ className, ...props }, ref) => ( -
    + )); TableCaption.displayName = "TableCaption"; export { - Table, - TableHeader, - TableBody, - TableFooter, - TableHead, - TableRow, - TableCell, - TableCaption, + Table, + TableHeader, + TableBody, + TableFooter, + TableHead, + TableRow, + TableCell, + TableCaption, }; diff --git a/components/ui/tabs.tsx b/components/ui/tabs.tsx index 023b203d..e54c215a 100644 --- a/components/ui/tabs.tsx +++ b/components/ui/tabs.tsx @@ -1,5 +1,5 @@ -import * as React from "react"; import * as TabsPrimitive from "@radix-ui/react-tabs"; +import * as React from "react"; import { cn } from "@/lib/utils"; diff --git a/components/ui/textarea.tsx b/components/ui/textarea.tsx index e894f81e..5b434e4a 100644 --- a/components/ui/textarea.tsx +++ b/components/ui/textarea.tsx @@ -3,21 +3,21 @@ import * as React from "react"; import { cn } from "@/lib/utils"; export interface TextareaProps - extends React.TextareaHTMLAttributes {} + extends React.TextareaHTMLAttributes {} const Textarea = React.forwardRef( - ({ className, ...props }, ref) => { - return ( -