refactor: réorganisation référentiels, nouveaux modules extraction, nettoyage code obsolète
- Réorganisation data/referentiels/ : pdfs/, dicts/, user/ (structure unifiée) - Fix badges "Source absente" sur page admin référentiels - Ré-indexation COCOA 2025 (555 → 1451 chunks, couverture 94%) - Fix VRAM OOM : embeddings forcés CPU via T2A_EMBED_CPU - Nouveaux modules : document_router, docx_extractor, image_extractor, ocr_engine - Module complétude (quality/completude.py + config YAML) - Template DIM (synthèse dimensionnelle) - Gunicorn config + systemd service t2a-viewer - Suppression t2a_install_rag_cleanup/ (copie obsolète) - Suppression scripts/ et scripts_t2a_v2/ (anciens benchmarks) - Suppression 81 fichiers _doc.txt de test - Cache Ollama : TTL configurable, corrections loader YAML - Dashboard : améliorations templates (base, index, detail, cpam, validation) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -78,8 +78,26 @@
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
/* Main nav links */
|
||||
.sidebar-link {
|
||||
display: block;
|
||||
padding: 0.4rem 1rem;
|
||||
color: #cbd5e1;
|
||||
text-decoration: none;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 600;
|
||||
border-left: 3px solid transparent;
|
||||
transition: all 0.15s;
|
||||
}
|
||||
.sidebar-link:hover {
|
||||
color: #f8fafc;
|
||||
background: #334155;
|
||||
border-left-color: #3b82f6;
|
||||
}
|
||||
|
||||
/* Search */
|
||||
.sidebar-search {
|
||||
position: relative;
|
||||
padding: 0.75rem 1rem 0.5rem;
|
||||
border-bottom: 1px solid #334155;
|
||||
}
|
||||
@@ -162,6 +180,7 @@
|
||||
border-radius: 9999px;
|
||||
font-size: 0.7rem;
|
||||
font-weight: 600;
|
||||
transition: all 0.15s;
|
||||
}
|
||||
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
|
||||
th, td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid #e2e8f0; }
|
||||
@@ -206,6 +225,7 @@
|
||||
border-radius: 9999px;
|
||||
font-size: 0.7rem;
|
||||
font-weight: 600;
|
||||
transition: all 0.15s;
|
||||
}
|
||||
.badge-das { background: #dbeafe; color: #1d4ed8; }
|
||||
.badge-actes { background: #e0e7ff; color: #3730a3; }
|
||||
@@ -335,45 +355,70 @@
|
||||
}
|
||||
.src-file-btn:hover { background: #e2e8f0; border-color: #3b82f6; }
|
||||
.src-file-btn.active { background: #3b82f6; color: #fff; border-color: #3b82f6; }
|
||||
|
||||
/* Tableau dossiers (index) */
|
||||
.table-dossiers { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
|
||||
.table-dossiers th {
|
||||
text-align: left; padding: 0.6rem 0.75rem; border-bottom: 2px solid #e2e8f0;
|
||||
font-weight: 600; color: #475569; font-size: 0.75rem; text-transform: uppercase;
|
||||
letter-spacing: 0.05em; background: #f8fafc;
|
||||
}
|
||||
.table-dossiers td { padding: 0.6rem 0.75rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
|
||||
.row-clickable { cursor: pointer; transition: background 0.15s; }
|
||||
.row-clickable:hover { background: #f0f9ff; }
|
||||
|
||||
/* Hamburger toggle (mobile) */
|
||||
.sidebar-toggle {
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 0.75rem;
|
||||
left: 0.75rem;
|
||||
z-index: 10001;
|
||||
background: #1e293b;
|
||||
color: #e2e8f0;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
padding: 0.5rem 0.65rem;
|
||||
font-size: 1.2rem;
|
||||
cursor: pointer;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
/* Responsive */
|
||||
@media (max-width: 768px) {
|
||||
.sidebar-toggle { display: block; }
|
||||
.sidebar {
|
||||
transform: translateX(-100%);
|
||||
transition: transform 0.25s ease;
|
||||
z-index: 10000;
|
||||
}
|
||||
.sidebar.open { transform: translateX(0); }
|
||||
.main { margin-left: 0; padding: 1rem; padding-top: 3.5rem; }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Hamburger (mobile) -->
|
||||
<button class="sidebar-toggle" id="sidebar-toggle" aria-label="Menu">☰</button>
|
||||
|
||||
<!-- Sidebar -->
|
||||
<aside class="sidebar">
|
||||
<aside class="sidebar" id="sidebar">
|
||||
<div class="sidebar-header">
|
||||
<h1>T2A Viewer</h1>
|
||||
<img src="{{ url_for('static', filename='logo_aivanov.png') }}" alt="Aivanov" style="height:32px;margin-bottom:0.5rem;background:#fff;border-radius:6px;padding:2px 8px;">
|
||||
<h1>T2A Viewer <span style="font-size:0.65rem;font-weight:400;color:#94a3b8;">v1.0</span></h1>
|
||||
<p>Visualisation CIM-10</p>
|
||||
</div>
|
||||
<nav class="sidebar-main-nav" style="padding:0.5rem 0;border-bottom:1px solid #334155;">
|
||||
<a href="/" class="sidebar-link">📁 Dossiers</a>
|
||||
<a href="/dashboard" class="sidebar-link">📊 Dashboard</a>
|
||||
<a href="/dim" class="sidebar-link">🏥 Synthèse DIM</a>
|
||||
<a href="/cpam" class="sidebar-link">⚠ Contrôles UCR</a>
|
||||
<a href="/admin/referentiels" class="sidebar-link">📚 Référentiels</a>
|
||||
</nav>
|
||||
<div class="sidebar-search">
|
||||
<input type="text" id="sidebar-search" placeholder="Rechercher un dossier…" autocomplete="off">
|
||||
</div>
|
||||
<nav class="sidebar-nav" id="sidebar-nav">
|
||||
{% block sidebar %}{% endblock %}
|
||||
</nav>
|
||||
<div class="sidebar-admin" style="border-top:1px solid #334155;padding:0.5rem 1rem;">
|
||||
<a href="/dashboard" style="display:block;color:#cbd5e1;text-decoration:none;font-size:0.8rem;font-weight:600;padding:0.35rem 0;transition:color 0.15s;"
|
||||
onmouseover="this.style.color='#f8fafc'" onmouseout="this.style.color='#cbd5e1'">
|
||||
Dashboard
|
||||
</a>
|
||||
<a href="/cpam" style="display:block;color:#cbd5e1;text-decoration:none;font-size:0.8rem;font-weight:600;padding:0.35rem 0;transition:color 0.15s;"
|
||||
onmouseover="this.style.color='#f8fafc'" onmouseout="this.style.color='#cbd5e1'">
|
||||
Contrôles CPAM
|
||||
</a>
|
||||
<a href="/admin/referentiels" style="display:block;color:#cbd5e1;text-decoration:none;font-size:0.8rem;font-weight:600;padding:0.35rem 0;transition:color 0.15s;"
|
||||
onmouseover="this.style.color='#f8fafc'" onmouseout="this.style.color='#cbd5e1'">
|
||||
Référentiels RAG
|
||||
</a>
|
||||
<a href="/validation" style="display:block;color:#fbbf24;text-decoration:none;font-size:0.8rem;font-weight:600;padding:0.35rem 0;transition:color 0.15s;"
|
||||
onmouseover="this.style.color='#fde68a'" onmouseout="this.style.color='#fbbf24'">
|
||||
Validation DIM
|
||||
</a>
|
||||
</div>
|
||||
<div class="sidebar-admin">
|
||||
<label for="model-select">Modèle Ollama</label>
|
||||
<select id="model-select"><option>Chargement…</option></select>
|
||||
<button id="model-apply">Appliquer</button>
|
||||
<div class="status-msg" id="model-status"></div>
|
||||
<div id="sidebar-autocomplete" style="display:none;position:absolute;left:0;right:0;background:#0f172a;border:1px solid #475569;border-radius:0 0 6px 6px;max-height:250px;overflow-y:auto;z-index:100;"></div>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
@@ -383,96 +428,53 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Sidebar toggle (mobile)
|
||||
(function() {
|
||||
const sel = document.getElementById('model-select');
|
||||
const btn = document.getElementById('model-apply');
|
||||
const status = document.getElementById('model-status');
|
||||
|
||||
function loadModels() {
|
||||
fetch('/admin/models')
|
||||
.then(r => r.json())
|
||||
.then(d => {
|
||||
sel.innerHTML = '';
|
||||
if (d.models && d.models.length) {
|
||||
d.models.forEach(m => {
|
||||
const opt = document.createElement('option');
|
||||
opt.value = m;
|
||||
opt.textContent = m;
|
||||
if (m === d.current) opt.selected = true;
|
||||
sel.appendChild(opt);
|
||||
});
|
||||
} else {
|
||||
sel.innerHTML = '<option>Aucun modèle</option>';
|
||||
}
|
||||
})
|
||||
.catch(() => { sel.innerHTML = '<option>Erreur</option>'; });
|
||||
}
|
||||
|
||||
btn.addEventListener('click', function() {
|
||||
const model = sel.value;
|
||||
if (!model || model === 'Aucun modèle' || model === 'Erreur') return;
|
||||
status.textContent = '…';
|
||||
status.style.color = '#94a3b8';
|
||||
fetch('/admin/models', {
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: JSON.stringify({model: model})
|
||||
})
|
||||
.then(r => r.json())
|
||||
.then(d => {
|
||||
if (d.ok) {
|
||||
status.textContent = 'Modèle appliqué';
|
||||
status.style.color = '#16a34a';
|
||||
} else {
|
||||
status.textContent = d.error || 'Erreur';
|
||||
status.style.color = '#dc2626';
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
status.textContent = 'Erreur réseau';
|
||||
status.style.color = '#dc2626';
|
||||
var btn = document.getElementById('sidebar-toggle');
|
||||
var sb = document.getElementById('sidebar');
|
||||
if (btn && sb) {
|
||||
btn.addEventListener('click', function() { sb.classList.toggle('open'); });
|
||||
sb.addEventListener('click', function(e) {
|
||||
if (e.target.tagName === 'A') sb.classList.remove('open');
|
||||
});
|
||||
});
|
||||
|
||||
loadModels();
|
||||
}
|
||||
})();
|
||||
|
||||
// Sidebar search filter
|
||||
// Sidebar autocomplete search
|
||||
(function() {
|
||||
const input = document.getElementById('sidebar-search');
|
||||
const nav = document.getElementById('sidebar-nav');
|
||||
if (!input || !nav) return;
|
||||
var input = document.getElementById('sidebar-search');
|
||||
var dropdown = document.getElementById('sidebar-autocomplete');
|
||||
if (!input || !dropdown) return;
|
||||
|
||||
var dossiers = {{ dossier_list | tojson }};
|
||||
|
||||
input.addEventListener('input', function() {
|
||||
const q = this.value.toLowerCase().trim();
|
||||
const groups = nav.querySelectorAll('.group-title');
|
||||
|
||||
groups.forEach(function(groupEl) {
|
||||
// Collect all sibling links until next group-title
|
||||
const links = [];
|
||||
let next = groupEl.nextElementSibling;
|
||||
while (next && !next.classList.contains('group-title')) {
|
||||
if (next.tagName === 'A') links.push(next);
|
||||
next = next.nextElementSibling;
|
||||
}
|
||||
|
||||
if (!q) {
|
||||
groupEl.style.display = '';
|
||||
links.forEach(function(a) { a.style.display = ''; });
|
||||
return;
|
||||
}
|
||||
|
||||
const groupMatch = groupEl.textContent.toLowerCase().includes(q);
|
||||
let anyLinkMatch = false;
|
||||
|
||||
links.forEach(function(a) {
|
||||
const match = groupMatch || a.textContent.toLowerCase().includes(q);
|
||||
a.style.display = match ? '' : 'none';
|
||||
if (match) anyLinkMatch = true;
|
||||
});
|
||||
|
||||
groupEl.style.display = (groupMatch || anyLinkMatch) ? '' : 'none';
|
||||
var q = this.value.toLowerCase().trim();
|
||||
dropdown.innerHTML = '';
|
||||
if (!q) { dropdown.style.display = 'none'; return; }
|
||||
var matches = dossiers.filter(function(d) { return d.name.toLowerCase().includes(q); }).slice(0, 15);
|
||||
if (!matches.length) { dropdown.style.display = 'none'; return; }
|
||||
matches.forEach(function(d) {
|
||||
var a = document.createElement('a');
|
||||
a.href = '/dossier/' + d.path;
|
||||
a.textContent = d.name;
|
||||
a.style.cssText = 'display:block;padding:0.35rem 0.6rem;color:#e2e8f0;text-decoration:none;font-size:0.8rem;border-bottom:1px solid #1e293b;';
|
||||
a.addEventListener('mouseenter', function() { this.style.background = '#334155'; });
|
||||
a.addEventListener('mouseleave', function() { this.style.background = ''; });
|
||||
dropdown.appendChild(a);
|
||||
});
|
||||
dropdown.style.display = 'block';
|
||||
});
|
||||
|
||||
input.addEventListener('keydown', function(e) {
|
||||
if (e.key === 'Enter') {
|
||||
var first = dropdown.querySelector('a');
|
||||
if (first) { window.location = first.href; e.preventDefault(); }
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener('click', function(e) {
|
||||
if (!e.target.closest('.sidebar-search')) dropdown.style.display = 'none';
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user