Skip to content

Commit 32667b7

Browse files
committed
refactor(logging,desktop,ci): unify logger, complete Desktop WPF rewrite, fix CI, update .gitignore
Logger unification (Trion.Core → all projects): - Remove Success level from LogLevel; add Debug; fix ShowInfo default to true - Fix TrionLogger.MapLevel: Trace/Debug → LogLevel.Debug (was Info) - Fix Enqueue filter to check ShowDebug; fix WriteConsole colors for updated enum - Add ILoggerExtensions.LogException to bridge old call-site API to ILogger - Delete dead LoggerExtensions.cs (IServiceCollection variant, never used) - Delete Desktop ITrionLogger interface and its standalone TrionLogger impl - Add ProjectReference from Trion.Desktop to Trion.Core; bump ME.* to 9.0.9 - Migrate App.xaml.cs to ConfigureLogging + AddTrionLogger + ILogger<App> - Migrate MySqlSetupService to ILogger<MySqlSetupService> - Migrate ServerControlViewModel to ILogger<ServerControlViewModel> Desktop WPF application (Trion.Desktop) — full rewrite with MVVM + DI: Views/Pages: - MainWindow: custom chrome, navigation shell, tray integration, accent sync - LoginWindow: username/password, remember-me, continue-offline, version footer - DashboardView: live CPU/RAM/disk metrics, server status cards, notification feed - ServerControlView: start/stop Database/World/Logon servers with crash detection and configurable auto-restart (up to 5 attempts per server) - InstallerView: per-expansion emulator download and install progress tracking - DatabaseEditorView: MySQL database query and management UI - DdnsView: DDNS provider configuration and manual/auto update controls - LogsView: live log viewer with level filtering - SettingsView: theme, language, paths, MySQL, server, network settings - SinglePlayerView: single-player/LAN server configuration - SupportersView: supporter tier list fetched from API - TrayMenuWindow: system-tray popup with quick server controls Services: - MySqlSetupService: portable MySQL 8 download (Trion API + CDN fallback), hardware-tuned my.ini generation (40% RAM for InnoDB buffer pool), data directory init, phoenix user setup, start/stop/repair/reinstall, crash detection + auto-restart with configurable max restarts - SystemMetricsService: hosted service polling CPU/RAM/disk every second - ThemeService: dark/light theme switching with per-accent-color event - LocalizationService: runtime language switching via Strings.*.json files - NavigationService: MVVM page navigation with history - NotificationService: in-app notification queue with timestamps - ApiKeyService: guest/supporter API key lifecycle (register, cache, refresh) - AccountService: login, session token storage, remember-me, guest mode - NewsService + SupportersService: HTTP fetch with retry from Trion API - EmulatorInstallerService: per-expansion download, extract, and version tracking - DdnsUpdateService: background DDNS polling against multiple provider URLs - DatabaseService: MySQL query execution with connection pooling - TrayService: Windows system tray icon with dynamic accent color and context menu ViewModels (CommunityToolkit.Mvvm, full MVVM): - MainWindowViewModel: navigation state, page switching, tray sync - DashboardViewModel: metrics binding, MySQL banner, event log, notification feed - ServerControlViewModel: Database/World/Logon toggle commands, CanExecute guards, per-server crash monitor loop, Start All / Stop All, 3-second poll timer - InstallerViewModel: expansion card grid, download progress, install state machine - LoginViewModel: async login command, IsBusy spinner, error message binding - SettingsViewModel: two-way settings binding, save-on-navigate - DdnsViewModel, DatabaseEditorViewModel, LogsViewModel, SupportersViewModel, SinglePlayerViewModel, EmulatorCardViewModel Controls: - MetricBar: custom bar control with animated fill and label - ServerStatusCard: status indicator card bound to running/stopped state - SparklineChart: lightweight Canvas-based sparkline for metric history Infrastructure: - Converters: BoolToVisibility, InverseBool, NullToVisibility, EnumToVisibility, InverseBoolToVisibility, BoolToString, ResourceKey, StatusToColor - ServiceCollectionExtensions: RegisterViewModels, RegisterViews, RegisterTrayService - PasswordBoxHelper: attached property for MVVM-safe password binding - Constants: ApiEndpoints, AppLinks, DbQueries, DdnsProviderUrls, ExternalLinks (MySQL CDN/version), MySqlInitSql (first-run SQL script) Updater (Trion.Updater): - Minimal WPF window: progress bar with glow, phase label, status text, version footer - Logo tinted with #00D4FF accent via OpacityMask (matches main app style) - WindowStyle=None with drop-shadow border, no resize, center-screen Assets — Trion logo embedded in WPF projects: - Add res/icons/trion-logo/TrionLogoNew.png + TrionLogoNew250.png to repo - Link PNGs as <Resource> items in Trion.Desktop.csproj and Trion.Updater.csproj - Use OpacityMask Rectangle in MainWindow, LoginWindow, UpdaterWindow - Fixes XamlParseException thrown at startup by missing pack:// URI resource CI — split Windows / Linux jobs: - build-windows: full solution restore + build + test; publishes Trion.Desktop (WPF / net9.0-windows only) and Trion.Web; uploads Desktop + Web artifacts - build-linux: explicit per-csproj restore + build for cross-platform projects only (Core/API/Agent/Platform/UI/Web + test projects); excludes Trion.Desktop and Trion.Updater (WPF / net9.0-windows TFM); uploads Web artifact - Both jobs install aspire + wasm-tools workloads and upload coverage to Codecov .gitignore improvements: - Remove duplicates (*.pdb, *.DotSettings each listed twice) - Add *.trx, coverage*.xml, *.cobertura.xml (test/coverage output) - Add Logs/, database/, my.ini (runtime artifacts created by the app) - Add .env, secrets.json, appsettings.Local.json (secrets/local config) - Add *.pubxml.user, wwwroot/dist/, .claude/, desktop.ini - Remove irrelevant patterns for a .NET project (*.class, *.seed, *.pid)
1 parent 66098c6 commit 32667b7

