From 595adafa602676ba7b9edf729bf98fe712bd476d Mon Sep 17 00:00:00 2001 From: Casey Williams Date: Fri, 27 Jan 2023 15:51:36 -0500 Subject: [PATCH 1/3] Initial commit of admin panel --- UT4MasterServer.Web/package-lock.json | 25 ++++++ UT4MasterServer.Web/package.json | 2 + .../src/components/CrudPage.vue | 58 ++++++++++++++ UT4MasterServer.Web/src/components/Footer.vue | 2 +- UT4MasterServer.Web/src/components/Header.vue | 18 ++++- UT4MasterServer.Web/src/components/Hub.vue | 2 +- .../src/components/LoadingPanel.vue | 24 +++++- UT4MasterServer.Web/src/components/Match.vue | 4 +- .../src/components/MatchList.vue | 2 +- .../src/components/StatCard.vue | 10 +-- .../src/components/StatSection.vue | 4 +- .../src/components/UserInfo.vue | 8 +- UT4MasterServer.Web/src/enums/account-flag.ts | 8 ++ .../src/enums/game-server-trust.ts | 5 ++ .../src/pages/Admin/Accounts/Accounts.vue | 78 ++++++++++++++++++ .../Admin/Accounts/components/EditAccount.vue | 18 +++++ .../Accounts/components/EditAccountFlags.vue | 80 +++++++++++++++++++ .../src/pages/Admin/TrustedServers.vue | 17 ++++ .../src/pages/Instructions/HubOwners.vue | 2 +- .../src/pages/Instructions/StockUT4.vue | 2 +- .../src/pages/Instructions/UT4UU.vue | 2 +- UT4MasterServer.Web/src/pages/Login.vue | 12 +-- .../src/pages/Profile/ChangeEmail.vue | 10 +-- .../src/pages/Profile/ChangePassword.vue | 14 ++-- .../src/pages/Profile/ChangeUsername.vue | 10 +-- .../src/pages/Profile/PlayerCard.vue | 6 +- UT4MasterServer.Web/src/pages/Register.vue | 10 +-- UT4MasterServer.Web/src/pages/Servers.vue | 12 +-- UT4MasterServer.Web/src/pages/Stats.vue | 24 +++--- UT4MasterServer.Web/src/route-guards.ts | 7 ++ UT4MasterServer.Web/src/routes.ts | 23 +++++- .../src/services/account.service.ts | 10 +-- .../src/services/admin-service.ts | 34 ++++++++ .../src/services/authentication.service.ts | 14 ++-- .../src/services/custom.service.ts | 2 +- .../src/services/http.service.ts | 21 ++--- .../src/services/stats.service.ts | 2 +- .../src/stores/account-store.ts | 10 ++- .../src/stores/server-store.ts | 7 +- .../src/stores/session-store.ts | 4 +- UT4MasterServer.Web/src/types/account.ts | 20 +++++ .../src/types/refresh-session-request.ts | 2 +- .../src/types/statistic-config.ts | 2 +- .../src/types/trusted-game-server.ts | 7 ++ UT4MasterServer.Web/src/utils/utilities.ts | 12 +++ UT4MasterServer.Web/tsconfig.json | 7 +- UT4MasterServer.Web/vite.config.ts | 8 +- .../Controllers/AccountController.cs | 15 ++++ 48 files changed, 562 insertions(+), 114 deletions(-) create mode 100644 UT4MasterServer.Web/src/components/CrudPage.vue create mode 100644 UT4MasterServer.Web/src/enums/account-flag.ts create mode 100644 UT4MasterServer.Web/src/enums/game-server-trust.ts create mode 100644 UT4MasterServer.Web/src/pages/Admin/Accounts/Accounts.vue create mode 100644 UT4MasterServer.Web/src/pages/Admin/Accounts/components/EditAccount.vue create mode 100644 UT4MasterServer.Web/src/pages/Admin/Accounts/components/EditAccountFlags.vue create mode 100644 UT4MasterServer.Web/src/pages/Admin/TrustedServers.vue create mode 100644 UT4MasterServer.Web/src/services/admin-service.ts create mode 100644 UT4MasterServer.Web/src/types/trusted-game-server.ts create mode 100644 UT4MasterServer.Web/src/utils/utilities.ts diff --git a/UT4MasterServer.Web/package-lock.json b/UT4MasterServer.Web/package-lock.json index d8faaa6f..7cb58bee 100644 --- a/UT4MasterServer.Web/package-lock.json +++ b/UT4MasterServer.Web/package-lock.json @@ -10,8 +10,10 @@ "dependencies": { "@types/crypto-js": "^4.1.1", "@types/vue-router": "^2.0.0", + "@vueform/multiselect": "^2.5.8", "crypto-js": "^4.1.1", "sass": "^1.57.1", + "ts-md5": "^1.3.1", "vue": "^3.2.45", "vue-recaptcha": "^2.0.3" }, @@ -580,6 +582,11 @@ "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.45.tgz", "integrity": "sha512-Ewzq5Yhimg7pSztDV+RH1UDKBzmtqieXQlpTVm2AwraoRL/Rks96mvd8Vgi7Lj+h+TH8dv7mXD3FRZR3TUvbSg==" }, + "node_modules/@vueform/multiselect": { + "version": "2.5.8", + "resolved": "https://registry.npmjs.org/@vueform/multiselect/-/multiselect-2.5.8.tgz", + "integrity": "sha512-etUJCCDlo3LDsbDLoJdDHFpvgHyl2rzcOG9VQvLJ3caNIHDYm0g+HMIbAydswWr1iWKstqRi9YkkBR75gQ9TBw==" + }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", @@ -1022,6 +1029,14 @@ "node": ">=8.0" } }, + "node_modules/ts-md5": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/ts-md5/-/ts-md5-1.3.1.tgz", + "integrity": "sha512-DiwiXfwvcTeZ5wCE0z+2A9EseZsztaiZtGrtSaY5JOD7ekPnR/GoIVD5gXZAlK9Na9Kvpo9Waz5rW64WKAWApg==", + "engines": { + "node": ">=12" + } + }, "node_modules/typescript": { "version": "4.9.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", @@ -1523,6 +1538,11 @@ "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.45.tgz", "integrity": "sha512-Ewzq5Yhimg7pSztDV+RH1UDKBzmtqieXQlpTVm2AwraoRL/Rks96mvd8Vgi7Lj+h+TH8dv7mXD3FRZR3TUvbSg==" }, + "@vueform/multiselect": { + "version": "2.5.8", + "resolved": "https://registry.npmjs.org/@vueform/multiselect/-/multiselect-2.5.8.tgz", + "integrity": "sha512-etUJCCDlo3LDsbDLoJdDHFpvgHyl2rzcOG9VQvLJ3caNIHDYm0g+HMIbAydswWr1iWKstqRi9YkkBR75gQ9TBw==" + }, "anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", @@ -1835,6 +1855,11 @@ "is-number": "^7.0.0" } }, + "ts-md5": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/ts-md5/-/ts-md5-1.3.1.tgz", + "integrity": "sha512-DiwiXfwvcTeZ5wCE0z+2A9EseZsztaiZtGrtSaY5JOD7ekPnR/GoIVD5gXZAlK9Na9Kvpo9Waz5rW64WKAWApg==" + }, "typescript": { "version": "4.9.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", diff --git a/UT4MasterServer.Web/package.json b/UT4MasterServer.Web/package.json index 0fa4e6e6..0a80c584 100644 --- a/UT4MasterServer.Web/package.json +++ b/UT4MasterServer.Web/package.json @@ -12,8 +12,10 @@ "dependencies": { "@types/crypto-js": "^4.1.1", "@types/vue-router": "^2.0.0", + "@vueform/multiselect": "^2.5.8", "crypto-js": "^4.1.1", "sass": "^1.57.1", + "ts-md5": "^1.3.1", "vue": "^3.2.45", "vue-recaptcha": "^2.0.3" }, diff --git a/UT4MasterServer.Web/src/components/CrudPage.vue b/UT4MasterServer.Web/src/components/CrudPage.vue new file mode 100644 index 00000000..4734246a --- /dev/null +++ b/UT4MasterServer.Web/src/components/CrudPage.vue @@ -0,0 +1,58 @@ + + + + + \ No newline at end of file diff --git a/UT4MasterServer.Web/src/components/Footer.vue b/UT4MasterServer.Web/src/components/Footer.vue index 0749bbe1..5d0db009 100644 --- a/UT4MasterServer.Web/src/components/Footer.vue +++ b/UT4MasterServer.Web/src/components/Footer.vue @@ -33,7 +33,7 @@ \ No newline at end of file diff --git a/UT4MasterServer.Web/src/components/Match.vue b/UT4MasterServer.Web/src/components/Match.vue index 5b6a7b5d..48200c19 100644 --- a/UT4MasterServer.Web/src/components/Match.vue +++ b/UT4MasterServer.Web/src/components/Match.vue @@ -43,9 +43,9 @@ div { \ No newline at end of file diff --git a/UT4MasterServer.Web/src/pages/Admin/Accounts/components/EditAccount.vue b/UT4MasterServer.Web/src/pages/Admin/Accounts/components/EditAccount.vue new file mode 100644 index 00000000..f4d91b0b --- /dev/null +++ b/UT4MasterServer.Web/src/pages/Admin/Accounts/components/EditAccount.vue @@ -0,0 +1,18 @@ + + + \ No newline at end of file diff --git a/UT4MasterServer.Web/src/pages/Admin/Accounts/components/EditAccountFlags.vue b/UT4MasterServer.Web/src/pages/Admin/Accounts/components/EditAccountFlags.vue new file mode 100644 index 00000000..d888dc63 --- /dev/null +++ b/UT4MasterServer.Web/src/pages/Admin/Accounts/components/EditAccountFlags.vue @@ -0,0 +1,80 @@ + + + + + + diff --git a/UT4MasterServer.Web/src/pages/Admin/TrustedServers.vue b/UT4MasterServer.Web/src/pages/Admin/TrustedServers.vue new file mode 100644 index 00000000..9bf2c997 --- /dev/null +++ b/UT4MasterServer.Web/src/pages/Admin/TrustedServers.vue @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/UT4MasterServer.Web/src/pages/Instructions/HubOwners.vue b/UT4MasterServer.Web/src/pages/Instructions/HubOwners.vue index 9836aba4..6101d678 100644 --- a/UT4MasterServer.Web/src/pages/Instructions/HubOwners.vue +++ b/UT4MasterServer.Web/src/pages/Instructions/HubOwners.vue @@ -35,5 +35,5 @@ diff --git a/UT4MasterServer.Web/src/pages/Instructions/StockUT4.vue b/UT4MasterServer.Web/src/pages/Instructions/StockUT4.vue index a8984547..5b7c32bf 100644 --- a/UT4MasterServer.Web/src/pages/Instructions/StockUT4.vue +++ b/UT4MasterServer.Web/src/pages/Instructions/StockUT4.vue @@ -49,5 +49,5 @@

