#!/usr/bin/env python3 """ Démarre le dashboard avec la version corrigée sur un port alternatif pour éviter le conflit avec le processus existant """ import os import sys from pathlib import Path # Ajouter le répertoire parent au path sys.path.insert(0, str(Path(__file__).parent)) # Changer vers le répertoire web_dashboard os.chdir('web_dashboard') # Modifier temporairement le port dans le code app_py_path = Path('app.py') app_content = app_py_path.read_text() # Remplacer le port 5001 par 5002 modified_content = app_content.replace('port=5001', 'port=5002') # Écrire le fichier temporaire temp_app_path = Path('app_fixed.py') temp_app_path.write_text(modified_content) print("🚀 Démarrage du dashboard corrigé sur le port 5002...") print("🌐 URL: http://127.0.0.1:5002") print("📊 API Sessions: http://127.0.0.1:5002/api/agent/sessions") print("=" * 60) # Exécuter le dashboard corrigé os.system('python app_fixed.py')