Skip to content

Commit

Permalink
EDGECLOUD-2263 Web UI - Cluster Instance details should show the num …
Browse files Browse the repository at this point in the history
…masters and num nodes (#228)

* Number of node is default to 0 if not defined
  • Loading branch information
rahuldsce authored Apr 1, 2020
1 parent bbe795e commit 5648f1b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/services/model/clusterInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { TYPE_JSON, IPAccessLabel } from '../../constant';

let fields = formatter.fields;

export const keys = [
export const keys = () => ([
{ field: fields.region, label: 'Region', sortable: true, visible: true },
{ field: fields.clusterName, serverField: 'key#OS#cluster_key#OS#name', sortable: true, label: 'Cluster', visible: true },
{ field: fields.organizationName, serverField: 'key#OS#organization', sortable: true, label: 'Organization', visible: true },
Expand All @@ -24,7 +24,7 @@ export const keys = [
{ field: fields.reservable, serverField: 'reservable', label: 'Reservable', roles: ['AdminManager'] },
{ field: fields.reservedBy, serverField: 'reserved_by', label: 'Reserved By', roles: ['AdminManager'] },
{ field: fields.actions, label: 'Actions', sortable: false, visible: true, clickable: true }
]
])

export const multiDataRequest = (keys, mcRequestList) => {
let cloudletDataList = [];
Expand Down Expand Up @@ -140,8 +140,9 @@ export const streamClusterInst = (data) => {

const customData = (value) => {
value[fields.ipAccess] = IPAccessLabel(value[fields.ipAccess])
value[fields.numberOfNodes] = value[fields.numberOfNodes] ? value[fields.numberOfNodes] : 0
}

export const getData = (response, body) => {
return formatter.formatData(response, body, keys, customData, true)
return formatter.formatData(response, body, keys(), customData, true)
}
2 changes: 1 addition & 1 deletion src/sites/siteFour/clusterInst/clusterInstList.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ClusterInstView extends React.Component {
}
this.action = '';
this.data = {};
this.keys = Object.assign([], keys);
this.keys = keys();
}

onRegClose = (isEdited)=>
Expand Down

0 comments on commit 5648f1b

Please sign in to comment.