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.
21 lines
619 B
TypeScript
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;
|
|
}
|