Skip to content

Commit de0f26c

Browse files
authored
FEAT: [UI] add hint for common parameters with support for custom input. (#3521)
1 parent bad4232 commit de0f26c

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

xinference/web/ui/src/locales/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@
207207
},
208208

209209
"components": {
210-
"copySuccess": "Copied to clipboard!"
210+
"copySuccess": "Copied to clipboard!",
211+
"suggestsCommonParameters": "Suggests common parameters; others allowed."
211212
}
212213
}

xinference/web/ui/src/locales/zh.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@
207207
},
208208

209209
"components": {
210-
"copySuccess": "已复制到剪贴板!"
210+
"copySuccess": "已复制到剪贴板!",
211+
"suggestsCommonParameters": "提示常用参数,也允许输入其他参数"
211212
}
212213
}

xinference/web/ui/src/scenes/launch_model/components/addPair.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
TextField,
1010
} from '@mui/material'
1111
import React, { useEffect, useState } from 'react'
12+
import { useTranslation } from 'react-i18next'
1213

1314
const AddPair = ({
1415
customData,
@@ -23,6 +24,8 @@ const AddPair = ({
2324
const [defaultIndex, setDefaultIndex] = useState(-1)
2425
const [isNotUniqueKey, setIsNotUniqueKey] = useState(false)
2526

27+
const { t } = useTranslation()
28+
2629
useEffect(() => {
2730
onGetArr(arr)
2831
}, [arr])
@@ -115,6 +118,7 @@ const AddPair = ({
115118
style={{ width: '44%' }}
116119
disablePortal
117120
options={tipOptions}
121+
groupBy={() => t('components.suggestsCommonParameters')}
118122
value={item[customData.key]}
119123
inputValue={item[customData.key]}
120124
onInputChange={(_, newValue) => {

0 commit comments

Comments
 (0)