diff --git a/frontend/src/lib/components/apps/editor/AppEditorHeader.svelte b/frontend/src/lib/components/apps/editor/AppEditorHeader.svelte index 42d6f7a0f3..28329374dc 100644 --- a/frontend/src/lib/components/apps/editor/AppEditorHeader.svelte +++ b/frontend/src/lib/components/apps/editor/AppEditorHeader.svelte @@ -28,7 +28,9 @@ Sun, Moon, SunMoon, - Zap + Zap, + Globe, + AlertTriangle } from 'lucide-svelte' import { createEventDispatcher, getContext, untrack } from 'svelte' import { @@ -773,7 +775,13 @@ let dirtyPath = $state(false) let path: Path | undefined = $state(undefined) - let moreItems = [ + let secretUrlHref = $derived( + secretUrl + ? `${window.location.origin}${base}/public/${$workspaceStore}/${secretUrl}` + : undefined + ) + + let moreItems = $derived([ { displayName: 'Deployment history', icon: History, @@ -789,6 +797,12 @@ appExport?.open($app) } }, + { + displayName: 'Public URL', + icon: Globe, + disabled: !secretUrlHref, + href: secretUrlHref + }, // { // displayName: 'Publish to Hub', // icon: faGlobe, @@ -797,13 +811,7 @@ // window.open(url.toString(), '_blank') // } // }, - { - displayName: 'Hub compatible JSON', - icon: FileUp, - action: () => { - appExport?.open(toStatic($app, $staticExporter, $summary).app) - } - }, + { displayName: 'App inputs', icon: FormInput, @@ -860,8 +868,15 @@ action: () => { lazyDrawerOpen = true } + }, + { + displayName: 'Hub export', + icon: FileUp, + action: () => { + appExport?.open(toStatic($app, $staticExporter, $summary).app) + } } - ] + ]) let appEditorTutorial: AppEditorTutorial | undefined = $state(undefined) @@ -1167,29 +1182,24 @@ {/snippet}
- {#if $appPath == ''} - - Save this app once before you can publish it - - {:else} - - A viewer of the app will execute the runnables of the app on behalf of the publisher (you) - - It ensures that all required resources/runnable visible for publisher but not for viewer - at time of creating the app would prevent the execution of the app. To guarantee tight - security, a policy is computed at time of deployment of the app which only allow the - scripts/flows referred to in the app to be called on behalf of. Furthermore, static - parameters are not overridable. Hence, users will only be able to use the app as intended - by the publisher without risk for leaking resources not used in the app. - - + + A viewer of the app will execute the runnables of the app on behalf of the publisher (you) + + It ensures that all required resources/runnable visible for publisher but not for viewer at + time of creating the app would prevent the execution of the app. To guarantee tight + security, a policy is computed at time of deployment of the app which only allow the + scripts/flows referred to in the app to be called on behalf of. Furthermore, static + parameters are not overridable. Hence, users will only be able to use the app as intended by + the publisher without risk for leaking resources not used in the app. + + -
+
-

Public URL

-
+

Public URL

-
+
+
- -
-
-
Public URL
-
- {#if secretUrl} - {@const href = `${window.location.origin}${base}/public/${$workspaceStore}/${secretUrl}`} - - {:else} - {/if} -
- Share this url directly or embed it using an iframe (if requiring login, top-level domain - of embedding app must be the same as the one of Windmill) -
- -
- {#if !$enterpriseLicense} - - Custom path is an enterprise only feature. - -
- {:else if !($userStore?.is_admin || $userStore?.is_super_admin)} - - Custom path can only be set by workspace admins - -
- {/if} - { - customPath = detail ? '' : undefined - if (customPath === undefined) { - customPathError = '' - } - }} - checked={customPath !== undefined} - options={{ - right: 'Use a custom URL' - }} - disabled={!$enterpriseLicense || !($userStore?.is_admin || $userStore?.is_super_admin)} - /> - - {#if customPath !== undefined} -
-
Custom path
-
- { - dirtyCustomPath = true - }} - /> -
-
Custom public URL
-
- - -
{dirtyCustomPath ? customPathError : ''} -
- {/if} -
+ {#if $appPath == ''} + + {:else if secretUrlHref} + + {:else} + {/if} +
+ Share this url directly or embed it using an iframe (if requiring login, top-level domain of + embedding app must be the same as the one of Windmill)
- - You will still need to deploy the app to make visible the latest changes - - Embed this app in your own product to be used by your own users - {/if} +
+ {#if !($userStore?.is_admin || $userStore?.is_super_admin)} + + Custom path can only be set by workspace admins + +
+ {/if} + {#if !$enterpriseLicense} +
+ + EE only Enterprise Edition only feature +
+ {/if} + { + customPath = detail ? '' : undefined + if (customPath === undefined) { + customPathError = '' + } + }} + checked={customPath !== undefined} + options={{ + right: 'Use a custom URL' + }} + disabled={!$enterpriseLicense || !($userStore?.is_admin || $userStore?.is_super_admin)} + /> + + {#if customPath !== undefined} +
+
Custom path
+
+ { + dirtyCustomPath = true + }} + /> +
+
Custom public URL
+
+ + +
{dirtyCustomPath ? customPathError : ''} +
+ {/if} +
+
+ + You will still need to deploy the app to make visible the latest changes + + + Embed this app in your own product to be used by your own users