From a9932aa1442fbd6e651304d984b8549b856ecbec Mon Sep 17 00:00:00 2001 From: Jeremy Farrance Date: Fri, 4 Oct 2024 23:04:37 -0500 Subject: [PATCH] Enhancement to PersonaBar, Settings, Servers, System Info, Web subtab that adds the .NET Framework Product Version --- .../Servers.Web/src/components/Tabs/Web.jsx | 16 ++-- .../src/services/smtpServerService.js | 2 +- .../Servers/WebServer/ServerInfo.cs | 62 +++++++------- .../Dnn.PersonaBar.Extensions.csproj | 4 +- .../Services/SystemInfoWebController.cs | 83 ++++++++++--------- .../App_LocalResources/Servers.resx | 10 ++- .../siteimportexport-bundle.js.LICENSE.txt | 5 ++ 7 files changed, 101 insertions(+), 81 deletions(-) create mode 100644 Dnn.AdminExperience/Dnn.PersonaBar.Extensions/admin/personaBar/Dnn.SiteImportExport/scripts/bundles/siteimportexport-bundle.js.LICENSE.txt diff --git a/Dnn.AdminExperience/ClientSide/Servers.Web/src/components/Tabs/Web.jsx b/Dnn.AdminExperience/ClientSide/Servers.Web/src/components/Tabs/Web.jsx index 4ea8165e3c7..7ce4b0b9b62 100644 --- a/Dnn.AdminExperience/ClientSide/Servers.Web/src/components/Tabs/Web.jsx +++ b/Dnn.AdminExperience/ClientSide/Servers.Web/src/components/Tabs/Web.jsx @@ -37,21 +37,25 @@ class Web extends Component { tooltip={Localization.get("ServerInfo_IISVersion.Help")} text={props.webServerInfo.iisVersion || defaultPlaceHolder} /> - + + +
- + +
-
-
+ diff --git a/Dnn.AdminExperience/ClientSide/Servers.Web/src/services/smtpServerService.js b/Dnn.AdminExperience/ClientSide/Servers.Web/src/services/smtpServerService.js index 47c38b9ff20..27ab30bfe4e 100644 --- a/Dnn.AdminExperience/ClientSide/Servers.Web/src/services/smtpServerService.js +++ b/Dnn.AdminExperience/ClientSide/Servers.Web/src/services/smtpServerService.js @@ -17,7 +17,7 @@ const sendTestEmail = function (parameters) { return serviceFramework.post(getControllerName(), "SendTestEmail", parameters); }; -const getOAuthProviders = function(){ +const getOAuthProviders = function () { return serviceFramework.get(getControllerName(), "GetSmtpOAuthProviders"); }; diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Servers/WebServer/ServerInfo.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Servers/WebServer/ServerInfo.cs index 7a7ecb8d30b..eefe8bd30cd 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Servers/WebServer/ServerInfo.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Servers/WebServer/ServerInfo.cs @@ -2,33 +2,35 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information -namespace Dnn.PersonaBar.Servers.Components.WebServer -{ - using System; - using System.Net; - using System.Security.Principal; - using System.Web; - - using DotNetNuke.Common; - - public class ServerInfo - { - public string Framework => Environment.Version.ToString(); - - public string HostName => Dns.GetHostName(); - - public string Identity => WindowsIdentity.GetCurrent().Name; - - public string IISVersion => HttpContext.Current.Request.ServerVariables["SERVER_SOFTWARE"]; - - public string OSVersion => Environment.OSVersion.ToString(); - - public string PhysicalPath => Globals.ApplicationMapPath; - - public string Url => Globals.GetDomainName(HttpContext.Current.Request); - - public string RelativePath => string.IsNullOrEmpty(Globals.ApplicationPath) ? "/" : Globals.ApplicationPath; - - public string ServerTime => DateTime.Now.ToString(); - } -} +namespace Dnn.PersonaBar.Servers.Components.WebServer +{ + using System; + using System.Net; + using System.Security.Principal; + using System.Web; + + using DotNetNuke.Common; + + public class ServerInfo + { + public string Framework => Environment.Version.ToString(); + + public string NetFrameworkVersion => Globals.NETFrameworkVersion.ToString(3); + + public string HostName => Dns.GetHostName(); + + public string Identity => WindowsIdentity.GetCurrent().Name; + + public string IISVersion => HttpContext.Current.Request.ServerVariables["SERVER_SOFTWARE"]; + + public string OSVersion => Environment.OSVersion.ToString(); + + public string PhysicalPath => Globals.ApplicationMapPath; + + public string Url => Globals.GetDomainName(HttpContext.Current.Request); + + public string RelativePath => string.IsNullOrEmpty(Globals.ApplicationPath) ? "/" : Globals.ApplicationPath; + + public string ServerTime => DateTime.Now.ToString(); + } +} diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.csproj b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.csproj index d035508f6eb..1e586ba7147 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.csproj +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.csproj @@ -659,7 +659,9 @@ - + + Designer + diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Services/SystemInfoWebController.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Services/SystemInfoWebController.cs index 1bb3f3ccd00..0edfc1dbc35 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Services/SystemInfoWebController.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Services/SystemInfoWebController.cs @@ -2,48 +2,49 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information -namespace Dnn.PersonaBar.Servers.Services -{ - using System; - using System.Net; - using System.Net.Http; - using System.Web.Http; +namespace Dnn.PersonaBar.Servers.Services +{ + using System; + using System.Net; + using System.Net.Http; + using System.Web.Http; - using Dnn.PersonaBar.Library; - using Dnn.PersonaBar.Library.Attributes; - using Dnn.PersonaBar.Servers.Components.WebServer; - using DotNetNuke.Instrumentation; + using Dnn.PersonaBar.Library; + using Dnn.PersonaBar.Library.Attributes; + using Dnn.PersonaBar.Servers.Components.WebServer; + using DotNetNuke.Instrumentation; + + [MenuPermission(Scope = ServiceScope.Host)] + public class SystemInfoWebController : PersonaBarApiController + { + private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(SystemInfoWebController)); - [MenuPermission(Scope = ServiceScope.Host)] - public class SystemInfoWebController : PersonaBarApiController - { - private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(SystemInfoWebController)); - [HttpGet] - public HttpResponseMessage GetWebServerInfo() - { - try - { - var serverInfo = new ServerInfo(); - return this.Request.CreateResponse(HttpStatusCode.OK, new - { - osVersion = serverInfo.OSVersion, - iisVersion = serverInfo.IISVersion, - framework = serverInfo.Framework, - identity = serverInfo.Identity, - hostName = serverInfo.HostName, - physicalPath = serverInfo.PhysicalPath, - url = serverInfo.Url, - relativePath = serverInfo.RelativePath, - serverTime = serverInfo.ServerTime, - }); - } - catch (Exception exc) - { - Logger.Error(exc); - return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); - } - } - } -} + public HttpResponseMessage GetWebServerInfo() + { + try + { + var serverInfo = new ServerInfo(); + return this.Request.CreateResponse(HttpStatusCode.OK, new + { + osVersion = serverInfo.OSVersion, + iisVersion = serverInfo.IISVersion, + framework = serverInfo.Framework, + netFrameworkVersion = serverInfo.NetFrameworkVersion, + identity = serverInfo.Identity, + hostName = serverInfo.HostName, + physicalPath = serverInfo.PhysicalPath, + url = serverInfo.Url, + relativePath = serverInfo.RelativePath, + serverTime = serverInfo.ServerTime, + }); + } + catch (Exception exc) + { + Logger.Error(exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + } + } + } +} diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/admin/personaBar/Dnn.Servers/App_LocalResources/Servers.resx b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/admin/personaBar/Dnn.Servers/App_LocalResources/Servers.resx index f9921e32b99..398319bd7b0 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/admin/personaBar/Dnn.Servers/App_LocalResources/Servers.resx +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/admin/personaBar/Dnn.Servers/App_LocalResources/Servers.resx @@ -148,10 +148,16 @@ Web - The version of .NET. + This is the CLR version. The first two parts (e.g. 4.0) indicates the major version of the CLR, and remaining is the build number. - .NET Framework Version: + .NET Framework CLR Version: + + + This is the version number that is typically used to refer to the .NET Framework as a product (e.g. 4.8.1). + + + .NET Framework Product Version: The name of the Host computer. diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/admin/personaBar/Dnn.SiteImportExport/scripts/bundles/siteimportexport-bundle.js.LICENSE.txt b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/admin/personaBar/Dnn.SiteImportExport/scripts/bundles/siteimportexport-bundle.js.LICENSE.txt new file mode 100644 index 00000000000..827f2732cb2 --- /dev/null +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/admin/personaBar/Dnn.SiteImportExport/scripts/bundles/siteimportexport-bundle.js.LICENSE.txt @@ -0,0 +1,5 @@ +/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/