using System.Net.Http; using System.Threading.Tasks; using System.Collections.Generic; using Oqtane.Documentation; using Oqtane.Shared; using System.Net; namespace Oqtane.Services { [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class SystemService : ServiceBase, ISystemService { public SystemService(HttpClient http, SiteState siteState) : base(http, siteState) { } private string Apiurl => CreateApiUrl("System"); public async Task> GetSystemInfoAsync() { return await GetSystemInfoAsync("configuration"); } public async Task> GetSystemInfoAsync(string type) { return await GetJsonAsync>($"{Apiurl}?type={type}"); } public async Task GetSystemInfoAsync(string settingKey, object defaultValue) { return await GetJsonAsync($"{Apiurl}/{settingKey}/{defaultValue}"); } public async Task UpdateSystemInfoAsync(Dictionary settings) { await PostJsonAsync(Apiurl, settings); } public async Task> GetIconsAsync() { return await GetJsonAsync>($"{Apiurl}/icons"); } } }