🧱 Mixed page infra
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="">
|
||||
<head>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="icon" href="/favicon.ico">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Solarpass</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
%%APP_DATA%%
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
0
DysonNetwork.Pass/Client/src/views/authorize.vue
Normal file
0
DysonNetwork.Pass/Client/src/views/authorize.vue
Normal file
@@ -9,10 +9,11 @@
|
||||
|
||||
<p class="mt-4 opacity-75 text-xs">
|
||||
<span v-if="version == null">Loading...</span>
|
||||
<span v-else
|
||||
>v{{ version.version }} @ {{ version.commit.substring(0, 6) }}
|
||||
{{ version.updatedAt }}</span
|
||||
>
|
||||
<span v-else>
|
||||
v{{ version.version }} @
|
||||
{{ version.commit.substring(0, 6) }}
|
||||
{{ version.updatedAt }}
|
||||
</span>
|
||||
</p>
|
||||
</n-card>
|
||||
</section>
|
||||
|
0
DysonNetwork.Pass/Client/src/views/login.vue
Normal file
0
DysonNetwork.Pass/Client/src/views/login.vue
Normal file
24
DysonNetwork.Pass/Pages/Data/VersionPageData.cs
Normal file
24
DysonNetwork.Pass/Pages/Data/VersionPageData.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using DysonNetwork.Shared.Data;
|
||||
using DysonNetwork.Shared.PageData;
|
||||
|
||||
namespace DysonNetwork.Pass.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);
|
||||
}
|
||||
}
|
@@ -1,6 +1,9 @@
|
||||
using System.Text.Json;
|
||||
using DysonNetwork.Pass;
|
||||
using DysonNetwork.Pass.Pages.Data;
|
||||
using DysonNetwork.Pass.Startup;
|
||||
using DysonNetwork.Shared.Http;
|
||||
using DysonNetwork.Shared.PageData;
|
||||
using DysonNetwork.Shared.Registry;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
@@ -30,6 +33,8 @@ builder.Services.AddAppBusinessServices(builder.Configuration);
|
||||
// Add scheduled jobs
|
||||
builder.Services.AddAppScheduledJobs();
|
||||
|
||||
builder.Services.AddTransient<IPageDataProvider, VersionPageData>();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Run database migrations
|
||||
@@ -42,6 +47,8 @@ using (var scope = app.Services.CreateScope())
|
||||
// Configure application middleware pipeline
|
||||
app.ConfigureAppMiddleware(builder.Configuration, builder.Environment.ContentRootPath);
|
||||
|
||||
app.MapPages(Path.Combine(builder.Environment.WebRootPath, "dist", "index.html"));
|
||||
|
||||
// Configure gRPC
|
||||
app.ConfigureGrpcServices();
|
||||
|
||||
|
@@ -46,8 +46,6 @@ public static class ApplicationConfiguration
|
||||
|
||||
app.MapControllers().RequireRateLimiting("fixed");
|
||||
|
||||
app.MapFallbackToFile("dist/index.html");
|
||||
|
||||
return app;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user