Skip to content

Commit 7db47dd

Browse files
committed
Bring over the files from the earlier version of the Web UI
1 parent bbf8800 commit 7db47dd

File tree

171 files changed

+4325
-404
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+4325
-404
lines changed

Directory.Build.props

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Project>
2+
<PropertyGroup>
3+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
4+
<TargetFramework>net10.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>true</ImplicitUsings>
7+
<InterceptorsNamespaces>
8+
$(InterceptorsNamespaces);Microsoft.AspNetCore.OpenApi.Generated
9+
</InterceptorsNamespaces>
10+
<Features>$(Features);InterceptorsPreview</Features>
11+
</PropertyGroup>
12+
13+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
14+
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
15+
<NoWarn>1701;1702;</NoWarn>
16+
</PropertyGroup>
17+
18+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
19+
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
20+
<NoWarn>1701;1702;</NoWarn>
21+
</PropertyGroup>
22+
</Project>

src/aspire/AStar.Web.ServiceDefaults/AStar.Web.ServiceDefaults.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212

1313
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="10.0.0"/>
1414
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="10.0.0"/>
15-
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.13.1"/>
16-
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.13.1"/>
17-
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.13.0"/>
18-
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.13.0"/>
19-
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.13.0"/>
15+
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.14.0" />
16+
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.14.0" />
17+
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.14.0" />
18+
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.14.0" />
19+
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.14.0" />
2020
</ItemGroup>
2121

2222
</Project>

src/modules/apis/AStar.Web.ApiService/AStar.Web.ApiService.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10+
<PackageReference Include="Asp.Versioning.Mvc" Version="8.1.0"/>
11+
<PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0"/>
1012
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.0"/>
13+
<PackageReference Include="TestableIO.System.IO.Abstractions" Version="22.0.16"/>
14+
<PackageReference Include="TestableIO.System.IO.Abstractions.Wrappers" Version="22.0.16"/>
15+
<PackageReference Include="NetEscapades.AspNetCore.SecurityHeaders" Version="1.2.0"/>
1116
</ItemGroup>
1217

1318
<ItemGroup>

src/modules/apis/AStar.Web.ApiService/Program.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
1+
using Asp.Versioning;
2+
13
var builder = WebApplication.CreateBuilder(args);
24

35
// Add service defaults & Aspire client integrations.
46
builder.AddServiceDefaults();
57

8+
_ = builder.Services.AddApiVersioning(options =>
9+
{
10+
options.DefaultApiVersion = new ApiVersion(1, 0);
11+
options.AssumeDefaultVersionWhenUnspecified = true;
12+
options.ReportApiVersions = true;
13+
})
14+
.AddApiExplorer(options =>
15+
{
16+
options.GroupNameFormat = "'v'VVV";
17+
options.SubstituteApiVersionInUrl = true;
18+
});
619
// Add services to the container.
720
builder.Services.AddProblemDetails();
821

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,43 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net10.0</TargetFramework>
5-
<ImplicitUsings>enable</ImplicitUsings>
6-
<Nullable>enable</Nullable>
4+
<Deterministic>true</Deterministic>
5+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
6+
<UserSecretsId>d7e61e34-084f-4c2b-9be8-5925170dc3b7</UserSecretsId>
77
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.4.0" />
11+
<PackageReference Include="FluentUI.Demo.Shared" Version="4.10.4" />
12+
<PackageReference Include="JetBrains.Annotations" Version="2025.2.2" />
13+
<PackageReference Include="Markdig" Version="0.43.0" />
14+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="10.0.0" />
15+
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.23.0" />
16+
<PackageReference Include="Microsoft.Extensions.Logging.ApplicationInsights" Version="2.23.0" />
17+
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="10.0.0" />
18+
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components" Version="4.13.1" />
19+
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components.Icons" Version="4.13.1" />
20+
<PackageReference Include="Microsoft.Identity.Web" Version="4.0.1" />
21+
<PackageReference Include="Microsoft.Identity.Web.UI" Version="4.0.1" />
22+
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.14.0" />
23+
<PackageReference Include="Scalar.AspNetCore" Version="2.10.3" />
24+
<PackageReference Include="TestableIO.System.IO.Abstractions.Wrappers" Version="22.0.16" />
25+
<PackageReference Include="Testably.Abstractions.FileSystem.Interface" Version="10.0.0" />
26+
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="10.0.0" />
27+
<PackageReference Include="NetEscapades.AspNetCore.SecurityHeaders" Version="1.2.0" />
28+
<PackageReference Include="AStar.Dev.Source.Generators" Version="0.2.6-alpha" />
29+
</ItemGroup>
30+
31+
<ItemGroup>
32+
<Folder Include="wwwroot\assets\" />
33+
</ItemGroup>
834

935
<ItemGroup>
1036
<ProjectReference Include="..\..\aspire\AStar.Web.ServiceDefaults\AStar.Web.ServiceDefaults.csproj"/>
1137
</ItemGroup>
1238

39+
<ItemGroup>
40+
<Using Include="JetBrains.Annotations" />
41+
</ItemGroup>
42+
1343
</Project>
Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,54 @@
1-
<!DOCTYPE html>
1+
<!DOCTYPE html>
22
<html lang="en">
33

