Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
108ba8f167 | ||
|
|
5dea7d3353 |
+56
-29
@@ -22,26 +22,6 @@
|
|||||||
<body class="h-screen flex overflow-hidden">
|
<body class="h-screen flex overflow-hidden">
|
||||||
|
|
||||||
<div id="app" class="flex w-full h-full relative bg-aethas-dark">
|
<div id="app" class="flex w-full h-full relative bg-aethas-dark">
|
||||||
|
|
||||||
<!-- MODAL PARAMÈTRES -->
|
|
||||||
<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 -->
|
<!-- BARRE LATÉRALE -->
|
||||||
<div :class="['transition-all duration-300 flex-shrink-0 relative z-50 flex flex-col', isSidebarOpen ? 'w-72' : 'w-0']">
|
<div :class="['transition-all duration-300 flex-shrink-0 relative z-50 flex flex-col', isSidebarOpen ? 'w-72' : 'w-0']">
|
||||||
@@ -243,6 +223,11 @@
|
|||||||
<option value="free">Gratuits uniquement</option>
|
<option value="free">Gratuits uniquement</option>
|
||||||
<option value="paid">Payants</option>
|
<option value="paid">Payants</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- BOUTON D'EXPORT CSV -->
|
||||||
|
<button @click="exportCSV" class="bg-aethas-panel border border-gray-600 hover:border-aethas-cyan text-gray-300 hover:text-white px-3 py-1.5 rounded flex items-center gap-2 text-sm transition-colors md:ml-auto">
|
||||||
|
<i data-lucide="download" class="w-4 h-4 text-green-500"></i> Export CSV
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="overflow-x-auto max-h-[500px] custom-scrollbar">
|
<div class="overflow-x-auto max-h-[500px] custom-scrollbar">
|
||||||
<table class="w-full text-left text-sm text-gray-300">
|
<table class="w-full text-left text-sm text-gray-300">
|
||||||
@@ -293,7 +278,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Boutons présents sur toutes les bulles (utilisateur et IA) -->
|
<!-- Boutons de copie et téléchargement individuel -->
|
||||||
<div class="mt-3 flex items-center gap-3 border-t border-gray-700/50 pt-2 opacity-50 hover:opacity-100 transition-opacity">
|
<div 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="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 || new Date().toISOString())" 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>
|
<button @click="downloadMessage(msg.content, msg.created_at || new Date().toISOString())" 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>
|
||||||
@@ -448,9 +433,8 @@
|
|||||||
const isSyncing = ref(false);
|
const isSyncing = ref(false);
|
||||||
const isSavingSettings = ref(false);
|
const isSavingSettings = ref(false);
|
||||||
|
|
||||||
const isSettingsModalOpen = ref(false);
|
|
||||||
const settingsMessage = ref("");
|
|
||||||
const passForm = reactive({ old: '', new: '', confirm: '' });
|
const passForm = reactive({ old: '', new: '', confirm: '' });
|
||||||
|
const settingsMessage = ref("");
|
||||||
|
|
||||||
const modelInfo = reactive({ last_sync_date: null, last_sync_type: null, models: [] });
|
const modelInfo = reactive({ last_sync_date: null, last_sync_type: null, models: [] });
|
||||||
const financesList = ref([]);
|
const financesList = ref([]);
|
||||||
@@ -523,8 +507,11 @@
|
|||||||
const autoResize = () => { const el = promptTextarea.value; if(el){ el.style.height = 'auto'; el.style.height = el.scrollHeight + 'px'; }};
|
const autoResize = () => { const el = promptTextarea.value; if(el){ el.style.height = 'auto'; el.style.height = el.scrollHeight + 'px'; }};
|
||||||
const scrollToBottom = () => { nextTick(() => { const c = document.getElementById('chat-container'); if (c) c.scrollTop = c.scrollHeight; }); };
|
const scrollToBottom = () => { nextTick(() => { const c = document.getElementById('chat-container'); if (c) c.scrollTop = c.scrollHeight; }); };
|
||||||
|
|
||||||
const openSettings = () => { isSettingsModalOpen.value = true; nextTick(() => lucide.createIcons()); };
|
const openSettings = () => {
|
||||||
const closeSettings = () => { isSettingsModalOpen.value = false; };
|
activeView.value = 'settings';
|
||||||
|
if(window.innerWidth < 768) isSidebarOpen.value = false;
|
||||||
|
nextTick(() => lucide.createIcons());
|
||||||
|
};
|
||||||
|
|
||||||
const logToTerminal = async (msg) => {
|
const logToTerminal = async (msg) => {
|
||||||
try { await fetch('/api/logs', { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ message: msg }) }); } catch(e){}
|
try { await fetch('/api/logs', { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ message: msg }) }); } catch(e){}
|
||||||
@@ -625,6 +612,35 @@
|
|||||||
downloadFile(templateContent, 'aethas38-config-agents.md');
|
downloadFile(templateContent, 'aethas38-config-agents.md');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const exportCSV = () => {
|
||||||
|
logToTerminal("Génération de l'extraction CSV (vue filtrée)...");
|
||||||
|
let csvContent = "\uFEFF";
|
||||||
|
csvContent += "Fournisseur,Modèle,Nom,Domaine,Gratuit,Contexte,Prix_In,Prix_Out,Description\n";
|
||||||
|
|
||||||
|
filteredModels.value.forEach(m => {
|
||||||
|
const escapeCSV = (str) => {
|
||||||
|
if (str === null || str === undefined) return '""';
|
||||||
|
return `"${String(str).replace(/"/g, '""')}"`;
|
||||||
|
};
|
||||||
|
const row = [
|
||||||
|
escapeCSV(m.provider),
|
||||||
|
escapeCSV(m.model_id),
|
||||||
|
escapeCSV(m.name),
|
||||||
|
escapeCSV(m.domain),
|
||||||
|
m.is_free ? "Oui" : "Non",
|
||||||
|
m.context_length,
|
||||||
|
m.pricing_prompt,
|
||||||
|
m.pricing_completion,
|
||||||
|
escapeCSV(m.description_fr)
|
||||||
|
];
|
||||||
|
csvContent += row.join(",") + "\n";
|
||||||
|
});
|
||||||
|
|
||||||
|
const d = new Date();
|
||||||
|
const dateStr = d.getFullYear() + String(d.getMonth()+1).padStart(2, '0') + String(d.getDate()).padStart(2, '0');
|
||||||
|
downloadFile(csvContent, `${dateStr}-extraction-modeles.csv`, 'text/csv;charset=utf-8');
|
||||||
|
};
|
||||||
|
|
||||||
const handleConfigImport = (event) => {
|
const handleConfigImport = (event) => {
|
||||||
const file = event.target.files[0];
|
const file = event.target.files[0];
|
||||||
if (!file) return;
|
if (!file) return;
|
||||||
@@ -721,7 +737,19 @@
|
|||||||
|
|
||||||
const exportProject = (format) => { if(activeProject.value) window.open(`/api/projects/${activeProject.value.id}/export?format=${format}`, '_blank'); };
|
const exportProject = (format) => { if(activeProject.value) window.open(`/api/projects/${activeProject.value.id}/export?format=${format}`, '_blank'); };
|
||||||
const copyToClipboard = async (text) => { try { await navigator.clipboard.writeText(text); alert("Copié !"); } catch (e) {} };
|
const copyToClipboard = async (text) => { try { await navigator.clipboard.writeText(text); alert("Copié !"); } catch (e) {} };
|
||||||
const downloadFile = (content, hint) => { let fname = hint ? hint.trim() : 'code.txt'; if (!fname.includes('.')) fname += '.txt'; const blob = new Blob([content], { type: 'text/plain;charset=utf-8' }); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = fname; a.click(); URL.revokeObjectURL(url); };
|
|
||||||
|
const downloadFile = (content, hint, mimeType = 'text/plain;charset=utf-8') => {
|
||||||
|
let fname = hint ? hint.trim() : 'code.txt';
|
||||||
|
if (!fname.includes('.')) fname += '.txt';
|
||||||
|
const blob = new Blob([content], { type: mimeType });
|
||||||
|
const url = URL.createObjectURL(blob);
|
||||||
|
const a = document.createElement('a');
|
||||||
|
a.href = url;
|
||||||
|
a.download = fname;
|
||||||
|
a.click();
|
||||||
|
URL.revokeObjectURL(url);
|
||||||
|
};
|
||||||
|
|
||||||
const downloadMessage = (content, dateString) => { downloadFile(content, `message_${dateString.replace(/[:T.Z]/g, '-')}.txt`); };
|
const downloadMessage = (content, dateString) => { downloadFile(content, `message_${dateString.replace(/[:T.Z]/g, '-')}.txt`); };
|
||||||
const parseMessage = (content) => { const regex = /```([\w.-]*)\n([\s\S]*?)```/g; let parts = [], last = 0, m; while ((m = regex.exec(content)) !== null) { if (m.index > last) parts.push({ type: 'text', content: content.slice(last, m.index) }); parts.push({ type: 'code', language: m[1], content: m[2] }); last = m.index + m[0].length; } if (last < content.length) parts.push({ type: 'text', content: content.slice(last) }); return parts.length > 0 ? parts : [{ type: 'text', content: content }]; };
|
const parseMessage = (content) => { const regex = /```([\w.-]*)\n([\s\S]*?)```/g; let parts = [], last = 0, m; while ((m = regex.exec(content)) !== null) { if (m.index > last) parts.push({ type: 'text', content: content.slice(last, m.index) }); parts.push({ type: 'code', language: m[1], content: m[2] }); last = m.index + m[0].length; } if (last < content.length) parts.push({ type: 'text', content: content.slice(last) }); return parts.length > 0 ? parts : [{ type: 'text', content: content }]; };
|
||||||
|
|
||||||
@@ -837,7 +865,6 @@
|
|||||||
fetchUser();
|
fetchUser();
|
||||||
fetchProjects();
|
fetchProjects();
|
||||||
fetchModelsInfo().then(() => {
|
fetchModelsInfo().then(() => {
|
||||||
// Force la validation de la première vue si nécessaire
|
|
||||||
if(activeProject.value) validateConfigAndReplace();
|
if(activeProject.value) validateConfigAndReplace();
|
||||||
});
|
});
|
||||||
fetchFinances();
|
fetchFinances();
|
||||||
@@ -848,9 +875,9 @@
|
|||||||
user, activeView, settingsTab, isSidebarOpen, toggleSidebar, prompt, autoResize, promptTextarea,
|
user, activeView, settingsTab, isSidebarOpen, toggleSidebar, prompt, autoResize, promptTextarea,
|
||||||
projects, pinnedProjects, recentProjects, activeProject, messages, isAiThinking,
|
projects, pinnedProjects, recentProjects, activeProject, messages, isAiThinking,
|
||||||
createNewProject, selectProject, renameProject, sendMessage, isLoading, togglePin, deleteProject,
|
createNewProject, selectProject, renameProject, sendMessage, isLoading, togglePin, deleteProject,
|
||||||
isSettingsModalOpen, openSettings, closeSettings, passForm, settingsMessage, isSavingSettings, changePassword, uploadAvatar,
|
openSettings, passForm, settingsMessage, isSavingSettings, changePassword, uploadAvatar,
|
||||||
modelInfo, financesList, filterSearch, filterDomain, filterPricing, filterProvider, uniqueProviders, filteredModels, getFilteredModelsForCol, formatDate, syncModels, isSyncing,
|
modelInfo, financesList, filterSearch, filterDomain, filterPricing, filterProvider, uniqueProviders, filteredModels, getFilteredModelsForCol, formatDate, syncModels, isSyncing,
|
||||||
workers, selectedPrompter, selectedConcatenator, colPricing, colDomain, downloadTemplate, handleConfigImport,
|
workers, selectedPrompter, selectedConcatenator, colPricing, colDomain, downloadTemplate, exportCSV, handleConfigImport,
|
||||||
attachedFiles, handleFileUpload, handlePaste, removeFile,
|
attachedFiles, handleFileUpload, handlePaste, removeFile,
|
||||||
exportProject, copyToClipboard, downloadFile, downloadMessage, parseMessage, systemLogs
|
exportProject, copyToClipboard, downloadFile, downloadMessage, parseMessage, systemLogs
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user