From 44d20de251d91d83cc084254b498b2326f60abc0 Mon Sep 17 00:00:00 2001 From: skynono Date: Sat, 21 Jun 2025 20:36:52 +0800 Subject: [PATCH 1/5] feat: add placeholder for kling AccessKey and SecretKey --- web/src/pages/Channel/EditChannel.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/src/pages/Channel/EditChannel.js b/web/src/pages/Channel/EditChannel.js index ca38e6b9..1ef8af8c 100644 --- a/web/src/pages/Channel/EditChannel.js +++ b/web/src/pages/Channel/EditChannel.js @@ -64,6 +64,8 @@ function type2secretPrompt(type) { return '按照如下格式输入:AppId|SecretId|SecretKey'; case 33: return '按照如下格式输入:Ak|Sk|Region'; + case 50: + return '按照如下格式输入: AccessKey|SecretKey'; default: return '请输入渠道对应的鉴权密钥'; } From e4def0625b3984118fd70229e696164150b9c202 Mon Sep 17 00:00:00 2001 From: skynono Date: Sat, 21 Jun 2025 20:50:53 +0800 Subject: [PATCH 2/5] feat: kling apiKey format to use `|` delimiter --- relay/channel/task/kling/adaptor.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/relay/channel/task/kling/adaptor.go b/relay/channel/task/kling/adaptor.go index 9ea58728..2995a07b 100644 --- a/relay/channel/task/kling/adaptor.go +++ b/relay/channel/task/kling/adaptor.go @@ -69,8 +69,8 @@ func (a *TaskAdaptor) Init(info *relaycommon.TaskRelayInfo) { a.ChannelType = info.ChannelType a.baseURL = info.BaseUrl - // apiKey format: "access_key,secret_key" - keyParts := strings.Split(info.ApiKey, ",") + // apiKey format: "access_key|secret_key" + keyParts := strings.Split(info.ApiKey, "|") if len(keyParts) == 2 { a.accessKey = strings.TrimSpace(keyParts[0]) a.secretKey = strings.TrimSpace(keyParts[1]) @@ -264,7 +264,7 @@ func (a *TaskAdaptor) createJWTToken() (string, error) { } func (a *TaskAdaptor) createJWTTokenWithKey(apiKey string) (string, error) { - parts := strings.Split(apiKey, ",") + parts := strings.Split(apiKey, "|") if len(parts) != 2 { return "", fmt.Errorf("invalid API key format, expected 'access_key,secret_key'") } From 58c9c7d5dd28d9e5cd039c84f789a78f661506b5 Mon Sep 17 00:00:00 2001 From: t0ng7u Date: Sat, 21 Jun 2025 21:59:38 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E2=9C=A8=20feat(settings-announcements):?= =?UTF-8?q?=20improve=20editor=20UX=20with=20modal=20&=20tooltips?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added “Expand Edit” button with `Maximize2` icon to open a large modal editor * Introduced full-screen `TextArea` modal; content syncs back to main form via Form API * Switched to correct `TextArea` import from Semi UI to fix invalid element error * Implemented ellipsis & `Tooltip` for “content” and “extra” columns to keep table concise * Added state management (`showContentModal`, `formApiRef`) and related handlers * Updated success messages & punctuation for consistency --- web/src/i18n/locales/en.json | 5 +- .../Dashboard/SettingsAnnouncements.js | 91 +++++++++++++++---- web/src/pages/Setting/index.js | 20 ++-- 3 files changed, 87 insertions(+), 29 deletions(-) diff --git a/web/src/i18n/locales/en.json b/web/src/i18n/locales/en.json index 70ce272d..4b5dfc65 100644 --- a/web/src/i18n/locales/en.json +++ b/web/src/i18n/locales/en.json @@ -1710,5 +1710,8 @@ "可信": "Reliable", "所有上游数据均可信": "All upstream data is reliable", "以下上游数据可能不可信:": "The following upstream data may not be reliable: ", - "按倍率类型筛选": "Filter by ratio type" + "按倍率类型筛选": "Filter by ratio type", + "内容": "Content", + "放大编辑": "Expand editor", + "编辑公告内容": "Edit announcement content" } \ No newline at end of file diff --git a/web/src/pages/Setting/Dashboard/SettingsAnnouncements.js b/web/src/pages/Setting/Dashboard/SettingsAnnouncements.js index c15e2885..dfbad8ee 100644 --- a/web/src/pages/Setting/Dashboard/SettingsAnnouncements.js +++ b/web/src/pages/Setting/Dashboard/SettingsAnnouncements.js @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react'; +import React, { useEffect, useState, useRef } from 'react'; import { Button, Space, @@ -9,7 +9,9 @@ import { Divider, Modal, Tag, - Switch + Switch, + TextArea, + Tooltip } from '@douyinfe/semi-ui'; import { IllustrationNoResult, @@ -20,7 +22,8 @@ import { Edit, Trash2, Save, - Bell + Bell, + Maximize2 } from 'lucide-react'; import { API, showError, showSuccess, getRelativeTime, formatDateTimeString } from '../../../helpers'; import { useTranslation } from 'react-i18next'; @@ -33,6 +36,7 @@ const SettingsAnnouncements = ({ options, refresh }) => { const [announcementsList, setAnnouncementsList] = useState([]); const [showAnnouncementModal, setShowAnnouncementModal] = useState(false); const [showDeleteModal, setShowDeleteModal] = useState(false); + const [showContentModal, setShowContentModal] = useState(false); const [deletingAnnouncement, setDeletingAnnouncement] = useState(null); const [editingAnnouncement, setEditingAnnouncement] = useState(null); const [modalLoading, setModalLoading] = useState(false); @@ -51,6 +55,8 @@ const SettingsAnnouncements = ({ options, refresh }) => { // 面板启用状态 const [panelEnabled, setPanelEnabled] = useState(true); + const formApiRef = useRef(null); + const typeOptions = [ { value: 'default', label: t('默认') }, { value: 'ongoing', label: t('进行中') }, @@ -76,13 +82,16 @@ const SettingsAnnouncements = ({ options, refresh }) => { dataIndex: 'content', key: 'content', render: (text) => ( -
- {text} -
+ +
+ {text} +
+
) }, { @@ -121,13 +130,17 @@ const SettingsAnnouncements = ({ options, refresh }) => { dataIndex: 'extra', key: 'extra', render: (text) => ( -
- {text || '-'} -
+ +
+ {text || '-'} +
+
) }, { @@ -472,7 +485,12 @@ const SettingsAnnouncements = ({ options, refresh }) => { className="rounded-xl" confirmLoading={modalLoading} > -
+ (formApiRef.current = api)} + > { rules={[{ required: true, message: t('请输入公告内容') }]} onChange={(value) => setAnnouncementForm({ ...announcementForm, content: value })} /> + { > {t('确定要删除此公告吗?')} + + {/* 公告内容放大编辑 Modal */} + { + // 将内容同步到表单 + if (formApiRef.current) { + formApiRef.current.setValue('content', announcementForm.content); + } + setShowContentModal(false); + }} + onCancel={() => setShowContentModal(false)} + okText={t('确定')} + cancelText={t('取消')} + className="rounded-xl" + width={800} + > +