44
<head>
55
<meta charset="utf-8"/>
66
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
77
<base href="/"/>
8-
<link rel="stylesheet" href="@Assets["lib/bootstrap/dist/css/bootstrap.min.css"]"/>
98
<link rel="stylesheet" href="@Assets["app.css"]"/>
109
<link rel="stylesheet" href="@Assets["AStar.Dev.Web.styles.css"]"/>
1110
<ImportMap/>
12-
<link rel="icon" type="image/png" href="favicon.png"/>
13-
<HeadOutlet/>
11+
<link rel="icon" type="image/x-icon" href="favicon.ico"/>
12+
<HeadOutlet @rendermode="InteractiveServer"/>
13+
<script src="_content/Microsoft.FluentUI.AspNetCore.Components/js/loading-theme.js" type="text/javascript"></script>
14+
<loading-theme storage-name="theme"></loading-theme>
15+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css">
16+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
17+
<script>
18+
window.highlightMarkdown = () => {
19+
if (window.hljs) {
20+
window.hljs.highlightAll();
21+
}
22+
};
23+
</script>
24+
<!-- Add marked (Markdown parser) and DOMPurify (sanitizer) -->
25+
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
26+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/purify.min.js"></script>
27+
<script>
28+
// md: markdown text
29+
// allowHtml: when true, bypass sanitizer (only do this if you trust the source)
30+
window.renderMarkdown = (md, allowHtml) => {
31+
const html = window.marked?.parse(md ?? "") ?? "";
32+
if (allowHtml) {
33+
return html;
34+
}
35+
// Sanitize, but allow common code/formatting tags and classes used by highlight.js
36+
const cfg = {
37+
ALLOWED_TAGS: [
38+
'pre', 'code', 'span', 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
39+
'ul', 'ol', 'li', 'a', 'strong', 'em', 'table', 'thead', 'tbody',
40+
'tr', 'th', 'td', 'blockquote', 'hr', 'br', 'img'
41+
],
42+
ALLOWED_ATTR: ['href', 'title', 'alt', 'class', 'rel', 'target', 'src']
43+
};
44+
return window.DOMPurify ? window.DOMPurify.sanitize(html, cfg) : html;
45+
};
46+
</script>
1447
</head>
1548
1649
<body>
17-
<Routes/>
18-
<script src="@Assets["_framework/blazor.web.js"]"></script>
50+
<Routes @rendermode="InteractiveServer"/>
51+
<script src="_framework/blazor.web.js"></script>
1952
</body>
2053
21-
</html>
54+
</html>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace AStar.Dev.Web.Components;
2+
3+
public partial class App
4+
{
5+
public static string PageTitle(string page) => $"{page} - AStar Development";
6+
}

src/uis/AStar.Dev.Web/Components/Layout/LoginDisplay.razor

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,35 @@
1-
@inherits LayoutComponentBase
1+
@using Microsoft.FluentUI.AspNetCore.Components.Icons.Regular
2+
@inherits LayoutComponentBase
23

3-
<div class="page">
4-
<div class="sidebar">
5-
<NavMenu/>
6-
</div>
4+
<FluentLayout>
5+
<FluentHeader>
6+
<img src="@Assets["assets/astar-logo.png"]" alt="AStar.Dev" style="height: 40px;"/>
7+
<FluentSpacer/>
8+
<FluentButton Appearance="Appearance.Stealth"
9+
IconStart="@(new Size20.Settings())"
10+
@onclick="OpenSettingsDialog"
11+
Title="Settings"/>
712

8-
<main>
9-
<div class="top-row px-4">
10-
<a href="https://learn.microsoft.com/aspnet/core/" target="_blank">About</a>
11-
</div>
13+
</FluentHeader>
14+
<FluentStack Class="main" Orientation="Orientation.Horizontal" Width="100%">
15+
<NavMenu/>
16+
<FluentBodyContent Class="body-content">
17+
<div class="content">
18+
@Body
19+
</div>
20+
</FluentBodyContent>
21+
</FluentStack>
22+
<FluentFooter>
23+
<FluentStack Orientation="Orientation.Horizontal" HorizontalAlignment="HorizontalAlignment.Center" Width="100%">
24+
Copyright ©: AStar Development, 2009 - @(DateTime.Now.Year)
25+
</FluentStack>
26+
</FluentFooter>
27+
</FluentLayout>
1228

13-
<article class="content px-4">
14-
@Body
15-
</article>
16-
</main>
17-
</div>
29+
<SettingsPanel IsOpen="_settingsPanelOpen" OnClose="CloseSettingsPanel"/>
1830

19-
<div id="blazor-error-ui">
31+
<div id="blazor-error-ui" data-nosnippet>
2032
An unhandled error has occurred.
21-
<a href="" class="reload">Reload</a>
22-
<a class="dismiss">🗙</a>
23-
</div>
33+
<a href="." class="reload">Reload</a>
34+
<span class="dismiss">🗙</span>
35+
</div>

0 commit comments

Comments
 (0)