From 3ced5ff14403e02007143bd2cde86758ead1956b Mon Sep 17 00:00:00 2001 From: t0ng7u Date: Fri, 27 Jun 2025 10:08:44 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20chore:=20Improve=20channel=20creati?= =?UTF-8?q?on=20UX:=20defer=20"Fetch=20Model=20List"=20action=20until=20af?= =?UTF-8?q?ter=20creation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, the "Fetch Model List" button was visible in the channel-creation view even though it only functions once a channel record exists, leading to user confusion. Changes introduced: • Render the "Fetch Model List" button only when editing an existing channel (`isEdit === true`). • Display an informational Banner in creation mode to remind users that the upstream model list can be fetched after the channel has been created. • Refactored JSX to apply the above conditional rendering without altering existing logic. This update streamlines the creation workflow and sets clearer expectations for users. --- web/src/i18n/locales/en.json | 3 ++- web/src/pages/Channel/EditChannel.js | 24 +++++++++++++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/web/src/i18n/locales/en.json b/web/src/i18n/locales/en.json index c9e5ce8f..060f3e65 100644 --- a/web/src/i18n/locales/en.json +++ b/web/src/i18n/locales/en.json @@ -1748,5 +1748,6 @@ "快捷设置": "Quick settings", "批量创建时会在名称后自动添加随机后缀": "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" + "生成数量必须大于0": "Generation quantity must be greater than 0", + "创建后可在编辑渠道时获取上游模型列表": "After creation, you can get the upstream model list when editing the channel" } \ No newline at end of file diff --git a/web/src/pages/Channel/EditChannel.js b/web/src/pages/Channel/EditChannel.js index 7f06ef09..413e8248 100644 --- a/web/src/pages/Channel/EditChannel.js +++ b/web/src/pages/Channel/EditChannel.js @@ -792,13 +792,15 @@ const EditChannel = (props) => { > {t('填入所有模型')} - + {isEdit ? ( + + ) : null} + {!isEdit && ( + + )} +