chore: test by api

This commit is contained in:
jialin
2025-10-13 14:40:26 +08:00
parent 54703c67c1
commit a5c1b8e15f
29 changed files with 683 additions and 298 deletions
@@ -49,18 +49,21 @@ const Container = styled.div`
interface ImportYAMLProps {
ref?: any;
action: PageActionType;
actionStatus: {
action: PageActionType;
isBuiltIn: boolean;
};
content?: string;
onSubmit?: (content: string) => void;
}
const ImportYAML: React.FC<ImportYAMLProps> = forwardRef(
({ action, content = '' }, ref) => {
({ actionStatus, content = '' }, ref) => {
const intl = useIntl();
const { userSettings } = useUserSettings();
const editorRef = useRef<any>(null);
const [fileContent, setFileContent] = useState<string>(
action === PageAction.CREATE ? yamlTemplate : content
actionStatus.action === PageAction.CREATE ? yamlTemplate : content
);
const [error, setError] = useState<string>('');
@@ -131,6 +134,7 @@ const ImportYAML: React.FC<ImportYAMLProps> = forwardRef(
<YamlEditor
ref={editorRef}
lang="yaml"
actionStatus={actionStatus}
theme={userSettings?.isDarkTheme ? 'vs-dark' : 'vs-light'}
value={fileContent}
height={'calc(100vh - 255px)'}