feat: 在新增&编辑渠道时添加点击模型复制名称功能

(cherry picked from commit c4935f392f)
This commit is contained in:
AAEE86
2025-08-24 01:09:08 +08:00
parent 808f5c481e
commit da516af837
3 changed files with 31 additions and 2 deletions

View File

@@ -1050,5 +1050,7 @@
"已绑定的邮箱账户": "已绑定的邮箱账户",
"已绑定的 Telegram 账户": "已绑定的 Telegram 账户",
"新额度": "新额度",
"需要添加的额度(支持负数)": "需要添加的额度(支持负数)"
"需要添加的额度(支持负数)": "需要添加的额度(支持负数)",
"点击复制模型名称": "点击复制模型名称",
"已复制:{{name}}": "已复制:{{name}}"
}

View File

@@ -1485,6 +1485,31 @@ const EditChannelModal = (props) => {
optionList={modelOptions}
style={{ width: '100%' }}
onChange={(value) => handleInputChange('models', value)}
renderSelectedItem={(optionNode) => {
const modelName = String(optionNode?.value ?? '');
return {
isRenderInTag: true,
content: (
<span
className="cursor-pointer select-none"
role="button"
tabIndex={0}
title={t('点击复制模型名称')}
onClick={async (e) => {
e.stopPropagation();
const ok = await copy(modelName);
if (ok) {
showSuccess(t('已复制:{{name}}', { name: modelName }));
} else {
showError(t('复制失败'));
}
}}
>
{optionNode.label || modelName}
</span>
),
};
}}
extraText={(
<Space wrap>
<Button size='small' type='primary' onClick={() => handleInputChange('models', basicModels)}>

View File

@@ -1995,5 +1995,7 @@
"跟随系统主题设置": "Follow system theme",
"当前跟随系统": "Currently following system",
"深色": "Dark",
"浅色": "Light"
"浅色": "Light",
"点击复制模型名称": "Click to copy model name",
"已复制:{{name}}": "Copied: {{name}}"
}