Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings Dialog ->Settings Panel #791

Merged
merged 7 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/Aspire.Dashboard/Components/Dialogs/SettingsDialog.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
@inject IJSRuntime JS
@implements IDialogContentComponent

<FluentRadioGroup TValue="string" Label="Theme" Value="@_currentSetting" ValueChanged="SettingChangedAsync" Orientation="Orientation.Vertical">
<FluentRadio Value="@ThemeSettingSystem">System</FluentRadio>
<FluentRadio Value="@ThemeSettingLight">Light</FluentRadio>
<FluentRadio Value="@ThemeSettingDark">Dark</FluentRadio>
</FluentRadioGroup>
<FluentStack Orientation="Orientation.Vertical" Style="display: contents">
<FluentRadioGroup TValue="string" Label="Theme" Value="@_currentSetting" ValueChanged="SettingChangedAsync" Orientation="Orientation.Vertical">
<FluentRadio Value="@ThemeSettingSystem">System</FluentRadio>
<FluentRadio Value="@ThemeSettingLight">Light</FluentRadio>
<FluentRadio Value="@ThemeSettingDark">Dark</FluentRadio>
</FluentRadioGroup>
<div style="height: 100%;"></div>
vnbaaij marked this conversation as resolved.
Show resolved Hide resolved
<div class="version">Version: @s_version</div>
</FluentStack>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Reflection;
using Microsoft.FluentUI.AspNetCore.Components;
using Microsoft.JSInterop;

Expand All @@ -15,6 +16,7 @@ public partial class SettingsDialog : IDialogContentComponent, IAsyncDisposable
private const string ThemeSettingLight = "Light";

private string _currentSetting = ThemeSettingSystem;
private static readonly string? s_version = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyFileVersionAttribute>()?.Version;

private IJSObjectReference? _jsModule;

Expand Down
3 changes: 2 additions & 1 deletion src/Aspire.Dashboard/Components/Layout/MainLayout.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ public async Task LaunchSettings()
SecondaryAction = null,
TrapFocus = true,
Modal = true,
Alignment = HorizontalAlignment.Right,
Width = "300px",
Height = "auto"
};

_ = await dialogService.ShowDialogAsync<SettingsDialog>(parameters).ConfigureAwait(true);
_ = await dialogService.ShowPanelAsync<SettingsDialog>(parameters).ConfigureAwait(true);
}
}
5 changes: 5 additions & 0 deletions src/Aspire.Dashboard/wwwroot/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,8 @@ fluent-data-grid-cell .long-inner-content {
grid-template-rows: 1fr;
gap: calc(var(--design-unit) * 2px);
}

.version {
text-align: end;
font-size: small;
}