mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-25 11:29:39 +08:00
fix: linter error
This commit is contained in:
@@ -113,4 +113,4 @@
|
||||
height: 100%;
|
||||
width: 3rem;
|
||||
gap: 0.4rem;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,11 +25,11 @@ export default function N8nAuthFormComponent({
|
||||
}: {
|
||||
itemConfigList: IDynamicFormItemSchema[];
|
||||
onSubmit?: (val: object) => unknown;
|
||||
initialValues?: Record<string, any>;
|
||||
initialValues?: Record<string, string>;
|
||||
}) {
|
||||
// 当前选择的认证类型
|
||||
const [authType, setAuthType] = useState<string>(
|
||||
initialValues?.['auth-type'] || 'none'
|
||||
initialValues?.['auth-type'] || 'none',
|
||||
);
|
||||
|
||||
// 根据 itemConfigList 动态生成 zod schema
|
||||
@@ -111,7 +111,7 @@ export default function N8nAuthFormComponent({
|
||||
acc[item.name] = initialValues[item.name] ?? item.default;
|
||||
return acc;
|
||||
},
|
||||
{} as Record<string, any>,
|
||||
{} as Record<string, string>,
|
||||
);
|
||||
|
||||
Object.entries(mergedValues).forEach(([key, value]) => {
|
||||
@@ -119,7 +119,7 @@ export default function N8nAuthFormComponent({
|
||||
});
|
||||
|
||||
// 更新认证类型
|
||||
setAuthType(mergedValues['auth-type'] as string || 'none');
|
||||
setAuthType((mergedValues['auth-type'] as string) || 'none');
|
||||
}
|
||||
}, [initialValues, form, itemConfigList]);
|
||||
|
||||
@@ -138,9 +138,9 @@ export default function N8nAuthFormComponent({
|
||||
acc[item.name] = formValues[item.name] ?? item.default;
|
||||
return acc;
|
||||
},
|
||||
{} as Record<string, any>,
|
||||
{} as Record<string, string>,
|
||||
);
|
||||
|
||||
|
||||
onSubmit?.(finalValues);
|
||||
});
|
||||
return () => subscription.unsubscribe();
|
||||
@@ -149,7 +149,11 @@ export default function N8nAuthFormComponent({
|
||||
// 根据认证类型过滤表单项
|
||||
const filteredConfigList = itemConfigList.filter((config) => {
|
||||
// 始终显示webhook-url、auth-type、timeout和output-key
|
||||
if (['webhook-url', 'auth-type', 'timeout', 'output-key'].includes(config.name)) {
|
||||
if (
|
||||
['webhook-url', 'auth-type', 'timeout', 'output-key'].includes(
|
||||
config.name,
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -197,4 +201,4 @@ export default function N8nAuthFormComponent({
|
||||
</div>
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,4 +97,4 @@
|
||||
font-size: 1.4rem;
|
||||
font-weight: bold;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,10 +203,10 @@ export interface MarketPluginResponse {
|
||||
}
|
||||
|
||||
interface GetPipelineConfig {
|
||||
ai: {};
|
||||
output: {};
|
||||
safety: {};
|
||||
trigger: {};
|
||||
ai: object;
|
||||
output: object;
|
||||
safety: object;
|
||||
trigger: object;
|
||||
}
|
||||
|
||||
interface GetPipeline {
|
||||
|
||||
Reference in New Issue
Block a user