From e3005cd2fd9fb6a58e50c0e48fac6e984084f6f1 Mon Sep 17 00:00:00 2001 From: THS-LMIS <91137979+THS-LMIS@users.noreply.github.com> Date: Mon, 16 Dec 2024 08:36:41 +0100 Subject: [PATCH] =?UTF-8?q?Hinzuf=C3=BCgen=20von=20Funktionalit=C3=A4ten?= =?UTF-8?q?=20der=20Kartendarstellung=20auf=20der=20Startseite=20(#14)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Thomas Schley --- .env.example | 1 + .github/Dockerfile | 2 + .gitignore | 1 + README.md | 10 +- app/components/Breadcrumbs.module.css | 16 +-- app/components/Breadcrumbs.tsx | 8 +- app/components/OpenLayers.tsx | 186 ++++++++++++++++++++++++-- app/services/fiwareService.tsx | 39 ++++++ package-lock.json | 92 +++++++++++++ package.json | 2 + public/index.html | 12 -- tsconfig.json | 5 +- vite.config.ts | 23 +++- 13 files changed, 353 insertions(+), 44 deletions(-) create mode 100644 .env.example create mode 100644 app/services/fiwareService.tsx delete mode 100644 public/index.html diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..2e86b48 --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +VITE_FIWARE_SERVER_BASE_URL= \ No newline at end of file diff --git a/.github/Dockerfile b/.github/Dockerfile index 831d131..b7a4411 100644 --- a/.github/Dockerfile +++ b/.github/Dockerfile @@ -8,6 +8,8 @@ ADD . /app/ WORKDIR /app # install app +ARG VITE_FIWARE_SERVER_BASE_URL=localhost +ENV VITE_FIWARE_SERVER_BASE_URL=$VITE_FIWARE_SERVER_BASE_URL RUN npm install && npm run build # expose web port diff --git a/.gitignore b/.gitignore index 4786736..70415cf 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ # misc .DS_Store +.env .env.local .env.development.local .env.test.local diff --git a/README.md b/README.md index d490839..42a5a6c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ # Getting Started with 5GLa Visualization +## Create .env + +Rename/copy `.env.example` to `.env` and change the `.env` with your configuration. + +## Scripts + In the project directory, you can run: ### `npm run dev` @@ -26,8 +32,8 @@ Open [http://localhost:3000](http://localhost:3000) to view it in the browser. ## Run with Docker ```shell -docker build -f ./.github/Dockerfile -t 5gla-react-visualization . -docker run --name 5gla-react-visualization -p 3000:3000 5gla-react-visualization +docker build --build-arg VITE_FIWARE_SERVER_BASE_URL= -f ./.github/Dockerfile -t 5gla-react-visualization . +docker run --name 5gla-react-visualization -p 3000:3000 5gla-react-visualization ``` Open [http://localhost:3000](http://localhost:3000) to view it in the browser. \ No newline at end of file diff --git a/app/components/Breadcrumbs.module.css b/app/components/Breadcrumbs.module.css index 56a4286..c810c07 100644 --- a/app/components/Breadcrumbs.module.css +++ b/app/components/Breadcrumbs.module.css @@ -6,13 +6,13 @@ color: white; font-size: large; text-decoration: none; - & + &:before { - content: '>'; - font-weight: normal; - margin: 0 15px; - } - &.active { - font-weight: bold; - } + } + a + a:before { + content: '>'; + font-weight: normal; + margin: 0 15px; + } + a.active { + font-weight: bold; } } \ No newline at end of file diff --git a/app/components/Breadcrumbs.tsx b/app/components/Breadcrumbs.tsx index f9e5b56..5e07a65 100644 --- a/app/components/Breadcrumbs.tsx +++ b/app/components/Breadcrumbs.tsx @@ -12,7 +12,9 @@ function Breadcrumbs() {