To switch back to official Epic's servers, remove all lines that you added to Engine.ini file (added lines may have moved).

diff --git a/UT4MasterServer.Web/src/pages/Instructions/UT4UU.vue b/UT4MasterServer.Web/src/pages/Instructions/UT4UU.vue index f4704ee5..b1c7e4e1 100644 --- a/UT4MasterServer.Web/src/pages/Instructions/UT4UU.vue +++ b/UT4MasterServer.Web/src/pages/Instructions/UT4UU.vue @@ -21,5 +21,5 @@

To switch back to official Epic's servers, clear text box in Master Server Domain section.

diff --git a/UT4MasterServer.Web/src/pages/Login.vue b/UT4MasterServer.Web/src/pages/Login.vue index 7cb407e8..498530b2 100644 --- a/UT4MasterServer.Web/src/pages/Login.vue +++ b/UT4MasterServer.Web/src/pages/Login.vue @@ -40,15 +40,15 @@ diff --git a/UT4MasterServer.Web/src/components/UserInfo.vue b/UT4MasterServer.Web/src/components/UserInfo.vue index ce9e70de..223ae728 100644 --- a/UT4MasterServer.Web/src/components/UserInfo.vue +++ b/UT4MasterServer.Web/src/components/UserInfo.vue @@ -2,7 +2,7 @@