Enhance MessagesDialog component and localization for overproduction notifications
- Updated MessagesDialog.vue to extract additional parameters (value, branch_id, region_id) for better handling of overproduction scenarios. - Modified localization files (de/falukant.json and en/falukant.json) to reflect changes in the overproduction notification format, including branch information. - Improved data formatting for clarity in notifications related to production levels.
This commit is contained in:
@@ -192,8 +192,17 @@ const store = createStore({
|
||||
try {
|
||||
if (socketIoUrl) {
|
||||
const parsed = new URL(socketIoUrl, window.location.origin);
|
||||
// Falls /api oder ähnliche Pfade enthalten sind → auf Origin reduzieren (inkl. Port!)
|
||||
socketIoUrl = parsed.origin;
|
||||
// In Produktion: Verwende immer window.location.origin (Port 443), nicht den Port aus der Umgebungsvariable
|
||||
// Socket.io wird über Nginx-Proxy auf /socket.io/ weitergeleitet
|
||||
if (window.location.hostname === 'www.your-part.de' || window.location.hostname.includes('your-part.de')) {
|
||||
socketIoUrl = window.location.origin;
|
||||
} else {
|
||||
// Lokale Entwicklung: Origin aus parsed verwenden (inkl. Port)
|
||||
socketIoUrl = parsed.origin;
|
||||
}
|
||||
} else {
|
||||
// Fallback: aktuelle Origin verwenden
|
||||
socketIoUrl = window.location.origin;
|
||||
}
|
||||
} catch (e) {
|
||||
// Wenn Parsing fehlschlägt: letzte Rettung ist der aktuelle Origin
|
||||
@@ -284,12 +293,26 @@ const store = createStore({
|
||||
|
||||
// Wenn Umgebungsvariable nicht gesetzt ist oder leer, verwende Fallback-Logik
|
||||
if (!daemonUrl || (typeof daemonUrl === 'string' && daemonUrl.trim() === '')) {
|
||||
// Fallback: direkte Verbindung zum Daemon-Port 4551 (ohne Apache-Proxy)
|
||||
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
|
||||
daemonUrl = `${protocol}//${hostname}:4551/`;
|
||||
console.log('[Daemon] Verwende Fallback basierend auf Hostname, Protokoll und Port 4551');
|
||||
// In Produktion: Verwende /ws/ über Nginx-Proxy (Port 443)
|
||||
if (isProduction) {
|
||||
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
|
||||
daemonUrl = `${protocol}//${hostname}/ws/`;
|
||||
console.log('[Daemon] Verwende Nginx-Proxy /ws/ über Port 443');
|
||||
} else {
|
||||
// Lokale Entwicklung: direkte Verbindung zum Daemon-Port 4551
|
||||
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
|
||||
daemonUrl = `${protocol}//${hostname}:4551/`;
|
||||
console.log('[Daemon] Verwende Fallback basierend auf Hostname, Protokoll und Port 4551');
|
||||
}
|
||||
} else {
|
||||
console.log('[Daemon] Verwende Umgebungsvariable');
|
||||
// Wenn Umgebungsvariable gesetzt ist, aber in Produktion: Konvertiere Port 4551 zu /ws/
|
||||
if (isProduction && daemonUrl.includes(':4551')) {
|
||||
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
|
||||
daemonUrl = `${protocol}//${hostname}/ws/`;
|
||||
console.log('[Daemon] Konvertiere Port 4551 zu /ws/ für Nginx-Proxy');
|
||||
} else {
|
||||
console.log('[Daemon] Verwende Umgebungsvariable');
|
||||
}
|
||||
}
|
||||
|
||||
console.log('[Daemon] Finale Daemon-URL:', daemonUrl);
|
||||
|
||||
Reference in New Issue
Block a user