Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Admin panel - add to the system info - WebRootPath/ContentRootPath/EnvironmentName

support60021a4d6398
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/System/SystemInfo.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/System/SystemInfo.cshtml
index 5d9e07460..d65cb1478 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/System/SystemInfo.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/System/SystemInfo.cshtml
@@ -48,6 +48,24 @@
<label class="control-label">@Model.AspNetInfo</label>
</div>
</div>
+ <div class="form-group">
+ <admin-label asp-for="WebRootPath" />
+ <div class="col-md-9 col-sm-9">
+ <label class="control-label">@Model.WebRootPath</label>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="ContentRootPath" />
+ <div class="col-md-9 col-sm-9">
+ <label class="control-label">@Model.ContentRootPath</label>
+ </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="EnvironmentName" />
+ <div class="col-md-9 col-sm-9">
+ <label class="control-label">@Model.EnvironmentName</label>
+ </div>
+ </div>
<div class="form-group">
<admin-label asp-for="ServerTimeZone" />
<div class="col-md-9 col-sm-9">
diff --git a/src/Web/Grand.Web.Admin/Controllers/SystemController.cs b/src/Web/Grand.Web.Admin/Controllers/SystemController.cs
index d37119e32..f03a900c3 100644
--- a/src/Web/Grand.Web.Admin/Controllers/SystemController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/SystemController.cs
@@ -16,6 +16,7 @@ using Grand.Web.Admin.Extensions;
using Grand.Web.Admin.Models.Common;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Security.Authorization;
+using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Hosting;
@@ -37,6 +38,7 @@ namespace Grand.Web.Admin.Controllers
private readonly ITranslationService _translationService;
private readonly IMachineNameProvider _machineNameProvider;
private readonly IHostApplicationLifetime _applicationLifetime;
+ private readonly IWebHostEnvironment _webHostEnvironment;
private readonly ILogger _logger;
private readonly CurrencySettings _currencySettings;
@@ -55,6 +57,7 @@ namespace Grand.Web.Admin.Controllers
ITranslationService translationService,
IMachineNameProvider machineNameProvider,
IHostApplicationLifetime applicationLifetime,
+ IWebHostEnvironment webHostEnvironment,
ILogger logger,
CurrencySettings currencySettings,
MeasureSettings measureSettings,
@@ -70,6 +73,7 @@ namespace Grand.Web.Admin.Controllers
_workContext = workContext;
_translationService = translationService;
_applicationLifetime = applicationLifetime;
+ _webHostEnvironment = webHostEnvironment;
_logger = logger;
_extConfig = extConfig;
_machineNameProvider = machineNameProvider;
@@ -95,7 +99,9 @@ namespace Grand.Web.Admin.Controllers
catch (Exception) { }
model.MachineName = _machineNameProvider.GetMachineName();
-
+ model.WebRootPath = _webHostEnvironment.WebRootPath;
+ model.ContentRootPath = _webHostEnvironment.ContentRootPath;
+ model.EnvironmentName = _webHostEnvironment.EnvironmentName;
model.ServerTimeZone = TimeZoneInfo.Local.StandardName;
model.ServerLocalTime = DateTime.Now;
model.ApplicationTime = _dateTimeService.ConvertToUserTime(DateTime.UtcNow, TimeZoneInfo.Utc, _dateTimeService.CurrentTimeZone);
diff --git a/src/Web/Grand.Web.Admin/Models/Common/SystemInfoModel.cs b/src/Web/Grand.Web.Admin/Models/Common/SystemInfoModel.cs
index be29c0db2..2d180701f 100644
--- a/src/Web/Grand.Web.Admin/Models/Common/SystemInfoModel.cs
+++ b/src/Web/Grand.Web.Admin/Models/Common/SystemInfoModel.cs
@@ -7,9 +7,9 @@ namespace Grand.Web.Admin.Models.Common
{
public SystemInfoModel()
{
- this.ServerVariables = new List<ServerVariableModel>();
- this.LoadedAssemblies = new List<LoadedAssembly>();
- this.SystemWarnings = new List<SystemWarningModel>();
+ ServerVariables = new List<ServerVariableModel>();
+ LoadedAssemblies = new List<LoadedAssembly>();
+ SystemWarnings = new List<SystemWarningModel>();
}
[GrandResourceDisplayName("Admin.System.SystemInfo.ASPNETInfo")]
@@ -25,6 +25,15 @@ namespace Grand.Web.Admin.Models.Common
[GrandResourceDisplayName("Admin.System.SystemInfo.OperatingSystem")]
public string OperatingSystem { get; set; }
+ [GrandResourceDisplayName("Admin.System.SystemInfo.WebRootPath")]
+ public string WebRootPath { get; set; }
+
+ [GrandResourceDisplayName("Admin.System.SystemInfo.ContentRootPath")]
+ public string ContentRootPath { get; set; }
+
+ [GrandResourceDisplayName("Admin.System.SystemInfo.EnvironmentName")]
+ public string EnvironmentName { get; set; }
+
[GrandResourceDisplayName("Admin.System.SystemInfo.ServerLocalTime")]
public DateTime ServerLocalTime { get; set; }
diff --git a/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml b/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml
index a978dacb9..78d505aac 100644
--- a/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml
+++ b/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml
@@ -12594,9 +12594,15 @@
<Resource Name="Admin.System.SystemInfo.ASPNETInfo">
<Value>ASP.NET info</Value>
</Resource>
+ <Resource Name="Admin.System.SystemInfo.ContentRootPath">
+ <Value>Absolute path to the directory that contains the application content files</Value>
+ </Resource>
<Resource Name="Admin.System.SystemInfo.GrandVersion">
<Value>grandnode version</Value>
</Resource>
+ <Resource Name="Admin.System.SystemInfo.EnvironmentName">
+ <Value>The name of the environment</Value>
+ </Resource>
<Resource Name="Admin.System.SystemInfo.HTTPHOST">
<Value>HTTP_HOST</Value>
</Resource>
@@ -12623,10 +12629,13 @@
</Resource>
<Resource Name="Admin.System.SystemInfo.ServerVariables">
<Value>Server variables</Value>
- </Resource>
+ </Resource>
<Resource Name="Admin.System.SystemInfo.UTCTime">
<Value>Greenwich Mean Time (GMT/UTC)</Value>
</Resource>
+ <Resource Name="Admin.System.SystemInfo.WebRootPath">
+ <Value>Absolute path to the directory that contains the web-servable application content files</Value>
+ </Resource>
<Resource Name="Admin.System.UserApi.Email">
<Value>Email</Value>
</Resource>
diff --git a/src/Web/Grand.Web/App_Data/Resources/Upgrade/en_200.xml b/src/Web/Grand.Web/App_Data/Resources/Upgrade/en_200.xml
index 8d6847b7b..62c5b03b9 100644
--- a/src/Web/Grand.Web/App_Data/Resources/Upgrade/en_200.xml
+++ b/src/Web/Grand.Web/App_Data/Resources/Upgrade/en_200.xml
@@ -51,4 +51,13 @@
<Resource Name="Admin.Settings.GeneralCommon.ReCaptchaScore">
<Value>reCAPTCHA v3 Score (1.0 is very likely a very good interaction, 0.0 is very likely a bot)</Value>
</Resource>
+ <Resource Name="Admin.System.SystemInfo.WebRootPath">
+ <Value>Absolute path to the directory that contains the web-servable application content files</Value>
+ </Resource>
+ <Resource Name="Admin.System.SystemInfo.ContentRootPath">
+ <Value>Absolute path to the directory that contains the application content files</Value>
+ </Resource>
+ <Resource Name="Admin.System.SystemInfo.EnvironmentName">
+ <Value>The name of the environment</Value>
+ </Resource>
</Language>
\ No newline at end of file