Fix the state and default value when create cluster instance
The clusterTemplate of state was not updated when clusterTemplate changed Closes-Bug: #1996143 Change-Id: I4f781454b918662a8e46f4d4af06454df5993936
This commit is contained in:
parent
60bf011927
commit
f89ffe6149
@ -761,7 +761,6 @@
|
|||||||
"Docker Storage Driver": "Docker Storage Driver",
|
"Docker Storage Driver": "Docker Storage Driver",
|
||||||
"Docker Swarm": "Docker Swarm",
|
"Docker Swarm": "Docker Swarm",
|
||||||
"Docker Swarm Mode": "Docker Swarm Mode",
|
"Docker Swarm Mode": "Docker Swarm Mode",
|
||||||
"Docker Volume Size": "Docker Volume Size",
|
|
||||||
"Docker Volume Size (GiB)": "Docker Volume Size (GiB)",
|
"Docker Volume Size (GiB)": "Docker Volume Size (GiB)",
|
||||||
"Domain": "Domain",
|
"Domain": "Domain",
|
||||||
"Domain Detail": "Domain Detail",
|
"Domain Detail": "Domain Detail",
|
||||||
|
@ -761,7 +761,6 @@
|
|||||||
"Docker Storage Driver": "Docker存储驱动",
|
"Docker Storage Driver": "Docker存储驱动",
|
||||||
"Docker Swarm": "Docker Swarm",
|
"Docker Swarm": "Docker Swarm",
|
||||||
"Docker Swarm Mode": "Docker Swarm Mode",
|
"Docker Swarm Mode": "Docker Swarm Mode",
|
||||||
"Docker Volume Size": "Docker硬盘大小",
|
|
||||||
"Docker Volume Size (GiB)": "Docker硬盘大小(GiB)",
|
"Docker Volume Size (GiB)": "Docker硬盘大小(GiB)",
|
||||||
"Domain": "域",
|
"Domain": "域",
|
||||||
"Domain Detail": "域详情",
|
"Domain Detail": "域详情",
|
||||||
|
@ -184,7 +184,7 @@ export class BaseDetail extends Base {
|
|||||||
dataIndex: 'docker_storage_driver',
|
dataIndex: 'docker_storage_driver',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('Docker Volume Size'),
|
label: t('Docker Volume Size (GiB)'),
|
||||||
dataIndex: 'docker_volume_size',
|
dataIndex: 'docker_volume_size',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -107,7 +107,7 @@ export class BaseDetail extends Base {
|
|||||||
content: keypairUrl,
|
content: keypairUrl,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('Docker Volume Size'),
|
label: t('Docker Volume Size (GiB)'),
|
||||||
dataIndex: 'docker_volume_size',
|
dataIndex: 'docker_volume_size',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -34,6 +34,8 @@ export class StepInfo extends Base {
|
|||||||
|
|
||||||
async getClustertemplates() {
|
async getClustertemplates() {
|
||||||
await globalClusterTemplateStore.fetchList();
|
await globalClusterTemplateStore.fetchList();
|
||||||
|
this.updateDefaultValue();
|
||||||
|
this.updateState();
|
||||||
}
|
}
|
||||||
|
|
||||||
get clusterTemplates() {
|
get clusterTemplates() {
|
||||||
@ -53,18 +55,18 @@ export class StepInfo extends Base {
|
|||||||
return globalKeypairStore.list.data || [];
|
return globalKeypairStore.list.data || [];
|
||||||
}
|
}
|
||||||
|
|
||||||
handleTemplateChange = (e) => {
|
get nameForStateUpdate() {
|
||||||
const { selectedRows = [] } = e;
|
return ['clusterTemplate'];
|
||||||
this.setState({
|
}
|
||||||
clusterTemplate: selectedRows[0],
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
get defaultValue() {
|
get defaultValue() {
|
||||||
const { template } = this.locationParams;
|
const { template } = this.locationParams;
|
||||||
if (template) {
|
if (template) {
|
||||||
return {
|
return {
|
||||||
clusterTemplate: { selectedRowKeys: [template] },
|
clusterTemplate: {
|
||||||
|
selectedRowKeys: [template],
|
||||||
|
selectedRows: this.clusterTemplates,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
@ -96,7 +98,6 @@ export class StepInfo extends Base {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
columns: getBaseTemplateColumns(this),
|
columns: getBaseTemplateColumns(this),
|
||||||
onChange: this.handleTemplateChange,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'keypair',
|
name: 'keypair',
|
||||||
|
@ -64,7 +64,7 @@ export const policyMap = {
|
|||||||
octavia: ['os_load-balancer_api'],
|
octavia: ['os_load-balancer_api'],
|
||||||
// keystone: ['identity:'],
|
// keystone: ['identity:'],
|
||||||
heat: ['stacks:', 'resource:index'],
|
heat: ['stacks:', 'resource:index'],
|
||||||
magnum: ['cluster', 'clustertemplate'],
|
magnum: ['cluster:', 'clustertemplate:'],
|
||||||
barbican: [
|
barbican: [
|
||||||
'secret:get',
|
'secret:get',
|
||||||
'secret:decrypt',
|
'secret:decrypt',
|
||||||
|
Loading…
Reference in New Issue
Block a user