-
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.
Add details column to trace view, remove status badge and put counter…
… badge on resource name (#1788) * add details column to trace detail * Update xlfs, style button * remove error badge * Put unread error counter on name * update trace detail details column to absolute width * Remove unused resx strings, re-add titles for resource name * Make error counter badge text white in dark theme * fixed variable name --------- Co-authored-by: Adam Ratzman <[email protected]>
- Loading branch information
Showing
74 changed files
with
294 additions
and
434 deletions.
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.