mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-19 00:02:03 +00:00
edit operatorOnly on toggle change
This commit is contained in:
@@ -354,7 +354,10 @@ async fn edit_auto_invite(
|
||||
.await?;
|
||||
tx.commit().await?;
|
||||
|
||||
Ok(format!("Edit command script {}", &w_id))
|
||||
Ok(format!(
|
||||
"Edit auto-invite for workspace {} to {}",
|
||||
&w_id, domain
|
||||
))
|
||||
}
|
||||
|
||||
async fn list_workspaces_as_super_admin(
|
||||
|
||||
@@ -109,8 +109,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
$: operatorOnly != undefined && auto_invite_domain && setOperatorOnly()
|
||||
|
||||
async function removeAllInvitesFromDomain() {
|
||||
await Promise.all(
|
||||
invites
|
||||
@@ -127,15 +125,6 @@
|
||||
)
|
||||
)
|
||||
}
|
||||
async function setOperatorOnly() {
|
||||
await removeAllInvitesFromDomain()
|
||||
await WorkspaceService.editAutoInvite({
|
||||
workspace: $workspaceStore ?? '',
|
||||
requestBody: { operator: operatorOnly }
|
||||
})
|
||||
loadSettings()
|
||||
listInvites()
|
||||
}
|
||||
</script>
|
||||
|
||||
<SearchItems
|
||||
@@ -349,6 +338,15 @@
|
||||
options={{
|
||||
right: `Auto-invited users to join as operators`
|
||||
}}
|
||||
on:change={async (e) => {
|
||||
await removeAllInvitesFromDomain()
|
||||
await WorkspaceService.editAutoInvite({
|
||||
workspace: $workspaceStore ?? '',
|
||||
requestBody: { operator: e.detail }
|
||||
})
|
||||
loadSettings()
|
||||
listInvites()
|
||||
}}
|
||||
/>
|
||||
<div>
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user