diff --git a/Dockerfile b/Dockerfile index 0ff6889..edfdc86 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,9 @@ RUN apk add --update nodejs npm # VITE arguments ARG VITE_BACKEND_PORT ARG VITE_BACKEND_NAME +ARG VITE_APP_BACKEND_URL ENV VITE_BACKEND_PORT=${VITE_BACKEND_PORT} ENV VITE_BACKEND_NAME=${VITE_BACKEND_PORT} +ENV VITE_APP_BACKEND_URL=${VITE_APP_BACKEND_URL} EXPOSE 5173 CMD ["npm", "run", "dev"] diff --git a/README.md b/README.md index f036308..137c632 100644 --- a/README.md +++ b/README.md @@ -34,10 +34,13 @@ the default backend port is 9000 `set VITE_BACKEND_PORT=8000` -### Configure the backend port +### Configure the backend url (optional) -`set VITE_BACKEND_PORT={port}` before running `npm run dev` -the default backend port is 9000 +if sveltos backend is hosted on a different host, you can set the url by running the following command: + +`set VITE_APP_BACKEND_URL={url}` before running `npm run dev` + +there is no default url. ##### Example : diff --git a/src/components/ui/errorQuery.tsx b/src/components/ui/errorQuery.tsx index 8dee816..116d982 100644 --- a/src/components/ui/errorQuery.tsx +++ b/src/components/ui/errorQuery.tsx @@ -1,11 +1,8 @@ import { ExclamationTriangleIcon } from "@radix-ui/react-icons"; import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; - -import { Separator } from "@/components/ui/separator"; import { Button } from "@/components/ui/button"; -import { AlertTriangleIcon, RefreshCcw } from "lucide-react"; +import { AlertTriangleIcon } from "lucide-react"; import { appConfig } from "@/config/app"; -import { useQueryClient } from "react-query"; import { RefreshButton } from "@/components/ui/RefreshButton"; type ErrorFetchingProps = { diff --git a/src/modules/clusters/cluster-information/components/AddonsTable/AddonsTable.tsx b/src/modules/clusters/cluster-information/components/AddonsTable/AddonsTable.tsx index fdae986..e080bdf 100644 --- a/src/modules/clusters/cluster-information/components/AddonsTable/AddonsTable.tsx +++ b/src/modules/clusters/cluster-information/components/AddonsTable/AddonsTable.tsx @@ -193,7 +193,7 @@ export const AddonsTable = ({ {row.profileType && (
diff --git a/src/modules/clusters/clusters-list/components/ClusterList.tsx b/src/modules/clusters/clusters-list/components/ClusterList.tsx index 5f408bb..40b3524 100644 --- a/src/modules/clusters/clusters-list/components/ClusterList.tsx +++ b/src/modules/clusters/clusters-list/components/ClusterList.tsx @@ -1,10 +1,10 @@ -import {ClusterCard} from "@/modules/clusters/clusters-list/components/ClusterCard"; +import { ClusterCard } from "@/modules/clusters/clusters-list/components/ClusterCard"; -import {useNavigate, useParams} from "react-router-dom"; -import {ClusterInfoType, ClusterListResponse} from "@/types/cluster.types"; -import {EmptyData} from "@/components/ui/emptyData"; -import {usePagination} from "@/hooks/usePagination"; -import {FC} from "react"; +import { useNavigate, useParams } from "react-router-dom"; +import { ClusterInfoType, ClusterListResponse } from "@/types/cluster.types"; +import { EmptyData } from "@/components/ui/emptyData"; +import { usePagination } from "@/hooks/usePagination"; +import { FC } from "react"; type ClusterListProps = { data: ClusterListResponse; diff --git a/vite.config.ts b/vite.config.ts index 77ee2d1..b904ebc 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -6,8 +6,10 @@ const basenameProd = "/"; export default defineConfig(({ command }) => { dotenv.config(); - const { VITE_BACKEND_PORT,VITE_BACKEND_NAME } = process.env; - const VITE_BACKEND_URL = `http://${VITE_BACKEND_NAME}:${VITE_BACKEND_PORT}`; + const { VITE_BACKEND_PORT, VITE_BACKEND_NAME, VITE_APP_BACKEND_URL } = + process.env; + const VITE_BACKEND_URL = + VITE_APP_BACKEND_URL ?? `http://${VITE_BACKEND_NAME}:${VITE_BACKEND_PORT}`; return { plugins: [react()], resolve: {