From 735075d1bddff21732077cbc6159da819e58769d Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Sat, 22 Nov 2025 13:21:13 +0100 Subject: [PATCH] Add WebSocket Log feature to Services Status View - Introduced a WebSocket Log section in the Services Status View, allowing users to view real-time logs. - Updated localization files for both German and English to include WebSocket Log messages. - Enhanced the UI with a button to open the WebSocket Log dialog, improving user interaction and monitoring capabilities. --- .../dialogues/admin/WebSocketLogDialog.vue | 263 ++++++++++++++++++ frontend/src/i18n/locales/de/admin.json | 18 ++ frontend/src/i18n/locales/en/admin.json | 18 ++ .../src/views/admin/ServicesStatusView.vue | 42 ++- 4 files changed, 338 insertions(+), 3 deletions(-) create mode 100644 frontend/src/dialogues/admin/WebSocketLogDialog.vue diff --git a/frontend/src/dialogues/admin/WebSocketLogDialog.vue b/frontend/src/dialogues/admin/WebSocketLogDialog.vue new file mode 100644 index 0000000..3b36320 --- /dev/null +++ b/frontend/src/dialogues/admin/WebSocketLogDialog.vue @@ -0,0 +1,263 @@ + + + + + + diff --git a/frontend/src/i18n/locales/de/admin.json b/frontend/src/i18n/locales/de/admin.json index 40aaff6..f50cbbc 100644 --- a/frontend/src/i18n/locales/de/admin.json +++ b/frontend/src/i18n/locales/de/admin.json @@ -267,6 +267,24 @@ "notConnected": "Daemon nicht verbunden", "sendError": "Fehler beim Senden der Anfrage", "error": "Fehler beim Abrufen der Verbindungen" + }, + "websocketLog": { + "title": "WebSocket-Log", + "showLog": "WebSocket-Log anzeigen", + "refresh": "Aktualisieren", + "loading": "Lädt...", + "close": "Schließen", + "entryCount": "{count} Einträge", + "noEntries": "Keine Log-Einträge vorhanden", + "notConnected": "Daemon nicht verbunden", + "sendError": "Fehler beim Senden der Anfrage", + "parseError": "Fehler beim Verarbeiten der Antwort", + "timestamp": "Zeitstempel", + "direction": "Richtung", + "peer": "Peer", + "connUser": "Verbindungs-User", + "targetUser": "Ziel-User", + "event": "Event" } } } diff --git a/frontend/src/i18n/locales/en/admin.json b/frontend/src/i18n/locales/en/admin.json index adcc859..ce3a9f0 100644 --- a/frontend/src/i18n/locales/en/admin.json +++ b/frontend/src/i18n/locales/en/admin.json @@ -267,6 +267,24 @@ "notConnected": "Daemon not connected", "sendError": "Error sending request", "error": "Error fetching connections" + }, + "websocketLog": { + "title": "WebSocket Log", + "showLog": "Show WebSocket Log", + "refresh": "Refresh", + "loading": "Loading...", + "close": "Close", + "entryCount": "{count} entries", + "noEntries": "No log entries available", + "notConnected": "Daemon not connected", + "sendError": "Error sending request", + "parseError": "Error parsing response", + "timestamp": "Timestamp", + "direction": "Direction", + "peer": "Peer", + "connUser": "Connection User", + "targetUser": "Target User", + "event": "Event" } } } diff --git a/frontend/src/views/admin/ServicesStatusView.vue b/frontend/src/views/admin/ServicesStatusView.vue index e01ee58..26748d0 100644 --- a/frontend/src/views/admin/ServicesStatusView.vue +++ b/frontend/src/views/admin/ServicesStatusView.vue @@ -51,7 +51,12 @@
-

{{ $t('admin.servicesStatus.daemon.connections.title') }}

+
+

{{ $t('admin.servicesStatus.daemon.connections.title') }}

+ +

{{ $t('admin.servicesStatus.daemon.connections.none') }}

@@ -91,6 +96,9 @@
+ + + @@ -98,11 +106,13 @@ import { mapState, mapGetters } from 'vuex'; import SimpleTabs from '@/components/SimpleTabs.vue'; import apiClient from '@/utils/axios.js'; +import WebSocketLogDialog from '@/dialogues/admin/WebSocketLogDialog.vue'; export default { name: 'ServicesStatusView', components: { - SimpleTabs + SimpleTabs, + WebSocketLogDialog }, data() { return { @@ -271,6 +281,11 @@ export default { const minutes = Math.floor((seconds % 3600) / 60); return `${hours}h ${minutes}m`; } + }, + openWebSocketLogDialog() { + if (this.$refs.webSocketLogDialog) { + this.$refs.webSocketLogDialog.open(); + } } }, created() { @@ -364,10 +379,31 @@ export default { margin-top: 30px; } -.connections-section h3 { +.section-header { + display: flex; + justify-content: space-between; + align-items: center; margin-bottom: 15px; } +.section-header h3 { + margin: 0; +} + +.log-button { + padding: 8px 16px; + background: #1976d2; + color: white; + border: none; + border-radius: 4px; + cursor: pointer; + font-size: 14px; +} + +.log-button:hover { + background: #1565c0; +} + .no-connections { padding: 20px; text-align: center;