windmill-components 1.60.0 → 1.60.2
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.
- package/components/SchemaModal.svelte +8 -0
- package/components/apps/components/table/AppTable.svelte +16 -10
- package/components/apps/components/table/AppTableFooter.svelte +7 -1
- package/components/apps/editor/AppEditorHeader.svelte +11 -13
- package/components/apps/editor/AppExportButton.svelte +4 -3
- package/components/apps/editor/AppExportButton.svelte.d.ts +2 -3
- package/components/apps/editor/componentsPanel/data.js +2 -3
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +1 -1
- package/components/apps/editorUtils.js +251 -14
- package/components/apps/utils.d.ts +5 -1
- package/components/apps/utils.js +10 -0
- package/components/icons/SurrealdbIcon.svelte +13 -0
- package/components/icons/SurrealdbIcon.svelte.d.ts +17 -0
- package/components/icons/index.d.ts +3 -1
- package/components/icons/index.js +3 -1
- package/components/jobs/JobDetail.svelte +33 -38
- package/package.json +518 -517
|
@@ -35,6 +35,12 @@ export let oldArgName = undefined;
|
|
|
35
35
|
let resource_type = undefined;
|
|
36
36
|
const dispatch = createEventDispatcher();
|
|
37
37
|
let drawer;
|
|
38
|
+
function handleKeyUp(event) {
|
|
39
|
+
const key = event.key;
|
|
40
|
+
if (key === 'Enter') {
|
|
41
|
+
dispatch('save');
|
|
42
|
+
}
|
|
43
|
+
}
|
|
38
44
|
export function openDrawer() {
|
|
39
45
|
drawer.openDrawer();
|
|
40
46
|
resource_type = property.format?.substring(5);
|
|
@@ -66,6 +72,8 @@ else {
|
|
|
66
72
|
}
|
|
67
73
|
</script>
|
|
68
74
|
|
|
75
|
+
<svelte:window on:keyup={handleKeyUp} />
|
|
76
|
+
|
|
69
77
|
<Drawer bind:this={drawer} placement="right">
|
|
70
78
|
<DrawerContent on:close={clearModal} title="Add an argument">
|
|
71
79
|
<div class="flex flex-col gap-6">
|
|
@@ -90,18 +90,18 @@ $: result && rerender();
|
|
|
90
90
|
{#if Array.isArray(result) && result.every(isObject)}
|
|
91
91
|
<div class="border border-gray-300 shadow-sm divide-y divide-gray-300 flex flex-col h-full">
|
|
92
92
|
{#if search !== 'Disabled'}
|
|
93
|
-
<div class="px-
|
|
93
|
+
<div class="px-2 py-1">
|
|
94
94
|
<div class="flex items-center">
|
|
95
|
-
<div>
|
|
95
|
+
<div class="grow max-w-[300px]">
|
|
96
96
|
<DebouncedInput placeholder="Search..." bind:value={searchValue} />
|
|
97
97
|
</div>
|
|
98
98
|
</div>
|
|
99
99
|
</div>
|
|
100
100
|
{/if}
|
|
101
101
|
|
|
102
|
-
<div class="overflow-auto flex-1 w-full">
|
|
103
|
-
<table class="
|
|
104
|
-
<thead class="bg-gray-50 text-left">
|
|
102
|
+
<div class="overflow-x-auto flex-1 w-full">
|
|
103
|
+
<table class="relative w-full border-b border-b-gray-200">
|
|
104
|
+
<thead class="sticky top-0 bg-gray-50 text-left">
|
|
105
105
|
{#each $table.getHeaderGroups() as headerGroup}
|
|
106
106
|
<tr class="divide-x">
|
|
107
107
|
{#each headerGroup.headers as header}
|
|
@@ -109,16 +109,22 @@ $: result && rerender();
|
|
|
109
109
|
{@const context = header?.getContext()}
|
|
110
110
|
{#if context}
|
|
111
111
|
{@const component = renderCell(header.column.columnDef.header, context)}
|
|
112
|
-
<th class="
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
<th class="!p-0">
|
|
113
|
+
<span class="block px-4 py-4 text-sm font-semibold border-b">
|
|
114
|
+
{#if !header.isPlaceholder && component}
|
|
115
|
+
<svelte:component this={component} />
|
|
116
|
+
{/if}
|
|
117
|
+
</span>
|
|
116
118
|
</th>
|
|
117
119
|
{/if}
|
|
118
120
|
{/if}
|
|
119
121
|
{/each}
|
|
120
122
|
{#if actionButtons.length > 0}
|
|
121
|
-
<th class="
|
|
123
|
+
<th class="!p-0">
|
|
124
|
+
<span class="block px-4 py-4 text-sm font-semibold border-b">
|
|
125
|
+
Actions
|
|
126
|
+
</span>
|
|
127
|
+
</th>
|
|
122
128
|
{/if}
|
|
123
129
|
</tr>
|
|
124
130
|
{/each}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>import Button from '../../../common/button/Button.svelte';
|
|
2
2
|
import { faDownload } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
+
import { ChevronLeft, ChevronRight } from 'lucide-svelte';
|
|
3
4
|
import { tableOptions } from './tableOptions';
|
|
4
5
|
export let result;
|
|
5
6
|
export let paginationEnabled = false;
|
|
@@ -15,26 +16,30 @@ function downloadResultAsJSON() {
|
|
|
15
16
|
}
|
|
16
17
|
</script>
|
|
17
18
|
|
|
18
|
-
<div class="px-
|
|
19
|
+
<div class="px-2 py-1 text-xs flex flex-row gap-2 items-center justify-between">
|
|
19
20
|
{#if paginationEnabled && result.length > (tableOptions.initialState?.pagination?.pageSize ?? 25)}
|
|
20
21
|
<div class="flex items-center gap-2 flex-row">
|
|
21
22
|
<Button
|
|
22
23
|
size="xs"
|
|
23
24
|
variant="border"
|
|
24
25
|
color="light"
|
|
26
|
+
btnClasses="!py-1 !pl-1"
|
|
25
27
|
on:click={() => $table.previousPage()}
|
|
26
28
|
disabled={!$table.getCanPreviousPage()}
|
|
27
29
|
>
|
|
30
|
+
<ChevronLeft size={14} />
|
|
28
31
|
Previous
|
|
29
32
|
</Button>
|
|
30
33
|
<Button
|
|
31
34
|
size="xs"
|
|
32
35
|
variant="border"
|
|
33
36
|
color="light"
|
|
37
|
+
btnClasses="!py-1 !pr-1"
|
|
34
38
|
on:click={() => $table.nextPage()}
|
|
35
39
|
disabled={!$table.getCanNextPage()}
|
|
36
40
|
>
|
|
37
41
|
Next
|
|
42
|
+
<ChevronRight size={14} />
|
|
38
43
|
</Button>
|
|
39
44
|
{$table.getState().pagination.pageIndex + 1} of {$table.getPageCount()}
|
|
40
45
|
</div>
|
|
@@ -46,6 +51,7 @@ function downloadResultAsJSON() {
|
|
|
46
51
|
size="xs"
|
|
47
52
|
variant="border"
|
|
48
53
|
color="light"
|
|
54
|
+
btnClasses="!py-1"
|
|
49
55
|
on:click={downloadResultAsJSON}
|
|
50
56
|
startIcon={{ icon: faDownload }}
|
|
51
57
|
>
|
|
@@ -24,6 +24,7 @@ import { getContext } from 'svelte';
|
|
|
24
24
|
import { Icon } from 'svelte-awesome';
|
|
25
25
|
import { Pane, Splitpanes } from 'svelte-splitpanes';
|
|
26
26
|
import { appToHubUrl, classNames, copyToClipboard, sendUserToast } from '../../../utils';
|
|
27
|
+
import { toStatic } from '../utils';
|
|
27
28
|
import AppExportButton from './AppExportButton.svelte';
|
|
28
29
|
import PanelSection from './settingsPanel/common/PanelSection.svelte';
|
|
29
30
|
async function hash(message) {
|
|
@@ -48,16 +49,6 @@ let publishDrawerOpen = false;
|
|
|
48
49
|
function closeSaveDrawer() {
|
|
49
50
|
saveDrawerOpen = false;
|
|
50
51
|
}
|
|
51
|
-
function toStatic() {
|
|
52
|
-
const newApp = JSON.parse(JSON.stringify($app));
|
|
53
|
-
newApp.grid.forEach((x) => {
|
|
54
|
-
let c = x.data;
|
|
55
|
-
if (c.componentInput?.type == 'runnable') {
|
|
56
|
-
c.componentInput.value = $staticExporter[x.id]();
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
return { app: newApp, summary: $summary };
|
|
60
|
-
}
|
|
61
52
|
async function computeTriggerables() {
|
|
62
53
|
const allTriggers = await Promise.all($app.grid
|
|
63
54
|
.flatMap((x) => {
|
|
@@ -383,16 +374,23 @@ $: selectedJobId && testJobLoader?.watchJob(selectedJobId);
|
|
|
383
374
|
displayName: 'JSON',
|
|
384
375
|
icon: faFileExport,
|
|
385
376
|
action: () => {
|
|
386
|
-
appExport.open()
|
|
377
|
+
appExport.open($app)
|
|
387
378
|
}
|
|
388
379
|
},
|
|
389
380
|
{
|
|
390
381
|
displayName: 'Publish to Hub',
|
|
391
382
|
icon: faGlobe,
|
|
392
383
|
action: () => {
|
|
393
|
-
const url = appToHubUrl(toStatic())
|
|
384
|
+
const url = appToHubUrl(toStatic($app, $staticExporter, $summary))
|
|
394
385
|
window.open(url.toString(), '_blank')
|
|
395
386
|
}
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
displayName: 'Hub compatible JSON',
|
|
390
|
+
icon: faFileExport,
|
|
391
|
+
action: () => {
|
|
392
|
+
appExport.open(toStatic($app, $staticExporter, $summary).app)
|
|
393
|
+
}
|
|
396
394
|
}
|
|
397
395
|
]}
|
|
398
396
|
>
|
|
@@ -409,7 +407,7 @@ $: selectedJobId && testJobLoader?.watchJob(selectedJobId);
|
|
|
409
407
|
<span class="hidden md:inline">Debug Runs</span>
|
|
410
408
|
</Button>
|
|
411
409
|
</span>
|
|
412
|
-
<AppExportButton bind:this={appExport}
|
|
410
|
+
<AppExportButton bind:this={appExport} />
|
|
413
411
|
<Button
|
|
414
412
|
on:click={() => (publishDrawerOpen = true)}
|
|
415
413
|
color="light"
|
|
@@ -6,10 +6,11 @@ import { Highlight } from 'svelte-highlight';
|
|
|
6
6
|
import json from 'svelte-highlight/languages/json';
|
|
7
7
|
import { Button } from '../../common';
|
|
8
8
|
let jsonViewerDrawer;
|
|
9
|
-
|
|
9
|
+
let app = undefined;
|
|
10
|
+
export function open(app_l) {
|
|
11
|
+
app = app_l;
|
|
10
12
|
jsonViewerDrawer?.toggleDrawer();
|
|
11
13
|
}
|
|
12
|
-
export let app;
|
|
13
14
|
</script>
|
|
14
15
|
|
|
15
16
|
<Drawer bind:this={jsonViewerDrawer} size="800px">
|
|
@@ -25,7 +26,7 @@ export let app;
|
|
|
25
26
|
>
|
|
26
27
|
Copy content
|
|
27
28
|
</Button>
|
|
28
|
-
<Highlight language={json} code={JSON.stringify(app, null, 4)} />
|
|
29
|
+
<Highlight language={json} code={JSON.stringify(app ?? {}, null, 4)} />
|
|
29
30
|
</div>
|
|
30
31
|
</DrawerContent>
|
|
31
32
|
</Drawer>
|
|
@@ -2,8 +2,7 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
import type { App } from '../types';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
open?: (() => void) | undefined;
|
|
6
|
-
app: App;
|
|
5
|
+
open?: ((app_l: App) => void) | undefined;
|
|
7
6
|
};
|
|
8
7
|
events: {
|
|
9
8
|
[evt: string]: CustomEvent<any>;
|
|
@@ -14,6 +13,6 @@ export type AppExportButtonProps = typeof __propDef.props;
|
|
|
14
13
|
export type AppExportButtonEvents = typeof __propDef.events;
|
|
15
14
|
export type AppExportButtonSlots = typeof __propDef.slots;
|
|
16
15
|
export default class AppExportButton extends SvelteComponentTyped<AppExportButtonProps, AppExportButtonEvents, AppExportButtonSlots> {
|
|
17
|
-
get open(): () => void;
|
|
16
|
+
get open(): (app_l: App) => void;
|
|
18
17
|
}
|
|
19
18
|
export {};
|
|
@@ -220,10 +220,9 @@ const display = {
|
|
|
220
220
|
value: `<img
|
|
221
221
|
src="https://images.unsplash.com/photo-1554629947-334ff61d85dc?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1024&h=1280&q=80"
|
|
222
222
|
>
|
|
223
|
-
<
|
|
223
|
+
<h1 class="absolute top-4 left-2 text-white">
|
|
224
224
|
Hello \${ctx.username}
|
|
225
|
-
</
|
|
226
|
-
`,
|
|
225
|
+
</h1>`,
|
|
227
226
|
},
|
|
228
227
|
configuration: {},
|
|
229
228
|
card: false
|
|
@@ -1,16 +1,253 @@
|
|
|
1
1
|
export function defaultCode(component, language) {
|
|
2
|
-
|
|
3
|
-
return `export async function main(x: string) {
|
|
4
|
-
return [
|
|
5
|
-
{ foo: x, bar: 42 },
|
|
6
|
-
{ foo: "static", bar: 84 }]
|
|
7
|
-
}`;
|
|
8
|
-
}
|
|
9
|
-
else if (component === 'tablecomponent' && language === 'python3') {
|
|
10
|
-
return `def main(x: str):
|
|
11
|
-
return [
|
|
12
|
-
{ "foo": x, "bar": 42 },
|
|
13
|
-
{ "foo": "static", "bar": 84 }]`;
|
|
14
|
-
}
|
|
15
|
-
return undefined;
|
|
2
|
+
return DEFAULT_CODES[component]?.[language];
|
|
16
3
|
}
|
|
4
|
+
const DEFAULT_CODES = {
|
|
5
|
+
tablecomponent: {
|
|
6
|
+
deno: `export async function main() {
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
"id": 1,
|
|
10
|
+
"name": "A cell with a long name",
|
|
11
|
+
"age": 42
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"id": 2,
|
|
15
|
+
"name": "A briefer cell",
|
|
16
|
+
"age": 84
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}`,
|
|
20
|
+
python3: `def main():
|
|
21
|
+
return [
|
|
22
|
+
{
|
|
23
|
+
"id": 1,
|
|
24
|
+
"name": "A cell with a long name",
|
|
25
|
+
"age": 42
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": 2,
|
|
29
|
+
"name": "A briefer cell",
|
|
30
|
+
"age": 84
|
|
31
|
+
}
|
|
32
|
+
]`,
|
|
33
|
+
},
|
|
34
|
+
textcomponent: {
|
|
35
|
+
deno: `export async function main() {
|
|
36
|
+
return "foo"
|
|
37
|
+
}`,
|
|
38
|
+
python3: `def main():
|
|
39
|
+
return "foo"`,
|
|
40
|
+
},
|
|
41
|
+
barchartcomponent: {
|
|
42
|
+
deno: `export async function main() {
|
|
43
|
+
return {
|
|
44
|
+
"data": [
|
|
45
|
+
25,
|
|
46
|
+
50,
|
|
47
|
+
25
|
|
48
|
+
],
|
|
49
|
+
"labels": [
|
|
50
|
+
"Bar",
|
|
51
|
+
"Charts",
|
|
52
|
+
"<3"
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
}`,
|
|
56
|
+
python3: `def main():
|
|
57
|
+
return {
|
|
58
|
+
"data": [
|
|
59
|
+
25,
|
|
60
|
+
50,
|
|
61
|
+
25
|
|
62
|
+
],
|
|
63
|
+
"labels": [
|
|
64
|
+
"Bar",
|
|
65
|
+
"Charts",
|
|
66
|
+
"<3"
|
|
67
|
+
]
|
|
68
|
+
}`,
|
|
69
|
+
},
|
|
70
|
+
displaycomponent: {
|
|
71
|
+
deno: `export async function main() {
|
|
72
|
+
return {
|
|
73
|
+
"foo": 42
|
|
74
|
+
}
|
|
75
|
+
}`,
|
|
76
|
+
python3: `def main():
|
|
77
|
+
return {
|
|
78
|
+
"foo": 42
|
|
79
|
+
}`,
|
|
80
|
+
},
|
|
81
|
+
htmlcomponent: {
|
|
82
|
+
deno: `export async function main() {
|
|
83
|
+
return \`<img
|
|
84
|
+
src="https://images.unsplash.com/photo-1554629947-334ff61d85dc?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1024&h=1280&q=80"
|
|
85
|
+
>
|
|
86
|
+
<h1 class="absolute top-4 left-2 text-white">
|
|
87
|
+
Hello world
|
|
88
|
+
</h1>\`
|
|
89
|
+
}`,
|
|
90
|
+
python3: `def main():
|
|
91
|
+
return '''<img
|
|
92
|
+
src="https://images.unsplash.com/photo-1554629947-334ff61d85dc?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1024&h=1280&q=80"
|
|
93
|
+
>
|
|
94
|
+
<h1 class="absolute top-4 left-2 text-white">
|
|
95
|
+
Hello world
|
|
96
|
+
</h1>'''`,
|
|
97
|
+
},
|
|
98
|
+
piechartcomponent: {
|
|
99
|
+
deno: `export async function main() {
|
|
100
|
+
return {
|
|
101
|
+
"data": [
|
|
102
|
+
25,
|
|
103
|
+
50,
|
|
104
|
+
25
|
|
105
|
+
],
|
|
106
|
+
"labels": [
|
|
107
|
+
"Pie",
|
|
108
|
+
"Charts",
|
|
109
|
+
"<3"
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
}`,
|
|
113
|
+
python3: `def main():
|
|
114
|
+
return {
|
|
115
|
+
"data": [
|
|
116
|
+
25,
|
|
117
|
+
50,
|
|
118
|
+
25
|
|
119
|
+
],
|
|
120
|
+
"labels": [
|
|
121
|
+
"Pie",
|
|
122
|
+
"Charts",
|
|
123
|
+
"<3"
|
|
124
|
+
]
|
|
125
|
+
}`,
|
|
126
|
+
},
|
|
127
|
+
scatterchartcomponent: {
|
|
128
|
+
deno: `export async function main() {
|
|
129
|
+
return [
|
|
130
|
+
{
|
|
131
|
+
"label": "foo",
|
|
132
|
+
"data": [
|
|
133
|
+
{ "x": 25, "y": 50 },
|
|
134
|
+
{ "x": 23, "y": 23 },
|
|
135
|
+
{ "x": 12, "y": 37 }
|
|
136
|
+
],
|
|
137
|
+
"backgroundColor": "rgb(255, 12, 137)"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"label": "bar",
|
|
141
|
+
"data": [
|
|
142
|
+
{ "x": 32, "y": 32 },
|
|
143
|
+
{ "x": 25, "y": 42 },
|
|
144
|
+
{ "x": 3, "y": 27 }
|
|
145
|
+
],
|
|
146
|
+
"backgroundColor": "orange"
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
}`,
|
|
150
|
+
python3: `def main():
|
|
151
|
+
return [
|
|
152
|
+
{
|
|
153
|
+
"label": "foo",
|
|
154
|
+
"data": [
|
|
155
|
+
{ "x": 25, "y": 50 },
|
|
156
|
+
{ "x": 23, "y": 23 },
|
|
157
|
+
{ "x": 12, "y": 37 }
|
|
158
|
+
],
|
|
159
|
+
"backgroundColor": "rgb(255, 12, 137)"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"label": "bar",
|
|
163
|
+
"data": [
|
|
164
|
+
{ "x": 32, "y": 32 },
|
|
165
|
+
{ "x": 25, "y": 42 },
|
|
166
|
+
{ "x": 3, "y": 27 }
|
|
167
|
+
],
|
|
168
|
+
"backgroundColor": "orange"
|
|
169
|
+
}
|
|
170
|
+
]`,
|
|
171
|
+
},
|
|
172
|
+
timeseriescomponent: {
|
|
173
|
+
deno: `export async function main() {
|
|
174
|
+
return [
|
|
175
|
+
{
|
|
176
|
+
"label": "foo",
|
|
177
|
+
"data": [
|
|
178
|
+
{
|
|
179
|
+
"x": "2021-11-06 23:39:30",
|
|
180
|
+
"y": 50
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"x": "2021-11-07 01:00:28",
|
|
184
|
+
"y": 60
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"x": "2021-11-07 09:00:28",
|
|
188
|
+
"y": 20
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
"backgroundColor": "rgb(255, 12, 137)"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"label": "bar",
|
|
195
|
+
"data": [
|
|
196
|
+
{
|
|
197
|
+
"x": "2021-11-06 23:39:30",
|
|
198
|
+
"y": 20
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"x": "2021-11-07 01:00:28",
|
|
202
|
+
"y": 13
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"x": "2021-11-07 09:00:28",
|
|
206
|
+
"y": 45
|
|
207
|
+
}
|
|
208
|
+
],
|
|
209
|
+
"backgroundColor": "orange"
|
|
210
|
+
}
|
|
211
|
+
]
|
|
212
|
+
}`,
|
|
213
|
+
python3: `def main():
|
|
214
|
+
return [
|
|
215
|
+
{
|
|
216
|
+
"label": "foo",
|
|
217
|
+
"data": [
|
|
218
|
+
{
|
|
219
|
+
"x": "2021-11-06 23:39:30",
|
|
220
|
+
"y": 50
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"x": "2021-11-07 01:00:28",
|
|
224
|
+
"y": 60
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"x": "2021-11-07 09:00:28",
|
|
228
|
+
"y": 20
|
|
229
|
+
}
|
|
230
|
+
],
|
|
231
|
+
"backgroundColor": "rgb(255, 12, 137)"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"label": "bar",
|
|
235
|
+
"data": [
|
|
236
|
+
{
|
|
237
|
+
"x": "2021-11-06 23:39:30",
|
|
238
|
+
"y": 20
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"x": "2021-11-07 01:00:28",
|
|
242
|
+
"y": 13
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"x": "2021-11-07 09:00:28",
|
|
246
|
+
"y": 45
|
|
247
|
+
}
|
|
248
|
+
],
|
|
249
|
+
"backgroundColor": "orange"
|
|
250
|
+
}
|
|
251
|
+
]`,
|
|
252
|
+
},
|
|
253
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Schema } from '../../common';
|
|
2
2
|
import type { AppInput, InputType, ResultAppInput, StaticAppInput } from './inputType';
|
|
3
|
-
import type { AppComponent } from './types';
|
|
3
|
+
import type { App, AppComponent } from './types';
|
|
4
4
|
export declare function loadSchema(workspace: string, path: string, runType: 'script' | 'flow' | 'hubscript'): Promise<Schema>;
|
|
5
5
|
export declare function schemaToInputsSpec(schema: Schema, defaultUserInput: boolean): Record<string, StaticAppInput>;
|
|
6
6
|
export declare const displayData: Record<AppComponent['type'], {
|
|
@@ -12,3 +12,7 @@ export declare function fieldTypeToTsType(inputType: InputType): string;
|
|
|
12
12
|
export declare function isScriptByNameDefined(appInput: AppInput | undefined): boolean;
|
|
13
13
|
export declare function isScriptByPathDefined(appInput: AppInput | undefined): boolean;
|
|
14
14
|
export declare function clearResultAppInput(appInput: ResultAppInput): ResultAppInput;
|
|
15
|
+
export declare function toStatic(app: App, staticExporter: Record<string, () => any>, summary: string): {
|
|
16
|
+
app: App;
|
|
17
|
+
summary: string;
|
|
18
|
+
};
|
package/components/apps/utils.js
CHANGED
|
@@ -188,3 +188,13 @@ export function clearResultAppInput(appInput) {
|
|
|
188
188
|
}
|
|
189
189
|
return appInput;
|
|
190
190
|
}
|
|
191
|
+
export function toStatic(app, staticExporter, summary) {
|
|
192
|
+
const newApp = JSON.parse(JSON.stringify(app));
|
|
193
|
+
newApp.grid.forEach((x) => {
|
|
194
|
+
let c = x.data;
|
|
195
|
+
if (c.componentInput?.type == 'runnable') {
|
|
196
|
+
c.componentInput.value = staticExporter[x.id]();
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
return { app: newApp, summary };
|
|
200
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script>export let height = '24px';
|
|
2
|
+
export let width = '24px';
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg {width} {height} viewBox="0 0 168 168" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6
|
+
<path d="M84.1501 44.6726L123.672 66.5598V57.7846L84.1501 35.9483C78.2718 39.2008 49.8625 54.9047 44.6279 57.7846C49.4898 60.4781 100.549 88.684 131.584 105.828V114.569C127.365 116.907 84.1501 140.776 84.1501 140.776C72.3256 134.254 48.5242 121.108 36.7167 114.569V88.3622L84.1501 114.569L92.0613 110.198L28.8055 75.2672V118.957L84.1501 149.517C89.605 146.502 135.446 121.176 139.478 118.94V101.474L60.4334 57.7846L84.1501 44.6726ZM28.8055 49.0433V66.5259L107.85 110.215L84.1332 123.327L44.611 101.44V110.215L84.1332 132.052C90.0115 128.799 118.421 113.095 123.655 110.215C118.793 107.522 67.7517 79.316 36.7167 62.1552V53.4139C40.9349 51.0761 84.1501 27.207 84.1501 27.207C95.9576 33.746 119.759 46.8918 131.584 53.4139V79.6209L84.1501 53.4139L76.2389 57.7846L139.478 92.7328V49.0433L84.1501 18.4657C78.6783 21.498 32.8543 46.8241 28.8055 49.0433ZM84.1501 1L13 40.3189V127.681L84.1501 167L155.3 127.698V40.3189L84.1501 1ZM147.372 123.31L84.1501 158.259L20.9112 123.31V44.6896L84.1501 9.7413L147.389 44.6896L147.372 123.31Z" fill="url(#paint0_linear_215_188)"/>
|
|
7
|
+
<defs>
|
|
8
|
+
<linearGradient id="paint0_linear_215_188" x1="47.4481" y1="20.4303" x2="120.859" y2="147.582" gradientUnits="userSpaceOnUse">
|
|
9
|
+
<stop stop-color="#FF00A0"/>
|
|
10
|
+
<stop offset="1" stop-color="#9600FF"/>
|
|
11
|
+
</linearGradient>
|
|
12
|
+
</defs>
|
|
13
|
+
</svg>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
height?: string | undefined;
|
|
5
|
+
width?: string | undefined;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {};
|
|
11
|
+
};
|
|
12
|
+
export type SurrealdbIconProps = typeof __propDef.props;
|
|
13
|
+
export type SurrealdbIconEvents = typeof __propDef.events;
|
|
14
|
+
export type SurrealdbIconSlots = typeof __propDef.slots;
|
|
15
|
+
export default class SurrealdbIcon extends SvelteComponentTyped<SurrealdbIconProps, SurrealdbIconEvents, SurrealdbIconSlots> {
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -44,6 +44,7 @@ import RedditIcon from './RedditIcon.svelte';
|
|
|
44
44
|
import SupabaseIcon from './SupabaseIcon.svelte';
|
|
45
45
|
import WebdavIcon from './WebdavIcon.svelte';
|
|
46
46
|
import ZammadIcon from './ZammadIcon.svelte';
|
|
47
|
+
import SurrealdbIcon from './SurrealdbIcon.svelte';
|
|
47
48
|
export declare const APP_TO_ICON_COMPONENT: {
|
|
48
49
|
readonly postgresql: typeof PostgresIcon;
|
|
49
50
|
readonly mysql: typeof Mysql;
|
|
@@ -94,5 +95,6 @@ export declare const APP_TO_ICON_COMPONENT: {
|
|
|
94
95
|
readonly webdav: typeof WebdavIcon;
|
|
95
96
|
readonly zammad: typeof ZammadIcon;
|
|
96
97
|
readonly nextcloud: typeof NextcloudIcon;
|
|
98
|
+
readonly surrealdb: typeof SurrealdbIcon;
|
|
97
99
|
};
|
|
98
|
-
export { AirtableIcon, DbIcon, DiscordIcon, GcalIcon, GCloudIcon, GdriveIcon, GithubIcon, GitlabIcon, GmailIcon, GSheetsIcon, HttpIcon, Mail, MastodonIcon, MatrixIcon, Mysql, PostgresIcon, S3Icon, Slack, TogglIcon, WindmillIcon, MailchimpIcon, SendgridIcon, LinkedinIcon, HubspotIcon, TelegramIcon, StripeIcon, DatadogIcon, FunkwhaleIcon, GdocsIcon, FaunadbIcon, ClickhouseIcon, OpenaiIcon, AwsIcon, BcryptIcon, GoogleIcon, HackernewsIcon, MongodbIcon, RedditIcon, SupabaseIcon, WebdavIcon, ZammadIcon, NextcloudIcon, SendflakeIcon, };
|
|
100
|
+
export { AirtableIcon, DbIcon, DiscordIcon, GcalIcon, GCloudIcon, GdriveIcon, GithubIcon, GitlabIcon, GmailIcon, GSheetsIcon, HttpIcon, Mail, MastodonIcon, MatrixIcon, Mysql, PostgresIcon, S3Icon, Slack, TogglIcon, WindmillIcon, MailchimpIcon, SendgridIcon, LinkedinIcon, HubspotIcon, TelegramIcon, StripeIcon, DatadogIcon, FunkwhaleIcon, GdocsIcon, FaunadbIcon, ClickhouseIcon, OpenaiIcon, AwsIcon, BcryptIcon, GoogleIcon, HackernewsIcon, MongodbIcon, RedditIcon, SupabaseIcon, WebdavIcon, ZammadIcon, NextcloudIcon, SendflakeIcon, SurrealdbIcon, };
|
|
@@ -44,6 +44,7 @@ import RedditIcon from './RedditIcon.svelte';
|
|
|
44
44
|
import SupabaseIcon from './SupabaseIcon.svelte';
|
|
45
45
|
import WebdavIcon from './WebdavIcon.svelte';
|
|
46
46
|
import ZammadIcon from './ZammadIcon.svelte';
|
|
47
|
+
import SurrealdbIcon from './SurrealdbIcon.svelte';
|
|
47
48
|
export const APP_TO_ICON_COMPONENT = {
|
|
48
49
|
postgresql: PostgresIcon,
|
|
49
50
|
mysql: Mysql,
|
|
@@ -94,5 +95,6 @@ export const APP_TO_ICON_COMPONENT = {
|
|
|
94
95
|
webdav: WebdavIcon,
|
|
95
96
|
zammad: ZammadIcon,
|
|
96
97
|
nextcloud: NextcloudIcon,
|
|
98
|
+
surrealdb: SurrealdbIcon,
|
|
97
99
|
};
|
|
98
|
-
export { AirtableIcon, DbIcon, DiscordIcon, GcalIcon, GCloudIcon, GdriveIcon, GithubIcon, GitlabIcon, GmailIcon, GSheetsIcon, HttpIcon, Mail, MastodonIcon, MatrixIcon, Mysql, PostgresIcon, S3Icon, Slack, TogglIcon, WindmillIcon, MailchimpIcon, SendgridIcon, LinkedinIcon, HubspotIcon, TelegramIcon, StripeIcon, DatadogIcon, FunkwhaleIcon, GdocsIcon, FaunadbIcon, ClickhouseIcon, OpenaiIcon, AwsIcon, BcryptIcon, GoogleIcon, HackernewsIcon, MongodbIcon, RedditIcon, SupabaseIcon, WebdavIcon, ZammadIcon, NextcloudIcon, SendflakeIcon, };
|
|
100
|
+
export { AirtableIcon, DbIcon, DiscordIcon, GcalIcon, GCloudIcon, GdriveIcon, GithubIcon, GitlabIcon, GmailIcon, GSheetsIcon, HttpIcon, Mail, MastodonIcon, MatrixIcon, Mysql, PostgresIcon, S3Icon, Slack, TogglIcon, WindmillIcon, MailchimpIcon, SendgridIcon, LinkedinIcon, HubspotIcon, TelegramIcon, StripeIcon, DatadogIcon, FunkwhaleIcon, GdocsIcon, FaunadbIcon, ClickhouseIcon, OpenaiIcon, AwsIcon, BcryptIcon, GoogleIcon, HackernewsIcon, MongodbIcon, RedditIcon, SupabaseIcon, WebdavIcon, ZammadIcon, NextcloudIcon, SendflakeIcon, SurrealdbIcon, };
|