From 6e9a1c7677b389744d119eac9e60457fd6eb641a Mon Sep 17 00:00:00 2001 From: FiniteReality Date: Sat, 3 Oct 2020 21:24:31 +0100 Subject: [PATCH] Use bootstrap icons for status indicator instead --- .../Dashboard/Pages/Index.razor | 21 +++++++++++++------ .../wwwroot/img/bootstrap-icons.svg | 1 + 2 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 src/Microsoft.Tye.Hosting/wwwroot/img/bootstrap-icons.svg diff --git a/src/Microsoft.Tye.Hosting/Dashboard/Pages/Index.razor b/src/Microsoft.Tye.Hosting/Dashboard/Pages/Index.razor index ff1a750b..b827baa7 100644 --- a/src/Microsoft.Tye.Hosting/Dashboard/Pages/Index.razor +++ b/src/Microsoft.Tye.Hosting/Dashboard/Pages/Index.razor @@ -6,6 +6,7 @@ + @@ -21,7 +22,15 @@ var logsPath = $"logs/{service.Description.Name}"; var servicePath = $"services/{service.Description.Name}"; var status = GetServiceStatusColor(service); - + +
Status Name Type Source
+ @if (status != null) + { + + + + } + @if(service.ServiceType == ServiceType.External) { @@ -97,12 +106,12 @@ return $"{(b.Protocol ?? "tcp")}://{b.Host ?? "localhost"}:{b.Port}"; } - string GetServiceStatusColor(Service service) + (string color, string image)? GetServiceStatusColor(Service service) { // Ingress services have no liveness or readiness checks if (service.ServiceType == ServiceType.Ingress) { - return String.Empty; + return null; } foreach (var replica in service.Replicas) @@ -114,11 +123,11 @@ case ReplicaState.Added: case ReplicaState.Started: case ReplicaState.Stopped: - return "table-danger"; + return ("text-danger", "x-circle-fill"); // Replica has passed liveness, but not readiness case ReplicaState.Healthy: - return "table-warning"; + return ("text-warning", "exclamation-circle-fill"); // Replica passed both liveness and readiness case ReplicaState.Ready: @@ -127,7 +136,7 @@ } // All replicas have passed liveness and readiness - return "table-success"; + return ("text-success", "check-circle-fill"); } protected override void OnInitialized() diff --git a/src/Microsoft.Tye.Hosting/wwwroot/img/bootstrap-icons.svg b/src/Microsoft.Tye.Hosting/wwwroot/img/bootstrap-icons.svg new file mode 100644 index 00000000..f7731a14 --- /dev/null +++ b/src/Microsoft.Tye.Hosting/wwwroot/img/bootstrap-icons.svg @@ -0,0 +1 @@ + \ No newline at end of file