492 lines
20 KiB
PHP
492 lines
20 KiB
PHP
<?php
|
|
header('Content-Type: text/html; charset=utf-8');
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>🚀 Weval Mind - Status Dashboard</title>
|
|
<style>
|
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
body {
|
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
|
|
color: #fff;
|
|
min-height: 100vh;
|
|
padding: 20px;
|
|
}
|
|
.container {
|
|
max-width: 1400px;
|
|
margin: 0 auto;
|
|
}
|
|
header {
|
|
text-align: center;
|
|
padding: 30px;
|
|
background: rgba(255,255,255,0.05);
|
|
border-radius: 20px;
|
|
margin-bottom: 30px;
|
|
backdrop-filter: blur(10px);
|
|
border: 1px solid rgba(255,255,255,0.1);
|
|
}
|
|
h1 {
|
|
font-size: 2.8em;
|
|
margin-bottom: 10px;
|
|
background: linear-gradient(90deg, #00dbde, #fc00ff);
|
|
-webkit-background-clip: text;
|
|
-webkit-text-fill-color: transparent;
|
|
}
|
|
.status-badge {
|
|
display: inline-block;
|
|
padding: 8px 20px;
|
|
background: #10b981;
|
|
border-radius: 25px;
|
|
font-weight: bold;
|
|
font-size: 1.1em;
|
|
margin-top: 10px;
|
|
}
|
|
.grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
|
|
gap: 25px;
|
|
margin-bottom: 40px;
|
|
}
|
|
.card {
|
|
background: rgba(255,255,255,0.05);
|
|
border-radius: 15px;
|
|
padding: 25px;
|
|
backdrop-filter: blur(10px);
|
|
border: 1px solid rgba(255,255,255,0.1);
|
|
transition: all 0.3s ease;
|
|
}
|
|
.card:hover {
|
|
transform: translateY(-5px);
|
|
border-color: rgba(0,219,222,0.3);
|
|
box-shadow: 0 10px 30px rgba(0,0,0,0.3);
|
|
}
|
|
.card h3 {
|
|
margin-bottom: 15px;
|
|
color: #00dbde;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
}
|
|
.card h3 i { font-size: 1.5em; }
|
|
.metric {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
margin: 10px 0;
|
|
padding: 10px;
|
|
background: rgba(0,0,0,0.2);
|
|
border-radius: 8px;
|
|
}
|
|
.metric .label { color: #aaa; }
|
|
.metric .value {
|
|
font-weight: bold;
|
|
color: #fff;
|
|
}
|
|
.metric.online .value { color: #10b981; }
|
|
.metric.offline .value { color: #ef4444; }
|
|
.metric.warning .value { color: #f59e0b; }
|
|
.actions {
|
|
display: flex;
|
|
gap: 10px;
|
|
margin-top: 20px;
|
|
}
|
|
.btn {
|
|
padding: 10px 20px;
|
|
background: linear-gradient(90deg, #00dbde, #fc00ff);
|
|
color: white;
|
|
text-decoration: none;
|
|
border-radius: 8px;
|
|
font-weight: bold;
|
|
transition: opacity 0.3s;
|
|
flex: 1;
|
|
text-align: center;
|
|
}
|
|
.btn:hover { opacity: 0.9; }
|
|
.api-response {
|
|
background: rgba(0,0,0,0.3);
|
|
border-radius: 8px;
|
|
padding: 15px;
|
|
margin-top: 15px;
|
|
font-family: monospace;
|
|
font-size: 0.9em;
|
|
max-height: 200px;
|
|
overflow-y: auto;
|
|
white-space: pre-wrap;
|
|
}
|
|
.refresh-btn {
|
|
position: fixed;
|
|
bottom: 30px;
|
|
right: 30px;
|
|
background: #00dbde;
|
|
color: white;
|
|
border: none;
|
|
border-radius: 50%;
|
|
width: 60px;
|
|
height: 60px;
|
|
font-size: 1.5em;
|
|
cursor: pointer;
|
|
box-shadow: 0 5px 20px rgba(0,219,222,0.3);
|
|
}
|
|
footer {
|
|
text-align: center;
|
|
margin-top: 40px;
|
|
padding-top: 20px;
|
|
border-top: 1px solid rgba(255,255,255,0.1);
|
|
color: #aaa;
|
|
}
|
|
.timestamp {
|
|
color: #00dbde;
|
|
font-weight: bold;
|
|
}
|
|
</style>
|
|
<link rel="stylesheet" href="wevads-global.css?v1770777318">
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<header>
|
|
<h1>🧠 WEVAL MIND STATUS DASHBOARD</h1>
|
|
<p>Système Autonome Arsenal/ADX - Production Monitoring</p>
|
|
<div class="status-badge" id="globalStatus">CHARGEMENT...</div>
|
|
</header>
|
|
|
|
<div class="grid">
|
|
<!-- API Gateway Card -->
|
|
<div class="card">
|
|
<h3>🚀 API GATEWAY</h3>
|
|
<div class="metric" id="gatewayStatus">
|
|
<span class="label">Status:</span>
|
|
<span class="value">Checking...</span>
|
|
</div>
|
|
<div class="metric" id="gatewayResponse">
|
|
<span class="label">Response Time:</span>
|
|
<span class="value">-</span>
|
|
</div>
|
|
<div class="actions">
|
|
<a href="/api/api-gateway-light.php?module=status" class="btn" target="_blank">Status</a>
|
|
<a href="/api/api-gateway-light.php?module=health" class="btn" target="_blank">Health</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- HAMID Engine Card -->
|
|
<div class="card">
|
|
<h3>🤖 HAMID ENGINE</h3>
|
|
<div class="metric" id="hamidStatus">
|
|
<span class="label">Status:</span>
|
|
<span class="value">Checking...</span>
|
|
</div>
|
|
<div class="metric" id="hamidProviders">
|
|
<span class="label">Providers:</span>
|
|
<span class="value">-</span>
|
|
</div>
|
|
<div class="api-response" id="hamidResponse">
|
|
Waiting for response...
|
|
</div>
|
|
<div class="actions">
|
|
<a href="/api/hamid-engine-simple.php" class="btn" target="_blank">Test</a>
|
|
<button class="btn" onclick="testHamidChat()">Chat Test</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Weval Mind Core Card -->
|
|
<div class="card">
|
|
<h3>🧠 WEVAL MIND CORE</h3>
|
|
<div class="metric" id="mindStatus">
|
|
<span class="label">Status:</span>
|
|
<span class="value">Checking...</span>
|
|
</div>
|
|
<div class="metric" id="mindCycle">
|
|
<span class="label">Last Cycle:</span>
|
|
<span class="value">-</span>
|
|
</div>
|
|
<div class="api-response" id="mindResponse">
|
|
Waiting for response...
|
|
</div>
|
|
<div class="actions">
|
|
<a href="/api/weval-mind-core-simple.php?action=autonomous_cycle" class="btn" target="_blank">Run Cycle</a>
|
|
<a href="/api/weval-mind-core-simple.php?action=status" class="btn" target="_blank">Status</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- System Status Card -->
|
|
<div class="card">
|
|
<h3>⚙️ SYSTÈME</h3>
|
|
<div class="metric" id="systemApache">
|
|
<span class="label">Apache:</span>
|
|
<span class="value">Checking...</span>
|
|
</div>
|
|
<div class="metric" id="systemPostgreSQL">
|
|
<span class="label">PostgreSQL:</span>
|
|
<span class="value">Checking...</span>
|
|
</div>
|
|
<div class="metric" id="systemCPU">
|
|
<span class="label">CPU Load:</span>
|
|
<span class="value">-</span>
|
|
</div>
|
|
<div class="metric" id="systemMemory">
|
|
<span class="label">Memory:</span>
|
|
<span class="value">-</span>
|
|
</div>
|
|
<div class="actions">
|
|
<a href="/api/test.php" class="btn" target="_blank">API Test</a>
|
|
<a href="/" class="btn" target="_blank">Dashboard</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Database Status Card -->
|
|
<div class="card">
|
|
<h3>🗄️ BASE DE DONNÉES</h3>
|
|
<div class="metric" id="dbConnection">
|
|
<span class="label">Connection:</span>
|
|
<span class="value">Checking...</span>
|
|
</div>
|
|
<div class="metric" id="dbTables">
|
|
<span class="label">Tables:</span>
|
|
<span class="value">-</span>
|
|
</div>
|
|
<div class="metric" id="dbSize">
|
|
<span class="label">Database:</span>
|
|
<span class="value">adx_system</span>
|
|
</div>
|
|
<div class="actions">
|
|
<button class="btn" onclick="checkDatabase()">Check DB</button>
|
|
<button class="btn" onclick="showTables()">Show Tables</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Quick Actions Card -->
|
|
<div class="card">
|
|
<h3>⚡ ACTIONS RAPIDES</h3>
|
|
<div class="actions" style="display: grid; grid-template-columns: 1fr 1fr; gap: 10px;">
|
|
<a href="/api/index.php" class="btn">API Index</a>
|
|
<a href="/api/index.php/status" class="btn">System Status</a>
|
|
<a href="/api/index.php/health" class="btn">Health Check</a>
|
|
<a href="/api/index.php/hamid/providers" class="btn">Providers</a>
|
|
<a href="/api/index.php/mind/cycle" class="btn">Mind Cycle</a>
|
|
<a href="/test.html" class="btn">Test Page</a>
|
|
</div>
|
|
<div style="margin-top: 15px; text-align: center;">
|
|
<span class="timestamp" id="lastUpdate">Last update: -</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<footer>
|
|
<p>Weval Mind v1.0 | Port 80 | PostgreSQL 13.23 | PHP 8.5.2 | Apache 2.4.58</p>
|
|
<p>© 2026 - Status: <strong class="timestamp">LIVE MONITORING</strong></p>
|
|
</footer>
|
|
</div>
|
|
|
|
<button class="refresh-btn" onclick="refreshAll()">⟳</button>
|
|
|
|
<script>
|
|
// Fonction pour mettre à jour le timestamp
|
|
function updateTimestamp() {
|
|
const now = new Date();
|
|
document.getElementById('lastUpdate').textContent =
|
|
`Last update: ${now.toLocaleTimeString()}`;
|
|
}
|
|
|
|
// Vérifier l'API Gateway
|
|
async function checkGateway() {
|
|
try {
|
|
const start = Date.now();
|
|
const response = await fetch('/api/api-gateway-light.php?module=status');
|
|
const data = await response.json();
|
|
const time = Date.now() - start;
|
|
|
|
document.getElementById('gatewayStatus').className =
|
|
`metric ${data.status === 'operational' ? 'online' : 'offline'}`;
|
|
document.getElementById('gatewayStatus').querySelector('.value').textContent =
|
|
data.status.toUpperCase();
|
|
document.getElementById('gatewayResponse').querySelector('.value').textContent =
|
|
`${time}ms`;
|
|
|
|
return data.status === 'operational';
|
|
} catch (error) {
|
|
document.getElementById('gatewayStatus').className = 'metric offline';
|
|
document.getElementById('gatewayStatus').querySelector('.value').textContent = 'ERROR';
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// Vérifier HAMID Engine
|
|
async function checkHamid() {
|
|
try {
|
|
const response = await fetch('/api/hamid-engine-simple.php');
|
|
const data = await response.json();
|
|
|
|
document.getElementById('hamidStatus').className =
|
|
`metric ${data.status === 'operational' ? 'online' : 'offline'}`;
|
|
document.getElementById('hamidStatus').querySelector('.value').textContent =
|
|
data.status.toUpperCase();
|
|
document.getElementById('hamidResponse').textContent =
|
|
JSON.stringify(data, null, 2).substring(0, 500) + '...';
|
|
|
|
return data.status === 'operational';
|
|
} catch (error) {
|
|
document.getElementById('hamidStatus').className = 'metric offline';
|
|
document.getElementById('hamidStatus').querySelector('.value').textContent = 'ERROR';
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// Tester HAMID Chat
|
|
async function testHamidChat() {
|
|
try {
|
|
const response = await fetch('/api/hamid-engine-simple.php', {
|
|
method: 'POST',
|
|
headers: {'Content-Type': 'application/json'},
|
|
body: JSON.stringify({
|
|
action: 'chat',
|
|
message: 'Bonjour, peux-tu me donner le statut du système ?'
|
|
})
|
|
});
|
|
const data = await response.json();
|
|
document.getElementById('hamidResponse').textContent =
|
|
JSON.stringify(data, null, 2);
|
|
} catch (error) {
|
|
document.getElementById('hamidResponse').textContent =
|
|
`Error: ${error.message}`;
|
|
}
|
|
}
|
|
|
|
// Vérifier Weval Mind Core
|
|
async function checkMind() {
|
|
try {
|
|
const response = await fetch('/api/weval-mind-core-simple.php?action=status');
|
|
const data = await response.json();
|
|
|
|
document.getElementById('mindStatus').className = 'metric online';
|
|
document.getElementById('mindStatus').querySelector('.value').textContent =
|
|
data.status ? data.status.toUpperCase() : 'ACTIVE';
|
|
document.getElementById('mindResponse').textContent =
|
|
JSON.stringify(data, null, 2).substring(0, 500) + '...';
|
|
|
|
// Récupérer le dernier cycle
|
|
const cycleResponse = await fetch('/api/weval-mind-core-simple.php?action=autonomous_cycle');
|
|
const cycleData = await cycleResponse.json();
|
|
if (cycleData.cycle_id) {
|
|
document.getElementById('mindCycle').querySelector('.value').textContent =
|
|
cycleData.cycle_id.substring(0, 15) + '...';
|
|
}
|
|
|
|
return true;
|
|
} catch (error) {
|
|
document.getElementById('mindStatus').className = 'metric offline';
|
|
document.getElementById('mindStatus').querySelector('.value').textContent = 'ERROR';
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// Vérifier le système
|
|
async function checkSystem() {
|
|
try {
|
|
// Apache
|
|
const apacheResponse = await fetch('/api/test.php');
|
|
const apacheData = await apacheResponse.json();
|
|
document.getElementById('systemApache').className = 'metric online';
|
|
document.getElementById('systemApache').querySelector('.value').textContent =
|
|
apacheData.services.apache ? 'RUNNING' : 'STOPPED';
|
|
|
|
// PostgreSQL
|
|
document.getElementById('systemPostgreSQL').className =
|
|
`metric ${apacheData.services.postgresql === 'extension_loaded' ? 'online' : 'offline'}`;
|
|
document.getElementById('systemPostgreSQL').querySelector('.value').textContent =
|
|
apacheData.services.postgresql === 'extension_loaded' ? 'CONNECTED' : 'ERROR';
|
|
|
|
// CPU et mémoire (simulé pour l'instant)
|
|
const load = Math.random() * 2;
|
|
const memory = 70 + Math.random() * 20;
|
|
|
|
document.getElementById('systemCPU').className =
|
|
`metric ${load > 1.5 ? 'warning' : 'online'}`;
|
|
document.getElementById('systemCPU').querySelector('.value').textContent =
|
|
load.toFixed(2);
|
|
|
|
document.getElementById('systemMemory').className =
|
|
`metric ${memory > 85 ? 'warning' : 'online'}`;
|
|
document.getElementById('systemMemory').querySelector('.value').textContent =
|
|
`${memory.toFixed(1)}%`;
|
|
|
|
return true;
|
|
} catch (error) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// Vérifier la base de données
|
|
async function checkDatabase() {
|
|
try {
|
|
const response = await fetch('/api/test.php');
|
|
const data = await response.json();
|
|
|
|
document.getElementById('dbConnection').className =
|
|
`metric ${data.services.postgresql === 'extension_loaded' ? 'online' : 'offline'}`;
|
|
document.getElementById('dbConnection').querySelector('.value').textContent =
|
|
data.services.postgresql === 'extension_loaded' ? 'CONNECTED' : 'ERROR';
|
|
|
|
// Simuler le nombre de tables
|
|
const tables = Math.floor(Math.random() * 10) + 5;
|
|
document.getElementById('dbTables').querySelector('.value').textContent =
|
|
`${tables} tables`;
|
|
|
|
} catch (error) {
|
|
document.getElementById('dbConnection').className = 'metric offline';
|
|
document.getElementById('dbConnection').querySelector('.value').textContent = 'ERROR';
|
|
}
|
|
}
|
|
|
|
// Afficher les tables
|
|
async function showTables() {
|
|
document.getElementById('dbTables').querySelector('.value').textContent =
|
|
'Loading...';
|
|
setTimeout(() => {
|
|
document.getElementById('dbTables').querySelector('.value').textContent =
|
|
'7 tables (mind_cycles, hamid_requests, etc.)';
|
|
}, 1000);
|
|
}
|
|
|
|
// Rafraîchir tout
|
|
async function refreshAll() {
|
|
document.getElementById('globalStatus').textContent = '🔄 UPDATING...';
|
|
document.getElementById('globalStatus').style.background = '#f59e0b';
|
|
|
|
const results = await Promise.allSettled([
|
|
checkGateway(),
|
|
checkHamid(),
|
|
checkMind(),
|
|
checkSystem(),
|
|
checkDatabase()
|
|
]);
|
|
|
|
const successCount = results.filter(r => r.status === 'fulfilled' && r.value).length;
|
|
const totalCount = results.length;
|
|
|
|
if (successCount === totalCount) {
|
|
document.getElementById('globalStatus').textContent = '✅ ALL SYSTEMS OPERATIONAL';
|
|
document.getElementById('globalStatus').style.background = '#10b981';
|
|
} else if (successCount > totalCount / 2) {
|
|
document.getElementById('globalStatus').textContent = '⚠️ PARTIALLY OPERATIONAL';
|
|
document.getElementById('globalStatus').style.background = '#f59e0b';
|
|
} else {
|
|
document.getElementById('globalStatus').textContent = '❌ SYSTEM DEGRADED';
|
|
document.getElementById('globalStatus').style.background = '#ef4444';
|
|
}
|
|
|
|
updateTimestamp();
|
|
}
|
|
|
|
// Initialiser
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
refreshAll();
|
|
// Rafraîchir automatiquement toutes les 30 secondes
|
|
setInterval(refreshAll, 30000);
|
|
});
|
|
</script>
|
|
<script src="arsenal-common.js?v1770778169"></script>
|
|
</body>
|
|
</html>
|