From 8b804645fc031edbaa0a9e207b8324c3737cabac Mon Sep 17 00:00:00 2001 From: 13on4rd <116517713+13on4rd@users.noreply.github.com> Date: Sat, 14 Dec 2024 17:28:17 +0100 Subject: [PATCH] Fixed import/export functionality (#63) fixed import and export for all minigame configs --- .nginx/compose/nginx-dev.conf | 9 +++- .nginx/compose/nginx.conf | 8 ++++ docker-compose-dev.yaml | 47 ++++++++++++++++++- .../EditChickenshockConfigurationModal.vue | 11 ++++- .../EditCrosswordpuzzleModal.vue | 3 +- .../EditFinitequizConfigurationModal.vue | 3 +- .../EditMemoryConfigurationModal.vue | 11 ++++- .../EditMinigameModals/EditRegexGameModal.vue | 37 +++++++++------ .../EditTowerDefenseConfigurationModal.vue | 3 +- .../EditTowercrushConfigurationModal.vue | 3 +- src/ts/import-configuration.ts | 2 +- src/ts/models/regexgame-models.ts | 12 +++-- src/ts/rest-clients/regexgame-rest-client.ts | 4 +- 13 files changed, 124 insertions(+), 29 deletions(-) diff --git a/.nginx/compose/nginx-dev.conf b/.nginx/compose/nginx-dev.conf index dd95c0c..4f79692 100644 --- a/.nginx/compose/nginx-dev.conf +++ b/.nginx/compose/nginx-dev.conf @@ -16,7 +16,6 @@ server { proxy_pass http://keycloak/keycloak/; } - location /minigames/bugfinder/api/ { proxy_pass http://bugfinder-backend/api/; } @@ -41,6 +40,10 @@ server { proxy_pass http://regexgame-backend/api/; } + location /minigames/towercrush/api/ { + proxy_pass http://towercrush-backend/api/; + } + location /minigames/towerdefense/api/ { proxy_pass http://towerdefense-backend/api/; } @@ -77,6 +80,10 @@ server { proxy_pass http://regexgame/; } + location /minigames/towercrush/ { + proxy_pass http://towercrush/; + } + location /minigames/towerdefense/ { proxy_pass http://towerdefense/; } diff --git a/.nginx/compose/nginx.conf b/.nginx/compose/nginx.conf index 4aebc31..69cd48f 100644 --- a/.nginx/compose/nginx.conf +++ b/.nginx/compose/nginx.conf @@ -44,6 +44,10 @@ server { proxy_pass http://regexgame-backend/api/; } + location /minigames/towercrush/api/ { + proxy_pass http://towercrush-backend/api/; + } + location /minigames/towerdefense/api/ { proxy_pass http://towerdefense-backend/api/; } @@ -76,6 +80,10 @@ server { proxy_pass http://regexgame/; } + location /minigames/towercrush/ { + proxy_pass http://towercrush/; + } + location /minigames/towerdefense/ { proxy_pass http://towerdefense/; } diff --git a/docker-compose-dev.yaml b/docker-compose-dev.yaml index 5216cb0..a2e2ff8 100644 --- a/docker-compose-dev.yaml +++ b/docker-compose-dev.yaml @@ -95,6 +95,16 @@ services: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres + towercrush-db: + container_name: towercrush-db + image: postgres:14-alpine + restart: always + expose: + - "5432" + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=postgres + towerdefense-db: container_name: towerdefense-db image: postgres:14-alpine @@ -145,6 +155,8 @@ services: - FINITEQUIZ_URL=http://finitequiz-backend/api/v1 - BUGFINDER_URL=http://bugfinder-backend/api/v1 - MEMORY_URL=http://memory-backend/api/v1 + - TOWERCURSH_URL=http://towercrush-backend/api/v1 + - TOWERDEFENSE=http://towerdefense-backend/api/v1 - KEYCLOAK_ISSUER=http://localhost/keycloak/realms/Gamify-IT - KEYCLOAK_URL=http://keycloak/keycloak/realms/Gamify-IT @@ -249,6 +261,23 @@ services: - OVERWORLD_URL=http://overworld-backend/api/v1 - KEYCLOAK_ISSUER=http://localhost/keycloak/realms/Gamify-IT - KEYCLOAK_URL=http://keycloak/keycloak/realms/Gamify-IT + + towercrush-backend: + container_name: towercrush-backend + image: ghcr.io/gamify-it/towercrush-backend:main + restart: always + pull_policy: always + expose: + - "80" + depends_on: + - towercrush-db + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=postgres + - POSTGRES_URL=postgresql://towercrush-db:5432/postgres + - OVERWORLD_URL=http://overworld-backend/api/v1 + - KEYCLOAK_ISSUER=http://localhost/keycloak/realms/Gamify-IT + - KEYCLOAK_URL=http://keycloak/keycloak/realms/Gamify-IT towerdefense-backend: container_name: towerdefense-backend @@ -262,7 +291,7 @@ services: environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres - - POSTGRES_URL=postgresql://regexgame-db:5432/postgres + - POSTGRES_URL=postgresql://towerdefense-db:5432/postgres - OVERWORLD_URL=http://overworld-backend/api/v1 - KEYCLOAK_ISSUER=http://localhost/keycloak/realms/Gamify-IT - KEYCLOAK_URL=http://keycloak/keycloak/realms/Gamify-IT @@ -331,6 +360,22 @@ services: restart: always expose: - "80" + + towercrush: + container_name: towercrush + image: ghcr.io/gamify-it/towercrush:main + pull_policy: always + restart: always + expose: + - "80" + + towerdefense: + container_name: towerdefense + image: ghcr.io/gamify-it/towerdefense:main + pull_policy: always + restart: always + expose: + - "80" # reverse-proxy reverse-proxy: diff --git a/src/components/EditMinigameModals/EditChickenshockConfigurationModal.vue b/src/components/EditMinigameModals/EditChickenshockConfigurationModal.vue index df11114..09d0972 100644 --- a/src/components/EditMinigameModals/EditChickenshockConfigurationModal.vue +++ b/src/components/EditMinigameModals/EditChickenshockConfigurationModal.vue @@ -1,6 +1,14 @@