From 19916dc02882c70d0897377efeb38f22680f4143 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Mon, 18 May 2020 14:07:41 -0700 Subject: [PATCH] Handle node-only views --- ui/app/styles/core/columns.scss | 9 ++ ui/app/templates/csi/plugins/index.hbs | 8 +- ui/app/templates/csi/plugins/plugin.hbs | 130 +++++++++++++----------- 3 files changed, 83 insertions(+), 64 deletions(-) diff --git a/ui/app/styles/core/columns.scss b/ui/app/styles/core/columns.scss index d68425e9a..d912a37c3 100644 --- a/ui/app/styles/core/columns.scss +++ b/ui/app/styles/core/columns.scss @@ -14,4 +14,13 @@ &.is-bottom-aligned { align-items: flex-end; } + + &.is-max-half { + max-width: 50%; + } + + &.is-centered { + margin-left: auto; + margin-right: auto; + } } diff --git a/ui/app/templates/csi/plugins/index.hbs b/ui/app/templates/csi/plugins/index.hbs index 7d4f5f1f1..2eab19291 100644 --- a/ui/app/templates/csi/plugins/index.hbs +++ b/ui/app/templates/csi/plugins/index.hbs @@ -42,8 +42,12 @@ {{#link-to "csi.plugins.plugin" row.model.plainId class="is-primary"}}{{row.model.plainId}}{{/link-to}} - {{if (gt row.model.controllersHealthy 0) "Healthy" "Unhealthy"}} - ({{row.model.controllersHealthy}}/{{row.model.controllersExpected}}) + {{#if row.model.controllerRequired}} + {{if (gt row.model.controllersHealthy 0) "Healthy" "Unhealthy"}} + ({{row.model.controllersHealthy}}/{{row.model.controllersExpected}}) + {{else}} + Node Only + {{/if}} {{if (gt row.model.nodesHealthy 0) "Healthy" "Unhealthy"}} diff --git a/ui/app/templates/csi/plugins/plugin.hbs b/ui/app/templates/csi/plugins/plugin.hbs index bcd2c8873..62b76f792 100644 --- a/ui/app/templates/csi/plugins/plugin.hbs +++ b/ui/app/templates/csi/plugins/plugin.hbs @@ -5,11 +5,13 @@
Plugin Details - - Controller Health - {{format-percentage model.controllersHealthy total=model.controllersExpected}} - ({{model.controllersHealthy}}/{{model.controllersExpected}}) - + {{#if model.controllerRequired}} + + Controller Health + {{format-percentage model.controllersHealthy total=model.controllersExpected}} + ({{model.controllersHealthy}}/{{model.controllersExpected}}) + + {{/if}} Node Health {{format-percentage model.nodesHealthy total=model.nodesExpected}} @@ -23,38 +25,40 @@
-
-
-
Controller Health
-
-
-
- {{gauge-chart - label="Availability" - value=model.controllersHealthy - total=model.controllersExpected}} -
-
-
-

Available

-

{{model.controllersHealthy}}

+ {{#if model.controllerRequired}} +
+
+
Controller Health
+
+
+
+ {{gauge-chart + label="Availability" + value=model.controllersHealthy + total=model.controllersExpected}}
-
-
-
-

Expected

-

{{model.controllersExpected}}

+
+
+

Available

+

{{model.controllersHealthy}}

+
+
+
+
+

Expected

+

{{model.controllersExpected}}

+
-
+ {{/if}}
Node Health
-
+
{{gauge-chart label="Availability" @@ -79,42 +83,44 @@
-
-
- Controller Allocations + {{#if model.controllerRequired}} +
+
+ Controller Allocations +
+
+ {{#if model.controllers}} + {{#list-table + source=sortedControllers + class="with-foot" as |t|}} + {{#t.head}} + + ID + Created + Modified + Health + Client + Job + Version + Volumes + CPU + Memory + {{/t.head}} + {{#t.body key="model.allocID" as |row|}} + {{plugin-allocation-row + data-test-controller-allocation=row.model.allocID + pluginAllocation=row.model}} + {{/t.body}} + {{/list-table}} + {{else}} +
+

No Controller Plugin Allocations

+

No allocations are providing controller plugin service.

+
+ {{/if}} +
-
- {{#if model.controllers}} - {{#list-table - source=sortedControllers - class="with-foot" as |t|}} - {{#t.head}} - - ID - Created - Modified - Health - Client - Job - Version - Volumes - CPU - Memory - {{/t.head}} - {{#t.body key="model.allocID" as |row|}} - {{plugin-allocation-row - data-test-controller-allocation=row.model.allocID - pluginAllocation=row.model}} - {{/t.body}} - {{/list-table}} - {{else}} -
-

No Controller Plugin Allocations

-

No allocations are providing controller plugin service.

-
- {{/if}} -
-
+ {{/if}}