KI-AGENT: Matrix-Teilnehmer synchronisieren
This commit is contained in:
@@ -19,6 +19,7 @@ const roomCreateForm = ref({
|
||||
const loading = ref(false)
|
||||
const roomProvisioning = ref(false)
|
||||
const roomCreating = ref(false)
|
||||
const roomMembersSyncing = ref(false)
|
||||
const matrixMessagesLoading = ref(false)
|
||||
const matrixMembersLoading = ref(false)
|
||||
const matrixMessageSending = ref(false)
|
||||
@@ -288,6 +289,32 @@ const loadRoomMembers = async ({ silent = false } = {}) => {
|
||||
}
|
||||
}
|
||||
|
||||
const syncRoomMembers = async () => {
|
||||
if (!canUseMatrixChat.value || !activeRoom.value?.exists) return
|
||||
|
||||
roomMembersSyncing.value = true
|
||||
try {
|
||||
const res = await $api(`${activeRoomEndpoint.value}/members/sync`, {
|
||||
method: "POST"
|
||||
})
|
||||
|
||||
toast.add({
|
||||
title: "Teilnehmer synchronisiert",
|
||||
description: `${res.joined || 0} synchronisiert, ${res.failed || 0} fehlgeschlagen`,
|
||||
color: res.failed ? "warning" : "success"
|
||||
})
|
||||
|
||||
await loadRoomMembers()
|
||||
} catch (error) {
|
||||
toast.add({
|
||||
title: "Teilnehmer konnten nicht synchronisiert werden",
|
||||
color: "error"
|
||||
})
|
||||
} finally {
|
||||
roomMembersSyncing.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const loadRoomChat = async ({ silent = false, includeMembers = false } = {}) => {
|
||||
await loadRoomMessages({ silent })
|
||||
|
||||
@@ -752,15 +779,26 @@ onBeforeUnmount(stopMatrixAutoRefresh)
|
||||
<h4 class="text-xs font-medium uppercase text-muted">
|
||||
Teilnehmer
|
||||
</h4>
|
||||
<UButton
|
||||
icon="i-heroicons-arrow-path"
|
||||
color="neutral"
|
||||
variant="ghost"
|
||||
size="xs"
|
||||
:loading="matrixMembersLoading"
|
||||
:disabled="!canUseMatrixChat || !activeRoom?.exists"
|
||||
@click="loadRoomMembers"
|
||||
/>
|
||||
<div class="flex items-center gap-1">
|
||||
<UButton
|
||||
icon="i-heroicons-user-plus"
|
||||
color="neutral"
|
||||
variant="ghost"
|
||||
size="xs"
|
||||
:loading="roomMembersSyncing"
|
||||
:disabled="!canUseMatrixChat || !activeRoom?.exists"
|
||||
@click="syncRoomMembers"
|
||||
/>
|
||||
<UButton
|
||||
icon="i-heroicons-arrow-path"
|
||||
color="neutral"
|
||||
variant="ghost"
|
||||
size="xs"
|
||||
:loading="matrixMembersLoading"
|
||||
:disabled="!canUseMatrixChat || !activeRoom?.exists"
|
||||
@click="loadRoomMembers"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="space-y-2">
|
||||
|
||||
Reference in New Issue
Block a user