Skip to content

Commit

Permalink
delete the input form of nodes' number in React node creation
Browse files Browse the repository at this point in the history
Signed-off-by: YoungHypo <haiboyang@smail.nju.edu.cn>
  • Loading branch information
YoungHypo committed Nov 8, 2024
1 parent a32997e commit 76b966c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 34 deletions.
2 changes: 0 additions & 2 deletions src/dashboard/src/locales/en-US/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ export default {
'app.node.new.nameCheck': 'Please enter node name',
'app.node.new.type': 'Type',
'app.node.new.typeCheck': 'Please select a type',
'app.node.new.num': 'Number',
'app.node.new.numCheck': 'Please enter the number of nodes',
'app.node.new.createSuccess': 'Create node succeed',
'app.node.new.createFail': 'Create node failed',
'app.node.new.inputBasic.form.networkType.label': 'Network Type',
Expand Down
2 changes: 0 additions & 2 deletions src/dashboard/src/locales/zh-CN/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ export default {
'app.node.new.nameCheck': '请输入名称',
'app.node.new.type': '类型',
'app.node.new.typeCheck': '请请选择类型',
'app.node.new.num': '数量',
'app.node.new.numCheck': '请输入数量',
'app.node.new.createSuccess': '创建节点成功',
'app.node.new.createFail': '创建节点失败',
'app.node.new.inputBasic.form.networkType.label': '网络类型',
Expand Down
31 changes: 1 addition & 30 deletions src/dashboard/src/pages/Node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
Form,
Input,
Select,
InputNumber,
Badge,
Upload,
} from 'antd';
Expand Down Expand Up @@ -216,8 +215,7 @@ const CreateNode = props => {
};

const onFinish = values => {
const msg = { ...values, num: parseInt(values.num, 10) };
handleCreate(msg, createCallback);
handleCreate(values, createCallback);
};

const formItemLayout = {
Expand Down Expand Up @@ -296,33 +294,6 @@ const CreateNode = props => {
>
<Select defaultActiveFirstOption={false}>{typeOptions}</Select>
</FormItem>
<FormItem
{...formItemLayout}
label={intl.formatMessage({
id: 'app.node.new.num',
defaultMessage: 'Number',
})}
name="num"
initialValue="1"
rules={[
{
required: true,
message: intl.formatMessage({
id: 'app.node.new.numCheck',
defaultMessage: 'Please enter the number of nodes',
}),
},
]}
>
<InputNumber
placeholder={intl.formatMessage({
id: 'app.node.new.num',
defaultMessage: 'Number',
})}
min={1}
style={{ width: '100%' }}
/>
</FormItem>
</Form>
</Modal>
);
Expand Down

0 comments on commit 76b966c

Please sign in to comment.