From 61acad1147b4e26b0646b53f626d2a0fcbeb89f9 Mon Sep 17 00:00:00 2001 From: ndsboy Date: Wed, 5 Mar 2025 19:56:23 +0000 Subject: [PATCH] feat: add debug --- directus/data.db | Bin 335872 -> 335872 bytes src/windmill/api.ts | 6 ++++-- src/windmill/app.ts | 21 +++++++++++++++++++-- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/directus/data.db b/directus/data.db index 1bf189817cec862ac2a7e3e8841a75ed5b30251a..a996d42a01f513a3c38468627170f90310b548d4 100644 GIT binary patch delta 793 zcmZoTAkuI^WP&uK^+XwGM(f6etqF|F3 z-y@#qJkPmL0*%|rz5V2ECOJm`#>mD{?nd5FR{2Ir26F}jqqIt&h*D?WM9b31l+uFm z;*bhc^AgJ(zjWVpBd6lZq_P69a#KTRgRJmMv&yWT)QE~ek6?qa%xp)`RDZAOiT*5V zEV*p^G^T&N&FDWp|1Ohg00RS~91q-%M&6**wD4T>aDzlAZ+|}n@0=j_z*LLWvWy@n zAGauvQuClPGoKQtFtc<=_w3T(+#oK4Q(uTB>Gw|BAuOrS2sO(N zG{`r0EGY4fh}ZSj%`|iLt4IrraCA*A^(;yA%=e89t}rR{3pFgO3NS4+Ez>nKjVQ=1 zNpyD14R$STl4=Y=b|i`B31S!sb>)Lj3xq2jC=K6j513dJxcRji_;>Pa1L00!Tu$Jd szQB)p0>vS~aD{<^!JUcR*a?J155r|QmPTGCO1;W(wJm^oSpdrg05`M=SpWb4 delta 672 zcmZoTAkuI^WP&uK+C&*=MzzL-tqF|FDu1{21S*EUEnvaK3RB}>OSiVJMfl;MJP*s>qV`O6>H{1XQ|Kh4BUthoA z#7ckf;tF5iT=U8($H*XqWL=X~7gvLT0Hdh1WEWSbsu08A(p29(0fTaHzh_8sVM&;m Vg|1^{RcJ{d!`Zd~=4Ama7XU)|*V+I8 diff --git a/src/windmill/api.ts b/src/windmill/api.ts index 91f5647..e98925b 100644 --- a/src/windmill/api.ts +++ b/src/windmill/api.ts @@ -4,6 +4,7 @@ type Options = { token: string instance: string flow: string + debug: boolean } type Data = { @@ -26,13 +27,14 @@ type Data = { export default defineOperationApi({ id: 'windmill', - handler: async ({ token, instance, flow }, { data }) => { + handler: async ({ token, instance, flow, debug }, { data }) => { const last = data.$last as Data const body = JSON.stringify({ event: last.event ?? "manual", instance: instance, collection: last.collection ?? last.body?.collection, - keys: last.keys ?? last.body?.keys ?? [last.key] + keys: last.keys ?? last.body?.keys ?? [last.key], + debug: debug, }) return await fetch(`https://windmill.swablab.de/api/r/${flow}`, { diff --git a/src/windmill/app.ts b/src/windmill/app.ts index a81e50f..e2b0047 100644 --- a/src/windmill/app.ts +++ b/src/windmill/app.ts @@ -5,7 +5,7 @@ export default defineOperationApp({ name: "swablab windmill", icon: "wind_power", description: "trigger a windmill action", - overview: ({ instance, flow }) => [ + overview: ({ instance, flow, debug }) => [ { label: "Instance", text: instance, @@ -14,6 +14,10 @@ export default defineOperationApp({ label: "Flow", text: flow, }, + { + label: "Debug", + text: debug, + }, ], options: [ { @@ -24,7 +28,7 @@ export default defineOperationApp({ width: "full", interface: "input", required: true, - note: "See Vaultwarden", + note: "see vaultwarden", options: { masked: true } @@ -63,5 +67,18 @@ export default defineOperationApp({ note: "https://windmill.swablab.de/api/r/..." }, }, + { + field: "debug", + name: "Debug", + type: "boolean", + schema: { + default_value: false + }, + meta: { + width: "full", + interface: "checkbox", + note: "not always suppported" + }, + }, ], });