From 06e581191b2878b3feaf38cb3f196d02684cbecd Mon Sep 17 00:00:00 2001 From: "Jingwei.Zhang" Date: Mon, 7 Aug 2023 20:27:21 +0800 Subject: [PATCH] refactor: refactor create ironic refact create ironic code Change-Id: I9aa223951e610e9a63e5fdc680381aea88d08ff0 --- .../Instance/actions/CreateIronic/index.jsx | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/src/pages/compute/containers/Instance/actions/CreateIronic/index.jsx b/src/pages/compute/containers/Instance/actions/CreateIronic/index.jsx index dca7ed53..54013efb 100644 --- a/src/pages/compute/containers/Instance/actions/CreateIronic/index.jsx +++ b/src/pages/compute/containers/Instance/actions/CreateIronic/index.jsx @@ -207,27 +207,37 @@ export class CreateIronic extends StepAction { return null; } - renderFooterLeft() { - const { data } = this.state; - const { count = 1 } = data; - const configs = { + getCountInputConfig() { + return { min: 1, max: 100, precision: 0, onChange: this.onCountChange, formatter: (value) => `$ ${value}`.replace(/\D/g, ''), }; + } + + 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()}