Add password reset localization and chat configuration

- Implemented German and English localization for password reset functionality.
- Added WebSocket URL resolution logic in chat services to support various environments and configurations.
- Created centralized chat configuration for event keys and payload mappings.
- Developed RoomsView component for admin chat room management, including create, edit, and delete functionalities.
This commit is contained in:
Torsten Schulz (local)
2025-08-18 07:44:56 +02:00
parent 23f698d8fd
commit 19ee6ba0a1
50 changed files with 3117 additions and 359 deletions

View File

@@ -29,10 +29,14 @@ export default {
...mapState(['daemonSocket']),
},
mounted() {
this.daemonSocket.addEventListener('workerStatus', () => { console.log('----'); });
if (this.daemonSocket && this.daemonSocket.addEventListener) {
this.daemonSocket.addEventListener('workerStatus', this.handleDaemonMessage);
}
},
beforeUnmount() {
this.daemonSocket.removeEventListener('workerStatus', this.handleDaemonMessage);
if (this.daemonSocket && this.daemonSocket.removeEventListener) {
this.daemonSocket.removeEventListener('workerStatus', this.handleDaemonMessage);
}
},
methods: {
openImprintDialog() {
@@ -48,7 +52,9 @@ export default {
this.$store.dispatch('dialogs/toggleDialogMinimize', dialogName);
},
async showFalukantDaemonStatus() {
this.daemonSocket.send('{"event": "getWorkerStatus"}');
if (this.daemonSocket && this.daemonSocket.send) {
this.daemonSocket.send('{"event": "getWorkerStatus"}');
}
},
handleDaemonMessage(event) {
const status = JSON.parse(event.data);

View File

@@ -110,6 +110,7 @@ import { createApp } from 'vue';
import apiClient from '@/utils/axios.js';
import RandomChatDialog from '../dialogues/chat/RandomChatDialog.vue';
import MultiChatDialog from '../dialogues/chat/MultiChatDialog.vue';
// Wichtig: die zentrale Instanzen importieren
import store from '@/store';
@@ -119,7 +120,8 @@ import i18n from '@/i18n';
export default {
name: 'AppNavigation',
components: {
RandomChatDialog
RandomChatDialog,
MultiChatDialog
},
data() {
return {
@@ -160,6 +162,22 @@ export default {
methods: {
...mapActions(['loadMenu', 'logout']),
openMultiChat() {
// Räume können später dynamisch geladen werden, hier als Platzhalter ein Beispiel:
const exampleRooms = [
{ id: 1, title: 'Allgemein' },
{ id: 2, title: 'Rollenspiel' }
];
const ref = this.$root.$refs.multiChatDialog;
if (ref && typeof ref.open === 'function') {
ref.open(exampleRooms);
} else if (ref?.$refs?.dialog && typeof ref.$refs.dialog.open === 'function') {
ref.$refs.dialog.open();
} else {
console.error('MultiChatDialog nicht bereit oder ohne open()');
}
},
async fetchForums() {
try {
const res = await apiClient.get('/api/forum');
@@ -192,8 +210,6 @@ export default {
// Datei erstellen und ans body anhängen
const container = document.createElement('div');
document.body.appendChild(container);
// Programmatisch ein neues App-Instance randomChatauen, mit Store, Router & i18n
this.$root.$refs.randomChatDialog.open(contact);
},
/**
@@ -211,7 +227,19 @@ export default {
// 2) view → Dialog/Window
if (item.view) {
this.$root.$refs[item.class].open();
const dialogRef = this.$root.$refs[item.class];
if (!dialogRef) {
console.error(`Dialog-Ref '${item.class}' nicht gefunden! Bitte prüfe Ref und Menü-Konfiguration.`);
return;
}
// Robust öffnen: erst open(), sonst auf inneres DialogWidget zurückgreifen
if (typeof dialogRef.open === 'function') {
dialogRef.open();
} else if (dialogRef.$refs?.dialog && typeof dialogRef.$refs.dialog.open === 'function') {
dialogRef.$refs.dialog.open();
} else {
console.error(`Dialog '${item.class}' gefunden, aber keine open()-Methode verfügbar.`);
}
return;
}