170 files changed

Lines changed: 19046 additions & 98 deletions

File tree

Some content is hidden

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

.github/workflows/dotnet.yml

Lines changed: 91 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,16 @@ on:
77
branches: [ main, dev ]
88

99
jobs:
10-
build:
11-
runs-on: ${{ matrix.os }}
12-
strategy:
13-
matrix:
14-
os: [ubuntu-latest, windows-latest]
10+
# ── Windows: full solution including WPF Desktop + Updater ──────────────────
11+
build-windows:
12+
name: Build & Test (Windows)
13+
runs-on: windows-latest
1514

1615
steps:
1716
- name: Checkout
1817
uses: actions/checkout@v4
1918

20-
- name: Setup .NET 9
19+
- name: Setup .NET 9
2120
uses: actions/setup-dotnet@v4
2221
with:
2322
dotnet-version: 9.0.x
@@ -26,33 +25,110 @@ jobs:
2625
run: dotnet workload install aspire wasm-tools
2726

2827
- name: Restore
29-
run: dotnet restore
28+
run: dotnet restore src/Trion.sln
3029

3130
- name: Build
32-
run: dotnet build -c Release --no-restore --warnaserror
31+
run: dotnet build src/Trion.sln -c Release --no-restore
3332

3433
- name: Test
35-
run: dotnet test -c Release --no-build --logger trx --collect:"XPlat Code Coverage"
34+
run: dotnet test src/Trion.sln -c Release --no-build --logger trx --collect:"XPlat Code Coverage"
3635

