Compare commits

..

5 Commits

Author SHA1 Message Date
Faton Ramadani
c978678708 Merge branch 'main' into fix-icon-only 2023-04-13 09:27:45 +02:00
Ruben Fiszel
8928cfa3d7 fix refreshOn 2023-04-13 09:22:52 +02:00
Ruben Fiszel
a5499c26f3 fix(backend): deno uses --no-check 2023-04-13 00:22:46 +02:00
Faton Ramadani
7dc7ecef55 feat(frontend): Update airtable instructions (#1403) 2023-04-12 23:54:23 +02:00
Faton Ramadani
1b8d6579f6 feat(frontend): Remove gap when button label is empty 2023-04-12 15:15:49 +02:00
12 changed files with 22 additions and 129 deletions

View File

@@ -1810,10 +1810,11 @@ async fn handle_deno_job(
//do not cache local dependencies
let reload = format!("--reload={base_internal_url}");
let child = async {
let mut args = Vec::new();
let script_path = format!("{job_dir}/wrapper.ts");
let import_map_path = format!("{job_dir}/import_map.json");
let mut args = Vec::new();
args.push("run");
args.push("--no-check");
args.push("--import-map");
args.push(&import_map_path);
args.push(&reload);

View File

@@ -1,86 +0,0 @@
version: "3.7"
services:
db:
image: postgres:14
restart: unless-stopped
volumes:
- db_data:/var/lib/postgresql/data
expose:
- 5432
ports:
- 5432:5432
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: windmill
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
windmill_server:
image: ghcr.io/windmill-labs/windmill:main
deploy:
replicas: 1
restart: unless-stopped
expose:
- 8000
ports:
- 8000:8000
environment:
- DATABASE_URL=postgres://postgres:${DB_PASSWORD}@db/windmill?sslmode=disable
- BASE_URL=http://${WM_BASE_URL}
- RUST_LOG=info
## You can set the number of workers to > 0 and not need any separate worker service
- NUM_WORKERS=0
- DISABLE_SERVER=false
- METRICS_ADDR=false
depends_on:
db:
condition: service_healthy
# volumes:
# - ./oauth.json/:/usr/src/app/oauth.json
windmill_worker:
image: ghcr.io/windmill-labs/windmill:main
deploy:
replicas: 3
restart: unless-stopped
environment:
- DATABASE_URL=postgres://postgres:${DB_PASSWORD}@db/windmill?sslmode=disable
- BASE_URL=http://${WM_BASE_URL}
- BASE_INTERNAL_URL=http://windmill_server:8000
- RUST_LOG=info
- NUM_WORKERS=1
- DISABLE_SERVER=true
- KEEP_JOB_DIR=false
- DENO_PATH=/usr/bin/deno
- PYTHON_PATH=/usr/local/bin/python3
- METRICS_ADDR=false
depends_on:
db:
condition: service_healthy
# to mount the worker folder to debug,, KEEP_JOB_DIR=true and mount /tmp/windmill
volumes:
- worker_dependency_cache:/tmp/windmill/cache
lsp:
image: ghcr.io/windmill-labs/windmill-lsp:latest
restart: unless-stopped
expose:
- 3001
caddy:
image: caddy:2.5.2-alpine
restart: unless-stopped
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
ports:
- 80:80
- 443:443
environment:
- BASE_URL=${WM_BASE_URL}
volumes:
db_data: null
worker_dependency_cache: null

View File

@@ -17,7 +17,7 @@ In the root folder:
```bash
docker build . -t windmill
docker compose -f docker-compose-dev.yml up db windmill_server windmill_worker
docker compose up db windmill_server windmill_worker
```
### 2. Backend is run by cargo
@@ -28,23 +28,20 @@ docker compose -f docker-compose-dev.yml up db windmill_server windmill_worker
- Install llvm
**On OSX:**
```bash
brew install llvm caddy gsed
# make LLVM tools available on PATH
echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc
# now, restart your shell. You should now have the `lld` binary on your PATH.
```
- To test that you have Rust and Cargo installed run `cargo --version`
- In your terminal, go to the backend directory and run `cargo build`
- Run `cargo run`
**Known issue on M1 Mac while running `cargo build`**
- You may encounter `linking with cc failed` build time error.
- To solve this run:
```bash
@@ -52,6 +49,7 @@ docker compose -f docker-compose-dev.yml up db windmill_server windmill_worker
source ~/.zshrc
```
**Do a Frontend Build**
In order to run the backend, you need to have a frontend build inside `frontend/build/`.
@@ -72,14 +70,11 @@ npm run build
```
**Known issue while running `npm run build`**
- You may encounter `FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory` error.
- To solve this run:
```bash
export NODE_OPTIONS=--max_old_space_size=8096
```
- run `npm run build` again
In the root folder:
@@ -91,7 +86,7 @@ docker-compose up db
In the backend folder:
```bash
DATABASE_URL=postgres://postgres:changeme@127.0.0.1:5432/windmill?sslmode=disable cargo run
DATABASE_URL=postgres://postgres:changeme@127.0.0.1:5433/windmill?sslmode=disable cargo run
```
You can now access [http://127.0.0.1:8000](http://127.0.0.1:8000).
@@ -151,13 +146,13 @@ Recommended config for VS Code:
- turn _format on save_ on
## Building
The project is built with [SvelteKit](https://kit.svelte.dev/) and uses as output static files.
There are others adapters for sveltekit, but we use the static adapter.
To build the frontend as static assets, use:
```
npm run build
```
@@ -165,11 +160,10 @@ npm run build
The output is in the `build` folder.
The default build assume you serve every non static files as the 200.html file which is catchall. If you prefer a normal layout, you can use:
```
NOTCATCHALL=true npm run build
```
which will generate an index.html and allow you to serve the frontend with any static server.
Env variables used for build are set in .env file. See [https://vitejs.dev/guide/env-and-mode.html#env-files](https://vitejs.dev/guide/env-and-mode.html#env-files) for more details.

View File

@@ -2,7 +2,12 @@
const apiTokenApps: Record<string, { img?: string; instructions: string[]; key?: string }> = {
airtable: {
img: '/airtable_connect.png',
instructions: ['Click on the top-right avatar', 'Click on Account', 'Find "Api"']
instructions: [
'Click to <a href="https://airtable.com/create/tokens" target="_blank" rel=”noopener noreferrer”>https://airtable.com/create/tokens</a>',
'Click on "Create new token"',
'Set a name, specify the scopes or the access level and click on "Create token"',
'Copy the token'
]
},
discord_webhook: {
img: '/discord_webhook.png',

View File

@@ -142,7 +142,9 @@
{#if resolvedConfig.beforeIcon && beforeIconComponent}
<svelte:component this={beforeIconComponent} size={14} />
{/if}
<div>{resolvedConfig.label}</div>
{#if resolvedConfig.label && resolvedConfig.label?.length > 0}
<div>{resolvedConfig.label}</div>
{/if}
{#if resolvedConfig.afterIcon && afterIconComponent}
<svelte:component this={afterIconComponent} size={14} />
{/if}

View File

@@ -11,7 +11,7 @@
import { sendUserToast } from '$lib/utils'
import { gridColumns } from '../../gridUtils'
const { app, selectedComponent, worldStore, focusedGrid, componentControl } =
const { app, selectedComponent, focusedGrid, componentControl } =
getContext<AppViewerContext>('AppViewerContext')
const { history, movingcomponents } = getContext<AppEditorContext>('AppEditorContext')
@@ -209,7 +209,6 @@
$selectedComponent = nitems.map((x) => x)
}
$worldStore = $worldStore
$app = $app
}

View File

@@ -15,8 +15,7 @@
import { push } from '$lib/history'
import { flip } from 'svelte/animate'
const { app, selectedComponent, focusedGrid, worldStore } =
getContext<AppViewerContext>('AppViewerContext')
const { app, selectedComponent, focusedGrid } = getContext<AppViewerContext>('AppViewerContext')
const { history } = getContext<AppEditorContext>('AppEditorContext')
@@ -33,7 +32,6 @@
$selectedComponent = [id]
$app = $app
$worldStore = $worldStore
}
let search = ''

View File

@@ -135,9 +135,7 @@
runnable?.type === 'runnableByName' &&
runnable?.inlineScript?.refreshOn?.find((x) => x.id === from)
) {
console.log('processss')
runnable.inlineScript.refreshOn = runnable.inlineScript.refreshOn.map((x) => {
console.log('renaming', x)
if (x.id === from) {
return {
id: to,

View File

@@ -87,22 +87,6 @@
inlineScript?.language == 'frontend' && worldStore
? buildExtraLib($worldStore?.outputsById ?? {}, id, false, $state, true)
: undefined
let refreshOn: string = inlineScript?.refreshOn?.map((x) => `${x.id}.${x.key}`).join(' ') ?? ''
$: handleRefreshOn(refreshOn)
function handleRefreshOn(refreshOn: string) {
if (refreshOn && refreshOn != '' && inlineScript) {
inlineScript.refreshOn = refreshOn
.split(' ')
.filter((x) => x.split('.').length == 2)
.map((x) => {
const [id, key] = x.split('.')
return { id, key }
})
}
}
</script>
{#if inlineScript}

View File

@@ -7,7 +7,7 @@
export let componentInput: ConnectedAppInput
const { connectingInput, app, worldStore } = getContext<AppViewerContext>('AppViewerContext')
const { connectingInput, app } = getContext<AppViewerContext>('AppViewerContext')
function applyConnection() {
if (
@@ -22,7 +22,6 @@
hoveredComponent: undefined
}
$app = $app
$worldStore = $worldStore
}
}

View File

@@ -21,7 +21,7 @@
let badgeClass = 'inline-flex items-center rounded-md px-2 py-0.5 text-xs font-medium border'
const { app, worldStore } = getContext<AppViewerContext>('AppViewerContext')
const { app } = getContext<AppViewerContext>('AppViewerContext')
const { connectingInput } = getContext<AppViewerContext>('AppViewerContext')
@@ -60,7 +60,6 @@
hoveredComponent: undefined
}
$app = $app
$worldStore = $worldStore
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 76 KiB