From 7a5c71cda3d19b3893895f9e3b92cef4aef38c68 Mon Sep 17 00:00:00 2001 From: Krzysztof Durek <21038648+kdurek@users.noreply.github.com> Date: Mon, 15 Jul 2024 01:02:18 +0200 Subject: [PATCH 1/6] feat: update configs --- .husky/pre-commit | 1 + biome.json | 49 ++++++--- package.json | 14 ++- pnpm-lock.yaml | 268 ++++++++++++++++++++++++++++++++++++++++------ 4 files changed, 280 insertions(+), 52 deletions(-) create mode 100644 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 00000000..cb2c84d5 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +pnpm lint-staged diff --git a/biome.json b/biome.json index dd7c1eb7..fe6fb659 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/**"] + }, + "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/package.json b/package.json index 502ff347..112c0e61 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,8 @@ "db:push": "drizzle-kit --config ./server/db/drizzle.config.ts", "db:truncate": "tsx -r dotenv/config ./server/db/reset.ts", "db:studio": "drizzle-kit studio --config ./server/db/drizzle.config.ts", + "check": "biome check", + "format": "biome format", "lint": "biome lint", "db:seed": "tsx -r dotenv/config ./server/db/seed.ts", "db:clean": "tsx -r dotenv/config ./server/db/reset.ts", @@ -28,7 +30,8 @@ "docker:build:canary": "./docker/build.sh canary", "docker:push:canary": "./docker/push.sh canary", "version": "echo $(node -p \"require('./package.json').version\")", - "test": "vitest --config __test__/vitest.config.ts" + "test": "vitest --config __test__/vitest.config.ts", + "prepare": "husky" }, "dependencies": { "@aws-sdk/client-s3": "3.515.0", @@ -121,7 +124,7 @@ "zod": "^3.23.4" }, "devDependencies": { - "@biomejs/biome": "1.7.1", + "@biomejs/biome": "^1.8.3", "@types/bcrypt": "5.0.2", "@types/dockerode": "3.3.23", "@types/js-yaml": "4.0.9", @@ -138,6 +141,8 @@ "autoprefixer": "^10.4.14", "drizzle-kit": "^0.21.1", "esbuild": "0.20.2", + "husky": "^9.0.11", + "lint-staged": "^15.2.7", "localtunnel": "2.0.2", "postcss": "^8.4.31", "prettier": "^3.2.4", @@ -155,5 +160,10 @@ "engines": { "node": "^18.18.0", "pnpm": ">=8.15.4" + }, + "lint-staged": { + "*": [ + "biome check --write --no-errors-on-unmatched --files-ignore-unknown=true" + ] } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 821ec3f6..7c47af8c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -272,8 +272,8 @@ dependencies: devDependencies: '@biomejs/biome': - specifier: 1.7.1 - version: 1.7.1 + specifier: ^1.8.3 + version: 1.8.3 '@types/bcrypt': specifier: 5.0.2 version: 5.0.2 @@ -322,6 +322,12 @@ devDependencies: esbuild: specifier: 0.20.2 version: 0.20.2 + husky: + specifier: ^9.0.11 + version: 9.0.11 + lint-staged: + specifier: ^15.2.7 + version: 15.2.7 localtunnel: specifier: 2.0.2 version: 2.0.2 @@ -1009,24 +1015,24 @@ packages: resolution: {integrity: sha512-wMue2Sy4GAVTk6Ic4tJVcnfdau+gx2EnG7S+uAEe+TWJFqE4YoWN4/H8MSLj4eYJKxGg26lZwboEniNiNwZQ6Q==} dev: false - /@biomejs/biome@1.7.1: - resolution: {integrity: sha512-wb2UNoFXcgaMdKXKT5ytsYntaogl2FSTjDt20CZynF3v7OXQUcIpTrr+be3XoOGpoZRj3Ytq9TSpmplUREXmeA==} + /@biomejs/biome@1.8.3: + resolution: {integrity: sha512-/uUV3MV+vyAczO+vKrPdOW0Iaet7UnJMU4bNMinggGJTAnBPjCoLEYcyYtYHNnUNYlv4xZMH6hVIQCAozq8d5w==} engines: {node: '>=14.21.3'} hasBin: true requiresBuild: true optionalDependencies: - '@biomejs/cli-darwin-arm64': 1.7.1 - '@biomejs/cli-darwin-x64': 1.7.1 - '@biomejs/cli-linux-arm64': 1.7.1 - '@biomejs/cli-linux-arm64-musl': 1.7.1 - '@biomejs/cli-linux-x64': 1.7.1 - '@biomejs/cli-linux-x64-musl': 1.7.1 - '@biomejs/cli-win32-arm64': 1.7.1 - '@biomejs/cli-win32-x64': 1.7.1 + '@biomejs/cli-darwin-arm64': 1.8.3 + '@biomejs/cli-darwin-x64': 1.8.3 + '@biomejs/cli-linux-arm64': 1.8.3 + '@biomejs/cli-linux-arm64-musl': 1.8.3 + '@biomejs/cli-linux-x64': 1.8.3 + '@biomejs/cli-linux-x64-musl': 1.8.3 + '@biomejs/cli-win32-arm64': 1.8.3 + '@biomejs/cli-win32-x64': 1.8.3 dev: true - /@biomejs/cli-darwin-arm64@1.7.1: - resolution: {integrity: sha512-qfLrIIB58dkgiY/1tgG6fSCBK22PZaSIf6blweZBsG6iMij05mEuJt50ne+zPnNFNUmt8t43NC/qOXT3iFHQBA==} + /@biomejs/cli-darwin-arm64@1.8.3: + resolution: {integrity: sha512-9DYOjclFpKrH/m1Oz75SSExR8VKvNSSsLnVIqdnKexj6NwmiMlKk94Wa1kZEdv6MCOHGHgyyoV57Cw8WzL5n3A==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [darwin] @@ -1034,8 +1040,8 @@ packages: dev: true optional: true - /@biomejs/cli-darwin-x64@1.7.1: - resolution: {integrity: sha512-OGeyNsEcp5VnKbF9/TBjPCTHNEOm7oHegEve07U3KZmzqfpw2Oe3i9DVW8t6vvj1TYbrwWYCld25H34kBDY7Vg==} + /@biomejs/cli-darwin-x64@1.8.3: + resolution: {integrity: sha512-UeW44L/AtbmOF7KXLCoM+9PSgPo0IDcyEUfIoOXYeANaNXXf9mLUwV1GeF2OWjyic5zj6CnAJ9uzk2LT3v/wAw==} engines: {node: '>=14.21.3'} cpu: [x64] os: [darwin] @@ -1043,48 +1049,44 @@ packages: dev: true optional: true - /@biomejs/cli-linux-arm64-musl@1.7.1: - resolution: {integrity: sha512-giH0/CzLOJ+wbxLxd5Shnr5xQf5fGnTRWLDe3lzjaF7IplVydNCEeZJtncB01SvyA6DAFJsvQ4LNxzAOQfEVCg==} + /@biomejs/cli-linux-arm64-musl@1.8.3: + resolution: {integrity: sha512-9yjUfOFN7wrYsXt/T/gEWfvVxKlnh3yBpnScw98IF+oOeCYb5/b/+K7YNqKROV2i1DlMjg9g/EcN9wvj+NkMuQ==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] - libc: [musl] requiresBuild: true dev: true optional: true - /@biomejs/cli-linux-arm64@1.7.1: - resolution: {integrity: sha512-MQDf5wErj1iBvlcxCyOa0XqZYN8WJrupVgbNnqhntO3yVATg8GxduVUn1fDSaolznkDRsj7Pz3Xu1esBFwvfmg==} + /@biomejs/cli-linux-arm64@1.8.3: + resolution: {integrity: sha512-fed2ji8s+I/m8upWpTJGanqiJ0rnlHOK3DdxsyVLZQ8ClY6qLuPc9uehCREBifRJLl/iJyQpHIRufLDeotsPtw==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] - libc: [glibc] requiresBuild: true dev: true optional: true - /@biomejs/cli-linux-x64-musl@1.7.1: - resolution: {integrity: sha512-ySNDtPhsLxU125IFHHAxfpoHBpkM56s4mEXeO70GZtgZay/o1h8IUPWCWf5Z7gKgc4jwgYN1U1U9xabI3hZVAg==} + /@biomejs/cli-linux-x64-musl@1.8.3: + resolution: {integrity: sha512-UHrGJX7PrKMKzPGoEsooKC9jXJMa28TUSMjcIlbDnIO4EAavCoVmNQaIuUSH0Ls2mpGMwUIf+aZJv657zfWWjA==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] - libc: [musl] requiresBuild: true dev: true optional: true - /@biomejs/cli-linux-x64@1.7.1: - resolution: {integrity: sha512-3wmCsGcC3KZ4pfTknXHfyMMlXPMhgfXVAcG5GlrR+Tq2JGiAw0EUydaLpsSBEbcG7IxH6OiUZEJZ95kAycCHBA==} + /@biomejs/cli-linux-x64@1.8.3: + resolution: {integrity: sha512-I8G2QmuE1teISyT8ie1HXsjFRz9L1m5n83U1O6m30Kw+kPMPSKjag6QGUn+sXT8V+XWIZxFFBoTDEDZW2KPDDw==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] - libc: [glibc] requiresBuild: true dev: true optional: true - /@biomejs/cli-win32-arm64@1.7.1: - resolution: {integrity: sha512-8hIDakEqZn0i6+388noYKdZ0ZrovTwnvMU/Qp/oJou0G7EPVdXupOe0oxiQSdRN0W7f6CS/yjPCYuVGzDG6r0g==} + /@biomejs/cli-win32-arm64@1.8.3: + resolution: {integrity: sha512-J+Hu9WvrBevfy06eU1Na0lpc7uR9tibm9maHynLIoAjLZpQU3IW+OKHUtyL8p6/3pT2Ju5t5emReeIS2SAxhkQ==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [win32] @@ -1092,8 +1094,8 @@ packages: dev: true optional: true - /@biomejs/cli-win32-x64@1.7.1: - resolution: {integrity: sha512-3W9k3uH6Ea6VOpAS9xkkAlS0LTfnGQjmIUCegZ8SDtK2NgJ1gO+qdEkGJb0ltahusFTN1QxJ107dM7ASA9IUEg==} + /@biomejs/cli-win32-x64@1.8.3: + resolution: {integrity: sha512-/PJ59vA1pnQeKahemaQf4Nyj7IKUvGQSc3Ze1uIGi+Wvr1xF7rGobSrAAG01T/gUDG21vkDsZYM03NAmPiVkqg==} engines: {node: '>=14.21.3'} cpu: [x64] os: [win32] @@ -4587,6 +4589,7 @@ packages: /@swagger-api/apidom-ns-json-schema-draft-4@1.0.0-alpha.5: resolution: {integrity: sha512-aDmcpGikL5JZmDTg7J6EJfLFjtUmX/MfduS4hQeopFCkw91dZsqxO10j7KEiRVVuJBuGStbYoHI5aIsQTlebzA==} + requiresBuild: true dependencies: '@babel/runtime-corejs3': 7.24.7 '@swagger-api/apidom-ast': 1.0.0-alpha.5 @@ -5665,6 +5668,11 @@ packages: string-width: 4.2.3 dev: false + /ansi-escapes@6.2.1: + resolution: {integrity: sha512-4nJ3yixlEthEJ9Rk4vPcdBRkZvQZlYyu8j4/Mqz5sgIkddmEnH2Yj2ZrnP9S3tQOvSNRUIgVNF/1yPpRAGNRig==} + engines: {node: '>=14.16'} + dev: true + /ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} @@ -5913,6 +5921,13 @@ packages: dependencies: fill-range: 7.0.1 + /braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + dependencies: + fill-range: 7.1.1 + dev: true + /browserslist@4.23.0: resolution: {integrity: sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} @@ -6049,7 +6064,6 @@ packages: /chalk@5.3.0: resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - dev: false /character-entities-legacy@1.1.4: resolution: {integrity: sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==} @@ -6142,6 +6156,21 @@ packages: timers-ext: 0.1.7 dev: true + /cli-cursor@4.0.0: + resolution: {integrity: sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + restore-cursor: 4.0.0 + dev: true + + /cli-truncate@4.0.0: + resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} + engines: {node: '>=18'} + dependencies: + slice-ansi: 5.0.0 + string-width: 7.2.0 + dev: true + /client-only@0.0.1: resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} dev: false @@ -6229,6 +6258,10 @@ packages: hasBin: true dev: false + /colorette@2.0.20: + resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} + dev: true + /combined-stream@1.0.8: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} @@ -6240,6 +6273,11 @@ packages: resolution: {integrity: sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw==} dev: false + /commander@12.1.0: + resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} + engines: {node: '>=18'} + dev: true + /commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} dev: false @@ -6791,6 +6829,10 @@ packages: /electron-to-chromium@1.4.708: resolution: {integrity: sha512-iWgEEvREL4GTXXHKohhh33+6Y8XkPI5eHihDmm8zUk5Zo7HICEW+wI/j5kJ2tbuNUCXJ/sNXa03ajW635DiJXA==} + /emoji-regex@10.3.0: + resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} + dev: true + /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -7040,6 +7082,10 @@ packages: resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} dev: false + /eventemitter3@5.0.1: + resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} + dev: true + /events@3.3.0: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} @@ -7128,6 +7174,13 @@ packages: dependencies: to-regex-range: 5.0.1 + /fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + dependencies: + to-regex-range: 5.0.1 + dev: true + /find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} @@ -7225,6 +7278,11 @@ packages: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} + /get-east-asian-width@1.2.0: + resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} + engines: {node: '>=18'} + dev: true + /get-func-name@2.0.2: resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} dev: true @@ -7478,6 +7536,12 @@ packages: engines: {node: '>=16.17.0'} dev: true + /husky@9.0.11: + resolution: {integrity: sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==} + engines: {node: '>=18'} + hasBin: true + dev: true + /iconv-lite@0.4.24: resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} engines: {node: '>=0.10.0'} @@ -7610,6 +7674,18 @@ packages: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} + /is-fullwidth-code-point@4.0.0: + resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} + engines: {node: '>=12'} + dev: true + + /is-fullwidth-code-point@5.0.0: + resolution: {integrity: sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==} + engines: {node: '>=18'} + dependencies: + get-east-asian-width: 1.2.0 + dev: true + /is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} @@ -7769,6 +7845,37 @@ packages: /lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + /lint-staged@15.2.7: + resolution: {integrity: sha512-+FdVbbCZ+yoh7E/RosSdqKJyUM2OEjTciH0TFNkawKgvFp1zbGlEC39RADg+xKBG1R4mhoH2j85myBQZ5wR+lw==} + engines: {node: '>=18.12.0'} + hasBin: true + dependencies: + chalk: 5.3.0 + commander: 12.1.0 + debug: 4.3.4 + execa: 8.0.1 + lilconfig: 3.1.1 + listr2: 8.2.3 + micromatch: 4.0.7 + pidtree: 0.6.0 + string-argv: 0.3.2 + yaml: 2.4.5 + transitivePeerDependencies: + - supports-color + dev: true + + /listr2@8.2.3: + resolution: {integrity: sha512-Lllokma2mtoniUOS94CcOErHWAug5iu7HOmDrvWgpw8jyQH2fomgB+7lZS4HWZxytUuQwkGOwe49FvwVaA85Xw==} + engines: {node: '>=18.0.0'} + dependencies: + cli-truncate: 4.0.0 + colorette: 2.0.20 + eventemitter3: 5.0.1 + log-update: 6.0.0 + rfdc: 1.4.1 + wrap-ansi: 9.0.0 + dev: true + /loader-runner@4.3.0: resolution: {integrity: sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==} engines: {node: '>=6.11.5'} @@ -7854,6 +7961,17 @@ packages: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} dev: false + /log-update@6.0.0: + resolution: {integrity: sha512-niTvB4gqvtof056rRIrTZvjNYE4rCUzO6X/X+kYjd7WFxXeJ0NwEFnRxX6ehkvv3jTwrXnNdtAak5XYZuIyPFw==} + engines: {node: '>=18'} + dependencies: + ansi-escapes: 6.2.1 + cli-cursor: 4.0.0 + slice-ansi: 7.1.0 + strip-ansi: 7.1.0 + wrap-ansi: 9.0.0 + dev: true + /long-timeout@0.1.1: resolution: {integrity: sha512-BFRuQUqc7x2NWxfJBCyUrN8iYUYznzL9JROmRz1gZ6KlOIgmoD+njPVbb+VNn2nGMKggMsK79iUNErillsrx7w==} dev: false @@ -7973,6 +8091,14 @@ packages: braces: 3.0.2 picomatch: 2.3.1 + /micromatch@4.0.7: + resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} + engines: {node: '>=8.6'} + dependencies: + braces: 3.0.3 + picomatch: 2.3.1 + dev: true + /mime-db@1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} engines: {node: '>= 0.6'} @@ -7997,6 +8123,11 @@ packages: hasBin: true dev: false + /mimic-fn@2.1.0: + resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} + engines: {node: '>=6'} + dev: true + /mimic-fn@4.0.0: resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} engines: {node: '>=12'} @@ -8382,6 +8513,13 @@ packages: dependencies: wrappy: 1.0.2 + /onetime@5.1.2: + resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} + engines: {node: '>=6'} + dependencies: + mimic-fn: 2.1.0 + dev: true + /onetime@6.0.0: resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} engines: {node: '>=12'} @@ -8519,6 +8657,12 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} + /pidtree@0.6.0: + resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==} + engines: {node: '>=0.10'} + hasBin: true + dev: true + /pify@2.3.0: resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} engines: {node: '>=0.10.0'} @@ -9228,6 +9372,14 @@ packages: lowercase-keys: 3.0.0 dev: false + /restore-cursor@4.0.0: + resolution: {integrity: sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + onetime: 5.1.2 + signal-exit: 3.0.7 + dev: true + /ret@0.2.2: resolution: {integrity: sha512-M0b3YWQs7R3Z917WRQy1HHA7Ba7D8hvZg6UE5mLykJxQVE2ju0IXbGlaHPPlkY+WN7wFP+wUMXmBFA0aV6vYGQ==} engines: {node: '>=4'} @@ -9237,6 +9389,10 @@ packages: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + /rfdc@1.4.1: + resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} + dev: true + /rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} hasBin: true @@ -9397,7 +9553,6 @@ packages: /signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - dev: false /signal-exit@4.1.0: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} @@ -9428,6 +9583,22 @@ packages: engines: {node: '>=14.16'} dev: false + /slice-ansi@5.0.0: + resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} + engines: {node: '>=12'} + dependencies: + ansi-styles: 6.2.1 + is-fullwidth-code-point: 4.0.0 + dev: true + + /slice-ansi@7.1.0: + resolution: {integrity: sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==} + engines: {node: '>=18'} + dependencies: + ansi-styles: 6.2.1 + is-fullwidth-code-point: 5.0.0 + dev: true + /slugify@1.6.6: resolution: {integrity: sha512-h+z7HKHYXj6wJU+AnS/+IH8Uh9fdcX1Lrhg1/VMdf9PwoBQXFcXiAdsy2tSK0P6gKwJLXp02r90ahUCqHk9rrw==} engines: {node: '>=8.0.0'} @@ -9520,6 +9691,11 @@ packages: bare-events: 2.2.1 dev: false + /string-argv@0.3.2: + resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} + engines: {node: '>=0.6.19'} + dev: true + /string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -9536,6 +9712,15 @@ packages: emoji-regex: 9.2.2 strip-ansi: 7.1.0 + /string-width@7.2.0: + resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} + engines: {node: '>=18'} + dependencies: + emoji-regex: 10.3.0 + get-east-asian-width: 1.2.0 + strip-ansi: 7.1.0 + dev: true + /string_decoder@1.3.0: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} dependencies: @@ -10443,6 +10628,15 @@ packages: string-width: 5.1.2 strip-ansi: 7.1.0 + /wrap-ansi@9.0.0: + resolution: {integrity: sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==} + engines: {node: '>=18'} + dependencies: + ansi-styles: 6.2.1 + string-width: 7.2.0 + strip-ansi: 7.1.0 + dev: true + /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} @@ -10513,6 +10707,12 @@ packages: engines: {node: '>= 14'} hasBin: true + /yaml@2.4.5: + resolution: {integrity: sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==} + engines: {node: '>= 14'} + hasBin: true + dev: true + /yargs-parser@18.1.3: resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} engines: {node: '>=6'} From 906e8de13b04dbef1e650d8c12472d1fbda01b5f Mon Sep 17 00:00:00 2001 From: Krzysztof Durek <21038648+kdurek@users.noreply.github.com> Date: Mon, 15 Jul 2024 01:08:18 +0200 Subject: [PATCH 2/6] chore: format whole repository with new configs --- __test__/compose/compose.test.ts | 4 +- __test__/compose/secrets/secret-root.test.ts | 6 +- __test__/compose/volume/volume-2.test.ts | 2 +- __test__/vitest.config.ts | 2 +- components.json | 32 +- components/auth/login-2fa.tsx | 14 +- .../cluster/modify-swarm-settings.tsx | 18 +- .../cluster/show-cluster-settings.tsx | 20 +- .../advanced/general/add-command.tsx | 16 +- .../application/advanced/ports/add-port.tsx | 14 +- .../application/advanced/ports/show-port.tsx | 4 +- .../advanced/ports/update-port.tsx | 16 +- .../advanced/redirects/add-redirect.tsx | 8 +- .../advanced/redirects/show-redirects.tsx | 2 +- .../advanced/redirects/update-redirect.tsx | 6 +- .../advanced/security/add-security.tsx | 4 +- .../advanced/security/show-security.tsx | 2 +- .../advanced/security/update-security.tsx | 2 +- .../show-application-advanced-settings.tsx | 2 +- .../advanced/traefik/show-traefik-config.tsx | 4 +- .../traefik/update-traefik-config.tsx | 21 +- .../advanced/volumes/add-volumes.tsx | 18 +- .../advanced/volumes/delete-volume.tsx | 2 +- .../advanced/volumes/show-volumes.tsx | 4 +- .../advanced/volumes/update-volume.tsx | 4 +- .../dashboard/application/build/show.tsx | 376 +++++++++--------- .../application/deployments/refresh-token.tsx | 2 +- .../deployments/show-deployments.tsx | 6 +- .../application/domains/add-domain.tsx | 2 +- .../application/domains/delete-domain.tsx | 2 +- .../application/domains/generate-domain.tsx | 4 +- .../domains/generate-traefikme.tsx | 2 +- .../application/domains/generate-wildcard.tsx | 2 +- .../application/domains/show-domains.tsx | 12 +- .../application/domains/update-domain.tsx | 2 +- .../application/environment/show.tsx | 16 +- .../general/generic/save-docker-provider.tsx | 10 +- .../dashboard/application/general/show.tsx | 4 +- .../dashboard/application/logs/show.tsx | 4 +- .../application/update-application.tsx | 16 +- .../compose/advanced/add-command.tsx | 16 +- .../compose/advanced/show-volumes.tsx | 6 +- .../deployments/refresh-token-compose.tsx | 2 +- .../deployments/show-deployments-compose.tsx | 8 +- .../dashboard/compose/enviroment/show.tsx | 16 +- .../dashboard/compose/general/actions.tsx | 16 +- .../compose/general/compose-file-editor.tsx | 10 +- .../compose/general/generic/show.tsx | 2 +- .../compose/general/randomize-compose.tsx | 4 +- components/dashboard/compose/general/show.tsx | 8 +- components/dashboard/compose/logs/show.tsx | 4 +- .../dashboard/compose/monitoring/show.tsx | 6 +- .../dashboard/compose/update-compose.tsx | 16 +- .../dashboard/database/backups/add-backup.tsx | 36 +- .../database/backups/update-backup.tsx | 32 +- .../dashboard/docker/logs/docker-logs-id.tsx | 2 +- .../docker/logs/show-docker-modal-logs.tsx | 4 +- components/dashboard/docker/show/colums.tsx | 2 +- .../dashboard/docker/show/show-containers.tsx | 4 +- .../docker/terminal/docker-terminal-modal.tsx | 2 +- .../docker/terminal/docker-terminal.tsx | 4 +- .../file-system/show-traefik-file.tsx | 4 +- .../file-system/show-traefik-system.tsx | 4 +- .../show-mariadb-advanced-settings.tsx | 16 +- .../advanced/show-mariadb-resources.tsx | 2 +- .../mariadb/backups/show-backup-mariadb.tsx | 18 +- .../environment/show-mariadb-environment.tsx | 12 +- .../show-external-mariadb-credentials.tsx | 2 +- .../mariadb/general/show-general-mariadb.tsx | 10 +- .../show-internal-mariadb-credentials.tsx | 4 +- .../mariadb/general/stop-mariadb.tsx | 106 ++--- .../dashboard/mariadb/start-mariadb.tsx | 106 ++--- .../dashboard/mariadb/update-mariadb.tsx | 16 +- .../mariadb/volumes/show-volumes.tsx | 6 +- .../advanced/show-mongo-advanced-settings.tsx | 16 +- .../mongo/advanced/show-mongo-resources.tsx | 2 +- .../mongo/backups/show-backup-mongo.tsx | 18 +- .../mongo/general/show-general-mongo.tsx | 10 +- .../show-internal-mongo-credentials.tsx | 4 +- .../dashboard/mongo/general/stop-mongo.tsx | 106 ++--- components/dashboard/mongo/start-mongo.tsx | 106 ++--- components/dashboard/mongo/update-mongo.tsx | 16 +- .../dashboard/mongo/volumes/show-volumes.tsx | 6 +- .../monitoring/docker/docker-block-chart.tsx | 10 +- .../monitoring/docker/docker-cpu-chart.tsx | 10 +- .../monitoring/docker/docker-disk-chart.tsx | 10 +- .../monitoring/docker/docker-memory-chart.tsx | 10 +- .../docker/docker-network-chart.tsx | 10 +- .../dashboard/monitoring/docker/show.tsx | 16 +- .../advanced/show-mysql-advanced-settings.tsx | 2 +- .../mysql/advanced/show-mysql-resources.tsx | 2 +- .../mysql/backups/show-backup-mysql.tsx | 18 +- .../environment/show-mysql-environment.tsx | 12 +- .../mysql/general/show-general-mysql.tsx | 10 +- .../show-internal-mysql-credentials.tsx | 4 +- .../dashboard/mysql/general/stop-mysql.tsx | 106 ++--- components/dashboard/mysql/start-mysql.tsx | 106 ++--- components/dashboard/mysql/update-mysql.tsx | 16 +- .../dashboard/mysql/volumes/show-volumes.tsx | 6 +- .../show-postgres-advanced-settings.tsx | 16 +- .../advanced/show-postgres-resources.tsx | 2 +- .../postgres/backups/show-backup-postgres.tsx | 18 +- .../environment/show-postgres-environment.tsx | 12 +- .../general/show-general-postgres.tsx | 10 +- .../show-internal-postgres-credentials.tsx | 4 +- .../postgres/general/stop-postgres.tsx | 106 ++--- .../dashboard/postgres/start-postgres.tsx | 106 ++--- .../dashboard/postgres/update-postgres.tsx | 16 +- .../postgres/volumes/show-volumes.tsx | 4 +- .../dashboard/project/add-application.tsx | 6 +- components/dashboard/project/add-compose.tsx | 18 +- components/dashboard/project/add-database.tsx | 2 +- components/dashboard/project/add-template.tsx | 32 +- components/dashboard/projects/add.tsx | 2 +- components/dashboard/projects/show.tsx | 2 +- components/dashboard/projects/update.tsx | 18 +- .../advanced/show-redis-advanced-settings.tsx | 16 +- .../redis/advanced/show-redis-resources.tsx | 2 +- .../environment/show-redis-environment.tsx | 12 +- .../redis/general/show-general-redis.tsx | 10 +- .../show-internal-redis-credentials.tsx | 4 +- .../dashboard/redis/general/stop-redis.tsx | 106 ++--- components/dashboard/redis/start-redis.tsx | 106 ++--- components/dashboard/redis/update-redis.tsx | 16 +- .../dashboard/redis/volumes/show-volumes.tsx | 4 +- .../dashboard/settings/appearance-form.tsx | 16 +- .../settings/certificates/add-certificate.tsx | 5 +- .../certificates/delete-certificate.tsx | 2 +- .../settings/cluster/nodes/add-node.tsx | 6 +- .../cluster/nodes/manager/add-manager.tsx | 4 +- .../settings/cluster/nodes/show-nodes.tsx | 30 +- .../cluster/nodes/workers/delete-worker.tsx | 4 +- .../cluster/registry/delete-registry.tsx | 2 +- .../settings/destination/add-destination.tsx | 2 +- .../destination/delete-destination.tsx | 2 +- .../destination/show-destinations.tsx | 2 +- .../destination/update-destination.tsx | 2 +- .../settings/github/remove-github-app.tsx | 8 +- .../dashboard/settings/profile/enable-2fa.tsx | 10 +- .../settings/profile/generate-token.tsx | 8 +- .../settings/profile/profile-form.tsx | 16 +- components/dashboard/settings/show.tsx | 12 +- .../settings/users/add-permissions.tsx | 4 +- .../dashboard/settings/users/add-user.tsx | 4 +- .../dashboard/settings/users/delete-user.tsx | 4 +- .../dashboard/settings/users/show-users.tsx | 36 +- .../dashboard/settings/users/update-user.tsx | 16 +- components/dashboard/settings/web-server.tsx | 12 +- .../web-server/docker-terminal-modal.tsx | 10 +- .../web-server/show-main-traefik-config.tsx | 4 +- .../settings/web-server/show-modal-logs.tsx | 7 +- .../show-server-middleware-config.tsx | 4 +- .../web-server/show-server-traefik-config.tsx | 4 +- .../settings/web-server/terminal-modal.tsx | 24 +- .../settings/web-server/terminal.tsx | 4 +- .../settings/web-server/update-server.tsx | 4 +- components/icons/data-tools-icons.tsx | 278 ++++++------- components/layouts/navbar.tsx | 6 +- components/layouts/navigation-tabs.tsx | 8 +- components/layouts/settings-layout.tsx | 6 +- components/shared/alert-block.tsx | 2 +- components/shared/code-editor.tsx | 10 +- components/shared/status-tooltip.tsx | 7 +- components/shared/toggle-visibility-input.tsx | 4 +- components/support/show-support.tsx | 2 +- components/ui/accordion.tsx | 86 ++-- components/ui/alert-dialog.tsx | 174 ++++---- components/ui/alert.tsx | 92 ++--- components/ui/avatar.tsx | 56 +-- components/ui/badge.tsx | 48 +-- components/ui/breadcrumb.tsx | 224 +++++------ components/ui/button.tsx | 128 +++--- components/ui/card.tsx | 100 ++--- components/ui/checkbox.tsx | 34 +- components/ui/command.tsx | 192 ++++----- components/ui/dialog.tsx | 152 ++++--- components/ui/dropdown-menu.tsx | 268 ++++++------- components/ui/file-tree.tsx | 8 +- components/ui/form.tsx | 4 +- components/ui/input-otp.tsx | 2 +- components/ui/input.tsx | 46 +-- components/ui/label.tsx | 22 +- components/ui/popover.tsx | 30 +- components/ui/progress.tsx | 42 +- components/ui/radio-group.tsx | 52 +-- components/ui/scroll-area.tsx | 2 +- components/ui/select.tsx | 218 +++++----- components/ui/separator.tsx | 38 +- components/ui/sheet.tsx | 176 ++++---- components/ui/sonner.tsx | 38 +- components/ui/switch.tsx | 34 +- components/ui/table.tsx | 142 +++---- components/ui/tabs.tsx | 2 +- components/ui/textarea.tsx | 26 +- components/ui/toggle.tsx | 58 +-- components/ui/tooltip.tsx | 24 +- lib/utils.ts | 6 +- next.config.mjs | 72 ++-- pages/api/[...trpc].ts | 6 +- pages/api/deploy/github.ts | 10 +- pages/api/redirect.ts | 6 +- pages/dashboard/docker.tsx | 2 +- .../[projectId]/services/mysql/[mysqlId].tsx | 10 +- .../services/postgres/[postgresId].tsx | 10 +- .../[projectId]/services/redis/[redisId].tsx | 10 +- pages/dashboard/settings/cluster.tsx | 2 +- pages/dashboard/traefik.tsx | 2 +- pages/index.tsx | 38 +- pages/swagger.tsx | 2 +- postcss.config.cjs | 8 +- server/api/root.ts | 44 +- server/api/routers/admin.ts | 12 +- server/api/routers/application.ts | 8 +- server/api/routers/auth.ts | 20 +- server/api/routers/backup.ts | 8 +- server/api/routers/certificate.ts | 2 +- server/api/routers/cluster.ts | 10 +- server/api/routers/compose.ts | 58 +-- server/api/routers/destination.ts | 2 +- server/api/routers/docker.ts | 4 +- server/api/routers/mariadb.ts | 2 +- server/api/routers/mongo.ts | 2 +- server/api/routers/mysql.ts | 4 +- server/api/routers/port.ts | 2 +- server/api/routers/postgres.ts | 2 +- server/api/routers/project.ts | 20 +- server/api/routers/redirects.ts | 2 +- server/api/routers/redis.ts | 2 +- server/api/routers/registry.ts | 8 +- server/api/routers/security.ts | 2 +- server/api/routers/settings.ts | 48 +-- server/api/services/admin.ts | 4 +- server/api/services/application.ts | 12 +- server/api/services/auth.ts | 4 +- server/api/services/certificate.ts | 4 +- server/api/services/compose.ts | 18 +- server/api/services/domain.ts | 6 +- server/api/services/mariadb.ts | 4 +- server/api/services/mongo.ts | 4 +- server/api/services/mount.ts | 4 +- server/api/services/mysql.ts | 4 +- server/api/services/postgres.ts | 4 +- server/api/services/redis.ts | 4 +- server/api/services/registry.ts | 14 +- server/api/services/security.ts | 8 +- server/api/services/settings.ts | 4 +- server/api/trpc.ts | 4 +- server/auth/auth.ts | 10 +- server/auth/token.ts | 4 +- server/constants/index.ts | 2 +- server/db/index.ts | 4 +- server/db/reset.ts | 2 +- server/db/schema/admin.ts | 8 +- server/db/schema/application.ts | 26 +- server/db/schema/auth.ts | 14 +- server/db/schema/backups.ts | 16 +- server/db/schema/certificate.ts | 6 +- server/db/schema/compose.ts | 20 +- server/db/schema/deployment.ts | 8 +- server/db/schema/destination.ts | 6 +- server/db/schema/domain.ts | 2 +- server/db/schema/mariadb.ts | 12 +- server/db/schema/mongo.ts | 12 +- server/db/schema/mount.ts | 12 +- server/db/schema/mysql.ts | 12 +- server/db/schema/port.ts | 6 +- server/db/schema/postgres.ts | 12 +- server/db/schema/project.ts | 16 +- server/db/schema/redirects.ts | 2 +- server/db/schema/redis.ts | 10 +- server/db/schema/registry.ts | 8 +- server/db/schema/security.ts | 2 +- server/db/schema/session.ts | 2 +- server/db/schema/source.ts | 6 +- server/db/schema/user.ts | 8 +- server/db/seed.ts | 2 +- server/monitoring/utilts.ts | 2 +- server/queues/deployments-queue.ts | 2 +- server/queues/queueSetup.ts | 2 +- server/server.ts | 20 +- server/setup/config-paths.ts | 4 +- server/setup/postgres-setup.ts | 2 +- server/setup/registry-setup.ts | 4 +- server/setup/traefik-setup.ts | 12 +- server/types/with.ts | 32 +- server/utils/backups/index.ts | 10 +- server/utils/backups/mariadb.ts | 4 +- server/utils/backups/mongo.ts | 4 +- server/utils/backups/mysql.ts | 6 +- server/utils/backups/postgres.ts | 6 +- server/utils/backups/utils.ts | 10 +- server/utils/builders/compose.ts | 8 +- server/utils/builders/docker-file.ts | 60 +-- server/utils/builders/heroku.ts | 2 +- server/utils/builders/index.ts | 2 +- server/utils/builders/nixpacks.ts | 2 +- server/utils/builders/paketo.ts | 4 +- server/utils/cluster/upload.ts | 2 +- server/utils/databases/mariadb.ts | 2 +- server/utils/databases/mongo.ts | 4 +- server/utils/databases/mysql.ts | 6 +- server/utils/databases/postgres.ts | 6 +- server/utils/databases/redis.ts | 6 +- server/utils/docker/compose.ts | 4 +- server/utils/docker/utils.ts | 2 +- server/utils/filesystem/ssh.ts | 94 ++--- server/utils/providers/github.ts | 2 +- server/utils/providers/raw.ts | 6 +- server/utils/traefik/domain.ts | 4 +- server/utils/traefik/middleware.ts | 4 +- server/utils/traefik/redirect.ts | 2 +- server/utils/traefik/registry.ts | 8 +- server/utils/traefik/security.ts | 12 +- server/utils/traefik/web-server.ts | 12 +- server/wss/docker-container-logs.ts | 2 +- server/wss/docker-container-terminal.ts | 2 +- server/wss/docker-stats.ts | 2 +- server/wss/listen-deployment.ts | 2 +- server/wss/terminal.ts | 8 +- server/wss/utils.ts | 16 +- setup.ts | 8 +- templates/appsmith/index.ts | 4 +- templates/baserow/index.ts | 4 +- templates/calcom/index.ts | 14 +- templates/directus/index.ts | 4 +- templates/documenso/index.ts | 8 +- templates/doublezero/index.ts | 6 +- templates/excalidraw/index.ts | 4 +- templates/ghost/index.ts | 4 +- templates/glitchtip/index.ts | 6 +- templates/grafana/index.ts | 4 +- templates/listmonk/index.ts | 10 +- templates/meilisearch/index.ts | 6 +- templates/metabase/index.ts | 4 +- templates/minio/index.ts | 4 +- templates/n8n/index.ts | 4 +- templates/nocodb/index.ts | 10 +- templates/odoo/index.ts | 4 +- templates/open-webui/index.ts | 8 +- templates/phpmyadmin/index.ts | 6 +- templates/plausible/index.ts | 6 +- templates/pocketbase/index.ts | 4 +- templates/rocketchat/index.ts | 4 +- templates/templates.ts | 67 ++-- templates/uptime-kuma/index.ts | 4 +- templates/utils/index.ts | 4 +- templates/wordpress/index.ts | 4 +- tsconfig.json | 83 ++-- tsconfig.server.json | 28 +- 349 files changed, 3565 insertions(+), 3549 deletions(-) diff --git a/__test__/compose/compose.test.ts b/__test__/compose/compose.test.ts index 675cb772..1e728b99 100644 --- a/__test__/compose/compose.test.ts +++ b/__test__/compose/compose.test.ts @@ -1,7 +1,7 @@ -import { expect, test } from "vitest"; -import { load } from "js-yaml"; import { addPrefixToAllProperties } from "@/server/utils/docker/compose"; import type { ComposeSpecification } from "@/server/utils/docker/types"; +import { load } from "js-yaml"; +import { expect, test } from "vitest"; const composeFile1 = ` version: "3.8" diff --git a/__test__/compose/secrets/secret-root.test.ts b/__test__/compose/secrets/secret-root.test.ts index 861343a2..61f9f818 100644 --- a/__test__/compose/secrets/secret-root.test.ts +++ b/__test__/compose/secrets/secret-root.test.ts @@ -1,8 +1,8 @@ -import { expect, test } from "vitest"; -import { load, dump } from "js-yaml"; import { generateRandomHash } from "@/server/utils/docker/compose"; -import type { ComposeSpecification } from "@/server/utils/docker/types"; import { addPrefixToSecretsRoot } from "@/server/utils/docker/compose/secrets"; +import type { ComposeSpecification } from "@/server/utils/docker/types"; +import { dump, load } from "js-yaml"; +import { expect, test } from "vitest"; test("Generate random hash with 8 characters", () => { const hash = generateRandomHash(); diff --git a/__test__/compose/volume/volume-2.test.ts b/__test__/compose/volume/volume-2.test.ts index 41581844..57bfb761 100644 --- a/__test__/compose/volume/volume-2.test.ts +++ b/__test__/compose/volume/volume-2.test.ts @@ -1,7 +1,7 @@ import { generateRandomHash } from "@/server/utils/docker/compose"; import { - addPrefixToVolumesRoot, addPrefixToAllVolumes, + addPrefixToVolumesRoot, } from "@/server/utils/docker/compose/volume"; import type { ComposeSpecification } from "@/server/utils/docker/types"; import { load } from "js-yaml"; diff --git a/__test__/vitest.config.ts b/__test__/vitest.config.ts index 4127903f..71749b6c 100644 --- a/__test__/vitest.config.ts +++ b/__test__/vitest.config.ts @@ -1,5 +1,5 @@ -import { defineConfig } from "vitest/config"; import tsconfigPaths from "vite-tsconfig-paths"; +import { defineConfig } from "vitest/config"; export default defineConfig({ plugins: [ diff --git a/components.json b/components.json index b4baac4f..81104c1e 100644 --- a/components.json +++ b/components.json @@ -1,17 +1,17 @@ { - "$schema": "https://ui.shadcn.com/schema.json", - "style": "default", - "rsc": false, - "tsx": true, - "tailwind": { - "config": "tailwind.config.ts", - "css": "styles/globals.css", - "baseColor": "zinc", - "cssVariables": true, - "prefix": "" - }, - "aliases": { - "components": "@/components", - "utils": "@/lib/utils" - } -} \ No newline at end of file + "$schema": "https://ui.shadcn.com/schema.json", + "style": "default", + "rsc": false, + "tsx": true, + "tailwind": { + "config": "tailwind.config.ts", + "css": "styles/globals.css", + "baseColor": "zinc", + "cssVariables": true, + "prefix": "" + }, + "aliases": { + "components": "@/components", + "utils": "@/lib/utils" + } +} diff --git a/components/auth/login-2fa.tsx b/components/auth/login-2fa.tsx index 6bf03d0c..7c4915fa 100644 --- a/components/auth/login-2fa.tsx +++ b/components/auth/login-2fa.tsx @@ -10,19 +10,19 @@ import { } from "@/components/ui/form"; import { CardTitle } from "@/components/ui/card"; -import { api } from "@/utils/api"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { AlertTriangle } from "lucide-react"; -import { useEffect } from "react"; -import { useForm } from "react-hook-form"; -import { toast } from "sonner"; -import { z } from "zod"; import { InputOTP, InputOTPGroup, InputOTPSlot, } from "@/components/ui/input-otp"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { AlertTriangle } from "lucide-react"; import { useRouter } from "next/router"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; const Login2FASchema = z.object({ pin: z.string().min(6, { diff --git a/components/dashboard/application/advanced/cluster/modify-swarm-settings.tsx b/components/dashboard/application/advanced/cluster/modify-swarm-settings.tsx index 3e2730c9..fd91703b 100644 --- a/components/dashboard/application/advanced/cluster/modify-swarm-settings.tsx +++ b/components/dashboard/application/advanced/cluster/modify-swarm-settings.tsx @@ -1,3 +1,5 @@ +import { AlertBlock } from "@/components/shared/alert-block"; +import { CodeEditor } from "@/components/shared/code-editor"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -17,21 +19,19 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; -import { api } from "@/utils/api"; -import { AlertBlock } from "@/components/shared/alert-block"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useEffect } from "react"; -import { useForm } from "react-hook-form"; -import { toast } from "sonner"; -import { z } from "zod"; -import { HelpCircle, Settings } from "lucide-react"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip"; -import { CodeEditor } from "@/components/shared/code-editor"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { HelpCircle, Settings } from "lucide-react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; const HealthCheckSwarmSchema = z .object({ diff --git a/components/dashboard/application/advanced/cluster/show-cluster-settings.tsx b/components/dashboard/application/advanced/cluster/show-cluster-settings.tsx index da69aedb..4078ae4c 100644 --- a/components/dashboard/application/advanced/cluster/show-cluster-settings.tsx +++ b/components/dashboard/application/advanced/cluster/show-cluster-settings.tsx @@ -1,4 +1,5 @@ -import React from "react"; +import { AlertBlock } from "@/components/shared/alert-block"; +import { Button } from "@/components/ui/button"; import { Card, CardContent, @@ -6,8 +7,6 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; -import { api } from "@/utils/api"; -import { z } from "zod"; import { Form, FormControl, @@ -16,11 +15,6 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; -import { toast } from "sonner"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useForm } from "react-hook-form"; -import { useEffect } from "react"; -import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Select, @@ -31,10 +25,16 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; -import Link from "next/link"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; import { Server } from "lucide-react"; +import Link from "next/link"; +import React from "react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; import { AddSwarmSettings } from "./modify-swarm-settings"; -import { AlertBlock } from "@/components/shared/alert-block"; interface Props { applicationId: string; diff --git a/components/dashboard/application/advanced/general/add-command.tsx b/components/dashboard/application/advanced/general/add-command.tsx index a898607d..979660bc 100644 --- a/components/dashboard/application/advanced/general/add-command.tsx +++ b/components/dashboard/application/advanced/general/add-command.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import { Button } from "@/components/ui/button"; import { Card, CardContent, @@ -6,8 +6,6 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; -import { api } from "@/utils/api"; -import { z } from "zod"; import { Form, FormControl, @@ -16,12 +14,14 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; -import { toast } from "sonner"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useForm } from "react-hook-form"; -import { useEffect } from "react"; -import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import React from "react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; interface Props { applicationId: string; } diff --git a/components/dashboard/application/advanced/ports/add-port.tsx b/components/dashboard/application/advanced/ports/add-port.tsx index 76939d82..873baa67 100644 --- a/components/dashboard/application/advanced/ports/add-port.tsx +++ b/components/dashboard/application/advanced/ports/add-port.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -17,13 +18,6 @@ import { FormMessage, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; -import { api } from "@/utils/api"; -import { AlertBlock } from "@/components/shared/alert-block"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useEffect } from "react"; -import { useForm } from "react-hook-form"; -import { toast } from "sonner"; -import { PlusIcon } from "lucide-react"; import { Select, SelectContent, @@ -31,6 +25,12 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { PlusIcon } from "lucide-react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; import { z } from "zod"; const AddPortSchema = z.object({ diff --git a/components/dashboard/application/advanced/ports/show-port.tsx b/components/dashboard/application/advanced/ports/show-port.tsx index ab5f4097..1ab804fb 100644 --- a/components/dashboard/application/advanced/ports/show-port.tsx +++ b/components/dashboard/application/advanced/ports/show-port.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import { AlertBlock } from "@/components/shared/alert-block"; import { Card, CardContent, @@ -8,10 +8,10 @@ import { } from "@/components/ui/card"; import { api } from "@/utils/api"; import { Rss } from "lucide-react"; +import React from "react"; import { AddPort } from "./add-port"; import { DeletePort } from "./delete-port"; import { UpdatePort } from "./update-port"; -import { AlertBlock } from "@/components/shared/alert-block"; interface Props { applicationId: string; } diff --git a/components/dashboard/application/advanced/ports/update-port.tsx b/components/dashboard/application/advanced/ports/update-port.tsx index 9742964e..8f9d9cd7 100644 --- a/components/dashboard/application/advanced/ports/update-port.tsx +++ b/components/dashboard/application/advanced/ports/update-port.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -17,14 +18,6 @@ import { FormMessage, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; -import { api } from "@/utils/api"; -import { AlertBlock } from "@/components/shared/alert-block"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { PenBoxIcon, Pencil } from "lucide-react"; -import { useEffect } from "react"; -import { useForm } from "react-hook-form"; -import { toast } from "sonner"; -import { z } from "zod"; import { Select, SelectContent, @@ -32,6 +25,13 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { PenBoxIcon, Pencil } from "lucide-react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; const UpdatePortSchema = z.object({ publishedPort: z.number().int().min(1).max(65535), diff --git a/components/dashboard/application/advanced/redirects/add-redirect.tsx b/components/dashboard/application/advanced/redirects/add-redirect.tsx index 4bcf2c56..661990a9 100644 --- a/components/dashboard/application/advanced/redirects/add-redirect.tsx +++ b/components/dashboard/application/advanced/redirects/add-redirect.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -11,22 +12,21 @@ import { import { Form, FormControl, + FormDescription, FormField, FormItem, FormLabel, - FormDescription, FormMessage, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; +import { Switch } from "@/components/ui/switch"; import { api } from "@/utils/api"; -import { AlertBlock } from "@/components/shared/alert-block"; import { zodResolver } from "@hookform/resolvers/zod"; +import { PlusIcon } from "lucide-react"; import { useEffect } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; -import { PlusIcon } from "lucide-react"; import { z } from "zod"; -import { Switch } from "@/components/ui/switch"; const AddRedirectchema = z.object({ regex: z.string().min(1, "Regex required"), diff --git a/components/dashboard/application/advanced/redirects/show-redirects.tsx b/components/dashboard/application/advanced/redirects/show-redirects.tsx index 2a6e80a2..9a8325fc 100644 --- a/components/dashboard/application/advanced/redirects/show-redirects.tsx +++ b/components/dashboard/application/advanced/redirects/show-redirects.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { Card, CardContent, @@ -8,6 +7,7 @@ import { } from "@/components/ui/card"; import { api } from "@/utils/api"; import { Split } from "lucide-react"; +import React from "react"; import { AddRedirect } from "./add-redirect"; import { DeleteRedirect } from "./delete-redirect"; import { UpdateRedirect } from "./update-redirect"; diff --git a/components/dashboard/application/advanced/redirects/update-redirect.tsx b/components/dashboard/application/advanced/redirects/update-redirect.tsx index 9643938b..855f5c8c 100644 --- a/components/dashboard/application/advanced/redirects/update-redirect.tsx +++ b/components/dashboard/application/advanced/redirects/update-redirect.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -11,22 +12,21 @@ import { import { Form, FormControl, + FormDescription, FormField, FormItem, FormLabel, - FormDescription, FormMessage, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; +import { Switch } from "@/components/ui/switch"; import { api } from "@/utils/api"; -import { AlertBlock } from "@/components/shared/alert-block"; import { zodResolver } from "@hookform/resolvers/zod"; import { PenBoxIcon, Pencil } from "lucide-react"; import { useEffect } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; -import { Switch } from "@/components/ui/switch"; const UpdateRedirectSchema = z.object({ regex: z.string().min(1, "Regex required"), permanent: z.boolean().default(false), diff --git a/components/dashboard/application/advanced/security/add-security.tsx b/components/dashboard/application/advanced/security/add-security.tsx index 1f7c0d39..64dfd57a 100644 --- a/components/dashboard/application/advanced/security/add-security.tsx +++ b/components/dashboard/application/advanced/security/add-security.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -18,12 +19,11 @@ import { } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; import { api } from "@/utils/api"; -import { AlertBlock } from "@/components/shared/alert-block"; import { zodResolver } from "@hookform/resolvers/zod"; +import { PlusIcon } from "lucide-react"; import { useEffect } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; -import { PlusIcon } from "lucide-react"; import { z } from "zod"; const AddSecuritychema = z.object({ diff --git a/components/dashboard/application/advanced/security/show-security.tsx b/components/dashboard/application/advanced/security/show-security.tsx index ef51e2c9..5c02bf76 100644 --- a/components/dashboard/application/advanced/security/show-security.tsx +++ b/components/dashboard/application/advanced/security/show-security.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { Card, CardContent, @@ -8,6 +7,7 @@ import { } from "@/components/ui/card"; import { api } from "@/utils/api"; import { LockKeyhole } from "lucide-react"; +import React from "react"; import { AddSecurity } from "./add-security"; import { DeleteSecurity } from "./delete-security"; import { UpdateSecurity } from "./update-security"; diff --git a/components/dashboard/application/advanced/security/update-security.tsx b/components/dashboard/application/advanced/security/update-security.tsx index 9ff53c2e..bb6e59ae 100644 --- a/components/dashboard/application/advanced/security/update-security.tsx +++ b/components/dashboard/application/advanced/security/update-security.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -18,7 +19,6 @@ import { } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; import { api } from "@/utils/api"; -import { AlertBlock } from "@/components/shared/alert-block"; import { zodResolver } from "@hookform/resolvers/zod"; import { PenBoxIcon, Pencil } from "lucide-react"; import { useEffect } from "react"; diff --git a/components/dashboard/application/advanced/show-application-advanced-settings.tsx b/components/dashboard/application/advanced/show-application-advanced-settings.tsx index d0177331..56513465 100644 --- a/components/dashboard/application/advanced/show-application-advanced-settings.tsx +++ b/components/dashboard/application/advanced/show-application-advanced-settings.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Card, @@ -21,7 +22,6 @@ import React, { useEffect } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; -import { AlertBlock } from "@/components/shared/alert-block"; const addResourcesApplication = z.object({ memoryReservation: z.number().nullable().optional(), diff --git a/components/dashboard/application/advanced/traefik/show-traefik-config.tsx b/components/dashboard/application/advanced/traefik/show-traefik-config.tsx index a3fb4f30..28d44264 100644 --- a/components/dashboard/application/advanced/traefik/show-traefik-config.tsx +++ b/components/dashboard/application/advanced/traefik/show-traefik-config.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import { CodeEditor } from "@/components/shared/code-editor"; import { Card, CardContent, @@ -8,8 +8,8 @@ import { } from "@/components/ui/card"; import { api } from "@/utils/api"; import { File } from "lucide-react"; +import React from "react"; import { UpdateTraefikConfig } from "./update-traefik-config"; -import { CodeEditor } from "@/components/shared/code-editor"; interface Props { applicationId: string; } diff --git a/components/dashboard/application/advanced/traefik/update-traefik-config.tsx b/components/dashboard/application/advanced/traefik/update-traefik-config.tsx index 659353ec..a185082b 100644 --- a/components/dashboard/application/advanced/traefik/update-traefik-config.tsx +++ b/components/dashboard/application/advanced/traefik/update-traefik-config.tsx @@ -1,3 +1,5 @@ +import { AlertBlock } from "@/components/shared/alert-block"; +import { CodeEditor } from "@/components/shared/code-editor"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -17,14 +19,12 @@ import { FormMessage, } from "@/components/ui/form"; import { api } from "@/utils/api"; -import { AlertBlock } from "@/components/shared/alert-block"; import { zodResolver } from "@hookform/resolvers/zod"; +import jsyaml from "js-yaml"; import { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; -import jsyaml from "js-yaml"; -import { CodeEditor } from "@/components/shared/code-editor"; const UpdateTraefikConfigSchema = z.object({ traefikConfig: z.string(), @@ -110,12 +110,15 @@ export const UpdateTraefikConfig = ({ applicationId }: Props) => { }; return ( - { - setOpen(open) - if (!open) { - form.reset(); - } - }}> + { + setOpen(open); + if (!open) { + form.reset(); + } + }} + > diff --git a/components/dashboard/application/advanced/volumes/add-volumes.tsx b/components/dashboard/application/advanced/volumes/add-volumes.tsx index 6b29bd7e..6b882b7c 100644 --- a/components/dashboard/application/advanced/volumes/add-volumes.tsx +++ b/components/dashboard/application/advanced/volumes/add-volumes.tsx @@ -1,8 +1,4 @@ -import { zodResolver } from "@hookform/resolvers/zod"; -import type React from "react"; -import { useEffect } from "react"; -import { useForm } from "react-hook-form"; -import { z } from "zod"; +import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, @@ -22,12 +18,16 @@ import { import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; -import { Button } from "@/components/ui/button"; -import { PlusIcon } from "lucide-react"; import { Textarea } from "@/components/ui/textarea"; -import { api } from "@/utils/api"; -import { toast } from "sonner"; import { cn } from "@/lib/utils"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { PlusIcon } from "lucide-react"; +import type React from "react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; interface Props { serviceId: string; serviceType: diff --git a/components/dashboard/application/advanced/volumes/delete-volume.tsx b/components/dashboard/application/advanced/volumes/delete-volume.tsx index 89e81f93..020a6c36 100644 --- a/components/dashboard/application/advanced/volumes/delete-volume.tsx +++ b/components/dashboard/application/advanced/volumes/delete-volume.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { AlertDialog, AlertDialogAction, @@ -13,6 +12,7 @@ import { import { Button } from "@/components/ui/button"; import { api } from "@/utils/api"; import { TrashIcon } from "lucide-react"; +import React from "react"; import { toast } from "sonner"; interface Props { diff --git a/components/dashboard/application/advanced/volumes/show-volumes.tsx b/components/dashboard/application/advanced/volumes/show-volumes.tsx index 2d419e9e..6c9b5398 100644 --- a/components/dashboard/application/advanced/volumes/show-volumes.tsx +++ b/components/dashboard/application/advanced/volumes/show-volumes.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import { AlertBlock } from "@/components/shared/alert-block"; import { Card, CardContent, @@ -8,10 +8,10 @@ import { } from "@/components/ui/card"; import { api } from "@/utils/api"; import { AlertTriangle, Package } from "lucide-react"; +import React from "react"; import { AddVolumes } from "./add-volumes"; import { DeleteVolume } from "./delete-volume"; import { UpdateVolume } from "./update-volume"; -import { AlertBlock } from "@/components/shared/alert-block"; interface Props { applicationId: string; } diff --git a/components/dashboard/application/advanced/volumes/update-volume.tsx b/components/dashboard/application/advanced/volumes/update-volume.tsx index d11ee142..34c17128 100644 --- a/components/dashboard/application/advanced/volumes/update-volume.tsx +++ b/components/dashboard/application/advanced/volumes/update-volume.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -17,15 +18,14 @@ import { FormMessage, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; +import { Textarea } from "@/components/ui/textarea"; import { api } from "@/utils/api"; -import { AlertBlock } from "@/components/shared/alert-block"; import { zodResolver } from "@hookform/resolvers/zod"; import { Pencil } from "lucide-react"; import { useEffect } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; -import { Textarea } from "@/components/ui/textarea"; const mountSchema = z.object({ mountPath: z.string().min(1, "Mount path required"), diff --git a/components/dashboard/application/build/show.tsx b/components/dashboard/application/build/show.tsx index d5c41a1b..aab78871 100644 --- a/components/dashboard/application/build/show.tsx +++ b/components/dashboard/application/build/show.tsx @@ -1,213 +1,213 @@ -import { - Form, - FormControl, - FormField, - FormItem, - FormLabel, - FormMessage, -} from "@/components/ui/form"; +import { Button } from "@/components/ui/button"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { + Form, + FormControl, + FormField, + FormItem, + FormLabel, + FormMessage, +} from "@/components/ui/form"; +import { Input } from "@/components/ui/input"; +import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; import { api } from "@/utils/api"; import { zodResolver } from "@hookform/resolvers/zod"; import { Cog } from "lucide-react"; import { useEffect } from "react"; import { useForm } from "react-hook-form"; -import { z } from "zod"; -import { Button } from "@/components/ui/button"; -import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; import { toast } from "sonner"; -import { Input } from "@/components/ui/input"; +import { z } from "zod"; enum BuildType { - dockerfile = "dockerfile", - heroku_buildpacks = "heroku_buildpacks", - paketo_buildpacks = "paketo_buildpacks", - nixpacks = "nixpacks", + dockerfile = "dockerfile", + heroku_buildpacks = "heroku_buildpacks", + paketo_buildpacks = "paketo_buildpacks", + nixpacks = "nixpacks", } const mySchema = z.discriminatedUnion("buildType", [ - z.object({ - buildType: z.literal("dockerfile"), - dockerfile: z - .string({ - required_error: "Dockerfile path is required", - invalid_type_error: "Dockerfile path is required", - }) - .min(1, "Dockerfile required"), - }), - z.object({ - buildType: z.literal("heroku_buildpacks"), - }), - z.object({ - buildType: z.literal("paketo_buildpacks"), - }), - z.object({ - buildType: z.literal("nixpacks"), - }), + z.object({ + buildType: z.literal("dockerfile"), + dockerfile: z + .string({ + required_error: "Dockerfile path is required", + invalid_type_error: "Dockerfile path is required", + }) + .min(1, "Dockerfile required"), + }), + z.object({ + buildType: z.literal("heroku_buildpacks"), + }), + z.object({ + buildType: z.literal("paketo_buildpacks"), + }), + z.object({ + buildType: z.literal("nixpacks"), + }), ]); type AddTemplate = z.infer; interface Props { - applicationId: string; + applicationId: string; } export const ShowBuildChooseForm = ({ applicationId }: Props) => { - const { mutateAsync, isLoading } = - api.application.saveBuildType.useMutation(); - const { data, refetch } = api.application.one.useQuery( - { - applicationId, - }, - { - enabled: !!applicationId, - }, - ); + const { mutateAsync, isLoading } = + api.application.saveBuildType.useMutation(); + const { data, refetch } = api.application.one.useQuery( + { + applicationId, + }, + { + enabled: !!applicationId, + }, + ); - const form = useForm({ - defaultValues: { - buildType: BuildType.nixpacks, - }, - resolver: zodResolver(mySchema), - }); + const form = useForm({ + defaultValues: { + buildType: BuildType.nixpacks, + }, + resolver: zodResolver(mySchema), + }); - const buildType = form.watch("buildType"); - useEffect(() => { - if (data) { - // TODO: refactor this - if (data.buildType === "dockerfile") { - form.reset({ - buildType: data.buildType, - ...(data.buildType && { - dockerfile: data.dockerfile || "", - }), - }); - } else { - form.reset({ - buildType: data.buildType, - }); - } - } - }, [form.formState.isSubmitSuccessful, form.reset, data, form]); + const buildType = form.watch("buildType"); + useEffect(() => { + if (data) { + // TODO: refactor this + if (data.buildType === "dockerfile") { + form.reset({ + buildType: data.buildType, + ...(data.buildType && { + dockerfile: data.dockerfile || "", + }), + }); + } else { + form.reset({ + buildType: data.buildType, + }); + } + } + }, [form.formState.isSubmitSuccessful, form.reset, data, form]); - const onSubmit = async (data: AddTemplate) => { - await mutateAsync({ - applicationId, - buildType: data.buildType, - dockerfile: data.buildType === "dockerfile" ? data.dockerfile : null, - }) - .then(async () => { - toast.success("Build type saved"); - await refetch(); - }) - .catch(() => { - toast.error("Error to save the build type"); - }); - }; + const onSubmit = async (data: AddTemplate) => { + await mutateAsync({ + applicationId, + buildType: data.buildType, + dockerfile: data.buildType === "dockerfile" ? data.dockerfile : null, + }) + .then(async () => { + toast.success("Build type saved"); + await refetch(); + }) + .catch(() => { + toast.error("Error to save the build type"); + }); + }; - return ( - - - -
- Build Type -

- Select the way of building your code -

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

+ Select the way of building your code +

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

    +

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

    +

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

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