chore: replace all cn comments of fe to en version by volc api (#320)

This commit is contained in:
tecvan
2025-07-31 10:32:15 +08:00
committed by GitHub
parent 716ec0cba8
commit 71f6245a01
2960 changed files with 15545 additions and 15545 deletions

View File

@@ -52,17 +52,17 @@ export default function Coachmark({
const initVisible = async (cid: string) => {
const coachMarkStorage =
await localStorageService.getValueSync(COACHMARK_KEY);
// readStep 代表已读的step index
// readStep represents the read step index
const readStep = (
typeSafeJSONParse(coachMarkStorage) as Record<string, number> | undefined
)?.[cid];
// 如果没有读过或者读过的step index 小于当前项的index则展示。
// Displays if it has not been read, or if the read step index is less than the index of the current item.
const shouldShow = readStep === undefined || itemIndex > readStep;
setVisible(shouldShow);
};
// 设置已读的step index
// Set the read step index
const setCoachmarkReadStep = useCallback(
(step: number) => {
const coachmarkStorage =
@@ -73,7 +73,7 @@ export default function Coachmark({
number | undefined
>;
// 如果没有读过或者要设置的index大于已读的step index 才设置,否则忽略。
// If it has not been read, or the index to be set is greater than the read step index, otherwise it is ignored.
if (
coachmarkValue[caseId] === undefined ||
step > Number(coachmarkValue[caseId])
@@ -99,7 +99,7 @@ export default function Coachmark({
)
) {
const nextIndex = index + (action === ACTIONS.PREV ? -1 : 1);
// 设置已经读过的step index
// Set the step index that has been read
setCoachmarkReadStep(index);
setStepIndex(nextIndex);
}
@@ -150,7 +150,7 @@ export default function Coachmark({
padding: 0,
},
buttonBack: {
display: 'none', // 隐藏返回按钮
display: 'none', // Hide back button
},
}}
floaterProps={{

View File

@@ -1,4 +1,4 @@
/** 基本组件样式 */
/** basic component style */
.dot {
width: 4px;
height: 4px;
@@ -26,7 +26,7 @@
}
}
/** 业务组件样式 */
/** Business Component Style */
.half-top-root {
flex: 1;
position: relative;

View File

@@ -184,7 +184,7 @@ export default function LevelLine({
style,
multiInfo = { multiline: false },
}: LevelLineProps) {
// getLineShowResult 返回数据,暂时没涉及到 root 画线
// getLineShowResult returns data, no root drawing is involved for the time being
const lineShowResult = getLineShowResult({ level, data });
const showMap: Record<LineShowResult, React.ReactNode> = {
[LineShowResult.HalfTopRoot]: (
@@ -203,7 +203,7 @@ export default function LevelLine({
[LineShowResult.FullRootWithChildren]: (
<FullRootWithChildren className={className} style={style} />
),
// output tree 中,暂时没涉及到 root 画线
// In the output tree, there is no root drawing involved for the time being
[LineShowResult.HalfTopChild]: (
<HalfTopChild
className={classNames(

View File

@@ -56,7 +56,7 @@ export default function ParamDescription({
)}
value={data.description}
ellipsis={true}
// 好像不生效
// It doesn't seem to work.
disabled={disabled}
handleBlur={() => {
setInputFocus(false);

View File

@@ -48,7 +48,7 @@ export default function ParamOperator({
}: ParamOperatorProps) {
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
const isLimited = level >= 3;
// 是否展示新增子项的按钮
// Whether to display the button for adding a child item
const needRenderAppendChild =
ObjectLikeTypes.includes(data.type) && !isLimited;
const computedOperatorStyle = (): React.CSSProperties => {

View File

@@ -34,7 +34,7 @@ interface ParamTypeProps {
level: number;
onSelectChange?: SelectProps['onChange'];
disabled?: boolean;
// 不支持使用的类型
// Types not supported
disabledTypes?: ParamTypeAlias[];
}

View File

@@ -54,8 +54,8 @@ export type WorkflowSLTextAreaProps = ComponentProps<typeof TextArea> & {
};
/**
* @component TextArea Workflow 场景下的二次封装;
* focus(inputting) 的时候提供多行滚动输入能力blur 的时候提供 ellipsis tooltip 提示能力
* @Component TextArea secondary encapsulation in Workflow scenarios;
* When focusing (inputting), it provides multi-line scrolling input capability, and when blur, it provides ellipsis and tooltip prompt capability.
*/
export default function WorkflowSLTextArea(props: WorkflowSLTextAreaProps) {
const { ellipsis = true } = props;
@@ -84,7 +84,7 @@ export default function WorkflowSLTextArea(props: WorkflowSLTextAreaProps) {
$state.inputOnFocus = false;
props?.handleBlur?.($state.value || '');
props?.onBlur?.(e);
// 失焦的时候,滚动到最顶端
// When out of focus, scroll to the top
if (textAreaRef?.current) {
textAreaRef.current.scrollTop = 0;
}
@@ -95,7 +95,7 @@ export default function WorkflowSLTextArea(props: WorkflowSLTextAreaProps) {
props?.handleChange?.(v);
};
// 输入法输入结束
// Input method input end
const onCompositionEnd = (e: React.CompositionEvent<HTMLTextAreaElement>) => {
const target = e.target as HTMLTextAreaElement;
@@ -126,7 +126,7 @@ export default function WorkflowSLTextArea(props: WorkflowSLTextAreaProps) {
$state.value = props.value;
}, [props.value]);
/** 是否处于失焦缩略状态 */
/** Is it in an out-of-focus thumbnail state? */
const ellipsisWithBlur = useMemo(
() => !$state.inputOnFocus && hasEllipsis,
[hasEllipsis, $state.inputOnFocus],

View File

@@ -36,10 +36,10 @@ import styles from './index.module.less';
export interface CustomTreeNodeProps extends RenderFullLabelProps {
onChange: (mode: ChangeMode, param: TreeNodeCustomData) => void;
// Description 组件变换为多行时,其下面第一个 child 需被记录
// When the Description component is transformed into multiple rows, the first child below it needs to be recorded
onActiveMultiInfoChange?: (info: ActiveMultiInfo) => void;
activeMultiInfo?: ActiveMultiInfo;
// 不支持使用的类型
// Types not supported
disabledTypes?: ParamTypeAlias[];
}
@@ -59,7 +59,7 @@ export default function CustomTreeNode(props: CustomTreeNodeProps) {
} = props;
const { allowValueEmpty, readonly, hasObjectLike, withDescription } =
useConfig();
// 当前值
// current value
const value = data as TreeNodeCustomData;
const isTopLevel = level === 0;
const isOnlyOneData = value.isSingle && isTopLevel;
@@ -71,15 +71,15 @@ export default function CustomTreeNode(props: CustomTreeNodeProps) {
const disableDelete = Boolean(
!allowValueEmpty && isOnlyOneData && isTopLevel,
);
// 删除时
// When deleting
const onDelete = () => {
onChange(ChangeMode.Delete, value);
};
// 新增子项时
// When adding a child
const onAppend = () => {
onChange(ChangeMode.Append, value);
};
// 类型切换时
// When switching types
const onSelectChange = (
val?: string | number | Array<unknown> | Record<string, unknown>,
) => {
@@ -90,7 +90,7 @@ export default function CustomTreeNode(props: CustomTreeNodeProps) {
if (isNumber(val)) {
const isObjectLike = ObjectLikeTypes.includes(val);
if (!isObjectLike) {
// 如果不是类Object判断是否有children如果有删除掉
// If it is not a class Object, determine whether there are children. If so, delete it
if (value.children && value.children.length > 0) {
delete value.children;
}
@@ -99,14 +99,14 @@ export default function CustomTreeNode(props: CustomTreeNodeProps) {
onChange(ChangeMode.Update, { ...value, type: val });
}
// 更新type
// Update type
};
// 更新
// update
const onNameChange = (name: string) => {
onChange(ChangeMode.Update, { ...value, name });
};
// 更新
// update
const onDescriptionChange = useCallback(
(description: string) => {
onChange(ChangeMode.Update, { ...value, description });
@@ -115,7 +115,7 @@ export default function CustomTreeNode(props: CustomTreeNodeProps) {
);
/**
* Description 组件单行 / 多行变换时,其下面第一个 child 的竖线需要缩短 / 延长
* Description When the component converts single/multiple rows, the vertical line of the first child below it needs to be shortened/lengthened
*/
const onDescriptionLineChange = useCallback(
(type: DescriptionLine) => {
@@ -140,7 +140,7 @@ export default function CustomTreeNode(props: CustomTreeNodeProps) {
if (readonly) {
return (
// 提高class的css 权重
// Increase the CSS weight of the class
<div
className={classNames(
styles['readonly-icon-container'],
@@ -170,7 +170,7 @@ export default function CustomTreeNode(props: CustomTreeNodeProps) {
})}
ref={treeNodeRef}
>
{/* 每增加一级多15长度 */}
{/* 15 more lengths for each additional level */}
<div
style={{ width: IndentationWidth }}
className={styles['level-icon']}
@@ -196,7 +196,7 @@ export default function CustomTreeNode(props: CustomTreeNodeProps) {
level={level}
disabledTypes={disabledTypes}
/>
{/* LLM 节点输出才有 description */}
{/* The LLM node output has a description. */}
{withDescription ? (
<ParamDescription
data={value}

View File

@@ -29,22 +29,22 @@ export type TreeNodeCustomData = TreeNodeData &
| 'quotedValue'
| 'fieldRandomKey'
> & {
// 行唯一值
// row unique value
key: string;
// Formfield
// Formed fields
field?: string;
// 是否是第一项
// Is it the first item?
isFirst?: boolean;
// 是否是最后一项
// Is it the last item?
isLast?: boolean;
// 是否只有该项一条数据
// Is there only one item of data?
isSingle?: boolean;
// 该项的嵌套层级从0开始
// The nesting level of the item, starting at 0
level?: number;
// 辅助线展示的字段
// Fields displayed by the auxiliary line
helpLineShow?: Array<boolean>;
children?: Array<TreeNodeCustomData>;
// 变量描述,用于作为隐藏的引导
// Variable descriptions, used as hidden bootstraps
description?: string;
};
@@ -52,24 +52,24 @@ export interface CustomTreeNodeFuncRef {
data: TreeNodeCustomData;
level: number;
readonly: boolean;
// 通用change方法
// General change method
onChange: (mode: ChangeMode, param: TreeNodeCustomData) => void;
// 定制的类型改变的change方法主要用于自定义render使用
// 添加子项
// Customized type change method, mainly used for custom rendering
// Add child item
onAppend: () => void;
// 删除该项
// Delete this item
onDelete: () => void;
// 删除该项下面的所有子项
// Delete all children under this item
onDeleteChildren: () => void;
// 类型改变时内部的调用方法主要用于从类Object类型转为其他类型时需要删除所有子项
// The internal call method when the type changes, mainly used to delete all children when converting from the class Object type to other types
onSelectChange: (
val?: string | number | Array<unknown> | Record<string, unknown>,
) => void;
}
export interface ActiveMultiInfo {
// 当前行是否处于多行状态,多行状态竖线需要延长
// Whether the current line is in a multi-line state, and the vertical line in the multi-line state needs to be extended
activeMultiKey: string;
// 当前行paramName数据是否出现错误信息
// Is there an error message for the current row paramName data?
withNameError?: boolean;
}

View File

@@ -67,7 +67,7 @@ export default function Header() {
</span>
</div>
{/* description 目前只在 LLM output 中存在 */}
{/* Description currently only exists in LLM output */}
{withDescription ? (
<div className={styles.description}>
<span className={styles.text}>

View File

@@ -15,12 +15,12 @@
*/
/* eslint-disable @typescript-eslint/naming-convention */
// 类型选择控件基础宽度
// Type selection control base width
export const OperatorTypeBaseWidth = 155;
// 61 = 删除按钮 + 添加按钮 的上层容器宽度
// 61 = Remove button + Add button, upper container width
export const OperatorLargeSize = 61;
// 31 = 删除按钮 的上层容器宽度
// 31 = Remove button, upper container width
export const OperatorSmallSize = 31;
// 8 = 删除按钮与变量类型中间的 margin 距离
// 8 = Remove the margin distance between the button and the variable type
export const SpacingSize = 8;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable @coze-arch/max-line-per-function */
import React, { type PropsWithChildren, useState } from 'react';
@@ -56,26 +56,26 @@ export function Parameters(props: PropsWithChildren<ParametersProps>) {
allowValueEmpty = true,
onChange,
} = props;
// 监听该值的变化
// Monitor for changes in this value
const isValueEmpty = !value || value.length === 0;
const { data: formattedTreeData, hasObjectLike } = formatTreeData(
cloneDeep(value) as TreeNodeCustomData[],
);
/**
* 表示当前哪一行的父亲节点的 description 处于多行状态(LLM节点)
* 用于渲染树形竖线,处于多行文本的下一行竖线应该延长
* param name 有错误信息,竖线从错误信息下方延展,长度有所变化
* The description of the parent node of which row is currently in a multi-row state (LLM node)
* For rendering tree vertical lines, the next vertical line in multiple lines of text should be extended
* If the param name has an error message, the vertical bar extends below the error message and the length changes
*/
const [activeMultiInfo, setActiveMultiInfo] = useState<ActiveMultiInfo>({
activeMultiKey: '',
});
// 该组件的 change 方法
// How to change this component
const onValueChange = (freshValue?: Array<TreeNodeCustomData>) => {
if (onChange) {
freshValue = (freshValue || []).concat([]);
// 清理掉无用字段
// Clean up useless fields
traverse<TreeNodeCustomData>(freshValue, node => {
const { key, name, type, description, children } = node;
// eslint-disable-next-line guard-for-in
@@ -95,9 +95,9 @@ export function Parameters(props: PropsWithChildren<ParametersProps>) {
}
};
// 树节点的 change 方法
// Tree node change method
const onTreeNodeChange = (mode: ChangeMode, param: TreeNodeCustomData) => {
// 先clone一份因为Tree内部会对treeData执行isEqual克隆一份一定是false
// Clone one first, because the Tree will execute isEqual on treeData, cloning one must be false.
const cloneDeepTreeData = cloneDeep(
formattedTreeData,
) as Array<TreeNodeCustomData>;
@@ -108,13 +108,13 @@ export function Parameters(props: PropsWithChildren<ParametersProps>) {
if (findResult) {
switch (mode) {
case ChangeMode.Append: {
// 新增不可以用 parentData 做标准,要在当前 data 下新增
// You can't use parentData as a standard for adding, you need to add it under the current data.
const { data } = findResult;
const currentChildren = data.children || [];
// @ts-expect-error 有些值不需要此时指定,因为在 rerender 的时候会执行 format
// @ts-expect-error Some values do not need to be specified at this time because format is executed during rerender
data.children = currentChildren.concat({
...getDefaultAppendValue(),
// 增加 field
// Add field
field: `${data.field}.children[${currentChildren.length}]`,
});
onValueChange(cloneDeepTreeData);

View File

@@ -19,10 +19,10 @@ export enum ParamTypeAlias {
Integer,
Boolean,
Number,
/** 理论上没有 List 了,此项仅作兼容 */
/** Theoretically there is no List, this item is only for compatibility */
List = 5,
Object = 6,
// 上面是 api 中定义的 InputType。下面是整合后的。从 99 开始,避免和后端定义撞车
// The above is the InputType defined in the api. The following is the integrated one. Start from 99 to avoid collisions with the backend definition.
ArrayString = 99,
ArrayInteger,
ArrayBoolean,
@@ -51,20 +51,20 @@ export enum ParamValueType {
export interface RecursedParamDefinition {
name?: string;
/** Tree 组件要求每一个节点都有 key而 key 不适合用名称(前后缀)等任何方式赋值,最终确定由接口转换层一次性提供随机 key */
/** The Tree component requires each node to have a key, and the key is not suitable for assignment in any way such as name (before and after). Finally, the interface conversion layer provides a random key at one time. */
fieldRandomKey?: string;
desc?: string;
required?: boolean;
type: ParamTypeAlias;
children?: RecursedParamDefinition[];
// region 参数值定义
// 输入参数的值可以来自上游变量引用,也可以是用户输入的定值(复杂类型则只允许引用)
// 如果是定值,传 fixedValue
// 如果是引用,传 quotedValue
// Region parameter value definition
// The value of the input parameter can come from an upstream variable reference, or it can be a fixed value entered by the user (for complex types, only references are allowed).
// If it is a fixed value, pass the fixedValue.
// If it is a reference, pass the quotedValue.
isQuote?: ParamValueType;
/** 参数定值 */
/** parameter setting */
fixedValue?: string;
/** 参数引用 */
/** parameter reference */
quotedValue?: [nodeId: string, ...path: string[]]; // string[]
// endregion
}
@@ -89,9 +89,9 @@ export interface ParametersProps {
className?: string;
style?: React.CSSProperties;
withDescription?: boolean;
// 不支持使用的类型
// Types not supported
disabledTypes?: ParamTypeAlias[];
errors?: ParametersError[];
// 支持空值 & 空数组
// Support null value & empty array
allowValueEmpty?: boolean;
}

View File

@@ -17,9 +17,9 @@
import { isFunction } from 'lodash-es';
/**
* 将 { value: label } 形式的结构体转成Select需要的options Array<{ label, value }>
* computedValue将value值转化一次作为options的value
* passItem判断当前value值是否需要跳过遍历
* Convert a structure of the form {value: label} into the options Array < {label, value} > required by Select
* computedValue: Convert the value value once as the value of options
* passItem: Determine whether the current value needs to skip the traversal
*/
export default function convertMaptoOptions<Value = number>(
map: Record<string, unknown>,
@@ -27,9 +27,9 @@ export default function convertMaptoOptions<Value = number>(
computedValue?: (val: unknown) => Value;
passItem?: (val: unknown) => boolean;
/**
* 由于 i18n 的实现方式问题,写成常量的文案需要惰性加载
* 因此涉及到 i18n 的 { value: label } 结构一律需要写成 { value: () => label }
* 该属性启用时,会额外进行一次惰性加载
* Due to the implementation of i18n, the copy written as a constant needs to be loaded lazily
* Therefore, the {value: label} structure involving i18n needs to be written as {value : () => label}
* When this property is enabled, an additional lazy load is performed
* @default false
* @link
*/

View File

@@ -32,7 +32,7 @@ interface ChildrenFindResult {
export type FindDataResult = RootFindResult | ChildrenFindResult | null;
/**
* 根据target数组找到key在该项的值和位置主要是获取位置方便操作parent的children
* According to the target array, find the value and position of the key in the item, mainly to obtain the position, which is convenient for operating the children of the parent.
*/
export function findCustomTreeNodeDataResult(
target: Array<TreeNodeCustomData>,
@@ -40,7 +40,7 @@ export function findCustomTreeNodeDataResult(
): FindDataResult {
const dataInRoot = target.find(item => item.field === findField);
if (dataInRoot) {
// 如果是根节点
// If it is the root node
return {
isRoot: true,
parentData: null,
@@ -87,7 +87,7 @@ export function formatTreeData(data: Array<TreeNodeCustomData>) {
function resolveActionParamList(
list: Array<TreeNodeCustomData>,
field: string,
// 主要是用来辅助展示线的判断的
// It is mainly used to assist the judgment of the display line.
{
parentData,
level,
@@ -99,16 +99,16 @@ export function formatTreeData(data: Array<TreeNodeCustomData>) {
list?.forEach((item, index) => {
const keyField = field ? `${field}.${index}` : `${index}`;
hasObjectLike = hasObjectLike || ObjectLikeTypes.includes(item.type);
// 赋值children
// Assignment children
item.key = item.key ?? item.fieldRandomKey ?? nanoid();
item.field = keyField;
item.isFirst = index === 0;
item.isLast = index === list.length - 1;
item.isSingle = item.isFirst && item.isLast;
item.level = level;
// 第一级不展示辅助线,需要判断level
// 也就是第二级level = 1只需要自身的层级线
// 在第三级level = 2之后需要辅助线展示上一级的辅助线
// The first level does not show the auxiliary line, you need to judge the level
// That is, the second level (level = 1) only needs its own level line
// After the third level (level = 2), the guide line is required to show the guide line of the previous level
item.helpLineShow =
parentData && level >= MAX_LINE_LEVEL
? (parentData.helpLineShow || []).concat(!parentData.isLast)
@@ -165,7 +165,7 @@ export function getLineShowResult({
item ? LineShowResult.HelpLineBlock : LineShowResult.EmptyBlock,
) || [];
const isRoot = isRootWithoutChildren || isRootWithChildren;
// 根节点不需要展示线,只有非根节点才需要辅助线
// The root node does not need a display line, only non-root nodes need auxiliary lines.
if (!isRoot) {
if (isChildWithChildren) {
if (data.isLast) {

View File

@@ -55,7 +55,7 @@ interface AutoGenerateProps {
};
showAiAvatar: boolean;
/**
* 最多允许多少个候选
* How many candidates are allowed at most?
* @default 5
*/
maxCandidateCount?: number;
@@ -66,7 +66,7 @@ interface PictureItem {
uid: string;
}
// 自动生成头像错误码
// Automatically generate avatar error codes
enum ErrorCode {
OVER_QUOTA_PER_DAY = 700012034,
CONTENT_NOT_LEGAL = 700012050,
@@ -177,7 +177,7 @@ export const AutoGenerate = (props: AutoGenerateProps) => {
});
const codeNumber = Number((error as { code: number })?.code);
if (codeNumber === ErrorCode.OVER_QUOTA_PER_DAY) {
// 超过单日次数上限
// Exceeding the maximum number of times a day
setTotalCount(MAX_TOTAL_COUNT);
Toast.error({
content: I18n.t('bot_edit_profile_pircture_autogen_quota_tooltip'),
@@ -213,7 +213,7 @@ export const AutoGenerate = (props: AutoGenerateProps) => {
};
useEffect(() => {
// 获取当日总生成次数
// Get the total number of spawns for the day
DeveloperApi.GetGenerateIconInfo()
.then(({ data }) => {
setTotalCount(Number(data?.current_day_count));
@@ -274,7 +274,7 @@ export const AutoGenerate = (props: AutoGenerateProps) => {
[s['loading-hover']]: loadingHover && !picture.url,
})}
>
{/* 二次hover展示取消 */}
{/* Secondary hover display cancelled */}
{hoverCount.current > 1 && loadingHover && !picture.url ? (
<div
className={s.mask}
@@ -287,7 +287,7 @@ export const AutoGenerate = (props: AutoGenerateProps) => {
</div>
) : null}
{/* 选中图片蒙版 */}
{/* Select image mask */}
{checkedId === idx && (
<div className={s.mask}>
<IconCozCheckMark className="text-[16]" />

View File

@@ -65,12 +65,12 @@ interface PackageUploadProps {
triggerClassName?: string;
maskIcon?: React.ReactNode;
/**
* 编辑遮罩的展示模式
* - full-center(默认): 整体覆盖黑色透明遮罩, Icon 居中展示. hover 展示
* - right-bottom: 右下角遮罩, 长期展示
* Edit the display mode of the mask
* - full-center (default): overall cover black transparent mask, Icon centered show.hover display
* - right-bottom: lower right masking, long display
*/
maskMode?: 'full-center' | 'right-bottom';
/** 编辑遮罩的 className */
/** Edit the className of the mask */
editMaskClassName?: string;
/** max size */
maxSize?: number;
@@ -81,7 +81,7 @@ interface PackageUploadProps {
contentNotLegalText?: string;
};
/**
* 自动生成的最大候选数量
* Maximum number of candidates automatically generated
* @default 5
*/
maxCandidateCount?: number;
@@ -91,14 +91,14 @@ interface PackageUploadProps {
onGenerateStaticImageClick?: React.MouseEventHandler<HTMLButtonElement>;
onGenerateGifClick?: React.MouseEventHandler<HTMLButtonElement>;
onSizeError?: () => void;
// 自定义自定生成图片逻辑
// Custom custom generated image logic
renderAutoGenerate?: (params: RenderAutoGenerateParams) => React.ReactNode;
testId?: string;
}
// eslint-disable-next-line @coze-arch/max-line-per-function
const _PictureUpload = (props: PackageUploadProps) => {
// 业务
// business
const {
onChange,
value,
@@ -225,7 +225,7 @@ const _PictureUpload = (props: PackageUploadProps) => {
return;
}
Toast.error({
// starling 切换
// Starling toggle
content: I18n.t(
'dataset_upload_image_warning',
{},

View File

@@ -54,11 +54,11 @@ function customUploadRequest(
try {
const { fileInstance } = file;
// 业务
// business
if (fileInstance) {
const extension = getFileExtension(file.name);
// 业务
// business
(async () => {
try {
const base64 = await getBase64(fileInstance);
@@ -72,7 +72,7 @@ function customUploadRequest(
onSuccess?.(result.data);
afterUploadCustom?.();
} catch (error) {
// 如参数校验失败情况会走到catch
// If parameter validation fails, it will go to catch.
afterUploadCustom?.();
}
})();

View File

@@ -64,10 +64,10 @@ export const IntelligenceList: React.FC<IntelligenceListProps> = ({
return (
<div className="relative h-full">
{/* 上遮罩 */}
{/* upper mask */}
<div className="sticky top-0 left-0 right-0 h-[20px] bg-gradient-to-b from-[rgba(255,255,255,1)] to-transparent pointer-events-none z-10" />
{/* 列表内容 */}
{/* list content */}
<div className="styled-scrollbar">
{data.list.map(intelligence => (
<IntelligenceItem
@@ -90,7 +90,7 @@ export const IntelligenceList: React.FC<IntelligenceListProps> = ({
) : null}
</div>
{/* 下遮罩 */}
{/* lower mask */}
<div className="sticky bottom-0 left-0 right-0 h-[20px] bg-gradient-to-t from-[rgba(255,255,255,1)] to-transparent pointer-events-none z-10" />
</div>
);

View File

@@ -50,7 +50,7 @@ export const intelligenceSearchService = {
},
});
const intelligenceList = resp?.data?.intelligences ?? [];
// 只保留single mode bot
// Keep only single mode bots
const singleModeBotList = intelligenceList.filter(
intelligence => intelligence.other_info?.bot_mode === BotMode.SingleMode,
);

View File

@@ -68,7 +68,7 @@ export const UpdateUserAvatar = forwardRef(
const { fileInstance } = file;
if (fileInstance) {
// 业务
// business
const resp = await uploadAvatar(fileInstance);
onChange?.(resp.web_uri);
onUpdateSuccess?.(resp.web_uri);