mirror of
https://github.com/alexhopeoconnor/dnsmasq-webui.git
synced 2026-10-13 15:31:17 +10:00
- Update Bootstrap to 5.3.8, add Bootstrap Icons; replace custom SVGs - Fix settings modal: load editing state only when modal opens (avoid refresh overwrite) - Home: StatusSection and LogsSection components with own timers - Move HTTP clients under Client/Http with Abstractions namespace pattern - Rename Options to Configuration; remove empty Options dir - Components: Modals/, Home/; consistent Abstractions (Services, Client.Services, Client.Http)
21 lines
673 B
C#
21 lines
673 B
C#
using DnsmasqWebUI.Client.Http.Abstractions;
|
|
using DnsmasqWebUI.Services.Abstractions;
|
|
using System.Net.Http.Json;
|
|
|
|
namespace DnsmasqWebUI.Client.Http;
|
|
|
|
public sealed class ReloadClient : IReloadClient
|
|
{
|
|
private readonly HttpClient _http;
|
|
|
|
public ReloadClient(HttpClient http) => _http = http;
|
|
|
|
public async Task<ReloadResult> ReloadAsync(CancellationToken ct = default)
|
|
{
|
|
var response = await _http.PostAsync("api/reload", null, ct);
|
|
response.EnsureSuccessStatusCode();
|
|
return await response.Content.ReadFromJsonAsync<ReloadResult>(ct)
|
|
?? throw new InvalidOperationException("Unexpected null from api/reload.");
|
|
}
|
|
}
|