- Add comprehensive documentation (IMPLEMENTATION_COMPLETE, ProductionReady, QUICK_START, STARTUP_ANALYSIS) - Add startup scripts (start-server.sh, start-server.bat, check-setup.sh) - Add configs directory structure with README - Add ValidationGuards and Main.js backup - Add LLM monitoring HTML interface - Add cache templates and XML files - Add technical report (rapport_technique.md) - Add bundled code.js 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
384 lines
11 KiB
HTML
384 lines
11 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>LLM Monitoring - SEO Generator</title>
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
:root {
|
|
--primary: #667eea;
|
|
--secondary: #764ba2;
|
|
--success: #48bb78;
|
|
--warning: #ed8936;
|
|
--error: #f56565;
|
|
--bg-light: #f7fafc;
|
|
--bg-dark: #1a202c;
|
|
--text-dark: #2d3748;
|
|
--text-light: #a0aec0;
|
|
--border-light: #e2e8f0;
|
|
}
|
|
|
|
body {
|
|
font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
min-height: 100vh;
|
|
color: var(--text-dark);
|
|
padding: 20px;
|
|
}
|
|
|
|
.container {
|
|
max-width: 1400px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
header {
|
|
background: white;
|
|
border-radius: 10px;
|
|
padding: 20px 30px;
|
|
margin-bottom: 20px;
|
|
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
|
|
header h1 {
|
|
color: var(--text-dark);
|
|
font-size: 1.8em;
|
|
}
|
|
|
|
.header-actions {
|
|
display: flex;
|
|
gap: 10px;
|
|
align-items: center;
|
|
}
|
|
|
|
.btn {
|
|
background: var(--bg-light);
|
|
color: var(--text-dark);
|
|
padding: 10px 20px;
|
|
border-radius: 8px;
|
|
text-decoration: none;
|
|
transition: all 0.2s;
|
|
border: none;
|
|
cursor: pointer;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.btn:hover {
|
|
background: var(--border-light);
|
|
}
|
|
|
|
.btn-primary {
|
|
background: var(--success);
|
|
color: white;
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
background: #38a169;
|
|
}
|
|
|
|
.grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
|
gap: 20px;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.card {
|
|
background: white;
|
|
border-radius: 10px;
|
|
padding: 25px;
|
|
box-shadow: 0 5px 20px rgba(0,0,0,0.1);
|
|
}
|
|
|
|
.card h2 {
|
|
color: var(--text-dark);
|
|
margin-bottom: 15px;
|
|
padding-bottom: 10px;
|
|
border-bottom: 2px solid var(--border-light);
|
|
font-size: 1.2em;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
}
|
|
|
|
.provider-badge {
|
|
display: inline-block;
|
|
padding: 4px 12px;
|
|
border-radius: 12px;
|
|
font-size: 0.75em;
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
.provider-openai { background: #10a37f; color: white; }
|
|
.provider-anthropic { background: #d97757; color: white; }
|
|
.provider-google { background: #4285f4; color: white; }
|
|
.provider-deepseek { background: #7c3aed; color: white; }
|
|
.provider-moonshot { background: #f59e0b; color: white; }
|
|
.provider-mistral { background: #ec4899; color: white; }
|
|
|
|
.status-indicator {
|
|
width: 12px;
|
|
height: 12px;
|
|
border-radius: 50%;
|
|
display: inline-block;
|
|
margin-right: 8px;
|
|
}
|
|
|
|
.status-online { background: var(--success); }
|
|
.status-offline { background: var(--error); }
|
|
.status-testing { background: var(--warning); animation: pulse 1.5s infinite; }
|
|
|
|
@keyframes pulse {
|
|
0%, 100% { opacity: 1; }
|
|
50% { opacity: 0.5; }
|
|
}
|
|
|
|
.metric {
|
|
margin: 15px 0;
|
|
}
|
|
|
|
.metric-label {
|
|
font-size: 0.85em;
|
|
color: var(--text-light);
|
|
margin-bottom: 5px;
|
|
}
|
|
|
|
.metric-value {
|
|
font-size: 1.5em;
|
|
font-weight: 700;
|
|
color: var(--text-dark);
|
|
}
|
|
|
|
.metric-unit {
|
|
font-size: 0.7em;
|
|
color: var(--text-light);
|
|
margin-left: 5px;
|
|
}
|
|
|
|
.progress-bar {
|
|
width: 100%;
|
|
height: 8px;
|
|
background: var(--bg-light);
|
|
border-radius: 4px;
|
|
overflow: hidden;
|
|
margin-top: 8px;
|
|
}
|
|
|
|
.progress-fill {
|
|
height: 100%;
|
|
background: linear-gradient(90deg, var(--success), var(--primary));
|
|
transition: width 0.3s;
|
|
}
|
|
|
|
.latency-chart {
|
|
display: flex;
|
|
align-items: flex-end;
|
|
height: 100px;
|
|
gap: 8px;
|
|
margin-top: 15px;
|
|
}
|
|
|
|
.latency-bar {
|
|
flex: 1;
|
|
background: var(--primary);
|
|
border-radius: 4px 4px 0 0;
|
|
position: relative;
|
|
transition: height 0.3s;
|
|
}
|
|
|
|
.latency-bar span {
|
|
position: absolute;
|
|
top: -20px;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
font-size: 0.7em;
|
|
font-weight: 600;
|
|
color: var(--text-dark);
|
|
}
|
|
|
|
.info-list {
|
|
list-style: none;
|
|
}
|
|
|
|
.info-list li {
|
|
padding: 8px 0;
|
|
border-bottom: 1px solid var(--border-light);
|
|
display: flex;
|
|
justify-content: space-between;
|
|
}
|
|
|
|
.info-list li:last-child {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.loading {
|
|
text-align: center;
|
|
padding: 40px;
|
|
color: var(--text-light);
|
|
}
|
|
|
|
.spinner {
|
|
border: 3px solid var(--border-light);
|
|
border-top: 3px solid var(--primary);
|
|
border-radius: 50%;
|
|
width: 40px;
|
|
height: 40px;
|
|
animation: spin 1s linear infinite;
|
|
margin: 0 auto 15px;
|
|
}
|
|
|
|
@keyframes spin {
|
|
0% { transform: rotate(0deg); }
|
|
100% { transform: rotate(360deg); }
|
|
}
|
|
|
|
.error-message {
|
|
background: #fed7d7;
|
|
color: #822727;
|
|
padding: 15px;
|
|
border-radius: 8px;
|
|
margin: 15px 0;
|
|
}
|
|
|
|
.last-updated {
|
|
text-align: center;
|
|
color: var(--text-light);
|
|
font-size: 0.85em;
|
|
margin-top: 20px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<header>
|
|
<h1>🤖 LLM Monitoring</h1>
|
|
<div class="header-actions">
|
|
<button class="btn btn-primary" onclick="refreshData()">🔄 Rafraîchir</button>
|
|
<a href="index.html" class="btn">← Retour Accueil</a>
|
|
</div>
|
|
</header>
|
|
|
|
<div id="content">
|
|
<div class="grid" id="llmGrid">
|
|
<!-- Les cartes LLM s'afficheront ici quand les données seront disponibles -->
|
|
</div>
|
|
<div class="last-updated" id="lastUpdated"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
let llmData = [];
|
|
|
|
async function loadLLMData() {
|
|
try {
|
|
const response = await fetch('/api/llm/status');
|
|
const data = await response.json();
|
|
|
|
if (data.success) {
|
|
llmData = data.providers;
|
|
renderLLMCards();
|
|
updateLastUpdated();
|
|
}
|
|
// Si erreur, on ne fait rien - on garde juste les anciennes données affichées
|
|
} catch (error) {
|
|
console.error('Erreur chargement LLM status:', error);
|
|
// Ne rien afficher si pas encore de données
|
|
}
|
|
}
|
|
|
|
function renderLLMCards() {
|
|
const grid = document.getElementById('llmGrid');
|
|
grid.innerHTML = '';
|
|
|
|
llmData.forEach(llm => {
|
|
const card = createLLMCard(llm);
|
|
grid.appendChild(card);
|
|
});
|
|
}
|
|
|
|
function createLLMCard(llm) {
|
|
const card = document.createElement('div');
|
|
card.className = 'card';
|
|
|
|
const statusClass = llm.status === 'online' ? 'status-online' :
|
|
llm.status === 'testing' ? 'status-testing' : 'status-offline';
|
|
|
|
const providerClass = `provider-${llm.provider}`;
|
|
|
|
card.innerHTML = `
|
|
<h2>
|
|
<span class="status-indicator ${statusClass}"></span>
|
|
${llm.name}
|
|
<span class="provider-badge ${providerClass}">${llm.provider}</span>
|
|
</h2>
|
|
|
|
<div class="metric">
|
|
<div class="metric-label">Latence Moyenne</div>
|
|
<div class="metric-value">
|
|
${llm.latency ? llm.latency : '-'}
|
|
<span class="metric-unit">ms</span>
|
|
</div>
|
|
${llm.latency ? `<div class="progress-bar">
|
|
<div class="progress-fill" style="width: ${Math.min(100, (llm.latency / 50) * 100)}%"></div>
|
|
</div>` : ''}
|
|
</div>
|
|
|
|
<div class="metric">
|
|
<div class="metric-label">Crédits Restants</div>
|
|
<div class="metric-value">
|
|
${llm.credits !== null ? (llm.credits === 'unlimited' ? '∞' : llm.credits) : '?'}
|
|
${llm.credits !== 'unlimited' && llm.credits !== null ? '<span class="metric-unit">tokens</span>' : ''}
|
|
</div>
|
|
</div>
|
|
|
|
<ul class="info-list">
|
|
<li>
|
|
<span>Modèle</span>
|
|
<strong>${llm.model}</strong>
|
|
</li>
|
|
<li>
|
|
<span>Appels (24h)</span>
|
|
<strong>${llm.calls || 0}</strong>
|
|
</li>
|
|
<li>
|
|
<span>Taux succès</span>
|
|
<strong>${llm.successRate || 100}%</strong>
|
|
</li>
|
|
<li>
|
|
<span>Dernier test</span>
|
|
<strong>${llm.lastTest || 'Jamais'}</strong>
|
|
</li>
|
|
</ul>
|
|
`;
|
|
|
|
return card;
|
|
}
|
|
|
|
function updateLastUpdated() {
|
|
const now = new Date();
|
|
const timeString = now.toLocaleTimeString('fr-FR');
|
|
document.getElementById('lastUpdated').textContent = `Dernière mise à jour: ${timeString}`;
|
|
}
|
|
|
|
function refreshData() {
|
|
loadLLMData();
|
|
}
|
|
|
|
// Auto-refresh every 5 minutes (300000ms)
|
|
setInterval(refreshData, 300000);
|
|
|
|
// Initial load
|
|
window.onload = loadLLMData;
|
|
</script>
|
|
</body>
|
|
</html>
|