setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch(Exception $e) { die("Erreur DB: " . $e->getMessage()); } // Charger config actuelle $config = $db->query("SELECT * FROM admin.brain_config ORDER BY id")->fetchAll(PDO::FETCH_ASSOC); ?> Brain Config Editor - WEVADS

🧠 Brain Config Editor

Configuration complète du système auto-réparant WEVADS
⚠️ ATTENTION: Modifications critiques système. Un backup automatique est créé avant chaque sauvegarde.

📋 Prompt Système Brain IA

Prompt Principal
Instructions système pour le Brain - Définit mission, règles, contexte

⚙️ Seuils & Limites

['label' => 'Seuil Disk Space (%)', 'desc' => 'Déclenchement nettoyage automatique'], 'memory_threshold' => ['label' => 'Seuil Memory (%)', 'desc' => 'Déclenchement restart services'], 'quota_threshold' => ['label' => 'Seuil Quota Warning (%)', 'desc' => 'Création alertes quotas'], 'log_retention_days' => ['label' => 'Rétention Logs (jours)', 'desc' => 'Suppression logs anciens'], 'error_timeout_hours' => ['label' => 'Timeout Serveur Error (heures)', 'desc' => 'Suppression serveurs en erreur prolongée'] ]; foreach ($thresholds as $key => $info) { $value_row = array_filter($config, fn($c) => $c['config_key'] === $key); $value = !empty($value_row) ? reset($value_row)['config_value'] : ''; echo "
{$info['label']}
{$info['desc']}
"; } ?>

🕒 Fréquences Routines (CRON)

['label' => 'auto_debug_routines', 'desc' => 'Format: */5 * * * * (minute heure jour mois jour_semaine)'], 'cron_proactive_monitor' => ['label' => 'proactive_monitor', 'desc' => 'Format: */10 * * * *'], 'cron_system_health' => ['label' => 'auto_system_health', 'desc' => 'Format: 0 * * * *'] ]; foreach ($frequencies as $key => $info) { $value_row = array_filter($config, fn($c) => $c['config_key'] === $key); $value = !empty($value_row) ? reset($value_row)['config_value'] : ''; echo "
{$info['label']}
{$info['desc']}
"; } ?>

📜 Historique Modifications

query(" SELECT * FROM admin.brain_config_history ORDER BY created_at DESC LIMIT 20 ")->fetchAll(PDO::FETCH_ASSOC); foreach ($history as $h) { echo "
"; echo "" . date('Y-m-d H:i:s', strtotime($h['created_at'])) . " - "; echo $h['action'] . " par " . ($h['modified_by'] ?? 'system'); if ($h['backup_data']) { echo " [Rollback]"; } echo "
"; } ?>