From 29c4030d0c178947c9f08e194866497e84c6fd6b Mon Sep 17 00:00:00 2001 From: "Jingwei.Zhang" Date: Mon, 7 Aug 2023 15:26:35 +0800 Subject: [PATCH] refactor: refactor create instance refact create instance code Change-Id: Ib8ca4af068bd7377c82bee9d0b01df9f1c0ace42 --- .../Instance/actions/StepCreate/index.jsx | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/src/pages/compute/containers/Instance/actions/StepCreate/index.jsx b/src/pages/compute/containers/Instance/actions/StepCreate/index.jsx index 40eede9d..47f2fa9b 100644 --- a/src/pages/compute/containers/Instance/actions/StepCreate/index.jsx +++ b/src/pages/compute/containers/Instance/actions/StepCreate/index.jsx @@ -518,9 +518,9 @@ export class StepCreate extends StepAction { return null; } - renderFooterLeft() { + getCountInputConfig() { const { data } = this.state; - const { count = 1, source: { value: sourceValue } = {} } = data; + const { source: { value: sourceValue } = {} } = data; const configs = { min: 1, max: @@ -533,17 +533,30 @@ export class StepCreate extends StepAction { onChange: this.onCountChange, formatter: (value) => `$ ${value}`.replace(/\D/g, ''), }; + return configs; + } + + renderCountInput() { + const { data } = this.state; + const { count = 1 } = data || {}; + const configs = this.getCountInputConfig(); + return ( +
+ {t('Count')} + +
+ ); + } + + renderFooterLeft() { return (
-
- {t('Count')} - -
+ {this.renderCountInput()} {this.renderExtra()}
{this.renderBadge()}