windmill-components 1.28.6 → 1.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/common.d.ts +3 -0
  2. package/components/AppConnect.svelte +29 -13
  3. package/components/ArgInput.svelte +28 -14
  4. package/components/ArgInput.svelte.d.ts +4 -0
  5. package/components/CenteredPage.svelte +2 -2
  6. package/components/DisplayResult.svelte +3 -3
  7. package/components/Editor.svelte +97 -97
  8. package/components/Editor.svelte.d.ts +3 -0
  9. package/components/EditorBar.svelte +57 -38
  10. package/components/FlowBuilder.svelte +40 -32
  11. package/components/FlowEditor.svelte +19 -57
  12. package/components/FlowEditor.svelte.d.ts +1 -0
  13. package/components/FlowJobResult.svelte +16 -16
  14. package/components/FlowModulesViewer.svelte +97 -0
  15. package/components/FlowModulesViewer.svelte.d.ts +17 -0
  16. package/components/FlowPreview.svelte +47 -68
  17. package/components/FlowPreview.svelte.d.ts +2 -6
  18. package/components/FlowPreviewContent.svelte +59 -44
  19. package/components/FlowPreviewContent.svelte.d.ts +0 -1
  20. package/components/FlowStatusViewer.svelte +104 -204
  21. package/components/FlowStatusViewer.svelte.d.ts +7 -4
  22. package/components/FlowViewer.svelte +60 -155
  23. package/components/FlowViewer.svelte.d.ts +0 -1
  24. package/components/IconedPath.svelte +12 -0
  25. package/components/IconedPath.svelte.d.ts +16 -0
  26. package/components/IconedResourceType.svelte +21 -2
  27. package/components/IconedResourceType.svelte.d.ts +1 -0
  28. package/components/InputTransformForm.svelte +9 -8
  29. package/components/InputTransformForm.svelte.d.ts +1 -1
  30. package/components/InviteGlobalUser.svelte +1 -1
  31. package/components/ItemPicker.svelte +6 -1
  32. package/components/JobStatus.svelte +1 -1
  33. package/components/ModuleStep.svelte +74 -96
  34. package/components/ModuleStep.svelte.d.ts +7 -4
  35. package/components/Multiselect.svelte +1 -1
  36. package/components/Path.svelte +62 -40
  37. package/components/Path.svelte.d.ts +2 -0
  38. package/components/ProgressBar.svelte +31 -0
  39. package/components/ProgressBar.svelte.d.ts +17 -0
  40. package/components/ProgressBarPart.svelte +20 -0
  41. package/components/ProgressBarPart.svelte.d.ts +20 -0
  42. package/components/ResourceEditor.svelte +2 -1
  43. package/components/ResourcePicker.svelte +9 -0
  44. package/components/SchemaForm.svelte +9 -4
  45. package/components/SchemaForm.svelte.d.ts +1 -1
  46. package/components/SchemaModal.svelte +20 -3
  47. package/components/SchemaViewer.svelte +58 -68
  48. package/components/ScriptBuilder.svelte +145 -122
  49. package/components/ScriptBuilder.svelte.d.ts +1 -0
  50. package/components/ScriptEditor.svelte +118 -339
  51. package/components/ScriptEditor.svelte.d.ts +0 -2
  52. package/components/ScriptSchema.svelte +45 -44
  53. package/components/SharedBadge.svelte +8 -3
  54. package/components/VariableEditor.svelte +1 -1
  55. package/components/common/drawer/Drawer.svelte +108 -0
  56. package/components/common/drawer/Drawer.svelte.d.ts +23 -0
  57. package/components/common/drawer/DrawerContent.svelte +19 -0
  58. package/components/common/drawer/DrawerContent.svelte.d.ts +20 -0
  59. package/components/common/menu/Menu.svelte +57 -0
  60. package/components/common/menu/Menu.svelte.d.ts +23 -0
  61. package/components/common/menu/MenuItem.svelte +9 -0
  62. package/components/common/menu/MenuItem.svelte.d.ts +27 -0
  63. package/components/common/tabs/Tab.svelte +17 -0
  64. package/components/common/tabs/Tab.svelte.d.ts +18 -0
  65. package/components/common/tabs/TabContent.svelte +12 -0
  66. package/components/common/tabs/TabContent.svelte.d.ts +19 -0
  67. package/components/common/tabs/Tabs.svelte +20 -0
  68. package/components/common/tabs/Tabs.svelte.d.ts +24 -0
  69. package/components/flows/CopyFirstStepSchema.svelte +4 -3
  70. package/components/flows/DynamicInputHelpBox.svelte +6 -4
  71. package/components/flows/DynamicInputHelpBox.svelte.d.ts +1 -1
  72. package/components/flows/FlowBox.svelte +15 -2
  73. package/components/flows/FlowBox.svelte.d.ts +14 -14
  74. package/components/flows/FlowBoxHeader.svelte +10 -3
  75. package/components/flows/FlowBoxHeader.svelte.d.ts +3 -0
  76. package/components/flows/FlowInput.svelte +14 -12
  77. package/components/flows/FlowInputs.svelte +56 -22
  78. package/components/flows/FlowInputs.svelte.d.ts +3 -1
  79. package/components/flows/FlowModuleHeader.svelte +69 -54
  80. package/components/flows/FlowModuleHeader.svelte.d.ts +6 -6
  81. package/components/flows/FlowSettings.svelte +82 -92
  82. package/components/flows/FlowSettings.svelte.d.ts +1 -1
  83. package/components/flows/FlowTimeline.svelte +169 -0
  84. package/components/flows/FlowTimeline.svelte.d.ts +21 -0
  85. package/components/flows/flowState.d.ts +14 -0
  86. package/components/flows/flowState.js +52 -0
  87. package/components/flows/flowStateUtils.d.ts +37 -0
  88. package/components/flows/flowStateUtils.js +220 -0
  89. package/components/flows/flowStore.d.ts +1 -16
  90. package/components/flows/flowStore.js +26 -203
  91. package/components/flows/pickers/FlowScriptPicker.svelte +5 -9
  92. package/components/flows/pickers/FlowScriptPicker.svelte.d.ts +0 -1
  93. package/components/flows/pickers/PickHubScript.svelte +1 -1
  94. package/components/flows/pickers/PickHubScript.svelte.d.ts +1 -1
  95. package/components/flows/pickers/PickScript.svelte +1 -1
  96. package/components/flows/pickers/PickScript.svelte.d.ts +1 -1
  97. package/components/flows/scheduleUtils.d.ts +7 -0
  98. package/components/flows/scheduleUtils.js +21 -0
  99. package/components/flows/stepOpenedStore.d.ts +1 -0
  100. package/components/flows/stepOpenedStore.js +6 -0
  101. package/components/flows/utils.d.ts +6 -13
  102. package/components/flows/utils.js +47 -119
  103. package/components/icons/DiscordIcon.svelte +16 -0
  104. package/components/icons/DiscordIcon.svelte.d.ts +17 -0
  105. package/components/icons/HttpIcon.svelte +21 -0
  106. package/components/icons/HttpIcon.svelte.d.ts +17 -0
  107. package/components/icons/MastodonIcon.svelte +16 -0
  108. package/components/icons/MastodonIcon.svelte.d.ts +17 -0
  109. package/components/icons/MatrixIcon.svelte +16 -0
  110. package/components/icons/MatrixIcon.svelte.d.ts +17 -0
  111. package/components/icons/S3Icon.svelte +16 -0
  112. package/components/icons/S3Icon.svelte.d.ts +17 -0
  113. package/components/icons/WindmillIcon.svelte +68 -0
  114. package/components/icons/WindmillIcon.svelte.d.ts +17 -0
  115. package/components/jobs/JobDetail.svelte +176 -0
  116. package/components/jobs/JobDetail.svelte.d.ts +17 -0
  117. package/components/landing/FlowGettingStarted.svelte +95 -0
  118. package/components/landing/FlowGettingStarted.svelte.d.ts +19 -0
  119. package/components/landing/FlowLandingBox.svelte +69 -0
  120. package/components/landing/FlowLandingBox.svelte.d.ts +17 -0
  121. package/components/landing/RessourceGettingStarted.svelte +51 -0
  122. package/components/landing/RessourceGettingStarted.svelte.d.ts +19 -0
  123. package/components/landing/ScriptBox.svelte +81 -0
  124. package/components/landing/ScriptBox.svelte.d.ts +17 -0
  125. package/components/landing/ScriptGettingStarted.svelte +93 -0
  126. package/components/landing/ScriptGettingStarted.svelte.d.ts +19 -0
  127. package/components/preview/FlowPreviewStatus.svelte +28 -0
  128. package/components/preview/FlowPreviewStatus.svelte.d.ts +17 -0
  129. package/components/propertyPicker/ObjectViewer.svelte +13 -13
  130. package/components/propertyPicker/utils.js +3 -2
  131. package/components/script_editor/LogPanel.svelte +172 -0
  132. package/components/script_editor/LogPanel.svelte.d.ts +22 -0
  133. package/components/sidebar/MenuLink.svelte +49 -0
  134. package/components/sidebar/MenuLink.svelte.d.ts +21 -0
  135. package/components/sidebar/SidebarContent.svelte +55 -0
  136. package/components/sidebar/SidebarContent.svelte.d.ts +16 -0
  137. package/components/sidebar/UserMenu.svelte +62 -0
  138. package/components/sidebar/UserMenu.svelte.d.ts +16 -0
  139. package/components/sidebar/WorkspaceMenu.svelte +66 -0
  140. package/components/sidebar/WorkspaceMenu.svelte.d.ts +16 -0
  141. package/gen/core/OpenAPI.js +1 -1
  142. package/gen/core/request.js +1 -0
  143. package/gen/models/FlowModule.d.ts +5 -3
  144. package/gen/models/ForloopFlow.d.ts +2 -2
  145. package/gen/models/MainArgSignature.d.ts +14 -3
  146. package/gen/services/JobService.d.ts +10 -2
  147. package/gen/services/JobService.js +4 -2
  148. package/gen/services/ScriptService.d.ts +18 -0
  149. package/gen/services/ScriptService.js +30 -0
  150. package/infer.js +47 -24
  151. package/logout.js +1 -1
  152. package/package.json +57 -23
  153. package/script_helpers.d.ts +4 -1
  154. package/script_helpers.js +68 -17
  155. package/stores.d.ts +0 -2
  156. package/stores.js +0 -4
  157. package/utils.d.ts +5 -2
  158. package/utils.js +37 -6
