From 66ac79f6fb7b44dd8bc81efc881fc6cf04c6f9da Mon Sep 17 00:00:00 2001 From: Samuel Bryan Date: Fri, 1 May 2020 19:02:45 +0100 Subject: [PATCH] Feature/193 WG API to Proxy + Refactor Room State + Implement basic Authentication + Implement premature code for Socket.io (#196) * WIP * #193 - Migrate from WG API to Proxy + update Room state * Remove console logs for authentication --- .env | 10 +- .eslintrc.js | 1 + src/App.vue | 59 ++-- src/components/TheCanvas.vue | 62 ++-- src/components/TheEntityPanel.vue | 10 +- src/components/entity-panel/games/Wows.vue | 106 +++--- src/components/navigation/LoginCard.vue | 52 +++ src/components/navigation/TheUserMenu.vue | 44 ++- src/games/wows/api.ts | 34 ++ src/plugins/vuetify.ts | 10 +- src/store/index.ts | 28 +- src/store/modules/authentication.ts | 54 +++- src/store/modules/canvas.ts | 2 - src/store/modules/room.ts | 354 ++++++++++++--------- src/store/modules/socket.ts | 38 +-- src/store/modules/types.d.ts | 56 ++++ src/tools/Circle.ts | 2 +- src/tools/Erase.ts | 2 +- src/tools/FreeDraw.ts | 2 +- src/tools/Line.ts | 2 +- src/tools/Move.ts | 2 +- src/tools/Ping.ts | 2 +- src/tools/Ruler.ts | 2 +- src/tools/Text.ts | 2 +- src/types/Games/Index.ts | 13 +- src/types/Games/Wows.ts | 140 +++++++- src/views/Room.vue | 36 ++- 27 files changed, 779 insertions(+), 346 deletions(-) create mode 100644 src/components/navigation/LoginCard.vue create mode 100644 src/games/wows/api.ts create mode 100644 src/store/modules/types.d.ts diff --git a/.env b/.env index 18422d3..ebd9e54 100644 --- a/.env +++ b/.env @@ -1,8 +1,10 @@ NODE_ENV=development -VUE_APP_MS_SOCK=localhost:4000 -VUE_APP_MS_AUTH=https://auth.eu.gametactic.eu -VUE_APP_MS_MAPS=https://maps.eu.gametactic.eu -VUE_APP_MS_USER=https://user.eu.gametactic.eu +VUE_APP_MS_SOCK=https://socket.gametactic.eu +# VUE_APP_MS_SOCK=http://localhost:3000 +VUE_APP_MS_AUTH=https://authentication.gametactic.eu +VUE_APP_MS_MAPS=https://maps.gametactic.eu +VUE_APP_MS_USER=https://user.gametactic.eu +VUE_APP_MS_WG_API=https://wg-api.gametactic.eu VUE_APP_ROOM_PRIMARY_COLOUR=#004e8c VUE_APP_DEFAULT_LOCALE=en VUE_APP_LOCALE=en \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index cdff589..0ffb055 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -13,6 +13,7 @@ module.exports = { "no-console": process.env.NODE_ENV === "production" ? "error" : "off", "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off", "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/no-this-alias": "off", semi: ["error", "never"] }, parser: "vue-eslint-parser", diff --git a/src/App.vue b/src/App.vue index aaef3ce..6f3fca3 100644 --- a/src/App.vue +++ b/src/App.vue @@ -7,40 +7,51 @@ + + diff --git a/src/components/navigation/TheUserMenu.vue b/src/components/navigation/TheUserMenu.vue index 7a459fc..88fdcfc 100644 --- a/src/components/navigation/TheUserMenu.vue +++ b/src/components/navigation/TheUserMenu.vue @@ -16,6 +16,15 @@ + + Logout + + + Login + + + + User Profile + + Logout + + + Login + + + +