diff --git a/common/endpoint_type.go b/common/endpoint_type.go index 09174f23..58936eea 100644 --- a/common/endpoint_type.go +++ b/common/endpoint_type.go @@ -8,6 +8,14 @@ func GetEndpointTypesByChannelType(channelType int, modelName string) []constant switch channelType { case constant.ChannelTypeJina: endpointTypes = []constant.EndpointType{constant.EndpointTypeJinaRerank} + case constant.ChannelTypeMidjourney, constant.ChannelTypeMidjourneyPlus: + endpointTypes = []constant.EndpointType{constant.EndpointTypeMidjourney} + case constant.ChannelTypeSunoAPI: + endpointTypes = []constant.EndpointType{constant.EndpointTypeSuno} + case constant.ChannelTypeKling: + endpointTypes = []constant.EndpointType{constant.EndpointTypeKling} + case constant.ChannelTypeJimeng: + endpointTypes = []constant.EndpointType{constant.EndpointTypeJimeng} case constant.ChannelTypeAws: fallthrough case constant.ChannelTypeAnthropic: diff --git a/constant/endpoint_type.go b/constant/endpoint_type.go index a1b840db..323bf2d6 100644 --- a/constant/endpoint_type.go +++ b/constant/endpoint_type.go @@ -8,4 +8,8 @@ const ( EndpointTypeAnthropic EndpointType = "anthropic" EndpointTypeGemini EndpointType = "gemini" EndpointTypeJinaRerank EndpointType = "jina-rerank" + EndpointTypeMidjourney EndpointType = "midjourney-proxy" + EndpointTypeSuno EndpointType = "suno-proxy" + EndpointTypeKling EndpointType = "kling" + EndpointTypeJimeng EndpointType = "jimeng" ) diff --git a/web/src/components/table/ModelPricing.js b/web/src/components/table/ModelPricing.js index 56d40257..bf9df911 100644 --- a/web/src/components/table/ModelPricing.js +++ b/web/src/components/table/ModelPricing.js @@ -1,5 +1,5 @@ import React, { useContext, useEffect, useRef, useMemo, useState } from 'react'; -import { API, copy, showError, showInfo, showSuccess, getModelCategories, renderModelTag } from '../../helpers'; +import { API, copy, showError, showInfo, showSuccess, getModelCategories, renderModelTag, stringToColor } from '../../helpers'; import { useTranslation } from 'react-i18next'; import { @@ -106,6 +106,26 @@ const ModelPricing = () => { ) : null; } + function renderSupportedEndpoints(endpoints) { + if (!endpoints || endpoints.length === 0) { + return null; + } + return ( + + {endpoints.map((endpoint, idx) => ( + + {endpoint} + + ))} + + ); + } + const columns = [ { title: t('可用性'), @@ -120,6 +140,13 @@ const ModelPricing = () => { }, defaultSortOrder: 'descend', }, + { + title: t('可用端点类型'), + dataIndex: 'supported_endpoint_types', + render: (text, record, index) => { + return renderSupportedEndpoints(text); + }, + }, { title: t('模型名称'), dataIndex: 'model_name', @@ -499,7 +526,7 @@ const ModelPricing = () => {
- {t('未登录,使用默认分组倍率')}: {groupRatio['default']} + {t('未登录,使用默认分组倍率:')}{groupRatio['default']}
)} diff --git a/web/src/i18n/locales/en.json b/web/src/i18n/locales/en.json index 9a0369e6..a5ac694f 100644 --- a/web/src/i18n/locales/en.json +++ b/web/src/i18n/locales/en.json @@ -1750,5 +1750,7 @@ "批量创建时会在名称后自动添加随机后缀": "When creating in batches, a random suffix will be automatically added to the name", "额度必须大于0": "Quota must be greater than 0", "生成数量必须大于0": "Generation quantity must be greater than 0", - "创建后可在编辑渠道时获取上游模型列表": "After creation, you can get the upstream model list when editing the channel" + "创建后可在编辑渠道时获取上游模型列表": "After creation, you can get the upstream model list when editing the channel", + "可用端点类型": "Supported endpoint types", + "未登录,使用默认分组倍率:": "Not logged in, using default group ratio: " } \ No newline at end of file