Browse Source

fix: 修改添加环境变量

pull/134/head
cp3hnu 1 year ago
parent
commit
6646ae0e63
2 changed files with 29 additions and 15 deletions
  1. +25
    -12
      react-ui/src/pages/ModelDeployment/CreateVersion/index.tsx
  2. +4
    -3
      react-ui/src/pages/ModelDeployment/ServiceInfo/index.tsx

+ 25
- 12
react-ui/src/pages/ModelDeployment/CreateVersion/index.tsx View File

@@ -421,7 +421,18 @@ function CreateServiceVersion() {
<> <>
<Row gutter={8}> <Row gutter={8}>
<Col span={10}> <Col span={10}>
<Form.Item label="环境变量"></Form.Item>
<Form.Item label="环境变量">
{fields.length === 0 ? (
<Button
type="link"
style={{ padding: '0' }}
onClick={() => add()}
disabled={disabled}
>
添加环境变量
</Button>
) : null}
</Form.Item>
</Col> </Col>
</Row> </Row>
{fields.map(({ key, name, ...restField }) => ( {fields.map(({ key, name, ...restField }) => (
@@ -457,7 +468,8 @@ function CreateServiceVersion() {
disabled={disabled} disabled={disabled}
onClick={() => { onClick={() => {
modalConfirm({ modalConfirm({
content: '是否确认删除?',
title: '删除',
content: '是否确认要删除该环境变量?',
onOk: () => { onOk: () => {
remove(name); remove(name);
}, },
@@ -466,19 +478,20 @@ function CreateServiceVersion() {
></Button> ></Button>
</Flex> </Flex>
))} ))}
<Button
type="link"
style={{ padding: '0', margin: '-24px 0 24px' }}
onClick={() => add()}
icon={<PlusOutlined />}
disabled={disabled}
>
环境变量
</Button>
{fields.length > 0 ? (
<Button
type="link"
style={{ padding: '0', margin: '-24px 0 24px' }}
onClick={() => add()}
icon={<PlusOutlined />}
disabled={disabled}
>
环境变量
</Button>
) : null}
</> </>
)} )}
</Form.List> </Form.List>

<Form.Item wrapperCol={{ offset: 0, span: 16 }}> <Form.Item wrapperCol={{ offset: 0, span: 16 }}>
<Button type="primary" htmlType="submit"> <Button type="primary" htmlType="submit">
{buttonText} {buttonText}


+ 4
- 3
react-ui/src/pages/ModelDeployment/ServiceInfo/index.tsx View File

@@ -163,7 +163,8 @@ function ServiceInfo() {
// 处理停止 // 处理停止
const handleServiceVersionStop = async (record: ServiceVersionData) => { const handleServiceVersionStop = async (record: ServiceVersionData) => {
modalConfirm({ modalConfirm({
content: '是否确认停止?',
title: '停止',
content: '是否确认停止该服务?',
onOk: () => { onOk: () => {
stopServiceVersion(record); stopServiceVersion(record);
}, },
@@ -372,7 +373,7 @@ function ServiceInfo() {
></SubAreaTitle> ></SubAreaTitle>
<div className={styles['service-info__content__filter']}> <div className={styles['service-info__content__filter']}>
<Input.Search <Input.Search
placeholder="按版本筛选"
placeholder="按服务版本筛选"
onSearch={onSearch} onSearch={onSearch}
onChange={(e) => setInputText(e.target.value)} onChange={(e) => setInputText(e.target.value)}
style={{ width: 300 }} style={{ width: 300 }}
@@ -382,7 +383,7 @@ function ServiceInfo() {
<Select <Select
style={{ width: 100, marginLeft: '20px' }} style={{ width: 100, marginLeft: '20px' }}
placeholder="请选择" placeholder="请选择"
onChange={(value) => setServiceStatus(value)}
onChange={(value) => setServiceStatus(value ?? '')}
options={allServiceStatusOptions} options={allServiceStatusOptions}
value={serviceStatus} value={serviceStatus}
allowClear allowClear


Loading…
Cancel
Save