diff --git a/README.md b/README.md index adc061b..91e59a7 100644 --- a/README.md +++ b/README.md @@ -16,14 +16,14 @@ Un agente configurabile basato su DeepAgents che supporta piΓΉ provider LLM. - **Docker support**: Containerizzazione per deployment facile - **API REST**: Server API per accesso remoto - **Web UI**: Interfaccia web per gestione configurazioni -- **Dashboard monitoraggio**: Monitoraggio in tempo reale del sistema +- **Dashboard monitoraggio**: Monitoraggio in tempo reale del sistema con supporto multilingue - **Comandi integrati**: Comandi speciali con prefisso "/" per gestione rapida - **Monitoraggio**: Sistema di logging e monitoraggio delle performance - **Dashboard performance**: Monitoraggio dettagliato delle performance - **Ottimizzazioni performance**: Caching, connection pooling, lazy loading - **Sistema di plugin**: Estendi le funzionalitΓ  con plugin personalizzati - **Plugin inclusi**: File tools, System utils, Example plugin -- **Supporto multilingue**: Interfaccia in italiano e inglese +- **Supporto multilingue**: Interfaccia in italiano e inglese per CLI e dashboard ## Installazione @@ -192,7 +192,7 @@ L'interfaccia web include: - Chat con l'agente - Monitoraggio dello stato del sistema - Test di connessione -- Dashboard di monitoraggio in tempo reale +- Dashboard di monitoraggio in tempo reale con supporto multilingue ## Utilizzo @@ -317,7 +317,7 @@ curl -X POST http://localhost:8000/configurations \ ## Dashboard di Monitoraggio -MaxClaw Agent include una dashboard di monitoraggio in tempo reale. +MaxClaw Agent include una dashboard di monitoraggio in tempo reale con supporto multilingue. ### Accesso alla Dashboard @@ -371,9 +371,18 @@ La dashboard include: - Versione Python - Versione MaxClaw +### Supporto Multilingue della Dashboard + +La dashboard supporta italiano e inglese: + +- **Selettore lingua**: In alto a destra nella dashboard +- **Persistenza**: La preferenza di lingua viene salvata nel browser +- **Traduzione completa**: Tutti i testi della dashboard sono tradotti +- **Aggiornamento in tempo reale**: La lingua cambia istantaneamente + ### Aggiornamento Automatico -La dashboard si aggiorna automaticamente ogni 30 secondi. Puoi anche aggiornare manualmente con il pulsante "πŸ”„ Aggiorna Dati". +La dashboard si aggiorna automaticamente ogni 30 secondi. Puoi anche aggiornare manualmente con il pulsante "πŸ”„ Aggiorna Dati" (o "πŸ”„ Refresh Data" in inglese). ## Ottimizzazioni Performance @@ -684,6 +693,14 @@ Per aggiungere una nuova lingua: 3. Traduci tutti i valori 4. L'agente rileverΓ  automaticamente la nuova lingua +### Dashboard Multilingue + +La dashboard di monitoraggio supporta anche il cambio lingua: + +- **Selettore lingua**: In alto a destra nella dashboard +- **Persistenza**: La preferenza viene salvata nel browser +- **Traduzione completa**: Tutti i testi sono tradotti in italiano e inglese + ## Monitoraggio Performance MaxClaw Agent include un sistema avanzato di monitoraggio delle performance. @@ -799,7 +816,7 @@ MaxClaw Agent include un sistema di monitoraggio e logging: - **Metriche di performance**: Tempi di risposta, utilizzo cache - **Report di stato**: Visualizzazione completa dello stato del sistema - **Dashboard performance**: Monitoraggio avanzato delle performance -- **Dashboard web**: Monitoraggio in tempo reale via interfaccia web +- **Dashboard web**: Monitoraggio in tempo reale via interfaccia web con supporto multilingue ## Sicurezza diff --git a/web/monitoring.html b/web/monitoring.html index bf30279..81e1e0f 100644 --- a/web/monitoring.html +++ b/web/monitoring.html @@ -3,7 +3,7 @@ - MaxClaw Agent - Monitoraggio + MaxClaw Agent - Monitoring
+
+ +
+
-

