feat: NCWF-10 streaming endpoint (#14)

Co-authored-by: shahdlala66 <shahd.lala66@gmail.com>
Reviewed-on: #14
This commit was merged in pull request #14.
This commit is contained in:
2026-06-23 09:38:08 +02:00
parent ab2c641130
commit 1dabd88c62
11 changed files with 455 additions and 4 deletions
@@ -12,6 +12,7 @@ import { TournamentServerService, ExternalTournamentServer } from '../../service
import { Bot } from '../../models/bot.models';
import { Tournament, TournamentResult, RoundPairings } from '../../models/tournament.models';
import { CurrentUser } from '../../models/auth.models';
import { environment } from '../../../environments/environment';
type StatusTab = 'started' | 'created' | 'finished';
@@ -77,6 +78,9 @@ export class TournamentsComponent implements OnInit {
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe(u => { this.currentUser = u; });
this.loadTournaments();
this.tournamentServerService.list()
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe({ next: res => { this.servers = res.servers; }, error: () => {} });
}
openCreateDialog(): void {
@@ -164,7 +168,16 @@ export class TournamentsComponent implements OnInit {
}
watchGame(gameId: string): void {
void this.router.navigate(['/game', gameId]);
const tid = this.selectedTournament?.id;
if (!tid) return;
const server = this.servers[0]?.url || environment.tournamentServerUrl;
if (!server) {
this.joinError = 'No tournament server configured. Cannot open stream.';
return;
}
void this.router.navigate(['/tournament', tid, 'game', gameId], {
queryParams: { server }
});
}
openJoinDialog(event: MouseEvent, tournamentId: string): void {