From 482008c77b32bdc1854dfe2a65e8e537e8fd3a14 Mon Sep 17 00:00:00 2001
From: cnachtigall1991 <40701475+cnachtigall1991@users.noreply.github.com>
Date: Tue, 19 Oct 2021 07:24:16 +0200
Subject: [PATCH] working on economy graph
---
package.json | 2 +-
src/components/EqValueGraph.vue | 108 ++++++++++++++++++++++++++++++++
src/constants/index.js | 9 +++
src/router/index.js | 6 ++
src/utils/ApiRequests.js | 12 ++++
src/utils/index.js | 4 +-
src/views/Match.vue | 7 +++
yarn.lock | 14 ++---
8 files changed, 152 insertions(+), 10 deletions(-)
create mode 100644 src/components/EqValueGraph.vue
diff --git a/package.json b/package.json
index ecf1eca..893a547 100644
--- a/package.json
+++ b/package.json
@@ -17,7 +17,7 @@
"luxon": "^2.0.2",
"string-sanitizer": "^2.0.2",
"vue": "^3.2.19",
- "vue-router": "^4.0.11",
+ "vue-router": "next",
"vuex": "^4.0.2"
},
"devDependencies": {
diff --git a/src/components/EqValueGraph.vue b/src/components/EqValueGraph.vue
new file mode 100644
index 0000000..7c1ec55
--- /dev/null
+++ b/src/components/EqValueGraph.vue
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/constants/index.js b/src/constants/index.js
index 452f08a..ebacbee 100644
--- a/src/constants/index.js
+++ b/src/constants/index.js
@@ -9,3 +9,12 @@ export const HITGROUPS = {
7: 'HitGroupRightLeg',
10: 'HitGroupGear'
}
+
+export const GRENADES = {
+ 501: 'EqDecoy', // eqElementToName[EqDecoy] = "Decoy Grenade"
+ 502: 'EqMolotov', // eqElementToName[EqMolotov] = "Molotov"
+ 503: 'EqIncendiary', // eqElementToName[EqIncendiary] = "Incendiary Grenade"
+ 504: 'EqFlash', // eqElementToName[EqFlash] = "Flashbang"
+ 505: 'EqSmoke', // eqElementToName[EqSmoke] = "Smoke Grenade"
+ 506: 'EqHE', // eqElementToName[EqHE] = "HE Grenade"
+}
diff --git a/src/router/index.js b/src/router/index.js
index 0d7c3a6..22b5d7d 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -46,6 +46,12 @@ const routes = [
score: lazyLoadComponent('ScoreTeam')
}
},
+ {
+ path: 'Economy',
+ components: {
+ score: lazyLoadComponent('EqValueGraph')
+ }
+ },
{
path: 'details',
components: {
diff --git a/src/utils/ApiRequests.js b/src/utils/ApiRequests.js
index 9fee1eb..59de08f 100644
--- a/src/utils/ApiRequests.js
+++ b/src/utils/ApiRequests.js
@@ -54,3 +54,15 @@ export const TrackMe = async (id64, authcode, sharecode) => {
return [status, statusError]
}
+
+export const getPlayerValue = async (match_id) => {
+ try {
+ const res = await axios.get(`${API_URL}/match/${match_id}/rounds`)
+
+ if (res.status === 200) {
+ return res.data
+ }
+ } catch (err) {
+ console.log(err.response.status, err.response.statusText)
+ }
+}
diff --git a/src/utils/index.js b/src/utils/index.js
index 0766fdc..bed707a 100644
--- a/src/utils/index.js
+++ b/src/utils/index.js
@@ -3,7 +3,7 @@ import {GoToLink, GoToMatch, GoToPlayer} from "./GoTo";
import {SaveLastVisitedToLocalStorage} from "./LocalStorage";
import {GetHLTV_1} from "./HLTV";
import {DisplayRank, LoadImage} from "./Display";
-import {GetUser, TrackMe} from "./ApiRequests";
+import {GetUser, TrackMe, getPlayerValue} from "./ApiRequests";
import {setTitle, GetWinLoss, truncate, checkStatEmpty, getPlayerArr, constructAvatarUrl, GetAvgRank} from "./Utils";
export {
@@ -12,6 +12,6 @@ export {
SaveLastVisitedToLocalStorage,
GetHLTV_1,
DisplayRank, LoadImage,
- GetUser, TrackMe,
+ GetUser, TrackMe, getPlayerValue,
setTitle, GetWinLoss, truncate, checkStatEmpty, getPlayerArr, constructAvatarUrl, GetAvgRank
}
diff --git a/src/views/Match.vue b/src/views/Match.vue
index 6a217e6..a46d7b0 100644
--- a/src/views/Match.vue
+++ b/src/views/Match.vue
@@ -41,6 +41,13 @@
replace>Scoreboard
+
+
+
+
+ p1
+ p2
+
+
+
+ {{i + ' - ' + round}}
+