Add SPA to the Drive project for further usage

This commit is contained in:
2025-07-25 22:47:23 +08:00
parent d13fb8b0e4
commit 123dce564c
41 changed files with 2311 additions and 8 deletions

View File

@@ -0,0 +1,24 @@
using DysonNetwork.Shared.Data;
using DysonNetwork.Shared.PageData;
namespace DysonNetwork.Drive.Pages.Data;
public class VersionPageData : IPageDataProvider
{
public bool CanHandlePath(PathString path) => true;
public Task<IDictionary<string, object?>> GetAppDataAsync(HttpContext context)
{
var versionData = new AppVersion
{
Version = ThisAssembly.AssemblyVersion,
Commit = ThisAssembly.GitCommitId,
UpdateDate = ThisAssembly.GitCommitDate
};
var result = typeof(AppVersion).GetProperties()
.ToDictionary(property => property.Name, property => property.GetValue(versionData));
return Task.FromResult<IDictionary<string, object?>>(result);
}
}