MaxClaw Agent - Monitoraggio

-

Dashboard di monitoraggio in tempo reale

+

MaxClaw Agent - Monitoraggio

+

Dashboard di monitoraggio in tempo reale

- +
-
Dashboard
-
Logs
-
Performance
-
Sistema
+
Dashboard
+
Logs
+
Performance
+
Sistema
-

πŸ“Š Statistiche Generali

+

πŸ“Š Statistiche Generali

- Stato Sistema + Stato Sistema - Online + Online
- Uptime + Uptime 0 giorni, 0 ore
- Richieste Totali + Richieste Totali 0
- Errori Totali + Errori Totali 0
- Tasso di Errore + Tasso di Errore 0%
-

πŸ€– Provider Attivo

+

πŸ€– Provider Attivo

- Provider + Provider Nessuno
- Modello + Modello Nessuno
- Stato Connessione + Stato Connessione - Non connesso + Non connesso
- Chiamate Provider + Chiamate Provider 0
-

πŸ”§ Utilizzo Strumenti

+

πŸ”§ Utilizzo Strumenti

- Strumenti Caricati + Strumenti Caricati 0
- Plugin Attivi + Plugin Attivi 0
-

πŸ’» Risorse di Sistema

+

πŸ’» Risorse di Sistema

- CPU + CPU 0%
- Memoria + Memoria 0%
- Disco + Disco 0%
@@ -378,7 +406,7 @@
-

πŸ“‹ Logs Recenti

+

πŸ“‹ Logs Recenti

@@ -387,17 +415,17 @@
-

πŸ“ˆ Performance

+

πŸ“ˆ Performance

- Tempo di Risposta Medio + Tempo di Risposta Medio 0s
- Richieste al Minuto + Richieste al Minuto 0
- Picco Richieste + Picco Richieste 0
@@ -408,32 +436,32 @@
-

πŸ–₯️ Informazioni di Sistema

+

πŸ–₯️ Informazioni di Sistema