37-
- name: Publish web (portable)
36+
- name: Publish Desktop (Windows only)
37+
run: dotnet publish src/Trion.Desktop/Trion.Desktop.csproj -c Release -o artifacts/desktop
38+
39+
- name: Publish Web
40+
run: dotnet publish src/Trion.Web/Trion.Web.csproj -c Release -o artifacts/web
41+
42+
- name: Upload test results
43+
if: always()
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: test-results-windows
47+
path: '**/*.trx'
48+
49+
- name: Upload coverage
50+
uses: codecov/codecov-action@v4
51+
with:
52+
token: ${{ secrets.CODECOV_TOKEN }}
53+
files: '**/coverage.cobertura.xml'
54+
55+
- name: Upload Desktop artifact
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: Trion-Desktop-windows
59+
path: artifacts/desktop
60+
61+
- name: Upload Web artifact (Windows)
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: Trion-Web-windows
65+
path: artifacts/web
66+
67+
# ── Linux: cross-platform projects only — no WPF / Windows TFM ──────────────
68+
build-linux:
69+
name: Build & Test (Linux)
70+
runs-on: ubuntu-latest
71+
72+
steps:
73+
- name: Checkout
74+
uses: actions/checkout@v4
75+
76+
- name: Setup .NET 9
77+
uses: actions/setup-dotnet@v4
78+
with:
79+
dotnet-version: 9.0.x
80+
81+
- name: Install .NET workloads
82+
run: dotnet workload install aspire wasm-tools
83+
84+
- name: Restore (cross-platform)
85+
run: |
86+
dotnet restore src/Trion.Core/Trion.Core.csproj
87+
dotnet restore src/Trion.API/Trion.API.csproj
88+
dotnet restore src/Trion.Agent/Trion.Agent.csproj
89+
dotnet restore src/Trion.Platform/Trion.Platform.csproj
90+
dotnet restore src/Trion.UI/Trion.UI.csproj
91+
dotnet restore src/Trion.Web/Trion.Web.csproj
92+
dotnet restore tests/Trion.Core.Tests/Trion.Core.Tests.csproj
93+
dotnet restore tests/Trion.Agent.Tests/Trion.Agent.Tests.csproj
94+
dotnet restore tests/Trion.Platform.Tests/Trion.Platform.Tests.csproj
95+
96+
- name: Build (cross-platform)
97+
run: |
98+
dotnet build src/Trion.Core/Trion.Core.csproj -c Release --no-restore
99+
dotnet build src/Trion.API/Trion.API.csproj -c Release --no-restore
100+
dotnet build src/Trion.Agent/Trion.Agent.csproj -c Release --no-restore
101+
dotnet build src/Trion.Platform/Trion.Platform.csproj -c Release --no-restore
102+
dotnet build src/Trion.UI/Trion.UI.csproj -c Release --no-restore
103+
dotnet build src/Trion.Web/Trion.Web.csproj -c Release --no-restore
104+
dotnet build tests/Trion.Core.Tests/Trion.Core.Tests.csproj -c Release --no-restore
105+
dotnet build tests/Trion.Agent.Tests/Trion.Agent.Tests.csproj -c Release --no-restore
106+
dotnet build tests/Trion.Platform.Tests/Trion.Platform.Tests.csproj -c Release --no-restore
107+
108+
- name: Test (cross-platform)
109+
run: |
110+
dotnet test tests/Trion.Core.Tests/Trion.Core.Tests.csproj -c Release --no-build --logger trx --collect:"XPlat Code Coverage"
111+
dotnet test tests/Trion.Agent.Tests/Trion.Agent.Tests.csproj -c Release --no-build --logger trx --collect:"XPlat Code Coverage"
112+
dotnet test tests/Trion.Platform.Tests/Trion.Platform.Tests.csproj -c Release --no-build --logger trx --collect:"XPlat Code Coverage"
113+
114+
- name: Publish Web
38115
run: dotnet publish src/Trion.Web/Trion.Web.csproj -c Release -o artifacts/web
39116

40117
- name: Upload test results
41118
if: always()
42119
uses: actions/upload-artifact@v4
43120
with:
44-
name: test-results-${{ matrix.os }}
121+
name: test-results-linux
45122
path: '**/*.trx'
46123

47124
- name: Upload coverage
48-
if: matrix.os == 'ubuntu-latest'
49125
uses: codecov/codecov-action@v4
50126
with:
51127
token: ${{ secrets.CODECOV_TOKEN }}
52128
files: '**/coverage.cobertura.xml'
53129

