Files
ersatztv/web/src/api/troubleshoot.ts
T
timothy 5530db7089
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 4m26s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 4m39s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
feat(web): logs and troubleshooting screens for SPA parity (#145)
Add typed API wrappers (api/logs.ts, api/troubleshoot.ts) and two new
screens: LogsScreen (paged, level-badged, server-side filtered log table)
and TroubleshootingScreen (General JSON viewer with copy, plus per-platform
NVIDIA/QSV/VAAPI/VideoToolbox capability tabs when populated). Both are
registered under a new "System" nav group in App.tsx alongside Settings.
Settings' Classic UI help text and About card now point at the new screens
instead of the Blazor logs/troubleshooting pages.
2026-07-07 13:42:01 +02:00

21 lines
619 B
TypeScript

import { ApiError, request } from './client';
import type { components } from './generated/v1';
export type TroubleshootingInfo = components['schemas']['TroubleshootingInfoResponseModel'];
export function getTroubleshootingInfo(): Promise<TroubleshootingInfo> {
return request<TroubleshootingInfo>('/api/troubleshoot/info');
}
export function messageFromTroubleshootError(error: unknown, fallback = 'Unable to load troubleshooting info'): string {
if (error instanceof ApiError) {
return error.detail ?? error.message;
}
if (error instanceof Error) {
return error.message;
}
return fallback;
}