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