-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b3ebdc9
commit de72667
Showing
8 changed files
with
186 additions
and
27 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,85 @@ | ||
@using System.Text.Json | ||
@using MudBlazor | ||
@using LiveHealthChecks.UI.Models | ||
|
||
@if (HealthCheck != null) | ||
{ | ||
<div style="min-width: 300px; min-height:300px;"> | ||
<div class="row"> | ||
<div class="col-10"> | ||
<b>Received Time</b> | ||
</div> | ||
<div class="col-2"> | ||
<b>Status</b> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-10"> | ||
@($"{HealthCheck?.ReceiveTimeStamp?.ToLocalTime().ToLongDateString()} - {HealthCheck?.ReceiveTimeStamp?.ToLocalTime().ToLongTimeString()}") | ||
</div> | ||
<div class="col-2"> | ||
@if(HealthCheck?.Status == HealthStatus.Healthy) | ||
{ | ||
<MudIcon Icon="@Icons.Material.Filled.Square" Style="font-size: 1.5rem; background-color: green; color: green;" /> | ||
} | ||
else | ||
{ | ||
<MudIcon Icon="@Icons.Material.Filled.Square" Style="font-size: 1.5rem; background-color: red; color: red;" /> | ||
} | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-10"> | ||
<b>Api</b> | ||
</div> | ||
<div class="col-2"> | ||
<br/> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-10"> | ||
@HealthCheck?.Api | ||
</div> | ||
<div class="col-2"> | ||
<br/> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-12"> | ||
<b>Health Report</b> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-12"> | ||
@if(@HealthCheck?.Report != null) | ||
{ | ||
<pre>@JsonPrettify(HealthCheck?.Report)</pre> | ||
} | ||
</div> | ||
</div> | ||
</div> | ||
} | ||
|
||
@code { | ||
[Parameter] | ||
public HealthCheck? HealthCheck { get; set; } | ||
|
||
private string JsonPrettify(HealthReport healthReport) | ||
{ | ||
if (healthReport == null) | ||
{ | ||
return string.Empty; | ||
} | ||
|
||
var transformedHealthReport = new TransformedHealthReport | ||
{ | ||
Status = healthReport.Status.ToString(), | ||
Results = healthReport.Entries?.ToDictionary(x => x.Key, y => y.Value.ToString()) | ||
}; | ||
|
||
var transformedJson = JsonSerializer.Serialize<TransformedHealthReport>(transformedHealthReport, | ||
new JsonSerializerOptions { WriteIndented = true }); | ||
|
||
return transformedJson; | ||
} | ||
} |
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,22 @@ | ||
@using MudBlazor | ||
@using LiveHealthChecks.UI.Models | ||
|
||
<MudDialog> | ||
<DialogContent> | ||
@if (HealthCheck != null) | ||
{ | ||
<div style="min-width: 300px; min-height:300px;"> | ||
<View | ||
HealthCheck="HealthCheck" | ||
></View> | ||
</div> | ||
} | ||
</DialogContent> | ||
<DialogActions> | ||
</DialogActions> | ||
</MudDialog> | ||
|
||
@code { | ||
[CascadingParameter] MudDialogInstance MudDialog { get; set; } | ||
[Parameter] public HealthCheck? HealthCheck { 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