diff --git a/.github/workflows/deploy-web.yml b/.github/workflows/deploy-web.yml index 412d720..bbaed60 100644 --- a/.github/workflows/deploy-web.yml +++ b/.github/workflows/deploy-web.yml @@ -6,6 +6,7 @@ on: paths: - 'src/PlanViewer.Core/**' - 'src/PlanViewer.Web/**' + - 'src/PlanViewer.App/PlanViewer.App.csproj' - '.github/workflows/deploy-web.yml' workflow_dispatch: @@ -36,6 +37,17 @@ jobs: - name: Install WASM workload run: dotnet workload install wasm-tools + - name: Sync web version with app version + shell: pwsh + run: | + $appVersion = ([xml](Get-Content src/PlanViewer.App/PlanViewer.App.csproj)).Project.PropertyGroup.Version | Where-Object { $_ } + Write-Host "App version: $appVersion" + $webCsproj = 'src/PlanViewer.Web/PlanViewer.Web.csproj' + $content = Get-Content $webCsproj -Raw + $content = [regex]::Replace($content, '[^<]+', "$appVersion") + Set-Content -Path $webCsproj -Value $content -NoNewline + Write-Host "Synced web csproj to $appVersion" + - name: Publish Blazor WASM run: dotnet publish src/PlanViewer.Web/PlanViewer.Web.csproj -c Release -o publish diff --git a/src/PlanViewer.App/PlanViewer.App.csproj b/src/PlanViewer.App/PlanViewer.App.csproj index 5334a5c..d3bb39f 100644 --- a/src/PlanViewer.App/PlanViewer.App.csproj +++ b/src/PlanViewer.App/PlanViewer.App.csproj @@ -6,7 +6,7 @@ app.manifest EDD.ico true - 1.7.2 + 1.7.3 Erik Darling Darling Data LLC Performance Studio diff --git a/src/PlanViewer.Web/Pages/Index.razor b/src/PlanViewer.Web/Pages/Index.razor index 3fd618b..eabbcc2 100644 --- a/src/PlanViewer.Web/Pages/Index.razor +++ b/src/PlanViewer.Web/Pages/Index.razor @@ -7,7 +7,7 @@

Free SQL Server Query Plan Analysis

Paste or upload a .sqlplan file. Your plan XML never leaves your browser.

-

Powered by the same analysis engine in the Performance Studio app.

+

Powered by the same analysis engine in the Performance Studio app. @AppVersion

@if (errorMessage != null) { @@ -57,6 +57,7 @@ else { @result.SqlServerBuild } + @AppVersion @if (shareUrl != null) { @shareUrl @@ -1664,6 +1665,13 @@ else @code { private const string ShareApiBase = "https://stats.erikdarling.com"; + private static readonly string AppVersion = GetAppVersion(); + private static string GetAppVersion() + { + var v = typeof(Index).Assembly.GetName().Version; + return v == null ? "?" : $"v{v.Major}.{v.Minor}.{v.Build}"; + } + private string activeTab = "paste"; private string planXml = ""; private string? errorMessage; diff --git a/src/PlanViewer.Web/PlanViewer.Web.csproj b/src/PlanViewer.Web/PlanViewer.Web.csproj index 1c136af..7d83410 100644 --- a/src/PlanViewer.Web/PlanViewer.Web.csproj +++ b/src/PlanViewer.Web/PlanViewer.Web.csproj @@ -5,7 +5,7 @@ enable enable PlanViewer.Web - 1.4.0 + 1.7.3 Erik Darling Darling Data LLC SQL Performance Studio diff --git a/src/PlanViewer.Web/wwwroot/css/app.css b/src/PlanViewer.Web/wwwroot/css/app.css index 542cb5a..bad44a6 100644 --- a/src/PlanViewer.Web/wwwroot/css/app.css +++ b/src/PlanViewer.Web/wwwroot/css/app.css @@ -451,6 +451,23 @@ textarea::placeholder { color: var(--text-muted); } +.toolbar-app-version { + font-size: 0.75rem; + font-weight: 600; + color: var(--text-muted); + padding: 0.1rem 0.4rem; + border-radius: 3px; + background: rgba(0, 0, 0, 0.05); + margin-left: auto; +} + +.app-version { + font-size: 0.8rem; + font-weight: 600; + color: var(--text-muted); + margin-left: 0.25rem; +} + /* === Statement Tabs === */ .statement-tabs { display: flex;