diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 97379020e..e405a0094 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,6 +1,6 @@ # These are supported funding model platforms -github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +github: [siumauricio] patreon: # open_collective: dokploy ko_fi: # Replace with a single Ko-fi username diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 364918135..81910e63b 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -1,59 +1,44 @@ name: Pull request + on: pull_request: - branches: - - main - - canary - - push: branches: - main - canary + +env: + HUSKY: 0 + 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 - with: - version: 8 + - name: Check out the code + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + - 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 - - build-and-push-docker-on-push: - if: github.event_name == 'push' - runs-on: ubuntu-latest - steps: - - name: Check out the code - uses: actions/checkout@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Prepare .env file - run: | - cp .env.production.example .env.production - - - 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 diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 000000000..1534e6d28 --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,35 @@ +name: Push + +on: + push: + branches: + - main + - canary + +env: + HUSKY: 0 + +jobs: + build-and-push-docker-on-push: + runs-on: ubuntu-latest + steps: + - name: Check out the code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Prepare .env file + run: | + cp .env.production.example .env.production + + - name: Build and push Docker image using custom script + run: | + chmod +x ./docker/push.sh + ./docker/push.sh ${{ github.ref_name == 'canary' && 'canary' || '' }} diff --git a/.husky/install.mjs b/.husky/install.mjs new file mode 100644 index 000000000..9b13ce1f9 --- /dev/null +++ b/.husky/install.mjs @@ -0,0 +1,6 @@ +// Skip Husky install in production and CI +if (process.env.NODE_ENV === "production" || process.env.CI === "true") { + process.exit(0); +} +const husky = (await import("husky")).default; +console.log(husky()); diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 000000000..cb2c84d5c --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +pnpm lint-staged diff --git a/Dockerfile b/Dockerfile index 6d3e58758..8075325cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,48 +1,65 @@ -# Etapa 1: Prepare image for building FROM node:18-slim AS base -# Install dependencies +# Disable husky +ENV HUSKY=0 + +# Set pnpm home ENV PNPM_HOME="/pnpm" ENV PATH="$PNPM_HOME:$PATH" -RUN corepack enable && apt-get update && apt-get install -y python3 make g++ git && rm -rf /var/lib/apt/lists/* +# Enable corepack +RUN corepack enable + +# Set workdir WORKDIR /app +FROM base AS base-deps +# Install dependencies only for production +RUN apt-get update && apt-get install -y python3 make g++ git && rm -rf /var/lib/apt/lists/* + +# Copy install script for husky +COPY .husky/install.mjs ./.husky/install.mjs + # Copy package.json and pnpm-lock.yaml COPY package.json pnpm-lock.yaml ./ +FROM base-deps AS prod-deps + +# Set production +ENV NODE_ENV=production + +# Install dependencies only for production +RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile + +FROM base-deps AS build + # Install dependencies only for building RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile # Copy the rest of the source code COPY . . -# Build the application -RUN pnpm run build +# Build the application +RUN pnpm build -# Stage 2: Prepare image for production -FROM node:18-slim AS production +FROM base AS production + +# Set production +ENV NODE_ENV=production # Install dependencies only for production -ENV PNPM_HOME="/pnpm" -ENV PATH="$PNPM_HOME:$PATH" -RUN corepack enable && apt-get update && apt-get install -y curl && apt-get install -y apache2-utils && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y curl apache2-utils && rm -rf /var/lib/apt/lists/* -WORKDIR /app - -# Copy the rest of the source code -COPY --from=base /app/.next ./.next -COPY --from=base /app/dist ./dist -COPY --from=base /app/next.config.mjs ./next.config.mjs -COPY --from=base /app/public ./public -COPY --from=base /app/package.json ./package.json -COPY --from=base /app/drizzle ./drizzle -COPY --from=base /app/.env.production ./.env -COPY --from=base /app/components.json ./components.json - -# Install dependencies only for production -COPY package.json pnpm-lock.yaml ./ -RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile +# Copy the rest of the source code +COPY --from=build /app/.next ./.next +COPY --from=build /app/dist ./dist +COPY --from=build /app/next.config.mjs ./next.config.mjs +COPY --from=build /app/public ./public +COPY --from=build /app/package.json ./package.json +COPY --from=build /app/drizzle ./drizzle +COPY --from=build /app/.env.production ./.env +COPY --from=build /app/components.json ./components.json +COPY --from=prod-deps /app/node_modules ./node_modules # Install docker RUN curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh && rm get-docker.sh @@ -54,11 +71,10 @@ RUN curl -sSL https://nixpacks.com/install.sh -o install.sh \ && ./install.sh \ && pnpm install -g tsx - # Install buildpacks RUN curl -sSL "https://github.com/buildpacks/pack/releases/download/v0.32.1/pack-v0.32.1-linux.tgz" | tar -C /usr/local/bin/ --no-same-owner -xzv pack # Expose port EXPOSE 3000 -CMD ["pnpm", "start"] \ No newline at end of file +CMD ["pnpm", "start"] diff --git a/README.md b/README.md index ade68e822..9353e9de3 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 675cb7729..1e728b997 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 92df7a73d..d592811b5 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 ae9387757..f86cabfde 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 861343a26..61f9f818d 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 9e3bfa80c..9f5fe9ed2 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 cf4ca1328..e339ee65a 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 6188e4a8f..e8f31aab5 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 b9b22fdf3..082526496 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 90905a00e..00d75fe82 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 41581844e..57bfb7618 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 4127903f8..71749b6c2 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 dd7c1eb71..fd2d79a31 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 b4baac4f4..81104c1e9 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 6bf03d0c3..7c4915fa6 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 3e2730c9f..fd91703b2 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 da69aedb8..4078ae4c1 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 a898607d7..979660bcc 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 76939d821..873baa679 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 ab5f40970..1ab804fb4 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 9742964e2..8f9d9cd7f 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 4bcf2c567..661990a97 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 2a6e80a22..9a8325fc8 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 9643938bd..855f5c8c0 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 1f7c0d392..64dfd57ab 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 ef51e2c90..5c02bf76d 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 9ff53c2e0..bb6e59aeb 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 d01773319..56513465f 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 a3fb4f302..28d442648 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; } diff --git a/components/dashboard/application/advanced/traefik/update-traefik-config.tsx b/components/dashboard/application/advanced/traefik/update-traefik-config.tsx index 659353ec0..a185082be 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 6b29bd7ef..6b882b7c1 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 89e81f930..020a6c36a 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 2d419e9ef..6c9b53980 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 d11ee1422..34c17128b 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 d5c41a1be..aab78871a 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 c0d32db91..e633a9f4e 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 ff26dc849..31ed4e2b4 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 0cdc64865..17adf2755 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 80c2f194b..63bd3f305 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 92ca19bd2..9ebe8e30c 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 264a626f1..3085b3a88 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 11babebdb..da4445527 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 d4df0366a..5aed35243 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 7262c35ba..6614a4803 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 1e91e491e..359142c53 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 ed129a4d7..d2a39e19f 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 b880edede..870f5d544 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 94288f240..780eac401 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 5dd58df0b..a769804da 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 a16ed1730..44ce15c04 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 4756bb2ad..57b5ec576 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 57a11d712..66d690e7a 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 b4de30b67..cb4210b36 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 956443efe..4e9b2dfd5 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 0df188075..85ad45060 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 b78152690..035d6c417 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 660a994cc..2db4248d5 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 76a9fd331..977dd2f6f 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 39ea5ae92..d002b409c 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 f8b0d80a4..546b7cc70 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 15c824f9b..0bb959c11 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 e2651c28b..391801792 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 bfed02fd5..21f87fd55 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 64b878efd..b18a663de 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 d819e1a4c..be27aeda3 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 f8d52aa41..07678b6fd 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 538dd685a..243ea4b3f 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 e8531de56..e8b56daee 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 c4b6deef8..d8f87f393 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 06244940b..03001af70 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 a739ff4a5..34d94e626 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 0c153b4cf..e3e874c5a 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 ae80d3302..062fffcdc 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 e63927608..bbc5d2f5f 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 c35922279..85353e8b0 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 2bb2fb2fa..807dcae07 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 2f19d78bd..176ab7d06 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 77bc95ca1..44b6e39cb 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 869409d59..b409ac4d8 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 3dcc3cf38..17eb4bcdc 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 156322e4d..dff62cec3 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 46ca19bd3..55b7e7e65 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 cc7fb393f..1f1b909ba 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 616634d02..cbb178f3e 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 4036bf76f..85fbc5e19 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 266105628..e54fe70d5 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 c6fcbc1ba..2e181c5fa 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 9fab4a8a8..6636688d9 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 b234a7019..09d2c372d 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 74c5c6011..3bc30862a 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 fa7a52839..3b7ec5a70 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 29d0035aa..48cada9f2 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 d5b28c2fc..57a3cbe22 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 fd46a182e..41f20f8f1 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 fdfa52ea8..a97fcfedd 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 51dc80cf7..78791ce1d 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 9720ae5df..b522603d8 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 ea7556b58..c54e7c0ca 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 336076747..60ebc08ba 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 cd281281a..37b71b6cc 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 98ee13427..9e39360be 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 7cd34aefc..c8002fa26 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 a86a2e254..442d4f656 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 eeb3cce23..877769b7f 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 42133df87..2ab783976 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 68db3f671..a2aa17cbc 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 a8b5270d1..e01226101 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 bf3bb7762..9bf1738f0 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 17f9faacd..8d9450826 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 45f0aa89c..95bfed6ad 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 4ba957d5a..4c449c949 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 ecf2a1afb..cbe48b6dc 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 fd769c911..a6697eb60 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 7ab901071..e6b36e63b 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 80774207e..87ae6d292 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 8778a79d0..1b9f37f8d 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 8df235833..f80a24fbc 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 13442d1f9..a7fe22c10 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 f3836bb89..8b5954806 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 ad3f545e0..cac15e0b6 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 24c40649b..06a634c31 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 fef753e7d..555451d9d 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 1f798144f..092006748 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 929845510..67cc5e35a 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 2e81f6292..e0a4aa970 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 8ac239b39..fdc08a736 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 f891e0961..55f11c17e 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 75b5d0d99..52142fcd6 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 d0460e53b..6572e3bae 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 54af315b5..907b1dc0b 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 fd923057d..99c7a385e 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 ebb4c7f30..f0b9a7736 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 95d105aba..e7ff2f7e0 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 2d3810ca8..ab2d4d77c 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 a87f2e4e4..952a18312 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 0612afbd1..e8b42daf4 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 c5a3bdfee..7069bde71 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 b5c0448f4..d05d824b1 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 1aa9fce2b..4b8bf19af 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 8ab7ea790..783e68d84 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 f6e14337f..8c2a369f3 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 f79e8eb17..55b28ec02 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 319c1b3b1..1aa25903b 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 c792861b5..f193ab2b6 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 b17f2004c..c05918b07 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 ee8edfead..16af8787f 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 36f5de2c1..e8f708dae 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 55c304110..cad28487c 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 843f572c0..78ad2c1a3 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 b2c0a6cb2..61c4917f6 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 0c3c98544..2fc217284 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 16f69b773..e6e4866e9 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 575ebfb86..2a9cc0fa3 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 4facdce29..d65291e46 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 71a808997..9f102a542 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 b2ecc1926..d9485ee53 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 cdc5a907d..c225be9ce 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 bbca5eceb..165918652 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 8ecee7efa..c361b975f 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 847932da8..0b0e38ffa 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 fdd121883..b251a2793 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 b3bf93417..7ef34baa3 100644 --- a/components/layouts/settings-layout.tsx +++ b/components/layouts/settings-layout.tsx @@ -76,22 +76,22 @@ export const SettingsLayout = ({ children }: Props) => { ); }; -import Link from "next/link"; import { Activity, 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 b0fec201d..0295ca8b9 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 6db8e50e3..b20ef60a3 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 e330affee..d5e9fcf19 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); + const inputRef = useRef(null); const togglePasswordVisibility = () => { setIsPasswordVisible((prevVisibility) => !prevVisibility); @@ -13,7 +16,16 @@ export const ToggleVisibilityInput = ({ ...props }: InputProps) => { const inputType = isPasswordVisible ? "text" : "password"; return (
- + +