From 73a1ffa3675b2e08c9a61553f826840c19b02ab1 Mon Sep 17 00:00:00 2001 From: Fabian Date: Fri, 21 Feb 2025 16:15:55 +0100 Subject: [PATCH 01/26] added files for uml game currently still as placeholder/with missing or wrong contents --- .../EditUmlGameConfigurationModal.vue | 375 ++++++++++++++++++ src/config.ts | 1 + src/ts/models/umlgame-models.ts | 13 + src/ts/rest-clients/umlgame-rest-client.ts | 17 + 4 files changed, 406 insertions(+) create mode 100644 src/components/EditMinigameModals/EditUmlGameConfigurationModal.vue create mode 100644 src/ts/models/umlgame-models.ts create mode 100644 src/ts/rest-clients/umlgame-rest-client.ts diff --git a/src/components/EditMinigameModals/EditUmlGameConfigurationModal.vue b/src/components/EditMinigameModals/EditUmlGameConfigurationModal.vue new file mode 100644 index 0000000..fa18e6c --- /dev/null +++ b/src/components/EditMinigameModals/EditUmlGameConfigurationModal.vue @@ -0,0 +1,375 @@ + + + diff --git a/src/config.ts b/src/config.ts index 5b1dd97..1c83726 100644 --- a/src/config.ts +++ b/src/config.ts @@ -10,4 +10,5 @@ export default { memoryApiUrl: "/minigames/memory/api/v1", regexgameApiUrl: "/minigames/regexgame/api/v1", towerdefenseApiUrl: "/minigames/towerdefense/api/v1", + umlGameApiUrl: "/minigames/umlgame/api/v1", }; diff --git a/src/ts/models/umlgame-models.ts b/src/ts/models/umlgame-models.ts new file mode 100644 index 0000000..556c8b4 --- /dev/null +++ b/src/ts/models/umlgame-models.ts @@ -0,0 +1,13 @@ +// TODO: implement, currently placeholders +export interface IUmlGameConfiguration { + id?: string; + graph: {}; +} + +export class UmlGameConfiguration implements IUmlGameConfiguration { + id?: string; + graph: {}; + public constructor(graph: {}) { + this.graph = graph; + } +} \ No newline at end of file diff --git a/src/ts/rest-clients/umlgame-rest-client.ts b/src/ts/rest-clients/umlgame-rest-client.ts new file mode 100644 index 0000000..9282996 --- /dev/null +++ b/src/ts/rest-clients/umlgame-rest-client.ts @@ -0,0 +1,17 @@ +import axios, { AxiosResponse } from "axios"; + +import config from "@/config"; + +import { IUmlGameConfiguration } from "@/ts/models/umlgame-models"; + +export async function postUmlGameConfig(umlGameConfig: IUmlGameConfiguration +): Promise { + return axios.post( + `${config.umlGameApiUrl}/configurations`, + umlGameConfig + ); +} + +export async function getUmlGameConfig(id: string): Promise { + return axios.get(`${config.umlGameApiUrl}/configurations/${id}`); +} From da848f6836fca1a67d47a514e662c60a146ce537 Mon Sep 17 00:00:00 2001 From: Fabian Date: Mon, 17 Mar 2025 19:15:31 +0100 Subject: [PATCH 02/26] enabled uml game selection --- docker-compose-dev.yaml | 8 -------- .../EditUmlGameConfigurationModal.vue | 2 +- src/ts/models/overworld-models.ts | 1 + src/views/MinigameTasksView.vue | 14 +++++++++++++- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/docker-compose-dev.yaml b/docker-compose-dev.yaml index 758309c..4ca2529 100644 --- a/docker-compose-dev.yaml +++ b/docker-compose-dev.yaml @@ -369,14 +369,6 @@ services: expose: - "80" - towerdefense: - container_name: towerdefense - image: ghcr.io/gamify-it/towerdefense:main - pull_policy: always - restart: always - expose: - - "80" - towerdefense: container_name: towerdefense image: ghcr.io/gamify-it/towerdefense:main diff --git a/src/components/EditMinigameModals/EditUmlGameConfigurationModal.vue b/src/components/EditMinigameModals/EditUmlGameConfigurationModal.vue index fa18e6c..a4778ea 100644 --- a/src/components/EditMinigameModals/EditUmlGameConfigurationModal.vue +++ b/src/components/EditMinigameModals/EditUmlGameConfigurationModal.vue @@ -283,7 +283,7 @@ async function importFile(event: any) { Add question diff --git a/src/ts/models/overworld-models.ts b/src/ts/models/overworld-models.ts index e2785b6..9af7dd9 100644 --- a/src/ts/models/overworld-models.ts +++ b/src/ts/models/overworld-models.ts @@ -109,6 +109,7 @@ export enum Minigame { REGEXGAME = "REGEXGAME", TOWERCRUSH = "TOWERCRUSH", TOWERDEFENSE = "TOWERDEFENSE", + UMLGAME = "UMLGAME", } export class Course implements ICourse { diff --git a/src/views/MinigameTasksView.vue b/src/views/MinigameTasksView.vue index 1755989..47abac3 100644 --- a/src/views/MinigameTasksView.vue +++ b/src/views/MinigameTasksView.vue @@ -20,6 +20,7 @@ import MapImageModal from "@/components/MapImageModal.vue"; import EditBugfinderConifgurationModal from "@/components/EditMinigameModals/EditBugfinderConfigurationModal.vue"; import router from "@/router"; import { getCourse } from "@/ts/rest-clients/course-rest-client"; +import EditUmlGameConfigurationModal from "@/components/EditMinigameModals/EditUmlGameConfigurationModal.vue"; const availableMinigames = Object.values(Minigame); @@ -47,6 +48,7 @@ const showBugfinderModal = ref(false); const showMemoryModal = ref(false); const showRegexGameModal = ref(false); const showTowerDefenseModal = ref(false); +const showUMLGameModal = ref(false); const courseName = ref(""); watch( @@ -330,7 +332,7 @@ function changedMinigame(task: ITask) { ).then((response) => { task = response.data; toast.success( - `Minigame in ${courseName.value} was updated to ${task.game}! )` + `Minigame in ${courseName.value} was updated to ${task.game}!` ); console.log( "Changed minigame to " + task.game + " in course " + courseName.value @@ -369,6 +371,9 @@ function editMinigameConfiguration(task: ITask) { case Minigame.TOWERDEFENSE: showTowerDefenseModal.value = true; break; + case Minigame.UMLGAME: + showUMLGameModal.value = true; + break; default: console.log( "This minigame is currently not supported to be edited here." @@ -411,6 +416,7 @@ function closedEditModal() { showMemoryModal.value = false; showRegexGameModal.value = false; showTowerDefenseModal.value = false; + showUMLGameModal.value = false; } function redirectToStatisticView(task: ITask) { @@ -568,4 +574,10 @@ function redirectToStatisticView(task: ITask) { @updateMinigameConfiguration="updateMinigameConfiguration" @closedModal="closedEditModal" /> + From 5fe23c28bdd1cd6937959d15f58e7e6b39509790 Mon Sep 17 00:00:00 2001 From: Fabian Date: Wed, 2 Apr 2025 14:53:51 +0200 Subject: [PATCH 03/26] added uml game to docker files --- .nginx/compose/nginx-dev.conf | 8 ++++++++ .nginx/compose/nginx.conf | 8 ++++++++ docker-compose-dev.yaml | 34 ++++++++++++++++++++++++++++++++++ docker-compose.yaml | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 84 insertions(+) diff --git a/.nginx/compose/nginx-dev.conf b/.nginx/compose/nginx-dev.conf index 4f79692..2eb8853 100644 --- a/.nginx/compose/nginx-dev.conf +++ b/.nginx/compose/nginx-dev.conf @@ -44,6 +44,10 @@ server { proxy_pass http://towercrush-backend/api/; } + location /minigames/umlgame/api/ { + proxy_pass http://umlgame-backend/api; + } + location /minigames/towerdefense/api/ { proxy_pass http://towerdefense-backend/api/; } @@ -84,6 +88,10 @@ server { proxy_pass http://towercrush/; } + location /minigames/umlgame/ { + proxy_pass http://umlgame/; + } + location /minigames/towerdefense/ { proxy_pass http://towerdefense/; } diff --git a/.nginx/compose/nginx.conf b/.nginx/compose/nginx.conf index 69cd48f..2dfbdc4 100644 --- a/.nginx/compose/nginx.conf +++ b/.nginx/compose/nginx.conf @@ -48,6 +48,10 @@ server { proxy_pass http://towercrush-backend/api/; } + location /minigames/umlgame/api/ { + proxy_pass http://umlgame-backend/api; + } + location /minigames/towerdefense/api/ { proxy_pass http://towerdefense-backend/api/; } @@ -84,6 +88,10 @@ server { proxy_pass http://towercrush/; } + location /minigames/umlgame/ { + proxy_pass http://umlgame/; + } + location /minigames/towerdefense/ { proxy_pass http://towerdefense/; } diff --git a/docker-compose-dev.yaml b/docker-compose-dev.yaml index 4ca2529..1daba8a 100644 --- a/docker-compose-dev.yaml +++ b/docker-compose-dev.yaml @@ -115,6 +115,16 @@ services: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres + umlgame-db: + container_name: umlgame-db + image: postgres:14-alpine + restart: always + ports: + - "5432:5432" + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=postgres + #backends keycloak: container_name: keycloak @@ -296,6 +306,22 @@ services: - KEYCLOAK_ISSUER=http://localhost/keycloak/realms/Gamify-IT - KEYCLOAK_URL=http://keycloak/keycloak/realms/Gamify-IT + umlgame-backend: + container_name: umlgame-backend + image: ghcr.io/gamify-it/umlgame-backend:main + restart: always + expose: + - "80" + depends_on: + - umlgame-db + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=postgres + - POSTGRES_URL=postgresql://umlgame-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 + #frontends landing-page: container_name: landing-page @@ -377,6 +403,14 @@ services: expose: - "80" + umlgame: + container_name: umlgame + image: ghcr.io/gamify-it/umlgame:main + restart: always + pull_policy: always + expose: + - "80" + # reverse-proxy reverse-proxy: container_name: reverse-proxy diff --git a/docker-compose.yaml b/docker-compose.yaml index 024e52b..62c89a9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -96,6 +96,16 @@ services: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres + umlgame-db: + container_name: umlgame-db + image: postgres:14-alpine + restart: always + ports: + - "5432:5432" + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=postgres + #backends keycloak: container_name: keycloak @@ -241,6 +251,22 @@ services: - KEYCLOAK_ISSUER=http://localhost/keycloak/realms/Gamify-IT - KEYCLOAK_URL=http://keycloak/keycloak/realms/Gamify-IT + umlgame-backend: + container_name: umlgame-backend + image: ghcr.io/gamify-it/umlgame-backend:main + restart: always + expose: + - "80" + depends_on: + - umlgame-db + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=postgres + - POSTGRES_URL=postgresql://umlgame-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 + #frontends landing-page: container_name: landing-page @@ -312,6 +338,14 @@ services: expose: - "80" + umlgame: + container_name: umlgame + image: ghcr.io/gamify-it/umlgame:main + restart: always + pull_policy: always + expose: + - "80" + # reverse-proxy reverse-proxy: container_name: reverse-proxy From cafcd955d7cefe71420aea5cbf8642c67b23a753 Mon Sep 17 00:00:00 2001 From: Fabian Date: Wed, 2 Apr 2025 21:12:43 +0200 Subject: [PATCH 04/26] selection mock --- .gitignore | 1 + .nginx/compose/nginx-dev.conf | 140 +++--- docker-compose-dev.yaml | 452 +++++++++--------- .../EditUmlGameConfigurationModal.vue | 50 +- src/config.ts | 2 +- src/ts/models/umlgame-models.ts | 4 +- src/ts/rest-clients/umlgame-rest-client.ts | 10 +- 7 files changed, 316 insertions(+), 343 deletions(-) diff --git a/.gitignore b/.gitignore index f37f3ea..435cd2f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ node_modules /dist /coverage +.prettierignore # local env files .env.local diff --git a/.nginx/compose/nginx-dev.conf b/.nginx/compose/nginx-dev.conf index 2eb8853..625ef82 100644 --- a/.nginx/compose/nginx-dev.conf +++ b/.nginx/compose/nginx-dev.conf @@ -16,41 +16,41 @@ server { proxy_pass http://keycloak/keycloak/; } - location /minigames/bugfinder/api/ { - proxy_pass http://bugfinder-backend/api/; - } - - location /minigames/chickenshock/api/ { - proxy_pass http://chickenshock-backend/api/; - } - - location /minigames/finitequiz/api/ { - proxy_pass http://finitequiz-backend/api/; - } - - location /minigames/crosswordpuzzle/api/ { - proxy_pass http://crosswordpuzzle-backend/api/; - } - - location /minigames/memory/api/ { - proxy_pass http://memory-backend/api/; - } - - location /minigames/regexgame/api/ { - proxy_pass http://regexgame-backend/api/; - } - - location /minigames/towercrush/api/ { - proxy_pass http://towercrush-backend/api/; - } - - location /minigames/umlgame/api/ { - proxy_pass http://umlgame-backend/api; - } - - location /minigames/towerdefense/api/ { - proxy_pass http://towerdefense-backend/api/; - } + #location /minigames/bugfinder/api/ { + # proxy_pass http://bugfinder-backend/api/; + #} + # + #location /minigames/chickenshock/api/ { + # proxy_pass http://chickenshock-backend/api/; + #} + # + #location /minigames/finitequiz/api/ { + # proxy_pass http://finitequiz-backend/api/; + #} + # + #location /minigames/crosswordpuzzle/api/ { + # proxy_pass http://crosswordpuzzle-backend/api/; + #} + # + #location /minigames/memory/api/ { + # proxy_pass http://memory-backend/api/; + #} + # + #location /minigames/regexgame/api/ { + # proxy_pass http://regexgame-backend/api/; + #} + # + #location /minigames/towercrush/api/ { + # proxy_pass http://towercrush-backend/api/; + #} + # + #location /minigames/umlgame/api/ { + # proxy_pass http://umlgame-backend/api; + #} + # + #location /minigames/towerdefense/api/ { + # proxy_pass http://towerdefense-backend/api/; + #} location /overworld/api/ { proxy_pass http://overworld-backend/api/; @@ -60,41 +60,41 @@ server { proxy_pass http://overworld/; } - location /minigames/chickenshock/ { - proxy_pass http://chickenshock/; - } - - location /minigames/bugfinder/ { - proxy_pass http://bugfinder/; - } - - location /minigames/finitequiz/ { - proxy_pass http://finitequiz/; - } - - location /minigames/crosswordpuzzle/ { - proxy_pass http://crosswordpuzzle/; - } - - location /minigames/memory/ { - proxy_pass http://memory/; - } - - location /minigames/regexgame/ { - proxy_pass http://regexgame/; - } - - location /minigames/towercrush/ { - proxy_pass http://towercrush/; - } - - location /minigames/umlgame/ { - proxy_pass http://umlgame/; - } - - location /minigames/towerdefense/ { - proxy_pass http://towerdefense/; - } + #location /minigames/chickenshock/ { + # proxy_pass http://chickenshock/; + #} + # + #location /minigames/bugfinder/ { + # proxy_pass http://bugfinder/; + #} + # + #location /minigames/finitequiz/ { + # proxy_pass http://finitequiz/; + #} + # + #location /minigames/crosswordpuzzle/ { + # proxy_pass http://crosswordpuzzle/; + #} + # + #location /minigames/memory/ { + # proxy_pass http://memory/; + #} + # + #location /minigames/regexgame/ { + # proxy_pass http://regexgame/; + #} + # + #location /minigames/towercrush/ { + # proxy_pass http://towercrush/; + #} + # + #location /minigames/umlgame/ { + # proxy_pass http://umlgame/; + #} + # + #location /minigames/towerdefense/ { + # proxy_pass http://towerdefense/; + #} location /lecturer-interface/ { proxy_pass http://host.docker.internal:8000/lecturer-interface/; diff --git a/docker-compose-dev.yaml b/docker-compose-dev.yaml index 1daba8a..6d6847b 100644 --- a/docker-compose-dev.yaml +++ b/docker-compose-dev.yaml @@ -89,8 +89,8 @@ services: container_name: regexgame-db image: postgres:14-alpine restart: always - ports: - - "5432:5432" + expose: + - "5432" environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres @@ -119,8 +119,8 @@ services: container_name: umlgame-db image: postgres:14-alpine restart: always - ports: - - "5432:5432" + expose: + - "5432" environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres @@ -170,157 +170,157 @@ services: - KEYCLOAK_ISSUER=http://localhost/keycloak/realms/Gamify-IT - KEYCLOAK_URL=http://keycloak/keycloak/realms/Gamify-IT - chickenshock-backend: - container_name: chickenshock-backend - image: ghcr.io/gamify-it/chickenshock-backend:main - restart: always - pull_policy: always - expose: - - "80" - depends_on: - - chickenshock-db - environment: - - POSTGRES_USER=postgres - - POSTGRES_PASSWORD=postgres - - POSTGRES_URL=postgresql://chickenshock-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 - - bugfinder-backend: - container_name: bugfinder-backend - image: ghcr.io/gamify-it/bugfinder-backend:main - restart: always - pull_policy: always - expose: - - "80" - depends_on: - - bugfinder-db - environment: - - POSTGRES_USER=postgres - - POSTGRES_PASSWORD=postgres - - POSTGRES_URL=postgresql://bugfinder-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 - - finitequiz-backend: - container_name: finitequiz-backend - image: ghcr.io/gamify-it/finitequiz-backend:main - restart: always - pull_policy: always - expose: - - "80" - depends_on: - - chickenshock-db - environment: - - POSTGRES_USER=postgres - - POSTGRES_PASSWORD=postgres - - POSTGRES_URL=postgresql://finitequiz-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 - - crosswordpuzzle-backend: - container_name: crosswordpuzzle-backend - image: ghcr.io/gamify-it/crosswordpuzzle-backend:main - restart: always - pull_policy: always - expose: - - "80" - depends_on: - - crosswordpuzzle-db - environment: - - POSTGRES_USER=postgres - - POSTGRES_PASSWORD=postgres - - POSTGRES_URL=postgresql://crosswordpuzzle-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 - - memory-backend: - container_name: memory-backend - image: ghcr.io/gamify-it/memory-backend:main - restart: always - pull_policy: always - expose: - - "80" - depends_on: - - memory-db - environment: - - POSTGRES_USER=postgres - - POSTGRES_PASSWORD=postgres - - POSTGRES_URL=postgresql://memory-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 - - regexgame-backend: - container_name: regexgame-backend - image: ghcr.io/gamify-it/regexgame-backend:main - restart: always - pull_policy: always - expose: - - "80" - depends_on: - - regexgame-db - environment: - - POSTGRES_USER=postgres - - POSTGRES_PASSWORD=postgres - - POSTGRES_URL=postgresql://regexgame-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 - - 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 - image: ghcr.io/gamify-it/towerdefense-backend:main - restart: always - pull_policy: always - expose: - - "80" - depends_on: - - towerdefense-db - environment: - - POSTGRES_USER=postgres - - POSTGRES_PASSWORD=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 - - umlgame-backend: - container_name: umlgame-backend - image: ghcr.io/gamify-it/umlgame-backend:main - restart: always - expose: - - "80" - depends_on: - - umlgame-db - environment: - - POSTGRES_USER=postgres - - POSTGRES_PASSWORD=postgres - - POSTGRES_URL=postgresql://umlgame-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 +#chickenshock-backend: +# container_name: chickenshock-backend +# image: ghcr.io/gamify-it/chickenshock-backend:main +# restart: always +# pull_policy: always +# expose: +# - "80" +# depends_on: +# - chickenshock-db +# environment: +# - POSTGRES_USER=postgres +# - POSTGRES_PASSWORD=postgres +# - POSTGRES_URL=postgresql://chickenshock-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 +# +#bugfinder-backend: +# container_name: bugfinder-backend +# image: ghcr.io/gamify-it/bugfinder-backend:main +# restart: always +# pull_policy: always +# expose: +# - "80" +# depends_on: +# - bugfinder-db +# environment: +# - POSTGRES_USER=postgres +# - POSTGRES_PASSWORD=postgres +# - POSTGRES_URL=postgresql://bugfinder-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 +# +#finitequiz-backend: +# container_name: finitequiz-backend +# image: ghcr.io/gamify-it/finitequiz-backend:main +# restart: always +# pull_policy: always +# expose: +# - "80" +# depends_on: +# - chickenshock-db +# environment: +# - POSTGRES_USER=postgres +# - POSTGRES_PASSWORD=postgres +# - POSTGRES_URL=postgresql://finitequiz-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 +# +#crosswordpuzzle-backend: +# container_name: crosswordpuzzle-backend +# image: ghcr.io/gamify-it/crosswordpuzzle-backend:main +# restart: always +# pull_policy: always +# expose: +# - "80" +# depends_on: +# - crosswordpuzzle-db +# environment: +# - POSTGRES_USER=postgres +# - POSTGRES_PASSWORD=postgres +# - POSTGRES_URL=postgresql://crosswordpuzzle-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 +# +#memory-backend: +# container_name: memory-backend +# image: ghcr.io/gamify-it/memory-backend:main +# restart: always +# pull_policy: always +# expose: +# - "80" +# depends_on: +# - memory-db +# environment: +# - POSTGRES_USER=postgres +# - POSTGRES_PASSWORD=postgres +# - POSTGRES_URL=postgresql://memory-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 +# +#regexgame-backend: +# container_name: regexgame-backend +# image: ghcr.io/gamify-it/regexgame-backend:main +# restart: always +# pull_policy: always +# expose: +# - "80" +# depends_on: +# - regexgame-db +# environment: +# - POSTGRES_USER=postgres +# - POSTGRES_PASSWORD=postgres +# - POSTGRES_URL=postgresql://regexgame-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 +# +#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 +# image: ghcr.io/gamify-it/towerdefense-backend:main +# restart: always +# pull_policy: always +# expose: +# - "80" +# depends_on: +# - towerdefense-db +# environment: +# - POSTGRES_USER=postgres +# - POSTGRES_PASSWORD=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 +# + #umlgame-backend: + # container_name: umlgame-backend + # image: ghcr.io/gamify-it/umlgame-backend:main + # restart: always + # expose: + # - "80" + # depends_on: + # - umlgame-db + # environment: + # - POSTGRES_USER=postgres + # - POSTGRES_PASSWORD=postgres + # - POSTGRES_URL=postgresql://umlgame-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 #frontends landing-page: @@ -339,77 +339,77 @@ services: expose: - "80" - chickenshock: - container_name: chickenshock - image: ghcr.io/gamify-it/chickenshock:main - pull_policy: always - restart: always - expose: - - "80" - - finitequiz: - container_name: finitequiz - image: ghcr.io/gamify-it/finitequiz:main - pull_policy: always - restart: always - expose: - - "80" - - crosswordpuzzle: - container_name: crosswordpuzzle - image: ghcr.io/gamify-it/crosswordpuzzle:main - pull_policy: always - restart: always - expose: - - "80" - - bugfinder: - container_name: bugfinder - image: ghcr.io/gamify-it/bugfinder:main - pull_policy: always - restart: always - expose: - - "80" - - memory: - container_name: memory - image: ghcr.io/gamify-it/memory:main - pull_policy: always - restart: always - expose: - - "80" - - regexgame: - container_name: regexgame - image: ghcr.io/gamify-it/regexgame:main - pull_policy: always - 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" - - umlgame: - container_name: umlgame - image: ghcr.io/gamify-it/umlgame:main - restart: always - pull_policy: always - expose: - - "80" + #chickenshock: + # container_name: chickenshock + # image: ghcr.io/gamify-it/chickenshock:main + # pull_policy: always + # restart: always + # expose: + # - "80" + # + #finitequiz: + # container_name: finitequiz + # image: ghcr.io/gamify-it/finitequiz:main + # pull_policy: always + # restart: always + # expose: + # - "80" + # + #crosswordpuzzle: + # container_name: crosswordpuzzle + # image: ghcr.io/gamify-it/crosswordpuzzle:main + # pull_policy: always + # restart: always + # expose: + # - "80" + # + #bugfinder: + # container_name: bugfinder + # image: ghcr.io/gamify-it/bugfinder:main + # pull_policy: always + # restart: always + # expose: + # - "80" + # + #memory: + # container_name: memory + # image: ghcr.io/gamify-it/memory:main + # pull_policy: always + # restart: always + # expose: + # - "80" + # + #regexgame: + # container_name: regexgame + # image: ghcr.io/gamify-it/regexgame:main + # pull_policy: always + # 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" + + #umlgame: + # container_name: umlgame + #image: ghcr.io/gamify-it/umlgame:main + # restart: always + #pull_policy: always + #expose: + # - "80" # reverse-proxy reverse-proxy: diff --git a/src/components/EditMinigameModals/EditUmlGameConfigurationModal.vue b/src/components/EditMinigameModals/EditUmlGameConfigurationModal.vue index a4778ea..3611d10 100644 --- a/src/components/EditMinigameModals/EditUmlGameConfigurationModal.vue +++ b/src/components/EditMinigameModals/EditUmlGameConfigurationModal.vue @@ -16,6 +16,7 @@ import { putMinigame } from "@/ts/rest-clients/minigame-rest-client"; import { useRoute } from "vue-router"; import { ITask } from "@/ts/models/overworld-models"; import ImportExportConfiguration from "@/components/ImportExportConfiguration.vue"; +import { BFormRow, BTable } from "bootstrap-vue-3"; const props = defineProps<{ minigame: ITask; @@ -280,51 +281,21 @@ async function importFile(event: any) { v-if="minigame !== undefined" > - - Add question - - - - - - - \ No newline at end of file diff --git a/src/ts/models/links.ts b/src/ts/models/links.ts new file mode 100644 index 0000000..5aee31e --- /dev/null +++ b/src/ts/models/links.ts @@ -0,0 +1,115 @@ +import { shapes, util } from '@joint/core'; + +export class CustRect extends shapes.standard.Rectangle { + override defaults() { + return { + ...super.defaults, + type: 'Rect', + size: { width: 100, height: 80 }, + attrs: { + body: { + width: 'calc(w)', + height: 'calc(h)', + fill: 'white', + strokeWidth: 2, + stroke: 'black' + }, + line1: { + x1: 0, y1: 25, x2: 'calc(w)', y2: 25, + stroke: 'black', strokeWidth: 1 + }, + line2: { + x1: 0, y1: 50, x2: 'calc(w)', y2: 50, + stroke: 'black', strokeWidth: 1 + }, + typeLabel: { + text: '', + textVerticalAnchor: 'middle', + textAnchor: 'middle', + fontSize: 8, + fontStyle: 'italic', + x: 'calc(w/2)', + y: 4 + }, + label: { + text: 'Classname', + textVerticalAnchor: 'middle', + textAnchor: 'middle', + fontSize: 12, + x: 'calc(w/2)', + y: 17 + }, + secondaryLabel: { + text: 'Attributes', + textVerticalAnchor: 'middle', + textAnchor: 'middle', + fontSize: 12, + x: 'calc(w/2)', + y: 37 + }, + thirdLabel: { + text: 'Methods', + textVerticalAnchor: 'middle', + textAnchor: 'middle', + fontSize: 12, + x: 'calc(w/2)', + y: 65 + } + } + }; + } + + override preinitialize() { + this.markup = util.svg/* xml */ ` + + + + + + + + `; + } +} + +export class InterfaceRect extends CustRect { + override defaults() { + return { + ...super.defaults(), + type: 'InterfaceRect', + attrs: { + ...super.defaults().attrs, + body: { ...super.defaults().attrs.body, fill: '#cce5ff' }, + typeLabel: { ...super.defaults().attrs.typeLabel, text: '«interface»', fontSize: 10, y: 5 } + } + }; + } +} + +export class AbstractRect extends CustRect { + override defaults() { + return { + ...super.defaults(), + type: 'AbstractRect', + attrs: { + ...super.defaults().attrs, + body: { ...super.defaults().attrs.body, fill: '#ffe6cc' }, + typeLabel: { ...super.defaults().attrs.typeLabel, text: '«abstract»', fontSize: 10, y: 5 } + } + }; + } +} + +export class EnumRect extends CustRect { + override defaults() { + return { + ...super.defaults(), + type: 'EnumRect', + attrs: { + ...super.defaults().attrs, + body: { ...super.defaults().attrs.body, fill: '#d3f3d3' }, + typeLabel: { ...super.defaults().attrs.typeLabel, text: '«enum»', fontSize: 10, y: 5 } + } + }; + } +} From ff78d08fb13edd61ececac083581ef096a9f4dfc Mon Sep 17 00:00:00 2001 From: Fabian Date: Thu, 24 Apr 2025 17:56:50 +0200 Subject: [PATCH 10/26] modal emits --- .../EditUmlGameConfigurationModal.vue | 13 +++-- .../UmlModals/UmlEditorModal.vue | 48 ++++++++++++++++--- 2 files changed, 49 insertions(+), 12 deletions(-) diff --git a/src/components/EditMinigameModals/EditUmlGameConfigurationModal.vue b/src/components/EditMinigameModals/EditUmlGameConfigurationModal.vue index 3e51972..fd11c4b 100644 --- a/src/components/EditMinigameModals/EditUmlGameConfigurationModal.vue +++ b/src/components/EditMinigameModals/EditUmlGameConfigurationModal.vue @@ -1,11 +1,11 @@