diff --git a/backend/open_webui/events.py b/backend/open_webui/events.py index 1f867198bf..ff86d093c3 100644 --- a/backend/open_webui/events.py +++ b/backend/open_webui/events.py @@ -353,7 +353,7 @@ async def event_target_matches( if targets is None: return True if not targets: - return False + return not user_ids if not user_ids: return False diff --git a/src/lib/components/admin/Settings/Events.svelte b/src/lib/components/admin/Settings/Events.svelte index e376f6286f..29dd2ab62a 100644 --- a/src/lib/components/admin/Settings/Events.svelte +++ b/src/lib/components/admin/Settings/Events.svelte @@ -1,5 +1,5 @@ - +

@@ -340,6 +444,122 @@

+
+
+
+ {$i18n.t('Send events for')} +
+ +
+ +
+ {#if targetMode === 'all'} + {$i18n.t( + 'Receives matching events across the instance, including system/config events and events associated with any user.' + )} + {:else if targetMode === 'system'} + {$i18n.t('Receives matching events that are not associated with a user.')} + {:else} + {$i18n.t( + 'Receives matching user-associated events only when the actor, user subject, or user data matches these users or current group members. System/config events are not sent.' + )} + {/if} +
+ + {#if targetMode === 'selected'} +
+ {#if targetUserIds.length > 0 || targetGroupIds.length > 0} +
+ {#each targetGroupIds as id} +
+ {selectedGroups[id]?.name ?? id} + {$i18n.t('group')} + +
+ {/each} + + {#each targetUserIds as id} +
+ {selectedUsers[id]?.name ?? id} + {$i18n.t('user')} + +
+ {/each} +
+ {/if} + +
+ + + {#if targetQuery.trim() && (targetGroupResults.length > 0 || targetUserResults.length > 0)} +
+ {#each targetGroupResults as group} + + {/each} + + {#each targetUserResults as user} + + {/each} +
+ {/if} +
+
+ {/if} +
+