diff --git a/.dockerignore b/.dockerignore index 10c5075..b3e90c2 100644 Binary files a/.dockerignore and b/.dockerignore differ diff --git a/Dockerfile b/Dockerfile index e201a86..e69de29 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +0,0 @@ -# Stage 1: Build the React application -FROM node:18-alpine as build -WORKDIR /app -COPY package*.json ./ -RUN npm install -COPY . . -RUN npm run build - -# Stage 2: Serve with Nginx -FROM nginx:alpine -COPY --from=build /app/dist /usr/share/nginx/html -COPY nginx.conf /etc/nginx/conf.d/default.conf -EXPOSE 80 -CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf index 59b9f8d..97684f0 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,20 +1 @@ -server { - listen 80; - - # Serve React App (SPA) - location / { - root /usr/share/nginx/html; - index index.html index.htm; - try_files $uri $uri/ /index.html; - } - - # Proxy API requests to Backend Service - location /api { - proxy_pass http://backend:3001; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection 'upgrade'; - proxy_set_header Host $host; - proxy_cache_bypass $http_upgrade; - } -} +���z \ No newline at end of file diff --git a/pages/Settings.tsx b/pages/Settings.tsx index 32f57de..e374a8f 100644 --- a/pages/Settings.tsx +++ b/pages/Settings.tsx @@ -473,7 +473,7 @@ export const SettingsPage: React.FC = () => { { id: 'users', label: 'Utenti', icon: }, { id: 'notices', label: 'Bacheca', icon: }, { id: 'alerts', label: 'Avvisi Email', icon: }, - { id: 'smtp', label: 'Impostazioni Posta', icon: } + { id: 'smtp', label: 'SMTP', icon: } ); } @@ -741,6 +741,54 @@ export const SettingsPage: React.FC = () => { )} + {/* ALERTS TAB */} + {isAdmin && activeTab === 'alerts' && ( +
+
+

Avvisi Automatici

Configura email automatiche per scadenze.

+ +
+
+ {alerts.map(alert => ( +
+

{alert.subject}

+

{alert.body}

+
+ Offset: {alert.daysOffset} giorni ({alert.offsetType}) + Ore: {alert.sendHour}:00 + {alert.active ? 'Attivo' : 'Inattivo'} +
+
+ + +
+
+ ))} + {alerts.length === 0 &&
Nessun alert configurato.
} +
+
+ )} + + {/* SMTP TAB */} + {isAdmin && activeTab === 'smtp' && ( +
+

Configurazione SMTP

+
+
+
setGlobalSettings(prev => prev ? {...prev, smtpConfig: {...(prev.smtpConfig || {}), host: e.target.value} as any} : null)} className="w-full border p-2.5 rounded-lg text-slate-700"/>
+
setGlobalSettings(prev => prev ? {...prev, smtpConfig: {...(prev.smtpConfig || {}), port: parseInt(e.target.value)} as any} : null)} className="w-full border p-2.5 rounded-lg text-slate-700"/>
+
+
+
setGlobalSettings(prev => prev ? {...prev, smtpConfig: {...(prev.smtpConfig || {}), user: e.target.value} as any} : null)} className="w-full border p-2.5 rounded-lg text-slate-700"/>
+
setGlobalSettings(prev => prev ? {...prev, smtpConfig: {...(prev.smtpConfig || {}), pass: e.target.value} as any} : null)} className="w-full border p-2.5 rounded-lg text-slate-700"/>
+
+
setGlobalSettings(prev => prev ? {...prev, smtpConfig: {...(prev.smtpConfig || {}), fromEmail: e.target.value} as any} : null)} className="w-full border p-2.5 rounded-lg text-slate-700"/>
+
setGlobalSettings(prev => prev ? {...prev, smtpConfig: {...(prev.smtpConfig || {}), secure: e.target.checked} as any} : null)} className="w-4 h-4"/>
+
{successMsg}
+
+
+ )} + {/* ALERT MODAL */} {showAlertModal && (
@@ -778,6 +826,48 @@ export const SettingsPage: React.FC = () => {
)} + {/* NOTICE MODAL */} + {showNoticeModal && ( +
+
+

{editingNotice ? 'Modifica Avviso' : 'Nuovo Avviso'}

+
+ setNoticeForm({...noticeForm, title: e.target.value})} required /> +