ID
Name
State
- Address |
+ Address |
Datacenter
+ Version
# Volumes |
# Allocs |
diff --git a/ui/app/templates/components/client-node-row.hbs b/ui/app/templates/components/client-node-row.hbs
index 3e6435af3..1f341b0ac 100644
--- a/ui/app/templates/components/client-node-row.hbs
+++ b/ui/app/templates/components/client-node-row.hbs
@@ -12,8 +12,9 @@
{{this.node.compositeStatus}}
-{{this.node.httpAddr}} |
+{{this.node.httpAddr}} |
{{this.node.datacenter}} |
+{{this.node.version}} |
{{if this.node.hostVolumes.length this.node.hostVolumes.length}} |
{{#if this.node.allocations.isPending}}
diff --git a/ui/app/templates/components/server-agent-row.hbs b/ui/app/templates/components/server-agent-row.hbs
index ea1353f07..5c16fc315 100644
--- a/ui/app/templates/components/server-agent-row.hbs
+++ b/ui/app/templates/components/server-agent-row.hbs
@@ -1,6 +1,7 @@
| {{this.agent.name}} |
{{this.agent.status}} |
{{if this.agent.isLeader "True" "False"}} |
-{{this.agent.address}} |
+{{this.agent.address}} |
{{this.agent.serfPort}} |
{{this.agent.datacenter}} |
+{{this.agent.version}} |
diff --git a/ui/app/templates/servers/index.hbs b/ui/app/templates/servers/index.hbs
index 8173b9100..1daed7b45 100644
--- a/ui/app/templates/servers/index.hbs
+++ b/ui/app/templates/servers/index.hbs
@@ -16,9 +16,10 @@
Name
Status
Leader
- Address
+ Address
port
Datacenter
+ Version
diff --git a/ui/mirage/factories/agent.js b/ui/mirage/factories/agent.js
index cf985d95b..47f96df6c 100644
--- a/ui/mirage/factories/agent.js
+++ b/ui/mirage/factories/agent.js
@@ -5,6 +5,7 @@ import { DATACENTERS } from '../common';
const UUIDS = provide(100, faker.random.uuid.bind(faker.random));
const AGENT_STATUSES = ['alive', 'leaving', 'left', 'failed'];
+const AGENT_BUILDS = ['1.1.0-beta', '1.0.2-alpha+ent', ...provide(5, faker.system.semver)];
export default Factory.extend({
id: i => (i / 100 >= 1 ? `${UUIDS[i]}-${i}` : UUIDS[i]),
@@ -29,6 +30,10 @@ export default Factory.extend({
Tags: generateTags(serfPort),
};
},
+
+ version() {
+ return this.member.Tags?.build || '';
+ },
});
function generateName() {
@@ -44,5 +49,6 @@ function generateTags(serfPort) {
return {
port: rpcPortCandidate === serfPort ? rpcPortCandidate + 1 : rpcPortCandidate,
dc: faker.helpers.randomize(DATACENTERS),
+ build: faker.helpers.randomize(AGENT_BUILDS),
};
}
diff --git a/ui/mirage/factories/node.js b/ui/mirage/factories/node.js
index f670db32c..14a269ea2 100644
--- a/ui/mirage/factories/node.js
+++ b/ui/mirage/factories/node.js
@@ -7,6 +7,7 @@ import moment from 'moment';
const UUIDS = provide(100, faker.random.uuid.bind(faker.random));
const NODE_STATUSES = ['initializing', 'ready', 'down'];
const NODE_CLASSES = provide(7, faker.company.bsBuzz.bind(faker.company));
+const NODE_VERSIONS = ['1.1.0-beta', '1.0.2-alpha+ent', ...provide(5, faker.system.semver)];
const REF_DATE = new Date();
export default Factory.extend({
@@ -22,6 +23,7 @@ export default Factory.extend({
createIndex: i => i,
modifyIndex: () => faker.random.number({ min: 10, max: 2000 }),
+ version: () => faker.helpers.randomize(NODE_VERSIONS),
httpAddr() {
return this.name.split('@')[1];
diff --git a/ui/tests/acceptance/clients-list-test.js b/ui/tests/acceptance/clients-list-test.js
index 3e6ea8e82..dd76d5a8c 100644
--- a/ui/tests/acceptance/clients-list-test.js
+++ b/ui/tests/acceptance/clients-list-test.js
@@ -66,6 +66,7 @@ module('Acceptance | clients list', function(hooks) {
);
assert.equal(nodeRow.address, node.httpAddr);
assert.equal(nodeRow.datacenter, node.datacenter, 'Datacenter');
+ assert.equal(nodeRow.version, node.version, 'Version');
assert.equal(nodeRow.allocations, allocations.length, '# Allocations');
});
@@ -146,7 +147,11 @@ module('Acceptance | clients list', function(hooks) {
assert.equal(ClientsList.nodes[1].compositeStatus.text, 'initializing');
assert.equal(ClientsList.nodes[2].compositeStatus.text, 'down');
- assert.equal(ClientsList.nodes[2].compositeStatus.text, 'down', 'down takes priority over ineligible');
+ assert.equal(
+ ClientsList.nodes[2].compositeStatus.text,
+ 'down',
+ 'down takes priority over ineligible'
+ );
assert.equal(ClientsList.nodes[4].compositeStatus.text, 'ineligible');
assert.ok(ClientsList.nodes[4].compositeStatus.isWarning, 'expected warning class');
@@ -299,6 +304,22 @@ module('Acceptance | clients list', function(hooks) {
filter: (node, selection) => selection.includes(node.datacenter),
});
+ testFacet('Versions', {
+ facet: ClientsList.facets.version,
+ paramName: 'version',
+ expectedOptions(nodes) {
+ return Array.from(new Set(nodes.mapBy('version'))).sort();
+ },
+ async beforeEach() {
+ server.create('agent');
+ server.createList('node', 2, { version: '0.12.0' });
+ server.createList('node', 2, { version: '1.1.0-beta1' });
+ server.createList('node', 2, { version: '1.2.0+ent' });
+ await ClientsList.visit();
+ },
+ filter: (node, selection) => selection.includes(node.version),
+ });
+
testFacet('Volumes', {
facet: ClientsList.facets.volume,
paramName: 'volume',
diff --git a/ui/tests/acceptance/servers-list-test.js b/ui/tests/acceptance/servers-list-test.js
index d4b30c580..05ac3f327 100644
--- a/ui/tests/acceptance/servers-list-test.js
+++ b/ui/tests/acceptance/servers-list-test.js
@@ -63,6 +63,7 @@ module('Acceptance | servers list', function(hooks) {
assert.equal(agentRow.address, agent.member.Address, 'Address');
assert.equal(agentRow.serfPort, agent.member.Port, 'Serf Port');
assert.equal(agentRow.datacenter, agent.member.Tags.dc, 'Datacenter');
+ assert.equal(agentRow.version, agent.version, 'Version');
});
test('each server should link to the server detail page', async function(assert) {
diff --git a/ui/tests/pages/clients/list.js b/ui/tests/pages/clients/list.js
index 652a777dc..f00c36a28 100644
--- a/ui/tests/pages/clients/list.js
+++ b/ui/tests/pages/clients/list.js
@@ -49,6 +49,7 @@ export default create({
address: text('[data-test-client-address]'),
datacenter: text('[data-test-client-datacenter]'),
+ version: text('[data-test-client-version]'),
allocations: text('[data-test-client-allocations]'),
clickRow: clickable(),
@@ -75,6 +76,7 @@ export default create({
class: multiFacet('[data-test-class-facet]'),
state: multiFacet('[data-test-state-facet]'),
datacenter: multiFacet('[data-test-datacenter-facet]'),
+ version: multiFacet('[data-test-version-facet]'),
volume: multiFacet('[data-test-volume-facet]'),
},
});
diff --git a/ui/tests/pages/servers/list.js b/ui/tests/pages/servers/list.js
index 9f8081e6b..cc884d4e1 100644
--- a/ui/tests/pages/servers/list.js
+++ b/ui/tests/pages/servers/list.js
@@ -11,6 +11,7 @@ export default create({
address: text('[data-test-server-address]'),
serfPort: text('[data-test-server-port]'),
datacenter: text('[data-test-server-datacenter]'),
+ version: text('[data-test-server-version]'),
clickRow: clickable(),
clickName: clickable('[data-test-server-name] a'),