From 9513da80f6e88dfde21fb37dac80ec3749f31e92 Mon Sep 17 00:00:00 2001 From: doncicuto <30386061+doncicuto@users.noreply.github.com> Date: Fri, 1 Dec 2017 09:26:03 +0100 Subject: [PATCH] feat(node): add engine labels info in the swarm nodes view (#1451) --- app/components/node/node.html | 27 +++++++++++++++++++++++++++ app/models/docker/node.js | 10 +++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/app/components/node/node.html b/app/components/node/node.html index 4b9f87910..b773d7bcd 100644 --- a/app/components/node/node.html +++ b/app/components/node/node.html @@ -143,6 +143,33 @@ +
+
+ + + +

There are no engine labels for this node.

+
+ + + + + + + + + + + + + + +
LabelValue
{{ engineLabel.key }}{{ engineLabel.value }}
+
+
+
+
+
diff --git a/app/models/docker/node.js b/app/models/docker/node.js index 1362d0885..9ec201403 100644 --- a/app/models/docker/node.js +++ b/app/models/docker/node.js @@ -17,13 +17,21 @@ function NodeViewModel(data) { this.Labels = []; } + var engineLabels = data.Description.Engine.Labels; + if (engineLabels) { + this.EngineLabels = Object.keys(engineLabels).map(function(key) { + return { key: key, value: engineLabels[key] }; + }); + } else { + this.EngineLabels = []; + } + this.Hostname = data.Description.Hostname; this.PlatformArchitecture = data.Description.Platform.Architecture; this.PlatformOS = data.Description.Platform.OS; this.CPUs = data.Description.Resources.NanoCPUs; this.Memory = data.Description.Resources.MemoryBytes; this.EngineVersion = data.Description.Engine.EngineVersion; - this.EngineLabels = data.Description.Engine.Labels; this.Plugins = data.Description.Engine.Plugins; this.Status = data.Status.State;