@golstats/gsc-lineups-reports 1.0.8 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/css/fonts.css +91 -91
- package/dist/gsc-lineups-reports.css +1 -1
- package/dist/gsc-lineups-reports.es.js +3135 -2751
- package/dist/gsc-lineups-reports.umd.js +10 -7
- package/dist/images/canchaRPH.svg +30 -30
- package/dist/images/events/atajada.svg +56 -56
- package/dist/images/events/fin-del-partido.svg +43 -43
- package/dist/images/events/fuera-de-lugar.svg +57 -57
- package/dist/images/events/gol.svg +48 -48
- package/dist/images/events/icn-cambio.svg +6 -6
- package/dist/images/events/icn-falta.svg +4 -4
- package/dist/images/events/icn-play.svg +3 -3
- package/dist/images/events/icn-tarjeta-amarilla.svg +3 -3
- package/dist/images/events/icn-tarjeta-roja.svg +3 -3
- package/dist/images/events/icn-tiro-a-porteria.svg +36 -36
- package/dist/images/events/icn-tiros-de-esquina.svg +18 -18
- package/dist/images/events/inicia-el-partido.svg +45 -45
- package/dist/images/events/jugada-peligrosa.svg +90 -90
- package/dist/images/events/penal-fallado.svg +194 -194
- package/dist/images/events/penal-marcado.svg +189 -189
- package/dist/images/events/tiempo-agregado.svg +74 -74
- package/dist/images/events/tiro-a-porteria.svg +80 -80
- package/dist/images/events/var.svg +30 -30
- package/package.json +7 -3
- package/src/components/Lineup2D/CheckBox.vue +42 -42
- package/src/components/Lineup2D/FilterEmpty.vue +48 -48
- package/src/components/Lineup2D/Icons.vue +29 -29
- package/src/components/Lineup2D/LineupField.vue +274 -274
- package/src/components/Lineup2D/LineupFilter.vue +285 -285
- package/src/components/Lineup2D/LineupMainHeader.vue +222 -222
- package/src/components/Lineup2D/LineupRecentItem.vue +110 -110
- package/src/components/Lineup2D/MatchDetails.vue +66 -66
- package/src/components/gsc-filter.vue +286 -286
- package/src/components/gsc-header-historico-lineup.vue +1064 -1064
- package/src/components/gsc-header-postmatch-lineup.vue +1017 -1017
- package/src/components/gsc-header-probables-lineup.vue +1044 -1044
- package/src/components/gsc-header-recientes-lineup.vue +2337 -2337
- package/src/components/gsc-lineup-dosd.vue +3777 -3752
- package/src/components/gsc-lineup-main.vue +81 -65
- package/src/components/gsc-lineups-reports.vue +10 -1
- package/src/components/gsc-lineups.vue +229 -37
- package/src/components/gsc-player-card.vue +166 -166
- package/src/index.js +4 -4
- package/src/main-test.js +42 -0
- package/src/types.d.ts +45 -45
- package/src/utils/apiUrl.js +33 -0
- package/src/utils/socketConnection.js +29 -29
|
@@ -1,166 +1,166 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div v-if="type == 1" class="gsc-item-player">
|
|
3
|
-
<div class="gsc-num-player">
|
|
4
|
-
<template v-if="data.shirt < 10">0</template>
|
|
5
|
-
{{ data.shirt }}
|
|
6
|
-
</div>
|
|
7
|
-
<div class="gsc-cont-info-by-player">
|
|
8
|
-
<div class="gsc-cont-info-by-player-row1">
|
|
9
|
-
<div class="shield-player-cont">
|
|
10
|
-
<img class="gsc-logo-player" :src="data.img" />
|
|
11
|
-
</div>
|
|
12
|
-
</div>
|
|
13
|
-
<div class="gsc-cont-info-by-player-row2">
|
|
14
|
-
<div
|
|
15
|
-
class="gsc-cont-info-by-player-row2-line-name"
|
|
16
|
-
:style="
|
|
17
|
-
data.section == 'Historicos' && data.type != 'Postmatch'
|
|
18
|
-
? 'text-decoration: none !important; cursor: default !important'
|
|
19
|
-
: ''
|
|
20
|
-
"
|
|
21
|
-
@click="
|
|
22
|
-
openProfile({
|
|
23
|
-
playerId: data.playerid,
|
|
24
|
-
teamId: data.teamid,
|
|
25
|
-
seasonId: data.season,
|
|
26
|
-
section: data.section,
|
|
27
|
-
type: data.type
|
|
28
|
-
})
|
|
29
|
-
"
|
|
30
|
-
>
|
|
31
|
-
{{ data.name }}
|
|
32
|
-
</div>
|
|
33
|
-
<div class="gsc-cont-info-by-player-row2-line-data">
|
|
34
|
-
<div class="cont-display-gsc">
|
|
35
|
-
<img class="gsc-img-country" :src="data.nation" />
|
|
36
|
-
<div :class="position">{{ data.position }}</div>
|
|
37
|
-
</div>
|
|
38
|
-
<div class="gsc-cont-cards">
|
|
39
|
-
<div class="gsc-yellow_card_div" v-if="data.yellowcard >= 1 && data.redcard == 0"></div>
|
|
40
|
-
<div class="gsc-red_card_div" v-if="data.redcard >= 1 && data.yellowcard == 0"></div>
|
|
41
|
-
<div
|
|
42
|
-
class="gsc-yellowred_card_div"
|
|
43
|
-
v-if="data.yellowcard >= 1 && data.redcard >= 1"
|
|
44
|
-
></div>
|
|
45
|
-
<template v-if="data.yellowcard >= 1 && data.redcard == 0"
|
|
46
|
-
>'{{ data.yellowcardmin }}
|
|
47
|
-
</template>
|
|
48
|
-
<template v-if="data.redcard >= 1">'{{ data.redcardmin }}</template>
|
|
49
|
-
<div class="gsc-goal_card_div_wrapper" v-for="(min, keyM) in data.goalsMin" :key="keyM">
|
|
50
|
-
<div class="gsc-goal_card_div"></div>
|
|
51
|
-
<div>'{{ min }}</div>
|
|
52
|
-
</div>
|
|
53
|
-
<div
|
|
54
|
-
class="gsc-goal_card_div_wrapper"
|
|
55
|
-
v-if="data.substitutionIn || data.substitutionOut"
|
|
56
|
-
>
|
|
57
|
-
<div class="gsc-change_card_div"></div>
|
|
58
|
-
<div>'{{ data.substitutionMin }}</div>
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
</div>
|
|
65
|
-
<div v-if="type == 2" class="gsc-item-player">
|
|
66
|
-
<div class="gsc-num-player2">
|
|
67
|
-
<template v-if="data.shirt < 10">0</template>
|
|
68
|
-
{{ data.shirt }}
|
|
69
|
-
</div>
|
|
70
|
-
<div class="gsc-cont-info-by-player2">
|
|
71
|
-
<div class="gsc-cont-info-by-player-row2">
|
|
72
|
-
<div
|
|
73
|
-
class="gsc-cont-info-by-player-row2-line-name2"
|
|
74
|
-
:style="
|
|
75
|
-
data.section == 'Historicos' && data.type != 'Postmatch'
|
|
76
|
-
? 'text-decoration: none !important; cursor: default !important'
|
|
77
|
-
: ''
|
|
78
|
-
"
|
|
79
|
-
@click="
|
|
80
|
-
openProfile({
|
|
81
|
-
playerId: data.playerid,
|
|
82
|
-
teamId: data.teamid,
|
|
83
|
-
seasonId: data.season,
|
|
84
|
-
section: data.section,
|
|
85
|
-
type: data.type
|
|
86
|
-
})
|
|
87
|
-
"
|
|
88
|
-
>
|
|
89
|
-
{{ data.name }}
|
|
90
|
-
</div>
|
|
91
|
-
<div class="gsc-cont-info-by-player-row2-line-data">
|
|
92
|
-
<div class="gsc-cont-cards2">
|
|
93
|
-
<div class="gsc-yellow_card_div" v-if="data.yellowcard >= 1 && data.redcard == 0"></div>
|
|
94
|
-
<div class="gsc-red_card_div" v-if="data.redcard >= 1 && data.yellowcard == 0"></div>
|
|
95
|
-
<div
|
|
96
|
-
class="gsc-yellowred_card_div"
|
|
97
|
-
v-if="data.yellowcard >= 1 && data.redcard >= 1"
|
|
98
|
-
></div>
|
|
99
|
-
<template v-if="data.yellowcard >= 1 && data.redcard == 0"
|
|
100
|
-
>'{{ data.yellowcardmin }}
|
|
101
|
-
</template>
|
|
102
|
-
<template v-if="data.redcard >= 1">'{{ data.redcardmin }}</template>
|
|
103
|
-
<div class="gsc-goal_card_div_wrapper" v-for="(min, keyM) in data.goalsMin" :key="keyM">
|
|
104
|
-
<div class="gsc-goal_card_div"></div>
|
|
105
|
-
<div>'{{ min }}</div>
|
|
106
|
-
</div>
|
|
107
|
-
<div
|
|
108
|
-
class="gsc-goal_card_div_wrapper"
|
|
109
|
-
v-if="data.substitutionIn || data.substitutionOut"
|
|
110
|
-
>
|
|
111
|
-
<div class="gsc-change_card_div"></div>
|
|
112
|
-
<div>'{{ data.substitutionMin }}</div>
|
|
113
|
-
</div>
|
|
114
|
-
</div>
|
|
115
|
-
<div class="cont-display-gsc">
|
|
116
|
-
<div :class="position">{{ data.position }}</div>
|
|
117
|
-
<img class="gsc-img-country" :src="data.nation" />
|
|
118
|
-
</div>
|
|
119
|
-
</div>
|
|
120
|
-
</div>
|
|
121
|
-
<div class="gsc-cont-info-by-player-row1">
|
|
122
|
-
<div class="shield-player-cont">
|
|
123
|
-
<img class="gsc-logo-player" :src="data.img" />
|
|
124
|
-
</div>
|
|
125
|
-
</div>
|
|
126
|
-
</div>
|
|
127
|
-
</div>
|
|
128
|
-
</template>
|
|
129
|
-
|
|
130
|
-
<script>
|
|
131
|
-
export default {
|
|
132
|
-
name: 'PlayerCard',
|
|
133
|
-
emits: ['open-profile'],
|
|
134
|
-
components: {},
|
|
135
|
-
props: {
|
|
136
|
-
data: {
|
|
137
|
-
type: Object,
|
|
138
|
-
default: () => {}
|
|
139
|
-
},
|
|
140
|
-
position: {
|
|
141
|
-
type: String,
|
|
142
|
-
default: 'gsc-position-player'
|
|
143
|
-
},
|
|
144
|
-
type: {
|
|
145
|
-
type: Number,
|
|
146
|
-
default: 1
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
data() {
|
|
150
|
-
return {}
|
|
151
|
-
},
|
|
152
|
-
computed: {},
|
|
153
|
-
methods: {
|
|
154
|
-
openProfile(data) {
|
|
155
|
-
if (data.section !== 'Historicos' || data.type === 'Postmatch') {
|
|
156
|
-
this.$emit('open-profile', data)
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
mounted() {}
|
|
161
|
-
}
|
|
162
|
-
</script>
|
|
163
|
-
|
|
164
|
-
<style scoped>
|
|
165
|
-
@import '/css/fonts.css';
|
|
166
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="type == 1" class="gsc-item-player">
|
|
3
|
+
<div class="gsc-num-player">
|
|
4
|
+
<template v-if="data.shirt < 10">0</template>
|
|
5
|
+
{{ data.shirt }}
|
|
6
|
+
</div>
|
|
7
|
+
<div class="gsc-cont-info-by-player">
|
|
8
|
+
<div class="gsc-cont-info-by-player-row1">
|
|
9
|
+
<div class="shield-player-cont">
|
|
10
|
+
<img class="gsc-logo-player" :src="data.img" />
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="gsc-cont-info-by-player-row2">
|
|
14
|
+
<div
|
|
15
|
+
class="gsc-cont-info-by-player-row2-line-name"
|
|
16
|
+
:style="
|
|
17
|
+
data.section == 'Historicos' && data.type != 'Postmatch'
|
|
18
|
+
? 'text-decoration: none !important; cursor: default !important'
|
|
19
|
+
: ''
|
|
20
|
+
"
|
|
21
|
+
@click="
|
|
22
|
+
openProfile({
|
|
23
|
+
playerId: data.playerid,
|
|
24
|
+
teamId: data.teamid,
|
|
25
|
+
seasonId: data.season,
|
|
26
|
+
section: data.section,
|
|
27
|
+
type: data.type
|
|
28
|
+
})
|
|
29
|
+
"
|
|
30
|
+
>
|
|
31
|
+
{{ data.name }}
|
|
32
|
+
</div>
|
|
33
|
+
<div class="gsc-cont-info-by-player-row2-line-data">
|
|
34
|
+
<div class="cont-display-gsc">
|
|
35
|
+
<img class="gsc-img-country" :src="data.nation" />
|
|
36
|
+
<div :class="position">{{ data.position }}</div>
|
|
37
|
+
</div>
|
|
38
|
+
<div class="gsc-cont-cards">
|
|
39
|
+
<div class="gsc-yellow_card_div" v-if="data.yellowcard >= 1 && data.redcard == 0"></div>
|
|
40
|
+
<div class="gsc-red_card_div" v-if="data.redcard >= 1 && data.yellowcard == 0"></div>
|
|
41
|
+
<div
|
|
42
|
+
class="gsc-yellowred_card_div"
|
|
43
|
+
v-if="data.yellowcard >= 1 && data.redcard >= 1"
|
|
44
|
+
></div>
|
|
45
|
+
<template v-if="data.yellowcard >= 1 && data.redcard == 0"
|
|
46
|
+
>'{{ data.yellowcardmin }}
|
|
47
|
+
</template>
|
|
48
|
+
<template v-if="data.redcard >= 1">'{{ data.redcardmin }}</template>
|
|
49
|
+
<div class="gsc-goal_card_div_wrapper" v-for="(min, keyM) in data.goalsMin" :key="keyM">
|
|
50
|
+
<div class="gsc-goal_card_div"></div>
|
|
51
|
+
<div>'{{ min }}</div>
|
|
52
|
+
</div>
|
|
53
|
+
<div
|
|
54
|
+
class="gsc-goal_card_div_wrapper"
|
|
55
|
+
v-if="data.substitutionIn || data.substitutionOut"
|
|
56
|
+
>
|
|
57
|
+
<div class="gsc-change_card_div"></div>
|
|
58
|
+
<div>'{{ data.substitutionMin }}</div>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
<div v-if="type == 2" class="gsc-item-player">
|
|
66
|
+
<div class="gsc-num-player2">
|
|
67
|
+
<template v-if="data.shirt < 10">0</template>
|
|
68
|
+
{{ data.shirt }}
|
|
69
|
+
</div>
|
|
70
|
+
<div class="gsc-cont-info-by-player2">
|
|
71
|
+
<div class="gsc-cont-info-by-player-row2">
|
|
72
|
+
<div
|
|
73
|
+
class="gsc-cont-info-by-player-row2-line-name2"
|
|
74
|
+
:style="
|
|
75
|
+
data.section == 'Historicos' && data.type != 'Postmatch'
|
|
76
|
+
? 'text-decoration: none !important; cursor: default !important'
|
|
77
|
+
: ''
|
|
78
|
+
"
|
|
79
|
+
@click="
|
|
80
|
+
openProfile({
|
|
81
|
+
playerId: data.playerid,
|
|
82
|
+
teamId: data.teamid,
|
|
83
|
+
seasonId: data.season,
|
|
84
|
+
section: data.section,
|
|
85
|
+
type: data.type
|
|
86
|
+
})
|
|
87
|
+
"
|
|
88
|
+
>
|
|
89
|
+
{{ data.name }}
|
|
90
|
+
</div>
|
|
91
|
+
<div class="gsc-cont-info-by-player-row2-line-data">
|
|
92
|
+
<div class="gsc-cont-cards2">
|
|
93
|
+
<div class="gsc-yellow_card_div" v-if="data.yellowcard >= 1 && data.redcard == 0"></div>
|
|
94
|
+
<div class="gsc-red_card_div" v-if="data.redcard >= 1 && data.yellowcard == 0"></div>
|
|
95
|
+
<div
|
|
96
|
+
class="gsc-yellowred_card_div"
|
|
97
|
+
v-if="data.yellowcard >= 1 && data.redcard >= 1"
|
|
98
|
+
></div>
|
|
99
|
+
<template v-if="data.yellowcard >= 1 && data.redcard == 0"
|
|
100
|
+
>'{{ data.yellowcardmin }}
|
|
101
|
+
</template>
|
|
102
|
+
<template v-if="data.redcard >= 1">'{{ data.redcardmin }}</template>
|
|
103
|
+
<div class="gsc-goal_card_div_wrapper" v-for="(min, keyM) in data.goalsMin" :key="keyM">
|
|
104
|
+
<div class="gsc-goal_card_div"></div>
|
|
105
|
+
<div>'{{ min }}</div>
|
|
106
|
+
</div>
|
|
107
|
+
<div
|
|
108
|
+
class="gsc-goal_card_div_wrapper"
|
|
109
|
+
v-if="data.substitutionIn || data.substitutionOut"
|
|
110
|
+
>
|
|
111
|
+
<div class="gsc-change_card_div"></div>
|
|
112
|
+
<div>'{{ data.substitutionMin }}</div>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
<div class="cont-display-gsc">
|
|
116
|
+
<div :class="position">{{ data.position }}</div>
|
|
117
|
+
<img class="gsc-img-country" :src="data.nation" />
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
<div class="gsc-cont-info-by-player-row1">
|
|
122
|
+
<div class="shield-player-cont">
|
|
123
|
+
<img class="gsc-logo-player" :src="data.img" />
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
</template>
|
|
129
|
+
|
|
130
|
+
<script>
|
|
131
|
+
export default {
|
|
132
|
+
name: 'PlayerCard',
|
|
133
|
+
emits: ['open-profile'],
|
|
134
|
+
components: {},
|
|
135
|
+
props: {
|
|
136
|
+
data: {
|
|
137
|
+
type: Object,
|
|
138
|
+
default: () => {}
|
|
139
|
+
},
|
|
140
|
+
position: {
|
|
141
|
+
type: String,
|
|
142
|
+
default: 'gsc-position-player'
|
|
143
|
+
},
|
|
144
|
+
type: {
|
|
145
|
+
type: Number,
|
|
146
|
+
default: 1
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
data() {
|
|
150
|
+
return {}
|
|
151
|
+
},
|
|
152
|
+
computed: {},
|
|
153
|
+
methods: {
|
|
154
|
+
openProfile(data) {
|
|
155
|
+
if (data.section !== 'Historicos' || data.type === 'Postmatch') {
|
|
156
|
+
this.$emit('open-profile', data)
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
mounted() {}
|
|
161
|
+
}
|
|
162
|
+
</script>
|
|
163
|
+
|
|
164
|
+
<style scoped>
|
|
165
|
+
@import '/css/fonts.css';
|
|
166
|
+
</style>
|
package/src/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
import GSCLineupsReports from './components/gsc-lineups-reports.vue'
|
|
3
|
-
|
|
4
|
-
export { GSCLineupsReports }
|
|
1
|
+
'use strict'
|
|
2
|
+
import GSCLineupsReports from './components/gsc-lineups-reports.vue'
|
|
3
|
+
|
|
4
|
+
export { GSCLineupsReports }
|
package/src/main-test.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entry point del harness de pruebas.
|
|
3
|
+
* Lee `?provider=N&isDevApis=true/false` de la URL y monta
|
|
4
|
+
* GSCLineupsReports con esos valores, usando los mismos datos
|
|
5
|
+
* de App.vue (game_id 90434, season_id 2010, gameNumber 2).
|
|
6
|
+
*/
|
|
7
|
+
import { createApp, h } from 'vue'
|
|
8
|
+
import GSCLineupsReports from './components/gsc-lineups-reports.vue'
|
|
9
|
+
|
|
10
|
+
const params = new URLSearchParams(window.location.search)
|
|
11
|
+
const provider = Number(params.get('provider') ?? '1')
|
|
12
|
+
const isDevApis = params.get('isDevApis') === 'true'
|
|
13
|
+
|
|
14
|
+
const GAME = { game_id: 90434, season_id: 2010, prematch: true }
|
|
15
|
+
|
|
16
|
+
const LAST_GAMES = {
|
|
17
|
+
home_team: 14,
|
|
18
|
+
last_home_games: [
|
|
19
|
+
{ season_id: 2010, game_id: 90420 },
|
|
20
|
+
{ season_id: 2010, game_id: 90412 },
|
|
21
|
+
{ season_id: 2010, game_id: 90406 },
|
|
22
|
+
],
|
|
23
|
+
visiting_team: 12,
|
|
24
|
+
last_visiting_games: [
|
|
25
|
+
{ season_id: 2010, game_id: 90422 },
|
|
26
|
+
{ season_id: 2010, game_id: 90417 },
|
|
27
|
+
{ season_id: 2010, game_id: 90403 },
|
|
28
|
+
],
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
createApp({
|
|
32
|
+
render() {
|
|
33
|
+
return h(GSCLineupsReports, {
|
|
34
|
+
selectedOption: 'Prematch',
|
|
35
|
+
game: GAME,
|
|
36
|
+
gameNumber: 2,
|
|
37
|
+
lastGames: LAST_GAMES,
|
|
38
|
+
provider,
|
|
39
|
+
isDevApis,
|
|
40
|
+
})
|
|
41
|
+
},
|
|
42
|
+
}).mount('#app')
|
package/src/types.d.ts
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
export interface Team {
|
|
2
|
-
logo: string
|
|
3
|
-
team_id: number
|
|
4
|
-
provisional_logo: string
|
|
5
|
-
colloquial_name: string
|
|
6
|
-
acronym: string
|
|
7
|
-
team_name: string
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface GameMinutes {
|
|
11
|
-
home_goals_minutes: number[]
|
|
12
|
-
visiting_goals_minutes: number[]
|
|
13
|
-
home_yellow_cards_minutes: number[]
|
|
14
|
-
away_yellow_cards_minutes: number[]
|
|
15
|
-
home_red_cards_minutes: number[]
|
|
16
|
-
away_red_cards_minutes: number[]
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface Game {
|
|
20
|
-
gameId: number
|
|
21
|
-
id: number
|
|
22
|
-
seasonId: number
|
|
23
|
-
regularSeasonId: number
|
|
24
|
-
matchday_name: string
|
|
25
|
-
status: number
|
|
26
|
-
score: number[]
|
|
27
|
-
game_status: number
|
|
28
|
-
dateTimeUTC: string
|
|
29
|
-
homeTeam: Team
|
|
30
|
-
awayTeam: Team
|
|
31
|
-
is_live: number
|
|
32
|
-
minutes: GameMinutes
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface TeamSelected {
|
|
36
|
-
teamId: number
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface FieldPosesionProps {
|
|
40
|
-
game: Game
|
|
41
|
-
widthSection: number
|
|
42
|
-
teamSelected: TeamSelected
|
|
43
|
-
areInactiveVisible?: boolean
|
|
44
|
-
showTitle?: boolean
|
|
45
|
-
}
|
|
1
|
+
export interface Team {
|
|
2
|
+
logo: string
|
|
3
|
+
team_id: number
|
|
4
|
+
provisional_logo: string
|
|
5
|
+
colloquial_name: string
|
|
6
|
+
acronym: string
|
|
7
|
+
team_name: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface GameMinutes {
|
|
11
|
+
home_goals_minutes: number[]
|
|
12
|
+
visiting_goals_minutes: number[]
|
|
13
|
+
home_yellow_cards_minutes: number[]
|
|
14
|
+
away_yellow_cards_minutes: number[]
|
|
15
|
+
home_red_cards_minutes: number[]
|
|
16
|
+
away_red_cards_minutes: number[]
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface Game {
|
|
20
|
+
gameId: number
|
|
21
|
+
id: number
|
|
22
|
+
seasonId: number
|
|
23
|
+
regularSeasonId: number
|
|
24
|
+
matchday_name: string
|
|
25
|
+
status: number
|
|
26
|
+
score: number[]
|
|
27
|
+
game_status: number
|
|
28
|
+
dateTimeUTC: string
|
|
29
|
+
homeTeam: Team
|
|
30
|
+
awayTeam: Team
|
|
31
|
+
is_live: number
|
|
32
|
+
minutes: GameMinutes
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface TeamSelected {
|
|
36
|
+
teamId: number
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface FieldPosesionProps {
|
|
40
|
+
game: Game
|
|
41
|
+
widthSection: number
|
|
42
|
+
teamSelected: TeamSelected
|
|
43
|
+
areInactiveVisible?: boolean
|
|
44
|
+
showTitle?: boolean
|
|
45
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transforma una URL de API según el proveedor y el entorno.
|
|
3
|
+
*
|
|
4
|
+
* @param {string} originalUrl - URL original (incluyendo path con variables ya sustituidas o base)
|
|
5
|
+
* @param {number|null} provider - ID de proveedor: 1, 0, null → sin cambio; >=2 → reescribir base
|
|
6
|
+
* @param {boolean} isDevApis - true → dominio dev-apis; false → dominio apis
|
|
7
|
+
* @returns {string} URL transformada
|
|
8
|
+
*/
|
|
9
|
+
export function getApiUrl(originalUrl, provider, isDevApis) {
|
|
10
|
+
// REGLA A: provider es 1, 0 o null → devolver URL sin cambios
|
|
11
|
+
if (!provider || provider <= 1) {
|
|
12
|
+
return originalUrl
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// REGLA B/C: provider >= 2 → reescribir dominio y eliminar segmentos prod/qa
|
|
16
|
+
const base = isDevApis
|
|
17
|
+
? `https://dev-apis.golstats.com/${provider}/`
|
|
18
|
+
: `https://apis.golstats.com/${provider}/`
|
|
19
|
+
|
|
20
|
+
// Extraer el path quitando el dominio original
|
|
21
|
+
const urlObj = new URL(originalUrl)
|
|
22
|
+
const pathWithStage = urlObj.pathname.replace(/^\//, '') // quitar "/" inicial
|
|
23
|
+
|
|
24
|
+
// Eliminar primer segmento si es "prod" o "qa"
|
|
25
|
+
const segments = pathWithStage.split('/')
|
|
26
|
+
const firstSegment = segments[0].toLowerCase()
|
|
27
|
+
const cleanPath =
|
|
28
|
+
firstSegment === 'prod' || firstSegment === 'qa'
|
|
29
|
+
? segments.slice(1).join('/')
|
|
30
|
+
: segments.join('/')
|
|
31
|
+
|
|
32
|
+
return base + cleanPath
|
|
33
|
+
}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import io from 'socket.io-client'
|
|
2
|
-
|
|
3
|
-
const socket = io('https://golstats-live-server-sockets.azurewebsites.net/', {
|
|
4
|
-
autoConnect: false,
|
|
5
|
-
transports: ['websocket']
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
export function getSocket() {
|
|
9
|
-
return socket
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function connectSocket() {
|
|
13
|
-
if (socket.disconnected) {
|
|
14
|
-
socket.connect()
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function disconnectSocket() {
|
|
19
|
-
if (socket.connected) socket.disconnect()
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function connectChannel(channel, externalSocket) {
|
|
23
|
-
const socket = externalSocket || getSocket()
|
|
24
|
-
if (socket.connected) {
|
|
25
|
-
socket.emit('subscribe', {
|
|
26
|
-
channel
|
|
27
|
-
})
|
|
28
|
-
}
|
|
29
|
-
}
|
|
1
|
+
import io from 'socket.io-client'
|
|
2
|
+
|
|
3
|
+
const socket = io('https://golstats-live-server-sockets.azurewebsites.net/', {
|
|
4
|
+
autoConnect: false,
|
|
5
|
+
transports: ['websocket']
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
export function getSocket() {
|
|
9
|
+
return socket
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function connectSocket() {
|
|
13
|
+
if (socket.disconnected) {
|
|
14
|
+
socket.connect()
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function disconnectSocket() {
|
|
19
|
+
if (socket.connected) socket.disconnect()
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function connectChannel(channel, externalSocket) {
|
|
23
|
+
const socket = externalSocket || getSocket()
|
|
24
|
+
if (socket.connected) {
|
|
25
|
+
socket.emit('subscribe', {
|
|
26
|
+
channel
|
|
27
|
+
})
|
|
28
|
+
}
|
|
29
|
+
}
|