Implemented new diagnostics endpoints in the API and added corresponding route configurations in the frontend. Introduced types for diagnostics data, including host, forwarding, and system diagnostics, to enhance monitoring capabilities. Updated localization files to support diagnostics UI elements in both English and Russian, ensuring a comprehensive user experience.
30 lines
1.1 KiB
C#
30 lines
1.1 KiB
C#
using LiteCqrs;
|
|
|
|
namespace TeleWave.Application.Diagnostics;
|
|
|
|
/// <summary>Живое состояние инфраструктуры для админской панели диагностики: БД, хранилище, ffmpeg.</summary>
|
|
public sealed record GetSystemDiagnosticsQuery : IQuery<SystemDiagnosticsDto>;
|
|
|
|
public sealed record SystemDiagnosticsDto(
|
|
DatabaseDiagnosticsDto Database,
|
|
StorageDiagnosticsDto Storage,
|
|
ToolDiagnosticsDto Ffmpeg,
|
|
ToolDiagnosticsDto Ffprobe
|
|
);
|
|
|
|
/// <summary>Доступность БД и время лёгкого запроса; при ошибке — её текст без latency.</summary>
|
|
public sealed record DatabaseDiagnosticsDto(bool Reachable, long? LatencyMs, string? Error);
|
|
|
|
/// <summary><c>LowSpace</c> — свободного меньше порога <c>MinFreeBytes</c> (место известно и оно мало).</summary>
|
|
public sealed record StorageDiagnosticsDto(
|
|
string RootPath,
|
|
bool Exists,
|
|
bool Writable,
|
|
long TotalBytes,
|
|
long FreeBytes,
|
|
long MinFreeBytes,
|
|
bool LowSpace
|
|
);
|
|
|
|
public sealed record ToolDiagnosticsDto(bool Available, string? Version);
|