Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Fix #171

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/components/MatchInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
matchInfo.end_time == null
"
>

<v-btn
color="primary"
small
Expand All @@ -107,7 +108,7 @@
serverInfo.port
"
>
{{ $t("Match.Connect") }}
{{ $t("Match.ConnectButtonAt") }} {{serverInfo.display_name}}
</v-btn>
<div v-if="serverInfo.gotv_port != null">
<v-btn
Expand Down Expand Up @@ -183,7 +184,8 @@ export default {
serverInfo: {
ip_string: "",
port: 0,
gotv_port: 0
gotv_port: 0,
display_name: ""
},
apiUrl: process.env?.VUE_APP_G5V_API_URL || "/api",
imageLoaded: true
Expand Down Expand Up @@ -257,6 +259,7 @@ export default {
this.serverInfo.ip_string = serveRes.ip_string;
this.serverInfo.port = serveRes.port;
this.serverInfo.gotv_port = serveRes.gotv_port;
this.serverInfo.display_name = serveRes.display_name;
}
} catch (err) {
console.log(`Error on match helper. The error is ${err.toString()}`);
Expand Down
42 changes: 38 additions & 4 deletions src/components/MatchesTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,32 @@
{{ item.team2_string }}
</div>
</template>

<template v-slot:item.ip_string="{ item }">
<div>
{{item.display_name}}
</div>
</template>

<template v-slot:item.connect="{ item }">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe have a check only if the person is a super_admin/admin or is a part of the match to show the connect button. And maybe remove the button when the match is completed.

Copy link
Contributor Author

@tech62 tech62 Nov 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've add a v-if on the match.end_time to hide the connect and gotv button when the field isn't null.
Checking admin/superadmin not works actually, i've set my SteamID in the production.json, but no effect.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fairly certain that is a configuration issue. Please revert this change as it was working prior to by having the v-if on the template.

<div v-if="item.end_time === null">
<v-btn
color="primary"
small
:href="
'steam://rungame/730/' +
user.steam_id +
'/+connect%20' +
item.ip_string +
':' +
item.port
"
>
{{ $t("Match.Connect") }}
</v-btn>
</div>
</template>

<template v-slot:top>
<div v-if="isMyMatches && isThereCancelledMatches">
<v-toolbar flat>
Expand Down Expand Up @@ -103,7 +129,15 @@ export default {
{
text: this.$t("Matches.Owner"),
value: "owner"
}
},
{
text: this.$t("Matches.Server"),
value: "ip_string"
},
{
//text: this.$t("Matches.ConnectButton"),
value: "connect"
}
];
},
isMyMatches() {
Expand Down Expand Up @@ -140,11 +174,11 @@ export default {
(match.cancelled == 0 || match.cancelled == null) &&
match.start_time != null
) {
matchString = `Live, ${team1Score}:${team2Score} vs ${match.team2_string}`;
matchString = `Live, ${team1Score}:${team2Score} - ${match.team1_string} vs ${match.team2_string}`;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see what you mean. This was a design choice since both teams are already showing in the table. So Team 1 is always considered the "Home" team, so this is why it was always vs Team2. I'm not opposed, but how does this look/feel on smaller screens or mobile layout?

Copy link
Contributor Author

@tech62 tech62 Nov 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like this from my browser with mobile compatiblity.
We can add a column with the teams instead of displaying these info in the status
image

} else if (team1Score < team2Score) {
matchString = `Lost, ${team1Score}:${team2Score} vs ${match.team2_string}`;
matchString = `Lost, ${team1Score}:${team2Score} - ${match.team1_string} vs ${match.team2_string}`;
} else if (team1Score > team2Score) {
matchString = `Won, ${team1Score}:${team2Score} vs ${match.team2_string}`;
matchString = `Won, ${team1Score}:${team2Score} - ${match.team1_string} vs ${match.team2_string}`;
} else if (match.cancelled == 1) {
matchString = "Cancelled";
} else if (team1Score == team2Score && match.forfeit != 1) {
Expand Down
16 changes: 13 additions & 3 deletions src/translations/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"StartTime": "Start:",
"EndTime": "End:",
"Connect": "Connect!",
"ConnectButtonAt": "Connecting to ",
"GOTVConnect": "Connect to GOTV!"
},
"CreateMatch": {
Expand Down Expand Up @@ -188,6 +189,8 @@
"Server": "Server",
"Owner": "Owner",
"DeleteButton": "Delete My Cancelled Matches",
"ConnectButton": "Connect",
"ConnectButtonAt": "Connecting to ",
"Versus": "vs"
},
"Metrics": {
Expand Down Expand Up @@ -418,9 +421,9 @@
"PauseMatch": "Mettre le match en pause",
"UnpauseMatch": "Reprendre le match",
"AddPlayerToServer": "Ajouter un joueur au serveur",
"ListBackups": "Liste des sauvegarde",
"ListBackups": "Liste des sauvegardes",
"CancelMatch": "Annuler le match",
"ForfeitMatch": "Forfeit Match",
"ForfeitMatch": "Déclarer forfait pour ce Match",
"Backup": "Sauvegarder",
"RCONCommand": "Commande RCON",
"RCONHint": "Travailler comme dans la console!",
Expand All @@ -437,7 +440,8 @@
"StartTime": "Début : ",
"EndTime": "Fin : ",
"Connect": "Connexion !",
"GOTVConnect": "Connexion à la GOTV!"
"GOTVConnect": "Connexion à la GOTV!",
"ConnectButtonAt": "Se connecter à "
},
"CreateMatch": {
"FormServer": "Selectionner un serveur",
Expand Down Expand Up @@ -553,6 +557,8 @@
"Status": "Status",
"Server": "Serveur",
"Owner": "Propriétaire",
"ConnectButton": "Se connecter",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just DeepL in order to get the JP translations as well. Make sure it's included as well!

Copy link
Contributor Author

@tech62 tech62 Nov 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

English / French OK but i don't speak JP and can't maintain all the languages :/
I've updated the future translation.json

"ConnectButtonAt": "Se connecter au",
"DeleteButton": "Supprimer mes matchs annulés",
"Versus": "vs"
},
Expand Down Expand Up @@ -803,6 +809,8 @@
"StartTime": "スタート:",
"EndTime": "終り:",
"Connect": "つなげろ!",
"ConnectButton": "接続",
"ConnectButtonAt": "に接続する ",
"GOTVConnect": "GOTVに接続"
},
"CreateMatch": {
Expand Down Expand Up @@ -915,6 +923,8 @@
"Status": "状態",
"Server": "サーバ",
"Owner": "オーナー",
"ConnectButton": "接続",
"ConnectButtonAt": "に接続する ",
"DeleteButton": "キャンセルされたマッチを削除する",
"Versus": "対"
},
Expand Down
6 changes: 3 additions & 3 deletions src/views/Season.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
{{ seasonData.name }}
<v-spacer />
{{ isStarted }}:
{{ new Date(seasonData.start_date).toLocaleDateString("en-CA") }}
{{ new Date(seasonData.start_date).toLocaleDateString() }}
<br />
{{ isEnding }}:
{{ new Date(seasonData.end_date).toLocaleDateString("en-CA") }}
{{ new Date(seasonData.end_date).toLocaleDateString() }}
</v-card-title>
<v-card-title
v-else-if="
Expand All @@ -22,7 +22,7 @@
{{ seasonData.name }}
<v-spacer />
{{ isStarted }}:
{{ new Date(seasonData.start_date).toLocaleDateString("en-CA") }}
{{ new Date(seasonData.start_date).toLocaleDateString() }}
</v-card-title>
<v-card-title v-else>
{{ seasonData.name }}
Expand Down