chore: replace all cn comments of fe to en version by volc api (#320)
This commit is contained in:
@@ -21,25 +21,25 @@ import { type DynamicParams } from '@coze-arch/bot-typings/teamspace';
|
||||
import { MemoryApi } from '@coze-arch/bot-api';
|
||||
|
||||
/**
|
||||
* 已经迁移的旧渠道 id 到新渠道 id 的映射
|
||||
* key(旧) -> value(新)
|
||||
* Mapping of migrated old channel IDs to new channel IDs
|
||||
* Key (old) - > value (new)
|
||||
*/
|
||||
const migratedConnectorIds: Record<string, string | undefined> = {
|
||||
// 微信服务号
|
||||
// WeChat service account
|
||||
'10000114': '10000120',
|
||||
// 微信订阅号
|
||||
// WeChat subscribed account
|
||||
'10000115': '10000121',
|
||||
};
|
||||
|
||||
export interface ConnectorOption {
|
||||
label: string;
|
||||
value: string;
|
||||
/** 该渠道 id 是否已经迁移 */
|
||||
/** Has the channel ID been migrated? */
|
||||
migrated?: boolean;
|
||||
}
|
||||
|
||||
export interface UseConnectorOptionsParams {
|
||||
/** 是否包含已迁移的旧渠道,默认不包含 */
|
||||
/** Whether to include the old channels that have been migrated, not by default */
|
||||
includeMigrated?: boolean;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ export function useConnectorOptions({
|
||||
includeMigrated = false,
|
||||
}: UseConnectorOptionsParams = {}): ConnectorOption[] {
|
||||
const { space_id } = useParams<DynamicParams>();
|
||||
// 资源库 workflow 页面的 url 上没有 space_id 参数,需要从 searchParams 中获取
|
||||
// There is no space_id parameter on the url of the library workflow page, you need to get it from searchParams
|
||||
const [searchParams] = useSearchParams();
|
||||
const spaceId = space_id ?? searchParams.get('space_id') ?? '';
|
||||
const { data } = useRequest(
|
||||
@@ -73,7 +73,7 @@ export function useConnectorOptions({
|
||||
},
|
||||
{
|
||||
refreshDeps: [spaceId],
|
||||
// 设置缓存 key, 防止重复请求
|
||||
// Set cache key to prevent duplicate requests
|
||||
cacheKey: `db_connector_name_${spaceId}`,
|
||||
},
|
||||
);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import { DataNamespace, dataReporter } from '@coze-data/reporter';
|
||||
@@ -55,7 +55,7 @@ export const useExpertModeConfig = (params: {
|
||||
res = await MemoryApi.GetModeConfig({
|
||||
bot_id: botId,
|
||||
});
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- 复制历史文件
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Copy history file
|
||||
} catch (error: any) {
|
||||
dataReporter.errorEvent(DataNamespace.DATABASE, {
|
||||
eventName: REPORT_EVENTS.DatabaseGetExpertConfig,
|
||||
|
||||
@@ -19,7 +19,7 @@ import { useRef } from 'react';
|
||||
import { type TableData } from '../components/database-table-data/type';
|
||||
|
||||
export const useGetTableInstantaneousData = (tableData: TableData) => {
|
||||
// 缓存 Data 数据,用于在事件中获取数据
|
||||
// Cache data for fetching data in events
|
||||
const dataRef = useRef<TableData>(tableData);
|
||||
dataRef.current = tableData;
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ export const useLibraryCreateDatabaseModal = ({
|
||||
const { id, draft_id } = createRes.database_info ?? {};
|
||||
if (id && draft_id) {
|
||||
if (onFinish) {
|
||||
// bot 绑定数据库需要 draft_id ,其他场景一般只需要用 id
|
||||
// Bot binding database needs draft_id, other scenarios generally only need to use id
|
||||
onFinish(id, draft_id);
|
||||
return;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user