refactor: update scroll modal
This commit is contained in:
@@ -74,11 +74,7 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
|
||||
style={{
|
||||
top: 100
|
||||
}}
|
||||
styles={{
|
||||
body: {
|
||||
minHeight: 450
|
||||
}
|
||||
}}
|
||||
maxContentHeight={450}
|
||||
footer={null}
|
||||
>
|
||||
<ContainerInstall token={token} />
|
||||
|
||||
@@ -2,7 +2,6 @@ import LabelSelector from '@/components/label-selector';
|
||||
import ModalFooter from '@/components/modal-footer';
|
||||
import ScrollerModal from '@/components/scroller-modal';
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import SimpleOverlay from '@/components/simple-overlay';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import _ from 'lodash';
|
||||
@@ -48,90 +47,66 @@ const UpdateLabels: React.FC<ViewModalProps> = (props) => {
|
||||
maskClosable={false}
|
||||
keyboard={false}
|
||||
width={600}
|
||||
styles={{
|
||||
content: {
|
||||
padding: '0px'
|
||||
},
|
||||
header: {
|
||||
padding: 'var(--ant-modal-content-padding)',
|
||||
paddingBottom: '0'
|
||||
},
|
||||
body: {
|
||||
padding: '0'
|
||||
},
|
||||
footer: {
|
||||
padding: '0 var(--ant-modal-content-padding)'
|
||||
}
|
||||
}}
|
||||
maxContentHeight={550}
|
||||
footer={
|
||||
<ModalFooter onOk={handleSumit} onCancel={onCancel}></ModalFooter>
|
||||
}
|
||||
>
|
||||
<SimpleOverlay
|
||||
style={{
|
||||
maxHeight: '550px'
|
||||
<Form
|
||||
name="deployModel"
|
||||
form={form}
|
||||
onFinish={onOk}
|
||||
preserve={false}
|
||||
clearOnDestroy={true}
|
||||
initialValues={{
|
||||
name: data.name,
|
||||
labels: data.labels
|
||||
}}
|
||||
>
|
||||
<Form
|
||||
name="deployModel"
|
||||
form={form}
|
||||
onFinish={onOk}
|
||||
preserve={false}
|
||||
clearOnDestroy={true}
|
||||
initialValues={{
|
||||
name: data.name,
|
||||
labels: data.labels
|
||||
}}
|
||||
style={{
|
||||
padding: 'var(--ant-modal-content-padding)',
|
||||
paddingBlock: 0
|
||||
}}
|
||||
>
|
||||
<Form.Item<FormData> name="name">
|
||||
<SealInput.Input
|
||||
label={intl.formatMessage({
|
||||
id: 'common.table.name'
|
||||
})}
|
||||
disabled
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData>
|
||||
name="labels"
|
||||
rules={[
|
||||
() => ({
|
||||
validator(rule, value) {
|
||||
if (_.keys(value).length > 0) {
|
||||
if (_.some(_.keys(value), (k: string) => !value[k])) {
|
||||
return Promise.reject(
|
||||
intl.formatMessage(
|
||||
{
|
||||
id: 'common.validate.value'
|
||||
},
|
||||
{
|
||||
name: intl.formatMessage({
|
||||
id: 'resources.form.label'
|
||||
})
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
<Form.Item<FormData> name="name">
|
||||
<SealInput.Input
|
||||
label={intl.formatMessage({
|
||||
id: 'common.table.name'
|
||||
})}
|
||||
disabled
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData>
|
||||
name="labels"
|
||||
rules={[
|
||||
() => ({
|
||||
validator(rule, value) {
|
||||
if (_.keys(value).length > 0) {
|
||||
if (_.some(_.keys(value), (k: string) => !value[k])) {
|
||||
return Promise.reject(
|
||||
intl.formatMessage(
|
||||
{
|
||||
id: 'common.validate.value'
|
||||
},
|
||||
{
|
||||
name: intl.formatMessage({
|
||||
id: 'resources.form.label'
|
||||
})
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
})
|
||||
]}
|
||||
>
|
||||
<LabelSelector
|
||||
label={intl.formatMessage({
|
||||
id: 'resources.table.labels'
|
||||
})}
|
||||
labels={labels}
|
||||
btnText="common.button.addLabel"
|
||||
onChange={handleLabelsChange}
|
||||
></LabelSelector>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</SimpleOverlay>
|
||||
return Promise.resolve();
|
||||
}
|
||||
})
|
||||
]}
|
||||
>
|
||||
<LabelSelector
|
||||
label={intl.formatMessage({
|
||||
id: 'resources.table.labels'
|
||||
})}
|
||||
labels={labels}
|
||||
btnText="common.button.addLabel"
|
||||
onChange={handleLabelsChange}
|
||||
></LabelSelector>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</ScrollerModal>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user