Files
eveAI/eveai_chat_client/templates/scripts.html
Josako 42cb1de0fd - 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
2025-09-12 10:18:43 +02:00

58 lines
2.7 KiB
HTML

<!-- 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>
// Voeg taalinstellingen toe aan chatConfig indien deze nog niet bestaan
if (window.chatConfig) {
// Maak supportedLanguages beschikbaar voor de client
window.chatConfig.supportedLanguages = [
{% for lang_code in config.SUPPORTED_LANGUAGES %}
{
code: "{{ lang_code }}",
name: "{{ config.SUPPORTED_LANGUAGE_DETAILS[config.SUPPORTED_LANGUAGES_FULL[loop.index0]]['iso 639-1'] }}",
flag: "{{ config.SUPPORTED_LANGUAGE_DETAILS[config.SUPPORTED_LANGUAGES_FULL[loop.index0]]['flag'] }}"
}{% if not loop.last %},{% endif %}
{% endfor %}
];
// Voeg tenantMake toe aan chatConfig als die nog niet bestaat
if (!window.chatConfig.tenantMake) {
window.chatConfig.tenantMake = {
name: "{{ tenant_make.name|default('EveAI') }}",
logo_url: "{{ tenant_make.logo_url|default('') }}"
};
}
console.log('Taalinstellingen toegevoegd aan chatConfig');
} else {
console.warn('chatConfig is niet gedefinieerd in scripts.html');
}
</script>