style: textarea max rows

This commit is contained in:
jialin
2026-01-15 11:17:05 +08:00
parent b1cb4bbe32
commit 0d8333eac6
5 changed files with 14 additions and 11 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ const Container = styled.div`
`; `;
const ButtonWrapper = styled.div` const ButtonWrapper = styled.div`
margin-top: 16px; margin-top: 8px;
`; `;
const Wrapper: React.FC<WrapperProps> = ({ const Wrapper: React.FC<WrapperProps> = ({
+1 -1
View File
@@ -99,7 +99,7 @@ const SealTextArea: React.FC<InputTextareaProps & SealFormItemProps> = (
console.log('style=========', style, rest); console.log('style=========', style, rest);
return ( return (
<InputWrapper> <InputWrapper className="textarea-input-wrapper">
<Wrapper <Wrapper
status={status} status={status}
label={label && <LabelWrapper>{label}</LabelWrapper>} label={label && <LabelWrapper>{label}</LabelWrapper>}
+10 -7
View File
@@ -71,7 +71,6 @@ const InputWrapper = styled.div`
box-shadow: none; box-shadow: none;
padding-block: 5px; padding-block: 5px;
padding-inline: ${INPUT_INNER_PADDING}px; padding-inline: ${INPUT_INNER_PADDING}px;
height: ${INPUTHEIGHT}px !important;
background-color: ${BGCOLOR}; background-color: ${BGCOLOR};
} }
.ant-input.seal-textarea { .ant-input.seal-textarea {
@@ -87,7 +86,6 @@ const InputWrapper = styled.div`
border: none; border: none;
box-shadow: none; box-shadow: none;
padding: 0; padding: 0;
height: ${INPUTHEIGHT}px !important;
background-color: ${BGCOLOR}; background-color: ${BGCOLOR};
flex: 1; flex: 1;
@@ -112,7 +110,6 @@ const InputWrapper = styled.div`
box-shadow: none; box-shadow: none;
padding-block: 5px; padding-block: 5px;
padding-inline: ${INPUT_INNER_PADDING}px; padding-inline: ${INPUT_INNER_PADDING}px;
height: ${INPUTHEIGHT}px !important;
background-color: transparent; background-color: transparent;
} }
.ant-input.ant-input-disabled { .ant-input.ant-input-disabled {
@@ -120,7 +117,6 @@ const InputWrapper = styled.div`
} }
input.ant-input-number-input { input.ant-input-number-input {
flex: 1; flex: 1;
height: ${INPUTHEIGHT}px !important;
padding-block: 6px 4px; padding-block: 6px 4px;
padding-inline: ${INPUT_INNER_PADDING}px; padding-inline: ${INPUT_INNER_PADDING}px;
} }
@@ -145,6 +141,16 @@ const InputWrapper = styled.div`
background-color: transparent !important; background-color: transparent !important;
} }
} }
&:not(.textarea-input-wrapper) {
.ant-input,
.ant-input-password,
.ant-input-number,
.ant-input-outlined,
input.ant-input-number-input {
height: ${INPUTHEIGHT}px !important;
}
}
.ant-input-search-button { .ant-input-search-button {
position: absolute; position: absolute;
top: -20px; top: -20px;
@@ -166,9 +172,6 @@ const InputWrapper = styled.div`
.seal-textarea-wrapper { .seal-textarea-wrapper {
height: auto; height: auto;
padding-right: 10px; padding-right: 10px;
.ant-input-outlined {
height: auto !important;
}
textarea { textarea {
overflow-y: auto !important; overflow-y: auto !important;
} }
+1 -1
View File
@@ -63,7 +63,7 @@ const BasicForm: React.FC<AddModalProps> = ({ action, currentData }) => {
'vllm serve {{model_path}} --port {{port}} --host {{worker_ip}} --served-model-name {{model_name}}' 'vllm serve {{model_path}} --port {{port}} --host {{worker_ip}} --served-model-name {{model_name}}'
} }
)} )}
autoSize={{ minRows: 2, maxRows: 4 }} autoSize={{ minRows: 2, maxRows: 5 }}
label={intl.formatMessage({ label={intl.formatMessage({
id: 'backend.form.defaultExecuteCommand' id: 'backend.form.defaultExecuteCommand'
})} })}
+1 -1
View File
@@ -65,7 +65,7 @@ const CustomBackend: React.FC = () => {
required required
scaleSize={false} scaleSize={false}
alwaysFocus={true} alwaysFocus={true}
autoSize={{ minRows: 2, maxRows: 4 }} autoSize={{ minRows: 2, maxRows: 5 }}
onBlur={handleRunCommandOnBlur} onBlur={handleRunCommandOnBlur}
label={intl.formatMessage({ id: 'backend.runCommand' })} label={intl.formatMessage({ id: 'backend.runCommand' })}
description={intl.formatMessage({ description={intl.formatMessage({