mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-11 08:07:15 +00:00
fix integer handling as field type
This commit is contained in:
@@ -58,6 +58,9 @@ fn parse_go_typ(typ: &parser_go_ast::Expr) -> (Option<String>, Typ) {
|
||||
Some((*name).to_string()),
|
||||
match *name {
|
||||
"int" => Typ::Int,
|
||||
"int16" => Typ::Int,
|
||||
"int32" => Typ::Int,
|
||||
"int64" => Typ::Int,
|
||||
"string" => Typ::Str(None),
|
||||
"bool" => Typ::Bool,
|
||||
_ => Typ::Unknown,
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@
|
||||
</script>
|
||||
|
||||
{#if componentInput?.type === 'static'}
|
||||
{#if fieldType === 'number'}
|
||||
{#if fieldType === 'number' || fieldType === 'integer'}
|
||||
<input on:keydown|stopPropagation type="number" bind:value={componentInput.value} />
|
||||
{:else if fieldType === 'textarea'}
|
||||
<textarea on:keydown|stopPropagation bind:value={componentInput.value} />
|
||||
|
||||
@@ -2,6 +2,7 @@ import type { ReadFileAs } from '../common/fileInput/model'
|
||||
import type { InlineScript } from './types'
|
||||
|
||||
export type InputType =
|
||||
| 'integer'
|
||||
| 'text'
|
||||
| 'textarea'
|
||||
| 'template'
|
||||
|
||||
@@ -132,6 +132,8 @@ export function fieldTypeToTsType(inputType: InputType): string {
|
||||
switch (inputType) {
|
||||
case 'number':
|
||||
return 'number'
|
||||
case 'integer':
|
||||
return 'number'
|
||||
case 'boolean':
|
||||
return 'boolean'
|
||||
case 'object':
|
||||
|
||||
Reference in New Issue
Block a user