Mise à jour vers 0.8.5 ; ajout de la bascule entre le canal bêta et le canal stable
Some checks failed
E2E Tests / e2e (push) Failing after 21s
Build & Push Images / build (brain) (push) Successful in 1m0s
Build & Push Images / build (core) (push) Successful in 1m34s
Build & Push Images / build-switcher (push) Successful in 39s
Build & Push Images / build (web) (push) Successful in 1m40s
Some checks failed
E2E Tests / e2e (push) Failing after 21s
Build & Push Images / build (brain) (push) Successful in 1m0s
Build & Push Images / build (core) (push) Successful in 1m34s
Build & Push Images / build-switcher (push) Successful in 39s
Build & Push Images / build (web) (push) Successful in 1m40s
This commit is contained in:
@@ -19,6 +19,24 @@ export interface LicenseStatusDTO {
|
||||
betaChannelEnabled: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Etat du canal courant + dernier resultat de bascule (cf. ChannelStatusDTO cote backend).
|
||||
*/
|
||||
export type ChannelName = 'stable' | 'beta';
|
||||
export type SwitchStatus = 'IN_PROGRESS' | 'SUCCESS' | 'ERROR';
|
||||
|
||||
export interface ChannelStatusDTO {
|
||||
currentChannel: ChannelName;
|
||||
switcherAvailable: boolean;
|
||||
lastSwitch: {
|
||||
id: string;
|
||||
status: SwitchStatus;
|
||||
channel: ChannelName;
|
||||
message: string;
|
||||
completedAt: string;
|
||||
} | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reflet de UpdateCheckService.BetaStatus.
|
||||
*/
|
||||
@@ -91,4 +109,23 @@ export class LicenseService {
|
||||
catchError(() => of(null))
|
||||
);
|
||||
}
|
||||
|
||||
/** Etat du canal courant et dernier resultat de switch (pour polling UI). */
|
||||
getChannelStatus(): Observable<ChannelStatusDTO | null> {
|
||||
return this.http.get<ChannelStatusDTO>(`${this.apiUrl}/channel`, this.authOptions).pipe(
|
||||
catchError(() => of(null))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Declenche un switch de canal. 202 + { id, channel } si accepte,
|
||||
* sinon erreur (403 = pas de licence, 503 = sidecar indispo, etc.).
|
||||
*/
|
||||
switchChannel(channel: ChannelName): Observable<{ id: string; channel: ChannelName } | { error: string }> {
|
||||
return this.http.post<{ id: string; channel: ChannelName }>(
|
||||
`${this.apiUrl}/channel/switch`, { channel }, this.authOptions
|
||||
).pipe(
|
||||
catchError((err) => of({ error: err?.error?.error ?? 'Echec du switch de canal' }))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user