+
{[
{ id: "home", label: t.nav.home, icon: Zap },
- { id: "vpn", label: t.nav.vpn, icon: Shield },
{ id: "settings", label: t.nav.settings, icon: Settings },
{ id: "about", label: t.nav.about, icon: Info },
].map(({ id, label, icon: Icon }) => {
diff --git a/src/components/NetworkRepairPanel.jsx b/src/components/NetworkRepairPanel.jsx
new file mode 100644
index 0000000..618fe98
--- /dev/null
+++ b/src/components/NetworkRepairPanel.jsx
@@ -0,0 +1,207 @@
+import { useState } from "react";
+import {
+ Activity,
+ CheckCircle2,
+ ClipboardCopy,
+ Loader2,
+ RefreshCw,
+ ShieldCheck,
+ Wrench,
+ XCircle,
+} from "lucide-react";
+import { invokeTauri } from "../utils/tauriBridge";
+
+const T = {
+ tr: {
+ title: "Gelişmiş Ağ ve Proxy Onarım Merkezi",
+ desc: "Önce tara. Onarım yalnızca LD-FDPI’ye ait proxy ve QUIC/WFP ayarlarına dokunur; ağ yığını sıfırlanmaz.",
+ scan: "Şimdi Tara",
+ scanning: "Taranıyor...",
+ smart: "Güvenli Onarım",
+ smartRunning: "Onarılıyor...",
+ proxy: "Proxy & Sentinel Onar",
+ wfp: "WFP / QUIC Kalıntısını Temizle",
+ report: "Raporu Kopyala",
+ confirm: "Bu işlem çalışan FDPI oturumunu durdurup proxy ayarlarını yedekten geri yükler. Devam?",
+ noScan: "Henüz tarama yok.",
+ done: "Tamamlandı.",
+ },
+ en: {
+ title: "Advanced Network & Proxy Repair Center",
+ desc: "Scan first. Repairs touch only LD-FDPI proxy and QUIC/WFP state; the network stack is never reset.",
+ scan: "Scan Now",
+ scanning: "Scanning...",
+ smart: "Safe Repair",
+ smartRunning: "Repairing...",
+ proxy: "Repair Proxy & Sentinel",
+ wfp: "Clean WFP / QUIC Residue",
+ report: "Copy Report",
+ confirm: "This stops the active FDPI session and restores system proxy settings from backup. Continue?",
+ noScan: "No scan yet.",
+ done: "Done.",
+ },
+};
+
+function Row({ item }) {
+ return (
+
+ {item.passed ? (
+
+ ) : (
+
+ )}
+
+
{item.name}
+
{item.detail}
+
+
+ );
+}
+
+export default function NetworkRepairPanel({ lang = "tr", status = null }) {
+ const t = T[lang] || T.tr;
+ const [items, setItems] = useState([]);
+ const [busy, setBusy] = useState(null);
+ const [message, setMessage] = useState(null);
+ const [scanned, setScanned] = useState(false);
+
+ const run = async (name, fn) => {
+ setBusy(name);
+ setMessage(null);
+ try {
+ const result = await fn();
+ setMessage({ ok: true, text: result || t.done });
+ return result;
+ } catch (error) {
+ setMessage({ ok: false, text: String(error) });
+ return null;
+ } finally {
+ setBusy(null);
+ }
+ };
+
+ const scan = () =>
+ run("scan", async () => {
+ const result = await invokeTauri("run_diagnostics");
+ setItems(Array.isArray(result) ? result : []);
+ setScanned(true);
+ return `${result.length} kontrol tamamlandı.`;
+ });
+
+ const repairProxy = () =>
+ run("proxy", async () => {
+ const res = await invokeTauri("emergency_sentinel_restore");
+ return res?.message || t.done;
+ });
+
+ const repairWfp = () =>
+ run("wfp", async () => invokeTauri("cleanup_wfp_residue"));
+
+ const copyReport = () =>
+ run("report", async () => {
+ const report = await invokeTauri("diagnostics_report");
+ await navigator.clipboard.writeText(report);
+ return "Redakte edilmiş tanılama raporu kopyalandı.";
+ });
+
+ const smartRepair = () =>
+ run("smart", async () => {
+ if (!window.confirm(t.confirm)) return t.done;
+ await invokeTauri("emergency_sentinel_restore");
+ await invokeTauri("cleanup_wfp_residue").catch(() => {});
+ await invokeTauri("run_diagnostics").then((result) => setItems(result || []));
+ setScanned(true);
+ return "Güvenli onarım tamamlandı; lütfen yeniden tarayın.";
+ });
+
+ const disabled = Boolean(busy);
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+ {status?.proxyTotalMs > 0 && (
+
+ Ağ TCP: {status.networkMs} ms
+ CONNECT: {status.proxyConnectMs} ms
+ TLS: {status.proxyTlsMs} ms
+ Proxy: {status.proxyTotalMs} ms
+
+ )}
+
+ {message && (
+
+ {message.text}
+
+ )}
+
+ {!scanned ? (
+ {t.noScan}
+ ) : (
+
+ {items.map((item) => (
+
+ ))}
+
+ )}
+
+
+
+ LD-FDPI-only / no netsh reset / no route flush
+
+
+ );
+}
diff --git a/src/components/UpdatePanel.jsx b/src/components/UpdatePanel.jsx
index b70fd12..4d6dfee 100644
--- a/src/components/UpdatePanel.jsx
+++ b/src/components/UpdatePanel.jsx
@@ -2,6 +2,7 @@ import { useEffect, useRef, useState } from "react";
import {
AlertTriangle,
CheckCircle2,
+ Copy,
Download,
Loader2,
RefreshCw,
@@ -9,6 +10,7 @@ import {
} from "lucide-react";
import { check } from "@tauri-apps/plugin-updater";
import { invokeTauri } from "../utils/tauriBridge";
+import { isNewerVersion } from "../utils/version";
const T = {
tr: {
@@ -71,12 +73,13 @@ function Spinner() {
return
;
}
-export default function UpdatePanel({ appVersion = "1.7.3", lang = "tr", ...rest }) {
+export default function UpdatePanel({ appVersion = "1.8.11", lang = "tr", ...rest }) {
const t = T[lang] || T.tr;
const [state, setState] = useState("idle");
const [update, setUpdate] = useState(null);
const [percent, setPercent] = useState(null);
const [error, setError] = useState(null);
+ const [diagBusy, setDiagBusy] = useState(false);
const mounted = useRef(true);
useEffect(() => {
@@ -93,7 +96,7 @@ export default function UpdatePanel({ appVersion = "1.7.3", lang = "tr", ...rest
try {
const found = await check();
if (!mounted.current) return;
- if (!found) {
+ if (!found || !isNewerVersion(found.version, appVersion)) {
setUpdate(null);
setState("current");
return;
@@ -107,13 +110,30 @@ export default function UpdatePanel({ appVersion = "1.7.3", lang = "tr", ...rest
}
};
+ const copyDiagnostics = async () => {
+ setDiagBusy(true);
+ setError(null);
+ try {
+ const report = await invokeTauri("diagnostics_report");
+ if (navigator.clipboard?.writeText) {
+ await navigator.clipboard.writeText(report);
+ } else {
+ window.prompt("Tanılama raporu", report);
+ }
+ } catch (e) {
+ setError(messageOf(e));
+ } finally {
+ setDiagBusy(false);
+ }
+ };
+
const installNow = async () => {
if (!update || state === "downloading") return;
setState("downloading");
setPercent(0);
setError(null);
try {
- // Stop SpoofDPI/VPN and clear loopback proxy before replacing files.
+ // Stop SpoofDPI and clear loopback proxy before replacing files.
await invokeTauri("prepare_for_update");
let total = 0;
@@ -271,6 +291,15 @@ export default function UpdatePanel({ appVersion = "1.7.3", lang = "tr", ...rest
)}
+
+
);
}
diff --git a/src/i18n.js b/src/i18n.js
index 834d3df..728b8bf 100644
--- a/src/i18n.js
+++ b/src/i18n.js
@@ -1,10 +1,9 @@
export const TEXT = {
tr: {
- nav: { home: "Bağlantı", vpn: "VPN", settings: "Ayarlar", about: "Hakkında" },
+ nav: { home: "Bağlantı", settings: "Ayarlar", about: "Hakkında" },
status: {
connected: "Bağlı ve Korunuyor",
fdpiConnected: "FDPI Bağlı",
- vpnConnected: "VPN Bağlı",
disconnected: "Bağlı Değil",
connecting: "Bağlanıyor...",
autoConnecting: "Otomatik bağlanıyor...",
@@ -43,22 +42,6 @@ export const TEXT = {
eduroamDesc: "Kurumsal Wi-Fi için DoH + MTU 1400 + WinHTTP/WinINet; Discord metin ve uygulama trafiği.",
eduroamNote: "Eduroam modu yalnızca yerel ağ yığınını optimize eder; kurumun güvenlik duvarını aşmaz.",
},
- vpn: {
- title: "VPN",
- server: "AmneziaWG Sunucusu",
- connect: "VPN'E BAĞLAN",
- disconnect: "VPN BAĞLANTISINI KES",
- install: "AmneziaWG İstemcisini Kur",
- installing: "Kuruluyor...",
- preparing: "Hazırlanıyor...",
- import: "AmneziaWG .conf İçe Aktar",
- restore: "Gömülü Sunucuyu Geri Yükle",
- note: "Tam tünel: tüm trafik sunucu üzerinden gider. LD FDPI proxy'siyle birlikte kullanılabilir.",
- connected: "VPN bağlı",
- disconnected: "VPN bağlı değil",
- noClient: "AmneziaWG istemcisi kurulu değil.",
- noConfig: "VPN yapılandırması yok; .conf içe aktarın.",
- },
captive: {
title: "Oturum Açmadan Bağlantı",
desc: "Kafe/otel captive portalını algılar. Açık ağda doğrudan bağlanır; giriş duvarı varsa portalı tarayıcıda açar. Normal/Oyun modu ayarlarını değiştirmez.",
@@ -119,8 +102,8 @@ export const TEXT = {
startup: "Başlangıç",
autoStart: "Windows açıldığında otomatik başlat",
autoStartDesc: "Yönetici göreviyle, UAC sormadan sistem tepsisinde başlar.",
- autoConnect: "Uygulama açıldığında otomatik bağlan",
- autoConnectDesc: "Arayüz yüklenmeden motor ve proxy hazırlanır.",
+ autoConnect: "Açılışta otomatik bağlan",
+ autoConnectDesc: "Bilgisayar veya uygulama açılırken FDPI proxy otomatik olarak başlatılır.",
minimize: "Pencere kapatılınca tepsiye küçült",
minimizeDesc: "X'e basınca bağlantı kopmaz, arka planda çalışmaya devam eder.",
lan: "LAN Paylaşımı",
@@ -181,11 +164,10 @@ export const TEXT = {
},
},
en: {
- nav: { home: "Connection", vpn: "VPN", settings: "Settings", about: "About" },
+ nav: { home: "Connection", settings: "Settings", about: "About" },
status: {
connected: "Connected & Protected",
fdpiConnected: "FDPI Connected",
- vpnConnected: "VPN Connected",
disconnected: "Disconnected",
connecting: "Connecting...",
autoConnecting: "Auto-connecting...",
@@ -224,22 +206,6 @@ export const TEXT = {
eduroamDesc: "DoH + MTU 1400 + WinHTTP/WinINet for campus Wi-Fi; Discord text and app traffic.",
eduroamNote: "Eduroam mode only tunes the local network stack; it does not bypass your institution's firewall.",
},
- vpn: {
- title: "VPN",
- server: "AmneziaWG Server",
- connect: "CONNECT VPN",
- disconnect: "DISCONNECT VPN",
- install: "Install AmneziaWG Client",
- installing: "Installing...",
- preparing: "Preparing...",
- import: "Import AmneziaWG .conf",
- restore: "Restore Built-in Server",
- note: "Full tunnel: all traffic goes through the server. Can be used alongside the LD FDPI proxy.",
- connected: "VPN connected",
- disconnected: "VPN disconnected",
- noClient: "AmneziaWG client is not installed.",
- noConfig: "No VPN configuration; import a .conf file.",
- },
captive: {
title: "Connect Without Login",
desc: "Detects a cafe/hotel captive portal. Connects directly when the network is open; if there is a login wall, opens the portal in your browser. Does not change Normal/Game mode settings.",
@@ -300,8 +266,8 @@ export const TEXT = {
startup: "Startup",
autoStart: "Start with Windows",
autoStartDesc: "Starts elevated in the tray at logon without a UAC prompt.",
- autoConnect: "Connect automatically on launch",
- autoConnectDesc: "Engine and proxy are ready before the UI loads.",
+ autoConnect: "Auto-connect on launch",
+ autoConnectDesc: "Automatically starts the FDPI proxy when your PC or app boots.",
minimize: "Minimize to tray when closed",
minimizeDesc: "Closing the window keeps the connection alive in the background.",
lan: "LAN Sharing",
diff --git a/src/utils/version.js b/src/utils/version.js
new file mode 100644
index 0000000..58f51d8
--- /dev/null
+++ b/src/utils/version.js
@@ -0,0 +1,20 @@
+// Monotonic version gate for the updater. The server must never be able to
+// downgrade a client by serving an older or equal latest.json.
+export function parseVersion(value) {
+ const match = String(value || "")
+ .trim()
+ .replace(/^v/i, "")
+ .match(/^(\d+)\.(\d+)\.(\d+)/);
+ return match ? match.slice(1, 4).map(Number) : null;
+}
+
+export function isNewerVersion(remote, current) {
+ const a = parseVersion(remote);
+ const b = parseVersion(current);
+ if (!a || !b) return false;
+ for (let i = 0; i < 3; i += 1) {
+ if (a[i] > b[i]) return true;
+ if (a[i] < b[i]) return false;
+ }
+ return false;
+}