Просмотр исходного кода

🧬merge: Add a button to copy the selected model in the channel (#1290)

Merge pull request #1290 from JoeyLearnsToCode/feat-copy-models
同語 8 месяцев назад
Родитель
Сommit
75e3959474
2 измененных файлов с 12 добавлено и 1 удалено
  1. 1 0
      web/src/i18n/locales/en.json
  2. 11 1
      web/src/pages/Channel/EditChannel.js

+ 1 - 0
web/src/i18n/locales/en.json

@@ -428,6 +428,7 @@
   "填入基础模型": "Fill in the basic model",
   "填入所有模型": "Fill in all models",
   "清除所有模型": "Clear all models",
+  "复制所有模型": "Copy all models",
   "密钥": "Key",
   "请输入密钥": "Please enter the key",
   "批量创建": "Batch Create",

+ 11 - 1
web/src/pages/Channel/EditChannel.js

@@ -26,7 +26,7 @@ import {
   Card,
   Tag,
 } from '@douyinfe/semi-ui';
-import { getChannelModels } from '../../helpers';
+import { getChannelModels, copy } from '../../helpers';
 import {
   IconSave,
   IconClose,
@@ -832,6 +832,16 @@ useEffect(() => {
                   >
                     {t('清除所有模型')}
                   </Button>
+                  <Button
+                    type='tertiary'
+                    onClick={() => {
+                      copy(inputs.models.join(','));
+                    }}
+                    size="large"
+                    className="!rounded-lg"
+                  >
+                    {t('复制所有模型')}
+                  </Button>
                 </div>
 
                 <div>