-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display new error logs count to projects page (#545)
- Loading branch information
Showing
21 changed files
with
538 additions
and
60 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
src/Aspire.Dashboard/Components/Controls/UnreadLogErrorsBadge.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@namespace Aspire.Dashboard.Components | ||
|
||
@if (UnviewedCount > 0) | ||
{ | ||
<div @onclick="OnClick" class="resource-error-badge"> | ||
<FluentBadge title="@($"{UnviewedCount} error logs")" Appearance="Appearance.Accent" Circular="true" Fill="error" slot="end"> | ||
@((UnviewedCount > 9) ? "9+" : UnviewedCount.ToString()) | ||
</FluentBadge> | ||
</div> | ||
} | ||
|
||
@code { | ||
[Parameter] | ||
public EventCallback<MouseEventArgs> OnClick { get; set; } | ||
|
||
[Parameter] | ||
public int UnviewedCount { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using Aspire.Dashboard.Model; | ||
using Microsoft.Fast.Components.FluentUI; | ||
|
||
namespace Aspire.Dashboard.Components.Pages; | ||
|
||
public partial class Index : ResourcesListBase<ProjectViewModel> | ||
{ | ||
protected override ValueTask<List<ProjectViewModel>> GetResources(IDashboardViewModelService dashboardViewModelService) | ||
=> dashboardViewModelService.GetProjectsAsync(); | ||
|
||
protected override IAsyncEnumerable<ResourceChanged<ProjectViewModel>> WatchResources( | ||
IDashboardViewModelService dashboardViewModelService, | ||
IEnumerable<NamespacedName> initialList, | ||
CancellationToken cancellationToken) | ||
=> dashboardViewModelService.WatchProjectsAsync(initialList, cancellationToken); | ||
|
||
protected override bool Filter(ProjectViewModel resource) | ||
=> resource.Name.Contains(filter, StringComparison.CurrentCultureIgnoreCase) | ||
|| resource.ProjectPath.Contains(filter, StringComparison.CurrentCultureIgnoreCase); | ||
|
||
private readonly GridSort<ProjectViewModel> _projectPathSort = GridSort<ProjectViewModel>.ByAscending(p => p.ProjectPath); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.