From 2413c19393671952fb7ab7a36bece4282d740fed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Cmit=20Tun=C3=A7?= Date: Fri, 3 Apr 2026 14:23:22 +0300 Subject: [PATCH] feat: implement UI components for PHP extension management, server tuning, and MariaDB database operations --- service_events.json | 176 ++++++++++++++++++ src/renderer/src/App.tsx | 40 +++- .../components/Dashboard/DashboardDetails.tsx | 8 +- .../src/components/MariaDbDatabaseManager.tsx | 4 +- .../src/components/MariaDbExportWizard.tsx | 10 +- .../src/components/MariaDbImportWizard.tsx | 10 +- .../src/components/PhpExtensionManager.tsx | 5 +- .../ProjectManager/ProjectDetails.tsx | 14 +- src/renderer/src/components/ServerTuning.tsx | 6 +- 9 files changed, 234 insertions(+), 39 deletions(-) diff --git a/service_events.json b/service_events.json index a0a68bb..f496842 100644 --- a/service_events.json +++ b/service_events.json @@ -1,4 +1,180 @@ [ + { + "service": "php:5.6.40", + "action": "start", + "status": "success", + "id": "lswj9e3dr", + "timestamp": 1775215366381 + }, + { + "service": "php:7.4.33", + "action": "start", + "status": "success", + "id": "ygy1lszgv", + "timestamp": 1775215366364 + }, + { + "service": "php:8.2.30", + "action": "start", + "status": "success", + "id": "uafoj8ms0", + "timestamp": 1775215366347 + }, + { + "service": "php:8.5.4", + "action": "start", + "status": "success", + "id": "9om7zwoix", + "timestamp": 1775215366330 + }, + { + "service": "mariadb:10.11.8", + "action": "start", + "status": "success", + "id": "iauegprtk", + "timestamp": 1775215365870 + }, + { + "service": "mariadb:11.4.2", + "action": "start", + "status": "success", + "id": "ub17l46ie", + "timestamp": 1775215365851 + }, + { + "service": "apache", + "action": "start", + "status": "success", + "id": "9s4gcc69m", + "timestamp": 1775215365334 + }, + { + "service": "nginx", + "action": "start", + "status": "success", + "id": "ejkeubl89", + "timestamp": 1775215365279 + }, + { + "service": "mariadb:10.11.8", + "action": "exit", + "status": "failure", + "details": "Exit code: 1", + "id": "15n8prhqk", + "timestamp": 1775215363028 + }, + { + "service": "mariadb:11.4.2", + "action": "exit", + "status": "failure", + "details": "Exit code: 1", + "id": "shkq1j2z6", + "timestamp": 1775215363020 + }, + { + "service": "php:8.5.4", + "action": "exit", + "status": "failure", + "details": "Exit code: 1", + "id": "ymicfo8vr", + "timestamp": 1775215363013 + }, + { + "service": "php:8.2.30", + "action": "exit", + "status": "failure", + "details": "Exit code: 1", + "id": "lj6mzphe2", + "timestamp": 1775215363006 + }, + { + "service": "php:5.6.40", + "action": "exit", + "status": "failure", + "details": "Exit code: 1", + "id": "jviowcog6", + "timestamp": 1775215363000 + }, + { + "service": "php:7.4.33", + "action": "exit", + "status": "failure", + "details": "Exit code: 1", + "id": "hrec85n0o", + "timestamp": 1775215362994 + }, + { + "service": "apache", + "action": "exit", + "status": "failure", + "details": "Exit code: 1", + "id": "ylz7lqxot", + "timestamp": 1775215362970 + }, + { + "service": "nginx", + "action": "exit", + "status": "failure", + "details": "Exit code: 1", + "id": "gt4zol9k7", + "timestamp": 1775215362967 + }, + { + "service": "php:5.6.40", + "action": "start", + "status": "success", + "id": "4561oqfbq", + "timestamp": 1775215165402 + }, + { + "service": "php:7.4.33", + "action": "start", + "status": "success", + "id": "rx3hglow7", + "timestamp": 1775215165361 + }, + { + "service": "php:8.2.30", + "action": "start", + "status": "success", + "id": "w0lba1icw", + "timestamp": 1775215165316 + }, + { + "service": "php:8.5.4", + "action": "start", + "status": "success", + "id": "at8cycpe4", + "timestamp": 1775215165295 + }, + { + "service": "mariadb:10.11.8", + "action": "start", + "status": "success", + "id": "68cfbobjp", + "timestamp": 1775215165182 + }, + { + "service": "mariadb:11.4.2", + "action": "start", + "status": "success", + "id": "e04xqdiud", + "timestamp": 1775215164897 + }, + { + "service": "apache", + "action": "start", + "status": "success", + "id": "q2ak9offn", + "timestamp": 1775215164330 + }, + { + "service": "nginx", + "action": "start", + "status": "success", + "id": "r19c607j0", + "timestamp": 1775215137764 + }, { "service": "php:5.6.40", "action": "start", diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index a8103a8..a48fb33 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -476,14 +476,27 @@ function App(): JSX.Element { if ((status[s]?.status || 'stopped') === 'stopped') setStatus(prev => ({ ...prev, [s]: { status: 'starting' } })) } - await Promise.all([ - ...criticalServices.filter(s => status[s]?.status !== 'running').map(s => window.api?.startService(s)), - ...phpToStart.filter(s => (status[s]?.status || 'stopped') !== 'running').map(s => window.api?.startService(s)), - ...mariaDbToStart.filter(s => (status[s]?.status || 'stopped') !== 'running').map(s => window.api?.startService(s)) + const results = await Promise.all([ + ...criticalServices.filter(s => status[s]?.status !== 'running').map(s => window.api?.startService(s).then((r: any) => ({ service: s, ...r }))), + ...phpToStart.filter(s => (status[s]?.status || 'stopped') !== 'running').map(s => window.api?.startService(s).then((r: any) => ({ service: s, ...r }))), + ...mariaDbToStart.filter(s => (status[s]?.status || 'stopped') !== 'running').map(s => window.api?.startService(s).then((r: any) => ({ service: s, ...r }))) ]) + const errors = results.filter(r => r && !r.success) + if (errors.length > 0) { + const errorList = errors.map(e => `${e.service}: ${e.message}`).join('
') + Swal.fire({ + title: t('common.error'), + html: `
${errorList}
`, + icon: 'error', + background: '#1e1e1e', + color: '#fff' + }) + } else { + setNotification({ open: true, message: t('dashboard.all_started'), severity: 'success' }) + } + fetchStatus() - setNotification({ open: true, message: t('dashboard.all_started'), severity: 'success' }) } const handleStopAll = async () => { @@ -498,12 +511,19 @@ function App(): JSX.Element { const result = await window.api.invoke('services:stop-all') + if (!result.success) { + Swal.fire({ + title: t('common.error'), + text: result.message, + icon: 'error', + background: '#1e1e1e', + color: '#fff' + }) + } else { + setNotification({ open: true, message: t('dashboard.all_stopped'), severity: 'success' }) + } + fetchStatus() - setNotification({ - open: true, - message: result.success ? t('dashboard.all_stopped') : result.message, - severity: result.success ? 'success' : 'error' - }) } const formatMemory = (bytes?: number) => { diff --git a/src/renderer/src/components/Dashboard/DashboardDetails.tsx b/src/renderer/src/components/Dashboard/DashboardDetails.tsx index aba02a4..dbeefb9 100644 --- a/src/renderer/src/components/Dashboard/DashboardDetails.tsx +++ b/src/renderer/src/components/Dashboard/DashboardDetails.tsx @@ -304,12 +304,12 @@ export default function DashboardDetails({ )} @@ -378,7 +378,7 @@ export default function DashboardDetails({ {activeTab === 'settings_live' ? 'php.ini (Aktif Konfigürasyon)' : getTemplateName()} @@ -266,7 +266,7 @@ const MariaDbDatabaseManager: React.FC = ({ version {t('mariadb_manager.users_title')} - diff --git a/src/renderer/src/components/MariaDbExportWizard.tsx b/src/renderer/src/components/MariaDbExportWizard.tsx index ba5ac18..d2e962e 100644 --- a/src/renderer/src/components/MariaDbExportWizard.tsx +++ b/src/renderer/src/components/MariaDbExportWizard.tsx @@ -210,7 +210,7 @@ const MariaDbExportWizard: React.FC = ({ open, onClose ), }} /> - + ) @@ -293,18 +293,18 @@ const MariaDbExportWizard: React.FC = ({ open, onClose )} {activeStep === 0 && ( - )} {activeStep === 1 && ( - + )} {activeStep === 2 && ( - + )} {activeStep === 3 && !exportResult && ( - )} diff --git a/src/renderer/src/components/MariaDbImportWizard.tsx b/src/renderer/src/components/MariaDbImportWizard.tsx index 0c9b370..49689b1 100644 --- a/src/renderer/src/components/MariaDbImportWizard.tsx +++ b/src/renderer/src/components/MariaDbImportWizard.tsx @@ -188,7 +188,7 @@ const MariaDbImportWizard: React.FC = ({ open, onClose ), }} /> - + ) @@ -337,18 +337,18 @@ const MariaDbImportWizard: React.FC = ({ open, onClose )} {activeStep === 0 && ( - + )} {activeStep === 1 && ( - + )} {activeStep === 2 && ( - )} {activeStep === 3 && !importResult && ( - )} diff --git a/src/renderer/src/components/PhpExtensionManager.tsx b/src/renderer/src/components/PhpExtensionManager.tsx index 0aba9b5..f3c1533 100644 --- a/src/renderer/src/components/PhpExtensionManager.tsx +++ b/src/renderer/src/components/PhpExtensionManager.tsx @@ -266,7 +266,7 @@ const PhpExtensionManager: React.FC = ({ open, onClose - @@ -331,7 +331,6 @@ const PhpExtensionManager: React.FC = ({ open, onClose @@ -340,7 +339,7 @@ const PhpExtensionManager: React.FC = ({ open, onClose @@ -284,14 +284,14 @@ export default function ProjectDetails({ {!isHostMapped && ( @@ -407,12 +407,12 @@ export default function ProjectDetails({ @@ -518,7 +518,7 @@ export default function ProjectDetails({ {t('common.refresh')} @@ -318,7 +318,7 @@ export default function ServerTuning() { MariaDB {v.version} Performance variables - @@ -410,7 +410,7 @@ export default function ServerTuning() { {t('common.cancel')}