- eveai_chat_client updated to retrieve static files from the correct (bunny.net) location when a STATIC_URL is defined.
- Defined locations for crewai crew memory. This failed in k8s. - Redis connection for pub/sub in ExecutionProgressTracker adapted to conform to TLS-enabled connections
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<!-- EveAI Logo voor AI berichten - links boven, half buiten de bubbel -->
|
||||
<img
|
||||
v-if="message.sender === 'ai'"
|
||||
src="/static/assets/img/eveai_logo.svg"
|
||||
:src="staticUrl('assets/img/eveai_logo.svg')"
|
||||
alt="EveAI"
|
||||
class="ai-message-logo"
|
||||
/>
|
||||
@@ -105,7 +105,7 @@
|
||||
<!-- EveAI Logo voor AI berichten - links boven, half buiten de bubbel -->
|
||||
<img
|
||||
v-if="message.sender === 'ai'"
|
||||
src="/static/assets/img/eveai_logo.svg"
|
||||
:src="staticUrl('assets/img/eveai_logo.svg')"
|
||||
alt="EveAI"
|
||||
class="ai-message-logo"
|
||||
/>
|
||||
@@ -124,7 +124,7 @@
|
||||
<!-- EveAI Logo voor AI berichten - links boven, half buiten de bubbel -->
|
||||
<img
|
||||
v-if="message.sender === 'ai'"
|
||||
src="/static/assets/img/eveai_logo.svg"
|
||||
:src="staticUrl('assets/img/eveai_logo.svg')"
|
||||
alt="EveAI"
|
||||
class="ai-message-logo"
|
||||
/>
|
||||
@@ -166,11 +166,23 @@ export default {
|
||||
originalTexts
|
||||
);
|
||||
|
||||
// Helper to build environment-aware static asset URLs
|
||||
const staticUrl = (p) => {
|
||||
try {
|
||||
if (typeof window !== 'undefined' && typeof window.staticUrl === 'function') {
|
||||
return window.staticUrl(p);
|
||||
}
|
||||
} catch (e) {}
|
||||
const base = '/static/';
|
||||
return base + String(p || '').replace(/^\/+/, '');
|
||||
};
|
||||
|
||||
return {
|
||||
messageTexts: translations,
|
||||
translationLoading: isLoading,
|
||||
translationError: error,
|
||||
currentLanguage
|
||||
currentLanguage,
|
||||
staticUrl
|
||||
};
|
||||
},
|
||||
props: {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<div class="progress-title">
|
||||
<!-- Evie working animatie tijdens processing -->
|
||||
<img v-if="isProcessing"
|
||||
src="/static/assets/img/evie_working.webp"
|
||||
:src="staticUrl('assets/img/evie_working.webp')"
|
||||
alt="Bezig met verwerken..."
|
||||
class="progress-icon working-animation">
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
<!-- Alleen Evie animatie voor "No Information" tijdens processing -->
|
||||
<div v-else-if="shouldShowProgressIconOnly" class="progress-icon-only">
|
||||
<img src="/static/assets/img/evie_working.webp"
|
||||
<img :src="staticUrl('assets/img/evie_working.webp')"
|
||||
alt="Bezig met verwerken..."
|
||||
class="working-animation-only">
|
||||
</div>
|
||||
@@ -72,6 +72,16 @@ import { useComponentTranslations } from '../js/services/LanguageProvider.js';
|
||||
export default {
|
||||
name: 'ProgressTracker',
|
||||
setup() {
|
||||
// Helper to build environment-aware static asset URLs
|
||||
const staticUrl = (p) => {
|
||||
try {
|
||||
if (typeof window !== 'undefined' && typeof window.staticUrl === 'function') {
|
||||
return window.staticUrl(p);
|
||||
}
|
||||
} catch (e) {}
|
||||
const base = '/static/';
|
||||
return base + String(p || '').replace(/^\/+/, '');
|
||||
};
|
||||
// Define original English texts (base language for developers)
|
||||
const originalTexts = {
|
||||
error: 'Error while processing',
|
||||
@@ -92,7 +102,8 @@ export default {
|
||||
statusTexts: translations,
|
||||
translationLoading: isLoading,
|
||||
translationError: error,
|
||||
currentLanguage
|
||||
currentLanguage,
|
||||
staticUrl
|
||||
};
|
||||
},
|
||||
props: {
|
||||
|
||||
@@ -28,7 +28,9 @@
|
||||
tenantMake: {
|
||||
name: "{{ tenant_make.name|default('EveAI') }}",
|
||||
logo_url: "{{ tenant_make.logo_url|default('') }}"
|
||||
}
|
||||
},
|
||||
// Environment-aware static base provided by Flask's overridden url_for
|
||||
staticBase: '{{ static_url }}'
|
||||
};
|
||||
|
||||
// Debug info om te controleren of chatConfig correct is ingesteld
|
||||
|
||||
@@ -1,6 +1,30 @@
|
||||
<!-- Material Icons voor icoontjes in de interface -->
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0">
|
||||
|
||||
<!-- Define a robust global staticUrl helper BEFORE loading the chat client bundle -->
|
||||
<script>
|
||||
(function(){
|
||||
if (typeof window === 'undefined') return;
|
||||
// If already defined (e.g., by chat.html head), reuse it and expose globally
|
||||
if (typeof window.staticUrl === 'function') {
|
||||
try { globalThis.staticUrl = window.staticUrl; } catch (e) {}
|
||||
} else {
|
||||
// Prefer runtime chatConfig.staticBase; else fallback to server-provided base or default
|
||||
var serverStaticBase = '{{ static_url|default("") }}' || '';
|
||||
if (!serverStaticBase) { serverStaticBase = '{{ url_for("static", filename="") }}'; }
|
||||
var base = (window.chatConfig && window.chatConfig.staticBase) ? window.chatConfig.staticBase : (serverStaticBase || '/static/');
|
||||
var normalizedBase = String(base).replace(/\/+$/, '/');
|
||||
window.staticUrl = function(path) {
|
||||
if (!path) return normalizedBase;
|
||||
return normalizedBase + String(path).replace(/^\/+/, '');
|
||||
};
|
||||
try { globalThis.staticUrl = window.staticUrl; } catch (e) {}
|
||||
}
|
||||
// Optional lightweight debug
|
||||
// console.debug('[scripts.html] staticUrl defined:', typeof window.staticUrl);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<!-- Chat client JS - bundled met alle componenten en ES modules -->
|
||||
<script src="{{url_for('static', filename='dist/chat-client.js')}}"></script>
|
||||
<script>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import json
|
||||
import uuid
|
||||
from flask import Blueprint, render_template, request, session, current_app, jsonify, Response, stream_with_context
|
||||
from flask import Blueprint, render_template, request, session, current_app, jsonify, Response, stream_with_context, \
|
||||
url_for
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
|
||||
from common.extensions import db, content_manager
|
||||
@@ -110,6 +111,11 @@ def chat(magic_link_code):
|
||||
if isinstance(specialist_config, str):
|
||||
specialist_config = json.loads(specialist_config)
|
||||
|
||||
static_url = current_app.config.get('STATIC_URL')
|
||||
current_app.logger.debug(f"STATIC_URL: {static_url}")
|
||||
if not static_url:
|
||||
static_url = url_for('static', filename='')
|
||||
|
||||
return render_template('chat.html',
|
||||
tenant=tenant,
|
||||
tenant_make=tenant_make,
|
||||
@@ -117,7 +123,8 @@ def chat(magic_link_code):
|
||||
customisation=customisation,
|
||||
messages=[],
|
||||
settings=settings,
|
||||
config=current_app.config
|
||||
config=current_app.config,
|
||||
static_url=static_url
|
||||
)
|
||||
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user