feat: add Turkish and English localization files and initialize main application component
This commit is contained in:
@@ -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<any[]>([])
|
||||
@@ -1536,10 +1538,40 @@ function App(): JSX.Element {
|
||||
|
||||
{activeTab === 'projects' && (
|
||||
<Box>
|
||||
<Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', mb: 3 }}>
|
||||
<Typography variant="h5" sx={{ fontWeight: 'medium' }}>
|
||||
<Box sx={{ display: 'flex', flexDirection: { xs: 'column', sm: 'row' }, gap: 2, alignItems: { xs: 'stretch', sm: 'center' }, mb: 3 }}>
|
||||
<Typography variant="h5" sx={{ fontWeight: 'medium', flexGrow: 1 }}>
|
||||
{t('projects.title')}
|
||||
</Typography>
|
||||
<TextField
|
||||
size="small"
|
||||
placeholder={t('projects.search')}
|
||||
value={projectSearch}
|
||||
onChange={(e) => 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: (
|
||||
<InputAdornment position="start">
|
||||
<SearchIcon sx={{ color: 'rgba(255, 255, 255, 0.3)' }} />
|
||||
</InputAdornment>
|
||||
),
|
||||
endAdornment: projectSearch && (
|
||||
<InputAdornment position="end">
|
||||
<IconButton size="small" onClick={() => setProjectSearch('')} sx={{ color: 'rgba(255, 255, 255, 0.3)' }}>
|
||||
<CloseIcon fontSize="small" />
|
||||
</IconButton>
|
||||
</InputAdornment>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
<Button variant="contained" startIcon={<ProjectIcon />} onClick={() => setIsProjectDialogOpen(true)}>
|
||||
{t('projects.add_new')}
|
||||
</Button>
|
||||
@@ -1549,9 +1581,26 @@ function App(): JSX.Element {
|
||||
<Paper sx={{ p: 4, textAlign: 'center', bgcolor: 'rgba(255, 255, 255, 0.03)' }}>
|
||||
<Typography variant="body1" color="text.secondary">{t('projects.empty')}</Typography>
|
||||
</Paper>
|
||||
) : (
|
||||
) : (() => {
|
||||
const filteredProjects = projects.filter(p =>
|
||||
p.name.toLowerCase().includes(projectSearch.toLowerCase()) ||
|
||||
p.host.toLowerCase().includes(projectSearch.toLowerCase())
|
||||
);
|
||||
|
||||
if (filteredProjects.length === 0) {
|
||||
return (
|
||||
<Paper sx={{ p: 6, textAlign: 'center', bgcolor: 'rgba(255, 255, 255, 0.02)', border: '1px dashed rgba(255, 255, 255, 0.1)' }}>
|
||||
<SearchIcon sx={{ fontSize: 48, color: 'rgba(255, 255, 255, 0.1)', mb: 2 }} />
|
||||
<Typography variant="h6" sx={{ color: 'rgba(255, 255, 255, 0.4)' }}>
|
||||
{t('common.not_found', 'Eşleşen proje bulunamadı')}
|
||||
</Typography>
|
||||
</Paper>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Grid container spacing={3}>
|
||||
{projects.map((project) => (
|
||||
{filteredProjects.map((project) => (
|
||||
<Grid item xs={12} md={6} key={project.id}>
|
||||
<Paper
|
||||
elevation={0}
|
||||
@@ -1668,7 +1717,8 @@ function App(): JSX.Element {
|
||||
</Grid>
|
||||
))}
|
||||
</Grid>
|
||||
)}
|
||||
)
|
||||
})()}
|
||||
</Box>
|
||||
)}
|
||||
</Container>
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user