diff --git a/magnum_ui/static/dashboard/container-infra/clusters/details/drawer.controller.js b/magnum_ui/static/dashboard/container-infra/clusters/details/drawer.controller.js index e104ac13..6136a801 100644 --- a/magnum_ui/static/dashboard/container-infra/clusters/details/drawer.controller.js +++ b/magnum_ui/static/dashboard/container-infra/clusters/details/drawer.controller.js @@ -31,6 +31,15 @@ ]; function controller() { - } + var ctrl = this; + ctrl.objLen = objLen; + function objLen(obj) { + var length = 0; + if (typeof obj === 'object') { + length = Object.keys(obj).length; + } + return length; + } + } })(); diff --git a/magnum_ui/static/dashboard/container-infra/clusters/details/drawer.controller.spec.js b/magnum_ui/static/dashboard/container-infra/clusters/details/drawer.controller.spec.js new file mode 100644 index 00000000..cd00f773 --- /dev/null +++ b/magnum_ui/static/dashboard/container-infra/clusters/details/drawer.controller.spec.js @@ -0,0 +1,33 @@ +/** + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +(function() { + 'use strict'; + + describe('cluster drawer controller', function() { + + var ctrl; + + beforeEach(module('horizon.dashboard.container-infra.clusters')); + + beforeEach(inject(function($controller) { + ctrl = $controller('horizon.dashboard.container-infra.clusters.DrawerController', {}); + })); + + it('objLen returns number of attributes of object', inject(function() { + expect(ctrl.objLen(undefined)).toBe(0); + expect(ctrl.objLen({a: 0})).toBe(1); + })); + }); +})(); diff --git a/magnum_ui/static/dashboard/container-infra/clusters/details/drawer.html b/magnum_ui/static/dashboard/container-infra/clusters/details/drawer.html index 743c76da..b78146c3 100644 --- a/magnum_ui/static/dashboard/container-infra/clusters/details/drawer.html +++ b/magnum_ui/static/dashboard/container-infra/clusters/details/drawer.html @@ -1,27 +1,43 @@
-
+
ID
{$ item.id $}
-
+
Master Count
{$ item.master_count $}
-
+
Node Count
{$ item.node_count $}
+
+
Keypair
+
{$ item.keypair $}
+
-
+
Cluster Template
{$ item.cluster_template_id $}
-
+
+
API Address
+
{$ item.api_address $}
+
+
+
+
+
Master Addresses
+
None
+
{$ addr $}
+
+
Node Addresses
+
None
{$ addr $}
diff --git a/magnum_ui/static/dashboard/container-infra/clusters/details/overview.controller.js b/magnum_ui/static/dashboard/container-infra/clusters/details/overview.controller.js index 3c671088..7fd7dc73 100644 --- a/magnum_ui/static/dashboard/container-infra/clusters/details/overview.controller.js +++ b/magnum_ui/static/dashboard/container-infra/clusters/details/overview.controller.js @@ -30,6 +30,7 @@ var ctrl = this; ctrl.cluster = {}; ctrl.cluster_template = {}; + ctrl.objLen = objLen; $scope.context.loadPromise.then(onGetCluster); @@ -41,5 +42,13 @@ function onGetClusterTemplate(clusterTemplate) { ctrl.cluster_template = clusterTemplate.data; } + + function objLen(obj) { + var length = 0; + if (typeof obj === 'object') { + length = Object.keys(obj).length; + } + return length; + } } })(); diff --git a/magnum_ui/static/dashboard/container-infra/clusters/details/overview.controller.spec.js b/magnum_ui/static/dashboard/container-infra/clusters/details/overview.controller.spec.js index 2abe556b..77d82383 100644 --- a/magnum_ui/static/dashboard/container-infra/clusters/details/overview.controller.spec.js +++ b/magnum_ui/static/dashboard/container-infra/clusters/details/overview.controller.spec.js @@ -41,5 +41,9 @@ expect(ctrl.cluster).toBeDefined(); })); + it('objLen returns number of attributes of object', inject(function() { + expect(ctrl.objLen(undefined)).toBe(0); + expect(ctrl.objLen({a: 0})).toBe(1); + })); }); })(); diff --git a/magnum_ui/static/dashboard/container-infra/clusters/details/overview.html b/magnum_ui/static/dashboard/container-infra/clusters/details/overview.html index 8e1554ca..462959d9 100644 --- a/magnum_ui/static/dashboard/container-infra/clusters/details/overview.html +++ b/magnum_ui/static/dashboard/container-infra/clusters/details/overview.html @@ -25,13 +25,11 @@
API Address
{$ ctrl.cluster.api_address $}
Master Addresses
-
-
{$ addr $}
-
+
None
+
{$ addr $}
Node Addresses
-
-
{$ addr $}
-
+
None
+
{$ addr $}
@@ -40,10 +38,6 @@

Miscellaneous


-
Stack ID
-
- {$ ctrl.cluster.stack_id $} -
Discovery URL
{$ ctrl.cluster.discovery_url $}
Cluster Create Timeout
@@ -59,6 +53,38 @@
Keypair
{$ ctrl.cluster.keypair $}
+
Docker Volume Size
+
{$ ctrl.cluster.docker_volume_size | noValue $} GB
+
Master Flavor ID
+
{$ ctrl.cluster.master_flavor_id | noValue $}
+
COE Version
+
{$ ctrl.cluster.coe_version | noValue $}
+
Container Version
+
{$ ctrl.cluster.container_version | noValue $}
+
+ +
+

Labels

+
+
+
None
+
{$ key $}
+
{$ value $}
+
+
+
+

Stack

+
+
+
Stack ID
+
+ {$ ctrl.cluster.stack_id $} +
+
Stack Faults
+
None
+
as follows:
+
{$ key $}
+
{$ value $}
@@ -73,6 +99,8 @@
{$ ctrl.cluster.id $}
Status
{$ ctrl.cluster.status $}
+
Status Reason
+
{$ ctrl.cluster.status_reason | noValue $}