Skip to content

Commit b7f7038

Browse files
committed
fix: not support num input
1 parent ef15747 commit b7f7038

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

app/components/welcome/index.tsx

+9
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,15 @@ const Welcome: FC<IWelcomeProps> = ({
122122
onChange={(e) => { setInputs({ ...inputs, [item.key]: e.target.value }) }}
123123
/>
124124
)}
125+
{item.type === 'number' && (
126+
<input
127+
type="number"
128+
className="block w-full p-2 text-gray-900 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 "
129+
placeholder={`${item.name}${!item.required ? `(${t('appDebug.variableTable.optional')})` : ''}`}
130+
value={inputs[item.key]}
131+
onChange={(e) => { onInputsChange({ ...inputs, [item.key]: e.target.value }) }}
132+
/>
133+
)}
125134
</div>
126135
))}
127136
</div>

utils/prompt.ts

+13
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@ export const userInputsFormToPromptVariables = (useInputs: UserInputFormItem[] |
2424
if (item['text-input'])
2525
return ['string', item['text-input']]
2626

27+
if (item.number)
28+
return ['number', item.number]
29+
2730
return ['select', item.select]
2831
})()
32+
2933
if (type === 'string' || type === 'paragraph') {
3034
promptVariables.push({
3135
key: content.variable,
@@ -36,6 +40,15 @@ export const userInputsFormToPromptVariables = (useInputs: UserInputFormItem[] |
3640
options: [],
3741
})
3842
}
43+
else if (type === 'number') {
44+
promptVariables.push({
45+
key: content.variable,
46+
name: content.label,
47+
required: content.required,
48+
type,
49+
options: [],
50+
})
51+
}
3952
else {
4053
promptVariables.push({
4154
key: content.variable,

0 commit comments

Comments
 (0)