添加 页脚 编译时间显示

This commit is contained in:
Kimdiego2098
2023-08-29 17:01:46 +08:00
parent 5ef2b0089e
commit a049176c14
2 changed files with 9 additions and 2 deletions

View File

@@ -19,7 +19,7 @@
<MSheet> <MSheet>
<MCard Flat Href=@CONFIG_COPYRIGHT_URL Target="_blank"> <MCard Flat Href=@CONFIG_COPYRIGHT_URL Target="_blank">
<MLabel Style="background-color:inherit;" Class="text-subtltie-2">@CONFIG_COPYRIGHT</MLabel> <MLabel Style="background-color:inherit;" Class="text-subtltie-2">@CONFIG_COPYRIGHT</MLabel>
<MLabel Style="background-color:inherit;" Class="text-subtltie-2 ml-4">@Version</MLabel> <MLabel Style="background-color:inherit;white-space: pre;" Class="text-subtltie-2 ml-4">@Version</MLabel>
</MCard> </MCard>
</MSheet> </MSheet>

View File

@@ -14,6 +14,8 @@ using Microsoft.AspNetCore.Components;
using System.Reflection; using System.Reflection;
using ThingsGateway.Admin.Core;
namespace ThingsGateway.Admin.Blazor.Core; namespace ThingsGateway.Admin.Blazor.Core;
/// <summary> /// <summary>
/// Foter /// Foter
@@ -40,7 +42,12 @@ public partial class Foter
/// <inheritdoc/> /// <inheritdoc/>
protected override async Task OnParametersSetAsync() protected override async Task OnParametersSetAsync()
{ {
Version = "v" + Assembly.GetExecutingAssembly().GetName().Version.ToString(); var assembly = Assembly.GetEntryAssembly();
if (assembly != null)
{
Version = $"v{assembly.GetName().Version} {new System.IO.FileInfo(assembly.Location).LastWriteTime.ToDefaultDateTimeFormat()}";
}
await base.OnParametersSetAsync(); await base.OnParametersSetAsync();
} }