mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-29 16:15:51 +00:00
Merge branch 'main' into darkmode_new
This commit is contained in:
@@ -1,5 +1,60 @@
|
||||
# Changelog
|
||||
|
||||
## [1.305.3](https://github.com/windmill-labs/windmill/compare/v1.305.2...v1.305.3) (2024-04-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* improve app icon renderer and app html renderer ([ee56821](https://github.com/windmill-labs/windmill/commit/ee56821a4734fa56097ae1ec7e032b6d14c0ee80))
|
||||
|
||||
## [1.305.2](https://github.com/windmill-labs/windmill/compare/v1.305.1...v1.305.2) (2024-04-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* unsaved changes on deploy of flow ([d1650db](https://github.com/windmill-labs/windmill/commit/d1650dbed935b206a8de8a59835933d559ff3a20))
|
||||
|
||||
## [1.305.1](https://github.com/windmill-labs/windmill/compare/v1.305.0...v1.305.1) (2024-04-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fix plug connection for apps with array items ([c88e6a8](https://github.com/windmill-labs/windmill/commit/c88e6a86359cbdad038db09d54979cec1f12c8f3))
|
||||
* **frontend:** add missing darkModeObserver in CronInput ([#3531](https://github.com/windmill-labs/windmill/issues/3531)) ([8525494](https://github.com/windmill-labs/windmill/commit/8525494a68314e342b7393f6b6df15565ffb4082))
|
||||
* **frontend:** fix text alignement ([#3533](https://github.com/windmill-labs/windmill/issues/3533)) ([0c9a95c](https://github.com/windmill-labs/windmill/commit/0c9a95c964a16c3194d4887b7a3882a626faf6e4))
|
||||
* improve goto behavior ([6c33f17](https://github.com/windmill-labs/windmill/commit/6c33f17829a3a43cd1794abfc0c0807caa01bcfd))
|
||||
* load lazily the app icons ([cd5b023](https://github.com/windmill-labs/windmill/commit/cd5b0230338f3f20d7306b8a3feef509f6c8fe30))
|
||||
* remove requirement on full wasm parser for row insert of db studio ([cd07020](https://github.com/windmill-labs/windmill/commit/cd07020edb8ff652d086023771caa07755b5b2a2))
|
||||
* remove requirement on full wasm parser for row insert of db studio ([f17bed9](https://github.com/windmill-labs/windmill/commit/f17bed9741762f5241206a1bc257bcc4c4cb96fb))
|
||||
* update monaco configurations ([62e4ec2](https://github.com/windmill-labs/windmill/commit/62e4ec2e1443b47c273631d2b8efa7f3a9ba804c))
|
||||
|
||||
## [1.305.0](https://github.com/windmill-labs/windmill/compare/v1.304.4...v1.305.0) (2024-04-09)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* flow concurrency limits support custom concurrency key ([a55aad3](https://github.com/windmill-labs/windmill/commit/a55aad30039d8bc44f4cbc9aa2fa3e220966ca80))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add ability to cancel flows directly from operator modal ([5272956](https://github.com/windmill-labs/windmill/commit/5272956153419f3eac7203a9b043ca63c2cf869b))
|
||||
|
||||
## [1.304.4](https://github.com/windmill-labs/windmill/compare/v1.304.3...v1.304.4) (2024-04-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* allow for longer approver names in flows ([f117539](https://github.com/windmill-labs/windmill/commit/f117539a54e5947832c1d435a4991274d103cef0))
|
||||
* **frontend:** Fix bypass confirmation shortcut ([#3527](https://github.com/windmill-labs/windmill/issues/3527)) ([db5abd3](https://github.com/windmill-labs/windmill/commit/db5abd37cda548e642fa825cd279a730a7af5c00))
|
||||
* **frontend:** Improve theme editor ([#3525](https://github.com/windmill-labs/windmill/issues/3525)) ([975055b](https://github.com/windmill-labs/windmill/commit/975055b90ff3e7bd0b8202920ca78fb9178663a7))
|
||||
* improve deadlocks for parallel branches with parallelism constraints ([0c824de](https://github.com/windmill-labs/windmill/commit/0c824de4cdfb3b6b609cce0e1678a58743ea24f4))
|
||||
* improve deadlocks for parallel branches with parallelism constraints ([8dd1175](https://github.com/windmill-labs/windmill/commit/8dd117528c793b828631d5f320bb28ce9c5e3a3f))
|
||||
* improve handling of very large iterator on frontend ([7e4b6c3](https://github.com/windmill-labs/windmill/commit/7e4b6c374415862954f4876b693a199aabcab45e))
|
||||
* improve order dragndrop for json editor in app ([1ab1fb7](https://github.com/windmill-labs/windmill/commit/1ab1fb7e4de9984c6408d1fe5ef332d8f242362b))
|
||||
* improve performance of for-loops with parralelism ([a4442d4](https://github.com/windmill-labs/windmill/commit/a4442d4d3d919383ac09df66f20d6c4f98c04a92))
|
||||
* improve performance of for-loops with parralelism ([29422f1](https://github.com/windmill-labs/windmill/commit/29422f156d8ca3e0ac03288bd11b31f505a492c1))
|
||||
|
||||
## [1.304.3](https://github.com/windmill-labs/windmill/compare/v1.304.2...v1.304.3) (2024-04-08)
|
||||
|
||||
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "UPDATE queue SET suspend = suspend - 1 WHERE id = $1 AND suspend > 0",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Uuid"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "0c349ac832cbf055fce755c8e2081eacf2b836b0396ec48a6cc2405fb7aa76de"
|
||||
}
|
||||
+4
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "SELECT concurrency_key FROM script WHERE hash = $1",
|
||||
"query": "SELECT concurrency_key FROM script WHERE hash = $1 AND workspace_id = $2",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
@@ -11,12 +11,13 @@
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int8"
|
||||
"Int8",
|
||||
"Text"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
true
|
||||
]
|
||||
},
|
||||
"hash": "2719f910142b32476a16025bb9836b0cab019ba0a436b330ea3a53fba4725f73"
|
||||
"hash": "a3ccf362b4f6df400b3c7a084795dbf541eb14c5c374656ffb96da7283a2a6f1"
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "SELECT value->>'concurrency_key' FROM flow WHERE path = $1 AND workspace_id = $2",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "?column?",
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Text",
|
||||
"Text"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
null
|
||||
]
|
||||
},
|
||||
"hash": "a875cb56485b812e9d4739afd0915067f7e5abe0ca0adf264b792fccf21e005b"
|
||||
}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "SELECT id FROM queue WHERE parent_job = $1 AND suspend > 0 ORDER by id FOR UPDATE",
|
||||
"query": "SELECT id FROM queue WHERE parent_job = $1 AND suspend > 0 ORDER by suspend",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
@@ -18,5 +18,5 @@
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "ca2bdfa3c310b05348e20464df8403fde43dec24a8b8823383d0ac8f2116babf"
|
||||
"hash": "b8d97d300ffe6fae99f2396ae07cef03903752d17ce3fdadca47d86da75139aa"
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "UPDATE queue SET suspend = suspend - 1 WHERE parent_job = $1 AND suspend > 0",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Uuid"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "d42005ce0f8fbb2f65e8caa3cb06b6888b6c29e40ff575bb3893ea93e48450dc"
|
||||
}
|
||||
Generated
+84
-73
@@ -169,9 +169,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "anyhow"
|
||||
version = "1.0.81"
|
||||
version = "1.0.82"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247"
|
||||
checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519"
|
||||
|
||||
[[package]]
|
||||
name = "archiver-rs"
|
||||
@@ -491,9 +491,9 @@ checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799"
|
||||
|
||||
[[package]]
|
||||
name = "async-trait"
|
||||
version = "0.1.79"
|
||||
version = "0.1.80"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681"
|
||||
checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -557,9 +557,9 @@ checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80"
|
||||
|
||||
[[package]]
|
||||
name = "aws-config"
|
||||
version = "1.1.9"
|
||||
version = "1.1.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "297b64446175a73987cedc3c438d79b2a654d0fff96f65ff530fbe039347644c"
|
||||
checksum = "48730d0b4c3d91c43d0d37168831d9fd0e065ad4a889a2ee9faf8d34c3d2804d"
|
||||
dependencies = [
|
||||
"aws-credential-types",
|
||||
"aws-runtime",
|
||||
@@ -600,9 +600,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "aws-runtime"
|
||||
version = "1.1.8"
|
||||
version = "1.1.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b13dc54b4b49f8288532334bba8f87386a40571c47c37b1304979b556dc613c8"
|
||||
checksum = "c4ee6903f9d0197510eb6b44c4d86b493011d08b4992938f7b9be0333b6685aa"
|
||||
dependencies = [
|
||||
"aws-credential-types",
|
||||
"aws-sigv4",
|
||||
@@ -623,9 +623,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "aws-sdk-sso"
|
||||
version = "1.18.0"
|
||||
version = "1.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "019a07902c43b03167ea5df0182f0cb63fae89f9a9682c44d18cf2e4a042cb34"
|
||||
checksum = "b2be5ba83b077b67a6f7a1927eb6b212bf556e33bd74b5eaa5aa6e421910803a"
|
||||
dependencies = [
|
||||
"aws-credential-types",
|
||||
"aws-runtime",
|
||||
@@ -645,9 +645,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "aws-sdk-ssooidc"
|
||||
version = "1.18.0"
|
||||
version = "1.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "04c46ee08a48a7f4eaa4ad201dcc1dd537b49c50859d14d4510e00ad9d3f9af2"
|
||||
checksum = "022ca669825f841aef17b12d4354ef2b8651e4664be49f2d9ea13e4062a80c9f"
|
||||
dependencies = [
|
||||
"aws-credential-types",
|
||||
"aws-runtime",
|
||||
@@ -667,9 +667,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "aws-sdk-sts"
|
||||
version = "1.18.0"
|
||||
version = "1.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f752ac730125ca6017f72f9db5ec1772c9ecc664f87aa7507a7d81b023c23713"
|
||||
checksum = "8e4a5f5cb007347c1ab34a6d56456301dfada921fc9e57d687ecb08baddd11ff"
|
||||
dependencies = [
|
||||
"aws-credential-types",
|
||||
"aws-runtime",
|
||||
@@ -763,9 +763,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "aws-smithy-runtime"
|
||||
version = "1.2.1"
|
||||
version = "1.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c53572b4cd934ee5e8461ad53caa36e9d246aaef42166e3ac539e206a925d330"
|
||||
checksum = "de34bcfa1fb3c82a80e252a753db34a6658e07f23d3a5b3fc96919518fa7a3f5"
|
||||
dependencies = [
|
||||
"aws-smithy-async",
|
||||
"aws-smithy-http",
|
||||
@@ -789,9 +789,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "aws-smithy-runtime-api"
|
||||
version = "1.3.0"
|
||||
version = "1.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ccb2b3a7030dc9a3c9a08ce0b25decea5130e9db19619d4dffbbff34f75fe850"
|
||||
checksum = "4cc56a5c96ec741de6c5e6bf1ce6948be969d6506dfa9c39cffc284e31e4979b"
|
||||
dependencies = [
|
||||
"aws-smithy-async",
|
||||
"aws-smithy-types",
|
||||
@@ -841,9 +841,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "aws-types"
|
||||
version = "1.1.8"
|
||||
version = "1.1.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0dbf2f3da841a8930f159163175cf6a3d16ddde517c1b0fba7aa776822800f40"
|
||||
checksum = "afb278e322f16f59630a83b6b2dc992a0b48aa74ed47b4130f193fae0053d713"
|
||||
dependencies = [
|
||||
"aws-credential-types",
|
||||
"aws-smithy-async",
|
||||
@@ -1240,9 +1240,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "bumpalo"
|
||||
version = "3.15.4"
|
||||
version = "3.16.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa"
|
||||
checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
|
||||
|
||||
[[package]]
|
||||
name = "bytecheck"
|
||||
@@ -1398,9 +1398,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.0.91"
|
||||
version = "1.0.92"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1fd97381a8cc6493395a5afc4c691c1084b3768db713b73aa215217aa245d153"
|
||||
checksum = "2678b2e3449475e95b0aa6f9b506a28e61b3dc8996592b983695e8ebb58a8b41"
|
||||
dependencies = [
|
||||
"jobserver",
|
||||
"libc",
|
||||
@@ -1573,9 +1573,9 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
|
||||
|
||||
[[package]]
|
||||
name = "combine"
|
||||
version = "4.6.6"
|
||||
version = "4.6.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4"
|
||||
checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"futures-core",
|
||||
@@ -1737,9 +1737,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "crc"
|
||||
version = "3.2.0"
|
||||
version = "3.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c2b432c56615136f8dba245fed7ec3d5518c500a31108661067e61e72fe7e6bc"
|
||||
checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636"
|
||||
dependencies = [
|
||||
"crc-catalog",
|
||||
]
|
||||
@@ -3526,9 +3526,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "hstr"
|
||||
version = "0.2.8"
|
||||
version = "0.2.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b0f5356d62012374578cd3a5c013d6586de3efbca3b53379fc1edfbb95c9db14"
|
||||
checksum = "96274be293b8877e61974a607105d09c84caebe9620b47774aa8a6b942042dd4"
|
||||
dependencies = [
|
||||
"hashbrown 0.14.3",
|
||||
"new_debug_unreachable",
|
||||
@@ -3917,9 +3917,9 @@ checksum = "9028f49264629065d057f340a86acb84867925865f73bbf8d47b4d149a7e88b8"
|
||||
|
||||
[[package]]
|
||||
name = "jobserver"
|
||||
version = "0.1.28"
|
||||
version = "0.1.29"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6"
|
||||
checksum = "f08474e32172238f2827bd160c67871cdb2801430f65c3979184dc362e3ca118"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
@@ -4221,9 +4221,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "malachite"
|
||||
version = "0.4.6"
|
||||
version = "0.4.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "95720fa434c3fb2701c89deefc75ee0a7ec63f376c3385f868486413236b2bd4"
|
||||
checksum = "38ad951c9d45bd4c77f4c843844870dddeb2e332864226f5a62277498e1627b8"
|
||||
dependencies = [
|
||||
"malachite-base",
|
||||
"malachite-nz",
|
||||
@@ -4232,9 +4232,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "malachite-base"
|
||||
version = "0.4.6"
|
||||
version = "0.4.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d96d768a3e1dc170837bc0e4dad10fc9140260deb164118d3278d2193f4de796"
|
||||
checksum = "d073a3d1e4e037975af5ef176a2632672e25e8ddbe8e1811745c2e0726b6ad94"
|
||||
dependencies = [
|
||||
"hashbrown 0.14.3",
|
||||
"itertools 0.11.0",
|
||||
@@ -4257,9 +4257,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "malachite-nz"
|
||||
version = "0.4.6"
|
||||
version = "0.4.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf2d170d59f4f8e2b3f463649ec5ba40cb6968ed7b4ce54541d7de63d39e3c05"
|
||||
checksum = "2546fc6ae29728079e87a2a0f011509e6060713b65e62ee46ba5d413b495ebc7"
|
||||
dependencies = [
|
||||
"itertools 0.11.0",
|
||||
"libm",
|
||||
@@ -4268,9 +4268,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "malachite-q"
|
||||
version = "0.4.6"
|
||||
version = "0.4.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8a77ea0d54682a8923756320ca3840497a878d19c9bdb29c830d95f081eb13f3"
|
||||
checksum = "0ad0ac879ecbb7e1cc8060b48696eebed0b0de8d922db4f8b378dfbc1bad806a"
|
||||
dependencies = [
|
||||
"itertools 0.11.0",
|
||||
"malachite-base",
|
||||
@@ -4476,7 +4476,7 @@ dependencies = [
|
||||
"mysql_common",
|
||||
"native-tls",
|
||||
"once_cell",
|
||||
"pem 3.0.3",
|
||||
"pem 3.0.4",
|
||||
"percent-encoding",
|
||||
"pin-project",
|
||||
"rand 0.8.5",
|
||||
@@ -5037,11 +5037,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "pem"
|
||||
version = "3.0.3"
|
||||
version = "3.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1b8fcc794035347fb64beda2d3b462595dd2753e3f268d89c5aae77e8cf2c310"
|
||||
checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae"
|
||||
dependencies = [
|
||||
"base64 0.21.7",
|
||||
"base64 0.22.0",
|
||||
"serde",
|
||||
]
|
||||
|
||||
@@ -6025,9 +6025,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.35"
|
||||
version = "1.0.36"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
|
||||
checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
@@ -8328,9 +8328,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "sysinfo"
|
||||
version = "0.30.8"
|
||||
version = "0.30.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4b1a378e48fb3ce3a5cf04359c456c9c98ff689bcf1c1bc6e6a31f247686f275"
|
||||
checksum = "26d7c217777061d5a2d652aea771fb9ba98b6dade657204b08c4b9604d11555b"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"core-foundation-sys",
|
||||
@@ -8486,9 +8486,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "time"
|
||||
version = "0.3.34"
|
||||
version = "0.3.36"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749"
|
||||
checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
|
||||
dependencies = [
|
||||
"deranged",
|
||||
"itoa",
|
||||
@@ -8507,9 +8507,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
|
||||
|
||||
[[package]]
|
||||
name = "time-macros"
|
||||
version = "0.2.17"
|
||||
version = "0.2.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774"
|
||||
checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"
|
||||
dependencies = [
|
||||
"num-conv",
|
||||
"time-core",
|
||||
@@ -8817,7 +8817,7 @@ dependencies = [
|
||||
"serde",
|
||||
"serde_spanned",
|
||||
"toml_datetime",
|
||||
"winnow 0.6.5",
|
||||
"winnow 0.6.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -9707,7 +9707,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||
|
||||
[[package]]
|
||||
name = "windmill"
|
||||
version = "1.304.3"
|
||||
version = "1.305.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"axum",
|
||||
@@ -9744,7 +9744,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "windmill-api"
|
||||
version = "1.304.3"
|
||||
version = "1.305.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"argon2",
|
||||
@@ -9821,7 +9821,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "windmill-api-client"
|
||||
version = "1.304.3"
|
||||
version = "1.305.3"
|
||||
dependencies = [
|
||||
"base64 0.21.7",
|
||||
"chrono",
|
||||
@@ -9839,7 +9839,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "windmill-audit"
|
||||
version = "1.304.3"
|
||||
version = "1.305.3"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"serde",
|
||||
@@ -9852,7 +9852,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "windmill-common"
|
||||
version = "1.304.3"
|
||||
version = "1.305.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"aws-config",
|
||||
@@ -9888,7 +9888,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "windmill-git-sync"
|
||||
version = "1.304.3"
|
||||
version = "1.305.3"
|
||||
dependencies = [
|
||||
"regex",
|
||||
"rsmq_async",
|
||||
@@ -9903,7 +9903,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "windmill-parser"
|
||||
version = "1.304.3"
|
||||
version = "1.305.3"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -9911,7 +9911,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "windmill-parser-bash"
|
||||
version = "1.304.3"
|
||||
version = "1.305.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"lazy_static",
|
||||
@@ -9922,7 +9922,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "windmill-parser-go"
|
||||
version = "1.304.3"
|
||||
version = "1.305.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"gosyn",
|
||||
@@ -9934,7 +9934,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "windmill-parser-graphql"
|
||||
version = "1.304.3"
|
||||
version = "1.305.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"lazy_static",
|
||||
@@ -9945,7 +9945,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "windmill-parser-py"
|
||||
version = "1.304.3"
|
||||
version = "1.305.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"itertools 0.12.1",
|
||||
@@ -9956,7 +9956,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "windmill-parser-py-imports"
|
||||
version = "1.304.3"
|
||||
version = "1.305.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-recursion",
|
||||
@@ -9973,7 +9973,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "windmill-parser-sql"
|
||||
version = "1.304.3"
|
||||
version = "1.305.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"lazy_static",
|
||||
@@ -9984,7 +9984,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "windmill-parser-ts"
|
||||
version = "1.304.3"
|
||||
version = "1.305.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"convert_case 0.6.0",
|
||||
@@ -10002,7 +10002,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "windmill-parser-wasm"
|
||||
version = "1.304.3"
|
||||
version = "1.305.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"getrandom 0.2.14",
|
||||
@@ -10020,7 +10020,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "windmill-queue"
|
||||
version = "1.304.3"
|
||||
version = "1.305.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-recursion",
|
||||
@@ -10051,9 +10051,20 @@ dependencies = [
|
||||
"windmill-common",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windmill-sql-datatype-parser-wasm"
|
||||
version = "1.305.3"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"wasm-bindgen",
|
||||
"wasm-bindgen-test",
|
||||
"windmill-parser",
|
||||
"windmill-parser-sql",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windmill-worker"
|
||||
version = "1.304.3"
|
||||
version = "1.305.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-recursion",
|
||||
@@ -10085,7 +10096,7 @@ dependencies = [
|
||||
"object_store",
|
||||
"once_cell",
|
||||
"openidconnect",
|
||||
"pem 3.0.3",
|
||||
"pem 3.0.4",
|
||||
"postgres-native-tls",
|
||||
"prometheus",
|
||||
"rand 0.8.5",
|
||||
@@ -10281,9 +10292,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "winnow"
|
||||
version = "0.6.5"
|
||||
version = "0.6.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8"
|
||||
checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
||||
+3
-2
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "windmill"
|
||||
version = "1.304.3"
|
||||
version = "1.305.3"
|
||||
authors.workspace = true
|
||||
edition.workspace = true
|
||||
|
||||
@@ -20,10 +20,11 @@ members = [
|
||||
"./parsers/windmill-parser-bash",
|
||||
"./parsers/windmill-parser-py",
|
||||
"./parsers/windmill-parser-py-imports",
|
||||
"./parsers/windmill-sql-datatype-parser-wasm",
|
||||
]
|
||||
|
||||
[workspace.package]
|
||||
version = "1.304.3"
|
||||
version = "1.305.3"
|
||||
authors = ["Ruben Fiszel <ruben@windmill.dev>"]
|
||||
edition = "2021"
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
-- Add down migration script here
|
||||
ALTER TABLE flow DROP COLUMN concurrency_key;
|
||||
@@ -0,0 +1,2 @@
|
||||
-- Add up migration script here
|
||||
ALTER TABLE flow ADD COLUMN concurrency_key VARCHAR(255);
|
||||
@@ -5,7 +5,7 @@ use regex::Regex;
|
||||
use serde_json::json;
|
||||
|
||||
use std::collections::HashMap;
|
||||
use windmill_parser::{Arg, MainArgSignature, Typ};
|
||||
pub use windmill_parser::{Arg, MainArgSignature, Typ};
|
||||
|
||||
pub fn parse_mysql_sig(code: &str) -> anyhow::Result<MainArgSignature> {
|
||||
let parsed = parse_mysql_file(&code)?;
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
[package]
|
||||
name = "windmill-sql-datatype-parser-wasm"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
authors.workspace = true
|
||||
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib"]
|
||||
name = "windmill_sql_datatype_parser_wasm"
|
||||
path = "./src/lib.rs"
|
||||
|
||||
[dev-dependencies]
|
||||
wasm-bindgen-test.workspace = true
|
||||
|
||||
[dependencies]
|
||||
windmill-parser.workspace = true
|
||||
windmill-parser-sql.workspace = true
|
||||
wasm-bindgen.workspace = true
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
set -eou pipefail
|
||||
|
||||
deno task wasmbuild --out ../../../cli/wasm/
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "windmill-parser-wasm",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "windmill-sql-datatype-parser-wasm",
|
||||
"version": "0.1.0"
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
use wasm_bindgen::prelude::*;
|
||||
use windmill_parser_sql::Typ;
|
||||
|
||||
fn to_str(typ: Typ) -> String {
|
||||
match typ {
|
||||
Typ::Str(_) => "str".to_string(),
|
||||
Typ::Int => "int".to_string(),
|
||||
Typ::Float => "float".to_string(),
|
||||
Typ::Bool => "bool".to_string(),
|
||||
Typ::List(t) => format!("list-{}", to_str(*t)),
|
||||
Typ::Bytes => "bytes".to_string(),
|
||||
Typ::Datetime => "datetime".to_string(),
|
||||
_ => "unknown".to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn parse_sql(typ: &str) -> String {
|
||||
to_str(windmill_parser_sql::parse_pg_typ(typ))
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn parse_mysql(typ: &str) -> String {
|
||||
to_str(windmill_parser_sql::parse_mysql_typ(typ))
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn parse_bigquery(typ: &str) -> String {
|
||||
to_str(windmill_parser_sql::parse_bigquery_typ(typ))
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn parse_snowflake(typ: &str) -> String {
|
||||
to_str(windmill_parser_sql::parse_snowflake_typ(typ))
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn parse_mssql(typ: &str) -> String {
|
||||
to_str(windmill_parser_sql::parse_mssql_typ(typ))
|
||||
}
|
||||
@@ -927,7 +927,7 @@ async fn handle_zombie_flows(
|
||||
r#"
|
||||
SELECT *
|
||||
FROM queue
|
||||
WHERE running = true AND suspend = 0 AND scheduled_for <= now() AND (job_kind = 'flow' OR job_kind = 'flowpreview')
|
||||
WHERE running = true AND suspend = 0 AND suspend_until IS null AND scheduled_for <= now() AND (job_kind = 'flow' OR job_kind = 'flowpreview')
|
||||
AND last_ping IS NOT NULL AND last_ping < NOW() - ($1 || ' seconds')::interval
|
||||
"#,
|
||||
).bind(FLOW_ZOMBIE_TRANSITION_TIMEOUT.as_str())
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
openapi: "3.0.3"
|
||||
|
||||
info:
|
||||
version: 1.304.3
|
||||
version: 1.305.3
|
||||
title: Windmill API
|
||||
|
||||
contact:
|
||||
|
||||
@@ -334,7 +334,7 @@ async fn create_flow(
|
||||
nf.draft_only,
|
||||
nf.tag,
|
||||
nf.dedicated_worker,
|
||||
nf.visible_to_runner_only,
|
||||
nf.visible_to_runner_only.unwrap_or(false),
|
||||
)
|
||||
.execute(&mut tx)
|
||||
.await?;
|
||||
@@ -502,7 +502,7 @@ async fn update_flow(
|
||||
w_id,
|
||||
nf.tag,
|
||||
nf.dedicated_worker,
|
||||
nf.visible_to_runner_only,
|
||||
nf.visible_to_runner_only.unwrap_or(false),
|
||||
)
|
||||
.execute(&mut tx)
|
||||
.await?;
|
||||
@@ -985,6 +985,7 @@ mod tests {
|
||||
cache_ttl: None,
|
||||
priority: None,
|
||||
early_return: None,
|
||||
concurrency_key: None,
|
||||
};
|
||||
let expect = serde_json::json!({
|
||||
"modules": [
|
||||
|
||||
@@ -105,6 +105,8 @@ pub struct FlowValue {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
// Priority at the flow level
|
||||
pub priority: Option<i16>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub concurrency_key: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Debug, Clone)]
|
||||
|
||||
@@ -1657,12 +1657,12 @@ pub async fn pull<R: rsmq_async::RsmqConnection + Send + Clone>(
|
||||
+ Duration::try_seconds(i64::from(job_custom_concurrency_time_window_s))
|
||||
.unwrap_or_default();
|
||||
tracing::info!("Job '{}' from path '{}' with concurrency key '{}' has reached its concurrency limit of {} jobs run in the last {} seconds. This job will be re-queued for next execution at {}",
|
||||
job_uuid, job_script_path, job_custom_concurrent_limit, job_concurrency_key, job_custom_concurrency_time_window_s, estimated_next_schedule_timestamp);
|
||||
job_uuid, job_script_path, job_concurrency_key, job_custom_concurrent_limit, job_custom_concurrency_time_window_s, estimated_next_schedule_timestamp);
|
||||
|
||||
let job_log_event = format!(
|
||||
"\nRe-scheduled job to {estimated_next_schedule_timestamp} due to concurrency limits with key {job_concurrency_key} and limit {job_custom_concurrent_limit} in the last {job_custom_concurrency_time_window_s} seconds",
|
||||
);
|
||||
let _ = append_logs(job_uuid, pulled_job.workspace_id, job_log_event, db);
|
||||
let _ = append_logs(job_uuid, pulled_job.workspace_id, job_log_event, db).await;
|
||||
if rsmq.is_some() {
|
||||
// if let Some(ref mut rsmq) = tx.rsmq {
|
||||
// if using redis, only one message at a time can be poped from the queue. Process only this message and move to the next elligible job
|
||||
@@ -1884,50 +1884,63 @@ async fn pull_single_job_and_mark_as_running_no_concurrency_limit<
|
||||
}
|
||||
|
||||
async fn concurrency_key(db: &Pool<Postgres>, queued_job: &QueuedJob) -> String {
|
||||
if queued_job.is_flow() {
|
||||
// custom concurrency keys are not yet supported for flows
|
||||
queued_job.full_path_with_workspace()
|
||||
} else {
|
||||
let concurrency_key = sqlx::query_scalar!(
|
||||
"SELECT concurrency_key FROM script WHERE hash = $1",
|
||||
queued_job.script_hash.unwrap_or(ScriptHash(0)).0
|
||||
let r = if queued_job.is_flow() {
|
||||
sqlx::query_scalar!(
|
||||
"SELECT value->>'concurrency_key' FROM flow WHERE path = $1 AND workspace_id = $2",
|
||||
queued_job.script_path,
|
||||
queued_job.workspace_id
|
||||
)
|
||||
.fetch_one(db)
|
||||
.await;
|
||||
match concurrency_key {
|
||||
Ok(Some(custom_concurrency_key)) => {
|
||||
let workspaced =
|
||||
custom_concurrency_key.replace("$workspace", queued_job.workspace_id.as_str());
|
||||
if RE_ARG_TAG.is_match(&workspaced) {
|
||||
let mut interpolated = workspaced.clone();
|
||||
for cap in RE_ARG_TAG.captures_iter(&workspaced) {
|
||||
let arg_name = cap.get(1).unwrap().as_str();
|
||||
let arg_value = match queued_job.args.as_ref() {
|
||||
Some(Json(args_map_json)) => match args_map_json.get(arg_name) {
|
||||
Some(arg_value_raw) => {
|
||||
serde_json::to_string(arg_value_raw).unwrap_or_default()
|
||||
}
|
||||
None => "".to_string(),
|
||||
},
|
||||
.await
|
||||
} else {
|
||||
sqlx::query_scalar!(
|
||||
"SELECT concurrency_key FROM script WHERE hash = $1 AND workspace_id = $2",
|
||||
queued_job.script_hash.unwrap_or(ScriptHash(0)).0,
|
||||
queued_job.workspace_id
|
||||
)
|
||||
.fetch_one(db)
|
||||
.await
|
||||
};
|
||||
process_custom_concurrency_key(queued_job, r).await
|
||||
}
|
||||
|
||||
async fn process_custom_concurrency_key(
|
||||
queued_job: &QueuedJob,
|
||||
concurrency_key: Result<Option<String>, sqlx::Error>,
|
||||
) -> String {
|
||||
match concurrency_key {
|
||||
Ok(Some(custom_concurrency_key)) => {
|
||||
let workspaced =
|
||||
custom_concurrency_key.replace("$workspace", queued_job.workspace_id.as_str());
|
||||
if RE_ARG_TAG.is_match(&workspaced) {
|
||||
let mut interpolated = workspaced.clone();
|
||||
for cap in RE_ARG_TAG.captures_iter(&workspaced) {
|
||||
let arg_name = cap.get(1).unwrap().as_str();
|
||||
let arg_value = match queued_job.args.as_ref() {
|
||||
Some(Json(args_map_json)) => match args_map_json.get(arg_name) {
|
||||
Some(arg_value_raw) => {
|
||||
serde_json::to_string(arg_value_raw).unwrap_or_default()
|
||||
}
|
||||
None => "".to_string(),
|
||||
};
|
||||
interpolated = interpolated
|
||||
.replace(format!("$args[{}]", arg_name).as_str(), arg_value.as_str());
|
||||
}
|
||||
interpolated
|
||||
} else {
|
||||
workspaced
|
||||
},
|
||||
None => "".to_string(),
|
||||
};
|
||||
interpolated = interpolated
|
||||
.replace(format!("$args[{}]", arg_name).as_str(), arg_value.as_str());
|
||||
}
|
||||
interpolated
|
||||
} else {
|
||||
workspaced
|
||||
}
|
||||
Ok(None) => queued_job.full_path_with_workspace(),
|
||||
_ => {
|
||||
tracing::warn!(
|
||||
"Unable to retrieve concurrency key for script {:?} | {:?}",
|
||||
queued_job.script_path,
|
||||
queued_job.script_hash
|
||||
);
|
||||
queued_job.full_path_with_workspace()
|
||||
}
|
||||
}
|
||||
Ok(None) => queued_job.full_path_with_workspace(),
|
||||
_ => {
|
||||
tracing::warn!(
|
||||
"Unable to retrieve concurrency key for script {:?} | {:?}",
|
||||
queued_job.script_path,
|
||||
queued_job.script_hash
|
||||
);
|
||||
queued_job.full_path_with_workspace()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3000,6 +3013,7 @@ pub async fn push<'c, T: Serialize + Send + Sync, R: rsmq_async::RsmqConnection
|
||||
skip_expr: None,
|
||||
cache_ttl: cache_ttl.map(|val| val as u32),
|
||||
early_return: None,
|
||||
concurrency_key: None,
|
||||
priority: priority,
|
||||
};
|
||||
(
|
||||
|
||||
@@ -1338,6 +1338,7 @@ pub async fn run_worker<R: rsmq_async::RsmqConnection + Send + Sync + Clone + 's
|
||||
None
|
||||
}
|
||||
};
|
||||
let mut suspend_first_success = false;
|
||||
|
||||
loop {
|
||||
#[cfg(feature = "benchmark")]
|
||||
@@ -1427,19 +1428,20 @@ pub async fn run_worker<R: rsmq_async::RsmqConnection + Send + Sync + Clone + 's
|
||||
r
|
||||
}
|
||||
},
|
||||
(job, timer) = async {
|
||||
(job, timer, suspend_first) = async {
|
||||
let pull_time = Instant::now();
|
||||
let suspend_first = if last_checked_suspended.elapsed().as_secs() > 3 {
|
||||
let suspend_first = if suspend_first_success || last_checked_suspended.elapsed().as_secs() > 3 {
|
||||
last_checked_suspended = Instant::now();
|
||||
true
|
||||
} else { false };
|
||||
pull(&db, rsmq.clone(), suspend_first).map(|x| (x, pull_time)).await
|
||||
pull(&db, rsmq.clone(), suspend_first).map(|x| (x, pull_time, suspend_first)).await
|
||||
} => {
|
||||
add_time!(timing, loop_start, "post pull");
|
||||
// tracing::debug!("pulled job: {:?}", job.as_ref().ok().and_then(|x| x.as_ref().map(|y| y.id)));
|
||||
let duration_pull_s = timer.elapsed().as_secs_f64();
|
||||
let err_pull = job.is_ok();
|
||||
let empty = job.as_ref().is_ok_and(|x| x.is_none());
|
||||
suspend_first_success = suspend_first && !empty;
|
||||
if !agent_mode && duration_pull_s > 0.5 {
|
||||
tracing::warn!("pull took more than 0.5s ({duration_pull_s}), this is a sign that the database is VERY undersized for this load. empty: {empty}, err: {err_pull}");
|
||||
#[cfg(feature = "prometheus")]
|
||||
|
||||
@@ -415,28 +415,29 @@ pub async fn update_flow_status_after_job_completion_internal<
|
||||
tx.commit().await?;
|
||||
|
||||
if parallelism.is_some() {
|
||||
let mut tx = db.begin().await?;
|
||||
|
||||
// this ensure that the lock is taken in the same order and thus avoid deadlocks
|
||||
let _ = sqlx::query!(
|
||||
"SELECT id FROM queue WHERE parent_job = $1 AND suspend > 0 ORDER by id FOR UPDATE",
|
||||
job_id_for_status
|
||||
let ids = sqlx::query_scalar!(
|
||||
"SELECT id FROM queue WHERE parent_job = $1 AND suspend > 0 ORDER by suspend",
|
||||
flow
|
||||
)
|
||||
.fetch_all(&mut *tx)
|
||||
.fetch_all(db)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
Error::InternalErr(format!("error while locking jobs to decrease parallelism of: {e}"))
|
||||
})?;
|
||||
sqlx::query!(
|
||||
"UPDATE queue SET suspend = suspend - 1 WHERE parent_job = $1 AND suspend > 0",
|
||||
flow
|
||||
)
|
||||
.execute(&mut *tx)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
Error::InternalErr(format!("error decreasing suspend: {e}"))
|
||||
})?;
|
||||
tx.commit().await?;
|
||||
for id in ids {
|
||||
sqlx::query!(
|
||||
"UPDATE queue SET suspend = suspend - 1 WHERE id = $1 AND suspend > 0",
|
||||
id
|
||||
)
|
||||
.execute(db)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
Error::InternalErr(format!(
|
||||
"error decreasing suspend for {id}: {e}"
|
||||
))
|
||||
})?;
|
||||
}
|
||||
}
|
||||
|
||||
sqlx::query!(
|
||||
@@ -446,13 +447,18 @@ pub async fn update_flow_status_after_job_completion_internal<
|
||||
flow
|
||||
)
|
||||
.execute(db)
|
||||
.await?;
|
||||
.await
|
||||
.map_err(|e| {
|
||||
Error::InternalErr(format!("error while setting last ping to null: {e}"))
|
||||
})?;
|
||||
|
||||
let r = sqlx::query_scalar!(
|
||||
"DELETE FROM parallel_monitor_lock WHERE parent_flow_id = $1 and job_id = $2 RETURNING last_ping",
|
||||
flow,
|
||||
job_id_for_status
|
||||
).fetch_optional(db).await?;
|
||||
).fetch_optional(db).await.map_err(|e| {
|
||||
Error::InternalErr(format!("error while removing parallel_monitor_lock: {e}"))
|
||||
})?;
|
||||
if r.is_some() {
|
||||
tracing::info!(
|
||||
"parallel flow has removed lock on its parent, last ping was {:?}",
|
||||
@@ -741,7 +747,10 @@ pub async fn update_flow_status_after_job_completion_internal<
|
||||
&_cleanup_module.flow_jobs_to_clean,
|
||||
)
|
||||
.execute(db)
|
||||
.await?;
|
||||
.await
|
||||
.map_err(|e| {
|
||||
Error::InternalErr(format!("error while cleaning up completed_job: {e}"))
|
||||
})?;
|
||||
}
|
||||
}
|
||||
if flow_job.canceled {
|
||||
@@ -2598,6 +2607,7 @@ async fn compute_next_flow_transform(
|
||||
cache_ttl: None,
|
||||
priority: None,
|
||||
early_return: None,
|
||||
concurrency_key: None,
|
||||
},
|
||||
path: Some(format!("{}/forloop", flow_job.script_path())),
|
||||
restarted_from: None,
|
||||
@@ -2696,6 +2706,7 @@ async fn compute_next_flow_transform(
|
||||
cache_ttl: None,
|
||||
priority: None,
|
||||
early_return: None,
|
||||
concurrency_key: None,
|
||||
},
|
||||
path: Some(format!(
|
||||
"{}/branchone-{}",
|
||||
@@ -2747,6 +2758,7 @@ async fn compute_next_flow_transform(
|
||||
cache_ttl: None,
|
||||
priority: None,
|
||||
early_return: None,
|
||||
concurrency_key: None,
|
||||
},
|
||||
path: Some(format!(
|
||||
"{}/branchall-{}",
|
||||
@@ -2814,6 +2826,7 @@ async fn compute_next_flow_transform(
|
||||
cache_ttl: None,
|
||||
priority: None,
|
||||
early_return: None,
|
||||
concurrency_key: None,
|
||||
},
|
||||
path: Some(format!(
|
||||
"{}/branchall-{}",
|
||||
@@ -2886,6 +2899,7 @@ async fn next_loop_iteration(
|
||||
cache_ttl: None,
|
||||
priority: None,
|
||||
early_return: None,
|
||||
concurrency_key: None,
|
||||
},
|
||||
path: inner_path,
|
||||
restarted_from: None,
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import { sleep } from "https://deno.land/x/sleep@v1.2.1/mod.ts";
|
||||
import * as windmill from "https://deno.land/x/windmill@v1.174.0/mod.ts";
|
||||
import * as api from "https://deno.land/x/windmill@v1.174.0/windmill-api/index.ts";
|
||||
|
||||
export const VERSION = "v1.304.3";
|
||||
export const VERSION = "v1.305.3";
|
||||
|
||||
export async function login(email: string, password: string): Promise<string> {
|
||||
return await windmill.UserService.login({
|
||||
|
||||
+20
-20
@@ -1,37 +1,38 @@
|
||||
// windmill
|
||||
export { setClient } from "npm:windmill-client@1.304.2";
|
||||
export * from "npm:windmill-client@1.304.2";
|
||||
export { SEP } from "https://deno.land/std@0.201.0/path/separator.ts";
|
||||
|
||||
// cliffy
|
||||
export { Command } from "https://deno.land/x/cliffy@v1.0.0-rc.3/command/mod.ts";
|
||||
export { Table } from "https://deno.land/x/cliffy@v1.0.0-rc.3/table/table.ts";
|
||||
export { colors } from "https://deno.land/x/cliffy@v1.0.0-rc.3/ansi/colors.ts";
|
||||
export { Secret } from "https://deno.land/x/cliffy@v1.0.0-rc.3/prompt/secret.ts";
|
||||
export { Select } from "https://deno.land/x/cliffy@v1.0.0-rc.3/prompt/select.ts";
|
||||
export { Confirm } from "https://deno.land/x/cliffy@v1.0.0-rc.3/prompt/confirm.ts";
|
||||
export { Input } from "https://deno.land/x/cliffy@v1.0.0-rc.3/prompt/input.ts";
|
||||
export { Command } from "https://deno.land/x/cliffy@v1.0.0-rc.4/command/mod.ts";
|
||||
export { Table } from "https://deno.land/x/cliffy@v1.0.0-rc.4/table/table.ts";
|
||||
export { colors } from "https://deno.land/x/cliffy@v1.0.0-rc.4/ansi/colors.ts";
|
||||
export { Secret } from "https://deno.land/x/cliffy@v1.0.0-rc.4/prompt/secret.ts";
|
||||
export { Select } from "https://deno.land/x/cliffy@v1.0.0-rc.4/prompt/select.ts";
|
||||
export { Confirm } from "https://deno.land/x/cliffy@v1.0.0-rc.4/prompt/confirm.ts";
|
||||
export { Input } from "https://deno.land/x/cliffy@v1.0.0-rc.4/prompt/input.ts";
|
||||
export {
|
||||
DenoLandProvider,
|
||||
UpgradeCommand,
|
||||
} from "https://deno.land/x/cliffy@v1.0.0-rc.3/command/upgrade/mod.ts";
|
||||
export { CompletionsCommand } from "https://deno.land/x/cliffy@v1.0.0-rc.3/command/completions/mod.ts";
|
||||
} from "https://deno.land/x/cliffy@v1.0.0-rc.4/command/upgrade/mod.ts";
|
||||
export { CompletionsCommand } from "https://deno.land/x/cliffy@v1.0.0-rc.4/command/completions/mod.ts";
|
||||
// std
|
||||
export * as path from "https://deno.land/std@0.184.0/path/mod.ts";
|
||||
export { ensureDir } from "https://deno.land/std@0.184.0/fs/ensure_dir.ts";
|
||||
export * as path from "https://deno.land/std@0.207.0/path/mod.ts";
|
||||
export { ensureDir } from "https://deno.land/std@0.207.0/fs/ensure_dir.ts";
|
||||
export {
|
||||
copy,
|
||||
readAll,
|
||||
readerFromStreamReader,
|
||||
} from "https://deno.land/std@0.184.0/streams/mod.ts";
|
||||
} from "https://deno.land/std@0.207.0/streams/mod.ts";
|
||||
export { SEP } from "https://deno.land/std@0.207.0/path/separator.ts";
|
||||
export { DelimiterStream } from "https://deno.land/std@0.207.0/streams/mod.ts";
|
||||
export { iterateReader } from "https://deno.land/std@0.207.0/streams/iterate_reader.ts";
|
||||
export { writeAllSync } from "https://deno.land/std@0.207.0/streams/mod.ts";
|
||||
export { encodeHex } from "https://deno.land/std@0.207.0/encoding/hex.ts";
|
||||
|
||||
// other
|
||||
export { Application, Router } from "https://deno.land/x/oak@v12.5.0/mod.ts";
|
||||
|
||||
export { getPort } from "https://deno.land/x/getport@v2.1.2/mod.ts";
|
||||
|
||||
export { DelimiterStream } from "https://deno.land/std@0.184.0/streams/mod.ts";
|
||||
export { iterateReader } from "https://deno.land/std@0.184.0/streams/iterate_reader.ts";
|
||||
export { writeAllSync } from "https://deno.land/std@0.184.0/streams/mod.ts";
|
||||
|
||||
// other
|
||||
export { getAvailablePort } from "https://deno.land/x/port@1.0.0/mod.ts";
|
||||
export { default as dir } from "https://deno.land/x/dir@1.5.1/mod.ts";
|
||||
export { passwordGenerator } from "https://deno.land/x/password_generator@latest/mod.ts"; // TODO: I think the version is called latest, but it's still pinned.
|
||||
@@ -48,5 +49,4 @@ export {
|
||||
parse as yamlParse,
|
||||
} from "https://deno.land/std@0.184.0/yaml/mod.ts";
|
||||
export { open } from "https://deno.land/x/open@v0.0.5/index.ts";
|
||||
export { encodeHex } from "https://deno.land/std@0.207.0/encoding/hex.ts";
|
||||
export { default as gitignore_parser } from "npm:gitignore-parser";
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ addEventListener("error", (event) => {
|
||||
}
|
||||
});
|
||||
|
||||
export const VERSION = "v1.304.3";
|
||||
export const VERSION = "v1.305.3";
|
||||
|
||||
let command: any = new Command()
|
||||
.name("wmill")
|
||||
|
||||
Generated
+8
-3
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "windmill-components",
|
||||
"version": "1.304.3",
|
||||
"version": "1.305.3",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "windmill-components",
|
||||
"version": "1.304.3",
|
||||
"version": "1.305.3",
|
||||
"license": "AGPL-3.0",
|
||||
"dependencies": {
|
||||
"@aws-crypto/sha256-js": "^4.0.0",
|
||||
@@ -52,6 +52,7 @@
|
||||
"vscode-uri": "~3.0.8",
|
||||
"vscode-ws-jsonrpc": "~3.1.0",
|
||||
"windmill-parser-wasm": "^1.286.2",
|
||||
"windmill-sql-datatype-parser-wasm": "1.305.0",
|
||||
"y-monaco": "^0.1.4",
|
||||
"y-websocket": "^1.5.0",
|
||||
"yaml": "^2.3.4",
|
||||
@@ -114,7 +115,6 @@
|
||||
"fsevents": "^2.3.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@sveltejs/kit": "^1.25.0",
|
||||
"svelte": "^4.0.0"
|
||||
}
|
||||
},
|
||||
@@ -10095,6 +10095,11 @@
|
||||
"resolved": "https://registry.npmjs.org/windmill-parser-wasm/-/windmill-parser-wasm-1.286.2.tgz",
|
||||
"integrity": "sha512-xwmIRy/QJoT/p5MpZw5O1Ed4T25gOjHvR4VpkJTxeMhhzRzhXA52gBRABRGL1lZImo74kWTHdMVQ/UdKB7yO0g=="
|
||||
},
|
||||
"node_modules/windmill-sql-datatype-parser-wasm": {
|
||||
"version": "1.305.0",
|
||||
"resolved": "https://registry.npmjs.org/windmill-sql-datatype-parser-wasm/-/windmill-sql-datatype-parser-wasm-1.305.0.tgz",
|
||||
"integrity": "sha512-tn0yVn61g6EQp4t7zVnH6ZeL1CbjSSPinpMB8PwbxCTcv+dj5ibWRzYmNu+bqzcLjwdMTUA6VRHsbYJ3Ne4HpQ=="
|
||||
},
|
||||
"node_modules/wordwrap": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "windmill-components",
|
||||
"version": "1.304.3",
|
||||
"version": "1.305.3",
|
||||
"scripts": {
|
||||
"dev": "vite dev",
|
||||
"build": "vite build",
|
||||
@@ -134,13 +134,13 @@
|
||||
"vscode-uri": "~3.0.8",
|
||||
"vscode-ws-jsonrpc": "~3.1.0",
|
||||
"windmill-parser-wasm": "^1.286.2",
|
||||
"windmill-sql-datatype-parser-wasm": "1.305.0",
|
||||
"y-monaco": "^0.1.4",
|
||||
"y-websocket": "^1.5.0",
|
||||
"yaml": "^2.3.4",
|
||||
"yjs": "^13.6.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@sveltejs/kit": "^1.25.0",
|
||||
"svelte": "^4.0.0"
|
||||
},
|
||||
"exports": {
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
import ToggleButton from './common/toggleButton-v2/ToggleButton.svelte'
|
||||
import FlowIcon from './home/FlowIcon.svelte'
|
||||
import { Alert, Button } from './common'
|
||||
import { goto } from '$app/navigation'
|
||||
import YAML from 'yaml'
|
||||
|
||||
let search: string = ''
|
||||
@@ -41,14 +40,14 @@
|
||||
|
||||
let searchKind: 'all' | 'scripts' | 'flows' | 'apps' | 'resources' = 'all'
|
||||
|
||||
let isOpen = false;
|
||||
let inputElement;
|
||||
let isOpen = false
|
||||
let inputElement
|
||||
|
||||
// Reactive statement to focus the input when the modal opens
|
||||
$: if (isOpen && inputElement) {
|
||||
// Use a timeout to ensure focus after any animations or rendering
|
||||
setTimeout(() => inputElement.focus(), 0);
|
||||
}
|
||||
// Reactive statement to focus the input when the modal opens
|
||||
$: if (isOpen && inputElement) {
|
||||
// Use a timeout to ensure focus after any animations or rendering
|
||||
setTimeout(() => inputElement.focus(), 0)
|
||||
}
|
||||
|
||||
let scripts: undefined | { path: string; content: string }[] = undefined
|
||||
let filteredScriptItems: { path: string; content: string; marked: any }[] = []
|
||||
@@ -94,7 +93,6 @@
|
||||
flows: getCounts(filteredFlowItems.length),
|
||||
scripts: getCounts(filteredScriptItems.length)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<SearchItems
|
||||
@@ -285,7 +283,9 @@
|
||||
<div class="flex gap-2">
|
||||
<Button
|
||||
on:click|once={() => {
|
||||
goto(`/scripts/edit/${item.path}?no_draft=true`)
|
||||
window
|
||||
.open(`/scripts/edit/${item.path}?no_draft=true`, '_blank')
|
||||
?.focus()
|
||||
}}
|
||||
color="light"
|
||||
size="sm"
|
||||
@@ -325,7 +325,9 @@
|
||||
<div class="flex gap-2">
|
||||
<Button
|
||||
on:click|once={() => {
|
||||
goto(`/flows/edit/${item.path}?no_draft=true`)
|
||||
window
|
||||
.open(`/flows/edit/${item.path}?no_draft=true`, '_blank')
|
||||
?.focus()
|
||||
}}
|
||||
color="light"
|
||||
size="sm"
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
import CronBuilder from './CronBuilder.svelte'
|
||||
import Label from './Label.svelte'
|
||||
import CronGen from './copilot/CronGen.svelte'
|
||||
import DarkModeObserver from './DarkModeObserver.svelte'
|
||||
|
||||
export let schedule: string
|
||||
// export let offset: number = -60 * Math.floor(new Date().getTimezoneOffset() / 60)
|
||||
@@ -198,6 +199,8 @@
|
||||
.flat()
|
||||
</script>
|
||||
|
||||
<DarkModeObserver on:change={onThemeChange} />
|
||||
|
||||
<div class="w-full flex space-x-8">
|
||||
<div class="w-full flex flex-col gap-4">
|
||||
<Label label="Cron">
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
startIcon={{ icon: SettingsIcon }}
|
||||
color="light"
|
||||
size="xs2"
|
||||
btnClasses="!text-tertiary"
|
||||
variant="contained">defaults</Button
|
||||
>
|
||||
{/if}
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
|
||||
let length = roughSizeOfObject(result)
|
||||
// Otherwise, check if the result is too large (10kb) for json
|
||||
largeObject = length > 100000
|
||||
largeObject = length > 50000
|
||||
|
||||
if (largeObject) {
|
||||
return 'json'
|
||||
@@ -547,9 +547,9 @@
|
||||
<div class="mt-1 mb-2">
|
||||
<Alert
|
||||
size="xs"
|
||||
title="Large file detected"
|
||||
title="Large result detected"
|
||||
type="warning"
|
||||
tooltip="We recommend using persistent storage for large data files. See docs for setting up an object storage service integration using s3 or any other s3 compatible services."
|
||||
tooltip="We recommend using persistent object storage for large result. See docs for setting up an object storage service integration using s3 or any other s3 compatible services."
|
||||
documentationLink="https://www.windmill.dev/docs/core_concepts/persistent_storage#large-data-files-s3-r2-minio-azure-blob"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -754,20 +754,20 @@
|
||||
]
|
||||
}
|
||||
)
|
||||
} else if (lang === 'javascript') {
|
||||
} else if (lang === 'typescript') {
|
||||
const stdLib = { content: libStdContent, filePath: 'es6.d.ts' }
|
||||
if (scriptLang == 'bun') {
|
||||
languages.typescript.javascriptDefaults.setExtraLibs([stdLib])
|
||||
languages.typescript.typescriptDefaults.setExtraLibs([stdLib])
|
||||
} else {
|
||||
const denoFetch = { content: denoFetchContent, filePath: 'deno_fetch.d.ts' }
|
||||
languages.typescript.javascriptDefaults.setExtraLibs([stdLib, denoFetch])
|
||||
languages.typescript.typescriptDefaults.setExtraLibs([stdLib, denoFetch])
|
||||
}
|
||||
if (scriptLang == 'bun' && ata == undefined) {
|
||||
const addLibraryToRuntime = async (code: string, _path: string) => {
|
||||
const path = 'file://' + _path
|
||||
let uri = mUri.parse(path)
|
||||
console.log('adding library to runtime', path)
|
||||
languages.typescript.javascriptDefaults.addExtraLib(code, path)
|
||||
languages.typescript.typescriptDefaults.addExtraLib(code, path)
|
||||
try {
|
||||
await vscode.workspace.fs.writeFile(uri, new TextEncoder().encode(code))
|
||||
} catch (e) {
|
||||
@@ -1028,18 +1028,24 @@
|
||||
|
||||
initialized = true
|
||||
|
||||
languages.typescript.typescriptDefaults.setModeConfiguration({
|
||||
completionItems: false,
|
||||
definitions: false,
|
||||
hovers: false
|
||||
})
|
||||
|
||||
languages.typescript.typescriptDefaults.setCompilerOptions({
|
||||
target: languages.typescript.ScriptTarget.Latest,
|
||||
allowNonTsExtensions: true,
|
||||
noSemanticValidation: false,
|
||||
noSyntaxValidation: false,
|
||||
|
||||
completionItems: true,
|
||||
hovers: true,
|
||||
documentSymbols: true,
|
||||
definitions: true,
|
||||
references: true,
|
||||
documentHighlights: true,
|
||||
rename: true,
|
||||
diagnostics: true,
|
||||
documentRangeFormattingEdits: true,
|
||||
signatureHelp: true,
|
||||
onTypeFormattingEdits: true,
|
||||
codeActions: true,
|
||||
inlayHints: true,
|
||||
checkJs: true,
|
||||
allowJs: true,
|
||||
noUnusedLocals: true,
|
||||
@@ -1064,7 +1070,25 @@
|
||||
inlayHints: true
|
||||
})
|
||||
|
||||
languages.typescript.typescriptDefaults.setModeConfiguration({
|
||||
completionItems: true,
|
||||
hovers: true,
|
||||
documentSymbols: true,
|
||||
definitions: true,
|
||||
references: true,
|
||||
documentHighlights: true,
|
||||
rename: true,
|
||||
diagnostics: true,
|
||||
documentRangeFormattingEdits: true,
|
||||
signatureHelp: true,
|
||||
onTypeFormattingEdits: true,
|
||||
codeActions: true,
|
||||
inlayHints: true
|
||||
})
|
||||
|
||||
languages.typescript.javascriptDefaults.setEagerModelSync(true)
|
||||
languages.typescript.typescriptDefaults.setEagerModelSync(true)
|
||||
|
||||
languages.typescript.javascriptDefaults.setDiagnosticsOptions({
|
||||
noSemanticValidation: false,
|
||||
noSyntaxValidation: false,
|
||||
@@ -1072,6 +1096,13 @@
|
||||
diagnosticCodesToIgnore: [1108]
|
||||
})
|
||||
|
||||
languages.typescript.typescriptDefaults.setDiagnosticsOptions({
|
||||
noSemanticValidation: false,
|
||||
noSyntaxValidation: false,
|
||||
noSuggestionDiagnostics: false,
|
||||
diagnosticCodesToIgnore: [1108]
|
||||
})
|
||||
|
||||
languages.typescript.javascriptDefaults.setCompilerOptions({
|
||||
target: languages.typescript.ScriptTarget.Latest,
|
||||
allowNonTsExtensions: true,
|
||||
@@ -1083,8 +1114,7 @@
|
||||
noUnusedParameters: true,
|
||||
noUnusedLocals: true,
|
||||
strict: true,
|
||||
noLib: false,
|
||||
|
||||
noLib: true,
|
||||
moduleResolution: languages.typescript.ModuleResolutionKind.NodeJs
|
||||
})
|
||||
|
||||
|
||||
@@ -67,11 +67,10 @@
|
||||
import FlowTutorials from './FlowTutorials.svelte'
|
||||
import { ignoredTutorials } from './tutorials/ignoredTutorials'
|
||||
import type DiffDrawer from './DiffDrawer.svelte'
|
||||
import UnsavedConfirmationModal from './common/confirmationModal/UnsavedConfirmationModal.svelte'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import { goto } from '$app/navigation'
|
||||
|
||||
export let initialPath: string = ''
|
||||
export let pathStoreInit: string | undefined = undefined
|
||||
export let newFlow: boolean
|
||||
export let selectedId: string | undefined
|
||||
export let initialArgs: Record<string, any> = {}
|
||||
@@ -84,6 +83,7 @@
|
||||
})
|
||||
| undefined = undefined
|
||||
export let diffDrawer: DiffDrawer | undefined = undefined
|
||||
export let gotoEdit: (path: string, selected: string) => void
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
|
||||
@@ -194,7 +194,8 @@
|
||||
dispatch('saveInitial', $pathStore)
|
||||
} else if (savedFlow?.draft_only && $pathStore !== initialPath) {
|
||||
initialPath = $pathStore
|
||||
goto(`/flows/edit/${$pathStore}?selected=${getSelectedId()}`)
|
||||
// this is so we can use the flow builder outside of sveltekit
|
||||
gotoEdit($pathStore, getSelectedId())
|
||||
}
|
||||
sendUserToast('Saved as draft')
|
||||
} catch (error) {
|
||||
@@ -359,9 +360,9 @@
|
||||
const scriptEditorDrawer = writable<ScriptEditorDrawer | undefined>(undefined)
|
||||
const moving = writable<{ module: FlowModule; modules: FlowModule[] } | undefined>(undefined)
|
||||
const history = initHistory($flowStore)
|
||||
const pathStore = writable<string>(initialPath)
|
||||
const pathStore = writable<string>(pathStoreInit ?? initialPath)
|
||||
|
||||
$: $pathStore = initialPath
|
||||
$: initialPath && ($pathStore = initialPath)
|
||||
|
||||
const testStepStore = writable<Record<string, any>>({})
|
||||
|
||||
@@ -982,14 +983,7 @@
|
||||
|
||||
<svelte:window on:keydown={onKeyDown} />
|
||||
|
||||
<UnsavedConfirmationModal
|
||||
{diffDrawer}
|
||||
savedValue={savedFlow}
|
||||
modifiedValue={{
|
||||
...$flowStore,
|
||||
path: $pathStore
|
||||
}}
|
||||
/>
|
||||
<slot />
|
||||
|
||||
{#key renderCount}
|
||||
{#if !$userStore?.operator}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
export let jobId: string
|
||||
export let workspaceId: string | undefined = undefined
|
||||
export let flowStateStore: Writable<FlowState> | undefined = undefined
|
||||
export let flowStateStore: Writable<FlowState> = writable({})
|
||||
export let selectedJobStep: string | undefined = undefined
|
||||
|
||||
export let isOwner = false
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
export let globalModuleStates: Writable<Record<string, GraphModuleState>>[]
|
||||
export let globalDurationStatuses: Writable<Record<string, DurationStatus>>[]
|
||||
export let childFlow: boolean = false
|
||||
export let reducedPolling = false
|
||||
|
||||
let jobResults: any[] = []
|
||||
let jobFailures: boolean[] = []
|
||||
@@ -118,25 +119,6 @@
|
||||
)
|
||||
}
|
||||
|
||||
if (flowJobIds) {
|
||||
let common = {
|
||||
iteration_from: Math.max(flowJobIds.flowJobs.length - 20, 0),
|
||||
iteration_total: flowJobIds?.length
|
||||
}
|
||||
let modId = flowJobIds?.moduleId ?? ''
|
||||
$localDurationStatuses[modId] = {
|
||||
...($localDurationStatuses[modId] ?? { byJob: {} }),
|
||||
...common
|
||||
}
|
||||
let prefixed = modId
|
||||
globalDurationStatuses.forEach((x) =>
|
||||
x.update((x) => {
|
||||
x[prefixed] = { ...(x[prefixed] ?? { byJob: {} }), ...common }
|
||||
return x
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
function updateForloop(len: number) {
|
||||
forloop_selected = flowJobIds?.flowJobs[len - 1] ?? ''
|
||||
lastSize = len
|
||||
@@ -224,17 +206,36 @@
|
||||
}
|
||||
}
|
||||
if (job?.type !== 'CompletedJob' && errorCount < 4) {
|
||||
timeout = setTimeout(() => loadJobInProgress(), 500)
|
||||
timeout = setTimeout(() => loadJobInProgress(), reducedPolling ? 5000 : 1000)
|
||||
}
|
||||
}
|
||||
|
||||
async function updateJobId() {
|
||||
if (jobId !== job?.id) {
|
||||
$localModuleStates = {}
|
||||
$localDurationStatuses = {}
|
||||
flowTimeline?.reset()
|
||||
timeout && clearTimeout(timeout)
|
||||
innerModules = []
|
||||
if (flowJobIds) {
|
||||
let common = {
|
||||
iteration_from: Math.max(flowJobIds.flowJobs.length - 20, 0),
|
||||
iteration_total: flowJobIds?.length
|
||||
}
|
||||
let modId = flowJobIds?.moduleId ?? ''
|
||||
$localDurationStatuses[modId] = {
|
||||
...($localDurationStatuses[modId] ?? { byJob: {} }),
|
||||
...common
|
||||
}
|
||||
let prefixed = modId
|
||||
globalDurationStatuses.forEach((x) =>
|
||||
x.update((x) => {
|
||||
x[prefixed] = { ...(x[prefixed] ?? { byJob: {} }), ...common }
|
||||
return x
|
||||
})
|
||||
)
|
||||
} else {
|
||||
$localDurationStatuses = {}
|
||||
}
|
||||
await loadJobInProgress()
|
||||
}
|
||||
}
|
||||
@@ -312,6 +313,12 @@
|
||||
) {
|
||||
let modId = flowJobIds?.moduleId
|
||||
if (modId) {
|
||||
if ($flowStateStore && $flowStateStore?.[modId] == undefined) {
|
||||
$flowStateStore[modId] = {
|
||||
...$flowStateStore[modId],
|
||||
previewResult: jobLoaded.args
|
||||
}
|
||||
}
|
||||
if ($flowStateStore?.[modId]) {
|
||||
if (!childFlow) {
|
||||
if (
|
||||
@@ -402,6 +409,31 @@
|
||||
let flowTimeline: FlowTimeline
|
||||
|
||||
let rightColumnSelect: 'timeline' | 'detail' = 'timeline'
|
||||
|
||||
let slicedListJobIds: string[] = []
|
||||
|
||||
$: flowJobIds && !deepEqual(flowJobIds, lastFlowJobIds) && updateSlicedListJobIds()
|
||||
let lastFlowJobIds: any = undefined
|
||||
function updateSlicedListJobIds() {
|
||||
lastFlowJobIds = flowJobIds
|
||||
slicedListJobIds =
|
||||
(flowJobIds?.flowJobs.length ?? 0) > 20
|
||||
? flowJobIds?.flowJobs?.slice(
|
||||
$localDurationStatuses[flowJobIds?.moduleId ?? '']?.iteration_from ?? 0
|
||||
) ?? []
|
||||
: flowJobIds?.flowJobs ?? []
|
||||
}
|
||||
|
||||
function loadPreviousIters(lenToAdd: number) {
|
||||
let r = $localDurationStatuses[flowJobIds?.moduleId ?? '']
|
||||
if (r.iteration_from) {
|
||||
r.iteration_from -= lenToAdd
|
||||
$localDurationStatuses = $localDurationStatuses
|
||||
globalDurationStatuses.forEach((x) => x.update((x) => x))
|
||||
}
|
||||
jobResults = [...new Array(lenToAdd), ...jobResults]
|
||||
updateSlicedListJobIds()
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if job}
|
||||
@@ -418,19 +450,24 @@
|
||||
)}
|
||||
|
||||
{#if (flowJobIds?.flowJobs.length ?? 0) > 20 && lenToAdd > 0}
|
||||
{@const allToAdd = (flowJobIds?.length ?? 0) - (slicedListJobIds.length ?? 0)}
|
||||
<p class="text-tertiary italic text-xs">
|
||||
For performance reasons, only the last 20 items are shown by default <button
|
||||
class="text-primary underline ml-4"
|
||||
on:click={() => {
|
||||
let r = $localDurationStatuses[flowJobIds?.moduleId ?? '']
|
||||
if (r.iteration_from) {
|
||||
r.iteration_from -= lenToAdd
|
||||
$localDurationStatuses = $localDurationStatuses
|
||||
globalDurationStatuses.forEach((x) => x.update((x) => x))
|
||||
}
|
||||
loadPreviousIters(lenToAdd)
|
||||
}}
|
||||
>Load {lenToAdd} prior
|
||||
</button>
|
||||
{#if allToAdd > 0}
|
||||
<button
|
||||
class="text-primary underline ml-4"
|
||||
on:click={() => {
|
||||
loadPreviousIters(allToAdd)
|
||||
}}
|
||||
>Load {allToAdd} prior
|
||||
</button>
|
||||
{/if}
|
||||
</p>
|
||||
{/if}
|
||||
{#if render}
|
||||
@@ -520,22 +557,28 @@
|
||||
Embedded flows: ({flowJobIds?.flowJobs.length} items)
|
||||
</h3>
|
||||
{#if (flowJobIds?.flowJobs.length ?? 0) > 20 && lenToAdd > 0}
|
||||
{@const allToAdd = (flowJobIds?.length ?? 0) - (slicedListJobIds.length ?? 0)}
|
||||
|
||||
<p class="text-tertiary italic text-xs">
|
||||
For performance reasons, only the last 20 items are shown by default <button
|
||||
class="text-primary underline ml-4"
|
||||
on:click={() => {
|
||||
let r = $localDurationStatuses[flowJobIds?.moduleId ?? '']
|
||||
if (r.iteration_from) {
|
||||
r.iteration_from -= lenToAdd
|
||||
$localDurationStatuses = $localDurationStatuses
|
||||
globalDurationStatuses.forEach((x) => x.update((x) => x))
|
||||
}
|
||||
loadPreviousIters(lenToAdd)
|
||||
}}
|
||||
>Load {lenToAdd} prior
|
||||
</button>
|
||||
{#if allToAdd > 0}
|
||||
<button
|
||||
class="text-primary underline ml-4"
|
||||
on:click={() => {
|
||||
loadPreviousIters(allToAdd)
|
||||
}}
|
||||
>Load {allToAdd} prior
|
||||
</button>
|
||||
{/if}
|
||||
</p>
|
||||
{/if}
|
||||
{#each (flowJobIds?.flowJobs.length ?? 0) > 20 ? flowJobIds?.flowJobs?.slice($localDurationStatuses[flowJobIds?.moduleId ?? '']?.iteration_from ?? 0) ?? [] : flowJobIds?.flowJobs ?? [] as loopJobId, j (loopJobId)}
|
||||
{#each slicedListJobIds as loopJobId, j (loopJobId)}
|
||||
{#if render}
|
||||
<Button
|
||||
variant={forloop_selected === loopJobId ? 'contained' : 'border'}
|
||||
@@ -565,12 +608,14 @@
|
||||
</Button>
|
||||
{/if}
|
||||
|
||||
<!-- <LogId id={loopJobId} /> -->
|
||||
<div class="border p-6" class:hidden={forloop_selected != loopJobId}>
|
||||
<svelte:self
|
||||
{childFlow}
|
||||
globalModuleStates={[localModuleStates, ...globalModuleStates]}
|
||||
globalDurationStatuses={[localDurationStatuses, ...globalDurationStatuses]}
|
||||
render={forloop_selected == loopJobId && selected == 'sequence' && render}
|
||||
reducedPolling={flowJobIds?.flowJobs.length && flowJobIds?.flowJobs.length > 20}
|
||||
{workspaceId}
|
||||
jobId={loopJobId}
|
||||
on:jobsLoaded={(e) => innerJobLoaded(e.detail, j)}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import { Job, JobService } from '$lib/gen'
|
||||
import { workspaceStore } from '$lib/stores'
|
||||
import { sendUserToast } from '$lib/toast'
|
||||
import { X } from 'lucide-svelte'
|
||||
import DisplayResult from './DisplayResult.svelte'
|
||||
import LightweightSchemaForm from './LightweightSchemaForm.svelte'
|
||||
import Tooltip from './Tooltip.svelte'
|
||||
@@ -14,7 +15,9 @@
|
||||
|
||||
let default_payload: object = {}
|
||||
let resumeUrl: string | undefined = undefined
|
||||
let cancelUrl: string | undefined = undefined
|
||||
let description: any = undefined
|
||||
let hide_cancel = false
|
||||
|
||||
$: approvalStep = (job?.flow_status?.step ?? 1) - 1
|
||||
|
||||
@@ -43,11 +46,72 @@
|
||||
default_payload = args
|
||||
|
||||
resumeUrl = job_result?.['resume']
|
||||
cancelUrl = job_result?.['cancel']
|
||||
hide_cancel = job?.raw_flow?.modules?.[approvalStep]?.suspend?.hide_cancel ?? false
|
||||
schema = mergeSchema(
|
||||
job?.raw_flow?.modules?.[approvalStep]?.suspend?.resume_form?.schema ?? {},
|
||||
job_result?.enums ?? {}
|
||||
)
|
||||
}
|
||||
|
||||
async function continu(approve: boolean) {
|
||||
if ((resumeUrl && approve) || (cancelUrl && !approve)) {
|
||||
let split = (approve ? resumeUrl : cancelUrl)!.split('/')
|
||||
let signatureUrl = split.pop() ?? ''
|
||||
const regex = /([^?]+)(?:\?[^=]+=(\w+))?/
|
||||
|
||||
const matches = signatureUrl.match(regex)
|
||||
|
||||
const signature = matches?.[1]
|
||||
if (!signature) {
|
||||
sendUserToast(`Could not parse signature: ${signatureUrl}`, true)
|
||||
return
|
||||
}
|
||||
const approver = matches?.[2] || undefined
|
||||
|
||||
let resumeId = -1
|
||||
let parsedResumeId = split.pop() ?? ''
|
||||
try {
|
||||
resumeId = new Number(parsedResumeId).valueOf()
|
||||
} catch (e) {
|
||||
console.error(`Could not parse resume id: ${parsedResumeId}`)
|
||||
}
|
||||
let jobId = split.pop() ?? ''
|
||||
if (approve) {
|
||||
await JobService.resumeSuspendedJobPost({
|
||||
workspace: workspaceId ?? $workspaceStore ?? '',
|
||||
id: jobId,
|
||||
requestBody: default_payload,
|
||||
resumeId,
|
||||
signature,
|
||||
approver
|
||||
})
|
||||
} else {
|
||||
await JobService.cancelSuspendedJobPost({
|
||||
workspace: workspaceId ?? $workspaceStore ?? '',
|
||||
id: jobId,
|
||||
resumeId,
|
||||
signature,
|
||||
approver,
|
||||
requestBody: {}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
if (approve) {
|
||||
await JobService.resumeSuspendedFlowAsOwner({
|
||||
workspace: workspaceId ?? $workspaceStore ?? '',
|
||||
id: job?.id ?? '',
|
||||
requestBody: default_payload
|
||||
})
|
||||
} else {
|
||||
await JobService.cancelQueuedJob({
|
||||
workspace: workspaceId ?? $workspaceStore ?? '',
|
||||
id: job?.id ?? '',
|
||||
requestBody: {}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="w-full h-full mt-2 text-sm text-tertiary">
|
||||
@@ -58,49 +122,20 @@
|
||||
<div>
|
||||
{#if isOwner || resumeUrl}
|
||||
<div class="flex flex-row gap-2 mt-2">
|
||||
{#if cancelUrl && !hide_cancel}
|
||||
<div>
|
||||
<Button
|
||||
color="red"
|
||||
title="Cancel the flow"
|
||||
iconOnly
|
||||
startIcon={{ icon: X }}
|
||||
variant="border"
|
||||
on:click={() => continu(false)}
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
<div>
|
||||
<Button
|
||||
color="green"
|
||||
variant="border"
|
||||
on:click={async () => {
|
||||
if (resumeUrl) {
|
||||
let split = resumeUrl.split('/')
|
||||
let signatureUrl = split.pop() ?? ''
|
||||
const regex = /([^?]+)(?:\?[^=]+=(\w+))?/
|
||||
|
||||
const matches = signatureUrl.match(regex)
|
||||
|
||||
const signature = matches?.[1]
|
||||
if (!signature) {
|
||||
sendUserToast(`Could not parse signature: ${signatureUrl}`, true)
|
||||
return
|
||||
}
|
||||
const approver = matches?.[2] || undefined
|
||||
|
||||
let resumeId = -1
|
||||
let parsedResumeId = split.pop() ?? ''
|
||||
try {
|
||||
resumeId = new Number(parsedResumeId).valueOf()
|
||||
} catch (e) {
|
||||
console.error(`Could not parse resume id: ${parsedResumeId}`)
|
||||
}
|
||||
let jobId = split.pop() ?? ''
|
||||
await JobService.resumeSuspendedJobPost({
|
||||
workspace: workspaceId ?? $workspaceStore ?? '',
|
||||
id: jobId,
|
||||
requestBody: default_payload,
|
||||
resumeId,
|
||||
signature,
|
||||
approver
|
||||
})
|
||||
} else {
|
||||
await JobService.resumeSuspendedFlowAsOwner({
|
||||
workspace: workspaceId ?? $workspaceStore ?? '',
|
||||
id: job?.id ?? '',
|
||||
requestBody: default_payload
|
||||
})
|
||||
}
|
||||
}}
|
||||
<Button color="green" variant="border" on:click={() => continu(true)}
|
||||
>Resume <Tooltip
|
||||
>Since you are an owner of this flow, you can send resume events without necessarily
|
||||
knowing the resume id sent by the approval step</Tooltip
|
||||
|
||||
@@ -305,7 +305,7 @@
|
||||
</button>
|
||||
</div>
|
||||
{/each}
|
||||
{:else}
|
||||
{:else if value != undefined}
|
||||
List is not an array
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<script lang="ts">
|
||||
export let id: string
|
||||
|
||||
$: id && console.log('updateJobId')
|
||||
</script>
|
||||
@@ -662,18 +662,21 @@
|
||||
bind:seconds={script.concurrency_time_window_s}
|
||||
/>
|
||||
</Label>
|
||||
<Label label="Custom concurrency key">
|
||||
<Label label="Custom concurrency key (optional)">
|
||||
<svelte:fragment slot="header">
|
||||
<Tooltip>
|
||||
Concurrency keys are global, you can have them be workspace specific using
|
||||
the variable `$workspace`. You can also use an argument's value using
|
||||
`$args[name_of_arg]`</Tooltip
|
||||
>
|
||||
</svelte:fragment>
|
||||
<input
|
||||
disabled={!$enterpriseLicense}
|
||||
type="text"
|
||||
autofocus
|
||||
bind:value={script.concurrency_key}
|
||||
placeholder={`$workspace/script/${script.path}-$args[foo]`}
|
||||
/>
|
||||
<Tooltip
|
||||
>Concurrency keys are global, you can have them be workspace specific using
|
||||
the variable `$workspace`. You can also use an argument's value using
|
||||
`$args[name_of_arg]`</Tooltip
|
||||
>
|
||||
</Label>
|
||||
</div>
|
||||
</Section>
|
||||
|
||||
@@ -17,11 +17,8 @@
|
||||
} from 'monaco-editor'
|
||||
import 'monaco-editor/esm/vs/basic-languages/sql/sql.contribution'
|
||||
import 'monaco-editor/esm/vs/basic-languages/yaml/yaml.contribution'
|
||||
import 'monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution'
|
||||
import 'monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution'
|
||||
import 'monaco-editor/esm/vs/basic-languages/graphql/graphql.contribution'
|
||||
import 'monaco-editor/esm/vs/language/json/monaco.contribution'
|
||||
import 'monaco-editor/esm/vs/language/typescript/monaco.contribution'
|
||||
import 'monaco-editor/esm/vs/basic-languages/css/css.contribution'
|
||||
import 'monaco-editor/esm/vs/language/css/monaco.contribution'
|
||||
|
||||
@@ -329,6 +326,7 @@
|
||||
filePath: 'windmill.d.ts'
|
||||
})
|
||||
}
|
||||
console.log(libs)
|
||||
languages.typescript.javascriptDefaults.setExtraLibs(libs)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,23 +67,35 @@
|
||||
|
||||
let runnableComponent: RunnableComponent
|
||||
|
||||
let confirmedCallback: (() => void) | undefined = undefined
|
||||
|
||||
let beforeIconComponent: any
|
||||
let afterIconComponent: any
|
||||
|
||||
$: resolvedConfig.beforeIcon && handleBeforeIcon()
|
||||
$: resolvedConfig.afterIcon && handleAfterIcon()
|
||||
|
||||
let confirmedCallback: (() => void) | undefined = undefined
|
||||
$: resolvedConfig.beforeIcon && beforeIconComponent && handleBeforeIcon()
|
||||
$: resolvedConfig.afterIcon && afterIconComponent && handleAfterIcon()
|
||||
|
||||
async function handleBeforeIcon() {
|
||||
if (resolvedConfig.beforeIcon) {
|
||||
beforeIconComponent = await loadIcon(resolvedConfig.beforeIcon)
|
||||
beforeIconComponent = await loadIcon(
|
||||
resolvedConfig.beforeIcon,
|
||||
beforeIconComponent,
|
||||
14,
|
||||
undefined,
|
||||
undefined
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleAfterIcon() {
|
||||
if (resolvedConfig.afterIcon) {
|
||||
afterIconComponent = await loadIcon(resolvedConfig.afterIcon)
|
||||
afterIconComponent = await loadIcon(
|
||||
resolvedConfig.afterIcon,
|
||||
afterIconComponent,
|
||||
14,
|
||||
undefined,
|
||||
undefined
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,17 +222,21 @@
|
||||
on:click={handleClick}
|
||||
size={resolvedConfig.size}
|
||||
color={resolvedConfig.color}
|
||||
startIcon={{
|
||||
icon: resolvedConfig.beforeIcon ? beforeIconComponent : undefined
|
||||
}}
|
||||
endIcon={{
|
||||
icon: resolvedConfig.afterIcon ? afterIconComponent : undefined
|
||||
}}
|
||||
{loading}
|
||||
>
|
||||
{#if resolvedConfig.beforeIcon}
|
||||
{#key resolvedConfig.beforeIcon}
|
||||
<div class="min-w-4" bind:this={beforeIconComponent} />
|
||||
{/key}
|
||||
{/if}
|
||||
{#if resolvedConfig.label?.toString() && resolvedConfig.label?.toString()?.length > 0}
|
||||
<div>{resolvedConfig.label.toString()}</div>
|
||||
{/if}
|
||||
{#if resolvedConfig.afterIcon}
|
||||
{#key resolvedConfig.afterIcon}
|
||||
<div class="min-w-4" bind:this={afterIconComponent} />
|
||||
{/key}
|
||||
{/if}
|
||||
</Button>
|
||||
{/key}
|
||||
</AlignWrapper>
|
||||
|
||||
@@ -62,18 +62,21 @@
|
||||
//@ts-ignore
|
||||
await import(
|
||||
/* @vite-ignore */
|
||||
/* webpackIgnore: true */
|
||||
`https://unpkg.com/react@${reactVersion}/umd/react.production.min.js`
|
||||
)
|
||||
|
||||
//@ts-ignore
|
||||
await import(
|
||||
/* @vite-ignore */
|
||||
/* webpackIgnore: true */
|
||||
`https://unpkg.com/react-dom@${reactVersion}/umd/react-dom.production.min.js`
|
||||
)
|
||||
}
|
||||
//@ts-ignore
|
||||
await import(
|
||||
/* @vite-ignore */
|
||||
/* webpackIgnore: true */
|
||||
`/api/w/${workspace ?? 'NO_W'}/resources_u/custom_component/${customComponent.name}`
|
||||
)
|
||||
loaded = true
|
||||
|
||||
@@ -34,18 +34,30 @@
|
||||
let beforeIconComponent: any
|
||||
let afterIconComponent: any
|
||||
|
||||
$: resolvedConfig.beforeIcon && handleBeforeIcon()
|
||||
$: resolvedConfig.afterIcon && handleAfterIcon()
|
||||
$: resolvedConfig.beforeIcon && beforeIconComponent && handleBeforeIcon()
|
||||
$: resolvedConfig.afterIcon && afterIconComponent && handleAfterIcon()
|
||||
|
||||
async function handleBeforeIcon() {
|
||||
if (resolvedConfig.beforeIcon) {
|
||||
beforeIconComponent = await loadIcon(resolvedConfig.beforeIcon)
|
||||
beforeIconComponent = await loadIcon(
|
||||
resolvedConfig.beforeIcon,
|
||||
beforeIconComponent,
|
||||
14,
|
||||
undefined,
|
||||
undefined
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleAfterIcon() {
|
||||
if (resolvedConfig.afterIcon) {
|
||||
afterIconComponent = await loadIcon(resolvedConfig.afterIcon)
|
||||
afterIconComponent = await loadIcon(
|
||||
resolvedConfig.afterIcon,
|
||||
afterIconComponent,
|
||||
14,
|
||||
undefined,
|
||||
undefined
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,14 +113,18 @@
|
||||
nonCaptureEvent
|
||||
>
|
||||
<span class="truncate inline-flex gap-2 items-center">
|
||||
{#if resolvedConfig.beforeIcon && beforeIconComponent}
|
||||
<svelte:component this={beforeIconComponent} size={14} />
|
||||
{#if resolvedConfig.beforeIcon}
|
||||
{#key resolvedConfig.beforeIcon}
|
||||
<div class="min-w-4" bind:this={beforeIconComponent} />
|
||||
{/key}
|
||||
{/if}
|
||||
{#if resolvedConfig.label && resolvedConfig.label?.length > 0}
|
||||
<div>{resolvedConfig.label}</div>
|
||||
{/if}
|
||||
{#if resolvedConfig.afterIcon && afterIconComponent}
|
||||
<svelte:component this={afterIconComponent} size={14} />
|
||||
{#if resolvedConfig.afterIcon}
|
||||
{#key resolvedConfig.afterIcon}
|
||||
<div class="min-w-4" bind:this={afterIconComponent} />
|
||||
{/key}
|
||||
{/if}
|
||||
</span>
|
||||
</Button>
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
import type { AppViewerContext, ComponentCustomCSS } from '../../types'
|
||||
import { initCss } from '../../utils'
|
||||
import RunnableWrapper from '../helpers/RunnableWrapper.svelte'
|
||||
import { twMerge } from 'tailwind-merge'
|
||||
import ResolveStyle from '../helpers/ResolveStyle.svelte'
|
||||
|
||||
export let id: string
|
||||
@@ -14,7 +13,7 @@
|
||||
export let customCss: ComponentCustomCSS<'htmlcomponent'> | undefined = undefined
|
||||
export let render: boolean
|
||||
|
||||
const { app, worldStore, mode } = getContext<AppViewerContext>('AppViewerContext')
|
||||
const { app, worldStore } = getContext<AppViewerContext>('AppViewerContext')
|
||||
|
||||
const outputs = initOutput($worldStore, id, {
|
||||
result: undefined,
|
||||
@@ -22,8 +21,6 @@
|
||||
})
|
||||
|
||||
let result: string | undefined = undefined
|
||||
let h: number | undefined = undefined
|
||||
let w: number | undefined = undefined
|
||||
|
||||
let css = initCss($app.css?.htmlcomponent, customCss)
|
||||
</script>
|
||||
@@ -43,8 +40,6 @@
|
||||
e?.preventDefault()
|
||||
}}
|
||||
class="h-full w-full"
|
||||
bind:clientHeight={h}
|
||||
bind:clientWidth={w}
|
||||
>
|
||||
<RunnableWrapper
|
||||
{outputs}
|
||||
@@ -55,22 +50,10 @@
|
||||
bind:initializing
|
||||
bind:result
|
||||
>
|
||||
{#key result}
|
||||
<iframe
|
||||
frameborder="0"
|
||||
style="height: {h}px; width: {w}px; {css?.container?.style ?? ''}"
|
||||
class={twMerge('p-0', css?.container?.class, 'wm-html')}
|
||||
title="sandbox"
|
||||
srcdoc={result
|
||||
? '<base target="_parent" /><scr' +
|
||||
`ipt type="application/javascript" src="/tailwind.js"></script>` +
|
||||
result
|
||||
: ''}
|
||||
/>
|
||||
{/key}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
{#if $mode == 'dnd'}
|
||||
<div on:click|stopPropagation class="absolute top-0 h-full w-full" />
|
||||
{/if}
|
||||
<div class="w-full h-full overflow-auto">
|
||||
{#key result}
|
||||
{@html result}
|
||||
{/key}
|
||||
</div>
|
||||
</RunnableWrapper>
|
||||
</div>
|
||||
|
||||
@@ -29,10 +29,12 @@
|
||||
|
||||
let iconComponent: any
|
||||
|
||||
$: handleIcon(resolvedConfig.icon)
|
||||
$: handleIcon(resolvedConfig, iconComponent)
|
||||
|
||||
async function handleIcon(i?: string) {
|
||||
iconComponent = i ? await loadIcon(i) : undefined
|
||||
async function handleIcon(conf, comp) {
|
||||
if (conf.icon && comp) {
|
||||
await loadIcon(conf.icon, iconComponent, conf.size, conf.strokeWidth, conf.color)
|
||||
}
|
||||
}
|
||||
|
||||
let css = initCss($app.css?.iconcomponent, customCss)
|
||||
@@ -66,12 +68,9 @@
|
||||
class={twMerge(css?.container?.class, 'wm-icon-container')}
|
||||
style={css?.container?.style ?? ''}
|
||||
>
|
||||
{#if resolvedConfig.icon && iconComponent}
|
||||
<svelte:component
|
||||
this={iconComponent}
|
||||
size={resolvedConfig.size || 24}
|
||||
color={resolvedConfig.color || 'currentColor'}
|
||||
strokeWidth={resolvedConfig.strokeWidth || 2}
|
||||
{#if resolvedConfig.icon}
|
||||
<div
|
||||
bind:this={iconComponent}
|
||||
class={twMerge(css?.icon?.class, 'wm-icon')}
|
||||
style={css?.icon?.style ?? ''}
|
||||
/>
|
||||
|
||||
@@ -40,22 +40,35 @@
|
||||
configuration
|
||||
)
|
||||
|
||||
let beforeIconComponent: any
|
||||
let afterIconComponent: any
|
||||
let css = initCss($app.css?.menucomponent, customCss)
|
||||
|
||||
$: resolvedConfig.beforeIcon && handleBeforeIcon()
|
||||
$: resolvedConfig.afterIcon && handleAfterIcon()
|
||||
let beforeIconComponent: any
|
||||
let afterIconComponent: any
|
||||
|
||||
$: resolvedConfig.beforeIcon && beforeIconComponent && handleBeforeIcon()
|
||||
$: resolvedConfig.afterIcon && afterIconComponent && handleAfterIcon()
|
||||
|
||||
async function handleBeforeIcon() {
|
||||
if (resolvedConfig.beforeIcon) {
|
||||
beforeIconComponent = await loadIcon(resolvedConfig.beforeIcon)
|
||||
beforeIconComponent = await loadIcon(
|
||||
resolvedConfig.beforeIcon,
|
||||
beforeIconComponent,
|
||||
14,
|
||||
undefined,
|
||||
undefined
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleAfterIcon() {
|
||||
if (resolvedConfig.afterIcon) {
|
||||
afterIconComponent = await loadIcon(resolvedConfig.afterIcon)
|
||||
afterIconComponent = await loadIcon(
|
||||
resolvedConfig.afterIcon,
|
||||
afterIconComponent,
|
||||
14,
|
||||
undefined,
|
||||
undefined
|
||||
)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -104,14 +117,18 @@
|
||||
nonCaptureEvent
|
||||
>
|
||||
<span class="truncate inline-flex gap-2 items-center">
|
||||
{#if resolvedConfig.beforeIcon && beforeIconComponent}
|
||||
<svelte:component this={beforeIconComponent} size={14} />
|
||||
{#if resolvedConfig.beforeIcon}
|
||||
{#key resolvedConfig.beforeIcon}
|
||||
<div class="min-w-4" bind:this={beforeIconComponent} />
|
||||
{/key}
|
||||
{/if}
|
||||
{#if resolvedConfig.label && resolvedConfig.label?.length > 0}
|
||||
<div>{resolvedConfig.label}</div>
|
||||
{/if}
|
||||
{#if resolvedConfig.afterIcon && afterIconComponent}
|
||||
<svelte:component this={afterIconComponent} size={14} />
|
||||
{#if resolvedConfig.afterIcon}
|
||||
{#key resolvedConfig.afterIcon}
|
||||
<div class="min-w-4" bind:this={afterIconComponent} />
|
||||
{/key}
|
||||
{/if}
|
||||
</span>
|
||||
</Button>
|
||||
|
||||
@@ -30,11 +30,17 @@
|
||||
|
||||
let iconComponent: any
|
||||
|
||||
$: isIcon && resolvedConfig?.media?.configuration?.icon?.icon && handleIcon()
|
||||
$: isIcon && resolvedConfig?.media?.configuration?.icon?.icon && iconComponent && handleIcon()
|
||||
|
||||
async function handleIcon() {
|
||||
if (resolvedConfig?.media?.configuration?.icon?.icon) {
|
||||
iconComponent = await loadIcon(resolvedConfig.media.configuration.icon.icon)
|
||||
iconComponent = await loadIcon(
|
||||
resolvedConfig?.media?.configuration?.icon?.icon,
|
||||
iconComponent,
|
||||
34,
|
||||
undefined,
|
||||
undefined
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,8 +86,10 @@
|
||||
style={css?.media?.style}
|
||||
>
|
||||
{#if isIcon}
|
||||
{#if resolvedConfig?.media && iconComponent}
|
||||
<svelte:component this={iconComponent} size={24} />
|
||||
{#if resolvedConfig?.media}
|
||||
{#key resolvedConfig.media}
|
||||
<div class="min-w-4 text-primary" bind:this={iconComponent} />
|
||||
{/key}
|
||||
{/if}
|
||||
{:else}
|
||||
<Loader loading={resolvedConfig?.media?.configuration?.image?.source == undefined}>
|
||||
|
||||
@@ -105,21 +105,6 @@
|
||||
let component = 'p'
|
||||
let classes = ''
|
||||
|
||||
function getHorizontalAlignement() {
|
||||
if (horizontalAlignment) {
|
||||
switch (horizontalAlignment) {
|
||||
case 'left':
|
||||
return '!text-left'
|
||||
case 'center':
|
||||
return '!text-center'
|
||||
case 'right':
|
||||
return '!text-right'
|
||||
default:
|
||||
return '!text-left'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$: resolvedConfig.style && (component = getComponent())
|
||||
$: resolvedConfig.style && (classes = getClasses())
|
||||
$: initialValue =
|
||||
@@ -184,7 +169,7 @@
|
||||
on:keydown|stopPropagation
|
||||
>
|
||||
{#if $mode == 'dnd' && editorMode && (componentInput?.type == 'template' || componentInput?.type == 'templatev2')}
|
||||
<AlignWrapper {horizontalAlignment} {verticalAlignment}>
|
||||
<AlignWrapper {verticalAlignment}>
|
||||
<textarea
|
||||
class={twMerge(
|
||||
'whitespace-pre-wrap !outline-none !border-0 !bg-transparent !resize-none !overflow-hidden !ring-0 !p-0 text-center',
|
||||
@@ -192,8 +177,7 @@
|
||||
'wm-text',
|
||||
classes,
|
||||
getClasses(),
|
||||
getClassesByType(),
|
||||
getHorizontalAlignement()
|
||||
getClassesByType()
|
||||
)}
|
||||
on:pointerdown|stopPropagation
|
||||
style={css?.text?.style}
|
||||
@@ -210,7 +194,7 @@
|
||||
/>
|
||||
</AlignWrapper>
|
||||
{:else}
|
||||
<AlignWrapper {horizontalAlignment} {verticalAlignment}>
|
||||
<AlignWrapper {verticalAlignment}>
|
||||
{#if !result || result === ''}
|
||||
<div
|
||||
class="text-ternary bg-surface-primary flex justify-center items-center h-full w-full"
|
||||
@@ -227,7 +211,17 @@
|
||||
>
|
||||
<svelte:element
|
||||
this={component}
|
||||
class={twMerge('whitespace-pre-wrap', css?.text?.class, classes)}
|
||||
class={twMerge(
|
||||
'whitespace-pre-wrap',
|
||||
|
||||
css?.text?.class,
|
||||
classes,
|
||||
horizontalAlignment === 'center'
|
||||
? 'text-center'
|
||||
: horizontalAlignment === 'right'
|
||||
? 'text-right'
|
||||
: 'text-left'
|
||||
)}
|
||||
style={css?.text?.style}
|
||||
>
|
||||
{String(result)}
|
||||
|
||||
@@ -33,7 +33,12 @@
|
||||
let Plotly
|
||||
onMount(async () => {
|
||||
//@ts-ignore
|
||||
await import('https://cdn.jsdelivr.net/npm/plotly.js-dist@2.18.0/plotly.min.js')
|
||||
await import(
|
||||
/* @vite-ignore */
|
||||
/* webpackIgnore: true */
|
||||
//@ts-ignore
|
||||
'https://cdn.jsdelivr.net/npm/plotly.js-dist@2.18.0/plotly.min.js'
|
||||
)
|
||||
|
||||
Plotly = window['Plotly']
|
||||
})
|
||||
|
||||
@@ -35,7 +35,11 @@
|
||||
let Plotly
|
||||
onMount(async () => {
|
||||
//@ts-ignore
|
||||
await import('https://cdn.jsdelivr.net/npm/plotly.js-dist@2.18.0/plotly.min.js')
|
||||
await import(
|
||||
/* webpackIgnore: true */
|
||||
//@ts-ignorez
|
||||
'https://cdn.jsdelivr.net/npm/plotly.js-dist@2.18.0/plotly.min.js'
|
||||
)
|
||||
|
||||
Plotly = window['Plotly']
|
||||
})
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
let vegaEmbed
|
||||
onMount(async () => {
|
||||
//@ts-ignore
|
||||
await import('https://cdn.jsdelivr.net/npm/vega@5.22.1')
|
||||
await import(/* webpackIgnore: true */ 'https://cdn.jsdelivr.net/npm/vega@5.22.1')
|
||||
//@ts-ignore
|
||||
await import('https://cdn.jsdelivr.net/npm/vega-lite@5.6.0')
|
||||
await import(/* webpackIgnore: true */ 'https://cdn.jsdelivr.net/npm/vega-lite@5.6.0')
|
||||
//@ts-ignore
|
||||
await import('https://cdn.jsdelivr.net/npm/vega-embed@6.21.0')
|
||||
await import(/* webpackIgnore: true */ 'https://cdn.jsdelivr.net/npm/vega-embed@6.21.0')
|
||||
|
||||
vegaEmbed = window['vegaEmbed']
|
||||
})
|
||||
|
||||
@@ -9,19 +9,19 @@
|
||||
type ColumnDef
|
||||
} from './utils'
|
||||
|
||||
import wasmUrl from 'windmill-parser-wasm/windmill_parser_wasm_bg.wasm?url'
|
||||
import init, {
|
||||
parse_sql,
|
||||
parse_mysql,
|
||||
parse_bigquery,
|
||||
parse_snowflake,
|
||||
parse_mssql
|
||||
} from 'windmill-parser-wasm'
|
||||
import type { MainArgSignature } from '$lib/gen'
|
||||
import { makeInsertQuery } from './queries/insert'
|
||||
import { argSigToJsonSchemaType } from '$lib/infer'
|
||||
} from 'windmill-sql-datatype-parser-wasm'
|
||||
import wasmUrl from 'windmill-sql-datatype-parser-wasm/windmill_sql_datatype_parser_wasm_bg.wasm?url'
|
||||
|
||||
init(wasmUrl)
|
||||
|
||||
import { argSigToJsonSchemaType } from '$lib/inferArgSig'
|
||||
|
||||
export let args: Record<string, any> = {}
|
||||
export let dbType: DbType = 'postgresql'
|
||||
|
||||
@@ -63,50 +63,66 @@
|
||||
}
|
||||
}) as FieldMetadata[] | undefined
|
||||
|
||||
async function parseSQLArgs(code: string, dbType: DbType) {
|
||||
await init(wasmUrl)
|
||||
|
||||
let rawSchema = ''
|
||||
function parseSQLArgs(field: string, dbType: DbType): string {
|
||||
let rawType = ''
|
||||
switch (dbType) {
|
||||
case 'mysql':
|
||||
rawSchema = parse_mysql(code)
|
||||
rawType = parse_mysql(field)
|
||||
break
|
||||
case 'postgresql':
|
||||
rawSchema = parse_sql(code)
|
||||
rawType = parse_sql(field)
|
||||
break
|
||||
case 'bigquery':
|
||||
rawSchema = parse_bigquery(code)
|
||||
rawType = parse_bigquery(field)
|
||||
break
|
||||
case 'snowflake':
|
||||
rawSchema = parse_snowflake(code)
|
||||
rawType = parse_snowflake(field)
|
||||
break
|
||||
case 'ms_sql_server':
|
||||
rawSchema = parse_mssql(code)
|
||||
rawType = parse_mssql(field)
|
||||
break
|
||||
default:
|
||||
throw new Error('Language not supported')
|
||||
}
|
||||
|
||||
const args: MainArgSignature = JSON.parse(rawSchema)
|
||||
|
||||
return args
|
||||
return rawType
|
||||
}
|
||||
|
||||
function rawTypeToSchemaType(typ: string) {
|
||||
if (typ.startsWith('list-')) {
|
||||
return {
|
||||
list: rawTypeToSchemaType(typ.replace('list-', ''))
|
||||
}
|
||||
} else if (typ == 'str') {
|
||||
return {
|
||||
str: undefined
|
||||
}
|
||||
} else {
|
||||
return typ
|
||||
}
|
||||
}
|
||||
async function builtSchema(fields: FieldMetadata[], dbType: DbType) {
|
||||
const properties: { [name: string]: SchemaProperty } = {}
|
||||
const required: string[] = []
|
||||
|
||||
const insertCode = makeInsertQuery('ignoredtable', columnDefs, dbType)
|
||||
const args = await parseSQLArgs(insertCode, dbType)
|
||||
await init(wasmUrl)
|
||||
|
||||
fields.forEach((field) => {
|
||||
const schemaProperty: SchemaProperty = {
|
||||
type: 'string'
|
||||
}
|
||||
|
||||
const parsedArg = args.args.find((arg) => arg.name === field.name)
|
||||
const parsedArg = columnDefs.find((arg) => arg.field === field.name)
|
||||
if (parsedArg) {
|
||||
argSigToJsonSchemaType(parsedArg.typ, schemaProperty)
|
||||
let typ: any = rawTypeToSchemaType(parseSQLArgs(parsedArg.datatype, dbType))
|
||||
argSigToJsonSchemaType(typ, schemaProperty)
|
||||
console.log(
|
||||
'schemaProperty',
|
||||
schemaProperty,
|
||||
field.name,
|
||||
typ,
|
||||
parseSQLArgs(parsedArg.datatype, dbType)
|
||||
)
|
||||
}
|
||||
|
||||
if (field.defaultValue) {
|
||||
|
||||
@@ -177,7 +177,7 @@ export async function eval_like(
|
||||
}
|
||||
window.open(x, '_blank')
|
||||
} else {
|
||||
await newTab(x)
|
||||
window.location.href = x
|
||||
}
|
||||
},
|
||||
(id, index) => {
|
||||
|
||||
@@ -6,21 +6,33 @@ function toKebabCase(str: string): string {
|
||||
.toLowerCase()
|
||||
}
|
||||
|
||||
export async function loadIcon(name: string): Promise<any> {
|
||||
let iconComponent: any
|
||||
export async function loadIcon(
|
||||
name: string,
|
||||
parent: HTMLElement,
|
||||
size: number | undefined,
|
||||
strokeWidth: number | undefined,
|
||||
color: string | undefined
|
||||
): Promise<any> {
|
||||
try {
|
||||
if (name) {
|
||||
iconComponent = (
|
||||
await import(
|
||||
`../../../../../node_modules/lucide-svelte/dist/svelte/icons/${toKebabCase(name)}.svelte`
|
||||
)
|
||||
).default
|
||||
return iconComponent
|
||||
} else {
|
||||
iconComponent = undefined
|
||||
await fetch(
|
||||
`https://cdn.jsdelivr.net/npm/lucide-static@0.367.0/icons/${toKebabCase(name)}.svg`
|
||||
)
|
||||
.then((response) => response.text())
|
||||
.then((svg) => (parent.innerHTML = svg))
|
||||
let elem = parent.children?.[0]
|
||||
if (elem) {
|
||||
elem.setAttribute('width', size?.toString() ?? '24')
|
||||
elem.setAttribute('height', size?.toString() ?? '24')
|
||||
if (strokeWidth) {
|
||||
elem.setAttribute('stroke-width', strokeWidth.toString())
|
||||
}
|
||||
if (color) {
|
||||
elem.setAttribute('stroke', color)
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
iconComponent = undefined
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,18 +82,30 @@
|
||||
let beforeIconComponent: any
|
||||
let afterIconComponent: any
|
||||
|
||||
$: resolvedConfig.beforeIcon && handleBeforeIcon()
|
||||
$: resolvedConfig.afterIcon && handleAfterIcon()
|
||||
$: resolvedConfig.beforeIcon && beforeIconComponent && handleBeforeIcon()
|
||||
$: resolvedConfig.afterIcon && afterIconComponent && handleAfterIcon()
|
||||
|
||||
async function handleBeforeIcon() {
|
||||
if (resolvedConfig.beforeIcon) {
|
||||
beforeIconComponent = await loadIcon(resolvedConfig.beforeIcon)
|
||||
beforeIconComponent = await loadIcon(
|
||||
resolvedConfig.beforeIcon,
|
||||
beforeIconComponent,
|
||||
14,
|
||||
undefined,
|
||||
undefined
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleAfterIcon() {
|
||||
if (resolvedConfig.afterIcon) {
|
||||
afterIconComponent = await loadIcon(resolvedConfig.afterIcon)
|
||||
afterIconComponent = await loadIcon(
|
||||
resolvedConfig.afterIcon,
|
||||
afterIconComponent,
|
||||
14,
|
||||
undefined,
|
||||
undefined
|
||||
)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -141,14 +153,20 @@
|
||||
<AlignWrapper {render} {verticalAlignment}>
|
||||
<div class="relative w-full">
|
||||
<div class="absolute top-1/2 -translate-y-1/2 left-2">
|
||||
{#if resolvedConfig.beforeIcon && beforeIconComponent}
|
||||
<svelte:component this={beforeIconComponent} size={14} />
|
||||
{#if resolvedConfig.beforeIcon}
|
||||
{#key resolvedConfig.beforeIcon}
|
||||
<div class="min-w-4" bind:this={beforeIconComponent} />
|
||||
{/key}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{#if inputType === 'password'}
|
||||
<input
|
||||
class={twMerge(classInput, beforeIconComponent && 'pl-8', afterIconComponent && 'pr-8')}
|
||||
class={twMerge(
|
||||
classInput,
|
||||
resolvedConfig.beforeIcon ? '!pl-8' : '',
|
||||
resolvedConfig.afterIcon ? '!pr-8' : ''
|
||||
)}
|
||||
style={css?.input?.style ?? ''}
|
||||
on:pointerdown|stopPropagation={(e) =>
|
||||
!$connectingInput.opened && selectId(e, id, selectedComponent, $app)}
|
||||
@@ -160,7 +178,11 @@
|
||||
/>
|
||||
{:else if inputType === 'text'}
|
||||
<input
|
||||
class={twMerge(classInput, beforeIconComponent && 'pl-8', afterIconComponent && 'pr-8')}
|
||||
class={twMerge(
|
||||
classInput,
|
||||
resolvedConfig.beforeIcon ? '!pl-8' : '',
|
||||
resolvedConfig.afterIcon ? '!pr-8' : ''
|
||||
)}
|
||||
style={css?.input?.style ?? ''}
|
||||
on:pointerdown|stopPropagation={(e) =>
|
||||
!$connectingInput.opened && selectId(e, id, selectedComponent, $app)}
|
||||
@@ -172,7 +194,11 @@
|
||||
/>
|
||||
{:else if inputType === 'email'}
|
||||
<input
|
||||
class={twMerge(classInput, beforeIconComponent && 'pl-8', afterIconComponent && 'pr-8')}
|
||||
class={twMerge(
|
||||
classInput,
|
||||
resolvedConfig.beforeIcon != undefined ? '!pl-8' : '',
|
||||
resolvedConfig.afterIcon ? '!pr-8' : ''
|
||||
)}
|
||||
style={css?.input?.style ?? ''}
|
||||
on:pointerdown|stopPropagation={(e) =>
|
||||
!$connectingInput.opened && selectId(e, id, selectedComponent, $app)}
|
||||
@@ -185,8 +211,10 @@
|
||||
{/if}
|
||||
|
||||
<div class="absolute top-1/2 -translate-y-1/2 right-2">
|
||||
{#if resolvedConfig.afterIcon && afterIconComponent}
|
||||
<svelte:component this={afterIconComponent} size={14} />
|
||||
{#if resolvedConfig.afterIcon}
|
||||
{#key resolvedConfig.afterIcon}
|
||||
<div class="min-w-4" bind:this={afterIconComponent} />
|
||||
{/key}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
<script lang="ts">
|
||||
import { getModifierKey } from '$lib/utils'
|
||||
|
||||
import { Copy, Scissors, Trash } from 'lucide-svelte'
|
||||
import { Copy, Paintbrush2, Scissors, Trash } from 'lucide-svelte'
|
||||
import ContextMenu from '$lib/components/ContextMenu.svelte'
|
||||
import ComponentCallbacks from './component/ComponentCallbacks.svelte'
|
||||
import { getContext } from 'svelte'
|
||||
import type { AppEditorContext, AppViewerContext } from '../types'
|
||||
import DeleteComponent from './settingsPanel/DeleteComponent.svelte'
|
||||
import { findComponentSettings } from './appUtils'
|
||||
import { secondaryMenuLeft } from './settingsPanel/secondaryMenu'
|
||||
import StylePanel from './settingsPanel/StylePanel.svelte'
|
||||
|
||||
export let id: string
|
||||
let componentCallbacks: ComponentCallbacks | undefined = undefined
|
||||
@@ -40,6 +42,14 @@
|
||||
icon: Copy,
|
||||
shortcut: `${getModifierKey()}C`
|
||||
},
|
||||
{
|
||||
label: 'Show style panel',
|
||||
onClick: () => {
|
||||
secondaryMenuLeft?.toggle(StylePanel, {})
|
||||
},
|
||||
icon: Paintbrush2,
|
||||
disabled: $secondaryMenuLeft.isOpen
|
||||
},
|
||||
|
||||
{
|
||||
label: 'Delete',
|
||||
|
||||
@@ -11,13 +11,17 @@
|
||||
|
||||
const { selectedComponent, app, stateId } = getContext<AppViewerContext>('AppViewerContext')
|
||||
|
||||
let firstComponent = $selectedComponent?.[0]
|
||||
|
||||
$: $selectedComponent?.[0] != firstComponent && (firstComponent = $selectedComponent?.[0])
|
||||
|
||||
$: hiddenInlineScript = $app?.hiddenInlineScripts
|
||||
?.map((x, i) => ({ script: x, index: i }))
|
||||
.find(({ script, index }) => $selectedComponent?.includes(BG_PREFIX + index))
|
||||
|
||||
$: componentSettings = findComponentSettings($app, $selectedComponent?.[0])
|
||||
$: tableActionSettings = findTableActionSettings($app, $selectedComponent?.[0])
|
||||
$: menuItemsSettings = findMenuItemsSettings($app, $selectedComponent?.[0])
|
||||
$: componentSettings = findComponentSettings($app, firstComponent)
|
||||
$: tableActionSettings = findTableActionSettings($app, firstComponent)
|
||||
$: menuItemsSettings = findMenuItemsSettings($app, firstComponent)
|
||||
|
||||
function findTableActionSettings(app: App, id: string | undefined) {
|
||||
return allItems(app.grid, app.subgrids)
|
||||
|
||||
@@ -371,9 +371,16 @@ export function insertNewGridItem(
|
||||
let parent = findGridItemById(app.grid, app.subgrids, key)?.data
|
||||
let subgrids = parent?.numberOfSubgrids
|
||||
if (subgrids === undefined) {
|
||||
throw Error(`Invalid subgrid selected, the parent has no subgrids: ${key}, parent: ${JSON.stringify(parent)}`)
|
||||
throw Error(
|
||||
`Invalid subgrid selected, the parent has no subgrids: ${key}, parent: ${JSON.stringify(
|
||||
parent
|
||||
)}`
|
||||
)
|
||||
}
|
||||
if (focusedGrid?.subGridIndex && (focusedGrid?.subGridIndex < 0 || focusedGrid?.subGridIndex >= subgrids)) {
|
||||
if (
|
||||
focusedGrid?.subGridIndex &&
|
||||
(focusedGrid?.subGridIndex < 0 || focusedGrid?.subGridIndex >= subgrids)
|
||||
) {
|
||||
throw Error(`Invalid subgrid selected: ${key}, max subgrids: ${subgrids}`)
|
||||
}
|
||||
// If ever the subgrid is undefined, we want to make sure it is defined
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
shouldCapitalize={true}
|
||||
resourceOnly={false}
|
||||
fieldType="text"
|
||||
tooltip="Eval an expression that return a list of class as string to dynamically add classes to the component. The styling can then be dynamic using the global CSS Editor."
|
||||
customTitle="Dynamic class (eval)"
|
||||
displayType={false}
|
||||
placeholder={undefined}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<script lang="ts">
|
||||
import { Copy, MoveLeft, MoveRight, Paintbrush2 } from 'lucide-svelte'
|
||||
import { Code, Copy, MoveLeft, MoveRight, Paintbrush2 } from 'lucide-svelte'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import { fade } from 'svelte/transition'
|
||||
import { slide } from 'svelte/transition'
|
||||
import { addWhitespaceBeforeCapitals, copyToClipboard, sendUserToast } from '../../../../utils'
|
||||
import { Button, ClearableInput } from '../../../common'
|
||||
import Popover from '../../../Popover.svelte'
|
||||
import type { ComponentCssProperty } from '../../types'
|
||||
import { ccomponents, type TypedComponent } from '../component'
|
||||
import QuickStyleMenu from './QuickStyleMenu.svelte'
|
||||
@@ -15,6 +14,9 @@
|
||||
import CssEval from './CssEval.svelte'
|
||||
import parse from 'style-to-object'
|
||||
import SimpleEditor from '$lib/components/SimpleEditor.svelte'
|
||||
import ToggleButtonGroup from '$lib/components/common/toggleButton-v2/ToggleButtonGroup.svelte'
|
||||
import ToggleButton from '$lib/components/common/toggleButton-v2/ToggleButton.svelte'
|
||||
import Popover from '$lib/components/Popover.svelte'
|
||||
|
||||
export let name: string
|
||||
export let value: ComponentCssProperty = {}
|
||||
@@ -40,125 +42,125 @@
|
||||
value.style = ''
|
||||
}
|
||||
parse(value.style)
|
||||
|
||||
isQuickMenuOpen = !isQuickMenuOpen
|
||||
} catch {
|
||||
sendUserToast('Invalid CSS: Rich editor cannot be toggled', true)
|
||||
}
|
||||
}
|
||||
|
||||
let richEditorOpen = false
|
||||
|
||||
let dynamicClass: boolean = value?.evalClass !== undefined
|
||||
let render = 0
|
||||
</script>
|
||||
|
||||
{#key render}
|
||||
<div class=" border-b flex justify-between items-center p-2 text-xs leading-6 font-bold">
|
||||
<div class="flex flex-col gap-1 w-full items-start">
|
||||
<div class="flex flex-row h-8 items-center justify-between w-full">
|
||||
<div class="capitalize">
|
||||
{addWhitespaceBeforeCapitals(name)}
|
||||
</div>
|
||||
{#if shouldDisplayLeft}
|
||||
<div class="flex justify-between items-center p-2 text-xs leading-6 font-bold w-full">
|
||||
<div class="capitalize">
|
||||
{addWhitespaceBeforeCapitals(name)}
|
||||
</div>
|
||||
<div class="flex flex-row items-center gap-1">
|
||||
{#if shouldDisplayLeft}
|
||||
<Popover placement="bottom" notClickable disappearTimeout={0}>
|
||||
<Button
|
||||
color="light"
|
||||
size="xs2"
|
||||
variant="border"
|
||||
on:click={() => {
|
||||
dispatch('left')
|
||||
}}
|
||||
>
|
||||
<div class="flex flex-row gap-2 text-2xs items-center">
|
||||
<MoveLeft size={14} />
|
||||
Copy for this component
|
||||
</div>
|
||||
</Button>
|
||||
{/if}
|
||||
{#if shouldDisplayRight}
|
||||
<Button
|
||||
color="light"
|
||||
size="xs2"
|
||||
variant="border"
|
||||
on:click={() => {
|
||||
dispatch('right')
|
||||
}}
|
||||
>
|
||||
<div class="flex flex-row gap-2 text-2xs items-center">
|
||||
Copy for every {componentType ? ccomponents[componentType].name : 'component'}
|
||||
<MoveRight size={14} />
|
||||
</div>
|
||||
</Button>
|
||||
{/if}
|
||||
</div>
|
||||
{#if wmClass}
|
||||
<Badge small>
|
||||
<div class="flex flex-row gap-1 items-center">
|
||||
{wmClass}
|
||||
<Button
|
||||
color="light"
|
||||
size="xs2"
|
||||
on:click={() => {
|
||||
copyToClipboard(wmClass)
|
||||
}}
|
||||
>
|
||||
<Copy size={14} />
|
||||
</Button>
|
||||
</div>
|
||||
</Badge>
|
||||
iconOnly
|
||||
startIcon={{ icon: MoveLeft }}
|
||||
on:click={() => dispatch('left')}
|
||||
/>
|
||||
<svelte:fragment slot="text">{'Copy for this component'}</svelte:fragment>
|
||||
</Popover>
|
||||
{/if}
|
||||
{#if shouldDisplayRight}
|
||||
<Popover placement="bottom" notClickable disappearTimeout={0}>
|
||||
<Button
|
||||
color="light"
|
||||
size="xs2"
|
||||
iconOnly
|
||||
startIcon={{ icon: MoveRight }}
|
||||
on:click={() => dispatch('right')}
|
||||
/>
|
||||
<svelte:fragment slot="text">
|
||||
Copy for every {componentType ? ccomponents[componentType].name : 'component'}
|
||||
</svelte:fragment>
|
||||
</Popover>
|
||||
{/if}
|
||||
<Popover placement="bottom" notClickable disappearTimeout={0}>
|
||||
<Button
|
||||
color="light"
|
||||
size="xs2"
|
||||
iconOnly
|
||||
startIcon={{ icon: Copy }}
|
||||
on:click={() => copyToClipboard(wmClass)}
|
||||
/>
|
||||
<svelte:fragment slot="text">
|
||||
Copy {wmClass}
|
||||
</svelte:fragment>
|
||||
</Popover>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{#if value}
|
||||
<div class="p-2 flex flex-col">
|
||||
<div class="p-2 flex flex-col gap-2">
|
||||
{#if tooltip}
|
||||
<div class="text-tertiary text-2xs py-2">{tooltip}</div>
|
||||
{/if}
|
||||
|
||||
{#if value.style !== undefined || forceStyle}
|
||||
<div class="pb-2">
|
||||
<!-- svelte-ignore a11y-label-has-associated-control -->
|
||||
<label class="block w-full">
|
||||
<div class="flex flex-row justify-between items-center w-full h-8">
|
||||
<div class="block w-full">
|
||||
<div class="flex flex-row justify-between items-center w-full h-8 mb-1">
|
||||
<div class="text-xs font-medium text-tertiary"> Plain CSS </div>
|
||||
{#if overriden}
|
||||
<Badge color="red" small>Overriden by local</Badge>
|
||||
{:else if overridding}
|
||||
<Badge color="blue" small>Overriding global</Badge>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="flex gap-1">
|
||||
<div class="relative grow">
|
||||
<ClearableInput
|
||||
bind:value={value.style}
|
||||
type="textarea"
|
||||
wrapperClass="h-full min-h-[72px]"
|
||||
inputClass="h-full !text-xs !rounded-none !p-2"
|
||||
/>
|
||||
</div>
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="flex flex-row gap-1">
|
||||
{#if overriden}
|
||||
<Badge color="red" small>Overriden by local</Badge>
|
||||
{:else if overridding}
|
||||
<Badge color="blue" small>Overriding global</Badge>
|
||||
{/if}
|
||||
{#if quickStyleProperties?.length}
|
||||
<Popover placement="bottom" notClickable disappearTimeout={0}>
|
||||
<Button
|
||||
variant="border"
|
||||
color="light"
|
||||
size="xs"
|
||||
btnClasses="!p-1 !w-[34px] !h-[34px] {isQuickMenuOpen
|
||||
? '!bg-gray-200/60 hover:!bg-gray-200 focus:!bg-gray-200'
|
||||
: ''}"
|
||||
aria-label="{isQuickMenuOpen ? 'Close' : 'Open'} styling menu"
|
||||
on:click={toggleQuickMenu}
|
||||
>
|
||||
<Paintbrush2 size={18} />
|
||||
</Button>
|
||||
<svelte:fragment slot="text">
|
||||
{isQuickMenuOpen ? 'Close' : 'Open'} styling menu
|
||||
</svelte:fragment>
|
||||
</Popover>
|
||||
<ToggleButtonGroup
|
||||
bind:selected={richEditorOpen}
|
||||
on:selected={() => {
|
||||
if (richEditorOpen !== isQuickMenuOpen) {
|
||||
toggleQuickMenu()
|
||||
richEditorOpen = isQuickMenuOpen
|
||||
}
|
||||
}}
|
||||
>
|
||||
<ToggleButton
|
||||
small
|
||||
light
|
||||
value={false}
|
||||
icon={Code}
|
||||
tooltip="Edit the CSS directly"
|
||||
/>
|
||||
<ToggleButton
|
||||
small
|
||||
light
|
||||
value={true}
|
||||
icon={Paintbrush2}
|
||||
tooltip="Open the rich editor to style the component with a visual interface"
|
||||
/>
|
||||
</ToggleButtonGroup>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
|
||||
<ClearableInput
|
||||
bind:value={value.style}
|
||||
type="textarea"
|
||||
disabled={isQuickMenuOpen}
|
||||
wrapperClass="h-full min-h-[72px]"
|
||||
inputClass="h-full !text-xs !rounded-none !p-2 !shadow-none !border-gray-200 dark:!border-gray-600 "
|
||||
/>
|
||||
</div>
|
||||
{#if quickStyleProperties?.length && isQuickMenuOpen}
|
||||
<div transition:fade|local={{ duration: 200 }} class="w-full pt-1">
|
||||
<div class="text-xs mb-1 font-medium">Rich editor</div>
|
||||
<div transition:slide|local={{ duration: 200 }} class="w-full">
|
||||
<QuickStyleMenu
|
||||
bind:value={value.style}
|
||||
properties={quickStyleProperties}
|
||||
@@ -188,7 +190,7 @@
|
||||
{#if value.class !== undefined || forceClass}
|
||||
<!-- svelte-ignore a11y-label-has-associated-control -->
|
||||
<label class="block">
|
||||
<div class="text-xs font-medium text-tertiary">
|
||||
<div class="text-xs font-medium text-tertiary mb-1">
|
||||
Tailwind classes
|
||||
<Tooltip light documentationLink="https://tailwindcss.com/">
|
||||
Use any tailwind classes to style your component
|
||||
@@ -196,7 +198,7 @@
|
||||
</div>
|
||||
<div class="relative">
|
||||
<SimpleEditor
|
||||
class="h-24"
|
||||
class="h-24 border !rounded-none"
|
||||
lang="tailwindcss"
|
||||
bind:code={value.class}
|
||||
fixedOverflowWidgets={true}
|
||||
@@ -222,27 +224,31 @@
|
||||
{/if}
|
||||
</label>
|
||||
{/if}
|
||||
|
||||
<Toggle
|
||||
options={{
|
||||
right: 'Use dynamic class'
|
||||
}}
|
||||
size="xs"
|
||||
bind:checked={dynamicClass}
|
||||
on:change={(e) => {
|
||||
if (e.detail && !value.evalClass) {
|
||||
value.evalClass = {
|
||||
type: 'evalv2',
|
||||
expr: '',
|
||||
connections: [],
|
||||
fieldType: 'text'
|
||||
<div class="flex flex-row justify-between items-center">
|
||||
<div class="text-xs flex flex-row items-center justify-center">
|
||||
Use dynamic class
|
||||
<Tooltip light>
|
||||
Eval an expression that return a list of class as string to dynamically add classes to
|
||||
the component. The styling can then be dynamic using the global CSS Editor.
|
||||
</Tooltip>
|
||||
</div>
|
||||
<Toggle
|
||||
size="xs"
|
||||
bind:checked={dynamicClass}
|
||||
on:change={(e) => {
|
||||
if (e.detail && !value.evalClass) {
|
||||
value.evalClass = {
|
||||
type: 'evalv2',
|
||||
expr: '',
|
||||
connections: [],
|
||||
fieldType: 'text'
|
||||
}
|
||||
} else {
|
||||
value.evalClass = undefined
|
||||
}
|
||||
} else {
|
||||
value.evalClass = undefined
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
{#if value?.evalClass && dynamicClass}
|
||||
<CssEval key={name} bind:evalClass={value.evalClass} />
|
||||
{/if}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
const { app } = getContext<AppViewerContext>('AppViewerContext')
|
||||
const styleStore = createStyleStore(properties)
|
||||
setContext(STYLE_STORE_KEY, styleStore)
|
||||
|
||||
let multiValues: Record<number, string[]> = initiateMultiValues()
|
||||
let mounted = false
|
||||
let isOpen: Record<string, boolean> = {}
|
||||
@@ -75,7 +76,14 @@
|
||||
|
||||
function setTopColors() {
|
||||
const styles = collectStyles()
|
||||
const parsedStyles = styles.map((style) => parse(style) || {})
|
||||
const parsedStyles = styles.map((style) => {
|
||||
try {
|
||||
return parse(style) || {}
|
||||
} catch {
|
||||
return {}
|
||||
}
|
||||
})
|
||||
|
||||
const usedColors: Record<string, number> = {}
|
||||
parsedStyles.forEach((style) => {
|
||||
Object.values(style).reduce((colors, v) => {
|
||||
@@ -174,7 +182,7 @@
|
||||
})
|
||||
</script>
|
||||
|
||||
<div class="pb-2 pt-1">
|
||||
<div class="flex flex-col !divide-y">
|
||||
{#each properties as property}
|
||||
{#each Object.keys(property) as group (group)}
|
||||
{@const prefix = `${componentType}_${componentProperty}_${group}`}
|
||||
@@ -182,13 +190,13 @@
|
||||
bind:isOpen={isOpen[prefix]}
|
||||
title={group}
|
||||
{prefix}
|
||||
openByDefault={true}
|
||||
wrapperClasses="!px-0 !pt-0"
|
||||
toggleClasses="border-b !rounded-b-none !py-0
|
||||
openByDefault={false}
|
||||
wrapperClasses="!px-0 !py-0 "
|
||||
toggleClasses=" !rounded-b-none !py-0
|
||||
{isOpen[prefix] ? '!bg-surface-secondary hover:!bg-surface-hover' : ''}"
|
||||
>
|
||||
<svelte:fragment slot="title">
|
||||
<span class="font-semibold text-tertiary capitalize">
|
||||
<span class="font-normal text-xs">
|
||||
{group}
|
||||
</span>
|
||||
</svelte:fragment>
|
||||
@@ -200,7 +208,7 @@
|
||||
} = styleStore.getProp(p)}
|
||||
{#if prop !== undefined && index !== undefined}
|
||||
<div class="pb-2 pt-1">
|
||||
<div class="text-sm font-medium text-tertiary pb-0.5">
|
||||
<div class="text-xs font-semibold text-tertiary pb-0.5">
|
||||
{formatKebabCase(prop.key)}
|
||||
</div>
|
||||
<div class="flex items-center gap-1">
|
||||
|
||||
@@ -611,7 +611,8 @@ export const quickStyleProperties: Record<
|
||||
aggridcomponent: {},
|
||||
aggridcomponentee: {},
|
||||
buttoncomponent: {
|
||||
button: buttonDefaultProps
|
||||
button: buttonDefaultProps,
|
||||
container: containerDefaultProps
|
||||
},
|
||||
downloadcomponent: {
|
||||
button: buttonDefaultProps
|
||||
|
||||
@@ -180,6 +180,7 @@
|
||||
|
||||
let dragDisabled = true
|
||||
|
||||
let dragging = false
|
||||
function handleConsider(e) {
|
||||
const {
|
||||
items: newItems,
|
||||
@@ -207,9 +208,11 @@
|
||||
|
||||
const reorderedValues = items.map((item) => item.value)
|
||||
componentInput.value = reorderedValues
|
||||
dragging = false
|
||||
}
|
||||
|
||||
function startDrag(e) {
|
||||
dragging = true
|
||||
// preventing default to prevent lag on touch devices (because of the browser checking for screen scrolling)
|
||||
e.preventDefault()
|
||||
dragDisabled = false
|
||||
@@ -290,6 +293,7 @@
|
||||
bind:componentInput
|
||||
bind:value={item.value}
|
||||
on:remove={() => deleteElementByType(index)}
|
||||
{dragging}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
...componentInput,
|
||||
type: 'evalv2',
|
||||
expr: expr,
|
||||
connections: [{ componentId: connection.componentId, id: connection.path.split('.')[0] }]
|
||||
connections: [{ componentId: connection.componentId, id: connection.path.split('.')[0].split('[')[0] }]
|
||||
}
|
||||
evalV2editor?.setCode(expr)
|
||||
$app = $app
|
||||
|
||||
@@ -167,9 +167,9 @@
|
||||
componentSettings.item.data.componentInput = appInput
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function isMac() {
|
||||
return navigator.platform.toUpperCase().indexOf('MAC') >= 0;
|
||||
return navigator.platform.toUpperCase().indexOf('MAC') >= 0
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
...componentInput,
|
||||
type: 'evalv2',
|
||||
expr: expr,
|
||||
connections: [{ componentId: connection.componentId, id: connection.path.split('.')[0] }]
|
||||
connections: [{ componentId: connection.componentId, id: connection.path.split('.')[0].split('[')[0] }]
|
||||
}
|
||||
evalV2editor?.setCode(expr)
|
||||
$app = $app
|
||||
|
||||
@@ -115,10 +115,10 @@
|
||||
|
||||
{#if component}
|
||||
{#key component?.id}
|
||||
<div class="px-2 flex items-center gap-2 flex-row justify-between">
|
||||
{#if !cssEditorOpen}
|
||||
<div class="px-2 flex gap-1 flex-col w-full pb-4">
|
||||
{#if !$cssEditorOpen}
|
||||
<Button
|
||||
color="blue"
|
||||
color="light"
|
||||
size="xs2"
|
||||
variant="border"
|
||||
on:click={() => {
|
||||
@@ -126,7 +126,7 @@
|
||||
}}
|
||||
>
|
||||
<div class="flex flex-row gap-1 text-xs items-center">
|
||||
Open CSS editor{$enterpriseLicense === undefined ? ' (EE only)' : ''}
|
||||
Open theme editor{$enterpriseLicense === undefined ? ' (EE only)' : ''}
|
||||
<Tooltip light>
|
||||
You can also use the App CSS Editor to customise the CSS of all components.
|
||||
</Tooltip>
|
||||
@@ -136,19 +136,18 @@
|
||||
<div />
|
||||
{/if}
|
||||
|
||||
<div class="flex flex-row gap-2 items-center justify-between">
|
||||
{#if $enterpriseLicense !== undefined}
|
||||
<Button
|
||||
color="dark"
|
||||
size="xs2"
|
||||
on:click={() => {
|
||||
migrationModal?.open()
|
||||
}}
|
||||
>
|
||||
Convert to global CSS
|
||||
</Button>
|
||||
{/if}
|
||||
</div>
|
||||
{#if $enterpriseLicense !== undefined}
|
||||
<Button
|
||||
color="light"
|
||||
size="xs2"
|
||||
variant="border"
|
||||
on:click={() => {
|
||||
migrationModal?.open()
|
||||
}}
|
||||
>
|
||||
Convert to global CSS
|
||||
</Button>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<Tabs bind:selected={tab}>
|
||||
@@ -178,28 +177,30 @@
|
||||
<svelte:fragment slot="content">
|
||||
<TabContent value="local">
|
||||
{#if component && component.customCss !== undefined}
|
||||
{#each Object.keys(ccomponents[component.type].customCss ?? {}) as name}
|
||||
<div class="w-full">
|
||||
<CssProperty
|
||||
quickStyleProperties={quickStyleProperties?.[component.type]?.[name]}
|
||||
forceStyle={ccomponents[component.type].customCss[name].style !== undefined}
|
||||
forceClass={ccomponents[component.type].customCss[name].class !== undefined}
|
||||
tooltip={ccomponents[component.type].customCss[name].tooltip}
|
||||
{name}
|
||||
wmClass={getSelector(name)}
|
||||
componentType={component.type}
|
||||
bind:value={component.customCss[name]}
|
||||
on:change={() => app.set($app)}
|
||||
shouldDisplayRight={hasStyleValue(component.customCss[name])}
|
||||
on:right={() => {
|
||||
copyLocalToGlobal(name, component?.customCss?.[name])
|
||||
tab = 'global'
|
||||
}}
|
||||
overridding={hasStyleValue($app.css?.[component.type]?.[name]) &&
|
||||
hasStyleValue(component.customCss[name])}
|
||||
/>
|
||||
</div>
|
||||
{/each}
|
||||
<div class="flex-col flex gap-4 divide-y">
|
||||
{#each Object.keys(ccomponents[component.type].customCss ?? {}) as name}
|
||||
<div class="w-full">
|
||||
<CssProperty
|
||||
quickStyleProperties={quickStyleProperties?.[component.type]?.[name]}
|
||||
forceStyle={ccomponents[component.type].customCss[name].style !== undefined}
|
||||
forceClass={ccomponents[component.type].customCss[name].class !== undefined}
|
||||
tooltip={ccomponents[component.type].customCss[name].tooltip}
|
||||
{name}
|
||||
wmClass={getSelector(name)}
|
||||
componentType={component.type}
|
||||
bind:value={component.customCss[name]}
|
||||
on:change={() => app.set($app)}
|
||||
shouldDisplayRight={hasStyleValue(component.customCss[name])}
|
||||
on:right={() => {
|
||||
copyLocalToGlobal(name, component?.customCss?.[name])
|
||||
tab = 'global'
|
||||
}}
|
||||
overridding={hasStyleValue($app.css?.[component.type]?.[name]) &&
|
||||
hasStyleValue(component.customCss[name])}
|
||||
/>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
</TabContent>
|
||||
<TabContent value="global">
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
export let componentInput: StaticInput<any>
|
||||
export let subFieldType: InputType | undefined
|
||||
export let id: string | undefined
|
||||
export let dragging: boolean = false
|
||||
|
||||
let fakeComponentInput: StaticInput<any> = {
|
||||
...componentInput,
|
||||
@@ -21,4 +22,5 @@
|
||||
fieldType={subFieldType}
|
||||
bind:componentInput={fakeComponentInput}
|
||||
on:remove
|
||||
{dragging}
|
||||
/>
|
||||
|
||||
-1
@@ -97,7 +97,6 @@
|
||||
lang="javascript"
|
||||
bind:code={componentInput.expr}
|
||||
shouldBindKey={false}
|
||||
domLib
|
||||
{extraLib}
|
||||
autoHeight
|
||||
{fixedOverflowWidgets}
|
||||
|
||||
+11
-13
@@ -2,32 +2,26 @@
|
||||
import type { StaticInput } from '../../../inputType'
|
||||
import { Loader2 } from 'lucide-svelte'
|
||||
import { ClearableInput, Popup } from '../../../../common'
|
||||
|
||||
import { AllIcons } from './icons'
|
||||
export let componentInput: StaticInput<string>
|
||||
|
||||
let loading = false
|
||||
let items: { label: string; icon: any }[]
|
||||
let filteredItems: { label: string; icon: any }[]
|
||||
let items: string[]
|
||||
let filteredItems: string[]
|
||||
let search = ''
|
||||
|
||||
$: if (search) {
|
||||
filteredItems = items.filter((item) => {
|
||||
return item.label.toLowerCase().includes(search.toLowerCase())
|
||||
return item.toLowerCase().includes(search.toLowerCase())
|
||||
})
|
||||
} else {
|
||||
filteredItems = items
|
||||
}
|
||||
|
||||
async function getData() {
|
||||
if (items) {
|
||||
}
|
||||
loading = true
|
||||
// @ts-ignore
|
||||
const data = await import('lucide-svelte/icons')
|
||||
|
||||
filteredItems = items = Object.entries(data)
|
||||
.filter(([key]) => !(key.endsWith('Icon') || key.startsWith('Lucide')))
|
||||
.map(([key, icon]) => ({ label: key, icon }))
|
||||
items = AllIcons
|
||||
|
||||
loading = false
|
||||
}
|
||||
@@ -80,7 +74,7 @@
|
||||
class="col-span-4 mb-2"
|
||||
/>
|
||||
<div class="grid gap-1 grid-cols-4 max-h-[300px] overflow-auto">
|
||||
{#each filteredItems as { label, icon }}
|
||||
{#each filteredItems as label}
|
||||
<button
|
||||
type="button"
|
||||
title={label}
|
||||
@@ -92,7 +86,11 @@
|
||||
hover:bg-gray-100 focus:bg-gray-100 rounded duration-200 dark:hover:bg-frost-900 dark:focus:bg-frost-900
|
||||
{label === componentInput.value ? 'text-blue-600 bg-blue-50 pointer-events-none' : ''}"
|
||||
>
|
||||
<svelte:component this={icon} size={22} />
|
||||
<img
|
||||
class="dark:invert"
|
||||
loading="lazy"
|
||||
src="https://cdn.jsdelivr.net/npm/lucide-static@0.367.0/icons/{label}.svg"
|
||||
/>
|
||||
<span class="inline-block w-full text-[10px] ellipsize pt-0.5">
|
||||
{label}
|
||||
</span>
|
||||
|
||||
+12
-5
@@ -30,6 +30,7 @@
|
||||
export let placeholder: string | undefined = undefined
|
||||
export let format: string | undefined = undefined
|
||||
export let id: string | undefined
|
||||
export let dragging: boolean = false
|
||||
|
||||
const { onchange } = getContext<AppViewerContext>('AppViewerContext')
|
||||
|
||||
@@ -153,11 +154,17 @@
|
||||
/>
|
||||
{:else}
|
||||
<div class="flex w-full flex-col">
|
||||
<JsonEditor
|
||||
small
|
||||
bind:value={componentInput.value}
|
||||
code={JSON.stringify(componentInput.value, null, 2)}
|
||||
/>
|
||||
{#if dragging}
|
||||
<div class="text-xs text-secondary whitespace-pre border p-1"
|
||||
>{JSON.stringify(componentInput.value, null, 2)}</div
|
||||
>
|
||||
{:else}
|
||||
<JsonEditor
|
||||
small
|
||||
bind:value={componentInput.value}
|
||||
code={JSON.stringify(componentInput.value, null, 2)}
|
||||
/>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{:else if fieldType === 'array'}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+1
-6
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { fly } from 'svelte/transition'
|
||||
import { Badge } from '../../../../common'
|
||||
import { secondaryMenuLeft, secondaryMenuRight } from './'
|
||||
import { getContext } from 'svelte'
|
||||
import type { AppViewerContext } from '../../../types'
|
||||
@@ -34,11 +33,7 @@
|
||||
class="flex justify-between {right ? '' : 'flex-row-reverse'} items-center gap-1 px-3 py-2"
|
||||
>
|
||||
<CloseButton on:close={() => secondaryMenu?.close()} />
|
||||
{#if $selectedComponent}
|
||||
<Badge color="blue">{$selectedComponent}</Badge>
|
||||
{:else}
|
||||
<div />
|
||||
{/if}
|
||||
<div class="text-xs font-bold"> Style Panel</div>
|
||||
</div>
|
||||
<div class="relative h-full overflow-y-auto">
|
||||
{#if typeof $secondaryMenu.component === 'string'}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Environment } from 'monaco-editor/esm/vs/editor/editor.api.js'
|
||||
import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker'
|
||||
import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker'
|
||||
|
||||
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker'
|
||||
import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker'
|
||||
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'
|
||||
|
||||
@@ -47,13 +47,7 @@ export function buildWorkerDefinition(
|
||||
case 'template':
|
||||
case 'typescript':
|
||||
case 'javascript':
|
||||
return new Worker(
|
||||
new URL(
|
||||
'../../../node_modules/monaco-editor/esm/vs/language/typescript/ts.worker',
|
||||
import.meta.url
|
||||
),
|
||||
{ type: 'module' }
|
||||
)
|
||||
return new tsWorker()
|
||||
case 'html':
|
||||
case 'handlebars':
|
||||
case 'razor':
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@
|
||||
>
|
||||
<div class="flex flex-col w-full space-y-4">
|
||||
<span>Are you sure you want to discard the changes you have made? </span>
|
||||
{#if savedValue && modifiedValue}
|
||||
{#if savedValue && modifiedValue && diffDrawer}
|
||||
<Button
|
||||
wrapperClasses="self-start"
|
||||
color="light"
|
||||
|
||||
@@ -510,10 +510,21 @@
|
||||
bind:seconds={$flowStore.value.concurrency_time_window_s}
|
||||
/>
|
||||
</Label>
|
||||
<Label label="Custom concurrency key">
|
||||
<div class="text-tertiary text-xs"
|
||||
>Custom concurrency keys can only be set as the setting of a workspace script</div
|
||||
>
|
||||
<Label label="Custom concurrency key (optional)">
|
||||
<svelte:fragment slot="header">
|
||||
<Tooltip>
|
||||
Concurrency keys are global, you can have them be workspace specific using the
|
||||
variable `$workspace`. You can also use an argument's value using
|
||||
`$args[name_of_arg]`</Tooltip
|
||||
>
|
||||
</svelte:fragment>
|
||||
<input
|
||||
type="text"
|
||||
autofocus
|
||||
disabled={!$enterpriseLicense}
|
||||
bind:value={$flowStore.value.concurrency_key}
|
||||
placeholder={`$workspace/script/${$pathStore}-$args[foo]`}
|
||||
/>
|
||||
</Label>
|
||||
</div>
|
||||
</Section>
|
||||
|
||||
@@ -90,6 +90,9 @@ export function cleanInputs(flow: OpenFlow | any): OpenFlow & {
|
||||
})
|
||||
}
|
||||
})
|
||||
if (newFlow.value.concurrency_key == '') {
|
||||
newFlow.value.concurrency_key = undefined
|
||||
}
|
||||
|
||||
return newFlow
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
|
||||
function isSortable(key: string) {
|
||||
return (
|
||||
(objects?.[0] != undefined && typeof objects[0][key] === 'string') ||
|
||||
(objects?.[0]?.[key] != undefined && typeof objects[0][key] === 'string') ||
|
||||
typeof objects[0][key] === 'number' ||
|
||||
typeof objects[0][key] === 'boolean'
|
||||
)
|
||||
|
||||
+1
-12395
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
import { ScriptService, type MainArgSignature, FlowService, Script } from '$lib/gen'
|
||||
import { get, writable } from 'svelte/store'
|
||||
import type { Schema, SchemaProperty, SupportedLanguage } from './common.js'
|
||||
import type { Schema, SupportedLanguage } from './common.js'
|
||||
import { emptySchema, sortObject } from './utils.js'
|
||||
import { tick } from 'svelte'
|
||||
import init, {
|
||||
@@ -21,6 +21,7 @@ import init, {
|
||||
} from 'windmill-parser-wasm'
|
||||
import wasmUrl from 'windmill-parser-wasm/windmill_parser_wasm_bg.wasm?url'
|
||||
import { workspaceStore } from './stores.js'
|
||||
import { argSigToJsonSchemaType } from './inferArgSig.js'
|
||||
|
||||
init(wasmUrl)
|
||||
|
||||
@@ -151,96 +152,6 @@ export async function inferArgs(
|
||||
await tick()
|
||||
}
|
||||
|
||||
export function argSigToJsonSchemaType(
|
||||
t:
|
||||
| string
|
||||
| { resource: string | null }
|
||||
| { list: string | { str: any } | { object: { key: string; typ: any }[] } | null }
|
||||
| { str: string[] | null }
|
||||
| { object: { key: string; typ: any }[] },
|
||||
oldS: SchemaProperty
|
||||
): void {
|
||||
const newS: SchemaProperty = { type: '' }
|
||||
if (t === 'int') {
|
||||
newS.type = 'integer'
|
||||
} else if (t === 'float') {
|
||||
newS.type = 'number'
|
||||
} else if (t === 'bool') {
|
||||
newS.type = 'boolean'
|
||||
} else if (t === 'email') {
|
||||
newS.type = 'string'
|
||||
newS.format = 'email'
|
||||
} else if (t === 'sql') {
|
||||
newS.type = 'string'
|
||||
newS.format = 'sql'
|
||||
} else if (t === 'yaml') {
|
||||
newS.type = 'string'
|
||||
newS.format = 'yaml'
|
||||
} else if (t === 'bytes') {
|
||||
newS.type = 'string'
|
||||
newS.contentEncoding = 'base64'
|
||||
} else if (t === 'datetime') {
|
||||
newS.type = 'string'
|
||||
newS.format = 'date-time'
|
||||
} else if (typeof t !== 'string' && `object` in t) {
|
||||
newS.type = 'object'
|
||||
if (t.object) {
|
||||
const properties = {}
|
||||
for (const prop of t.object) {
|
||||
properties[prop.key] = {}
|
||||
argSigToJsonSchemaType(prop.typ, properties[prop.key])
|
||||
}
|
||||
newS.properties = properties
|
||||
}
|
||||
} else if (typeof t !== 'string' && `str` in t) {
|
||||
newS.type = 'string'
|
||||
if (t.str) {
|
||||
newS.enum = t.str
|
||||
}
|
||||
} else if (typeof t !== 'string' && `resource` in t) {
|
||||
newS.type = 'object'
|
||||
newS.format = `resource-${t.resource}`
|
||||
} else if (typeof t !== 'string' && `list` in t) {
|
||||
newS.type = 'array'
|
||||
if (t.list === 'int' || t.list === 'float') {
|
||||
newS.items = { type: 'number' }
|
||||
} else if (t.list === 'bytes') {
|
||||
newS.items = { type: 'string', contentEncoding: 'base64' }
|
||||
} else if (t.list == 'string') {
|
||||
newS.items = { type: 'string' }
|
||||
} else if (t.list && typeof t.list == 'object' && 'str' in t.list) {
|
||||
newS.items = { type: 'string', enum: t.list.str }
|
||||
} else {
|
||||
newS.items = { type: 'object' }
|
||||
}
|
||||
} else {
|
||||
newS.type = 'object'
|
||||
}
|
||||
|
||||
if (oldS.type != newS.type) {
|
||||
for (const prop of Object.getOwnPropertyNames(newS)) {
|
||||
if (prop != 'description') {
|
||||
delete oldS[prop]
|
||||
}
|
||||
}
|
||||
} else if (oldS.format == 'date-time' && newS.format != 'date-time') {
|
||||
delete oldS.format
|
||||
} else if (oldS.items?.type != newS.items?.type) {
|
||||
delete oldS.items
|
||||
}
|
||||
|
||||
Object.assign(oldS, newS)
|
||||
|
||||
// if (sameItems && savedItems != undefined && savedItems.enum != undefined) {
|
||||
// sendUserToast(JSON.stringify(savedItems))
|
||||
// oldS.items = savedItems
|
||||
// }
|
||||
|
||||
if (oldS.format?.startsWith('resource-') && newS.type != 'object') {
|
||||
oldS.format = undefined
|
||||
}
|
||||
}
|
||||
|
||||
export async function loadSchemaFromPath(path: string, hash?: string): Promise<Schema> {
|
||||
if (path.startsWith('hub/')) {
|
||||
const { content, language, schema } = await ScriptService.getHubScriptByPath({ path })
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
import type { SchemaProperty } from './common'
|
||||
|
||||
export function argSigToJsonSchemaType(
|
||||
t:
|
||||
| string
|
||||
| { resource: string | null }
|
||||
| { list: string | { str: any } | { object: { key: string; typ: any }[] } | null }
|
||||
| { str: string[] | null }
|
||||
| { object: { key: string; typ: any }[] },
|
||||
oldS: SchemaProperty
|
||||
): void {
|
||||
const newS: SchemaProperty = { type: '' }
|
||||
if (t === 'int') {
|
||||
newS.type = 'integer'
|
||||
} else if (t === 'float') {
|
||||
newS.type = 'number'
|
||||
} else if (t === 'bool') {
|
||||
newS.type = 'boolean'
|
||||
} else if (t === 'email') {
|
||||
newS.type = 'string'
|
||||
newS.format = 'email'
|
||||
} else if (t === 'sql') {
|
||||
newS.type = 'string'
|
||||
newS.format = 'sql'
|
||||
} else if (t === 'yaml') {
|
||||
newS.type = 'string'
|
||||
newS.format = 'yaml'
|
||||
} else if (t === 'bytes') {
|
||||
newS.type = 'string'
|
||||
newS.contentEncoding = 'base64'
|
||||
} else if (t === 'datetime') {
|
||||
newS.type = 'string'
|
||||
newS.format = 'date-time'
|
||||
} else if (typeof t !== 'string' && `object` in t) {
|
||||
newS.type = 'object'
|
||||
if (t.object) {
|
||||
const properties = {}
|
||||
for (const prop of t.object) {
|
||||
properties[prop.key] = {}
|
||||
argSigToJsonSchemaType(prop.typ, properties[prop.key])
|
||||
}
|
||||
newS.properties = properties
|
||||
}
|
||||
} else if (typeof t !== 'string' && `str` in t) {
|
||||
newS.type = 'string'
|
||||
if (t.str) {
|
||||
newS.enum = t.str
|
||||
}
|
||||
} else if (typeof t !== 'string' && `resource` in t) {
|
||||
newS.type = 'object'
|
||||
newS.format = `resource-${t.resource}`
|
||||
} else if (typeof t !== 'string' && `list` in t) {
|
||||
newS.type = 'array'
|
||||
if (t.list === 'int' || t.list === 'float') {
|
||||
newS.items = { type: 'number' }
|
||||
} else if (t.list === 'bytes') {
|
||||
newS.items = { type: 'string', contentEncoding: 'base64' }
|
||||
} else if (t.list == 'string') {
|
||||
newS.items = { type: 'string' }
|
||||
} else if (t.list && typeof t.list == 'object' && 'str' in t.list) {
|
||||
newS.items = { type: 'string', enum: t.list.str }
|
||||
} else {
|
||||
newS.items = { type: 'object' }
|
||||
}
|
||||
} else {
|
||||
newS.type = 'object'
|
||||
}
|
||||
|
||||
if (oldS.type != newS.type) {
|
||||
for (const prop of Object.getOwnPropertyNames(newS)) {
|
||||
if (prop != 'description') {
|
||||
delete oldS[prop]
|
||||
}
|
||||
}
|
||||
} else if (oldS.format == 'date-time' && newS.format != 'date-time') {
|
||||
delete oldS.format
|
||||
} else if (oldS.items?.type != newS.items?.type) {
|
||||
delete oldS.items
|
||||
}
|
||||
|
||||
Object.assign(oldS, newS)
|
||||
|
||||
// if (sameItems && savedItems != undefined && savedItems.enum != undefined) {
|
||||
// sendUserToast(JSON.stringify(savedItems))
|
||||
// oldS.items = savedItems
|
||||
// }
|
||||
|
||||
if (oldS.format?.startsWith('resource-') && newS.type != 'object') {
|
||||
oldS.format = undefined
|
||||
}
|
||||
}
|
||||
@@ -7,9 +7,9 @@ export function scriptLangToEditorLang(lang: Script.language) {
|
||||
if (lang == 'deno') {
|
||||
return 'typescript'
|
||||
} else if (lang == 'bun') {
|
||||
return 'javascript'
|
||||
return 'typescript'
|
||||
} else if (lang == 'nativets') {
|
||||
return 'javascript'
|
||||
return 'typescript'
|
||||
// } else if (lang == 'graphql') {
|
||||
// return 'typescript'
|
||||
} else if (lang == 'postgresql') {
|
||||
|
||||
@@ -710,6 +710,7 @@ export function roughSizeOfObject(object: object | string) {
|
||||
objectList.push(value)
|
||||
|
||||
for (var i in value) {
|
||||
bytes += 2 * i.length
|
||||
stack.push(value[i])
|
||||
}
|
||||
}
|
||||
@@ -743,7 +744,10 @@ export function cleanValueProperties(obj: Value) {
|
||||
|
||||
export function orderedJsonStringify(obj: any, space?: string | number) {
|
||||
const allKeys = new Set()
|
||||
JSON.stringify(obj, (key, value) => (allKeys.add(key), value))
|
||||
JSON.stringify(
|
||||
obj,
|
||||
(key, value) => (value != undefined && value != null && allKeys.add(key), value)
|
||||
)
|
||||
return JSON.stringify(obj, (Array.from(allKeys) as string[]).sort(), space)
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
// await import('http://localhost:3000/app.iife.js')
|
||||
/* @vite-ignore */
|
||||
await import(
|
||||
/* webpackIgnore: true */
|
||||
`/api/w/${$workspaceStore}/raw_apps/get_data/${$page.params.version}/${$page.params.path}`
|
||||
)
|
||||
try {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import { page } from '$app/stores'
|
||||
|
||||
import FlowBuilder from '$lib/components/FlowBuilder.svelte'
|
||||
import UnsavedConfirmationModal from '$lib/components/common/confirmationModal/UnsavedConfirmationModal.svelte'
|
||||
import type { FlowState } from '$lib/components/flows/flowState'
|
||||
import { importFlowStore, initFlow } from '$lib/components/flows/flowStore'
|
||||
import { FlowService, type Flow } from '$lib/gen'
|
||||
@@ -26,6 +27,7 @@
|
||||
let loading = false
|
||||
|
||||
let initialPath: string | undefined = undefined
|
||||
let pathStoreInit: string | undefined = undefined
|
||||
|
||||
export const flowStore = writable<Flow>({
|
||||
summary: '',
|
||||
@@ -82,7 +84,7 @@
|
||||
])
|
||||
|
||||
flow = state.flow
|
||||
initialPath = state.path
|
||||
pathStoreInit = state.path
|
||||
state?.selectedId && (selectedId = state?.selectedId)
|
||||
} else {
|
||||
if (templatePath) {
|
||||
@@ -119,6 +121,12 @@
|
||||
|
||||
let getSelectedId: (() => string) | undefined = undefined
|
||||
let flowBuilder: FlowBuilder | undefined = undefined
|
||||
|
||||
let savedFlow:
|
||||
| (Flow & {
|
||||
draft?: Flow | undefined
|
||||
})
|
||||
| undefined = undefined
|
||||
</script>
|
||||
|
||||
<!-- <div id="monaco-widgets-root" class="monaco-editor" style="z-index: 1200;" /> -->
|
||||
@@ -133,12 +141,20 @@
|
||||
on:details={(e) => {
|
||||
goto(`/flows/get/${e.detail}?workspace=${$workspaceStore}`)
|
||||
}}
|
||||
gotoEdit={(path, selectedId) => goto(`/flows/edit/${path}?selected=${selectedId}`)}
|
||||
{initialPath}
|
||||
{pathStoreInit}
|
||||
bind:getSelectedId
|
||||
bind:this={flowBuilder}
|
||||
newFlow
|
||||
bind:savedFlow
|
||||
{flowStore}
|
||||
{flowStateStore}
|
||||
{selectedId}
|
||||
{loading}
|
||||
/>
|
||||
>
|
||||
<UnsavedConfirmationModal
|
||||
savedValue={{ ...savedFlow, path: undefined }}
|
||||
modifiedValue={$flowStore}
|
||||
/></FlowBuilder
|
||||
>
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
import { sendUserToast } from '$lib/toast'
|
||||
import DiffDrawer from '$lib/components/DiffDrawer.svelte'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import UnsavedConfirmationModal from '$lib/components/common/confirmationModal/UnsavedConfirmationModal.svelte'
|
||||
|
||||
let nodraft = $page.url.searchParams.get('nodraft')
|
||||
const initialState = nodraft ? undefined : localStorage.getItem(`flow-${$page.params.path}`)
|
||||
@@ -202,10 +203,13 @@
|
||||
{flowStore}
|
||||
{flowStateStore}
|
||||
initialPath={$page.params.path}
|
||||
gotoEdit={(path, selectedId) => goto(`/flows/edit/${path}?selected=${selectedId}`)}
|
||||
newFlow={false}
|
||||
{selectedId}
|
||||
{initialArgs}
|
||||
{loading}
|
||||
bind:savedFlow
|
||||
{diffDrawer}
|
||||
/>
|
||||
>
|
||||
<UnsavedConfirmationModal {diffDrawer} savedValue={savedFlow} modifiedValue={$flowStore} />
|
||||
</FlowBuilder>
|
||||
|
||||
@@ -813,6 +813,11 @@
|
||||
|
||||
<br /><br />
|
||||
|
||||
It can take additionally the following args: channel_id, user_name, user_id, command,
|
||||
trigger_id, api_app_id
|
||||
|
||||
<br /><br />
|
||||
|
||||
<span class="font-bold text-xs">
|
||||
The script or flow is permissioned as group "slack" that will be automatically created
|
||||
after connection to Slack.
|
||||
|
||||
@@ -1,13 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<html>
|
||||
<head>
|
||||
<title>API Reference</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<title>Windmill API Explorer</title>
|
||||
<script src="https://unpkg.com/@stoplight/elements/web-components.min.js"></script>
|
||||
<link rel="stylesheet" href="https://unpkg.com/@stoplight/elements/styles.min.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
</head>
|
||||
<body>
|
||||
<elements-api apiDescriptionUrl="/api/openapi.yaml" router="hash" layout="sidebar" />
|
||||
<!-- Add your own OpenAPI/Swagger spec file URL here: -->
|
||||
<!-- Note: this includes our proxy, you can remove the following line if you do not need it -->
|
||||
<!-- data-proxy-url="https://api.scalar.com/request-proxy" -->
|
||||
<script id="api-reference" data-url="/api/openapi.json"></script>
|
||||
<!-- You can also set a full configuration object like this -->
|
||||
<!-- easier for nested objects -->
|
||||
<script>
|
||||
var configuration = {
|
||||
theme: 'purple'
|
||||
}
|
||||
|
||||
var apiReference = document.getElementById('api-reference')
|
||||
apiReference.dataset.configuration = JSON.stringify(configuration)
|
||||
</script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>API Reference</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<title>Windmill API Explorer</title>
|
||||
<script src="https://unpkg.com/@stoplight/elements/web-components.min.js"></script>
|
||||
<link rel="stylesheet" href="https://unpkg.com/@stoplight/elements/styles.min.css" />
|
||||
</head>
|
||||
<body>
|
||||
<!-- Add your own OpenAPI/Swagger spec file URL here: -->
|
||||
<!-- Note: this includes our proxy, you can remove the following line if you do not need it -->
|
||||
<!-- data-proxy-url="https://api.scalar.com/request-proxy" -->
|
||||
<script id="api-reference" data-url="/api/openapi.json"></script>
|
||||
<!-- You can also set a full configuration object like this -->
|
||||
<!-- easier for nested objects -->
|
||||
<script>
|
||||
var configuration = {
|
||||
theme: 'purple'
|
||||
}
|
||||
|
||||
var apiReference = document.getElementById('api-reference')
|
||||
apiReference.dataset.configuration = JSON.stringify(configuration)
|
||||
</script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
|
||||
<elements-api apiDescriptionUrl="/api/openapi.yaml" router="hash" layout="sidebar" />
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+2
-2
@@ -4,8 +4,8 @@ verify_ssl = true
|
||||
name = "pypi"
|
||||
|
||||
[packages]
|
||||
wmill = ">=1.304.3"
|
||||
wmill_pg = ">=1.304.3"
|
||||
wmill = ">=1.305.3"
|
||||
wmill_pg = ">=1.305.3"
|
||||
sendgrid = "*"
|
||||
mysql-connector-python = "*"
|
||||
pymongo = "*"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
openapi: "3.0.3"
|
||||
|
||||
info:
|
||||
version: 1.304.3
|
||||
version: 1.305.3
|
||||
title: OpenFlow Spec
|
||||
contact:
|
||||
name: Ruben Fiszel
|
||||
@@ -48,6 +48,8 @@ components:
|
||||
type: boolean
|
||||
concurrent_limit:
|
||||
type: number
|
||||
concurrency_key:
|
||||
type: string
|
||||
concurrency_time_window_s:
|
||||
type: number
|
||||
skip_expr:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "wmill"
|
||||
version = "1.304.3"
|
||||
version = "1.305.3"
|
||||
description = "A client library for accessing Windmill server wrapping the Windmill client API"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://windmill.dev"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "wmill-pg"
|
||||
version = "1.304.3"
|
||||
version = "1.305.3"
|
||||
description = "An extension client for the wmill client library focused on pg"
|
||||
license = "Apache-2.0"
|
||||
homepage = "https://windmill.dev"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "windmill-client",
|
||||
"description": "Windmill SDK client for browsers and Node.js",
|
||||
"version": "1.304.3",
|
||||
"version": "1.305.3",
|
||||
"author": "Ruben Fiszel",
|
||||
"license": "Apache 2.0",
|
||||
"devDependencies": {
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
1.304.3
|
||||
1.305.3
|
||||
|
||||
Reference in New Issue
Block a user