Compare commits

...

5 Commits

  1. 22
      THIRD-PARTY-NOTICES.txt
  2. 43
      src/Microsoft.Tye.Hosting/Dashboard/Pages/Index.razor
  3. 1
      src/Microsoft.Tye.Hosting/wwwroot/img/bootstrap-icons.svg

22
THIRD-PARTY-NOTICES.txt

@ -0,0 +1,22 @@
NET Core uses third-party libraries or other resources that may be
distributed under licenses different than the .NET Core software.
In the event that we accidentally failed to list a required notice, please
bring it to our attention. Post an issue or email us:
dotnet@microsoft.com
The attached notices are provided for information only.
License notice for Bootstrap
------------------------------------
The MIT License (MIT)
Copyright (c) 2019-2020 The Bootstrap Authors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

43
src/Microsoft.Tye.Hosting/Dashboard/Pages/Index.razor

@ -6,6 +6,7 @@
<table class="table service-table">
<thead>
<tr>
<th>Status</th>
<th>Name</th>
<th>Type</th>
<th>Source</th>
@ -20,7 +21,16 @@
{
var logsPath = $"logs/{service.Description.Name}";
var servicePath = $"services/{service.Description.Name}";
var status = GetServiceStatusColor(service);
<tr @key="service.Description.Name">
<td>
@if (status != null)
{
<svg class="bi @status.Value.color" width="32" height="32" fill="currentColor">
<use href="/img/bootstrap-icons.svg#@status.Value.image" />
</svg>
}
</td>
<td>
@if(service.ServiceType == ServiceType.External)
{
@ -96,6 +106,39 @@
return $"{(b.Protocol ?? "tcp")}://{b.Host ?? "localhost"}:{b.Port}";
}
(string color, string image)? GetServiceStatusColor(Service service)
{
// Ingress services have no liveness or readiness checks
if (service.ServiceType == ServiceType.Ingress)
{
return null;
}
foreach (var replica in service.Replicas)
{
switch (replica.Value.State)
{
// Replica was recently restarted
case ReplicaState.Removed:
case ReplicaState.Added:
case ReplicaState.Started:
case ReplicaState.Stopped:
return ("text-danger", "x-circle-fill");
// Replica has passed liveness, but not readiness
case ReplicaState.Healthy:
return ("text-warning", "exclamation-circle-fill");
// Replica passed both liveness and readiness
case ReplicaState.Ready:
continue;
}
}
// All replicas have passed liveness and readiness
return ("text-success", "check-circle-fill");
}
protected override void OnInitialized()
{
foreach (var a in application.Services.Values)

1
src/Microsoft.Tye.Hosting/wwwroot/img/bootstrap-icons.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 579 KiB

Loading…
Cancel
Save