From 3627feac1c97cc27c79f99519ef5b25b142292ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Cmit=20Tun=C3=A7?= Date: Thu, 2 Apr 2026 00:42:20 +0300 Subject: [PATCH] feat: add Turkish and English localization files and initialize main application component --- src/renderer/src/App.tsx | 288 ++++++++++++++++++------------- src/renderer/src/locales/en.json | 1 + src/renderer/src/locales/tr.json | 4 +- 3 files changed, 173 insertions(+), 120 deletions(-) diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index bbc36d6..9eecb68 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -68,7 +68,8 @@ import { Language as HostIcon, Launch as LaunchIcon, Handyman as ToolsIcon, - Restore as ResetIcon + Restore as ResetIcon, + Search as SearchIcon } from '@mui/icons-material' import Swal from 'sweetalert2' import { useTranslation } from 'react-i18next' @@ -117,6 +118,7 @@ function App(): JSX.Element { mariadb: { status: 'stopped' } }) const [activeTab, setActiveTab] = useState('dashboard') + const [projectSearch, setProjectSearch] = useState('') const [settingsTab, setSettingsTab] = useState(0) const [dashboardTab, setDashboardTab] = useState(0) const [projects, setProjects] = useState([]) @@ -1536,10 +1538,40 @@ function App(): JSX.Element { {activeTab === 'projects' && ( - - + + {t('projects.title')} + setProjectSearch(e.target.value)} + sx={{ + minWidth: { sm: 300 }, + bgcolor: 'rgba(255, 255, 255, 0.03)', + borderRadius: 1, + '& .MuiOutlinedInput-root': { + color: '#fff', + '& fieldset': { borderColor: 'rgba(255, 255, 255, 0.1)' }, + '&:hover fieldset': { borderColor: 'rgba(255, 255, 255, 0.2)' }, + } + }} + InputProps={{ + startAdornment: ( + + + + ), + endAdornment: projectSearch && ( + + setProjectSearch('')} sx={{ color: 'rgba(255, 255, 255, 0.3)' }}> + + + + ) + }} + /> @@ -1549,126 +1581,144 @@ function App(): JSX.Element { {t('projects.empty')} - ) : ( - - {projects.map((project) => ( - - - - - - - - - - {project.name} - - - {project.path.length > 40 ? '...' + project.path.slice(-37) : project.path} - + ) : (() => { + const filteredProjects = projects.filter(p => + p.name.toLowerCase().includes(projectSearch.toLowerCase()) || + p.host.toLowerCase().includes(projectSearch.toLowerCase()) + ); + + if (filteredProjects.length === 0) { + return ( + + + + {t('common.not_found', 'Eşleşen proje bulunamadı')} + + + ); + } + + return ( + + {filteredProjects.map((project) => ( + + + + + + + + + + {project.name} + + + {project.path.length > 40 ? '...' + project.path.slice(-37) : project.path} + + - - - - { - setNewProject(project) - setIsProjectDialogOpen(true) - }} sx={{ color: 'rgba(255,255,255,0.4)', '&:hover': { color: '#39A7FF' } }}> - - - - {project.serverType !== 'apache' && ( - - handleOpenProjectNginxConfig(project.host)} sx={{ color: 'rgba(255,255,255,0.4)', '&:hover': { color: '#39A7FF' } }}> - + + + { + setNewProject(project) + setIsProjectDialogOpen(true) + }} sx={{ color: 'rgba(255,255,255,0.4)', '&:hover': { color: '#39A7FF' } }}> + + + + {project.serverType !== 'apache' && ( + + handleOpenProjectNginxConfig(project.host)} sx={{ color: 'rgba(255,255,255,0.4)', '&:hover': { color: '#39A7FF' } }}> + + + + )} + + handleRemoveProject(project.id)} sx={{ color: 'rgba(255,255,255,0.4)', '&:hover': { color: '#ff4444' } }}> + - )} - - handleRemoveProject(project.id)} sx={{ color: 'rgba(255,255,255,0.4)', '&:hover': { color: '#ff4444' } }}> - - - - - - - - - } - label={`PHP ${project.phpVersion}`} - sx={{ bgcolor: 'rgba(71, 74, 255, 0.1)', color: '#777bb4', fontWeight: 600, border: '1px solid rgba(71, 74, 255, 0.2)' }} - /> - : } - label={project.serverType === 'apache' ? 'Apache' : 'Nginx'} - sx={{ bgcolor: 'rgba(255, 255, 255, 0.05)', color: '#fff', fontWeight: 600 }} - /> - - - - - - - - - {project.host} - - - - - - - ))} - - )} + + + + + } + label={`PHP ${project.phpVersion}`} + sx={{ bgcolor: 'rgba(71, 74, 255, 0.1)', color: '#777bb4', fontWeight: 600, border: '1px solid rgba(71, 74, 255, 0.2)' }} + /> + : } + label={project.serverType === 'apache' ? 'Apache' : 'Nginx'} + sx={{ bgcolor: 'rgba(255, 255, 255, 0.05)', color: '#fff', fontWeight: 600 }} + /> + + + + + + + + + {project.host} + + + + + + + + ))} + + ) + })()} )} diff --git a/src/renderer/src/locales/en.json b/src/renderer/src/locales/en.json index 99329d3..1011dcc 100644 --- a/src/renderer/src/locales/en.json +++ b/src/renderer/src/locales/en.json @@ -62,6 +62,7 @@ "projects": { "title": "My Projects", "add_new": "Add New Project", + "search": "Search for project or host...", "edit": "Edit Project", "empty": "No projects added yet.", "name": "Project Name", diff --git a/src/renderer/src/locales/tr.json b/src/renderer/src/locales/tr.json index 2704f5a..11b09f2 100644 --- a/src/renderer/src/locales/tr.json +++ b/src/renderer/src/locales/tr.json @@ -62,6 +62,7 @@ "projects": { "title": "Projelerim", "add_new": "Yeni Proje Ekle", + "search": "Proje veya host ara...", "edit": "Proje Düzenle", "empty": "Henüz bir proje eklenmemiş.", "name": "Proje Adı", @@ -77,7 +78,8 @@ "added": "Proje başarıyla eklendi.", "updated": "Proje başarıyla güncellendi.", "deleted": "Proje silindi.", - "delete_confirm": "Bu projeyi silmek istediğinize emin misiniz? Dosyalarınız silinmez, sadece listeden kaldırılır." + "delete_confirm": "Bu projeyi silmek istediğinize emin misiniz? Dosyalarınız silinmez, sadece listeden kaldırılır.", + "browse" : "Gözat" }, "settings": { "general": "Genel Ayarlar",