{#if workspaceSettingsInitialized === false} {#if fromWorkspaceSettings}

Double check the S3 resource fields and try again.

{:else if s3ResourcePath}

Double check the resource fields and that its object storage is reachable, then try again.

{:else}

The workspace needs to be connected to an S3 storage to use this feature. You can configure it here.

{/if} {:else} {#if fileListUnavailable == true} {#if replaceUnauthorizedWarning} {@render replaceUnauthorizedWarning()} {:else}

You don't have access to the S3 bucket resource and your administrator has restricted the access to it. You are not authorized to browse the bucket content. If you think this is incorrect, please contact your workspace administrator.

More info in Windmill's documentation

{/if} {/if}
{#if !fileListUnavailable}
{#if !rootPath}
{/if} {#if displayedFileKeys.length === 0} {#if fileListLoading}
Loading content
{:else}
{#if filter.trim() !== ''} No files starting with "{filter.trim()}" {:else} No files in the workspace S3 bucket {/if}
{#if flatHasMore}
{/if} {/if} {:else}
{#snippet header()}{/snippet} {#snippet footer()}{/snippet} {#snippet item({ index, style })} {@const item_key = displayedFileKeys[index] ?? ''} {@const is_load_more = item_key.endsWith(LOAD_MORE_SUFFIX)} {@const load_more_prefix = is_load_more ? item_key.slice(0, -1) : ''} {@const file_info = allFilesByKey[item_key]}
{#if is_load_more} {@const loadMoreNesting = nestingLevelOf(load_more_prefix + 'x') - 2 * rootPathNestingLevel} {@const loadingMore = folderState[load_more_prefix]?.loading === true}
!loadingMore && loadMore(load_more_prefix)} class={twMerge( 'flex flex-row h-full text-xs items-center justify-start text-secondary', loadingMore ? 'cursor-default' : 'cursor-pointer' )} >
{#if loadingMore} {:else} {/if}
Load more
{:else if file_info} {@const nestingLevel = file_info.nestingLevel - 2 * rootPathNestingLevel}
selectItem(index)} class={twMerge( 'flex flex-row h-full font-semibold text-xs items-center justify-start', selectedFileKey !== undefined && selectedFileKey.s3 === file_info.full_key ? 'bg-surface-hover' : '' )} >
{#if file_info.type === 'folder'} {#if folderState[file_info.full_key]?.loading} {:else if file_info.collapsed}{:else}{/if}
{#if file_info.display_name === ''} (empty name) {:else}{file_info.display_name}{/if} {#if !lazyMode} ({file_info.count}{count % 1000 === 0 && lastKeyFolders[file_info.nestingLevel / 2] === file_info.display_name ? '+' : ''} item{file_info.count === 1 ? '' : 's'}) {/if}
{:else}
{file_info.display_name}
{/if}
{/if}
{/snippet}
{#if fileListLoading === true}
Loading content
{:else if lazyMode}
{displayedCount} item{displayedCount === 1 ? '' : 's'} shown
{:else}
{displayedCount}{flatHasMore ? '+' : ''} {displayedCount !== count ? 'filtered ' : ''}items (including inside folders)
{#if flatHasMore} {/if} {/if}
{/if}
{/if}
{#if fileMetadata === undefined}
{#if fileInfoLoading}
{:else if fileListUnavailable}
{:else}
{/if}
{:else}

{((p) => (p.startsWith(rootPath) ? p.slice(rootPath.length) : p))( fileMetadata.fileKey )}

{#if filePreview !== undefined && (!hideS3SpecificDetails || !readOnlyMode || allowDelete)}
{#if !hideS3SpecificDetails} {@const downloadApiPath = `/w/${ws}/job_helpers/download_s3_file?file_key=${encodeURIComponent(fileMetadata?.fileKey ?? '')}${storage ? `&storage=${storage}` : ''}${s3ResourcePath ? `&s3_resource_path=${encodeURIComponent(s3ResourcePath)}` : ''}`} {@const downloadName = fileMetadata?.fileKey.split('/').pop() ?? 'unnamed_download.file'} {#if shouldDownloadViaClient()}
{/if}
{#if !hideS3SpecificDetails} {/if}
{/if}
{/if} { deletionModalOpen = false }} on:confirmed={() => { deleteFileFromS3(fileMetadata?.fileKey) }} keyListen={false} loading={fileDeletionInProgress} >
Are you sure you want to permanently delete {fileMetadata?.fileKey} from the S3 bucket?
{ moveModalOpen = false }} on:confirmed={() => { moveS3File(fileMetadata?.fileKey, moveDestKey) }} keyListen={false} loading={fileMoveInProgress} >
New key:
Are you sure you want to permanently move {fileMetadata?.fileKey}?
{ uploadModalOpen = false if (evt.detail !== undefined && evt.detail !== null) { selectedFileKey = { s3: evt.detail, storage } await clearAndLoadFiles() loadFileMetadataPlusPreviewAsync(evt.detail) } }} />