-
Notifications
You must be signed in to change notification settings - Fork 462
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
Add details column to trace view, remove status badge and put counter badge on resource name #1788
Merged
adamint
merged 9 commits into
dotnet:main
from
adamint:dev/adamint/1081-standardize-grid-selection
Jan 25, 2024
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2956d12
add details column to trace detail
5cb939a
Update xlfs, style button
465b920
remove error badge
a729637
Put unread error counter on name
adf0537
update trace detail details column to absolute width
97fefb8
Remove unused resx strings, re-add titles for resource name
8d98532
Make error counter badge text white in dark theme
a22a8dc
fixed variable name
e4ff870
Merge branch 'main' into dev/adamint/1081-standardize-grid-selection
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
37 changes: 37 additions & 0 deletions
37
src/Aspire.Dashboard/Components/ResourcesGridColumns/ResourceNameDisplay.razor.cs
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,37 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Globalization; | ||
using Aspire.Dashboard.Model; | ||
using Aspire.Dashboard.Otlp.Storage; | ||
using Aspire.Dashboard.Resources; | ||
using Microsoft.AspNetCore.Components; | ||
|
||
namespace Aspire.Dashboard.Components; | ||
|
||
public partial class ResourceNameDisplay | ||
{ | ||
[Inject] | ||
public required TelemetryRepository TelemetryRepository { get; init; } | ||
|
||
private int GetUnviewedErrorCount(ResourceViewModel resource) | ||
{ | ||
if (UnviewedErrorCounts is null) | ||
{ | ||
return 0; | ||
} | ||
|
||
var application = TelemetryRepository.GetApplication(resource.Uid); | ||
return application is null ? 0 : UnviewedErrorCounts.GetValueOrDefault(application, 0); | ||
} | ||
|
||
private static string GetResourceErrorStructuredLogsUrl(ResourceViewModel resource) | ||
{ | ||
return $"/StructuredLogs/{resource.Uid}?level=error"; | ||
} | ||
|
||
private string FormatLogLinkTitle(int unviewedErrorCount) | ||
{ | ||
return FormatName(Resource) + Environment.NewLine + string.Format(CultureInfo.CurrentCulture, Loc[nameof(Columns.UnreadLogErrors)], unviewedErrorCount); | ||
} | ||
} |
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
17 changes: 0 additions & 17 deletions
17
src/Aspire.Dashboard/Components/ResourcesGridColumns/StateColumnDisplay.razor.cs
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
src/Aspire.Dashboard/Components/ResourcesGridColumns/StateColumnText.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,36 @@ | ||
@using Aspire.Dashboard.Model | ||
@using Aspire.Dashboard.Resources | ||
@inject IStringLocalizer<Columns> Loc | ||
|
||
@if (Resource is { State: ResourceStates.ExitedState /* containers */ or ResourceStates.FinishedState /* executables */ }) | ||
{ | ||
if (Resource.TryGetExitCode(out int exitCode) && exitCode is not 0) | ||
{ | ||
<!-- process completed unexpectedly, hence the non-zero code. this is almost certainly an error, so warn users --> | ||
<FluentIcon Title="@string.Format(Loc[Columns.StateColumnResourceExitedUnexpectedly], Resource.ResourceType, exitCode)" | ||
Icon="Icons.Filled.Size16.ErrorCircle" | ||
Color="Color.Error" | ||
Class="severity-icon"/> | ||
} | ||
else | ||
{ | ||
<!-- process completed, which may not have been unexpected --> | ||
<FluentIcon Title="@string.Format(Loc[Columns.StateColumnResourceExited], Resource.ResourceType)" | ||
Icon="Icons.Filled.Size16.Warning" | ||
Color="Color.Warning" | ||
Class="severity-icon"/> | ||
} | ||
} | ||
else | ||
{ | ||
<FluentIcon Icon="Icons.Filled.Size16.CheckmarkCircle" | ||
Color="Color.Success" | ||
Class="severity-icon"/> | ||
} | ||
|
||
@Resource.State | ||
|
||
@code { | ||
[Parameter, EditorRequired] | ||
public required ResourceViewModel Resource { get; set; } | ||
} |
19 changes: 0 additions & 19 deletions
19
src/Aspire.Dashboard/Components/ResourcesGridColumns/UnreadLogErrorsBadge.razor
This file was deleted.
Oops, something went wrong.
55 changes: 0 additions & 55 deletions
55
src/Aspire.Dashboard/Components/ResourcesGridColumns/UnreadLogErrorsBadge.razor.cs
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can imagine that having the resource's name link to its logs would be good for all resources, not just those with errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@drewnoakes do you think links appearing for all resources would be noisy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would probably be noisey. It's something to think about in the future. The PR is good as it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need to link to the logs from the resource name now that we're reinstated the "view logs" button?