import {client} from "../index.js"; import AbstractAuthentifiedView from "./abstracts/AbstractAuthentifiedView.js"; export default class extends AbstractAuthentifiedView { constructor(params) { super(params, "Tournament"); this.id = params.id; } async postInit() { let tournament = await client.tournaments.getTournament(this.id); if (tournament === null) return 1; document.getElementById("name").innerText = tournament.name || `${tournament.nb_players_by_game}x1, ${tournament.nb_players} players`; document.getElementById("nb_players").innerText = tournament.nb_players; document.getElementById("nb_players_by_game").innerText = tournament.nb_players_by_game; document.getElementById("level").innerText = tournament.level; document.getElementById("state").innerText = tournament.state; } async getHtml() { return `
Loading... | |
---|---|
Number of players | Loading... |
Number of players by game | Loading... |
Number of round | Loading... |
status | Loading... |