@@ -0,0 +1,51 @@
1
+ <script>
2
+ import { goto } from '$app/navigation'
3
+ </script>
4
+
5
+ <div class="p-4 border border-gray-300 rounded-md bg-gray-50 dark:border-gray-600 dark:bg-gray-700">
6
+ <div class="flex items-center">
7
+ <h3 class="inline-flex items-center text-lg font-medium text-gray-700 ">
8
+ <svg
9
+ class="w-6 h-6 mr-2"
10
+ fill="none"
11
+ stroke="currentColor"
12
+ viewBox="0 0 24 24"
13
+ xmlns="http://www.w3.org/2000/svg"
14
+ ><path d="M12 14l9-5-9-5-9 5 9 5z" /><path
15
+ d="M12 14l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14z"
16
+ /><path
17
+ stroke-linecap="round"
18
+ stroke-linejoin="round"
19
+ stroke-width="2"
20
+ d="M12 14l9-5-9-5-9 5 9 5zm0 0l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14zm-4 6v-7.5l4-2.222"
21
+ />
22
+ </svg>
23
+ Getting started
24
+ </h3>
25
+ </div>
26
+ <div class="mt-2 mb-4 text-sm text-gray-700 dark:text-gray-300">
27
+ Connect to apps like Slack, Google Drive or Airtable using OAuth.
28
+ </div>
29
+ <div class="flex">
30
+ <button
31
+ on:click={() => goto('resources')}
32
+ type="button"
33
+ class="inline-flex items-center text-white bg-gray-700 hover:bg-gray-800 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-lg text-xs px-3 py-1.5 mr-2 text-center dark:bg-gray-600 dark:hover:bg-gray-500 dark:focus:ring-gray-600"
34
+ >
35
+ <svg
36
+ class="w-4 h-4 mr-2"
37
+ fill="none"
38
+ stroke="currentColor"
39
+ viewBox="0 0 24 24"
40
+ xmlns="http://www.w3.org/2000/svg"
41
+ ><path
42
+ stroke-linecap="round"
43
+ stroke-linejoin="round"
44
+ stroke-width="2"
45
+ d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"
46
+ />
47
+ </svg>
48
+ Connect an API
49
+ </button>
50
+ </div>
51
+ </div>
@@ -0,0 +1,19 @@
1
+ /** @typedef {typeof __propDef.props} RessourceGettingStartedProps */
2
+ /** @typedef {typeof __propDef.events} RessourceGettingStartedEvents */
3
+ /** @typedef {typeof __propDef.slots} RessourceGettingStartedSlots */
4
+ export default class RessourceGettingStarted extends SvelteComponentTyped<{}, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> {
7
+ }
8
+ export type RessourceGettingStartedProps = typeof __propDef.props;
9
+ export type RessourceGettingStartedEvents = typeof __propDef.events;
10
+ export type RessourceGettingStartedSlots = typeof __propDef.slots;
11
+ import { SvelteComponentTyped } from "svelte";
12
+ declare const __propDef: {
13
+ props: {};
14
+ events: {
15
+ [evt: string]: CustomEvent<any>;
16
+ };
17
+ slots: {};
18
+ };
19
+ export {};
@@ -0,0 +1,81 @@
1
+ <script>import { goto } from '$app/navigation';
2
+ import { truncateHash } from '../../utils';
3
+ export let script;
4
+ </script>
5
+
6
+ <div
7
+ class="border p-4 rounded-sm shadow-sm space-y-2 hover:border-blue-600 flex flex-col justify-between cursor-pointer"
8
+ on:click={() => goto(`/scripts/get/${script.hash}`)}
9
+ >
10
+ <div class="font-bold">{script.summary || script.path}</div>
11
+
12
+ <div class="inline-flex justify-between w-full">
13
+ <div class="text-xs">{script.path}</div>
14
+
15
+ <span class="bg-gray-100 text-gray-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded ">
16
+ {truncateHash(script.hash)}
17
+ </span>
18
+ </div>
19
+ <div class="inline-flex space-x-1 w-full">
20
+ <span class="bg-blue-100 text-blue-800 text-xs font-semibold px-2.5 py-0.5 rounded ">
21
+ {String(script.language).toUpperCase()}
22
+ </span>
23
+ {#if script.is_trigger}
24
+ <span class="bg-red-100 text-red-800 text-xs font-semibold px-2.5 py-0.5 rounded">
25
+ TRIGGER
26
+ </span>
27
+ {/if}
28
+ </div>
29
+ <div class="inline-flex space-x-2 space-x-reverse flex-row-reverse w-full">
30
+ <button
31
+ on:click|stopPropagation={() => goto(`/scripts/edit/${script.hash}?step=2`)}
32
+ type="button"
33
+ class="inline-flex items-center text-gray-700 bg-transparent border border-gray-700 hover:bg-gray-800 hover:text-white focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-lg text-xs px-3 py-1.5 text-center"
34
+ data-dismiss-target="#alert-additional-content-5"
35
+ aria-label="Close"
36
+ >
37
+ <svg
38
+ class="w-4 h-4 mr-2"
39
+ fill="none"
40
+ stroke="currentColor"
41
+ viewBox="0 0 24 24"
42
+ xmlns="http://www.w3.org/2000/svg"
43
+ ><path
44
+ stroke-linecap="round"
45
+ stroke-linejoin="round"
46
+ stroke-width="2"
47
+ d="M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"
48
+ />
49
+ </svg>
50
+ Edit
51
+ </button>
52
+
53
+ <button
54
+ on:click|stopPropagation={() => goto(`/scripts/run/${script.hash}`)}
55
+ type="button"
56
+ class="inline-flex items-center text-gray-700 bg-transparent border border-gray-700 hover:bg-gray-800 hover:text-white focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-lg text-xs px-3 py-1.5 text-center"
57
+ data-dismiss-target="#alert-additional-content-5"
58
+ aria-label="Close"
59
+ >
60
+ <svg
61
+ class="w-4 h-4 mr-2"
62
+ fill="none"
63
+ stroke="currentColor"
64
+ viewBox="0 0 24 24"
65
+ xmlns="http://www.w3.org/2000/svg"
66
+ ><path
67
+ stroke-linecap="round"
68
+ stroke-linejoin="round"
69
+ stroke-width="2"
70
+ d="M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"
71
+ /><path
72
+ stroke-linecap="round"
73
+ stroke-linejoin="round"
74
+ stroke-width="2"
75
+ d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
76
+ />
77
+ </svg>
78
+ Run
79
+ </button>
80
+ </div>
81
+ </div>
@@ -0,0 +1,17 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import type { Script } from '../../gen';
3
+ declare const __propDef: {
4
+ props: {
5
+ script: Script;
6
+ };
7
+ events: {
8
+ [evt: string]: CustomEvent<any>;
9
+ };
10
+ slots: {};
11
+ };
12
+ export declare type ScriptBoxProps = typeof __propDef.props;
13
+ export declare type ScriptBoxEvents = typeof __propDef.events;
14
+ export declare type ScriptBoxSlots = typeof __propDef.slots;
15
+ export default class ScriptBox extends SvelteComponentTyped<ScriptBoxProps, ScriptBoxEvents, ScriptBoxSlots> {
16
+ }
17
+ export {};
@@ -0,0 +1,93 @@
1
+ <script>
2
+ import { goto } from '$app/navigation'
3
+ </script>
4
+
5
+ <div class="p-4 border border-gray-300 rounded-md bg-gray-50 ">
6
+ <div class="flex items-center">
7
+ <h3 class="inline-flex items-center text-lg font-medium text-gray-700 ">
8
+ <svg
9
+ class="w-6 h-6 mr-2"
10
+ fill="none"
11
+ stroke="currentColor"
12
+ viewBox="0 0 24 24"
13
+ xmlns="http://www.w3.org/2000/svg"
14
+ ><path d="M12 14l9-5-9-5-9 5 9 5z" /><path
15
+ d="M12 14l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14z"
16
+ /><path
17
+ stroke-linecap="round"
18
+ stroke-linejoin="round"
19
+ stroke-width="2"
20
+ d="M12 14l9-5-9-5-9 5 9 5zm0 0l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14zm-4 6v-7.5l4-2.222"
21
+ />
22
+ </svg>
23
+ Getting started
24
+ </h3>
25
+ </div>
26
+ <div class="mt-2 mb-4 text-sm text-gray-700 ">
27
+ Create a new script or find inspiration on the Hub!
28
+ </div>
29
+ <div class="inline-flex flex-wrap gap-y-2">
30
+ <button
31
+ on:click={() => goto('scripts/add')}
32
+ type="button"
33
+ class="mr-2 inline-flex items-center text-white bg-gray-700 hover:bg-gray-800 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-lg text-xs px-3 py-1.5 text-center"
34
+ >
35
+ <svg
36
+ class="w-4 h-4 mr-2"
37
+ fill="none"
38
+ stroke="currentColor"
39
+ viewBox="0 0 24 24"
40
+ xmlns="http://www.w3.org/2000/svg"
41
+ ><path
42
+ stroke-linecap="round"
43
+ stroke-linejoin="round"
44
+ stroke-width="2"
45
+ d="M12 6v6m0 0v6m0-6h6m-6 0H6"
46
+ /></svg
47
+ >
48
+ Create script
49
+ </button>
50
+ <button
51
+ on:click={() => goto('https://docs.windmill.dev/docs/getting_started/scripts')}
52
+ type="button"
53
+ class="mr-2 inline-flex items-center text-white bg-blue-600 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-xs px-3 py-1.5 text-center"
54
+ >
55
+ <svg
56
+ class="w-4 h-4 mr-2"
57
+ fill="none"
58
+ stroke="currentColor"
59
+ viewBox="0 0 24 24"
60
+ xmlns="http://www.w3.org/2000/svg"
61
+ ><path
62
+ stroke-linecap="round"
63
+ stroke-linejoin="round"
64
+ stroke-width="2"
65
+ d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
66
+ />
67
+ </svg>
68
+ Script documentation
69
+ </button>
70
+ <button
71
+ on:click={() => goto('https://hub.windmill.dev/')}
72
+ type="button"
73
+ class="inline-flex items-center text-gray-700 bg-transparent border border-gray-700 hover:bg-gray-800 hover:text-white focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-lg text-xs px-3 py-1.5 text-center"
74
+ data-dismiss-target="#alert-additional-content-5"
75
+ aria-label="Close"
76
+ >
77
+ <svg
78
+ class="w-4 h-4 mr-2"
79
+ fill="none"
80
+ stroke="currentColor"
81
+ viewBox="0 0 24 24"
82
+ xmlns="http://www.w3.org/2000/svg"
83
+ ><path
84
+ stroke-linecap="round"
85
+ stroke-linejoin="round"
86
+ stroke-width="2"
87
+ d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
88
+ />
89
+ </svg>
90
+ Explore community scripts on WindmillHub
91
+ </button>
92
+ </div>
93
+ </div>
@@ -0,0 +1,19 @@
1
+ /** @typedef {typeof __propDef.props} ScriptGettingStartedProps */
2
+ /** @typedef {typeof __propDef.events} ScriptGettingStartedEvents */
3
+ /** @typedef {typeof __propDef.slots} ScriptGettingStartedSlots */
4
+ export default class ScriptGettingStarted extends SvelteComponentTyped<{}, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> {
7
+ }
8
+ export type ScriptGettingStartedProps = typeof __propDef.props;
9
+ export type ScriptGettingStartedEvents = typeof __propDef.events;
10
+ export type ScriptGettingStartedSlots = typeof __propDef.slots;
11
+ import { SvelteComponentTyped } from "svelte";
12
+ declare const __propDef: {
13
+ props: {};
14
+ events: {
15
+ [evt: string]: CustomEvent<any>;
16
+ };
17
+ slots: {};
18
+ };
19
+ export {};
@@ -0,0 +1,28 @@
1
+ <script>import JobStatus from '../JobStatus.svelte';
2
+ export let job;
3
+ </script>
4
+
5
+ <div class="overflow-x-auto relative">
6
+ <table class="text-sm text-left text-gray-500 dark:text-gray-400">
7
+ <tbody>
8
+ <tr>
9
+ <th scope="row" class="py-2 pr-6 font-bold text-gray-900 whitespace-nowrap dark:text-white">
10
+ Status
11
+ </th>
12
+ <td class="py-2 "> <JobStatus {job} /></td>
13
+ </tr>
14
+ {#if job}
15
+ <tr>
16
+ <th scope="row" class="py-2 pr-6 font-bold text-gray-900 whitespace-nowrap ">
17
+ Job Id
18
+ </th>
19
+ <td class="py-2">
20
+ <a href="/run/{job?.id}">
21
+ {job?.id}
22
+ </a>
23
+ </td>
24
+ </tr>
25
+ {/if}
26
+ </tbody>
27
+ </table>
28
+ </div>
@@ -0,0 +1,17 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import type { CompletedJob, QueuedJob } from '../../gen';
3
+ declare const __propDef: {
4
+ props: {
5
+ job: QueuedJob | CompletedJob;
6
+ };
7
+ events: {
8
+ [evt: string]: CustomEvent<any>;
9
+ };
10
+ slots: {};
11
+ };
12
+ export declare type FlowPreviewStatusProps = typeof __propDef.props;
13
+ export declare type FlowPreviewStatusEvents = typeof __propDef.events;
14
+ export declare type FlowPreviewStatusSlots = typeof __propDef.slots;
15
+ export default class FlowPreviewStatus extends SvelteComponentTyped<FlowPreviewStatusProps, FlowPreviewStatusEvents, FlowPreviewStatusSlots> {
16
+ }
17
+ export {};
@@ -1,4 +1,5 @@
1
- <script>import { createEventDispatcher } from 'svelte';
1
+ <script>import { truncate } from '../../utils';
2
+ import { createEventDispatcher } from 'svelte';
2
3
  import { getTypeAsString } from '../flows/utils';
3
4
  import { computeKey } from './utils';
4
5
  import WarningMessage from './WarningMessage.svelte';
@@ -30,16 +31,15 @@ function selectProp(key) {
30
31
 
31
32
  {#if keys.length > 0}
32
33
  <span class:hidden={collapsed}>
33
- {#if level != 0}<span class="cursor-pointer hover:bg-slate-200" on:click={collapse}>(-)</span
34
+ {#if level != 0}<span class="cursor-pointer hover:bg-slate-200 px-1 rounded" on:click={collapse}
35
+ >(-)</span
34
36
  >{/if}
35
37
  <ul class="w-full">
36
38
  {#each keys as key, index}
37
- <li class={getTypeAsString(json[key]) !== 'object' ? 'hover:bg-sky-100 pt-1' : 'pt-1'}>
38
- {#if !isArray}
39
- <span class="key mr-1">{key}:</span>
40
- {:else}
41
- <span class="key mr-1">{index}:</span>
42
- {/if}
39
+ <li class="pt-1">
40
+ <button on:click={() => selectProp(key)} class="key rounded px-1 hover:bg-sky-100"
41
+ >{!isArray ? key : index}:</button
42
+ >
43
43
 
44
44
  {#if getTypeAsString(json[key]) === 'object'}
45
45
  <svelte:self
@@ -51,14 +51,14 @@ function selectProp(key) {
51
51
  on:select
52
52
  />
53
53
  {:else}
54
- <button class="val {getTypeAsString(json[key])}" on:click={() => selectProp(key)}>
54
+ <button
55
+ class="val rounded px-1 hover:bg-sky-100 {getTypeAsString(json[key])}"
56
+ on:click={() => selectProp(key)}
57
+ >
55
58
  {#if json[key] === undefined}
56
59
  <WarningMessage />
57
60
  {:else}
58
- <span> {JSON.stringify(json[key])}</span>
59
- {#if !pureViewer}
60
- <button class="ml-2 default-button-secondary py-0"> Select </button>
61
- {/if}
61
+ <span>{truncate(JSON.stringify(json[key]), 40)}</span>
62
62
  {/if}
63
63
  </button>
64
64
  {/if}
@@ -43,14 +43,15 @@ const validJSExpressionRegex = new RegExp(/^(?!(?:do|if|in|for|let|new|try|var|c
43
43
  export function computeKey(key, isArray, currentPath) {
44
44
  const isIdentifierValid = validJSExpressionRegex.test(key);
45
45
  // When an identifier is not a valid JS expression, we must use the bracket notation
46
+ const oldKey = key;
46
47
  if (!isIdentifierValid) {
47
48
  key = `["${key}"]`;
48
49
  }
49
50
  if (isArray) {
50
51
  if (currentPath === 'step') {
51
- return `${currentPath}(${key})?`;
52
+ return `step(${oldKey})`;
52
53
  }
53
- return `${currentPath}[${key}]`;
54
+ return `${currentPath}[${oldKey}]`;
54
55
  }
55
56
  else {
56
57
  if (currentPath) {
@@ -0,0 +1,172 @@
1
+ <script>import { CompletedJob, Job, JobService, Preview } from '../../gen';
2
+ import { workspaceStore } from '../../stores';
3
+ import { displayDate } from '../../utils';
4
+ import { faTimes } from '@fortawesome/free-solid-svg-icons';
5
+ import Icon from 'svelte-awesome';
6
+ import { check } from 'svelte-awesome/icons';
7
+ import Tabs from '../common/tabs/Tabs.svelte';
8
+ import Tab from '../common/tabs/Tab.svelte';
9
+ import TabContent from '../common/tabs/TabContent.svelte';
10
+ import DisplayResult from '../DisplayResult.svelte';
11
+ import TableCustom from '../TableCustom.svelte';
12
+ import Drawer from '../common/drawer/Drawer.svelte';
13
+ import { Highlight } from 'svelte-highlight';
14
+ import { json, python, typescript } from 'svelte-highlight/languages';
15
+ import DrawerContent from '../common/drawer/DrawerContent.svelte';
16
+ export let path;
17
+ export let lang;
18
+ export let previewIsLoading = false;
19
+ export let previewJob;
20
+ export let pastPreviews = [];
21
+ export let lastSave;
22
+ let selectedTab = 'logs';
23
+ let drawerOpen = false;
24
+ let drawerContent = undefined;
25
+ function openDrawer(newContent) {
26
+ drawerContent = newContent;
27
+ drawerOpen = true;
28
+ }
29
+ function closeDrawer() {
30
+ drawerOpen = false;
31
+ }
32
+ </script>
33
+
34
+ <Drawer bind:open={drawerOpen} size="800px">
35
+ <DrawerContent title={drawerContent?.title} on:close={() => closeDrawer()}>
36
+ {#if drawerContent?.mode === 'json'}
37
+ <Highlight language={json} code={JSON.stringify(drawerContent.content, null, 4)} />
38
+ {:else if drawerContent?.mode === 'plain'}
39
+ <pre class="overflow-x-auto break-all relative h-full m-2 text-xs bg-white shadow-inner p-2">
40
+ {drawerContent?.content}
41
+ </pre>
42
+ {:else if drawerContent?.mode === 'deno'}
43
+ <Highlight language={typescript} code={drawerContent?.content} />
44
+ {:else if drawerContent?.mode === 'python3'}
45
+ <Highlight language={python} code={drawerContent?.content} />
46
+ {/if}
47
+ </DrawerContent>
48
+ </Drawer>
49
+
50
+ <Tabs bind:selected={selectedTab}>
51
+ <Tab value="logs"><span class="text-xs">Logs</span></Tab>
52
+ <Tab value="results"><span class="text-xs">Results</span></Tab>
53
+ <Tab value="history"><span class="text-xs">History</span></Tab>
54
+ <Tab value="last_save"><span class="text-xs">Last save</span></Tab>
55
+
56
+ <svelte:fragment slot="content">
57
+ <div class="px-4">
58
+ <TabContent value="logs">
59
+ <pre class="whitespace-pre-wrap break-all relative h-full bg-gray-50 text-xs p-2">
60
+ {#if previewJob && previewJob.logs}
61
+ {previewJob.logs}
62
+ {:else if previewIsLoading}
63
+ Starting preview ...
64
+ {:else}
65
+ No preview is available yet
66
+ {/if}
67
+ </pre>
68
+ </TabContent>
69
+ <TabContent value="results">
70
+ <pre class="overflow-x-auto break-all relative h-full">
71
+ {#if previewJob && 'result' in previewJob && previewJob.result}
72
+ <DisplayResult result={previewJob.result} />
73
+ {:else if previewIsLoading}
74
+ Running...
75
+ {:else}
76
+ No output is available yet
77
+ {/if}
78
+ </pre>
79
+ </TabContent>
80
+ <TabContent value="history">
81
+ <TableCustom>
82
+ <tr slot="header-row">
83
+ <th class="text-xs">Id</th>
84
+ <th class="text-xs">Created at</th>
85
+ <th class="text-xs">Success</th>
86
+ <th class="text-xs">Result</th>
87
+ <th class="text-xs">Code</th>
88
+ <th class="text-xs">Logs</th>
89
+ </tr>
90
+ <tbody slot="body">
91
+ {#each pastPreviews as { id, created_at, success, result }}
92
+ <tr class="">
93
+ <td class="text-xs">
94
+ <a class="pr-3" href="/run/{id}" target="_blank">{id.substring(30)}</a>
95
+ </td>
96
+ <td class="text-xs">{displayDate(created_at)}</td>
97
+ <td class="text-xs">
98
+ {#if success}
99
+ <Icon class="text-green-600" data={check} scale={0.6} />
100
+ {:else}
101
+ <Icon class="text-red-700" data={faTimes} scale={0.6} />
102
+ {/if}
103
+ </td>
104
+ <td class="text-xs">
105
+ <a
106
+ href="#result"
107
+ class="text-xs"
108
+ on:click={() => {
109
+ openDrawer({ mode: 'json', content: result, title: 'Result' })
110
+ }}
111
+ >
112
+ {JSON.stringify(result).substring(0, 30)}...
113
+ </a>
114
+ </td>
115
+ <td class="text-xs">
116
+ <a
117
+ href="#code"
118
+ class="text-xs"
119
+ on:click={async () => {
120
+ const code = (
121
+ await JobService.getCompletedJob({
122
+ workspace: $workspaceStore ?? 'NO_W',
123
+ id
124
+ })
125
+ ).raw_code
126
+
127
+ openDrawer({ mode: lang, content: String(code), title: `Code ${lang}` })
128
+ }}
129
+ >
130
+ View code
131
+ </a>
132
+ </td>
133
+ <td>
134
+ <a
135
+ href="#logs"
136
+ class="text-xs"
137
+ on:click={async () => {
138
+ const logs = (
139
+ await JobService.getCompletedJob({
140
+ workspace: $workspaceStore ?? 'NO_W',
141
+ id
142
+ })
143
+ ).logs
144
+ openDrawer({ mode: 'plain', content: String(logs), title: `Code ${lang}` })
145
+ }}
146
+ >
147
+ View logs
148
+ </a>
149
+ </td>
150
+ </tr>
151
+ {/each}
152
+ </tbody>
153
+ </TableCustom>
154
+ </TabContent>
155
+ <TabContent value="last_save">
156
+ {#if lastSave}
157
+ <a
158
+ href="#last_save"
159
+ class="text-xs"
160
+ on:click={() => {
161
+ openDrawer({ mode: lang, content: String(lastSave), title: `Code ${lang}` })
162
+ }}
163
+ >
164
+ View last local save for path {path}
165
+ </a>
166
+ {:else}
167
+ No local save
168
+ {/if}
169
+ </TabContent>
170
+ </div>
171
+ </svelte:fragment>
172
+ </Tabs>
@@ -0,0 +1,22 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import { CompletedJob, Job, Preview } from '../../gen';
3
+ declare const __propDef: {
4
+ props: {
5
+ path: string | undefined;
6
+ lang: Preview.language;
7
+ previewIsLoading?: boolean | undefined;
8
+ previewJob: Job | undefined;
9
+ pastPreviews?: CompletedJob[] | undefined;
10
+ lastSave: string | null;
11
+ };
12
+ events: {
13
+ [evt: string]: CustomEvent<any>;
14
+ };
15
+ slots: {};
16
+ };
17
+ export declare type LogPanelProps = typeof __propDef.props;
18
+ export declare type LogPanelEvents = typeof __propDef.events;
19
+ export declare type LogPanelSlots = typeof __propDef.slots;
20
+ export default class LogPanel extends SvelteComponentTyped<LogPanelProps, LogPanelEvents, LogPanelSlots> {
21
+ }
22
+ export {};
@@ -0,0 +1,49 @@
1
+ <script>import { classNames } from '../../utils';
2
+ import { navigating } from '$app/stores';
3
+ import Icon from 'svelte-awesome';
4
+ export let label;
5
+ export let href;
6
+ export let icon;
7
+ export let isCollapsed;
8
+ export let disabled = false;
9
+ let isSelected = false;
10
+ navigating.subscribe(() => {
11
+ if (href === '/') {
12
+ isSelected = window.location.pathname === href;
13
+ }
14
+ else {
15
+ isSelected = window.location.pathname.includes(href);
16
+ }
17
+ });
18
+ </script>
19
+
20
+ {#if !disabled}
21
+ <a
22
+ {href}
23
+ class={classNames(
24
+ 'group flex items-center px-2 py-2 text-sm font-medium rounded-md h-8',
25
+ isSelected ? 'bg-gray-50 text-gray-900' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900'
26
+ )}
27
+ target={href.includes('http') ? '_blank' : null}
28
+ >
29
+ <Icon
30
+ data={icon}
31
+ class={classNames(
32
+ ' flex-shrink-0 h-4 w-4',
33
+ isSelected ? ' text-gray-700' : 'text-white group-hover:text-gray-500',
34
+ isCollapsed ? '-mr-1' : 'mr-3'
35
+ )}
36
+ />
37
+
38
+ {#if !isCollapsed}
39
+ <span
40
+ class={classNames(
41
+ 'whitespace-pre text-white',
42
+ isSelected ? ' text-gray-700 font-bold' : 'text-white group-hover:text-gray-500'
43
+ )}
44
+ >
45
+ {label}
46
+ </span>
47
+ {/if}
48
+ </a>
49
+ {/if}
@@ -0,0 +1,21 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import type { IconDefinition } from '@fortawesome/free-solid-svg-icons';
3
+ declare const __propDef: {
4
+ props: {
5
+ label: string;
6
+ href: string;
7
+ icon: IconDefinition;
8
+ isCollapsed: boolean;
9
+ disabled?: boolean | undefined;
10
+ };
11
+ events: {
12
+ [evt: string]: CustomEvent<any>;
13
+ };
14
+ slots: {};
15
+ };
16
+ export declare type MenuLinkProps = typeof __propDef.props;
17
+ export declare type MenuLinkEvents = typeof __propDef.events;
18
+ export declare type MenuLinkSlots = typeof __propDef.slots;
19
+ export default class MenuLink extends SvelteComponentTyped<MenuLinkProps, MenuLinkEvents, MenuLinkSlots> {
20
+ }
21
+ export {};