@namespace Oqtane.Modules.Admin.SystemInfo @inherits ModuleBase @inject ISystemService SystemService @inject IInstallationService InstallationService @inject IStringLocalizer Localizer @inject IStringLocalizer SharedLocalizer




  @Localizer["Access.ApiFramework"] 
@code { public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host; private string _version = string.Empty; private string _clrversion = string.Empty; private string _osversion = string.Empty; private string _serverpath = string.Empty; private string _servertime = string.Empty; private string _installationid = string.Empty; private string _detailederrors = string.Empty; private string _logginglevel = string.Empty; private string _swagger = string.Empty; private string _packageservice = string.Empty; protected override async Task OnInitializedAsync() { _version = Constants.Version; Dictionary systeminfo = await SystemService.GetSystemInfoAsync(); if (systeminfo != null) { _clrversion = systeminfo["clrversion"]; _osversion = systeminfo["osversion"]; _serverpath = systeminfo["serverpath"]; _servertime = systeminfo["servertime"] + " UTC"; _installationid = systeminfo["installationid"]; _detailederrors = systeminfo["detailederrors"]; _logginglevel = systeminfo["logginglevel"]; _swagger = systeminfo["swagger"]; _packageservice = systeminfo["packageservice"]; } } private async Task SaveConfig() { try { var settings = new Dictionary(); settings.Add("detailederrors", _detailederrors); settings.Add("logginglevel", _logginglevel); settings.Add("swagger", _swagger); settings.Add("packageservice", _packageservice); await SystemService.UpdateSystemInfoAsync(settings); AddModuleMessage(Localizer["Success.UpdateConfig.Restart"], MessageType.Success); } catch (Exception ex) { await logger.LogError(ex, "Error Saving Configuration"); AddModuleMessage(Localizer["Error.UpdateConfig"], MessageType.Error); } } private async Task RestartApplication() { try { ShowProgressIndicator(); var interop = new Interop(JSRuntime); await interop.RedirectBrowser(NavigateUrl(""), 20); await InstallationService.RestartAsync(); } catch (Exception ex) { await logger.LogError(ex, "Error Restarting Application"); } } }