mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-27 16:02:43 +00:00
Merge remote-tracking branch 'upstream/main' into appeditor-multiselect-input-type
This commit is contained in:
@@ -1 +1 @@
|
||||
01f384348341c87c5a0b32c4be7c699975ee7d6d
|
||||
aedaf655693cb9bab59fcf79a48c60aad6822668
|
||||
@@ -724,6 +724,8 @@ paths:
|
||||
type: string
|
||||
tls_implicit:
|
||||
type: boolean
|
||||
disable_tls:
|
||||
type: boolean
|
||||
required:
|
||||
- host
|
||||
- username
|
||||
@@ -731,6 +733,7 @@ paths:
|
||||
- port
|
||||
- from
|
||||
- tls_implicit
|
||||
- disable_tls
|
||||
required:
|
||||
- to
|
||||
- smtp
|
||||
|
||||
@@ -10,6 +10,7 @@ pub struct Smtp {
|
||||
pub port: u16,
|
||||
pub from: String,
|
||||
pub tls_implicit: Option<bool>,
|
||||
pub disable_tls: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, PartialEq)]
|
||||
@@ -20,6 +21,7 @@ pub struct SmtpConfigOpt {
|
||||
pub smtp_port: Option<u16>,
|
||||
pub smtp_from: Option<String>,
|
||||
pub smtp_tls_implicit: Option<bool>,
|
||||
pub smtp_disable_tls: Option<bool>,
|
||||
}
|
||||
|
||||
pub async fn load_smtp_config(db: &DB) -> error::Result<Option<Smtp>> {
|
||||
@@ -39,6 +41,7 @@ pub async fn load_smtp_config(db: &DB) -> error::Result<Option<Smtp>> {
|
||||
username,
|
||||
password,
|
||||
tls_implicit: config.smtp_tls_implicit,
|
||||
disable_tls: config.smtp_disable_tls,
|
||||
port: config.smtp_port.unwrap_or(587),
|
||||
from: config
|
||||
.smtp_from
|
||||
@@ -60,6 +63,9 @@ pub async fn load_smtp_config(db: &DB) -> error::Result<Option<Smtp>> {
|
||||
tls_implicit: std::env::var("SMTP_TLS_IMPLICIT")
|
||||
.ok()
|
||||
.and_then(|p| p.parse().ok()),
|
||||
disable_tls: std::env::var("SMTP_DISABLE_TLS")
|
||||
.ok()
|
||||
.and_then(|p| p.parse().ok()),
|
||||
port: std::env::var("SMTP_PORT")
|
||||
.ok()
|
||||
.and_then(|p| p.parse().ok())
|
||||
@@ -87,6 +93,7 @@ impl Default for SmtpConfigOpt {
|
||||
smtp_port: None,
|
||||
smtp_tls_implicit: None,
|
||||
smtp_username: None,
|
||||
smtp_disable_tls: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1304,6 +1304,8 @@ try {{
|
||||
job.args.as_ref()
|
||||
};
|
||||
|
||||
append_logs(&job.id, &job.workspace_id, format!("{init_logs}\n"), db).await;
|
||||
|
||||
let result = crate::js_eval::eval_fetch_timeout(
|
||||
env_code,
|
||||
inner_content.clone(),
|
||||
@@ -1324,14 +1326,7 @@ try {{
|
||||
"Executed native code in {}ms",
|
||||
started_at.elapsed().as_millis()
|
||||
);
|
||||
append_logs(
|
||||
&job.id,
|
||||
&job.workspace_id,
|
||||
format!("{}\n{}", init_logs, result.1),
|
||||
db,
|
||||
)
|
||||
.await;
|
||||
return Ok(result.0);
|
||||
return Ok(result);
|
||||
}
|
||||
}
|
||||
append_logs(&job.id, &job.workspace_id, init_logs, db).await;
|
||||
|
||||
@@ -754,9 +754,9 @@ pub async fn eval_fetch_timeout(
|
||||
_w_id: &str,
|
||||
_load_client: bool,
|
||||
_occupation_metrics: &mut OccupancyMetrics,
|
||||
) -> anyhow::Result<(Box<RawValue>, String)> {
|
||||
) -> anyhow::Result<Box<RawValue>> {
|
||||
use serde_json::value::to_raw_value;
|
||||
Ok((to_raw_value("require deno_core").unwrap(), "".to_string()))
|
||||
Ok(to_raw_value("require deno_core").unwrap())
|
||||
}
|
||||
|
||||
#[cfg(feature = "deno_core")]
|
||||
@@ -774,7 +774,9 @@ pub async fn eval_fetch_timeout(
|
||||
w_id: &str,
|
||||
load_client: bool,
|
||||
occupation_metrics: &mut OccupancyMetrics,
|
||||
) -> anyhow::Result<(Box<RawValue>, String)> {
|
||||
) -> anyhow::Result<Box<RawValue>> {
|
||||
use windmill_queue::append_logs;
|
||||
|
||||
let (sender, mut receiver) = oneshot::channel::<IsolateHandle>();
|
||||
|
||||
let parsed_args = windmill_parser_ts::parse_deno_signature(&ts_expr, true, None)?.args;
|
||||
@@ -805,6 +807,8 @@ pub async fn eval_fetch_timeout(
|
||||
));
|
||||
}
|
||||
|
||||
let db_ = db.clone();
|
||||
let w_id_ = w_id.to_string();
|
||||
let result_f = tokio::task::spawn_blocking(move || {
|
||||
let ops = vec![op_get_static_args(), op_log()];
|
||||
let ext = Extension { name: "windmill", ops: ops.into(), ..Default::default() };
|
||||
@@ -892,28 +896,31 @@ pub async fn eval_fetch_timeout(
|
||||
.build()?;
|
||||
|
||||
let future = async {
|
||||
tokio::select! {
|
||||
let r = tokio::select! {
|
||||
r = eval_fetch(&mut js_runtime, &js_expr, Some(env_code), load_client) => Ok(r),
|
||||
_ = memory_limit_rx.recv() => Err(Error::ExecutionErr("Memory limit reached, killing isolate".to_string()))
|
||||
}
|
||||
};
|
||||
|
||||
append_logs(
|
||||
&job_id,
|
||||
w_id_.as_str(),
|
||||
format!(
|
||||
"{extra_logs}{}",
|
||||
js_runtime.op_state().borrow().borrow::<LogString>().s
|
||||
),
|
||||
db_,
|
||||
)
|
||||
.await;
|
||||
|
||||
r
|
||||
};
|
||||
let r = runtime.block_on(future)?;
|
||||
// tracing::info!("total: {:?}", instant.elapsed());
|
||||
|
||||
(r as anyhow::Result<Box<RawValue>>).map(|x| {
|
||||
(
|
||||
x,
|
||||
js_runtime
|
||||
.op_state()
|
||||
.borrow()
|
||||
.borrow::<LogString>()
|
||||
.s
|
||||
.clone(),
|
||||
)
|
||||
})
|
||||
r
|
||||
});
|
||||
|
||||
let (res, logs) = run_future_with_polling_update_job_poller(
|
||||
let res = run_future_with_polling_update_job_poller(
|
||||
job_id,
|
||||
job_timeout,
|
||||
db,
|
||||
@@ -932,7 +939,7 @@ pub async fn eval_fetch_timeout(
|
||||
e
|
||||
})?;
|
||||
*mem_peak = (res.get().len() / 1000) as i32;
|
||||
Ok((res, format!("{extra_logs}{logs}")))
|
||||
Ok(res)
|
||||
}
|
||||
|
||||
#[cfg(feature = "deno_core")]
|
||||
|
||||
@@ -1703,7 +1703,7 @@ async fn do_nativets(
|
||||
canceled_by: &mut Option<CanceledBy>,
|
||||
worker_name: &str,
|
||||
occupancy_metrics: &mut OccupancyMetrics,
|
||||
) -> windmill_common::error::Result<(Box<RawValue>, String)> {
|
||||
) -> windmill_common::error::Result<Box<RawValue>> {
|
||||
let args = build_args_map(job, client, db).await?.map(Json);
|
||||
let job_args = if args.is_some() {
|
||||
args.as_ref()
|
||||
@@ -1711,7 +1711,7 @@ async fn do_nativets(
|
||||
job.args.as_ref()
|
||||
};
|
||||
|
||||
let result = eval_fetch_timeout(
|
||||
Ok(eval_fetch_timeout(
|
||||
env_code,
|
||||
code.clone(),
|
||||
transpile_ts(code)?,
|
||||
@@ -1726,8 +1726,7 @@ async fn do_nativets(
|
||||
true,
|
||||
occupancy_metrics,
|
||||
)
|
||||
.await?;
|
||||
Ok((result.0, result.1))
|
||||
.await?)
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Default)]
|
||||
@@ -2356,7 +2355,8 @@ async fn handle_code_execution_job(
|
||||
.map(|(k, v)| format!("const {} = '{}';\nprocess.env['{}'] = '{}';\n", k, v, k, v))
|
||||
.collect::<Vec<String>>()
|
||||
.join("\n"));
|
||||
let (result, ts_logs) = do_nativets(
|
||||
|
||||
let result = do_nativets(
|
||||
job,
|
||||
&client,
|
||||
env_code,
|
||||
@@ -2368,7 +2368,6 @@ async fn handle_code_execution_job(
|
||||
occupancy_metrics,
|
||||
)
|
||||
.await?;
|
||||
append_logs(&job.id, &job.workspace_id, ts_logs, db).await;
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -1014,12 +1014,26 @@
|
||||
</div>
|
||||
<div>
|
||||
<Toggle
|
||||
disabled={values[setting.key].smtp_disable_tls}
|
||||
id="smtp_tls_implicit"
|
||||
bind:checked={values[setting.key].smtp_tls_implicit}
|
||||
options={{ right: 'Implicit TLS' }}
|
||||
label="Implicit TLS"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<Toggle
|
||||
id="smtp_disable_tls"
|
||||
bind:checked={values[setting.key].smtp_disable_tls}
|
||||
on:change={() => {
|
||||
if (values[setting.key].smtp_disable_tls) {
|
||||
values[setting.key].smtp_tls_implicit = false
|
||||
}
|
||||
}}
|
||||
options={{ right: 'Disable TLS' }}
|
||||
label="Disable TLS"
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{:else if setting.fieldType == 'object_store_config'}
|
||||
@@ -1082,7 +1096,8 @@
|
||||
password: smtp['smtp_password'],
|
||||
port: smtp['smtp_port'],
|
||||
from: smtp['smtp_from'],
|
||||
tls_implicit: smtp['smtp_tls_implicit']
|
||||
tls_implicit: smtp['smtp_tls_implicit'],
|
||||
disable_tls: smtp['smtp_disable_tls']
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -101,7 +101,6 @@
|
||||
{displayContext}
|
||||
{error}
|
||||
{pickableProperties}
|
||||
{notSelectable}
|
||||
allowCopy={!notSelectable && !$propPickerConfig}
|
||||
on:select={({ detail }) => {
|
||||
dispatch('select', detail)
|
||||
|
||||
@@ -83,13 +83,15 @@
|
||||
{#if level != 0 && keys.length > 1}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
||||
|
||||
<Button
|
||||
color="light"
|
||||
size="xs2"
|
||||
variant="border"
|
||||
on:click={collapse}
|
||||
wrapperClasses="inline-flex w-fit h-4"
|
||||
btnClasses="font-semibold text-primary rounded-[0.275rem]">-</Button
|
||||
wrapperClasses="inline-flex w-fit"
|
||||
btnClasses="font-mono h-4 text-2xs px-1 font-thin text-primary rounded-[0.275rem]"
|
||||
>-</Button
|
||||
>
|
||||
{/if}
|
||||
{#if level == 0 && topBrackets}<span class="h-0">{openBracket}</span>{/if}
|
||||
@@ -194,8 +196,8 @@
|
||||
size="xs2"
|
||||
variant="border"
|
||||
on:click={collapse}
|
||||
wrapperClasses="inline-flex w-fit h-4"
|
||||
btnClasses="font-normal rounded-[0.275rem] h-4 p-1"
|
||||
wrapperClasses="inline-flex w-fit"
|
||||
btnClasses="font-normal h-4 text-2xs px-1 text-primary rounded-[0.275rem]"
|
||||
>
|
||||
{openBracket}{collapsedSymbol}{closeBracket}
|
||||
</Button>
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
export let pickableProperties: PickableProperties
|
||||
export let displayContext = true
|
||||
export let notSelectable: boolean
|
||||
export let error: boolean = false
|
||||
export let allowCopy = false
|
||||
|
||||
@@ -186,12 +185,12 @@
|
||||
<Button
|
||||
color="light"
|
||||
size="xs2"
|
||||
variant="contained"
|
||||
variant="border"
|
||||
on:click={() => {
|
||||
allResultsCollapsed = true
|
||||
}}
|
||||
wrapperClasses="inline-flex w-fit h-4"
|
||||
btnClasses="font-normal text-primary rounded-[0.275rem]">-</Button
|
||||
wrapperClasses="inline-flex whitespace-nowrap w-fit"
|
||||
btnClasses="font-mono h-4 text-2xs font-thin px-1 rounded-[0.275rem]">-</Button
|
||||
>
|
||||
{/if}
|
||||
|
||||
@@ -219,8 +218,8 @@
|
||||
on:click={() => {
|
||||
displayVariable = false
|
||||
}}
|
||||
wrapperClasses="inline-flex w-fit h-4"
|
||||
btnClasses="font-normal text-primary rounded-[0.275rem]">-</Button
|
||||
wrapperClasses="inline-flex whitespace-nowrap w-fit"
|
||||
btnClasses="font-mono h-4 text-2xs font-thin px-1 rounded-[0.275rem]">-</Button
|
||||
>
|
||||
|
||||
<ObjectViewer
|
||||
@@ -240,8 +239,8 @@
|
||||
await loadVariables()
|
||||
displayVariable = true
|
||||
}}
|
||||
wrapperClasses="inline-flex w-fit h-4"
|
||||
btnClasses="font-normal rounded-[0.275rem] p-1"
|
||||
wrapperClasses="inline-flex w-fit"
|
||||
btnClasses="font-normal text-2xs rounded-[0.275rem] h-4 px-1"
|
||||
>
|
||||
{'{...}'}
|
||||
</Button>
|
||||
@@ -259,8 +258,8 @@
|
||||
on:click={() => {
|
||||
displayResources = false
|
||||
}}
|
||||
wrapperClasses="inline-flex w-fit h-4"
|
||||
btnClasses="font-normal text-primary rounded-[0.275rem]">-</Button
|
||||
wrapperClasses="inline-flex whitespace-nowrap w-fit"
|
||||
btnClasses="font-mono h-4 text-2xs font-thin px-1 rounded-[0.275rem]">-</Button
|
||||
>
|
||||
<ObjectViewer
|
||||
{allowCopy}
|
||||
@@ -279,8 +278,8 @@
|
||||
await loadResources()
|
||||
displayResources = true
|
||||
}}
|
||||
wrapperClasses="inline-flex w-fit h-4"
|
||||
btnClasses="font-normal rounded-[0.275rem] p-1"
|
||||
wrapperClasses="inline-flex whitespace-nowrap w-fit"
|
||||
btnClasses="font-normal text-2xs rounded-[0.275rem] h-4 px-1"
|
||||
>
|
||||
{'{...}'}
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user