+ {#snippet trigger()}
+
+ {/snippet}
+ {#snippet content()}
+
+
Mode Whether to invite or add users directly to the workspace.
-
+
{
- if (auto_invite_domain != undefined) {
- await removeAllInvitesFromDomain()
- await WorkspaceService.editAutoInvite({
- workspace: $workspaceStore ?? '',
- requestBody: {
- operator: operatorOnly ?? false,
- invite_all: !isCloudHosted(),
- auto_add: e.detail === 'add'
- }
- })
- loadSettings()
- listInvites()
- listUsers()
- autoAdd = e.detail === 'add'
- } else {
- autoAdd = e.detail === 'add'
+ autoAdd = e.detail === 'add'
+ if (autoInviteOrAddEnabled) {
+ await updateAutoInvite(true)
}
}}
>
@@ -375,264 +426,239 @@
{/snippet}
- {/if}
-
Role Role of the auto-added users
-
{
- if (auto_invite_domain != undefined) {
- await removeAllInvitesFromDomain()
- await WorkspaceService.editAutoInvite({
- workspace: $workspaceStore ?? '',
- requestBody: {
- operator: e.detail === 'operator',
- invite_all: !isCloudHosted(),
- auto_add: showInvites ? (autoAdd ?? false) : true
- }
- })
+ Role Role of the auto-added users
+ {
operatorOnly = e.detail === 'operator'
- loadSettings()
- listInvites()
- listUsers()
- } else {
- operatorOnly = e.detail === 'operator'
- }
- }}
- >
- {#snippet children({ item })}
-
-
- {/snippet}
-
-
- {
- await removeAllInvitesFromDomain()
- await WorkspaceService.editAutoInvite({
- workspace: $workspaceStore ?? '',
- requestBody: e.detail
- ? {
- operator: operatorOnly ?? false,
- invite_all: !isCloudHosted(),
- auto_add: showInvites ? (autoAdd ?? false) : true
- }
- : {
- operator: undefined,
- auto_add: undefined
- }
- })
- loadSettings()
- listInvites()
- listUsers()
+ if (auto_invite_domain != undefined) {
+ await updateAutoInvite(true)
+ }
}}
- disabled={isCloudHosted() && !allowedAutoDomain}
- options={{
- right: 'Enabled'
- }}
- />
-
- {#if isCloudHosted() && !allowedAutoDomain}
- {domain} domain not allowed for auto-add
- {/if}
-
- {/snippet}
-
+ >
+ {#snippet children({ item })}
+
+
+ {/snippet}
+
- {#if instanceGroups.length > 0}
-
- {#snippet trigger()}
-
- {/snippet}
- {#snippet content()}
-
-
-
Auto-add instance groups
-
-
- {#if availableGroupItems.length > 0}
-
-
-
- Instance group
-
-
-
-
- Role
- {
- selectedNewRole = e.detail
- }}
- >
- {#snippet children({ item })}
-
-
-
- {/snippet}
-
-
-
-
-
-
- {/if}
-
-
- {#if autoAddInstanceGroups.length > 0}
-
-
Configured groups:
-
-
-
-
- | Group |
- Role |
- |
-
-
-
- {#each autoAddInstanceGroups as groupName (groupName)}
- {@const group = instanceGroups.find((g) => g.name === groupName)}
-
- |
- {groupName}
- {#if group?.summary}
- {group.summary}
- {/if}
- |
-
-
- {
- autoAddInstanceGroupsRoles[groupName] = e.detail
- await updateGroupRole(groupName, e.detail)
- }}
- >
- {#snippet children({ item })}
-
-
-
- {/snippet}
-
-
- |
-
-
-
-
- |
-
- {/each}
-
-
-
-
- {:else}
-
- No instance groups configured for auto-add
-
- {/if}
+
+ {
+ await updateAutoInvite(e.detail)
+ }}
+ disabled={isCloudHosted() && !allowedAutoDomain}
+ options={{
+ right: isCloudHosted()
+ ? `Auto-${autoAdd ? 'add' : 'invite'} anyone from ${
+ autoInviteOrAddEnabled ? auto_invite_domain : domain
+ }`
+ : `Auto-${autoAdd ? 'add' : 'invite'} anyone joining the instance`
+ }}
+ />
+ {#if isCloudHosted() && !allowedAutoDomain}
+
{domain} domain not allowed for auto-add
+ {/if}
{/snippet}
- {/if}
-
{
- listUsers()
- listInvites()
- }}
- />
-
-