54-
- name: Upload build artifacts
130+
- name: Upload Web artifact (Linux)
55131
uses: actions/upload-artifact@v4
56132
with:
57-
name: Trion-Build-${{ matrix.os }}
58-
path: artifacts/
133+
name: Trion-Web-linux
134+
path: artifacts/web

.gitignore

Lines changed: 77 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,23 @@
22
# Visual Studio / JetBrains Rider
33
# ================================
44

5-
## Visual Studio
65
.vs/
6+
.idea/
77
*.user
88
*.suo
99
*.userosscache
1010
*.sln.docstates
11-
*.pdb
12-
*.opendb
13-
*.VC.db
14-
*.VC.VC.opendb
15-
TestResults/
16-
_ReSharper*/
17-
*.DotSettings.user
18-
*.DotSettings
19-
*.ide
20-
21-
## Rider
22-
.idea/
2311
*.sln.iml
2412
*.ipr
2513
*.iws
2614
*.DotSettings
15+
*.DotSettings.user
16+
*.opendb
17+
*.VC.db
18+
*.VC.VC.opendb
19+
*.ide
2720

28-
## VS Code
21+
# VS Code
2922
.vscode/
3023
.history/
3124
*.code-workspace
@@ -42,31 +35,35 @@ x64/
4235
x86/
4336
publish/
4437
artifacts/
38+
39+
# Compiled outputs
4540
*.dll
4641
*.exe
4742
*.app
4843
*.so
4944
*.dylib
5045
*.pdb
5146

47+
# Publish profiles (user-local overrides only — keep *.pubxml)
48+
*.pubxml.user
49+
50+
# Blazor WASM compiled output
51+
wwwroot/dist/
52+
5253
# ================================
53-
# Temporary Files
54+
# Test Results & Coverage
5455
# ================================
5556

56-
*.log
57-
*.tmp
58-
*.temp
59-
*.cache
60-
*.bak
61-
*.swp
62-
*.swo
63-
*.DS_Store
64-
*.Thumbs.db
65-
*.idea
66-
*.class
57+
TestResults/
58+
*.trx
59+
*.coverage
60+
coverage*.xml
61+
coverage*.json
62+
*.cobertura.xml
63+
*.opencover.xml
6764

6865
# ================================
69-
# Packages
66+
# NuGet / Node Packages
7067
# ================================
7168

7269
*.nupkg
@@ -78,7 +75,30 @@ node_modules/
7875
bower_components/
7976

8077
# ================================
81-
# SQLite / Database / Local Data
78+
# Runtime Artifacts (app-generated)
79+
# ================================
80+
81+
# TrionLogger output
82+
Logs/
83+
logs/
84+
85+
# MySQL portable install + config (created by MySqlSetupService at runtime)
86+
database/
87+
my.ini
88+
89+
# ================================
90+
# Secrets & Local Config
91+
# ================================
92+
93+
.env
94+
.env.*
95+
*.env
96+
secrets.json
97+
appsettings.Local.json
98+
appsettings.*.local.json
99+
100+
# ================================
101+
# SQLite / Database
82102
# ================================
83103

84104
*.db
@@ -87,18 +107,43 @@ bower_components/
87107
settings.db
88108

89109
# ================================
90-
# Misc
110+
# Temporary Files
111+
# ================================
112+
113+
*.tmp
114+
*.temp
115+
*.cache
116+
*.bak
117+
*.swp
118+
*.swo
119+
*.log
120+
121+
# OS artefacts
122+
.DS_Store
123+
Thumbs.db
124+
desktop.ini
125+
126+
# ================================
127+
# Archive Files
91128
# ================================
92129

93-
*.pid
94-
*.seed
95130
*.tar.gz
96131
*.zip
97132
*.7z
98133
*.rar
134+
135+
# ================================
136+
# Claude Code
137+
# ================================
138+
139+
.claude/
140+
141+
# ================================
142+
# Project-specific scratch files
143+
# ================================
144+
99145
architecture.md
100146
issues_with_milestones.csv
101147
milestones_with_description.csv
102148
newplan.md
103149
plan.md
104-
.claude/settings.local.json

