feat: implement backend configuration service and initialize main application UI components

This commit is contained in:
Ümit Tunç
2026-03-30 09:13:55 +03:00
parent d7ff7ecfa9
commit d15b10a012
6 changed files with 30 additions and 4 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ http {
keepalive_timeout 65; keepalive_timeout 65;
server { server {
listen {{PORT}}; listen {{LISTEN_ADDRESS}}:{{PORT}};
server_name localhost; server_name localhost;
root "{{ROOT}}"; root "{{ROOT}}";
index index.php index.html index.htm; index index.php index.html index.htm;
+1 -1
View File
@@ -11,5 +11,5 @@
"4.4.9": 9009, "4.4.9": 9009,
"3.0.x (latest)": 9010 "3.0.x (latest)": 9010
}, },
"mysql": {} "mariadb": {}
} }
+5 -2
View File
@@ -1,7 +1,10 @@
{ {
"nginxPort": "80", "nginxPort": "80",
"phpPort": "9001", "phpPort": "9001",
"mariaDbPort": "3306",
"mariaDbPorts": {},
"allowRemoteAccess": true,
"language": "tr",
"mysqlPort": "3306", "mysqlPort": "3306",
"mysqlPorts": {}, "mysqlPorts": {}
"language": "tr"
} }
+1
View File
@@ -91,6 +91,7 @@ async function rebuildNginxConfig(forceProjects: boolean = false): Promise<{ bin
const configPath = await configService.generateConfig('nginx.conf.template', 'nginx.conf', { const configPath = await configService.generateConfig('nginx.conf.template', 'nginx.conf', {
PORT: settings.nginxPort, PORT: settings.nginxPort,
LISTEN_ADDRESS: settings.allowRemoteAccess ? '0.0.0.0' : '127.0.0.1',
PHP_PORT: settings.phpPort, PHP_PORT: settings.phpPort,
ROOT: rootPath, ROOT: rootPath,
LOG_DIR: logDir.replace(/\\/g, '/'), LOG_DIR: logDir.replace(/\\/g, '/'),
+1
View File
@@ -11,6 +11,7 @@ export class ConfigService {
phpPort: '9001', phpPort: '9001',
mariaDbPort: '3306', mariaDbPort: '3306',
mariaDbPorts: {} as Record<string, string>, mariaDbPorts: {} as Record<string, string>,
allowRemoteAccess: false,
language: 'tr' language: 'tr'
} }
+21
View File
@@ -19,6 +19,7 @@ import {
Paper, Paper,
Chip, Chip,
Switch, Switch,
FormControlLabel,
Button, Button,
Snackbar, Snackbar,
Alert, Alert,
@@ -92,6 +93,7 @@ interface AppSettings {
phpPort: string phpPort: string
mariaDbPort: string mariaDbPort: string
mariaDbPorts?: Record<string, string> mariaDbPorts?: Record<string, string>
allowRemoteAccess: boolean
language: string language: string
} }
@@ -116,6 +118,7 @@ function App(): JSX.Element {
nginxPort: '80', nginxPort: '80',
phpPort: '9001', phpPort: '9001',
mariaDbPort: '3306', mariaDbPort: '3306',
allowRemoteAccess: false,
language: 'tr' language: 'tr'
}) })
const [notification, setNotification] = useState<{ open: boolean, message: string, severity: 'success' | 'error' }>({ const [notification, setNotification] = useState<{ open: boolean, message: string, severity: 'success' | 'error' }>({
@@ -878,6 +881,24 @@ function App(): JSX.Element {
helperText="Varsayılan: 3306" helperText="Varsayılan: 3306"
/> />
</Box> </Box>
<Divider sx={{ my: 2, bgcolor: 'rgba(255,255,255,0.05)' }} />
<FormControlLabel
control={
<Switch
checked={settings.allowRemoteAccess}
onChange={(e) => {
const newSettings = { ...settings, allowRemoteAccess: e.target.checked }
setSettings(newSettings)
}}
/>
}
label="Dış Erişime İzin Ver (0.0.0.0)"
/>
<Typography variant="caption" color="text.secondary" sx={{ display: 'block' }}>
{settings.allowRemoteAccess
? "Sunucu yerel ağdaki diğer cihazlardan erişilebilir."
: "Sunucu sadece bu bilgisayardan (127.0.0.1) erişilebilir."}
</Typography>
</Paper> </Paper>
<Box sx={{ display: 'flex', justifyContent: 'flex-end' }}> <Box sx={{ display: 'flex', justifyContent: 'flex-end' }}>
<Button variant="contained" startIcon={<SaveIcon />} size="large" onClick={handleSaveSettings}> <Button variant="contained" startIcon={<SaveIcon />} size="large" onClick={handleSaveSettings}>