diff --git a/frontend/src/lib/components/ArgInput.svelte b/frontend/src/lib/components/ArgInput.svelte
index 0fb4e8d256..212a823c40 100644
--- a/frontend/src/lib/components/ArgInput.svelte
+++ b/frontend/src/lib/components/ArgInput.svelte
@@ -80,6 +80,7 @@
let s3FilePicker: S3FilePicker
let s3FileUploadRawMode: false
+ let isListJson = false
let el: HTMLTextAreaElement | undefined = undefined
@@ -125,7 +126,7 @@
function evalValueToRaw() {
rawValue =
- inputCat === 'object' || inputCat === 'resource-object'
+ inputCat === 'object' || inputCat === 'resource-object' || (inputCat == 'list' && !isListJson)
? JSON.stringify(value, null, 2)
: undefined
}
@@ -303,7 +304,6 @@
{/if}
Preview:
{/if}
-
{#if description}
{description}
@@ -370,107 +370,121 @@
{#if type == 'boolean' && value == undefined}
Not set
{/if}
- {:else if inputCat == 'list'}
-
- {#if Array.isArray(itemsType?.multiselect) && Array.isArray(value)}
-
-
-
- {:else if itemsType?.enum != undefined && Array.isArray(itemsType?.enum) && Array.isArray(value)}
-
-
-
- {:else}
-
- {#key redraw}
- {#if Array.isArray(value)}
- {#each value ?? [] as v, i}
- {#if i < itemsLimit}
-
- {#if itemsType?.type == 'number'}
-
- {:else if itemsType?.type == 'string' && itemsType?.contentEncoding == 'base64'}
-
fileChanged(x, (val) => (value[i] = val))}
- multiple={false}
- />
- {:else if itemsType?.type == 'object'}
-
- {:else if Array.isArray(itemsType?.enum)}
-
{
- dispatch('focus')
+ {:else if inputCat == 'list' && !isListJson}
+
+
+ {#if Array.isArray(itemsType?.multiselect) && Array.isArray(value)}
+
+
+
+ {:else if itemsType?.enum != undefined && Array.isArray(itemsType?.enum) && Array.isArray(value)}
+
+
+
+ {:else}
+
+ {#key redraw}
+ {#if Array.isArray(value)}
+ {#each value ?? [] as v, i}
+ {#if i < itemsLimit}
+
+ >
+
+
+
+ {/if}
+ {/each}
+ {#if value.length > itemsLimit}
+
{/if}
- {/each}
- {#if value.length > itemsLimit}
-
{/if}
- {/if}
- {/key}
-
-
-
-
- {/if}
+ {/key}
+
+
+
+
+ {/if}
+
+
+ {
+ evalValueToRaw()
+ isListJson = !isListJson
+ }}
+ checked={isListJson}
+ textClass="text-secondary"
+ size="xs"
+ options={{ right: 'json' }}
+ />
+
{:else if inputCat == 'resource-object' && resourceTypes == undefined}
Loading resource types...
@@ -529,7 +543,7 @@
/>
{/if}
- {:else if inputCat == 'object' || inputCat == 'resource-object'}
+ {:else if inputCat == 'object' || inputCat == 'resource-object' || isListJson}
{#if properties && Object.keys(properties).length > 0}
{/if}
+ {#if inputCat == 'list'}
+
+ {
+ isListJson = !isListJson
+ }}
+ checked={isListJson}
+ textClass="text-secondary"
+ size="xs"
+ options={{ right: 'json' }}
+ />
+
+ {/if}
{:else if inputCat == 'enum'}
@@ -419,6 +433,15 @@
{:else}
Not recognized input type {argName} ({arg.expr}, {propertyType})
+
+
{/if}
diff --git a/frontend/src/lib/components/flows/utils.ts b/frontend/src/lib/components/flows/utils.ts
index 19852e8e77..0c35ce9c60 100644
--- a/frontend/src/lib/components/flows/utils.ts
+++ b/frontend/src/lib/components/flows/utils.ts
@@ -68,9 +68,7 @@ export function evalValue(
return v
}
-export function cleanInputs(
- flow: OpenFlow | any
-): OpenFlow & {
+export function cleanInputs(flow: OpenFlow | any): OpenFlow & {
tag?: string
ws_error_handler_muted?: boolean
dedicated_worker?: boolean