mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-28 07:58:40 +00:00
Add razor page support
This commit is contained in:
parent
443bb1fc02
commit
0d5139489a
6 changed files with 41 additions and 2 deletions
|
@ -2,6 +2,7 @@ using System;
|
|||
using System.IO;
|
||||
using Kettu;
|
||||
using LBPUnion.ProjectLighthouse.Logging;
|
||||
using LBPUnion.ProjectLighthouse.Types.Settings;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse.Helpers
|
||||
{
|
||||
|
@ -50,6 +51,7 @@ namespace LBPUnion.ProjectLighthouse.Helpers
|
|||
|
||||
public static string CommitHash { get; set; }
|
||||
public static string Branch { get; set; }
|
||||
public static string FullVersion => $"{ServerStatics.ServerName} {Branch}@{CommitHash}";
|
||||
public static bool IsDirty => CommitHash.EndsWith("-dirty");
|
||||
public static bool CanCheckForUpdates { get; set; }
|
||||
}
|
||||
|
|
21
ProjectLighthouse/Pages/ExternalAuth/LandingPage.cshtml
Normal file
21
ProjectLighthouse/Pages/ExternalAuth/LandingPage.cshtml
Normal file
|
@ -0,0 +1,21 @@
|
|||
@page "/"
|
||||
@using LBPUnion.ProjectLighthouse.Helpers
|
||||
@model LBPUnion.ProjectLighthouse.Controllers.ExternalAuth.LandingPage
|
||||
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Project Lighthouse External Auth</title>
|
||||
</head>
|
||||
<body>
|
||||
test
|
||||
</body>
|
||||
<footer>
|
||||
<p>Page generated by @GitVersionHelper.FullVersion</p>
|
||||
</footer>
|
||||
</html>
|
10
ProjectLighthouse/Pages/ExternalAuth/LandingPage.cshtml.cs
Normal file
10
ProjectLighthouse/Pages/ExternalAuth/LandingPage.cshtml.cs
Normal file
|
@ -0,0 +1,10 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse.Controllers.ExternalAuth
|
||||
{
|
||||
public class LandingPage : PageModel
|
||||
{
|
||||
public IActionResult OnGet() => this.Page();
|
||||
}
|
||||
}
|
|
@ -29,7 +29,7 @@ namespace LBPUnion.ProjectLighthouse
|
|||
Logger.AddLogger(new LighthouseFileLogger());
|
||||
|
||||
Logger.Log("Welcome to Project Lighthouse!", LoggerLevelStartup.Instance);
|
||||
Logger.Log($"Running {ServerStatics.ServerName} {GitVersionHelper.CommitHash}@{GitVersionHelper.Branch}", LoggerLevelStartup.Instance);
|
||||
Logger.Log($"Running {GitVersionHelper.FullVersion}", LoggerLevelStartup.Instance);
|
||||
|
||||
// This loads the config, see ServerSettings.cs for more information
|
||||
Logger.Log("Loaded config file version " + ServerSettings.Instance.ConfigVersion, LoggerLevelStartup.Instance);
|
||||
|
|
|
@ -32,6 +32,10 @@
|
|||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Controllers\ExternalAuth"/>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||
<Exec Command="git describe --long --always --dirty --exclude=\* --abbrev=8 > "$(ProjectDir)/gitVersion.txt""/>
|
||||
<Exec Command="git branch --show-current > "$(ProjectDir)/gitBranch.txt""/>
|
||||
|
|
|
@ -29,6 +29,7 @@ namespace LBPUnion.ProjectLighthouse
|
|||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddControllers();
|
||||
services.AddRazorPages().WithRazorPagesAtContentRoot();
|
||||
|
||||
services.AddMvc
|
||||
(
|
||||
|
@ -152,7 +153,8 @@ namespace LBPUnion.ProjectLighthouse
|
|||
|
||||
app.UseRouting();
|
||||
|
||||
app.UseEndpoints(endpoints => endpoints.MapControllers());
|
||||
// app.UseEndpoints(endpoints => endpoints.MapControllers());
|
||||
app.UseEndpoints(endpoints => endpoints.MapRazorPages());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue