chore: replace all cn comments of fe to en version by volc api (#320)
This commit is contained in:
@@ -78,7 +78,7 @@ export const ConnectorField = (props: ConnectorFieldProps) => {
|
||||
}
|
||||
|
||||
function createRules(fieldSchema: FormSchemaItem): RuleItem[] {
|
||||
// 确保 formItemSchema.rules 是一个数组
|
||||
// Make sure formItemSchema.rules is an array
|
||||
const itemRules = fieldSchema.rules ?? [];
|
||||
|
||||
const rules = itemRules.map(rule => {
|
||||
@@ -91,7 +91,7 @@ export const ConnectorField = (props: ConnectorFieldProps) => {
|
||||
return { ...rule, ...(ruleMessage && { message: ruleMessage }) };
|
||||
});
|
||||
|
||||
// 添加 'required' 规则
|
||||
// Add'required 'rule
|
||||
rules.push({
|
||||
required: fieldSchema.required,
|
||||
message: I18n.t('bot_publish_field_placeholder', {
|
||||
@@ -116,7 +116,7 @@ export const ConnectorField = (props: ConnectorFieldProps) => {
|
||||
logger.error({ error: e as Error });
|
||||
values = [];
|
||||
}
|
||||
// 添加一个默认空值
|
||||
// Add a default null value
|
||||
if (!values.length) {
|
||||
values.push('');
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ export interface ConnectorFormProps {
|
||||
|
||||
const DEFAULT_FORM_STEP = 2;
|
||||
|
||||
// 多选 Select 在 Form 中的 value 是 string[],但提交到后端需要转换成 JSON string
|
||||
// Multiple Select The value in the Form is string [], but it needs to be converted to a JSON string when submitted to the backend.
|
||||
type FormValues = Record<string, string | string[]>;
|
||||
|
||||
export const ConnectorForm = forwardRef(
|
||||
@@ -75,7 +75,7 @@ export const ConnectorForm = forwardRef(
|
||||
}));
|
||||
|
||||
useEffect(() => {
|
||||
// 解决formApiRef.current取值不实时问题
|
||||
// Solve the problem that the value of formApiRef.current is not real-time
|
||||
update();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps -- ignore
|
||||
}, [schemaAreaInfo]);
|
||||
|
||||
@@ -34,7 +34,7 @@ export const ConnectorLink = ({
|
||||
botId: string;
|
||||
initValue?: TFormData;
|
||||
}) => {
|
||||
//支持通配URL
|
||||
//Support for wildcard URLs
|
||||
const formatUrl = (url?: string) => {
|
||||
let newUrl = url ?? '';
|
||||
if (newUrl) {
|
||||
|
||||
@@ -87,7 +87,7 @@ export const useConnectorFormModal = ({
|
||||
if (onUnbind) {
|
||||
onUnbind();
|
||||
} else {
|
||||
// 兼容历史逻辑,未传入 onUnbind 时,解绑后也调用 onSuccess
|
||||
// Compatible with historical logic, when onUnbind is not passed in, onSuccess is also called after unbinding.
|
||||
onSuccess({
|
||||
...(initValue as BotPublishConnectorInfo),
|
||||
bind_info: {},
|
||||
@@ -138,9 +138,9 @@ export const useConnectorFormModal = ({
|
||||
const { schema_area_pages: schemaPages = [] } = connectorConfigInfo ?? {};
|
||||
|
||||
const bindCb = (data: BindConnectorResponse) => {
|
||||
/** 适用Kv+Auth授权场景:KvAuthBind = 4
|
||||
* reddit渠道:若成功返回client_id,则覆盖auth_login_info中的client_id,并附带加密state跳转授权页面
|
||||
* 其余渠道:若成功返回auth_params,则合并auth_login_info作为授权链接参数跳转
|
||||
/** Applicable to Kv + Auth authorization scenarios: KvAuthBind = 4
|
||||
* Reddit channel: If the client_id is successfully returned, the client_id in the auth_login_info will be overwritten and the encrypted state jump authorization page will be attached
|
||||
* Other channels: If the auth_params is successfully returned, the merge auth_login_info jump as the authorization link parameter
|
||||
* */
|
||||
if (
|
||||
initValue?.bind_type === BindType.KvAuthBind &&
|
||||
@@ -254,7 +254,7 @@ export const useConnectorFormModal = ({
|
||||
{schemaPages?.length &&
|
||||
step !== 0 &&
|
||||
schemaPages[step]?.api_action !== SchemaAreaPageApi.NotQuery ? (
|
||||
// 页面按钮不执行任何操作时 不展示上一步
|
||||
// When the page button does not perform any action, the previous step is not displayed
|
||||
<UIButton
|
||||
theme="solid"
|
||||
onClick={() => {
|
||||
|
||||
Reference in New Issue
Block a user