Trion.sln

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trion.Agent", "src\Trion.Ag
2121
EndProject
2222
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trion.Platform", "src\Trion.Platform\Trion.Platform.csproj", "{B2C3D4E5-F6A7-8901-BCDE-F12345678901}"
2323
EndProject
24+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trion.Desktop", "src\Trion.Desktop\Trion.Desktop.csproj", "{E5F6A7B8-C9D0-1234-EF01-345678901234}"
25+
EndProject
2426
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trion.Agent.Tests", "tests\Trion.Agent.Tests\Trion.Agent.Tests.csproj", "{C3D4E5F6-A7B8-9012-CDEF-123456789012}"
2527
EndProject
2628
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trion.Platform.Tests", "tests\Trion.Platform.Tests\Trion.Platform.Tests.csproj", "{D4E5F6A7-B8C9-0123-DEF0-234567890123}"
@@ -119,6 +121,18 @@ Global
119121
{B2C3D4E5-F6A7-8901-BCDE-F12345678901}.Release|x64.Build.0 = Release|Any CPU
120122
{B2C3D4E5-F6A7-8901-BCDE-F12345678901}.Release|x86.ActiveCfg = Release|Any CPU
121123
{B2C3D4E5-F6A7-8901-BCDE-F12345678901}.Release|x86.Build.0 = Release|Any CPU
124+
{E5F6A7B8-C9D0-1234-EF01-345678901234}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
125+
{E5F6A7B8-C9D0-1234-EF01-345678901234}.Debug|Any CPU.Build.0 = Debug|Any CPU
126+
{E5F6A7B8-C9D0-1234-EF01-345678901234}.Debug|x64.ActiveCfg = Debug|Any CPU
127+
{E5F6A7B8-C9D0-1234-EF01-345678901234}.Debug|x64.Build.0 = Debug|Any CPU
128+
{E5F6A7B8-C9D0-1234-EF01-345678901234}.Debug|x86.ActiveCfg = Debug|Any CPU
129+
{E5F6A7B8-C9D0-1234-EF01-345678901234}.Debug|x86.Build.0 = Debug|Any CPU
130+
{E5F6A7B8-C9D0-1234-EF01-345678901234}.Release|Any CPU.ActiveCfg = Release|Any CPU
131+
{E5F6A7B8-C9D0-1234-EF01-345678901234}.Release|Any CPU.Build.0 = Release|Any CPU
132+
{E5F6A7B8-C9D0-1234-EF01-345678901234}.Release|x64.ActiveCfg = Release|Any CPU
133+
{E5F6A7B8-C9D0-1234-EF01-345678901234}.Release|x64.Build.0 = Release|Any CPU
134+
{E5F6A7B8-C9D0-1234-EF01-345678901234}.Release|x86.ActiveCfg = Release|Any CPU
135+
{E5F6A7B8-C9D0-1234-EF01-345678901234}.Release|x86.Build.0 = Release|Any CPU
122136
{C3D4E5F6-A7B8-9012-CDEF-123456789012}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
123137
{C3D4E5F6-A7B8-9012-CDEF-123456789012}.Debug|Any CPU.Build.0 = Debug|Any CPU
124138
{C3D4E5F6-A7B8-9012-CDEF-123456789012}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -155,6 +169,7 @@ Global
155169
{C99FA784-527A-433A-8892-71A951DF63CE} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
156170
{A1B2C3D4-E5F6-7890-ABCD-EF1234567890} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
157171
{B2C3D4E5-F6A7-8901-BCDE-F12345678901} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
172+
{E5F6A7B8-C9D0-1234-EF01-345678901234} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
158173
{C3D4E5F6-A7B8-9012-CDEF-123456789012} = {0AB3BF05-4346-4AA6-1389-037BE0695223}
159174
{D4E5F6A7-B8C9-0123-DEF0-234567890123} = {0AB3BF05-4346-4AA6-1389-037BE0695223}
160175
EndGlobalSection

0 commit comments

Comments
 (0)