diff --git a/client/src/stores/chat.js b/client/src/stores/chat.js index 36f4fb6..ce3c8c2 100644 --- a/client/src/stores/chat.js +++ b/client/src/stores/chat.js @@ -21,6 +21,7 @@ export const useChatStore = defineStore('chat', () => { const historyResults = ref([]); const unreadChatsCount = ref(0); const errorMessage = ref(null); + const commandTable = ref(null); const remainingSecondsToTimeout = ref(1800); const awaitingLoginUsername = ref(false); const awaitingLoginPassword = ref(false); @@ -191,6 +192,10 @@ export const useChatStore = defineStore('chat', () => { handleWebSocketMessage({ type: 'commandResult', ...data }); }); + socketInstance.on('commandTable', (data) => { + handleWebSocketMessage({ type: 'commandTable', ...data }); + }); + socketInstance.on('unreadChats', (data) => { handleWebSocketMessage({ type: 'unreadChats', ...data }); }); @@ -315,6 +320,15 @@ export const useChatStore = defineStore('chat', () => { }, 5000); break; } + case 'commandTable': { + const title = data.title || 'Ausgabe'; + const columns = Array.isArray(data.columns) ? data.columns : []; + const rows = Array.isArray(data.rows) ? data.rows : []; + commandTable.value = { title, columns, rows }; + // Tabelle ist persistent; temporäre Fehlermeldung löschen + errorMessage.value = null; + break; + } case 'unreadChats': unreadChatsCount.value = data.count || 0; break; @@ -543,6 +557,10 @@ export const useChatStore = defineStore('chat', () => { socket.value.emit('requestOpenConversations'); } + function clearCommandTable() { + commandTable.value = null; + } + function setView(view) { currentView.value = view; @@ -574,6 +592,7 @@ export const useChatStore = defineStore('chat', () => { searchResults.value = []; inboxResults.value = []; historyResults.value = []; + commandTable.value = null; searchData.value = { nameIncludes: '', minAge: null, @@ -689,6 +708,7 @@ export const useChatStore = defineStore('chat', () => { unreadChatsCount, remainingSecondsToTimeout, errorMessage, + commandTable, searchData, awaitingLoginUsername, awaitingLoginPassword, @@ -703,6 +723,7 @@ export const useChatStore = defineStore('chat', () => { userSearch, requestHistory, requestOpenConversations, + clearCommandTable, setView, logout, restoreSession diff --git a/client/src/views/ChatView.vue b/client/src/views/ChatView.vue index 8cd2443..d760180 100644 --- a/client/src/views/ChatView.vue +++ b/client/src/views/ChatView.vue @@ -22,6 +22,30 @@
+| + {{ column }} + | +
|---|
| + {{ cell }} + | +