Skip to content

Commit

Permalink
Combined Resources View (#987)
Browse files Browse the repository at this point in the history
* Combined Resources View

* Bug fixes, code review changes

* Add a couple missing tooltips
  • Loading branch information
tlmii authored Nov 22, 2023
1 parent 69937e2 commit ea05b9a
Show file tree
Hide file tree
Showing 23 changed files with 306 additions and 325 deletions.
2 changes: 1 addition & 1 deletion src/Aspire.Dashboard/Aspire.Dashboard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="Aspire.Dashboard.Tests"/>
<InternalsVisibleTo Include="Aspire.Dashboard.Tests" />
</ItemGroup>

</Project>
10 changes: 8 additions & 2 deletions src/Aspire.Dashboard/Components/Controls/GridValue.razor
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@
&#x25cf;&#x25cf;&#x25cf;&#x25cf;&#x25cf;&#x25cf;&#x25cf;&#x25cf;
</span>
}
else
else if (EnableHighlighting)
{
<span class="cellText" title="@Value">
<span class="cellText" title="@(ToolTip ?? Value)">
<FluentHighlighter HighlightedText="@HighlightText"
Text="@Value" />
</span>
}
else
{
<span class="cellText" title="@(ToolTip ?? Value)">
@(MaxDisplayLength.HasValue ? TrimLength(Value) : Value)
</span>
}
@if (EnableMasking)
{
<FluentButton Appearance="Appearance.Lightweight"
Expand Down
12 changes: 12 additions & 0 deletions src/Aspire.Dashboard/Components/Controls/GridValue.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public partial class GridValue
[Parameter]
public bool IsMasked { get; set; }

[Parameter]
public bool EnableHighlighting { get; set; } = false;

/// <summary>
/// The text to highlight within the value when the value is displayed unmasked
/// </summary>
Expand All @@ -33,6 +36,12 @@ public partial class GridValue
[Parameter]
public EventCallback<bool> IsMaskedChanged { get; set; }

[Parameter]
public int? MaxDisplayLength { get; set; }

[Parameter]
public string? ToolTip { get; set; }

private const string PreCopyText = "Copy to clipboard";
private const string PostCopyText = "Copied!";

Expand All @@ -48,4 +57,7 @@ private async Task ToggleMaskStateAsync()

private async Task CopyTextToClipboardAsync(string? text, string id)
=> await JS.InvokeVoidAsync("copyTextToClipboard", id, text, PreCopyText, PostCopyText);

private static string TrimLength(string? text)
=> text?.Length > 8 ? text.Substring(0, 8) : text ?? string.Empty;
}
6 changes: 3 additions & 3 deletions src/Aspire.Dashboard/Components/Layout/NavMenu.razor
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="nav-menu-container">
<FluentNavMenu Width="250" Collapsible="true">
<FluentNavLink Icon="@(new Icons.Regular.Size24.AppGeneric())" Href="/" Match="NavLinkMatch.All">Projects</FluentNavLink>
<FluentNavLink Icon="@(new Icons.Regular.Size24.BinFull())" Href="/Containers">Containers</FluentNavLink>
<FluentNavLink Icon="@(new Icons.Regular.Size24.AppGeneric())" Href="/Executables">Executables</FluentNavLink>
<FluentNavLink Icon="@(new Icons.Regular.Size24.AppFolder())" Href="/" Match="NavLinkMatch.All">Resources</FluentNavLink>
@* <FluentNavLink Icon="@(new Icons.Regular.Size24.BinFull())" Href="/Containers">Containers</FluentNavLink>
<FluentNavLink Icon="@(new Icons.Regular.Size24.AppGeneric())" Href="/Executables">Executables</FluentNavLink> *@
<FluentNavGroup Title="Logs" Icon="@(new Icons.Regular.Size24.SlideText())" Expanded="true" Gap="10px 0;">
<FluentNavLink Icon="@(new Icons.Regular.Size24.SlideText())" Href="/ProjectLogs">Project</FluentNavLink>
<FluentNavLink Icon="@(new Icons.Regular.Size24.SlideText())" Href="/ContainerLogs">Container</FluentNavLink>
Expand Down
97 changes: 0 additions & 97 deletions src/Aspire.Dashboard/Components/Pages/Containers.razor

This file was deleted.

102 changes: 0 additions & 102 deletions src/Aspire.Dashboard/Components/Pages/Executables.razor

This file was deleted.

19 changes: 0 additions & 19 deletions src/Aspire.Dashboard/Components/Pages/Index.razor.cs

This file was deleted.

7 changes: 0 additions & 7 deletions src/Aspire.Dashboard/Components/Pages/Index.razor.css

This file was deleted.

Loading

0 comments on commit ea05b9a

Please sign in to comment.