feat: add match eq support
All checks were successful
Deploy Production Server / if_merged (pull_request) Successful in 6m42s

This commit is contained in:
2026-01-16 15:37:23 +01:00
parent 0150c4fac2
commit 01436ac220
7 changed files with 95 additions and 81 deletions

View File

@@ -7,6 +7,9 @@ const rootDiv = document.getElementById("safca_api_data");
const cupImg = `<img decoding="async" loading="lazy" width="16" height="16" class="wp-image-1635"
style="width: 16px;" src="https://intra.ffsaf.fr/img/171891.png"
alt="">`
const cupImg2 = `<img decoding="async" loading="lazy" width="16" height="16" class="wp-image-1635"
style="width: 16px;" src="https://intra.ffsaf.fr/img/171892.png"
alt="">`
const voidFunction = () => {
@@ -15,7 +18,7 @@ let lastRf = 0;
let rfFonction = voidFunction;
setInterval(() => {
rfFonction();
// rfFonction();
}, 15000);
function setSubPage(name) {
@@ -214,11 +217,11 @@ function buildMatchArray(matchs) {
arrayContent += `
<tr>
<td class="has-text-align-right" data-align="right">${match.red}</td>
<td class="has-text-align-center" data-align="center">${match.red_w ? cupImg : ""}</td>
<td class="has-text-align-center" data-align="center">${match.red_w ? cupImg : (match.eq ? cupImg2 : "")}</td>
<td class="has-text-align-center" data-align="center">${scoreToString(match.score)}</td>
<td class="has-text-align-center" data-align="center">${match.blue_w ? cupImg : ""}</td>
<td class="has-text-align-center" data-align="center">${match.blue_w ? cupImg : (match.eq ? cupImg2 : "")}</td>
<td class="has-text-align-left" data-align="left">${match.blue}</td>
<td class="has-text-align-center" data-align="center">${dateToString((match.red_w || match.blue_w) ? match.date : null)}</td>
<td class="has-text-align-center" data-align="center">${dateToString((match.end) ? match.date : null)}</td>
</tr>`
}
arrayContent += `</tbody></table></figure>`
@@ -234,6 +237,7 @@ function buildRankArray(rankArray) {
<tr>
<th class="has-text-align-center" data-align="center">${i18next.t('place')}</th>
<th class="has-text-align-center" data-align="center">${i18next.t('nom')}</th>
<th class="has-text-align-center" data-align="center">${i18next.t('score')}</th>
<th class="has-text-align-center" data-align="center">${i18next.t('victoire')}</th>
<th class="has-text-align-center" data-align="center">${i18next.t('ratio')}</th>
<th class="has-text-align-center" data-align="center">${i18next.t('pointsMarqués')}</th>
@@ -245,6 +249,7 @@ function buildRankArray(rankArray) {
<tr>
<td class="has-text-align-center" data-align="center">${row.rank}</td>
<td class="has-text-align-left" data-align="left">${row.name}</td>
<td class="has-text-align-center" data-align="center">${row.score}</td>
<td class="has-text-align-center" data-align="center">${row.win}</td>
<td class="has-text-align-center" data-align="center">${row.pointRate.toFixed(3)}</td>
<td class="has-text-align-center" data-align="center">${row.pointMake}</td>
@@ -419,7 +424,7 @@ function buildCombView(comb) {
<td class="has-text-align-center" data-align="center">${match.adv}</td>
<td class="has-text-align-center" data-align="center">${scoreToString(match.score)}</td>
<td class="has-text-align-center" data-align="center">${match.ratio.toFixed(3)}</td>
<td class="has-text-align-center" data-align="center">${match.win ? cupImg : ""}</td>
<td class="has-text-align-center" data-align="center">${match.win ? cupImg : (match.eq ? cupImg2 : "")}</td>
</tr>`
}
arrayContent += `</tbody></table></figure>`

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -57,6 +57,7 @@
"rechercheParCombattant": "Search by fighter",
"rouge": "Red",
"résultatDeLaCompétition": "Competition result",
"score": "Score",
"scores": "Scores",
"statistique": "Statistics",
"tauxDeVictoire2": "Win rate: {{nb}}% ({{victoires}} out of {{matchs}})",

View File

@@ -57,6 +57,7 @@
"rechercheParCombattant": "Recherche par combattant",
"rouge": "Rouge",
"résultatDeLaCompétition": "Résultat de la compétition",
"score": "Score",
"scores": "Scores",
"statistique": "Statistique",
"tauxDeVictoire2": "Taux de victoire : {{nb}}% ({{victoires}} sur {{matchs}})",

View File

@@ -14,6 +14,11 @@ function CupImg() {
style={{width: "16px"}} src="/img/171891.png"
alt=""/>
}
function CupImg2() {
return <img decoding="async" loading="lazy" width="16" height="16" className="wp-image-1635"
style={{width: "16px"}} src="/img/171892.png"
alt=""/>
}
export function ResultView() {
const {uuid} = useParams()
@@ -87,9 +92,9 @@ function BuildMatchArray({matchs}) {
<tbody>
{matchs.map((match, idx) => <tr key={idx}>
<td style={{textAlign: "right"}}>{match.red}</td>
<td style={{textAlign: "center"}}>{match.red_w ? <CupImg/> : ""}</td>
<td style={{textAlign: "center"}}>{match.red_w ? <CupImg/> : (match.eq ? <CupImg2/> : "")}</td>
<td style={{textAlign: "center"}}>{scoreToString(match.score)}</td>
<td style={{textAlign: "center"}}>{match.blue_w ? <CupImg/> : ""}</td>
<td style={{textAlign: "center"}}>{match.blue_w ? <CupImg/> : (match.eq ? <CupImg2/> : "")}</td>
<td style={{textAlign: "left"}}>{match.blue}</td>
</tr>)}
</tbody>
@@ -105,6 +110,7 @@ function BuildRankArray({rankArray}) {
<tr>
<th scope="col" style={{textAlign: "center"}}>{t('place')}</th>
<th scope="col" style={{textAlign: "center"}}>{t('nom')}</th>
<th scope="col" style={{textAlign: "center"}}>{t('score')}</th>
<th scope="col" style={{textAlign: "center"}}>{t('victoire')}</th>
<th scope="col" style={{textAlign: "center"}}>{t('ratio')}</th>
<th scope="col" style={{textAlign: "center"}}>{t('pointsMarqués')}</th>
@@ -115,6 +121,7 @@ function BuildRankArray({rankArray}) {
{rankArray.map((row, idx) => <tr key={idx}>
<td style={{textAlign: "center"}}>{row.rank}</td>
<td style={{textAlign: "left"}}>{row.name}</td>
<td style={{textAlign: "center"}}>{row.score}</td>
<td style={{textAlign: "center"}}>{row.win}</td>
<td style={{textAlign: "center"}}>{row.pointRate.toFixed(3)}</td>
<td style={{textAlign: "center"}}>{row.pointMake}</td>
@@ -395,7 +402,7 @@ function CombResult({uuid, combId}) {
<td style={{textAlign: "center"}}>{match.adv}</td>
<td style={{textAlign: "center"}}>{scoreToString(match.score)}</td>
<td style={{textAlign: "center"}}>{match.ratio.toFixed(3)}</td>
<td style={{textAlign: "left"}}>{match.win ? <CupImg/> : ""}</td>
<td style={{textAlign: "left"}}>{match.win ? <CupImg/> : (match.eq ? <CupImg2/> : "")}</td>
</tr>)}
</tbody>
</table>