Files
windmill/frontend/src/lib/components/S3FilePicker.svelte
T
wendrulandRuben Fiszel 32fae7a10c feat: ansible playbook execution git repo mode (repo viewer + UI utils) (#6831)
* Improve minio on flake.nix

* Add first asset parsing logic for ansible

* Correct html gt sign

* Decouple s3 file picker from drawer

* Factor duplicate code into snippet

* Update S3FilePickerInner to be compatible

* Fix pane shrinking issue

* Git repo viewer

* Change GitRepoViewer

* Endpoints for git repo visualizer

* Move git repo viewer to its own component

* Add button to populate git repo viewer

* Update parser yaml for new ansisble features (repo viewer)

* Reflect parser changes for ansible

* Add button to add the git repo mode of declaration for ansible

* Factor function

* Playbook + inventories into the drawer

* Add button to add inventories from s3

* Move tests to lib.rs

* Inventory loading from s3

* Move get github app token logic to be reused by ansible

* Update parser and ansible executor

* Use the correct path for inventories

* Add nushell to flake for wasm builds

* Add published parser

* Update hubPaths with clone and upload to s3

* Update ee-repo to the branch ref

* Fix npm run check

* Update cargo.lock

* Change labels on buttons

* Remove debug log

* Update ee-repo-ref

* Fix ee issues

* Update ee-repo ref

* Fix typo

* Fix ee

* Update ee-repo-ref

* Fix missing imports

* Unused var

* Fix typo

* Layout improvents

* Fix typos

* Remove unused function and log

---------

Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
2025-10-16 09:08:18 +00:00

75 lines
2.0 KiB
Svelte

<script lang="ts">
import { type S3Object } from '$lib/utils'
import { Drawer } from './common'
import DrawerContent from './common/drawer/DrawerContent.svelte'
import { createEventDispatcher, tick } from 'svelte'
import S3FilePickerInner from './S3FilePickerInner.svelte'
let dispatch = createEventDispatcher<{
close: { s3: string; storage: string | undefined } | undefined
selectAndClose: { s3: string; storage: string | undefined }
}>()
interface Props {
fromWorkspaceSettings?: boolean
readOnlyMode: boolean
initialFileKey?: { s3: string; storage?: string } | undefined
selectedFileKey?: { s3: string; storage?: string } | undefined
folderOnly?: boolean
regexFilter?: RegExp | undefined
}
let {
fromWorkspaceSettings = false,
readOnlyMode,
initialFileKey = $bindable(undefined),
selectedFileKey = $bindable(undefined),
folderOnly = false,
regexFilter = undefined
}: Props = $props()
let drawer: Drawer | undefined = $state()
let s3FilePickerInner: S3FilePickerInner | undefined = $state()
export async function open(_preSelectedFileKey: S3Object | undefined = undefined) {
drawer?.openDrawer?.()
await tick()
s3FilePickerInner?.open?.(_preSelectedFileKey)
}
</script>
<!-- svelte-ignore a11y_click_events_have_key_events -->
<!-- svelte-ignore a11y_no_static_element_interactions -->
<Drawer
bind:this={drawer}
on:close={() => {
dispatch('close')
s3FilePickerInner?.close?.()
}}
size="1200px"
>
<DrawerContent
title="S3 file browser"
on:close={() => {
s3FilePickerInner?.exit?.()
drawer?.closeDrawer?.()
}}
tooltip="Files present in the Workspace S3 bucket. You can set the workspace S3 bucket in the settings."
documentationLink="https://www.windmill.dev/docs/integrations/s3"
>
<S3FilePickerInner
bind:this={s3FilePickerInner}
on:selectAndClose={(e) => {
dispatch('selectAndClose', e.detail)
drawer?.closeDrawer?.()
}}
{fromWorkspaceSettings}
{readOnlyMode}
bind:initialFileKey
bind:selectedFileKey
{folderOnly}
{regexFilter}
/>
</DrawerContent>
</Drawer>