mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-12 00:06:14 +00:00
fix home + refreshOnStart
This commit is contained in:
@@ -70,10 +70,10 @@ https://user-images.githubusercontent.com/275584/218350457-bc2fdc3b-e667-4da5-a2
|
||||
|
||||
3. Make it flow! You can chain your scripts or scripts made by the community
|
||||
shared on [WindmillHub](https://hub.windmill.dev).
|
||||

|
||||

|
||||
|
||||
4. Build complex UI on top of your scripts and flows.
|
||||

|
||||

|
||||
|
||||
Scripts and flows can also be triggered by a cron schedule '_/5 _ \* \* \*' or
|
||||
through webhooks.
|
||||
@@ -123,7 +123,7 @@ instance from local commands. See
|
||||
### Running scripts locally
|
||||
|
||||
You can run your script locally easily, you simply need to pass the right
|
||||
environment variables for the `wmill` client library to fetch resource and
|
||||
environment variables for the `wmill` client library to fetch resources and
|
||||
variables from your instance if necessary. See more:
|
||||
<https://docs.windmill.dev/docs/advanced/local_development/>
|
||||
|
||||
|
||||
@@ -67,8 +67,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
$: resolvedConfig?.triggerOnAppLoad && runnableComponent?.runComponent()
|
||||
|
||||
let errors: Record<string, string> = {}
|
||||
$: errorsMessage = Object.values(errors)
|
||||
.filter((x) => x != '')
|
||||
@@ -119,6 +117,7 @@
|
||||
{render}
|
||||
{outputs}
|
||||
{extraKey}
|
||||
refreshOnStart={resolvedConfig.triggerOnAppLoad}
|
||||
>
|
||||
<AlignWrapper {noWFull} {horizontalAlignment} {verticalAlignment}>
|
||||
{#if errorsMessage}
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
export let recomputeOnInputChanged: boolean = false
|
||||
export let loading = false
|
||||
export let recomputableByRefreshButton: boolean = true
|
||||
export let refreshOnStart: boolean = false
|
||||
|
||||
const {
|
||||
worldStore,
|
||||
@@ -54,13 +55,13 @@
|
||||
|
||||
$runnableComponents[id] = {
|
||||
autoRefresh: autoRefresh && recomputableByRefreshButton,
|
||||
refreshOnStart,
|
||||
cb: async (inlineScript?: InlineScript) => {
|
||||
await executeComponent(true, inlineScript)
|
||||
}
|
||||
}
|
||||
|
||||
if (!$worldStore.initializedComponents.includes(id)) {
|
||||
console.log('adding', id)
|
||||
$worldStore.initializedComponents = [...$worldStore.initializedComponents, id]
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
export let recomputeIds: string[] = []
|
||||
export let outputs: { result: Output<any>; loading: Output<boolean> }
|
||||
export let extraKey: string | undefined = undefined
|
||||
export let refreshOnStart: boolean = false
|
||||
|
||||
const { staticExporter, noBackend, componentControl, runnableComponents } =
|
||||
getContext<AppViewerContext>('AppViewerContext')
|
||||
@@ -101,6 +102,7 @@
|
||||
<slot />
|
||||
{:else if componentInput.type === 'runnable' && isRunnableDefined(componentInput)}
|
||||
<RunnableComponent
|
||||
{refreshOnStart}
|
||||
{extraKey}
|
||||
bind:loading
|
||||
bind:this={runnableComponent}
|
||||
|
||||
@@ -39,15 +39,19 @@
|
||||
}
|
||||
|
||||
function refresh() {
|
||||
console.log('refresh')
|
||||
let isFirstLoad = false
|
||||
if (!firstLoad) {
|
||||
$worldStore.initialized = true
|
||||
firstLoad = true
|
||||
isFirstLoad = true
|
||||
}
|
||||
loading = true
|
||||
Promise.all(
|
||||
Object.keys($runnableComponents).map((id) => {
|
||||
if (!$runnableComponents?.[id]?.autoRefresh) {
|
||||
if (
|
||||
!$runnableComponents?.[id]?.autoRefresh &&
|
||||
(!isFirstLoad || !$runnableComponents?.[id]?.refreshOnStart)
|
||||
) {
|
||||
return
|
||||
}
|
||||
return $runnableComponents?.[id]?.cb?.()
|
||||
|
||||
@@ -138,7 +138,14 @@ export type AppViewerContext = {
|
||||
connectingInput: Writable<ConnectingInput>
|
||||
breakpoint: Writable<EditorBreakpoint>
|
||||
runnableComponents: Writable<
|
||||
Record<string, { autoRefresh: boolean; cb: (inlineScript?: InlineScript) => Promise<void> }>
|
||||
Record<
|
||||
string,
|
||||
{
|
||||
autoRefresh: boolean
|
||||
refreshOnStart?: boolean
|
||||
cb: (inlineScript?: InlineScript) => Promise<void>
|
||||
}
|
||||
>
|
||||
>
|
||||
staticExporter: Writable<Record<string, () => any>>
|
||||
appPath: string
|
||||
|
||||
@@ -23,7 +23,9 @@
|
||||
|
||||
type Tab = 'hubscripts' | 'hubflows' | 'hubapps' | 'workspace'
|
||||
|
||||
let tab: Tab = (window.location.hash?.replace('#', '') as Tab | undefined) ?? 'workspace'
|
||||
let tab: Tab = window.location.hash?.includes('#')
|
||||
? (window.location.hash?.replace('#', '') as Tab)
|
||||
: 'workspace'
|
||||
let filter: string = ''
|
||||
|
||||
let flowViewer: Drawer
|
||||
|
||||
Reference in New Issue
Block a user