feat: complete i18n support, telegram webhook, and security improvements

This commit is contained in:
AyrisAI
2026-05-14 13:46:17 +03:00
parent 4c9a07e3ef
commit cc65a2bd72
23 changed files with 798 additions and 205 deletions

View File

@@ -1,11 +1,13 @@
"use client";
import { useState } from "react";
import { useDictionary } from "@/components/DictionaryContext";
export default function MailLogin({ onSuccess }: { onSuccess: (email: string) => void }) {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [error, setError] = useState("");
const [loading, setLoading] = useState(false);
const dict = useDictionary();
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
@@ -30,29 +32,26 @@ export default function MailLogin({ onSuccess }: { onSuccess: (email: string) =>
<div className="card" style={{ maxWidth: 420, width: "100%" }}>
<div style={{ textAlign: "center", marginBottom: 24 }}>
<div style={{ fontSize: 32, marginBottom: 8 }}>📧</div>
<h2 style={{ fontSize: 18, fontWeight: 700, color: "var(--text-primary)" }}>Mail Hesabına Bağlan</h2>
<h2 style={{ fontSize: 18, fontWeight: 700, color: "var(--text-primary)" }}>{dict.mailClient.loginTitle || "IMAP Girişi"}</h2>
<p style={{ fontSize: 13, color: "var(--text-secondary)", marginTop: 4 }}>
Mailcow mail hesabınızın bilgilerini girin
{dict.mailClient.loginSubtitle || "Mail kutunuza bağlanın"}
</p>
</div>
<form onSubmit={handleSubmit} className="form-group">
{error && <div className="error-msg">{error}</div>}
<div>
<label className="label">E-posta Adresi</label>
<input type="email" className="input" placeholder="info@domain.com" value={email}
<label className="label">{dict.mailClient.emailLabel || "E-posta"}</label>
<input type="email" className="input" placeholder={dict.mailClient.emailPlaceholder || "isim@domain.com"} value={email}
onChange={(e) => setEmail(e.target.value)} required autoFocus />
</div>
<div>
<label className="label">Şifre</label>
<input type="password" className="input" placeholder="Mail hesabı şifresi" value={password}
<label className="label">{dict.mailClient.passwordLabel || "Şifre"}</label>
<input type="password" className="input" placeholder={dict.mailClient.passwordPlaceholder || "********"} value={password}
onChange={(e) => setPassword(e.target.value)} required />
</div>
<button type="submit" className="btn btn-primary" style={{ width: "100%" }} disabled={loading}>
{loading ? <span className="spinner" /> : "Bağlan"}
{loading ? <span className="spinner" /> : (dict.mailClient.connect || "Bağlan")}
</button>
<p style={{ fontSize: 11, color: "var(--text-muted)", textAlign: "center", marginTop: 8 }}>
Şifreniz sunucuda saklanmaz, sadece oturum süresince kullanılır.
</p>
</form>
</div>
</div>