Files
udmin/frontend/src/flows/components/testrun/testrun-json-input/index.tsx
ayou b0963e5e37 feat(flows): 新增流程编辑器基础功能与相关组件
feat(backend): 添加流程模型与服务支持
feat(frontend): 实现流程编辑器UI与交互
feat(assets): 添加流程节点图标资源
feat(plugins): 实现上下文菜单和运行时插件
feat(components): 新增基础节点和侧边栏组件
feat(routes): 添加流程相关路由配置
feat(models): 创建流程和运行日志数据模型
feat(services): 实现流程服务层逻辑
feat(migration): 添加流程相关数据库迁移
feat(config): 更新前端配置支持流程编辑器
feat(utils): 增强axios错误处理和工具函数
2025-09-15 00:27:13 +08:00

38 lines
847 B
TypeScript

/**
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
* SPDX-License-Identifier: MIT
*/
import { FC } from 'react';
import { CodeEditor } from '@flowgram.ai/form-materials';
import { useFormMeta, useSyncDefault } from '../hooks';
import styles from './index.module.less';
interface TestRunJsonInputProps {
values: Record<string, unknown>;
setValues: (values: Record<string, unknown>) => void;
}
export const TestRunJsonInput: FC<TestRunJsonInputProps> = ({ values, setValues }) => {
const formMeta = useFormMeta();
useSyncDefault({
formMeta,
values,
setValues,
});
return (
<div className={styles['testrun-json-input']}>
<CodeEditor
languageId="json"
value={JSON.stringify(values, null, 2)}
onChange={(value) => setValues(JSON.parse(value))}
/>
</div>
);
};