feat(client): support json input in variable input (#5453)

This commit is contained in:
Junyi 2024-10-18 22:58:48 +08:00 committed by GitHub
parent 012f648bb2
commit cdc2d62842
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,6 +21,7 @@ import { useTranslation } from 'react-i18next';
import { useCompile } from '../../hooks';
import { XButton } from './XButton';
import { useStyles } from './style';
import { Json } from '../input';
const JT_VALUE_RE = /^\s*{{\s*([^{}]+)\s*}}\s*$/;
@ -124,6 +125,14 @@ const ConstantTypes = {
return null;
},
},
object: {
label: '{{t("JSON")}}',
value: 'object',
component: Json,
default() {
return {};
},
},
};
type UseTypeConstantType = true | (string | [string, Record<string, any>])[];