additional system info

This commit is contained in:
Shaun Walker
2021-06-25 15:06:52 -04:00
parent e1e4d82684
commit db1808d3e9
4 changed files with 201 additions and 163 deletions

View File

@ -124,88 +124,4 @@ namespace Oqtane.Controllers
_installationManager.InstallPackages();
}
}
public partial class SearchResult
{
[JsonProperty("@context")]
public Context Context { get; set; }
[JsonProperty("totalHits")]
public long TotalHits { get; set; }
[JsonProperty("data")]
public Data[] Data { get; set; }
}
public partial class Context
{
[JsonProperty("@vocab")]
public Uri Vocab { get; set; }
[JsonProperty("@base")]
public Uri Base { get; set; }
}
public partial class Data
{
[JsonProperty("@id")]
public Uri Url { get; set; }
[JsonProperty("@type")]
public string Type { get; set; }
[JsonProperty("registration")]
public Uri Registration { get; set; }
[JsonProperty("id")]
public string Id { get; set; }
[JsonProperty("version")]
public string Version { get; set; }
[JsonProperty("description")]
public string Description { get; set; }
[JsonProperty("summary")]
public string Summary { get; set; }
[JsonProperty("title")]
public string Title { get; set; }
[JsonProperty("iconUrl")]
public Uri IconUrl { get; set; }
[JsonProperty("licenseUrl")]
public Uri LicenseUrl { get; set; }
[JsonProperty("projectUrl")]
public Uri ProjectUrl { get; set; }
[JsonProperty("tags")]
public string[] Tags { get; set; }
[JsonProperty("authors")]
public string[] Authors { get; set; }
[JsonProperty("totalDownloads")]
public long TotalDownloads { get; set; }
[JsonProperty("verified")]
public bool Verified { get; set; }
[JsonProperty("versions")]
public Version[] Versions { get; set; }
}
public partial class Version
{
[JsonProperty("version")]
public string Number { get; set; }
[JsonProperty("downloads")]
public long Downloads { get; set; }
[JsonProperty("@id")]
public Uri Url { get; set; }
}
}

View File

@ -27,12 +27,17 @@ namespace Oqtane.Controllers
{
Dictionary<string, string> systeminfo = new Dictionary<string, string>();
systeminfo.Add("rendermode", _configManager.GetSetting("RenderMode", "Server"));
systeminfo.Add("clrversion", Environment.Version.ToString());
systeminfo.Add("osversion", Environment.OSVersion.ToString());
systeminfo.Add("machinename", Environment.MachineName);
systeminfo.Add("serverpath", _environment.ContentRootPath);
systeminfo.Add("servertime", DateTime.Now.ToString());
systeminfo.Add("installationid", GetInstallationId());
systeminfo.Add("runtime", _configManager.GetSetting("Runtime", "Server"));
systeminfo.Add("rendermode", _configManager.GetSetting("RenderMode", "ServerPrerendered"));
systeminfo.Add("detailederrors", _configManager.GetSetting("DetailedErrors", "false"));
systeminfo.Add("logginglevel", _configManager.GetSetting("Logging:LogLevel:Default", "Information"));
return systeminfo;
}
@ -51,9 +56,25 @@ namespace Oqtane.Controllers
case "rendermode":
_configManager.AddOrUpdateSetting("RenderMode", kvp.Value, false);
break;
case "detailederrors":
_configManager.AddOrUpdateSetting("DetailedErrors", kvp.Value, false);
break;
case "logginglevel":
_configManager.AddOrUpdateSetting("Logging:LogLevel:Default", kvp.Value, false);
break;
}
}
}
private string GetInstallationId()
{
var installationid = _configManager.GetSetting("InstallationId", "");
if (installationid == "")
{
installationid = Guid.NewGuid().ToString();
_configManager.AddOrUpdateSetting("InstallationId", installationid, true);
}
return installationid;
}
}
}