{#if is_render_all}
{#if !noControls}
{ globalForceJson = ev.detail === 'json' }} >
{/if} {#each result['render_all'] as res} {/each}
{:else}
{#if result != undefined && length != undefined && largeObject != undefined}
{#if !hideAsJson && !['json', 's3object'].includes(resultKind ?? '') && typeof result === 'object'} { forceJson = ev.detail === 'json' }} > {#if ['table-col', 'table-row', 'table-row-object'].includes(resultKind ?? '')} {:else} {/if} {/if}
{#if !disableExpand && !noControls} The result renderer in Windmill supports rich display rendering, allowing you to customize the display format of your results.
{/if}
{#if !forceJson && resultKind == 'table-col'} {@const data = 'table-col' in result ? result['table-col'] : result} {:else if !forceJson && resultKind == 'table-row'} {@const data = 'table-row' in result ? result['table-row'] : result} {:else if !forceJson && resultKind == 'table-row-object'} {@const data = 'table-row-object' in result ? result['table-row-object'] : result} {:else if !forceJson && resultKind == 'html'}
{#if !requireHtmlApproval || enableHtml} {@html result.html} {:else}
Warning

Rendering HTML can expose you to XSS attacks. Only enable it if you trust the author of the script.

{/if}
{:else if !forceJson && resultKind == 'map'}
{:else if !forceJson && resultKind == 'png'}
png rendered
{:else if !forceJson && resultKind == 'jpeg'}
jpeg rendered
{:else if !forceJson && resultKind == 'svg'}
{@html result.svg}
{:else if !forceJson && resultKind == 'gif'}
gif rendered
{:else if !forceJson && resultKind == 'plain'}
{typeof result == 'string' ? result : result?.['result']}
{#if !noControls}
{/if}
{:else if !forceJson && resultKind == 'file'} {:else if !forceJson && resultKind == 'error' && result?.error}
{#if result.error.name || result.error.message}{result.error.name}: {result.error .message}{:else}{JSON.stringify(result.error, null, 4)}{/if}
{result.error.stack ?? ''}
{:else if !forceJson && resultKind == 'approval'}
{:else if !forceJson && resultKind == 's3object'}
{#if s3FileDisplayRawMode} {:else if !result?.disable_download} {/if}
{#if typeof result?.s3 == 'string' && (result?.s3?.endsWith('.parquet') || result?.s3?.endsWith('.csv'))} {#key result.s3} {/key} {/if}
{:else if !forceJson && resultKind == 's3object-list'}
{#each result as s3object} {#if s3FileDisplayRawMode} {:else if !s3object?.disable_download} {:else}
{s3object?.s3} (download disabled)
{/if} {#if s3object?.s3?.endsWith('.parquet') || s3object?.s3?.endsWith('.csv')} {#if seeS3PreviewFileFromList == s3object?.s3} {:else} {/if} {/if} {/each}
{:else if !forceJson && resultKind == 'markdown'}
{:else if largeObject} {#if result && typeof result == 'object' && 'file' in result} {:else}
Download {filename ? '' : 'as JSON'} {#if download_as_csv} convertJsonToCsv(result)} customText="Download as CSV" /> {/if}
{#if result && result != 'WINDMILL_TOO_BIG'} {/if} {/if} {:else if typeof result == 'string' && result.length > 0}
{result}
{#if !noControls}
{/if} {:else} {/if}
{:else if typeof result == 'string' && resultKind == 'plain'}
{result}
{#if !noControls}
{/if}
{:else}
No result: {toJsonStr(result)}
{/if}
{#if !disableExpand && !noControls} {/if} {/if}