Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1f1339809f | |||
| 0621968c3c | |||
| bd6d023513 | |||
| 2229cfd00a |
@@ -41,3 +41,6 @@ Thumbs.db
|
|||||||
# Claude Code
|
# Claude Code
|
||||||
/.claude/settings.local.json
|
/.claude/settings.local.json
|
||||||
/.claude/worktrees/
|
/.claude/worktrees/
|
||||||
|
|
||||||
|
# Local clone of the tournament server repo (not tracked)
|
||||||
|
/tournament-server/
|
||||||
|
|||||||
@@ -96,3 +96,10 @@
|
|||||||
### Features
|
### Features
|
||||||
|
|
||||||
* NCWF-10 streaming endpoint ([#14](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/issues/14)) ([1dabd88](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/1dabd88c6286a7b01d6fe8527aec864b24e21cca))
|
* NCWF-10 streaming endpoint ([#14](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/issues/14)) ([1dabd88](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/1dabd88c6286a7b01d6fe8527aec864b24e21cca))
|
||||||
|
## [0.0.0](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/compare/0.6.0...0.0.0) (2026-06-23)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* api streaming issues ([0621968](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/0621968c3ceddebe01e9c363bda345b5dcccfbbf))
|
||||||
|
* api url ([2229cfd](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/2229cfd00a7d16daa6a9544c8940e792c4362dfb))
|
||||||
|
* streaming issues ([bd6d023](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/bd6d02351336ed6adf66244979c6d959f47e318b))
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<!-- Center links — only when logged in -->
|
<!-- Center links — only when logged in -->
|
||||||
@if (currentUser) {
|
@if (currentUser) {
|
||||||
<div class="nc-links">
|
<div class="nc-links">
|
||||||
<button type="button" class="nc-link">
|
<button type="button" class="nc-link" (click)="goToTournaments()">
|
||||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"
|
||||||
stroke-linecap="round" stroke-linejoin="round">
|
stroke-linecap="round" stroke-linejoin="round">
|
||||||
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" />
|
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" />
|
||||||
|
|||||||
@@ -51,13 +51,20 @@ export interface TournamentList {
|
|||||||
finished: Tournament[];
|
finished: Tournament[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface TournamentMatch {
|
||||||
|
gameId: string;
|
||||||
|
whiteId: string;
|
||||||
|
winner?: 'white' | 'black' | 'draw' | null;
|
||||||
|
status?: GameStatus;
|
||||||
|
}
|
||||||
|
|
||||||
export interface TournamentPairing {
|
export interface TournamentPairing {
|
||||||
id: string;
|
id?: string;
|
||||||
round: number;
|
round?: number;
|
||||||
white: TournamentBotRef | null;
|
white: TournamentBotRef | null;
|
||||||
black: TournamentBotRef;
|
black: TournamentBotRef;
|
||||||
gameId: string | null;
|
matches: TournamentMatch[];
|
||||||
winner: 'white' | 'black' | 'draw' | null;
|
winner?: 'white' | 'black' | 'draw' | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RoundPairings {
|
export interface RoundPairings {
|
||||||
|
|||||||
@@ -158,9 +158,10 @@
|
|||||||
<div class="state-msg small"><span class="pulse"></span>Loading…</div>
|
<div class="state-msg small"><span class="pulse"></span>Loading…</div>
|
||||||
} @else if (pairings && pairings.pairings.length > 0) {
|
} @else if (pairings && pairings.pairings.length > 0) {
|
||||||
<div class="pairings-list">
|
<div class="pairings-list">
|
||||||
@for (p of pairings.pairings; track p.id) {
|
@for (p of pairings.pairings; track pairingKey(p)) {
|
||||||
<div class="pairing-row" [class.is-watchable]="!!p.gameId"
|
@let gid = firstGameId(p);
|
||||||
(click)="p.gameId && watchGame(p.gameId)">
|
<div class="pairing-row" [class.is-watchable]="!!gid"
|
||||||
|
(click)="gid && watchGame(gid)">
|
||||||
<span class="pairing-white">{{ p.white?.name ?? 'Bye' }}</span>
|
<span class="pairing-white">{{ p.white?.name ?? 'Bye' }}</span>
|
||||||
<span class="pairing-vs">vs</span>
|
<span class="pairing-vs">vs</span>
|
||||||
<span class="pairing-black">{{ p.black.name }}</span>
|
<span class="pairing-black">{{ p.black.name }}</span>
|
||||||
@@ -168,7 +169,7 @@
|
|||||||
<span class="pairing-result" [class]="'result-' + p.winner">
|
<span class="pairing-result" [class]="'result-' + p.winner">
|
||||||
{{ p.winner === 'draw' ? '½–½' : p.winner === 'white' ? '1–0' : '0–1' }}
|
{{ p.winner === 'draw' ? '½–½' : p.winner === 'white' ? '1–0' : '0–1' }}
|
||||||
</span>
|
</span>
|
||||||
} @else if (p.gameId) {
|
} @else if (gid) {
|
||||||
<span class="pairing-ongoing">
|
<span class="pairing-ongoing">
|
||||||
<svg width="9" height="9" viewBox="0 0 24 24" fill="currentColor">
|
<svg width="9" height="9" viewBox="0 0 24 24" fill="currentColor">
|
||||||
<circle cx="12" cy="12" r="10"/>
|
<circle cx="12" cy="12" r="10"/>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { BotService } from '../../services/bot.service';
|
|||||||
import { OfficialBotService } from '../../services/official-bot.service';
|
import { OfficialBotService } from '../../services/official-bot.service';
|
||||||
import { TournamentServerService, ExternalTournamentServer } from '../../services/tournament-server.service';
|
import { TournamentServerService, ExternalTournamentServer } from '../../services/tournament-server.service';
|
||||||
import { Bot } from '../../models/bot.models';
|
import { Bot } from '../../models/bot.models';
|
||||||
import { Tournament, TournamentResult, RoundPairings } from '../../models/tournament.models';
|
import { Tournament, TournamentResult, RoundPairings, TournamentPairing } from '../../models/tournament.models';
|
||||||
import { CurrentUser } from '../../models/auth.models';
|
import { CurrentUser } from '../../models/auth.models';
|
||||||
import { environment } from '../../../environments/environment';
|
import { environment } from '../../../environments/environment';
|
||||||
|
|
||||||
@@ -167,6 +167,16 @@ export class TournamentsComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
firstGameId(p: TournamentPairing): string | null {
|
||||||
|
return p.matches?.[0]?.gameId ?? null;
|
||||||
|
}
|
||||||
|
|
||||||
|
pairingKey(p: TournamentPairing): string {
|
||||||
|
const w = p.white?.id ?? 'bye';
|
||||||
|
const b = p.black?.id ?? 'bye';
|
||||||
|
return `${w}-${b}-${this.firstGameId(p) ?? ''}`;
|
||||||
|
}
|
||||||
|
|
||||||
watchGame(gameId: string): void {
|
watchGame(gameId: string): void {
|
||||||
const tid = this.selectedTournament?.id;
|
const tid = this.selectedTournament?.id;
|
||||||
if (!tid) return;
|
if (!tid) return;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { Injectable, inject } from '@angular/core';
|
|||||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { Tournament, TournamentList, RoundPairings } from '../models/tournament.models';
|
import { Tournament, TournamentList, RoundPairings } from '../models/tournament.models';
|
||||||
|
import { environment } from '../../environments/environment';
|
||||||
|
|
||||||
export interface CreateTournamentForm {
|
export interface CreateTournamentForm {
|
||||||
name: string;
|
name: string;
|
||||||
@@ -14,7 +15,7 @@ export interface CreateTournamentForm {
|
|||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class TournamentService {
|
export class TournamentService {
|
||||||
private readonly http = inject(HttpClient);
|
private readonly http = inject(HttpClient);
|
||||||
private readonly base = '/api/tournament';
|
private readonly base = `${(environment.tournamentServerUrl ?? '').replace(/\/+$/, '')}/api/tournament`;
|
||||||
|
|
||||||
list(): Observable<TournamentList> {
|
list(): Observable<TournamentList> {
|
||||||
return this.http.get<TournamentList>(this.base);
|
return this.http.get<TournamentList>(this.base);
|
||||||
|
|||||||
Submodule tournament-server deleted from ffe36da943
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
MAJOR=0
|
MAJOR=0
|
||||||
MINOR=6
|
MINOR=6
|
||||||
PATCH=0
|
PATCH=1
|
||||||
|
|||||||
Reference in New Issue
Block a user