From 38701bf06a136f5c544841b31b04bab700b4fd56 Mon Sep 17 00:00:00 2001 From: Niek Rabelink Date: Fri, 11 Sep 2026 22:14:50 +0200 Subject: [PATCH] Fix consistentie benamingen. --- admin.php | 158 +++++++++-- api/ai.php | 376 ++++++++++++++++++++++--- api/session.php | 6 + assets/js/notifications.js | 10 +- assets/js/session-guard.js | 32 +++ brainstorm_canvas.php | 544 ++++++++++++++++++++++++++++++++++++- includes/ai.php | 394 ++++++++++++++++++++++----- includes/auth.php | 51 +++- includes/settings.php | 81 ++++-- planner.php | 4 +- profile.php | 246 ++++++++++++++++- users.php | 6 +- 12 files changed, 1746 insertions(+), 162 deletions(-) diff --git a/admin.php b/admin.php index 11d7883..0af8c3b 100644 --- a/admin.php +++ b/admin.php @@ -799,8 +799,8 @@ require_once __DIR__ . '/includes/header.php'; - - + + @@ -1029,51 +1029,93 @@ require_once __DIR__ . '/includes/header.php';
-

AI & Brainstorm Co-Pilot

-

Intelligente assistentie voor post-it categorisatie, ideegeneratie en slimme planning

+

AI & Brainstorm Co-Pilot (Google Gemini Pro)

+

Intelligente assistentie voor post-it ontleding, categorisatie, ideegeneratie en slimme planning

- - - +
+ + + Zero-Data Leakage + + + + +
-
+ +
+
+ +
+
+ Strikte Zero-Data Leakage Privacy Garantie +

+ Er wordt onder géén enkele voorwaarde data uit Jira tickets, Outlook e-mails of Microsoft Teams naar de AI verzonden. De ingebouwde privacy firewall onderschept en filtert automatisch ticketnummers, Atlassian-links, mailheaders en communicatietraces vóór verzending. +

+
+
+ + -
-
+ +
+
+
+
+ +
+
+
+

AI Co-Pilot & Google Gemini Pro

+ + + Eigen Sleutel + + + + Organisatiesleutel Actief + + + + Geen Sleutel + + +
+

Koppel uw eigen Google Gemini Pro account of gebruik de centrale organisatieconfiguratie

+
+
+ +
+ + + Zero-Data Leakage Actief + +
+
+ + +
+
+ +
+
+ 100% Zero-Data Leakage Garantie +

+ Uw gevoelige gegevens uit Jira tickets, Outlook e-mails en Microsoft Teams worden strikt afgeschermd en NOOIT naar Google Gemini of OpenAI verstuurd. +

+
+
+ +
+ + + +
+ +
+ +
+
+ + + +
+ +
+ +
+ + +
+ + Gratis sleutel aanmaken? Google AI Studio → + +
+
+ + + + +
+
+ + + + + +
+ + +
+
+ + + + +
+
@@ -1173,8 +1355,20 @@ function filterAvatarCategory(category) { } } -// Sync banner status met browser permissie & activeer actuele thema kaart document.addEventListener('DOMContentLoaded', () => { + // Model en provider sync + const profileModelSelect = document.getElementById('profile_ai_model'); + const profileProviderInput = document.getElementById('profile_ai_provider'); + if (profileModelSelect && profileProviderInput) { + profileModelSelect.addEventListener('change', function() { + if (this.value.indexOf('gemini') !== -1) { + profileProviderInput.value = 'gemini'; + } else { + profileProviderInput.value = 'openai'; + } + }); + } + // Initialiseer geselecteerde thema-kaart const activeTheme = localStorage.getItem('fociz_theme') || '' || 'dark'; updateProfileThemeUI(activeTheme); @@ -1199,6 +1393,56 @@ document.addEventListener('DOMContentLoaded', () => { if (deniedEl) deniedEl.classList.add('hidden'); } }); + +async function testPersonalAiConnection() { + const btn = document.getElementById('profileAiTestBtn'); + const btnText = document.getElementById('profileAiTestBtnText'); + const resultDiv = document.getElementById('profileAiTestResult'); + const apiKey = document.getElementById('profile_ai_api_key').value.trim(); + const model = document.getElementById('profile_ai_model').value; + const provider = document.getElementById('profile_ai_provider').value; + + resultDiv.classList.add('hidden'); + resultDiv.className = 'hidden p-3 rounded-xl text-xs'; + btn.disabled = true; + btnText.innerText = 'Testen...'; + + try { + const payload = { + provider: provider, + model: model, + }; + // Stuur alleen de ingevulde sleutel mee als het geen placeholder bolletjes zijn + if (apiKey && apiKey !== '••••••••••••••••') { + payload.api_key = apiKey; + } + + const res = await fetch('/api/ai.php?action=test_connection', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(payload), + }); + const data = await res.json(); + + resultDiv.classList.remove('hidden'); + if (data.success) { + resultDiv.className = 'p-3 rounded-xl text-xs bg-emerald-50 dark:bg-emerald-950/30 border border-emerald-200 dark:border-emerald-800 text-emerald-800 dark:text-emerald-200 flex items-center space-x-2'; + resultDiv.innerHTML = `Verbinding Geslaagd! ${data.message}`; + } else { + resultDiv.className = 'p-3 rounded-xl text-xs bg-rose-50 dark:bg-rose-950/30 border border-rose-200 dark:border-rose-800 text-rose-800 dark:text-rose-200 flex items-center space-x-2'; + resultDiv.innerHTML = `Verbinding Mislukt: ${data.error || 'Onbekende fout'}`; + } + if (window.lucide) lucide.createIcons(); + } catch (err) { + resultDiv.classList.remove('hidden'); + resultDiv.className = 'p-3 rounded-xl text-xs bg-rose-50 dark:bg-rose-950/30 border border-rose-200 dark:border-rose-800 text-rose-800 dark:text-rose-200 flex items-center space-x-2'; + resultDiv.innerHTML = `Netwerkfout: ${err.message}`; + if (window.lucide) lucide.createIcons(); + } finally { + btn.disabled = false; + btnText.innerText = 'Test Verbinding'; + } +} diff --git a/users.php b/users.php index ce868b7..bb3ddf0 100644 --- a/users.php +++ b/users.php @@ -297,7 +297,11 @@ require_once __DIR__ . '/includes/header.php'; ?> - + + + + + Geaccepteerd