Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e322435bd8 | ||
|
|
efbecada77 |
No files matched your search
@@ -5,65 +5,78 @@ Ce projet est un laboratoire d'intelligence artificielle personnel. Il agit comm
|
||||
L'interface visuelle est inspirée de l'ergonomie de Gemini, avec le logo stylisé A38 (cerveau en réseau neuronal néon) comme charte graphique centrale.
|
||||
|
||||
## 🏗️ Stack Technique & Architecture
|
||||
- **Backend :** FastAPI (Python) modulaire et asynchrone (httpx, asyncio).
|
||||
- **Frontend :** Vue.js + Tailwind CSS (Responsive / Mobile-first).
|
||||
- **Base de Données :** PostgreSQL (gestion des utilisateurs, historiques, suivi financier, rôles hiérarchiques).
|
||||
- **Traitement Documentaire :** LibreOffice Headless (génération/conversion Excel, Word, PDF).
|
||||
- **Déploiement :** Docker, géré via Dockge et Gitea, sécurisé sur grappe RAID.
|
||||
|
||||
* **Backend :** FastAPI (Python) modulaire asynchrone (httpx, asyncio)[cite: 2].
|
||||
* **Frontend :** Vue.js + Tailwind CSS (Responsive / Mobile-first)[cite: 2].
|
||||
* **Base de Données :** PostgreSQL (gestion des utilisateurs, rôles hiérarchiques Super-Admin/Admin/User, historiques, suivi financier)[cite: 2].
|
||||
* **Traitement Documentaire :** LibreOffice Headless (génération/conversion Excel, Word, PDF)[cite: 2].
|
||||
* **Déploiement :** Docker, géré via Dockge et Gitea, sécurisé sur grappe RAID[cite: 2].
|
||||
|
||||
## 📌 Règles de Versioning (SemVer)
|
||||
Le développement suit un versioning strict (format `vX.Y.Z`) synchronisé avec les tags Gitea et GitHub, affiché dynamiquement sur l'interface :
|
||||
- **Majeur (X) :** Changement profond d'architecture ou refonte globale.
|
||||
- **Mineur (Y) :** Validation et ajout d'une nouvelle fonctionnalité de la roadmap.
|
||||
- **Patch (Z) :** Corrections de bugs, correctifs de sécurité ou ajustements visuels mineurs.
|
||||
|
||||
Le développement suit un versioning strict (format `vX.Y.Z`) synchronisé avec les tags Gitea et GitHub, affiché dynamiquement sur l'interface[cite: 2]:
|
||||
|
||||
* **Majeur (X) :** Changement profond d'architecture ou refonte globale[cite: 2].
|
||||
* **Mineur (Y) :** Validation et ajout d'une nouvelle fonctionnalité de la roadmap[cite: 2].
|
||||
* **Patch (Z) :** Corrections de bugs, correctifs de sécurité ou ajustements visuels mineurs[cite: 2].
|
||||
|
||||
## 📦 Récupération des Paquets Docker (Tags)
|
||||
Les images Docker sont construites automatiquement par les pipelines CI/CD lors de la création d'un tag.
|
||||
- **Sur Gitea :** Depuis la page principale de votre dépôt, naviguez dans l'onglet **Packages** (ou Paquets). Vous y trouverez le registre de conteneurs avec toutes les versions taguées (`v0.16.0`, `latest`, etc.).
|
||||
- **Sur GitHub :** Depuis la page principale du dépôt, regardez dans la colonne de droite la section **Packages**. Cliquez dessus pour accéder au GitHub Container Registry (`ghcr.io/votre-utilisateur/aethas38-multi-ia`) et visualiser la liste des tags disponibles à tirer via Docker/Dockge.
|
||||
|
||||
Les images Docker sont construites automatiquement par les pipelines CI/CD lors de la création d'un tag[cite: 2].
|
||||
|
||||
* **Sur Gitea :** Depuis la page principale de votre dépôt, naviguez dans l'onglet **Packages** (ou Paquets). Vous y trouverez le registre de conteneurs avec toutes les versions taguées (`v0.16.1`, `latest`, etc.)[cite: 2].
|
||||
* **Sur GitHub :** Depuis la page principale du dépôt, regardez dans la colonne de droite la section **Packages**. Cliquez dessus pour accéder au GitHub Container Registry (`ghcr.io/votre-utilisateur/aethas38-multi-ia`) et visualiser la liste des tags disponibles à tirer via Docker/Dockge[cite: 2].
|
||||
|
||||
## 🚀 ROADMAP & CAHIER DES CHARGES
|
||||
|
||||
### Sécurité & Infrastructure
|
||||
- [x] Installation stricte via Dockge et Gitea (création automatique des dossiers inclus).
|
||||
- [x] Sécurisation de la totalité du projet (fichiers, BDD PostgreSQL) sur le stockage RAID.
|
||||
- [x] Mots de passe cryptés (bcrypt), protection anti-brute force.
|
||||
- [x] Authentification 2FA obligatoire (Keepassium, Authenticator, etc.).
|
||||
- [x] Déconnexion automatique (timer invisible / session JWT) après 60 minutes d'inactivité.
|
||||
- [x] Configuration de GitHub Actions / Gitea Actions pour la création automatique des paquets Docker (Tags SemVer + latest).
|
||||
- [x] Horodatage UTC en base de données pour immunité au changement d'heure français (Prévention crash 2FA).
|
||||
- [x] Rotation automatique des logs système : génération d'un fichier log par jour avec purge stricte des fichiers de plus de 7 jours.
|
||||
- [x] Procédure de modification sécurisée du mot de passe (Utilisateurs et Admins).
|
||||
|
||||
* [x] Installation stricte via Dockge et Gitea (création automatique des dossiers inclus)[cite: 2].
|
||||
* [x] Sécurisation de la totalité du projet (fichiers, BDD PostgreSQL) sur le stockage RAID[cite: 2].
|
||||
* [x] Mots de passe cryptés (bcrypt), protection anti-brute force[cite: 2].
|
||||
* [x] Authentification 2FA obligatoire (Keepassium, Authenticator, etc.)[cite: 2].
|
||||
* [x] Déconnexion automatique (timer invisible / session JWT) après 60 minutes d'inactivité[cite: 2].
|
||||
* [x] Configuration de GitHub Actions / Gitea Actions pour la création automatique des paquets Docker (Tags SemVer + latest)[cite: 2].
|
||||
* [x] Horodatage UTC en base de données pour immunité au changement d'heure français (Prévention crash 2FA)[cite: 2].
|
||||
* [x] Rotation automatique des logs système : génération d'un fichier log par jour avec purge stricte des fichiers de plus de 7 jours[cite: 2].
|
||||
* [x] Procédure de modification sécurisée du mot de passe (Utilisateurs et Admins)[cite: 2].
|
||||
|
||||
### Administration & Gestion des Utilisateurs
|
||||
- [x] Assistant de première installation : le premier utilisateur initiateur devient automatiquement le **Super-Admin** unique du projet.
|
||||
- [x] Refonte du setup initial (Super-Admin) : configuration du serveur mail (opérateurs FR/Gmail) et paramétrage complet des clés fournisseurs IA.
|
||||
- [x] Intégration de la roue crantée (Paramètres) en bas de la barre latérale.
|
||||
- [x] Page de configuration par niveau (Super-Admin, Admin, Utilisateur).
|
||||
- [x] Upload et personnalisation d'avatar utilisateur (redimensionnement et adaptation dynamique).
|
||||
- [ ] Hiérarchie des rôles : Un Admin peut proposer l'élévation d'un User en Admin (soumis à validation exclusive du Super-Admin).
|
||||
- [ ] Export de l'activité Admin : Fichier Excel avec KPI, graphiques "camembert", et suivi financier par utilisateur.
|
||||
- [ ] Envoi de rapport d'activité automatisé chaque jeudi à 04h00.
|
||||
|
||||
* [x] Assistant de première installation : l'initiateur du projet se voit attribuer automatiquement le rôle exclusif de **Super-Admin** (un seul par projet)[cite: 2].
|
||||
* [x] Refonte du setup initial (Super Admin) : configuration du serveur mail (opérateurs FR/Gmail) et paramétrage complet des clés fournisseurs IA[cite: 2].
|
||||
* [x] Intégration de la roue crantée (Paramètres) en bas de la barre latérale[cite: 2].
|
||||
* [x] Page de configuration par niveau (Super-Admin, Admin, Utilisateur)[cite: 2].
|
||||
* [x] Upload et personnalisation dynamique d'avatar utilisateur[cite: 2].
|
||||
* [ ] Hiérarchie des rôles : Un Admin peut proposer l'élévation d'un User en Admin (formulaire soumis à la validation exclusive du Super Admin)[cite: 2].
|
||||
* [ ] Export de l'activité Admin : Fichier Excel avec KPI, graphiques "camembert", et suivi financier par utilisateur[cite: 2].
|
||||
* [x] Suivi financier en temps réel et vérification du budget API (mis à jour après chaque requête et affiché de manière non invasive sous le nom)[cite: 2].
|
||||
* [ ] Envoi de rapport d'activité automatisé chaque jeudi à 04h00[cite: 2].
|
||||
|
||||
### Expérience Utilisateur (UI/UX)
|
||||
- [x] Thème moderne (Gemini-like) et 100% compatible smartphones.
|
||||
- [x] Refonte de la gestion des projets : séparation Épinglés (en haut) / Non Épinglés (Récents).
|
||||
- [x] Arrêt de la création automatique de nouveau projet à l'ouverture.
|
||||
- [x] Intégration permanente du logo AETHAS38 en local (Setup / Login / Dashboard).
|
||||
- [x] Indicateur visuel (Loader/Animation) signalant que l'IA AETHAS38 "réfléchit" ou travaille.
|
||||
- [x] Fonctionnalité de renommage manuel des discussions/projets.
|
||||
- [x] Affichage permanent et non invasif des soldes financiers fournisseurs sous le profil utilisateur, mis à jour après chaque requête.
|
||||
- [ ] Affichage natif et fluide des images directement dans le flux de la discussion.
|
||||
- [ ] Système de partage des réponses sur les réseaux et messageries externes (Facebook, WhatsApp, etc.).
|
||||
|
||||
* [x] Thème moderne (Gemini-like) et 100% compatible smartphones[cite: 2].
|
||||
* [x] Refonte de la gestion des projets : séparation Épinglés (en haut) / Non Épinglés (Récents)[cite: 2].
|
||||
* [x] Arrêt de la création automatique de nouveau projet à l'ouverture[cite: 2].
|
||||
* [x] Intégration permanente du logo AETHAS38 en local (Setup / Login / Dashboard)[cite: 2].
|
||||
* [x] Indicateur visuel (Loader/Animation) signalant que l'IA AETHAS38 "réfléchit" ou travaille[cite: 2].
|
||||
* [x] Fonctionnalité de renommage manuel des discussions/projets[cite: 2].
|
||||
* [ ] Affichage natif et fluide des images directement dans le flux de la discussion[cite: 2].
|
||||
* [ ] Système de partage des réponses sur les réseaux et messageries externes (Facebook, WhatsApp, etc.)[cite: 2].
|
||||
|
||||
### Moteur IA, Modèles & Fonctionnalités
|
||||
- [x] Cœur asynchrone pour la parallélisation des appels API (module `orchestrator.py`).
|
||||
- [x] Pipeline multi-agents complet avec sélection dynamique par requête :
|
||||
- Sélection de 1 à 5 travailleurs IA en parallèle.
|
||||
- Si 1 seul travailleur : bypass automatique du prompteur et du concaténeur.
|
||||
- Si > 1 travailleur : chaîne complète active (1 Prompteur ➔ N Travailleurs ➔ 1 Concaténeur).
|
||||
- [x] Extraction universelle et multi-fournisseurs (OpenRouter, Groq, DeepSeek, Mistral, Gemini, Cloudflare) avec timeout étendu à 90 secondes.
|
||||
- [x] Tâche planifiée (CRON) pour la mise à jour automatique des modèles toutes les 12h (00h00 et 12h00 heure de Paris).
|
||||
- [x] Page dédiée aux modèles : export, import manuel de fichiers d'extraction JSON, filtrage par prix (Gratuit/Payant), domaine (Code, Texte, Vision, Audio) et recherche textuelle.
|
||||
- [x] Extraction unitaire des retours IA et téléchargement global d'une conversation (formats TXT et JSON).
|
||||
- [x] Détection et téléchargement ciblé de blocs de code ou de données (ex: fichiers `.xlsx`, `.py`, `.csv`) générés par l'IA en respectant le nommage exact.
|
||||
|
||||
* [x] Cœur asynchrone pour la parallélisation des appels API (module `orchestrator.py`)[cite: 2].
|
||||
* [x] Pipeline multi-agents complet avec sélection dynamique par requête :
|
||||
* Sélection de 1 à 5 travailleurs IA en parallèle[cite: 2].
|
||||
* Si un seul travailleur est sélectionné, bypass automatique du prompteur et du concaténeur[cite: 2].
|
||||
* Si > 1 travailleur, activation de la chaîne complète (1 Prompteur ➔ N Travailleurs ➔ 1 Concaténeur)[cite: 2].
|
||||
* [x] Extraction universelle multi-fournisseurs (OpenRouter, Groq, DeepSeek, Mistral, Gemini, Cloudflare) avec timeout porté à 90 secondes[cite: 2].
|
||||
* [x] Tâche planifiée (CRON) pour la mise à jour des modèles toutes les 12h (00h00 et 12h00)[cite: 2].
|
||||
* [x] Page spécifique dédiée aux modèles permettant l'export, l'import manuel d'un fichier d'extraction JSON, ainsi que le filtrage par prix, domaine et mots-clés[cite: 2].
|
||||
* [x] Extraction unitaire des retours IA et téléchargement global d'une conversation (formats TXT et JSON)[cite: 2].
|
||||
* [x] Détection et téléchargement ciblé de pièces jointes ou blocs spécifiques (Code brut, scripts, fichiers de données) générés par l'IA en respectant le nommage exact demandé[cite: 2].
|
||||
* [x] Classement, filtrage (Gratuit/Payant) et catégorisation des modèles (Texte, Code, Vision, Audio)[cite: 2].
|
||||
* [ ] Traduction automatisée des descriptions des modèles via Ollama (local) ou Gemini[cite: 2].
|
||||
* [ ] Interface d'aide à la décision pour le choix des modèles selon la tâche souhaitée[cite: 2].
|
||||
* [ ] Mécanisme de fallback / termes génériques pour les appels API (protection contre le dépassement des quotas)[cite: 2].
|
||||
+82
-98
@@ -23,26 +23,6 @@
|
||||
|
||||
<div id="app" class="flex w-full h-full relative bg-aethas-dark">
|
||||
|
||||
<!-- MODAL PARAMÈTRES (Sécurité) -->
|
||||
<div v-if="isSettingsModalOpen" class="fixed inset-0 bg-black/80 z-[100] flex items-center justify-center p-4">
|
||||
<div class="bg-aethas-panel border border-gray-600 rounded-2xl w-full max-w-md overflow-hidden shadow-[0_0_30px_rgba(0,0,0,0.7)]">
|
||||
<div class="p-4 border-b border-gray-700 flex justify-between items-center bg-gray-800/50">
|
||||
<h2 class="text-lg font-bold text-white flex items-center gap-2"><i data-lucide="settings" class="w-5 h-5 text-aethas-cyan"></i> Paramètres</h2>
|
||||
<button @click="closeSettings" class="text-gray-400 hover:text-white"><i data-lucide="x" class="w-5 h-5"></i></button>
|
||||
</div>
|
||||
<div class="p-6 space-y-4">
|
||||
<h3 class="text-sm font-semibold text-aethas-cyan uppercase tracking-wider mb-2">Sécurité du compte</h3>
|
||||
<div v-if="settingsMessage" :class="['p-3 rounded text-sm text-center', settingsMessage.includes('succès') ? 'bg-green-900/50 text-green-200 border border-green-500' : 'bg-red-900/50 text-red-200 border border-red-500']">{{ settingsMessage }}</div>
|
||||
<div><label class="block text-sm text-gray-300 mb-1">Ancien mot de passe</label><input v-model="passForm.old" type="password" class="w-full bg-aethas-dark border border-gray-600 rounded-lg px-4 py-2 focus:border-aethas-cyan focus:outline-none"></div>
|
||||
<div><label class="block text-sm text-gray-300 mb-1">Nouveau mot de passe</label><input v-model="passForm.new" type="password" class="w-full bg-aethas-dark border border-gray-600 rounded-lg px-4 py-2 focus:border-aethas-cyan focus:outline-none"></div>
|
||||
<div><label class="block text-sm text-gray-300 mb-1">Confirmer</label><input v-model="passForm.confirm" type="password" class="w-full bg-aethas-dark border border-gray-600 rounded-lg px-4 py-2 focus:border-aethas-cyan focus:outline-none"></div>
|
||||
<button @click="changePassword" :disabled="isSavingSettings" class="w-full mt-4 bg-gray-700 hover:bg-gray-600 text-white font-semibold py-2.5 px-4 rounded-lg transition-colors border border-gray-500 disabled:opacity-50">
|
||||
<span v-if="isSavingSettings">Mise à jour...</span><span v-else>Modifier</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- BARRE LATÉRALE -->
|
||||
<div :class="['transition-all duration-300 flex-shrink-0 relative z-50 flex flex-col', isSidebarOpen ? 'w-72' : 'w-0']">
|
||||
<aside :class="['absolute top-0 left-0 h-full w-72 bg-aethas-panel border-r border-gray-700 flex flex-col transition-transform duration-300', isSidebarOpen ? 'translate-x-0' : '-translate-x-full']">
|
||||
@@ -63,7 +43,7 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="flex-1 overflow-y-auto p-4 space-y-6">
|
||||
<div class="flex-1 overflow-y-auto p-4 space-y-6 custom-scrollbar">
|
||||
<div v-if="pinnedProjects.length > 0">
|
||||
<h3 class="text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2">Épinglés</h3>
|
||||
<ul class="space-y-1">
|
||||
@@ -84,14 +64,14 @@
|
||||
<div class="hidden group-hover:flex items-center gap-1 bg-gray-800 pl-2 rounded">
|
||||
<button @click.stop="renameProject(project)" class="text-gray-400 hover:text-aethas-cyan"><i data-lucide="edit-2" class="w-3.5 h-3.5"></i></button>
|
||||
<button @click.stop="togglePin(project.id)" class="text-gray-400 hover:text-white"><i data-lucide="pin" class="w-3.5 h-3.5"></i></button>
|
||||
<button @click.stop="deleteProject(project.id)" class="text-gray-400 hover:text-red-400"><i data-lucide="trash-2" class="w-3.5 h-3.5"></i></button>
|
||||
<button @click.stop="deleteProject(project.id)" class="text-red-500 hover:text-red-400"><i data-lucide="trash-2" class="w-3.5 h-3.5"></i></button>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- NOUVEAU : ENCART FINANCIER SOUS LE MENU RÉCENTS -->
|
||||
<!-- ENCART FINANCIER -->
|
||||
<div class="px-4 pb-2 border-b border-gray-700">
|
||||
<div v-if="financesList.length > 0" class="flex flex-col gap-1.5 mb-2">
|
||||
<div v-for="fin in financesList" :key="fin.provider" class="text-[10px] bg-gray-800/80 border border-gray-600/50 px-2 py-1.5 rounded flex justify-between items-center shadow-inner">
|
||||
@@ -137,7 +117,7 @@
|
||||
</header>
|
||||
|
||||
<!-- VUE : CONFIGURATION (Par Niveaux) -->
|
||||
<div v-if="activeView === 'settings'" class="flex-1 overflow-y-auto p-4 md:p-8">
|
||||
<div v-if="activeView === 'settings'" class="flex-1 overflow-y-auto p-4 md:p-8 custom-scrollbar">
|
||||
<div class="max-w-4xl mx-auto space-y-6">
|
||||
<h2 class="text-2xl font-bold text-white flex items-center gap-2 border-b border-gray-700 pb-4"><i data-lucide="settings-2" class="w-6 h-6 text-aethas-cyan"></i> Configuration Système</h2>
|
||||
|
||||
@@ -198,7 +178,7 @@
|
||||
</div>
|
||||
|
||||
<!-- VUE : MODÈLES ET FINANCES (Admin Only) -->
|
||||
<div v-if="activeView === 'models' && user.is_admin" class="flex-1 overflow-y-auto p-4 md:p-8 space-y-6">
|
||||
<div v-if="activeView === 'models' && user.is_admin" class="flex-1 overflow-y-auto p-4 md:p-8 space-y-6 custom-scrollbar">
|
||||
<div class="flex justify-between items-end border-b border-gray-700 pb-4">
|
||||
<div>
|
||||
<h2 class="text-2xl font-bold text-white flex items-center gap-2"><i data-lucide="cpu" class="w-6 h-6 text-aethas-cyan"></i> Modèles & Finances API</h2>
|
||||
@@ -253,86 +233,89 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- VUE : CHAT PAR DÉFAUT -->
|
||||
<template v-if="activeView === 'chat'">
|
||||
<!-- VUE : CHAT (Toujours accessible et affichée par défaut) -->
|
||||
<div v-show="activeView === 'chat'" class="flex-1 flex flex-col min-h-0">
|
||||
<div v-if="!activeProject" class="flex-1 overflow-y-auto p-4 flex flex-col items-center justify-center">
|
||||
<img src="/assets/logo.png" class="w-24 h-24 mb-6 rounded-full border-2 border-aethas-cyan shadow-[0_0_15px_rgba(6,182,212,0.5)]">
|
||||
<h2 class="text-2xl font-bold text-gray-200 mb-2">Comment puis-je vous aider aujourd'hui ?</h2>
|
||||
<p class="text-gray-500 text-sm">Sélectionnez ou créez un projet dans la barre latérale.</p>
|
||||
</div>
|
||||
|
||||
<div v-else class="flex-1 overflow-y-auto p-4 md:p-8 space-y-6 flex flex-col custom-scrollbar" id="chat-container">
|
||||
<div v-if="messages.length === 0" class="flex-1 flex items-center justify-center text-gray-500 italic">Démarrez la conversation ci-dessous.</div>
|
||||
|
||||
<div v-for="msg in messages" :key="msg.id" :class="['max-w-4xl rounded-2xl p-4', msg.role === 'user' ? 'bg-gray-800 ml-auto border border-gray-700' : 'bg-aethas-panel mr-auto border border-aethas-cyan/30 flex flex-col']">
|
||||
<div class="flex items-center gap-2 mb-2">
|
||||
<img v-if="msg.role === 'user' && user.avatar_path" :src="user.avatar_path" class="w-5 h-5 rounded-full object-cover">
|
||||
<span class="text-xs font-semibold uppercase tracking-wider text-gray-400">{{ msg.role === 'user' ? 'Vous' : 'AETHAS38' }}</span>
|
||||
</div>
|
||||
<template v-else>
|
||||
<div class="flex-1 overflow-y-auto p-4 md:p-8 space-y-6 flex flex-col custom-scrollbar" id="chat-container">
|
||||
<div v-if="messages.length === 0" class="flex-1 flex items-center justify-center text-gray-500 italic">Démarrez la conversation ci-dessous.</div>
|
||||
|
||||
<div class="text-gray-200 text-sm leading-relaxed w-full">
|
||||
<template v-for="(part, index) in parseMessage(msg.content)" :key="index">
|
||||
<div v-if="part.type === 'text'" class="whitespace-pre-wrap font-sans">{{ part.content }}</div>
|
||||
<div v-if="part.type === 'code'" class="my-4 bg-gray-900 rounded-lg border border-gray-700 overflow-hidden shadow-inner">
|
||||
<div class="flex justify-between items-center px-4 py-2 bg-gray-800 border-b border-gray-700">
|
||||
<span class="text-xs text-gray-400 font-mono flex items-center gap-2"><i data-lucide="file-code-2" class="w-4 h-4"></i> {{ part.language || 'code' }}</span>
|
||||
<button @click="downloadFile(part.content, part.language)" class="text-aethas-cyan hover:text-white flex items-center gap-1 text-xs transition-colors bg-gray-700 hover:bg-gray-600 px-2 py-1 rounded"><i data-lucide="download" class="w-3 h-3"></i> Fichier</button>
|
||||
<div v-for="msg in messages" :key="msg.id" :class="['max-w-4xl rounded-2xl p-4', msg.role === 'user' ? 'bg-gray-800 ml-auto border border-gray-700' : 'bg-aethas-panel mr-auto border border-aethas-cyan/30 flex flex-col']">
|
||||
<div class="flex items-center gap-2 mb-2">
|
||||
<img v-if="msg.role === 'user' && user.avatar_path" :src="user.avatar_path" class="w-5 h-5 rounded-full object-cover">
|
||||
<span class="text-xs font-semibold uppercase tracking-wider text-gray-400">{{ msg.role === 'user' ? 'Vous' : 'AETHAS38' }}</span>
|
||||
</div>
|
||||
|
||||
<div class="text-gray-200 text-sm leading-relaxed w-full">
|
||||
<template v-for="(part, index) in parseMessage(msg.content)" :key="index">
|
||||
<div v-if="part.type === 'text'" class="whitespace-pre-wrap font-sans">{{ part.content }}</div>
|
||||
<div v-if="part.type === 'code'" class="my-4 bg-gray-900 rounded-lg border border-gray-700 overflow-hidden shadow-inner">
|
||||
<div class="flex justify-between items-center px-4 py-2 bg-gray-800 border-b border-gray-700">
|
||||
<span class="text-xs text-gray-400 font-mono flex items-center gap-2"><i data-lucide="file-code-2" class="w-4 h-4"></i> {{ part.language || 'code' }}</span>
|
||||
<button @click="downloadFile(part.content, part.language)" class="text-aethas-cyan hover:text-white flex items-center gap-1 text-xs transition-colors bg-gray-700 hover:bg-gray-600 px-2 py-1 rounded"><i data-lucide="download" class="w-3 h-3"></i> Fichier</button>
|
||||
</div>
|
||||
<pre class="p-4 text-xs font-mono text-gray-300 overflow-x-auto custom-scrollbar"><code>{{ part.content }}</code></pre>
|
||||
</div>
|
||||
<pre class="p-4 text-xs font-mono text-gray-300 overflow-x-auto custom-scrollbar"><code>{{ part.content }}</code></pre>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<div v-if="msg.role !== 'user'" class="mt-3 flex items-center gap-3 border-t border-gray-700/50 pt-2 opacity-50 hover:opacity-100 transition-opacity">
|
||||
<button @click="copyToClipboard(msg.content)" class="text-xs text-gray-400 hover:text-aethas-cyan flex items-center gap-1"><i data-lucide="copy" class="w-3 h-3"></i> Copier</button>
|
||||
<button @click="downloadMessage(msg.content, msg.created_at)" class="text-xs text-gray-400 hover:text-aethas-cyan flex items-center gap-1"><i data-lucide="file-down" class="w-3 h-3"></i> Extraire</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="isAiThinking" class="max-w-3xl rounded-2xl p-4 bg-aethas-panel mr-auto border border-aethas-cyan/30 w-24">
|
||||
<div class="flex space-x-1.5 h-4 items-center">
|
||||
<div class="w-2 h-2 bg-aethas-cyan rounded-full animate-bounce"></div>
|
||||
<div class="w-2 h-2 bg-aethas-cyan rounded-full animate-bounce" style="animation-delay: 0.15s"></div>
|
||||
<div class="w-2 h-2 bg-aethas-cyan rounded-full animate-bounce" style="animation-delay: 0.3s"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ZONE SÉLECTION MODÈLES PAR REQUÊTE & PROMPT -->
|
||||
<div class="p-4 md:p-6 w-full max-w-5xl mx-auto space-y-2 flex-shrink-0">
|
||||
<div class="bg-gray-800/80 border border-gray-700 rounded-xl p-3 flex flex-wrap gap-4 items-center text-xs shadow-md">
|
||||
<div class="flex items-center gap-2 flex-1 min-w-[200px]">
|
||||
<span class="text-aethas-cyan font-semibold w-20"><i data-lucide="users" class="w-3 h-3 inline"></i> Travailleurs:</span>
|
||||
<select multiple v-model="selectedWorkers" @change="limitWorkers" class="bg-aethas-dark border border-gray-600 rounded px-2 py-1 text-gray-200 w-full h-16 outline-none focus:border-aethas-cyan custom-scrollbar">
|
||||
<option value="gemini-3.5-flash-lite">Gemini 3.5 Flash-Lite (Direct)</option>
|
||||
<option v-for="m in modelInfo.models" :key="m.model_id" :value="m.model_id">{{ m.name || m.model_id }} ({{ m.domain }})</option>
|
||||
</select>
|
||||
<span class="text-gray-500 ml-1">{{ selectedWorkers.length }}/5</span>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-2 flex-1 min-w-[200px]" :class="{'opacity-30 pointer-events-none': selectedWorkers.length <= 1}">
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-gray-400 font-semibold w-24"><i data-lucide="edit-3" class="w-3 h-3 inline"></i> Prompteur:</span>
|
||||
<select v-model="selectedPrompter" class="bg-aethas-dark border border-gray-600 rounded px-2 py-1 text-gray-200 flex-1 outline-none truncate">
|
||||
<option value="gemini-3.5-flash-lite">Gemini 3.5 Flash-Lite (Direct)</option>
|
||||
<option v-for="m in modelInfo.models" :key="m.model_id" :value="m.model_id">{{ m.name || m.model_id }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-aethas-purple font-semibold w-24"><i data-lucide="git-merge" class="w-3 h-3 inline"></i> Concaténeur:</span>
|
||||
<select v-model="selectedConcatenator" class="bg-aethas-dark border border-gray-600 rounded px-2 py-1 text-gray-200 flex-1 outline-none truncate">
|
||||
<option value="gemini-3.5-flash-lite">Gemini 3.5 Flash-Lite (Direct)</option>
|
||||
<option v-for="m in modelInfo.models" :key="m.model_id" :value="m.model_id">{{ m.name || m.model_id }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<div v-if="msg.role !== 'user'" class="mt-3 flex items-center gap-3 border-t border-gray-700/50 pt-2 opacity-50 hover:opacity-100 transition-opacity">
|
||||
<button @click="copyToClipboard(msg.content)" class="text-xs text-gray-400 hover:text-aethas-cyan flex items-center gap-1"><i data-lucide="copy" class="w-3 h-3"></i> Copier</button>
|
||||
<button @click="downloadMessage(msg.content, msg.created_at)" class="text-xs text-gray-400 hover:text-aethas-cyan flex items-center gap-1"><i data-lucide="file-down" class="w-3 h-3"></i> Extraire</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="isAiThinking" class="max-w-3xl rounded-2xl p-4 bg-aethas-panel mr-auto border border-aethas-cyan/30 w-24">
|
||||
<div class="flex space-x-1.5 h-4 items-center">
|
||||
<div class="w-2 h-2 bg-aethas-cyan rounded-full animate-bounce"></div>
|
||||
<div class="w-2 h-2 bg-aethas-cyan rounded-full animate-bounce" style="animation-delay: 0.15s"></div>
|
||||
<div class="w-2 h-2 bg-aethas-cyan rounded-full animate-bounce" style="animation-delay: 0.3s"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ZONE SÉLECTION MODÈLES PAR REQUÊTE -->
|
||||
<div v-if="activeProject" class="p-4 md:p-6 w-full max-w-5xl mx-auto space-y-2">
|
||||
<div class="bg-gray-800/80 border border-gray-700 rounded-xl p-3 flex flex-wrap gap-4 items-center text-xs shadow-md">
|
||||
<div class="flex items-center gap-2 flex-1 min-w-[200px]">
|
||||
<span class="text-aethas-cyan font-semibold w-20"><i data-lucide="users" class="w-3 h-3 inline"></i> Travailleurs:</span>
|
||||
<select multiple v-model="selectedWorkers" @change="limitWorkers" class="bg-aethas-dark border border-gray-600 rounded px-2 py-1 text-gray-200 w-full h-16 outline-none focus:border-aethas-cyan custom-scrollbar">
|
||||
<option value="gemini-3.5-flash-lite">Gemini 3.5 Flash-Lite (Direct)</option>
|
||||
<option v-for="m in modelInfo.models" :key="m.model_id" :value="m.model_id">{{ m.name || m.model_id }} ({{ m.domain }})</option>
|
||||
</select>
|
||||
<span class="text-gray-500 ml-1">{{ selectedWorkers.length }}/5</span>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-2 flex-1 min-w-[200px]" :class="{'opacity-30 pointer-events-none': selectedWorkers.length <= 1}">
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-gray-400 font-semibold w-24"><i data-lucide="edit-3" class="w-3 h-3 inline"></i> Prompteur:</span>
|
||||
<select v-model="selectedPrompter" class="bg-aethas-dark border border-gray-600 rounded px-2 py-1 text-gray-200 flex-1 outline-none truncate">
|
||||
<option value="gemini-3.5-flash-lite">Gemini 3.5 Flash-Lite (Direct)</option>
|
||||
<option v-for="m in modelInfo.models" :key="m.model_id" :value="m.model_id">{{ m.name || m.model_id }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-aethas-purple font-semibold w-24"><i data-lucide="git-merge" class="w-3 h-3 inline"></i> Concaténeur:</span>
|
||||
<select v-model="selectedConcatenator" class="bg-aethas-dark border border-gray-600 rounded px-2 py-1 text-gray-200 flex-1 outline-none truncate">
|
||||
<option value="gemini-3.5-flash-lite">Gemini 3.5 Flash-Lite (Direct)</option>
|
||||
<option v-for="m in modelInfo.models" :key="m.model_id" :value="m.model_id">{{ m.name || m.model_id }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="relative flex items-end bg-gray-800 border border-gray-600 rounded-2xl p-2 shadow-lg focus-within:border-aethas-cyan">
|
||||
<textarea v-model="prompt" @input="autoResize" @keydown.enter.exact.prevent="sendMessage" ref="promptTextarea" :disabled="isAiThinking" rows="1" class="w-full bg-transparent text-gray-200 p-3 max-h-[200px] overflow-y-auto focus:outline-none resize-none disabled:opacity-50 custom-scrollbar" placeholder="Sélectionnez vos modèles ci-dessus, puis posez votre question..."></textarea>
|
||||
<button @click="sendMessage" :disabled="!prompt.trim() || isAiThinking" class="p-3 text-aethas-cyan hover:text-white disabled:opacity-50"><i data-lucide="send" class="w-5 h-5"></i></button>
|
||||
<div class="relative flex items-end bg-gray-800 border border-gray-600 rounded-2xl p-2 shadow-lg focus-within:border-aethas-cyan">
|
||||
<textarea v-model="prompt" @input="autoResize" @keydown.enter.exact.prevent="sendMessage" ref="promptTextarea" :disabled="isAiThinking" rows="1" class="w-full bg-transparent text-gray-200 p-3 max-h-[200px] overflow-y-auto focus:outline-none resize-none disabled:opacity-50 custom-scrollbar" placeholder="Sélectionnez vos modèles ci-dessus, puis posez votre question..."></textarea>
|
||||
<button @click="sendMessage" :disabled="!prompt.trim() || isAiThinking" class="p-3 text-aethas-cyan hover:text-white disabled:opacity-50"><i data-lucide="send" class="w-5 h-5"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
@@ -405,12 +388,13 @@
|
||||
if(res.ok) {
|
||||
await fetchModelsInfo();
|
||||
await fetchFinances();
|
||||
alert("Synchronisation terminée !");
|
||||
alert("Synchronisation réussie !");
|
||||
} else {
|
||||
const err = await res.json();
|
||||
alert("Erreur: " + err.detail);
|
||||
let errText = await res.text();
|
||||
try { const errObj = JSON.parse(errText); errText = errObj.detail || errText; } catch(e){}
|
||||
alert("Erreur retournée par le serveur : " + errText);
|
||||
}
|
||||
} catch(e) { alert("Erreur réseau de synchronisation."); }
|
||||
} catch(e) { alert("Erreur réseau: impossible de contacter le serveur (" + e.message + ")."); }
|
||||
isSyncing.value = false;
|
||||
};
|
||||
|
||||
@@ -448,7 +432,7 @@
|
||||
if (response.ok) {
|
||||
const data = await response.json();
|
||||
if (Array.isArray(data)) messages.value = data;
|
||||
await fetchFinances(); // MAJ du budget sous le nom
|
||||
await fetchFinances();
|
||||
} else {
|
||||
const err = await response.json(); alert("Erreur API IA : " + err.detail);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user