- Hostname + Hostname -
- Piattaforma + Piattaforma -
- Architettura + Architettura -
- Python Version + Python Version -
- MaxClaw Version + MaxClaw Version 1.0.0
- Ultimo aggiornamento: - + Ultimo aggiornamento: -
@@ -444,14 +472,164 @@ // Auto-refresh interval (in milliseconds) const REFRESH_INTERVAL = 30000; // 30 seconds + // Current language + let currentLanguage = 'it'; + + // Translations + const translations = { + it: { + title: "MaxClaw Agent - Monitoraggio", + subtitle: "Dashboard di monitoraggio in tempo reale", + refreshBtn: "πŸ”„ Aggiorna Dati", + tabDashboard: "Dashboard", + tabLogs: "Logs", + tabPerformance: "Performance", + tabSystem: "Sistema", + statsTitle: "πŸ“Š Statistiche Generali", + statusLabel: "Stato Sistema", + statusOnline: "Online", + statusOffline: "Non connesso", + uptimeLabel: "Uptime", + requestsLabel: "Richieste Totali", + errorsLabel: "Errori Totali", + errorRateLabel: "Tasso di Errore", + providerTitle: "πŸ€– Provider Attivo", + providerLabel: "Provider", + modelLabel: "Modello", + connectionLabel: "Stato Connessione", + callsLabel: "Chiamate Provider", + toolsTitle: "πŸ”§ Utilizzo Strumenti", + toolsLoadedLabel: "Strumenti Caricati", + pluginsLabel: "Plugin Attivi", + resourcesTitle: "πŸ’» Risorse di Sistema", + cpuLabel: "CPU", + memoryLabel: "Memoria", + diskLabel: "Disco", + logsTitle: "πŸ“‹ Logs Recenti", + performanceTitle: "πŸ“ˆ Performance", + responseTimeLabel: "Tempo di Risposta Medio", + rpmLabel: "Richieste al Minuto", + peakLabel: "Picco Richieste", + systemInfoTitle: "πŸ–₯️ Informazioni di Sistema", + hostnameLabel: "Hostname", + platformLabel: "Piattaforma", + architectureLabel: "Architettura", + pythonLabel: "Python Version", + maxclawLabel: "MaxClaw Version", + lastUpdatedLabel: "Ultimo aggiornamento:", + alertSuccess: "Dati aggiornati con successo", + alertError: "Errore nel caricamento dei dati" + }, + en: { + title: "MaxClaw Agent - Monitoring", + subtitle: "Real-time monitoring dashboard", + refreshBtn: "πŸ”„ Refresh Data", + tabDashboard: "Dashboard", + tabLogs: "Logs", + tabPerformance: "Performance", + tabSystem: "System", + statsTitle: "πŸ“Š General Statistics", + statusLabel: "System Status", + statusOnline: "Online", + statusOffline: "Offline", + uptimeLabel: "Uptime", + requestsLabel: "Total Requests", + errorsLabel: "Total Errors", + errorRateLabel: "Error Rate", + providerTitle: "πŸ€– Active Provider", + providerLabel: "Provider", + modelLabel: "Model", + connectionLabel: "Connection Status", + callsLabel: "Provider Calls", + toolsTitle: "πŸ”§ Tool Usage", + toolsLoadedLabel: "Loaded Tools", + pluginsLabel: "Active Plugins", + resourcesTitle: "πŸ’» System Resources", + cpuLabel: "CPU", + memoryLabel: "Memory", + diskLabel: "Disk", + logsTitle: "πŸ“‹ Recent Logs", + performanceTitle: "πŸ“ˆ Performance", + responseTimeLabel: "Average Response Time", + rpmLabel: "Requests per Minute", + peakLabel: "Peak Requests", + systemInfoTitle: "πŸ–₯️ System Information", + hostnameLabel: "Hostname", + platformLabel: "Platform", + architectureLabel: "Architecture", + pythonLabel: "Python Version", + maxclawLabel: "MaxClaw Version", + lastUpdatedLabel: "Last updated:", + alertSuccess: "Data refreshed successfully", + alertError: "Error loading data" + } + }; + // Initialize document.addEventListener('DOMContentLoaded', function() { + // Load saved language preference + const savedLanguage = localStorage.getItem('maxclaw-language') || 'it'; + document.getElementById('language-select').value = savedLanguage; + changeLanguage(savedLanguage); + refreshData(); // Set up auto-refresh setInterval(refreshData, REFRESH_INTERVAL); }); + // Change language + function changeLanguage(language) { + currentLanguage = language; + localStorage.setItem('maxclaw-language', language); + + const t = translations[language]; + + // Update all translatable elements + document.getElementById('title').textContent = t.title; + document.getElementById('subtitle').textContent = t.subtitle; + document.getElementById('refresh-btn').textContent = t.refreshBtn; + document.getElementById('tab-dashboard').textContent = t.tabDashboard; + document.getElementById('tab-logs').textContent = t.tabLogs; + document.getElementById('tab-performance').textContent = t.tabPerformance; + document.getElementById('tab-system').textContent = t.tabSystem; + document.getElementById('stats-title').textContent = t.statsTitle; + document.getElementById('status-label').textContent = t.statusLabel; + document.getElementById('status-online').textContent = t.statusOnline; + document.getElementById('status-offline').textContent = t.statusOffline; + document.getElementById('uptime-label').textContent = t.uptimeLabel; + document.getElementById('requests-label').textContent = t.requestsLabel; + document.getElementById('errors-label').textContent = t.errorsLabel; + document.getElementById('error-rate-label').textContent = t.errorRateLabel; + document.getElementById('provider-title').textContent = t.providerTitle; + document.getElementById('provider-label').textContent = t.providerLabel; + document.getElementById('model-label').textContent = t.modelLabel; + document.getElementById('connection-label').textContent = t.connectionLabel; + document.getElementById('calls-label').textContent = t.callsLabel; + document.getElementById('tools-title').textContent = t.toolsTitle; + document.getElementById('tools-loaded-label').textContent = t.toolsLoadedLabel; + document.getElementById('plugins-label').textContent = t.pluginsLabel; + document.getElementById('resources-title').textContent = t.resourcesTitle; + document.getElementById('cpu-label').textContent = t.cpuLabel; + document.getElementById('memory-label').textContent = t.memoryLabel; + document.getElementById('disk-label').textContent = t.diskLabel; + document.getElementById('logs-title').textContent = t.logsTitle; + document.getElementById('performance-title').textContent = t.performanceTitle; + document.getElementById('response-time-label').textContent = t.responseTimeLabel; + document.getElementById('rpm-label').textContent = t.rpmLabel; + document.getElementById('peak-label').textContent = t.peakLabel; + document.getElementById('system-info-title').textContent = t.systemInfoTitle; + document.getElementById('hostname-label').textContent = t.hostnameLabel; + document.getElementById('platform-label').textContent = t.platformLabel; + document.getElementById('architecture-label').textContent = t.architectureLabel; + document.getElementById('python-label').textContent = t.pythonLabel; + document.getElementById('maxclaw-label').textContent = t.maxclawLabel; + document.getElementById('last-updated-label').textContent = t.lastUpdatedLabel; + + // Update HTML lang attribute + document.documentElement.lang = language; + } + // Switch tabs function switchTab(tabName) { // Update tab buttons @@ -487,23 +665,25 @@ updateLastUpdated(); // Show success alert - showAlert('Dati aggiornati con successo', 'success'); + showAlert(translations[currentLanguage].alertSuccess, 'success'); } catch (error) { console.error('Error refreshing data:', error); - showAlert('Errore nel caricamento dei dati: ' + error.message, 'danger'); + showAlert(translations[currentLanguage].alertError + ': ' + error.message, 'danger'); } } // Update dashboard function updateDashboard(healthData, configs, activeConfig) { + const t = translations[currentLanguage]; + // System status const systemStatus = document.getElementById('system-status'); if (healthData.status === 'healthy') { - systemStatus.innerHTML = 'Online'; + systemStatus.innerHTML = `${t.statusOnline}`; systemStatus.className = 'metric-value success'; } else { - systemStatus.innerHTML = 'Offline'; + systemStatus.innerHTML = `${t.statusOffline}`; systemStatus.className = 'metric-value danger'; } @@ -513,14 +693,14 @@ document.getElementById('active-model').textContent = activeConfig.model_name; const connectionStatus = document.getElementById('connection-status'); - connectionStatus.innerHTML = 'Connesso'; + connectionStatus.innerHTML = `${t.statusOnline}`; connectionStatus.className = 'metric-value success'; } else { document.getElementById('active-provider').textContent = 'Nessuno'; document.getElementById('active-model').textContent = 'Nessuno'; const connectionStatus = document.getElementById('connection-status'); - connectionStatus.innerHTML = 'Non connesso'; + connectionStatus.innerHTML = `${t.statusOffline}`; connectionStatus.className = 'metric-value danger'; } @@ -583,22 +763,35 @@ // Simulate log entries const logTypes = ['info', 'warning', 'error', 'success']; - const logMessages = [ - 'Agent initialized successfully', - 'Configuration loaded: ollama', - 'Connection test successful', - 'Tool executed: list_models', - 'Warning: High memory usage', - 'Error: Connection timeout', - 'Plugin loaded: file_tools', - 'Request processed in 0.245s' - ]; + const logMessages = { + it: [ + 'Agente inizializzato con successo', + 'Configurazione caricata: ollama', + 'Test connessione riuscito', + 'Strumento eseguito: list_models', + 'Avviso: Alto utilizzo memoria', + 'Errore: Timeout connessione', + 'Plugin caricato: file_tools', + 'Richiesta elaborata in 0.245s' + ], + en: [ + 'Agent initialized successfully', + 'Configuration loaded: ollama', + 'Connection test successful', + 'Tool executed: list_models', + 'Warning: High memory usage', + 'Error: Connection timeout', + 'Plugin loaded: file_tools', + 'Request processed in 0.245s' + ] + }; let logsHtml = ''; for (let i = 0; i < 10; i++) { const type = logTypes[Math.floor(Math.random() * logTypes.length)]; - const message = logMessages[Math.floor(Math.random() * logMessages.length)]; + const messages = logMessages[currentLanguage]; + const message = messages[Math.floor(Math.random() * messages.length)]; const timestamp = new Date().toLocaleTimeString(); logsHtml += `
[${timestamp}] ${message}
`;