Skip to content

Commit

Permalink
fix issues and update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Safouen Turki committed Sep 30, 2024
1 parent 0452bb8 commit 1627605
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 16 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 :

Expand Down
5 changes: 1 addition & 4 deletions src/components/ui/errorQuery.tsx
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export const AddonsTable = ({
</TableCell>
<TableCell
content={row.profileName}
className="hidden md:table-cell"
className="hidden md:table-cell break-words whitespace-normal"
>
{row.profileType && (
<div>
Expand Down
12 changes: 6 additions & 6 deletions src/modules/clusters/clusters-list/components/ClusterList.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
6 changes: 4 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 1627605

Please sign in to comment.