diff --git a/service_events.json b/service_events.json index 2d1e110..49eaaee 100644 --- a/service_events.json +++ b/service_events.json @@ -1,4 +1,180 @@ [ + { + "service": "php:5.6.40", + "action": "start", + "status": "success", + "id": "ip2wf8j95", + "timestamp": 1775131231041 + }, + { + "service": "php:7.4.33", + "action": "start", + "status": "success", + "id": "brta3j7bf", + "timestamp": 1775131231014 + }, + { + "service": "php:8.2.30", + "action": "start", + "status": "success", + "id": "3i8vcjvbv", + "timestamp": 1775131230996 + }, + { + "service": "php:8.5.4", + "action": "start", + "status": "success", + "id": "ppygpqvhx", + "timestamp": 1775131230979 + }, + { + "service": "mariadb:10.11.8", + "action": "start", + "status": "success", + "id": "n0g8i2avo", + "timestamp": 1775131230537 + }, + { + "service": "mariadb:11.4.2", + "action": "start", + "status": "success", + "id": "02we1vlvr", + "timestamp": 1775131230516 + }, + { + "service": "apache", + "action": "start", + "status": "success", + "id": "1jpcki5fc", + "timestamp": 1775131229986 + }, + { + "service": "nginx", + "action": "start", + "status": "success", + "id": "3rigad9dj", + "timestamp": 1775131229925 + }, + { + "service": "mariadb:10.11.8", + "action": "exit", + "status": "failure", + "details": "Exit code: null", + "id": "nn66e97ys", + "timestamp": 1775131224313 + }, + { + "service": "mariadb:11.4.2", + "action": "exit", + "status": "failure", + "details": "Exit code: null", + "id": "pbmy1sua2", + "timestamp": 1775131224306 + }, + { + "service": "php:5.6.40", + "action": "exit", + "status": "failure", + "details": "Exit code: null", + "id": "21csoq0zp", + "timestamp": 1775131224296 + }, + { + "service": "php:7.4.33", + "action": "exit", + "status": "failure", + "details": "Exit code: null", + "id": "tfq0icf4v", + "timestamp": 1775131224289 + }, + { + "service": "php:8.2.30", + "action": "exit", + "status": "failure", + "details": "Exit code: null", + "id": "keraic95e", + "timestamp": 1775131224281 + }, + { + "service": "php:8.5.4", + "action": "exit", + "status": "failure", + "details": "Exit code: null", + "id": "5yfeqf3ni", + "timestamp": 1775131224274 + }, + { + "service": "apache", + "action": "exit", + "status": "failure", + "details": "Exit code: null", + "id": "sybx4mc6m", + "timestamp": 1775131224235 + }, + { + "service": "nginx", + "action": "exit", + "status": "failure", + "details": "Exit code: null", + "id": "lpmb34l47", + "timestamp": 1775131224222 + }, + { + "service": "mariadb:10.11.8", + "action": "stop", + "status": "info", + "id": "sgmy1tqyr", + "timestamp": 1775131224213 + }, + { + "service": "mariadb:11.4.2", + "action": "stop", + "status": "info", + "id": "jkh1z3y1a", + "timestamp": 1775131224196 + }, + { + "service": "php:5.6.40", + "action": "stop", + "status": "info", + "id": "sjoit37nw", + "timestamp": 1775131224184 + }, + { + "service": "php:7.4.33", + "action": "stop", + "status": "info", + "id": "dl2pmnf64", + "timestamp": 1775131224171 + }, + { + "service": "php:8.2.30", + "action": "stop", + "status": "info", + "id": "qi4jcjjis", + "timestamp": 1775131224159 + }, + { + "service": "php:8.5.4", + "action": "stop", + "status": "info", + "id": "gu69r9z5l", + "timestamp": 1775131224145 + }, + { + "service": "apache", + "action": "stop", + "status": "info", + "id": "o4py4bflp", + "timestamp": 1775131224131 + }, + { + "service": "nginx", + "action": "stop", + "status": "info", + "id": "ne32x4sul", + "timestamp": 1775131224124 + }, { "service": "php:5.6.40", "action": "start", diff --git a/src/main/ipc/index.ts b/src/main/ipc/index.ts index 335fd5a..7d7bdca 100644 --- a/src/main/ipc/index.ts +++ b/src/main/ipc/index.ts @@ -1182,4 +1182,23 @@ export function registerIpcHandlers(): void { rootPass: rootPass || '' }, dbName, savePath, compress, (msg) => log(msg)) }) + + ipcMain.handle('services:get-events', async () => { + try { + return serviceEventLogger.getEvents() + } catch (error: any) { + console.error('Failed to get events:', error) + return [] + } + }) + + ipcMain.handle('services:clear-events', async () => { + try { + serviceEventLogger.clear() + return { success: true } + } catch (error: any) { + console.error('Failed to clear events:', error) + return { success: false, message: error.message } + } + }) } diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index 78e8178..75dc9a9 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -79,7 +79,8 @@ import { Handyman as ToolsIcon, Restore as ResetIcon, Search as SearchIcon, - Tune as TuningIcon + Tune as TuningIcon, + History as HistoryIcon } from '@mui/icons-material' import Swal from 'sweetalert2' import { useTranslation } from 'react-i18next' @@ -91,6 +92,7 @@ import NginxCodeEditor from './components/NginxCodeEditor' import ApacheCodeEditor from './components/ApacheCodeEditor' import PhpExtensionManager from './components/PhpExtensionManager' import ServerTuning from './components/ServerTuning' +import ServiceEventMonitor from './components/ServiceEventMonitor' declare global { interface Window { @@ -1141,6 +1143,12 @@ function App(): JSX.Element { + + setActiveTab('event_monitor')}> + + + + @@ -1150,6 +1158,7 @@ function App(): JSX.Element { {activeTab === 'tuning' && } {activeTab === 'db_manager' && } + {activeTab === 'event_monitor' && } {activeTab === 'settings' && ( diff --git a/src/renderer/src/locales/en.json b/src/renderer/src/locales/en.json index fcbef45..6a01906 100644 --- a/src/renderer/src/locales/en.json +++ b/src/renderer/src/locales/en.json @@ -309,7 +309,7 @@ } }, "service_monitor": { - "title": "Service Monitor", + "title": "Service Logs", "desc": "Track the start, stop, and error history of services.", "event_log": "Event Log", "clear_confirm": "Are you sure you want to clear the entire event history?", diff --git a/src/renderer/src/locales/tr.json b/src/renderer/src/locales/tr.json index 872d129..5db5a51 100644 --- a/src/renderer/src/locales/tr.json +++ b/src/renderer/src/locales/tr.json @@ -304,7 +304,7 @@ } }, "service_monitor": { - "title": "Servis İzleyici", + "title": "Servis Logları", "desc": "Servislerin başlama, durma ve hata geçmişini takip edin.", "event_log": "Olay Günlüğü", "clear_confirm": "Tüm olay geçmişini silmek istediğinize emin misiniz?",