feat: implement core application UI and backend services for PHP environment management
This commit is contained in:
+17
-1
@@ -7,6 +7,7 @@ import { projectService } from '../services/ProjectService'
|
||||
import { phpManagerService } from '../services/PhpManagerService'
|
||||
import { mySqlManagerService } from '../services/MySqlManagerService'
|
||||
import { nginxManagerService } from '../services/NginxManagerService'
|
||||
import { phpMyAdminService } from '../services/PhpMyAdminService'
|
||||
import path from 'path'
|
||||
|
||||
function findExecutable(dir: string, name: string): string | null {
|
||||
@@ -58,7 +59,8 @@ export function registerIpcHandlers(): void {
|
||||
PHP_PORT: settings.phpPort,
|
||||
ROOT: rootPath,
|
||||
LOG_DIR: logDir.replace(/\\/g, '/'),
|
||||
CONF_DIR: confDir.replace(/\\/g, '/')
|
||||
CONF_DIR: confDir.replace(/\\/g, '/'),
|
||||
PHPMYADMIN_DIR: phpMyAdminService.getPath().replace(/\\/g, '/')
|
||||
})
|
||||
|
||||
// Test config first with prefix
|
||||
@@ -241,6 +243,9 @@ export function registerIpcHandlers(): void {
|
||||
ipcMain.handle('projects:remove', async (_event, id) => {
|
||||
return projectService.removeProject(id)
|
||||
})
|
||||
ipcMain.handle('projects:update', async (_event, project) => {
|
||||
return projectService.updateProject(project)
|
||||
})
|
||||
|
||||
// Config management
|
||||
ipcMain.handle('config:get', async () => {
|
||||
@@ -250,4 +255,15 @@ export function registerIpcHandlers(): void {
|
||||
ipcMain.handle('config:save', async (_event, config: any) => {
|
||||
return { success: true, settings: configService.updateSettings(config) }
|
||||
})
|
||||
|
||||
// phpMyAdmin
|
||||
ipcMain.handle('pma:status', async () => {
|
||||
return await phpMyAdminService.isInstalled()
|
||||
})
|
||||
|
||||
ipcMain.handle('pma:setup', async (event, mysqlPort: string) => {
|
||||
return await phpMyAdminService.setup(mysqlPort, (p) => {
|
||||
event.sender.send('pma:progress', p)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user