chore: backend placeholder
This commit is contained in:
@@ -156,6 +156,7 @@ export default {
|
||||
'models.table.apiAccessInfo.modelName': 'Model Name',
|
||||
'models.table.apiAccessInfo.apikey': 'API Key',
|
||||
'models.table.apiAccessInfo.openaiCompatible': 'OpenAI Compatible',
|
||||
'models.table.apiAccessInfo.anthropicCompatible': 'Anthropic Compatible',
|
||||
'models.table.apiAccessInfo.jinaCompatible': 'Jina Compatible',
|
||||
'models.table.apiAccessInfo.gotoCreate': 'Go to Create',
|
||||
'models.search.parts': '{n} parts',
|
||||
|
||||
@@ -156,6 +156,7 @@ export default {
|
||||
'models.table.apiAccessInfo.modelName': 'モデル名',
|
||||
'models.table.apiAccessInfo.apikey': 'APIキー',
|
||||
'models.table.apiAccessInfo.openaiCompatible': 'OpenAI互換',
|
||||
'models.table.apiAccessInfo.anthropicCompatible': 'Anthropic互換',
|
||||
'models.table.apiAccessInfo.jinaCompatible': 'Jina互換',
|
||||
'models.table.apiAccessInfo.gotoCreate': '作成に移動',
|
||||
'models.search.parts': '{n} 部分',
|
||||
|
||||
@@ -158,6 +158,7 @@ export default {
|
||||
'models.table.apiAccessInfo.modelName': 'Имя модели',
|
||||
'models.table.apiAccessInfo.apikey': 'Ключ API',
|
||||
'models.table.apiAccessInfo.openaiCompatible': 'Совместимо с OpenAI',
|
||||
'models.table.apiAccessInfo.anthropicCompatible': 'Совместимо с Anthropic',
|
||||
'models.table.apiAccessInfo.jinaCompatible': 'Совместимо с Jina',
|
||||
'models.table.apiAccessInfo.gotoCreate': 'Перейти к созданию',
|
||||
'models.search.parts': '{n} частей',
|
||||
|
||||
@@ -155,6 +155,7 @@ export default {
|
||||
'models.table.apiAccessInfo.modelName': 'Model Adı',
|
||||
'models.table.apiAccessInfo.apikey': 'API Anahtarı',
|
||||
'models.table.apiAccessInfo.openaiCompatible': 'OpenAI Uyumlu',
|
||||
'models.table.apiAccessInfo.anthropicCompatible': 'Anthropic Uyumlu',
|
||||
'models.table.apiAccessInfo.jinaCompatible': 'Jina Uyumlu',
|
||||
'models.table.apiAccessInfo.gotoCreate': 'Oluşturmaya Git',
|
||||
'models.search.parts': '{n} parça',
|
||||
|
||||
@@ -148,6 +148,7 @@ export default {
|
||||
'models.table.apiAccessInfo.modelName': '模型名称',
|
||||
'models.table.apiAccessInfo.apikey': 'API 密钥',
|
||||
'models.table.apiAccessInfo.openaiCompatible': 'OpenAI 兼容',
|
||||
'models.table.apiAccessInfo.anthropicCompatible': 'Anthropic 兼容',
|
||||
'models.table.apiAccessInfo.jinaCompatible': 'Jina 兼容',
|
||||
'models.table.apiAccessInfo.gotoCreate': '去创建',
|
||||
'models.search.parts': '{n} 个文件',
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { PageActionType } from '@/config/types';
|
||||
import { backendOptionsMap } from '@/pages/llmodels/constants/backend-parameters';
|
||||
import { MinusOutlined, PlusOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
BaseSelect,
|
||||
@@ -50,6 +51,19 @@ const Title = styled.div`
|
||||
padding-bottom: 8px;
|
||||
`;
|
||||
|
||||
const backendHolder = {
|
||||
[backendOptionsMap.SGLang]: {
|
||||
defaultEntry: 'sglang serve',
|
||||
defaultCommand:
|
||||
'--model-path {{model_path}} --host {{worker_ip}} --port {{port}}'
|
||||
},
|
||||
[backendOptionsMap.vllm]: {
|
||||
defaultEntry: 'vllm serve',
|
||||
defaultCommand:
|
||||
'{{model_path}} --host {{worker_ip}} --port {{port}} --served-model-name {{model_name}}'
|
||||
}
|
||||
};
|
||||
|
||||
type AddModalProps = {
|
||||
action: PageActionType;
|
||||
currentData?: ListItem;
|
||||
@@ -142,6 +156,16 @@ const VersionsForm: React.FC<AddModalProps> = ({
|
||||
setDefaultVersion(value);
|
||||
};
|
||||
|
||||
const getDefaultHolder = (content: string) => {
|
||||
if (!content) return '';
|
||||
return intl.formatMessage(
|
||||
{ id: 'common.help.default' },
|
||||
{
|
||||
content: content
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const versions = form.getFieldValue('version_configs') || [];
|
||||
|
||||
@@ -184,6 +208,7 @@ const VersionsForm: React.FC<AddModalProps> = ({
|
||||
|
||||
const isBuiltin = backendSource === BackendSourceValueMap.BUILTIN;
|
||||
const isCommunity = backendSource === BackendSourceValueMap.COMMUNITY;
|
||||
const backend = currentData?.backend_name;
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -358,12 +383,24 @@ const VersionsForm: React.FC<AddModalProps> = ({
|
||||
<Form.Item name={[name, 'entrypoint']}>
|
||||
<CInput.TextArea
|
||||
allowClear
|
||||
alwaysFocus={true}
|
||||
description={intl.formatMessage({
|
||||
id: 'backend.entrypoint.tips'
|
||||
})}
|
||||
label={intl.formatMessage({
|
||||
id: 'backend.replaceEntrypoint'
|
||||
})}
|
||||
placeholder={
|
||||
getDefaultHolder(
|
||||
backendHolder[backend as string]?.defaultEntry
|
||||
) ||
|
||||
intl.formatMessage(
|
||||
{ id: 'common.help.eg' },
|
||||
{
|
||||
content: 'vllm serve'
|
||||
}
|
||||
)
|
||||
}
|
||||
></CInput.TextArea>
|
||||
</Form.Item>
|
||||
<Form.Item name={[name, 'run_command']}>
|
||||
@@ -373,13 +410,18 @@ const VersionsForm: React.FC<AddModalProps> = ({
|
||||
description={intl.formatMessage({
|
||||
id: 'backend.form.defaultExecuteCommand.tips'
|
||||
})}
|
||||
placeholder={intl.formatMessage(
|
||||
{ id: 'common.help.eg' },
|
||||
{
|
||||
content:
|
||||
'{{model_path}} --port {{port}} --host {{worker_ip}} --served-model-name {{model_name}}'
|
||||
}
|
||||
)}
|
||||
placeholder={
|
||||
getDefaultHolder(
|
||||
backendHolder[backend as string]?.defaultCommand
|
||||
) ||
|
||||
intl.formatMessage(
|
||||
{ id: 'common.help.eg' },
|
||||
{
|
||||
content:
|
||||
'{{model_path}} --port {{port}} --host {{worker_ip}} --served-model-name {{model_name}}'
|
||||
}
|
||||
)
|
||||
}
|
||||
label={intl.formatMessage({ id: 'backend.runCommand' })}
|
||||
></SealTextArea>
|
||||
</Form.Item>
|
||||
|
||||
@@ -5,7 +5,7 @@ import styled from 'styled-components';
|
||||
import { usageChartCardHeight, usageChartHeight } from '../../config';
|
||||
|
||||
export const ChartTitle = styled.div`
|
||||
font-weight: var(--font-weight-bold);
|
||||
font-weight: 500;
|
||||
margin-bottom: 12px;
|
||||
`;
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import {
|
||||
MODEL_PROXY,
|
||||
RERANKER_API
|
||||
} from '@/pages/playground/apis';
|
||||
import { BulbOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
AutoTooltip,
|
||||
CopyButton,
|
||||
@@ -117,18 +116,11 @@ const ApiAccessInfo = ({ open, data, onClose }: ApiAccessInfoProps) => {
|
||||
return (
|
||||
<Tips>
|
||||
<dl className="tips">
|
||||
<dt>
|
||||
<BulbOutlined />
|
||||
</dt>
|
||||
<dd
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: data.generic_proxy
|
||||
? intl.formatMessage({
|
||||
id: 'models.table.genericProxy'
|
||||
})
|
||||
: intl.formatMessage({
|
||||
id: 'models.table.button.apiAccessInfo.tips'
|
||||
})
|
||||
__html: intl.formatMessage({
|
||||
id: 'models.table.button.apiAccessInfo.tips'
|
||||
})
|
||||
}}
|
||||
></dd>
|
||||
</dl>
|
||||
@@ -163,6 +155,7 @@ const ApiAccessInfo = ({ open, data, onClose }: ApiAccessInfoProps) => {
|
||||
onCancel={handleClose}
|
||||
footer={null}
|
||||
>
|
||||
{renderTips()}
|
||||
<ApiAccessInfoWrapper>
|
||||
<span className="label">
|
||||
{intl.formatMessage({ id: 'models.table.apiAccessInfo.endpoint' })}
|
||||
@@ -172,15 +165,22 @@ const ApiAccessInfo = ({ open, data, onClose }: ApiAccessInfoProps) => {
|
||||
{endPoint}
|
||||
</AutoTooltip>
|
||||
{!data.generic_proxy && (
|
||||
<APITAG color="geekblue">
|
||||
{isRanker
|
||||
? intl.formatMessage({
|
||||
id: 'models.table.apiAccessInfo.jinaCompatible'
|
||||
})
|
||||
: intl.formatMessage({
|
||||
id: 'models.table.apiAccessInfo.openaiCompatible'
|
||||
})}
|
||||
</APITAG>
|
||||
<>
|
||||
<APITAG color="geekblue">
|
||||
{isRanker
|
||||
? intl.formatMessage({
|
||||
id: 'models.table.apiAccessInfo.jinaCompatible'
|
||||
})
|
||||
: intl.formatMessage({
|
||||
id: 'models.table.apiAccessInfo.openaiCompatible'
|
||||
})}
|
||||
</APITAG>
|
||||
<APITAG color="geekblue">
|
||||
{intl.formatMessage({
|
||||
id: 'models.table.apiAccessInfo.anthropicCompatible'
|
||||
})}
|
||||
</APITAG>
|
||||
</>
|
||||
)}
|
||||
</span>
|
||||
<span className="copy-btn">
|
||||
|
||||
Reference in New Issue
Block a user