From 8feb5213cfdb2935a135be6999f983bddb41bfb7 Mon Sep 17 00:00:00 2001 From: litoral05 Date: Mon, 18 May 2026 12:18:38 +0100 Subject: [PATCH] Finishes controllers tab + adds Manual to settings --- .VSCodeCounter/2026-05-18_12-10-57/details.md | 45 + .../2026-05-18_12-10-57/diff-details.md | 15 + .VSCodeCounter/2026-05-18_12-10-57/diff.csv | 2 + .VSCodeCounter/2026-05-18_12-10-57/diff.md | 19 + .VSCodeCounter/2026-05-18_12-10-57/diff.txt | 22 + .../2026-05-18_12-10-57/results.csv | 32 + .../2026-05-18_12-10-57/results.json | 1 + .VSCodeCounter/2026-05-18_12-10-57/results.md | 38 + .../2026-05-18_12-10-57/results.txt | 71 + .VSCodeCounter/2026-05-18_12-12-03/details.md | 28 + .../2026-05-18_12-12-03/diff-details.md | 58 + .VSCodeCounter/2026-05-18_12-12-03/diff.csv | 45 + .VSCodeCounter/2026-05-18_12-12-03/diff.md | 52 + .VSCodeCounter/2026-05-18_12-12-03/diff.txt | 98 ++ .../2026-05-18_12-12-03/results.csv | 15 + .../2026-05-18_12-12-03/results.json | 1 + .VSCodeCounter/2026-05-18_12-12-03/results.md | 32 + .../2026-05-18_12-12-03/results.txt | 48 + .../controllers/ControllersRoute.tsx | 1339 +++++++++++++++-- src/components/settings/BackendSettings.tsx | 1154 +++++++++++++- src/components/ui/Button.tsx | 11 +- src/services/vpsApi.ts | 139 +- 22 files changed, 3031 insertions(+), 234 deletions(-) create mode 100644 .VSCodeCounter/2026-05-18_12-10-57/details.md create mode 100644 .VSCodeCounter/2026-05-18_12-10-57/diff-details.md create mode 100644 .VSCodeCounter/2026-05-18_12-10-57/diff.csv create mode 100644 .VSCodeCounter/2026-05-18_12-10-57/diff.md create mode 100644 .VSCodeCounter/2026-05-18_12-10-57/diff.txt create mode 100644 .VSCodeCounter/2026-05-18_12-10-57/results.csv create mode 100644 .VSCodeCounter/2026-05-18_12-10-57/results.json create mode 100644 .VSCodeCounter/2026-05-18_12-10-57/results.md create mode 100644 .VSCodeCounter/2026-05-18_12-10-57/results.txt create mode 100644 .VSCodeCounter/2026-05-18_12-12-03/details.md create mode 100644 .VSCodeCounter/2026-05-18_12-12-03/diff-details.md create mode 100644 .VSCodeCounter/2026-05-18_12-12-03/diff.csv create mode 100644 .VSCodeCounter/2026-05-18_12-12-03/diff.md create mode 100644 .VSCodeCounter/2026-05-18_12-12-03/diff.txt create mode 100644 .VSCodeCounter/2026-05-18_12-12-03/results.csv create mode 100644 .VSCodeCounter/2026-05-18_12-12-03/results.json create mode 100644 .VSCodeCounter/2026-05-18_12-12-03/results.md create mode 100644 .VSCodeCounter/2026-05-18_12-12-03/results.txt diff --git a/.VSCodeCounter/2026-05-18_12-10-57/details.md b/.VSCodeCounter/2026-05-18_12-10-57/details.md new file mode 100644 index 0000000..1662790 --- /dev/null +++ b/.VSCodeCounter/2026-05-18_12-10-57/details.md @@ -0,0 +1,45 @@ +# Details + +Date : 2026-05-18 12:10:57 + +Directory c:\\Users\\User\\Desktop\\Projetos\\Deployed\\LR OpenWRT Tool\\Frontend\\lr-openwrt-tool\\src + +Total : 30 files, 7309 codes, 2 comments, 1032 blanks, all 8343 lines + +[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md) + +## Files +| filename | language | code | comment | blank | total | +| :--- | :--- | ---: | ---: | ---: | ---: | +| [src/app/App.tsx](/src/app/App.tsx) | TypeScript JSX | 36 | 0 | 9 | 45 | +| [src/app/routes.tsx](/src/app/routes.tsx) | TypeScript JSX | 260 | 0 | 46 | 306 | +| [src/components/activity/ActivityLogs.tsx](/src/components/activity/ActivityLogs.tsx) | TypeScript JSX | 288 | 0 | 51 | 339 | +| [src/components/controllers/ControllersRoute.tsx](/src/components/controllers/ControllersRoute.tsx) | TypeScript JSX | 1,927 | 0 | 308 | 2,235 | +| [src/components/dashboard/IpPoolChart.tsx](/src/components/dashboard/IpPoolChart.tsx) | TypeScript JSX | 117 | 0 | 17 | 134 | +| [src/components/dashboard/MetricCard.tsx](/src/components/dashboard/MetricCard.tsx) | TypeScript JSX | 78 | 0 | 11 | 89 | +| [src/components/dashboard/NetworkTrafficChart.tsx](/src/components/dashboard/NetworkTrafficChart.tsx) | TypeScript JSX | 217 | 0 | 35 | 252 | +| [src/components/layout/AppShell.tsx](/src/components/layout/AppShell.tsx) | TypeScript JSX | 26 | 0 | 4 | 30 | +| [src/components/layout/Sidebar.tsx](/src/components/layout/Sidebar.tsx) | TypeScript JSX | 88 | 0 | 11 | 99 | +| [src/components/layout/TopBar.tsx](/src/components/layout/TopBar.tsx) | TypeScript JSX | 95 | 0 | 7 | 102 | +| [src/components/login/LoginScreen.tsx](/src/components/login/LoginScreen.tsx) | TypeScript JSX | 165 | 0 | 27 | 192 | +| [src/components/provisioning/ProvisioningWizard.tsx](/src/components/provisioning/ProvisioningWizard.tsx) | TypeScript JSX | 1,707 | 0 | 283 | 1,990 | +| [src/components/settings/BackendSettings.tsx](/src/components/settings/BackendSettings.tsx) | TypeScript JSX | 1,272 | 0 | 70 | 1,342 | +| [src/components/udp2raw/Udp2rawConfig.tsx](/src/components/udp2raw/Udp2rawConfig.tsx) | TypeScript JSX | 369 | 0 | 52 | 421 | +| [src/components/ui/Badge.tsx](/src/components/ui/Badge.tsx) | TypeScript JSX | 38 | 0 | 5 | 43 | +| [src/components/ui/Button.tsx](/src/components/ui/Button.tsx) | TypeScript JSX | 38 | 0 | 7 | 45 | +| [src/components/ui/Card.tsx](/src/components/ui/Card.tsx) | TypeScript JSX | 20 | 0 | 3 | 23 | +| [src/components/ui/Progress.tsx](/src/components/ui/Progress.tsx) | TypeScript JSX | 21 | 0 | 2 | 23 | +| [src/components/ui/Select.tsx](/src/components/ui/Select.tsx) | TypeScript JSX | 71 | 0 | 10 | 81 | +| [src/components/ui/StatusDot.tsx](/src/components/ui/StatusDot.tsx) | TypeScript JSX | 16 | 0 | 1 | 17 | +| [src/main.tsx](/src/main.tsx) | TypeScript JSX | 16 | 0 | 5 | 21 | +| [src/services/activityLogService.ts](/src/services/activityLogService.ts) | TypeScript | 62 | 0 | 14 | 76 | +| [src/services/apiClient.ts](/src/services/apiClient.ts) | TypeScript | 80 | 0 | 13 | 93 | +| [src/services/loginApi.ts](/src/services/loginApi.ts) | TypeScript | 15 | 0 | 2 | 17 | +| [src/services/vpnApi.ts](/src/services/vpnApi.ts) | TypeScript | 27 | 0 | 4 | 31 | +| [src/services/vpsApi.ts](/src/services/vpsApi.ts) | TypeScript | 142 | 2 | 20 | 164 | +| [src/styles/globals.css](/src/styles/globals.css) | PostCSS | 28 | 0 | 5 | 33 | +| [src/types/activity.ts](/src/types/activity.ts) | TypeScript | 20 | 0 | 2 | 22 | +| [src/types/api.ts](/src/types/api.ts) | TypeScript | 46 | 0 | 6 | 52 | +| [src/types/provisioning.ts](/src/types/provisioning.ts) | TypeScript | 24 | 0 | 2 | 26 | + +[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md) \ No newline at end of file diff --git a/.VSCodeCounter/2026-05-18_12-10-57/diff-details.md b/.VSCodeCounter/2026-05-18_12-10-57/diff-details.md new file mode 100644 index 0000000..73f0065 --- /dev/null +++ b/.VSCodeCounter/2026-05-18_12-10-57/diff-details.md @@ -0,0 +1,15 @@ +# Diff Details + +Date : 2026-05-18 12:10:57 + +Directory c:\\Users\\User\\Desktop\\Projetos\\Deployed\\LR OpenWRT Tool\\Frontend\\lr-openwrt-tool\\src + +Total : 0 files, 0 codes, 0 comments, 0 blanks, all 0 lines + +[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details + +## Files +| filename | language | code | comment | blank | total | +| :--- | :--- | ---: | ---: | ---: | ---: | + +[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details \ No newline at end of file diff --git a/.VSCodeCounter/2026-05-18_12-10-57/diff.csv b/.VSCodeCounter/2026-05-18_12-10-57/diff.csv new file mode 100644 index 0000000..b7d8d75 --- /dev/null +++ b/.VSCodeCounter/2026-05-18_12-10-57/diff.csv @@ -0,0 +1,2 @@ +"filename", "language", "", "comment", "blank", "total" +"Total", "-", , 0, 0, 0 \ No newline at end of file diff --git a/.VSCodeCounter/2026-05-18_12-10-57/diff.md b/.VSCodeCounter/2026-05-18_12-10-57/diff.md new file mode 100644 index 0000000..5ceb735 --- /dev/null +++ b/.VSCodeCounter/2026-05-18_12-10-57/diff.md @@ -0,0 +1,19 @@ +# Diff Summary + +Date : 2026-05-18 12:10:57 + +Directory c:\\Users\\User\\Desktop\\Projetos\\Deployed\\LR OpenWRT Tool\\Frontend\\lr-openwrt-tool\\src + +Total : 0 files, 0 codes, 0 comments, 0 blanks, all 0 lines + +[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md) + +## Languages +| language | files | code | comment | blank | total | +| :--- | ---: | ---: | ---: | ---: | ---: | + +## Directories +| path | files | code | comment | blank | total | +| :--- | ---: | ---: | ---: | ---: | ---: | + +[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md) \ No newline at end of file diff --git a/.VSCodeCounter/2026-05-18_12-10-57/diff.txt b/.VSCodeCounter/2026-05-18_12-10-57/diff.txt new file mode 100644 index 0000000..eabf7cb --- /dev/null +++ b/.VSCodeCounter/2026-05-18_12-10-57/diff.txt @@ -0,0 +1,22 @@ +Date : 2026-05-18 12:10:57 +Directory : c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src +Total : 0 files, 0 codes, 0 comments, 0 blanks, all 0 lines + +Languages ++----------+------------+------------+------------+------------+------------+ +| language | files | code | comment | blank | total | ++----------+------------+------------+------------+------------+------------+ ++----------+------------+------------+------------+------------+------------+ + +Directories ++------+------------+------------+------------+------------+------------+ +| path | files | code | comment | blank | total | ++------+------------+------------+------------+------------+------------+ ++------+------------+------------+------------+------------+------------+ + +Files ++----------+----------+------------+------------+------------+------------+ +| filename | language | code | comment | blank | total | ++----------+----------+------------+------------+------------+------------+ +| Total | | 0 | 0 | 0 | 0 | ++----------+----------+------------+------------+------------+------------+ \ No newline at end of file diff --git a/.VSCodeCounter/2026-05-18_12-10-57/results.csv b/.VSCodeCounter/2026-05-18_12-10-57/results.csv new file mode 100644 index 0000000..c2fa636 --- /dev/null +++ b/.VSCodeCounter/2026-05-18_12-10-57/results.csv @@ -0,0 +1,32 @@ +"filename", "language", "TypeScript", "PostCSS", "TypeScript JSX", "comment", "blank", "total" +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\app\App.tsx", "TypeScript JSX", 0, 0, 36, 0, 9, 45 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\app\routes.tsx", "TypeScript JSX", 0, 0, 260, 0, 46, 306 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\activity\ActivityLogs.tsx", "TypeScript JSX", 0, 0, 288, 0, 51, 339 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\controllers\ControllersRoute.tsx", "TypeScript JSX", 0, 0, 1927, 0, 308, 2235 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\dashboard\IpPoolChart.tsx", "TypeScript JSX", 0, 0, 117, 0, 17, 134 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\dashboard\MetricCard.tsx", "TypeScript JSX", 0, 0, 78, 0, 11, 89 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\dashboard\NetworkTrafficChart.tsx", "TypeScript JSX", 0, 0, 217, 0, 35, 252 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\layout\AppShell.tsx", "TypeScript JSX", 0, 0, 26, 0, 4, 30 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\layout\Sidebar.tsx", "TypeScript JSX", 0, 0, 88, 0, 11, 99 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\layout\TopBar.tsx", "TypeScript JSX", 0, 0, 95, 0, 7, 102 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\login\LoginScreen.tsx", "TypeScript JSX", 0, 0, 165, 0, 27, 192 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\provisioning\ProvisioningWizard.tsx", "TypeScript JSX", 0, 0, 1707, 0, 283, 1990 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\settings\BackendSettings.tsx", "TypeScript JSX", 0, 0, 1272, 0, 70, 1342 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\udp2raw\Udp2rawConfig.tsx", "TypeScript JSX", 0, 0, 369, 0, 52, 421 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\ui\Badge.tsx", "TypeScript JSX", 0, 0, 38, 0, 5, 43 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\ui\Button.tsx", "TypeScript JSX", 0, 0, 38, 0, 7, 45 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\ui\Card.tsx", "TypeScript JSX", 0, 0, 20, 0, 3, 23 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\ui\Progress.tsx", "TypeScript JSX", 0, 0, 21, 0, 2, 23 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\ui\Select.tsx", "TypeScript JSX", 0, 0, 71, 0, 10, 81 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\ui\StatusDot.tsx", "TypeScript JSX", 0, 0, 16, 0, 1, 17 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\main.tsx", "TypeScript JSX", 0, 0, 16, 0, 5, 21 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\services\activityLogService.ts", "TypeScript", 62, 0, 0, 0, 14, 76 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\services\apiClient.ts", "TypeScript", 80, 0, 0, 0, 13, 93 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\services\loginApi.ts", "TypeScript", 15, 0, 0, 0, 2, 17 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\services\vpnApi.ts", "TypeScript", 27, 0, 0, 0, 4, 31 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\services\vpsApi.ts", "TypeScript", 142, 0, 0, 2, 20, 164 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\styles\globals.css", "PostCSS", 0, 28, 0, 0, 5, 33 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\types\activity.ts", "TypeScript", 20, 0, 0, 0, 2, 22 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\types\api.ts", "TypeScript", 46, 0, 0, 0, 6, 52 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\types\provisioning.ts", "TypeScript", 24, 0, 0, 0, 2, 26 +"Total", "-", 416, 28, 6865, 2, 1032, 8343 \ No newline at end of file diff --git a/.VSCodeCounter/2026-05-18_12-10-57/results.json b/.VSCodeCounter/2026-05-18_12-10-57/results.json new file mode 100644 index 0000000..efc35dd --- /dev/null +++ b/.VSCodeCounter/2026-05-18_12-10-57/results.json @@ -0,0 +1 @@ +{"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/types/provisioning.ts":{"language":"TypeScript","code":24,"comment":0,"blank":2},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/services/vpsApi.ts":{"language":"TypeScript","code":142,"comment":2,"blank":20},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/styles/globals.css":{"language":"PostCSS","code":28,"comment":0,"blank":5},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/types/api.ts":{"language":"TypeScript","code":46,"comment":0,"blank":6},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/types/activity.ts":{"language":"TypeScript","code":20,"comment":0,"blank":2},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/services/vpnApi.ts":{"language":"TypeScript","code":27,"comment":0,"blank":4},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/services/loginApi.ts":{"language":"TypeScript","code":15,"comment":0,"blank":2},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/services/activityLogService.ts":{"language":"TypeScript","code":62,"comment":0,"blank":14},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/components/ui/StatusDot.tsx":{"language":"TypeScript JSX","code":16,"comment":0,"blank":1},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/main.tsx":{"language":"TypeScript JSX","code":16,"comment":0,"blank":5},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/components/ui/Progress.tsx":{"language":"TypeScript JSX","code":21,"comment":0,"blank":2},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/components/ui/Card.tsx":{"language":"TypeScript JSX","code":20,"comment":0,"blank":3},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/services/apiClient.ts":{"language":"TypeScript","code":80,"comment":0,"blank":13},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/components/udp2raw/Udp2rawConfig.tsx":{"language":"TypeScript JSX","code":369,"comment":0,"blank":52},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/components/ui/Select.tsx":{"language":"TypeScript JSX","code":71,"comment":0,"blank":10},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/components/provisioning/ProvisioningWizard.tsx":{"language":"TypeScript JSX","code":1707,"comment":0,"blank":283},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/components/login/LoginScreen.tsx":{"language":"TypeScript JSX","code":165,"comment":0,"blank":27},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/components/ui/Button.tsx":{"language":"TypeScript JSX","code":38,"comment":0,"blank":7},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/components/ui/Badge.tsx":{"language":"TypeScript JSX","code":38,"comment":0,"blank":5},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/components/layout/TopBar.tsx":{"language":"TypeScript JSX","code":95,"comment":0,"blank":7},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/components/layout/AppShell.tsx":{"language":"TypeScript JSX","code":26,"comment":0,"blank":4},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/components/settings/BackendSettings.tsx":{"language":"TypeScript JSX","code":1272,"comment":0,"blank":70},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/components/layout/Sidebar.tsx":{"language":"TypeScript JSX","code":88,"comment":0,"blank":11},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/components/controllers/ControllersRoute.tsx":{"language":"TypeScript JSX","code":1927,"comment":0,"blank":308},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/components/activity/ActivityLogs.tsx":{"language":"TypeScript JSX","code":288,"comment":0,"blank":51},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/app/routes.tsx":{"language":"TypeScript JSX","code":260,"comment":0,"blank":46},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/app/App.tsx":{"language":"TypeScript JSX","code":36,"comment":0,"blank":9},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/components/dashboard/NetworkTrafficChart.tsx":{"language":"TypeScript JSX","code":217,"comment":0,"blank":35},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/components/dashboard/MetricCard.tsx":{"language":"TypeScript JSX","code":78,"comment":0,"blank":11},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src/components/dashboard/IpPoolChart.tsx":{"language":"TypeScript JSX","code":117,"comment":0,"blank":17}} \ No newline at end of file diff --git a/.VSCodeCounter/2026-05-18_12-10-57/results.md b/.VSCodeCounter/2026-05-18_12-10-57/results.md new file mode 100644 index 0000000..a763ff7 --- /dev/null +++ b/.VSCodeCounter/2026-05-18_12-10-57/results.md @@ -0,0 +1,38 @@ +# Summary + +Date : 2026-05-18 12:10:57 + +Directory c:\\Users\\User\\Desktop\\Projetos\\Deployed\\LR OpenWRT Tool\\Frontend\\lr-openwrt-tool\\src + +Total : 30 files, 7309 codes, 2 comments, 1032 blanks, all 8343 lines + +Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md) + +## Languages +| language | files | code | comment | blank | total | +| :--- | ---: | ---: | ---: | ---: | ---: | +| TypeScript JSX | 21 | 6,865 | 0 | 964 | 7,829 | +| TypeScript | 8 | 416 | 2 | 63 | 481 | +| PostCSS | 1 | 28 | 0 | 5 | 33 | + +## Directories +| path | files | code | comment | blank | total | +| :--- | ---: | ---: | ---: | ---: | ---: | +| . | 30 | 7,309 | 2 | 1,032 | 8,343 | +| . (Files) | 1 | 16 | 0 | 5 | 21 | +| app | 2 | 296 | 0 | 55 | 351 | +| components | 18 | 6,553 | 0 | 904 | 7,457 | +| components\\activity | 1 | 288 | 0 | 51 | 339 | +| components\\controllers | 1 | 1,927 | 0 | 308 | 2,235 | +| components\\dashboard | 3 | 412 | 0 | 63 | 475 | +| components\\layout | 3 | 209 | 0 | 22 | 231 | +| components\\login | 1 | 165 | 0 | 27 | 192 | +| components\\provisioning | 1 | 1,707 | 0 | 283 | 1,990 | +| components\\settings | 1 | 1,272 | 0 | 70 | 1,342 | +| components\\udp2raw | 1 | 369 | 0 | 52 | 421 | +| components\\ui | 6 | 204 | 0 | 28 | 232 | +| services | 5 | 326 | 2 | 53 | 381 | +| styles | 1 | 28 | 0 | 5 | 33 | +| types | 3 | 90 | 0 | 10 | 100 | + +Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md) \ No newline at end of file diff --git a/.VSCodeCounter/2026-05-18_12-10-57/results.txt b/.VSCodeCounter/2026-05-18_12-10-57/results.txt new file mode 100644 index 0000000..6a87e9b --- /dev/null +++ b/.VSCodeCounter/2026-05-18_12-10-57/results.txt @@ -0,0 +1,71 @@ +Date : 2026-05-18 12:10:57 +Directory : c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src +Total : 30 files, 7309 codes, 2 comments, 1032 blanks, all 8343 lines + +Languages ++----------------+------------+------------+------------+------------+------------+ +| language | files | code | comment | blank | total | ++----------------+------------+------------+------------+------------+------------+ +| TypeScript JSX | 21 | 6,865 | 0 | 964 | 7,829 | +| TypeScript | 8 | 416 | 2 | 63 | 481 | +| PostCSS | 1 | 28 | 0 | 5 | 33 | ++----------------+------------+------------+------------+------------+------------+ + +Directories ++-------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+ +| path | files | code | comment | blank | total | ++-------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+ +| . | 30 | 7,309 | 2 | 1,032 | 8,343 | +| . (Files) | 1 | 16 | 0 | 5 | 21 | +| app | 2 | 296 | 0 | 55 | 351 | +| components | 18 | 6,553 | 0 | 904 | 7,457 | +| components\activity | 1 | 288 | 0 | 51 | 339 | +| components\controllers | 1 | 1,927 | 0 | 308 | 2,235 | +| components\dashboard | 3 | 412 | 0 | 63 | 475 | +| components\layout | 3 | 209 | 0 | 22 | 231 | +| components\login | 1 | 165 | 0 | 27 | 192 | +| components\provisioning | 1 | 1,707 | 0 | 283 | 1,990 | +| components\settings | 1 | 1,272 | 0 | 70 | 1,342 | +| components\udp2raw | 1 | 369 | 0 | 52 | 421 | +| components\ui | 6 | 204 | 0 | 28 | 232 | +| services | 5 | 326 | 2 | 53 | 381 | +| styles | 1 | 28 | 0 | 5 | 33 | +| types | 3 | 90 | 0 | 10 | 100 | ++-------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+ + +Files ++-------------------------------------------------------------------------------------------------------------------------------------+----------------+------------+------------+------------+------------+ +| filename | language | code | comment | blank | total | ++-------------------------------------------------------------------------------------------------------------------------------------+----------------+------------+------------+------------+------------+ +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\app\App.tsx | TypeScript JSX | 36 | 0 | 9 | 45 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\app\routes.tsx | TypeScript JSX | 260 | 0 | 46 | 306 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\activity\ActivityLogs.tsx | TypeScript JSX | 288 | 0 | 51 | 339 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\controllers\ControllersRoute.tsx | TypeScript JSX | 1,927 | 0 | 308 | 2,235 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\dashboard\IpPoolChart.tsx | TypeScript JSX | 117 | 0 | 17 | 134 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\dashboard\MetricCard.tsx | TypeScript JSX | 78 | 0 | 11 | 89 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\dashboard\NetworkTrafficChart.tsx | TypeScript JSX | 217 | 0 | 35 | 252 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\layout\AppShell.tsx | TypeScript JSX | 26 | 0 | 4 | 30 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\layout\Sidebar.tsx | TypeScript JSX | 88 | 0 | 11 | 99 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\layout\TopBar.tsx | TypeScript JSX | 95 | 0 | 7 | 102 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\login\LoginScreen.tsx | TypeScript JSX | 165 | 0 | 27 | 192 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\provisioning\ProvisioningWizard.tsx | TypeScript JSX | 1,707 | 0 | 283 | 1,990 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\settings\BackendSettings.tsx | TypeScript JSX | 1,272 | 0 | 70 | 1,342 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\udp2raw\Udp2rawConfig.tsx | TypeScript JSX | 369 | 0 | 52 | 421 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\ui\Badge.tsx | TypeScript JSX | 38 | 0 | 5 | 43 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\ui\Button.tsx | TypeScript JSX | 38 | 0 | 7 | 45 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\ui\Card.tsx | TypeScript JSX | 20 | 0 | 3 | 23 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\ui\Progress.tsx | TypeScript JSX | 21 | 0 | 2 | 23 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\ui\Select.tsx | TypeScript JSX | 71 | 0 | 10 | 81 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\ui\StatusDot.tsx | TypeScript JSX | 16 | 0 | 1 | 17 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\main.tsx | TypeScript JSX | 16 | 0 | 5 | 21 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\services\activityLogService.ts | TypeScript | 62 | 0 | 14 | 76 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\services\apiClient.ts | TypeScript | 80 | 0 | 13 | 93 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\services\loginApi.ts | TypeScript | 15 | 0 | 2 | 17 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\services\vpnApi.ts | TypeScript | 27 | 0 | 4 | 31 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\services\vpsApi.ts | TypeScript | 142 | 2 | 20 | 164 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\styles\globals.css | PostCSS | 28 | 0 | 5 | 33 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\types\activity.ts | TypeScript | 20 | 0 | 2 | 22 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\types\api.ts | TypeScript | 46 | 0 | 6 | 52 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\types\provisioning.ts | TypeScript | 24 | 0 | 2 | 26 | +| Total | | 7,309 | 2 | 1,032 | 8,343 | ++-------------------------------------------------------------------------------------------------------------------------------------+----------------+------------+------------+------------+------------+ \ No newline at end of file diff --git a/.VSCodeCounter/2026-05-18_12-12-03/details.md b/.VSCodeCounter/2026-05-18_12-12-03/details.md new file mode 100644 index 0000000..9e9a0a1 --- /dev/null +++ b/.VSCodeCounter/2026-05-18_12-12-03/details.md @@ -0,0 +1,28 @@ +# Details + +Date : 2026-05-18 12:12:03 + +Directory c:\\Users\\User\\Desktop\\Projetos\\Deployed\\LR OpenWRT Tool\\Frontend\\lr-openwrt-tool\\src-tauri + +Total : 13 files, 1139 codes, 0 comments, 220 blanks, all 1359 lines + +[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md) + +## Files +| filename | language | code | comment | blank | total | +| :--- | :--- | ---: | ---: | ---: | ---: | +| [src-tauri/build.rs](/src-tauri/build.rs) | Rust | 1 | 0 | 1 | 2 | +| [src-tauri/capabilities/default.json](/src-tauri/capabilities/default.json) | JSON | 11 | 0 | 0 | 11 | +| [src-tauri/icons/android/mipmap-anydpi-v26/ic\_launcher.xml](/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml) | XML | 5 | 0 | 0 | 5 | +| [src-tauri/icons/android/values/ic\_launcher\_background.xml](/src-tauri/icons/android/values/ic_launcher_background.xml) | XML | 4 | 0 | 0 | 4 | +| [src-tauri/src/commands/controllers.rs](/src-tauri/src/commands/controllers.rs) | Rust | 127 | 0 | 20 | 147 | +| [src-tauri/src/commands/files.rs](/src-tauri/src/commands/files.rs) | Rust | 12 | 0 | 0 | 12 | +| [src-tauri/src/commands/mod.rs](/src-tauri/src/commands/mod.rs) | Rust | 5 | 0 | 0 | 5 | +| [src-tauri/src/commands/network.rs](/src-tauri/src/commands/network.rs) | Rust | 12 | 0 | 1 | 13 | +| [src-tauri/src/commands/router.rs](/src-tauri/src/commands/router.rs) | Rust | 679 | 0 | 162 | 841 | +| [src-tauri/src/commands/ssh.rs](/src-tauri/src/commands/ssh.rs) | Rust | 179 | 0 | 32 | 211 | +| [src-tauri/src/lib.rs](/src-tauri/src/lib.rs) | Rust | 62 | 0 | 3 | 65 | +| [src-tauri/src/main.rs](/src-tauri/src/main.rs) | Rust | 4 | 0 | 1 | 5 | +| [src-tauri/tauri.conf.json](/src-tauri/tauri.conf.json) | JSON | 38 | 0 | 0 | 38 | + +[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md) \ No newline at end of file diff --git a/.VSCodeCounter/2026-05-18_12-12-03/diff-details.md b/.VSCodeCounter/2026-05-18_12-12-03/diff-details.md new file mode 100644 index 0000000..9c86670 --- /dev/null +++ b/.VSCodeCounter/2026-05-18_12-12-03/diff-details.md @@ -0,0 +1,58 @@ +# Diff Details + +Date : 2026-05-18 12:12:03 + +Directory c:\\Users\\User\\Desktop\\Projetos\\Deployed\\LR OpenWRT Tool\\Frontend\\lr-openwrt-tool\\src-tauri + +Total : 43 files, -6170 codes, -2 comments, -812 blanks, all -6984 lines + +[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details + +## Files +| filename | language | code | comment | blank | total | +| :--- | :--- | ---: | ---: | ---: | ---: | +| [src-tauri/build.rs](/src-tauri/build.rs) | Rust | 1 | 0 | 1 | 2 | +| [src-tauri/capabilities/default.json](/src-tauri/capabilities/default.json) | JSON | 11 | 0 | 0 | 11 | +| [src-tauri/icons/android/mipmap-anydpi-v26/ic\_launcher.xml](/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml) | XML | 5 | 0 | 0 | 5 | +| [src-tauri/icons/android/values/ic\_launcher\_background.xml](/src-tauri/icons/android/values/ic_launcher_background.xml) | XML | 4 | 0 | 0 | 4 | +| [src-tauri/src/commands/controllers.rs](/src-tauri/src/commands/controllers.rs) | Rust | 127 | 0 | 20 | 147 | +| [src-tauri/src/commands/files.rs](/src-tauri/src/commands/files.rs) | Rust | 12 | 0 | 0 | 12 | +| [src-tauri/src/commands/mod.rs](/src-tauri/src/commands/mod.rs) | Rust | 5 | 0 | 0 | 5 | +| [src-tauri/src/commands/network.rs](/src-tauri/src/commands/network.rs) | Rust | 12 | 0 | 1 | 13 | +| [src-tauri/src/commands/router.rs](/src-tauri/src/commands/router.rs) | Rust | 679 | 0 | 162 | 841 | +| [src-tauri/src/commands/ssh.rs](/src-tauri/src/commands/ssh.rs) | Rust | 179 | 0 | 32 | 211 | +| [src-tauri/src/lib.rs](/src-tauri/src/lib.rs) | Rust | 62 | 0 | 3 | 65 | +| [src-tauri/src/main.rs](/src-tauri/src/main.rs) | Rust | 4 | 0 | 1 | 5 | +| [src-tauri/tauri.conf.json](/src-tauri/tauri.conf.json) | JSON | 38 | 0 | 0 | 38 | +| [src/app/App.tsx](/src/app/App.tsx) | TypeScript JSX | -36 | 0 | -9 | -45 | +| [src/app/routes.tsx](/src/app/routes.tsx) | TypeScript JSX | -260 | 0 | -46 | -306 | +| [src/components/activity/ActivityLogs.tsx](/src/components/activity/ActivityLogs.tsx) | TypeScript JSX | -288 | 0 | -51 | -339 | +| [src/components/controllers/ControllersRoute.tsx](/src/components/controllers/ControllersRoute.tsx) | TypeScript JSX | -1,927 | 0 | -308 | -2,235 | +| [src/components/dashboard/IpPoolChart.tsx](/src/components/dashboard/IpPoolChart.tsx) | TypeScript JSX | -117 | 0 | -17 | -134 | +| [src/components/dashboard/MetricCard.tsx](/src/components/dashboard/MetricCard.tsx) | TypeScript JSX | -78 | 0 | -11 | -89 | +| [src/components/dashboard/NetworkTrafficChart.tsx](/src/components/dashboard/NetworkTrafficChart.tsx) | TypeScript JSX | -217 | 0 | -35 | -252 | +| [src/components/layout/AppShell.tsx](/src/components/layout/AppShell.tsx) | TypeScript JSX | -26 | 0 | -4 | -30 | +| [src/components/layout/Sidebar.tsx](/src/components/layout/Sidebar.tsx) | TypeScript JSX | -88 | 0 | -11 | -99 | +| [src/components/layout/TopBar.tsx](/src/components/layout/TopBar.tsx) | TypeScript JSX | -95 | 0 | -7 | -102 | +| [src/components/login/LoginScreen.tsx](/src/components/login/LoginScreen.tsx) | TypeScript JSX | -165 | 0 | -27 | -192 | +| [src/components/provisioning/ProvisioningWizard.tsx](/src/components/provisioning/ProvisioningWizard.tsx) | TypeScript JSX | -1,707 | 0 | -283 | -1,990 | +| [src/components/settings/BackendSettings.tsx](/src/components/settings/BackendSettings.tsx) | TypeScript JSX | -1,272 | 0 | -70 | -1,342 | +| [src/components/udp2raw/Udp2rawConfig.tsx](/src/components/udp2raw/Udp2rawConfig.tsx) | TypeScript JSX | -369 | 0 | -52 | -421 | +| [src/components/ui/Badge.tsx](/src/components/ui/Badge.tsx) | TypeScript JSX | -38 | 0 | -5 | -43 | +| [src/components/ui/Button.tsx](/src/components/ui/Button.tsx) | TypeScript JSX | -38 | 0 | -7 | -45 | +| [src/components/ui/Card.tsx](/src/components/ui/Card.tsx) | TypeScript JSX | -20 | 0 | -3 | -23 | +| [src/components/ui/Progress.tsx](/src/components/ui/Progress.tsx) | TypeScript JSX | -21 | 0 | -2 | -23 | +| [src/components/ui/Select.tsx](/src/components/ui/Select.tsx) | TypeScript JSX | -71 | 0 | -10 | -81 | +| [src/components/ui/StatusDot.tsx](/src/components/ui/StatusDot.tsx) | TypeScript JSX | -16 | 0 | -1 | -17 | +| [src/main.tsx](/src/main.tsx) | TypeScript JSX | -16 | 0 | -5 | -21 | +| [src/services/activityLogService.ts](/src/services/activityLogService.ts) | TypeScript | -62 | 0 | -14 | -76 | +| [src/services/apiClient.ts](/src/services/apiClient.ts) | TypeScript | -80 | 0 | -13 | -93 | +| [src/services/loginApi.ts](/src/services/loginApi.ts) | TypeScript | -15 | 0 | -2 | -17 | +| [src/services/vpnApi.ts](/src/services/vpnApi.ts) | TypeScript | -27 | 0 | -4 | -31 | +| [src/services/vpsApi.ts](/src/services/vpsApi.ts) | TypeScript | -142 | -2 | -20 | -164 | +| [src/styles/globals.css](/src/styles/globals.css) | PostCSS | -28 | 0 | -5 | -33 | +| [src/types/activity.ts](/src/types/activity.ts) | TypeScript | -20 | 0 | -2 | -22 | +| [src/types/api.ts](/src/types/api.ts) | TypeScript | -46 | 0 | -6 | -52 | +| [src/types/provisioning.ts](/src/types/provisioning.ts) | TypeScript | -24 | 0 | -2 | -26 | + +[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details \ No newline at end of file diff --git a/.VSCodeCounter/2026-05-18_12-12-03/diff.csv b/.VSCodeCounter/2026-05-18_12-12-03/diff.csv new file mode 100644 index 0000000..148291f --- /dev/null +++ b/.VSCodeCounter/2026-05-18_12-12-03/diff.csv @@ -0,0 +1,45 @@ +"filename", "language", "JSON", "Rust", "XML", "TypeScript", "PostCSS", "TypeScript JSX", "comment", "blank", "total" +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\build.rs", "Rust", 0, 1, 0, 0, 0, 0, 0, 1, 2 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\capabilities\default.json", "JSON", 11, 0, 0, 0, 0, 0, 0, 0, 11 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\icons\android\mipmap-anydpi-v26\ic_launcher.xml", "XML", 0, 0, 5, 0, 0, 0, 0, 0, 5 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\icons\android\values\ic_launcher_background.xml", "XML", 0, 0, 4, 0, 0, 0, 0, 0, 4 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\commands\controllers.rs", "Rust", 0, 127, 0, 0, 0, 0, 0, 20, 147 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\commands\files.rs", "Rust", 0, 12, 0, 0, 0, 0, 0, 0, 12 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\commands\mod.rs", "Rust", 0, 5, 0, 0, 0, 0, 0, 0, 5 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\commands\network.rs", "Rust", 0, 12, 0, 0, 0, 0, 0, 1, 13 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\commands\router.rs", "Rust", 0, 679, 0, 0, 0, 0, 0, 162, 841 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\commands\ssh.rs", "Rust", 0, 179, 0, 0, 0, 0, 0, 32, 211 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\lib.rs", "Rust", 0, 62, 0, 0, 0, 0, 0, 3, 65 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\main.rs", "Rust", 0, 4, 0, 0, 0, 0, 0, 1, 5 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\tauri.conf.json", "JSON", 38, 0, 0, 0, 0, 0, 0, 0, 38 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\app\App.tsx", "TypeScript JSX", 0, 0, 0, 0, 0, -36, 0, -9, -45 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\app\routes.tsx", "TypeScript JSX", 0, 0, 0, 0, 0, -260, 0, -46, -306 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\activity\ActivityLogs.tsx", "TypeScript JSX", 0, 0, 0, 0, 0, -288, 0, -51, -339 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\controllers\ControllersRoute.tsx", "TypeScript JSX", 0, 0, 0, 0, 0, -1927, 0, -308, -2235 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\dashboard\IpPoolChart.tsx", "TypeScript JSX", 0, 0, 0, 0, 0, -117, 0, -17, -134 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\dashboard\MetricCard.tsx", "TypeScript JSX", 0, 0, 0, 0, 0, -78, 0, -11, -89 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\dashboard\NetworkTrafficChart.tsx", "TypeScript JSX", 0, 0, 0, 0, 0, -217, 0, -35, -252 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\layout\AppShell.tsx", "TypeScript JSX", 0, 0, 0, 0, 0, -26, 0, -4, -30 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\layout\Sidebar.tsx", "TypeScript JSX", 0, 0, 0, 0, 0, -88, 0, -11, -99 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\layout\TopBar.tsx", "TypeScript JSX", 0, 0, 0, 0, 0, -95, 0, -7, -102 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\login\LoginScreen.tsx", "TypeScript JSX", 0, 0, 0, 0, 0, -165, 0, -27, -192 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\provisioning\ProvisioningWizard.tsx", "TypeScript JSX", 0, 0, 0, 0, 0, -1707, 0, -283, -1990 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\settings\BackendSettings.tsx", "TypeScript JSX", 0, 0, 0, 0, 0, -1272, 0, -70, -1342 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\udp2raw\Udp2rawConfig.tsx", "TypeScript JSX", 0, 0, 0, 0, 0, -369, 0, -52, -421 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\ui\Badge.tsx", "TypeScript JSX", 0, 0, 0, 0, 0, -38, 0, -5, -43 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\ui\Button.tsx", "TypeScript JSX", 0, 0, 0, 0, 0, -38, 0, -7, -45 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\ui\Card.tsx", "TypeScript JSX", 0, 0, 0, 0, 0, -20, 0, -3, -23 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\ui\Progress.tsx", "TypeScript JSX", 0, 0, 0, 0, 0, -21, 0, -2, -23 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\ui\Select.tsx", "TypeScript JSX", 0, 0, 0, 0, 0, -71, 0, -10, -81 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\ui\StatusDot.tsx", "TypeScript JSX", 0, 0, 0, 0, 0, -16, 0, -1, -17 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\main.tsx", "TypeScript JSX", 0, 0, 0, 0, 0, -16, 0, -5, -21 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\services\activityLogService.ts", "TypeScript", 0, 0, 0, -62, 0, 0, 0, -14, -76 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\services\apiClient.ts", "TypeScript", 0, 0, 0, -80, 0, 0, 0, -13, -93 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\services\loginApi.ts", "TypeScript", 0, 0, 0, -15, 0, 0, 0, -2, -17 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\services\vpnApi.ts", "TypeScript", 0, 0, 0, -27, 0, 0, 0, -4, -31 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\services\vpsApi.ts", "TypeScript", 0, 0, 0, -142, 0, 0, -2, -20, -164 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\styles\globals.css", "PostCSS", 0, 0, 0, 0, -28, 0, 0, -5, -33 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\types\activity.ts", "TypeScript", 0, 0, 0, -20, 0, 0, 0, -2, -22 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\types\api.ts", "TypeScript", 0, 0, 0, -46, 0, 0, 0, -6, -52 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\types\provisioning.ts", "TypeScript", 0, 0, 0, -24, 0, 0, 0, -2, -26 +"Total", "-", 49, 1081, 9, -416, -28, -6865, -2, -812, -6984 \ No newline at end of file diff --git a/.VSCodeCounter/2026-05-18_12-12-03/diff.md b/.VSCodeCounter/2026-05-18_12-12-03/diff.md new file mode 100644 index 0000000..9b74c49 --- /dev/null +++ b/.VSCodeCounter/2026-05-18_12-12-03/diff.md @@ -0,0 +1,52 @@ +# Diff Summary + +Date : 2026-05-18 12:12:03 + +Directory c:\\Users\\User\\Desktop\\Projetos\\Deployed\\LR OpenWRT Tool\\Frontend\\lr-openwrt-tool\\src-tauri + +Total : 43 files, -6170 codes, -2 comments, -812 blanks, all -6984 lines + +[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md) + +## Languages +| language | files | code | comment | blank | total | +| :--- | ---: | ---: | ---: | ---: | ---: | +| Rust | 9 | 1,081 | 0 | 220 | 1,301 | +| JSON | 2 | 49 | 0 | 0 | 49 | +| XML | 2 | 9 | 0 | 0 | 9 | +| PostCSS | 1 | -28 | 0 | -5 | -33 | +| TypeScript | 8 | -416 | -2 | -63 | -481 | +| TypeScript JSX | 21 | -6,865 | 0 | -964 | -7,829 | + +## Directories +| path | files | code | comment | blank | total | +| :--- | ---: | ---: | ---: | ---: | ---: | +| . | 43 | -6,170 | -2 | -812 | -6,984 | +| . (Files) | 2 | 39 | 0 | 1 | 40 | +| .. | 30 | -7,309 | -2 | -1,032 | -8,343 | +| ..\\src | 30 | -7,309 | -2 | -1,032 | -8,343 | +| ..\\src (Files) | 1 | -16 | 0 | -5 | -21 | +| ..\\src\\app | 2 | -296 | 0 | -55 | -351 | +| ..\\src\\components | 18 | -6,553 | 0 | -904 | -7,457 | +| ..\\src\\components\\activity | 1 | -288 | 0 | -51 | -339 | +| ..\\src\\components\\controllers | 1 | -1,927 | 0 | -308 | -2,235 | +| ..\\src\\components\\dashboard | 3 | -412 | 0 | -63 | -475 | +| ..\\src\\components\\layout | 3 | -209 | 0 | -22 | -231 | +| ..\\src\\components\\login | 1 | -165 | 0 | -27 | -192 | +| ..\\src\\components\\provisioning | 1 | -1,707 | 0 | -283 | -1,990 | +| ..\\src\\components\\settings | 1 | -1,272 | 0 | -70 | -1,342 | +| ..\\src\\components\\udp2raw | 1 | -369 | 0 | -52 | -421 | +| ..\\src\\components\\ui | 6 | -204 | 0 | -28 | -232 | +| ..\\src\\services | 5 | -326 | -2 | -53 | -381 | +| ..\\src\\styles | 1 | -28 | 0 | -5 | -33 | +| ..\\src\\types | 3 | -90 | 0 | -10 | -100 | +| capabilities | 1 | 11 | 0 | 0 | 11 | +| icons | 2 | 9 | 0 | 0 | 9 | +| icons\\android | 2 | 9 | 0 | 0 | 9 | +| icons\\android\\mipmap-anydpi-v26 | 1 | 5 | 0 | 0 | 5 | +| icons\\android\\values | 1 | 4 | 0 | 0 | 4 | +| src | 8 | 1,080 | 0 | 219 | 1,299 | +| src (Files) | 2 | 66 | 0 | 4 | 70 | +| src\\commands | 6 | 1,014 | 0 | 215 | 1,229 | + +[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md) \ No newline at end of file diff --git a/.VSCodeCounter/2026-05-18_12-12-03/diff.txt b/.VSCodeCounter/2026-05-18_12-12-03/diff.txt new file mode 100644 index 0000000..4ac369a --- /dev/null +++ b/.VSCodeCounter/2026-05-18_12-12-03/diff.txt @@ -0,0 +1,98 @@ +Date : 2026-05-18 12:12:03 +Directory : c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri +Total : 43 files, -6170 codes, -2 comments, -812 blanks, all -6984 lines + +Languages ++----------------+------------+------------+------------+------------+------------+ +| language | files | code | comment | blank | total | ++----------------+------------+------------+------------+------------+------------+ +| Rust | 9 | 1,081 | 0 | 220 | 1,301 | +| JSON | 2 | 49 | 0 | 0 | 49 | +| XML | 2 | 9 | 0 | 0 | 9 | +| PostCSS | 1 | -28 | 0 | -5 | -33 | +| TypeScript | 8 | -416 | -2 | -63 | -481 | +| TypeScript JSX | 21 | -6,865 | 0 | -964 | -7,829 | ++----------------+------------+------------+------------+------------+------------+ + +Directories ++--------------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+ +| path | files | code | comment | blank | total | ++--------------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+ +| . | 43 | -6,170 | -2 | -812 | -6,984 | +| . (Files) | 2 | 39 | 0 | 1 | 40 | +| .. | 30 | -7,309 | -2 | -1,032 | -8,343 | +| ..\src | 30 | -7,309 | -2 | -1,032 | -8,343 | +| ..\src (Files) | 1 | -16 | 0 | -5 | -21 | +| ..\src\app | 2 | -296 | 0 | -55 | -351 | +| ..\src\components | 18 | -6,553 | 0 | -904 | -7,457 | +| ..\src\components\activity | 1 | -288 | 0 | -51 | -339 | +| ..\src\components\controllers | 1 | -1,927 | 0 | -308 | -2,235 | +| ..\src\components\dashboard | 3 | -412 | 0 | -63 | -475 | +| ..\src\components\layout | 3 | -209 | 0 | -22 | -231 | +| ..\src\components\login | 1 | -165 | 0 | -27 | -192 | +| ..\src\components\provisioning | 1 | -1,707 | 0 | -283 | -1,990 | +| ..\src\components\settings | 1 | -1,272 | 0 | -70 | -1,342 | +| ..\src\components\udp2raw | 1 | -369 | 0 | -52 | -421 | +| ..\src\components\ui | 6 | -204 | 0 | -28 | -232 | +| ..\src\services | 5 | -326 | -2 | -53 | -381 | +| ..\src\styles | 1 | -28 | 0 | -5 | -33 | +| ..\src\types | 3 | -90 | 0 | -10 | -100 | +| capabilities | 1 | 11 | 0 | 0 | 11 | +| icons | 2 | 9 | 0 | 0 | 9 | +| icons\android | 2 | 9 | 0 | 0 | 9 | +| icons\android\mipmap-anydpi-v26 | 1 | 5 | 0 | 0 | 5 | +| icons\android\values | 1 | 4 | 0 | 0 | 4 | +| src | 8 | 1,080 | 0 | 219 | 1,299 | +| src (Files) | 2 | 66 | 0 | 4 | 70 | +| src\commands | 6 | 1,014 | 0 | 215 | 1,229 | ++--------------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+ + +Files ++--------------------------------------------------------------------------------------------------------------------------------------------+----------------+------------+------------+------------+------------+ +| filename | language | code | comment | blank | total | ++--------------------------------------------------------------------------------------------------------------------------------------------+----------------+------------+------------+------------+------------+ +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\build.rs | Rust | 1 | 0 | 1 | 2 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\capabilities\default.json | JSON | 11 | 0 | 0 | 11 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\icons\android\mipmap-anydpi-v26\ic_launcher.xml | XML | 5 | 0 | 0 | 5 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\icons\android\values\ic_launcher_background.xml | XML | 4 | 0 | 0 | 4 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\commands\controllers.rs | Rust | 127 | 0 | 20 | 147 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\commands\files.rs | Rust | 12 | 0 | 0 | 12 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\commands\mod.rs | Rust | 5 | 0 | 0 | 5 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\commands\network.rs | Rust | 12 | 0 | 1 | 13 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\commands\router.rs | Rust | 679 | 0 | 162 | 841 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\commands\ssh.rs | Rust | 179 | 0 | 32 | 211 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\lib.rs | Rust | 62 | 0 | 3 | 65 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\main.rs | Rust | 4 | 0 | 1 | 5 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\tauri.conf.json | JSON | 38 | 0 | 0 | 38 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\app\App.tsx | TypeScript JSX | -36 | 0 | -9 | -45 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\app\routes.tsx | TypeScript JSX | -260 | 0 | -46 | -306 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\activity\ActivityLogs.tsx | TypeScript JSX | -288 | 0 | -51 | -339 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\controllers\ControllersRoute.tsx | TypeScript JSX | -1,927 | 0 | -308 | -2,235 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\dashboard\IpPoolChart.tsx | TypeScript JSX | -117 | 0 | -17 | -134 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\dashboard\MetricCard.tsx | TypeScript JSX | -78 | 0 | -11 | -89 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\dashboard\NetworkTrafficChart.tsx | TypeScript JSX | -217 | 0 | -35 | -252 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\layout\AppShell.tsx | TypeScript JSX | -26 | 0 | -4 | -30 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\layout\Sidebar.tsx | TypeScript JSX | -88 | 0 | -11 | -99 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\layout\TopBar.tsx | TypeScript JSX | -95 | 0 | -7 | -102 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\login\LoginScreen.tsx | TypeScript JSX | -165 | 0 | -27 | -192 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\provisioning\ProvisioningWizard.tsx | TypeScript JSX | -1,707 | 0 | -283 | -1,990 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\settings\BackendSettings.tsx | TypeScript JSX | -1,272 | 0 | -70 | -1,342 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\udp2raw\Udp2rawConfig.tsx | TypeScript JSX | -369 | 0 | -52 | -421 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\ui\Badge.tsx | TypeScript JSX | -38 | 0 | -5 | -43 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\ui\Button.tsx | TypeScript JSX | -38 | 0 | -7 | -45 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\ui\Card.tsx | TypeScript JSX | -20 | 0 | -3 | -23 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\ui\Progress.tsx | TypeScript JSX | -21 | 0 | -2 | -23 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\ui\Select.tsx | TypeScript JSX | -71 | 0 | -10 | -81 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\components\ui\StatusDot.tsx | TypeScript JSX | -16 | 0 | -1 | -17 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\main.tsx | TypeScript JSX | -16 | 0 | -5 | -21 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\services\activityLogService.ts | TypeScript | -62 | 0 | -14 | -76 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\services\apiClient.ts | TypeScript | -80 | 0 | -13 | -93 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\services\loginApi.ts | TypeScript | -15 | 0 | -2 | -17 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\services\vpnApi.ts | TypeScript | -27 | 0 | -4 | -31 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\services\vpsApi.ts | TypeScript | -142 | -2 | -20 | -164 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\styles\globals.css | PostCSS | -28 | 0 | -5 | -33 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\types\activity.ts | TypeScript | -20 | 0 | -2 | -22 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\types\api.ts | TypeScript | -46 | 0 | -6 | -52 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src\types\provisioning.ts | TypeScript | -24 | 0 | -2 | -26 | +| Total | | -6,170 | -2 | -812 | -6,984 | ++--------------------------------------------------------------------------------------------------------------------------------------------+----------------+------------+------------+------------+------------+ \ No newline at end of file diff --git a/.VSCodeCounter/2026-05-18_12-12-03/results.csv b/.VSCodeCounter/2026-05-18_12-12-03/results.csv new file mode 100644 index 0000000..196b355 --- /dev/null +++ b/.VSCodeCounter/2026-05-18_12-12-03/results.csv @@ -0,0 +1,15 @@ +"filename", "language", "JSON", "Rust", "XML", "comment", "blank", "total" +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\build.rs", "Rust", 0, 1, 0, 0, 1, 2 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\capabilities\default.json", "JSON", 11, 0, 0, 0, 0, 11 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\icons\android\mipmap-anydpi-v26\ic_launcher.xml", "XML", 0, 0, 5, 0, 0, 5 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\icons\android\values\ic_launcher_background.xml", "XML", 0, 0, 4, 0, 0, 4 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\commands\controllers.rs", "Rust", 0, 127, 0, 0, 20, 147 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\commands\files.rs", "Rust", 0, 12, 0, 0, 0, 12 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\commands\mod.rs", "Rust", 0, 5, 0, 0, 0, 5 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\commands\network.rs", "Rust", 0, 12, 0, 0, 1, 13 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\commands\router.rs", "Rust", 0, 679, 0, 0, 162, 841 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\commands\ssh.rs", "Rust", 0, 179, 0, 0, 32, 211 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\lib.rs", "Rust", 0, 62, 0, 0, 3, 65 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\main.rs", "Rust", 0, 4, 0, 0, 1, 5 +"c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\tauri.conf.json", "JSON", 38, 0, 0, 0, 0, 38 +"Total", "-", 49, 1081, 9, 0, 220, 1359 \ No newline at end of file diff --git a/.VSCodeCounter/2026-05-18_12-12-03/results.json b/.VSCodeCounter/2026-05-18_12-12-03/results.json new file mode 100644 index 0000000..698f6a4 --- /dev/null +++ b/.VSCodeCounter/2026-05-18_12-12-03/results.json @@ -0,0 +1 @@ +{"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src-tauri/tauri.conf.json":{"language":"JSON","code":38,"comment":0,"blank":0},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src-tauri/src/main.rs":{"language":"Rust","code":4,"comment":0,"blank":1},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src-tauri/src/commands/ssh.rs":{"language":"Rust","code":179,"comment":0,"blank":32},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src-tauri/src/commands/network.rs":{"language":"Rust","code":12,"comment":0,"blank":1},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src-tauri/src/commands/mod.rs":{"language":"Rust","code":5,"comment":0,"blank":0},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src-tauri/src/lib.rs":{"language":"Rust","code":62,"comment":0,"blank":3},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src-tauri/src/commands/files.rs":{"language":"Rust","code":12,"comment":0,"blank":0},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src-tauri/src/commands/router.rs":{"language":"Rust","code":679,"comment":0,"blank":162},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src-tauri/icons/android/values/ic_launcher_background.xml":{"language":"XML","code":4,"comment":0,"blank":0},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src-tauri/src/commands/controllers.rs":{"language":"Rust","code":127,"comment":0,"blank":20},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src-tauri/capabilities/default.json":{"language":"JSON","code":11,"comment":0,"blank":0},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src-tauri/build.rs":{"language":"Rust","code":1,"comment":0,"blank":1},"file:///c%3A/Users/User/Desktop/Projetos/Deployed/LR%20OpenWRT%20Tool/Frontend/lr-openwrt-tool/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml":{"language":"XML","code":5,"comment":0,"blank":0}} \ No newline at end of file diff --git a/.VSCodeCounter/2026-05-18_12-12-03/results.md b/.VSCodeCounter/2026-05-18_12-12-03/results.md new file mode 100644 index 0000000..51f68e0 --- /dev/null +++ b/.VSCodeCounter/2026-05-18_12-12-03/results.md @@ -0,0 +1,32 @@ +# Summary + +Date : 2026-05-18 12:12:03 + +Directory c:\\Users\\User\\Desktop\\Projetos\\Deployed\\LR OpenWRT Tool\\Frontend\\lr-openwrt-tool\\src-tauri + +Total : 13 files, 1139 codes, 0 comments, 220 blanks, all 1359 lines + +Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md) + +## Languages +| language | files | code | comment | blank | total | +| :--- | ---: | ---: | ---: | ---: | ---: | +| Rust | 9 | 1,081 | 0 | 220 | 1,301 | +| JSON | 2 | 49 | 0 | 0 | 49 | +| XML | 2 | 9 | 0 | 0 | 9 | + +## Directories +| path | files | code | comment | blank | total | +| :--- | ---: | ---: | ---: | ---: | ---: | +| . | 13 | 1,139 | 0 | 220 | 1,359 | +| . (Files) | 2 | 39 | 0 | 1 | 40 | +| capabilities | 1 | 11 | 0 | 0 | 11 | +| icons | 2 | 9 | 0 | 0 | 9 | +| icons\\android | 2 | 9 | 0 | 0 | 9 | +| icons\\android\\mipmap-anydpi-v26 | 1 | 5 | 0 | 0 | 5 | +| icons\\android\\values | 1 | 4 | 0 | 0 | 4 | +| src | 8 | 1,080 | 0 | 219 | 1,299 | +| src (Files) | 2 | 66 | 0 | 4 | 70 | +| src\\commands | 6 | 1,014 | 0 | 215 | 1,229 | + +Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md) \ No newline at end of file diff --git a/.VSCodeCounter/2026-05-18_12-12-03/results.txt b/.VSCodeCounter/2026-05-18_12-12-03/results.txt new file mode 100644 index 0000000..20ea1a7 --- /dev/null +++ b/.VSCodeCounter/2026-05-18_12-12-03/results.txt @@ -0,0 +1,48 @@ +Date : 2026-05-18 12:12:03 +Directory : c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri +Total : 13 files, 1139 codes, 0 comments, 220 blanks, all 1359 lines + +Languages ++----------+------------+------------+------------+------------+------------+ +| language | files | code | comment | blank | total | ++----------+------------+------------+------------+------------+------------+ +| Rust | 9 | 1,081 | 0 | 220 | 1,301 | +| JSON | 2 | 49 | 0 | 0 | 49 | +| XML | 2 | 9 | 0 | 0 | 9 | ++----------+------------+------------+------------+------------+------------+ + +Directories ++--------------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+ +| path | files | code | comment | blank | total | ++--------------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+ +| . | 13 | 1,139 | 0 | 220 | 1,359 | +| . (Files) | 2 | 39 | 0 | 1 | 40 | +| capabilities | 1 | 11 | 0 | 0 | 11 | +| icons | 2 | 9 | 0 | 0 | 9 | +| icons\android | 2 | 9 | 0 | 0 | 9 | +| icons\android\mipmap-anydpi-v26 | 1 | 5 | 0 | 0 | 5 | +| icons\android\values | 1 | 4 | 0 | 0 | 4 | +| src | 8 | 1,080 | 0 | 219 | 1,299 | +| src (Files) | 2 | 66 | 0 | 4 | 70 | +| src\commands | 6 | 1,014 | 0 | 215 | 1,229 | ++--------------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+ + +Files ++--------------------------------------------------------------------------------------------------------------------------------------------+----------+------------+------------+------------+------------+ +| filename | language | code | comment | blank | total | ++--------------------------------------------------------------------------------------------------------------------------------------------+----------+------------+------------+------------+------------+ +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\build.rs | Rust | 1 | 0 | 1 | 2 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\capabilities\default.json | JSON | 11 | 0 | 0 | 11 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\icons\android\mipmap-anydpi-v26\ic_launcher.xml | XML | 5 | 0 | 0 | 5 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\icons\android\values\ic_launcher_background.xml | XML | 4 | 0 | 0 | 4 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\commands\controllers.rs | Rust | 127 | 0 | 20 | 147 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\commands\files.rs | Rust | 12 | 0 | 0 | 12 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\commands\mod.rs | Rust | 5 | 0 | 0 | 5 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\commands\network.rs | Rust | 12 | 0 | 1 | 13 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\commands\router.rs | Rust | 679 | 0 | 162 | 841 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\commands\ssh.rs | Rust | 179 | 0 | 32 | 211 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\lib.rs | Rust | 62 | 0 | 3 | 65 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\src\main.rs | Rust | 4 | 0 | 1 | 5 | +| c:\Users\User\Desktop\Projetos\Deployed\LR OpenWRT Tool\Frontend\lr-openwrt-tool\src-tauri\tauri.conf.json | JSON | 38 | 0 | 0 | 38 | +| Total | | 1,139 | 0 | 220 | 1,359 | ++--------------------------------------------------------------------------------------------------------------------------------------------+----------+------------+------------+------------+------------+ \ No newline at end of file diff --git a/src/components/controllers/ControllersRoute.tsx b/src/components/controllers/ControllersRoute.tsx index 8ccdc73..c69356f 100644 --- a/src/components/controllers/ControllersRoute.tsx +++ b/src/components/controllers/ControllersRoute.tsx @@ -10,13 +10,20 @@ import { ShieldCheck, Trash2, X, + Router, + LockKeyhole, + Network, + Eye, + EyeOff, } from 'lucide-react'; import { Card } from '@/components/ui/Card'; import { Select } from '@/components/ui/Select'; import { vpsApi } from '@/services/vpsApi'; +import { Button } from '@/components/ui/Button'; import type { ControllerClient } from '@/services/vpsApi'; +import type { RouterFirewallRule } from '@/services/vpsApi'; const scrollClass = '[scrollbar-width:thin] [scrollbar-color:rgba(59,130,246,0.55)_transparent] [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-blue-500/45 hover:[&::-webkit-scrollbar-thumb]:bg-blue-500/65'; @@ -53,7 +60,23 @@ export function ControllersRoute() { const [editingClient, setEditingClient] = useState(null); - async function loadClients() { + const [creatingClient, setCreatingClient] = useState(false); + const [deletingClientId, setDeletingClientId] = useState(''); + const [clientToDelete, setClientToDelete] = useState(null); + const [selectedRouterIp, setSelectedRouterIp] = useState(''); + const [selectedClientFileContent, setSelectedClientFileContent] = useState(''); + const [loadingRouterData, setLoadingRouterData] = useState(false); + const [routerDataError, setRouterDataError] = useState(''); + const [routerRules, setRouterRules] = useState([]); + const [routerPassword, setRouterPassword] = useState('litoralr'); + const [showRouterPassword, setShowRouterPassword] = useState(false); + const [creatingRule, setCreatingRule] = useState(false); + const [ruleToUpdate, setRuleToUpdate] = useState(null); + const [ruleToDelete, setRuleToDelete] = useState(null); + const [savingRule, setSavingRule] = useState(false); + + + async function loadClients(selectClientId?: string) { try { setLoading(true); setError(''); @@ -61,7 +84,13 @@ export function ControllersRoute() { const response = await vpsApi.listControllerClients(); setClients(response.clients); - setSelectedId((current) => current || response.clients[0]?.id || ''); + + setSelectedId((current) => + selectClientId || + current || + response.clients[0]?.id || + '', + ); } catch (err) { setError(String(err)); setClients([]); @@ -110,6 +139,156 @@ export function ControllersRoute() { filteredClients.find((client) => client.id === selectedId) ?? filteredClients[0]; + useEffect(() => { + if (!selectedClient) { + setSelectedClientFileContent(''); + setSelectedRouterIp(''); + setRouterDataError(''); + setRouterRules([]); + return; + } + + let cancelled = false; + + async function loadSelectedClientFile() { + try { + setLoadingRouterData(true); + setRouterDataError(''); + + const response = await vpsApi.readControllerClient(selectedClient.id); + + if (cancelled) return; + + setSelectedClientFileContent(response.content); + } catch (err) { + if (cancelled) return; + + setSelectedClientFileContent(''); + setSelectedRouterIp(''); + setRouterDataError(String(err)); + } finally { + if (!cancelled) { + setLoadingRouterData(false); + } + } + } + + loadSelectedClientFile(); + + return () => { + cancelled = true; + }; + }, [selectedClient?.id]); + + const routerGroups = useMemo(() => { + if (!selectedClientFileContent) return []; + + const parsed = parseClientTxt(selectedClientFileContent); + const groups = new Map(); + + parsed.controllers.forEach((controller) => { + const router = controller.routerVpnIp.trim(); + + if (!router) return; + + groups.set(router, [...(groups.get(router) ?? []), controller]); + }); + + return Array.from(groups.entries()).map(([routerVpnIp, controllers]) => ({ + routerVpnIp, + controllers, + })); + }, [selectedClientFileContent]); + + useEffect(() => { + if (routerGroups.length === 0) { + setSelectedRouterIp(''); + return; + } + + setSelectedRouterIp((current) => { + const currentStillExists = routerGroups.some( + (group) => group.routerVpnIp === current, + ); + + return currentStillExists ? current : routerGroups[0].routerVpnIp; + }); + }, [routerGroups]); + + const selectedRouterGroup = routerGroups.find( + (group) => group.routerVpnIp === selectedRouterIp, + ); + + const routerRulesLoaded = routerRules.length > 0; + + useEffect(() => { + setRouterRules([]); + setRouterDataError(''); + }, [selectedRouterIp]); + + async function deleteClient(client: ControllerClient) { + try { + setDeletingClientId(client.id); + setError(''); + + await vpsApi.deleteControllerClient(client.id); + await loadClients(); + + setSelectedId((current) => (current === client.id ? '' : current)); + setClientToDelete(null); + } catch (err) { + setError(String(err)); + } finally { + setDeletingClientId(''); + } + } + + async function loadRouterRules() { + if (!selectedRouterIp || !routerPassword.trim()) return; + + try { + setLoadingRouterData(true); + setRouterDataError(''); + + const response = await vpsApi.getRouterFirewallRules( + selectedRouterIp, + routerPassword.trim(), + ); + + setRouterRules(response.rules); + } catch (err) { + setRouterDataError(String(err)); + setRouterRules([]); + } finally { + setLoadingRouterData(false); + } + } + + async function refreshRouterPanel() { + if (!selectedClient) return; + + try { + setLoadingRouterData(true); + setRouterDataError(''); + + const clientResponse = await vpsApi.readControllerClient(selectedClient.id); + setSelectedClientFileContent(clientResponse.content); + + if (selectedRouterIp && routerPassword.trim()) { + const rulesResponse = await vpsApi.getRouterFirewallRules( + selectedRouterIp, + routerPassword.trim(), + ); + + setRouterRules(rulesResponse.rules); + } + } catch (err) { + setRouterDataError(String(err)); + setRouterRules([]); + } finally { + setLoadingRouterData(false); + } + } return (
@@ -123,19 +302,16 @@ export function ControllersRoute() {

- +
{error && ( @@ -146,20 +322,23 @@ export function ControllersRoute() {
-
+
-

- Clientes -

- +

Clientes

- Ficheiros em /var/litoral_regas_app/maquinas + {clients.length} ficheiros em /var/litoral_regas_app/maquinas

-
- {filteredClients.length} / {clients.length} clientes -
+
@@ -230,47 +409,69 @@ export function ControllersRoute() { key={client.id} type="button" onClick={() => setSelectedId(client.id)} - className={`w-full rounded-2xl border p-4 text-left transition ${active - ? 'border-blue-500/25 bg-blue-500/10' - : 'border-white/10 bg-white/[0.025] hover:bg-white/[0.045]' + className={`group w-full rounded-2xl border p-4 text-left transition-all duration-200 ${active + ? 'border-blue-500/25 bg-blue-500/[0.08]' + : 'border-white/10 bg-white/[0.025] hover:border-white/15 hover:bg-white/[0.045]' }`} > -
-
-

- {client.name} -

+
+
+
+

+ {client.name} +

-

+

0 + ? 'bg-blue-400' + : 'bg-slate-600' + }`} + /> +
+ +

{client.file}

+ +
+ 0 + ? 'text-blue-300' + : 'text-slate-600' + } + /> + + + {client.controller_count > 0 + ? 'Com controladores' + : 'Sem controladores'} + +
- 0 - ? 'bg-blue-500/10 text-blue-200' - : 'bg-white/[0.04] text-slate-400' - }`} - > - {client.controller_count} - -
+
+
0 + ? 'bg-blue-500/10 text-blue-100' + : 'bg-white/[0.04] text-slate-400' + }`} + > + {client.controller_count} +
-
- 0 - ? 'text-blue-300' - : 'text-slate-600' - } - /> - - - {client.controller_count > 0 - ? 'Com controladores' - : 'Sem controladores'} - + +
); @@ -284,123 +485,458 @@ export function ControllersRoute() {
- + - +
- - {selectedClient ? ( -
-
-
+
+ + {selectedClient ? ( +
+

Cliente selecionado

-

- {selectedClient.name} -

+
+

+ {selectedClient.name} +

-

+ + {selectedClient.controller_count} controlador(es) + + + + {selectedClient.file} + +

+ +

{selectedClient.path}

- -

- Última alteração:{' '} - {selectedClient.modified_at ?? '—'} -

- +
- -
- } - label="Controladores" - value={String( - selectedClient.controller_count, - )} - /> - - } - label="Ficheiro VPS" - value={selectedClient.file} - /> + ) : ( +
+ Nenhum cliente selecionado.
+ )} + -
-

- Próximas ações -

+ + {selectedClient ? ( + <> +
+
+

+ Router / Firewall +

-
-

• Abrir modal de edição do cliente.

-

- • Listar controladores do ficheiro .txt. -

-

- • Detetar router associado pelo IP - WireGuard. -

-

- • Adicionar, atualizar ou remover DNAT no - router. -

-

- • Atualizar entrada correspondente no - ficheiro VPS. -

+

+ Gestão de DNAT +

+ +

+ Seleciona o router, confirma a password e carrega as regras UCI. +

+
+ +
+ +
+
+
+ + + setRouterPassword(event.target.value)} + placeholder="Password do router" + className="w-full rounded-xl border border-white/10 bg-slate-950 px-3 py-3 pr-12 font-mono text-sm text-white outline-none transition placeholder:text-slate-600 focus:border-blue-500/40" + /> + + +
+
+
+ +
+
+
+ +
+ +
+

Estado

+ +

+ {routerDataError + ? 'Falha ao comunicar com o router' + : loadingRouterData + ? 'A analisar router...' + : routerRules.length > 0 + ? `${routerRules.length} regra(s) carregada(s)` + : selectedRouterIp + ? 'Pronto para carregar regras' + : 'Nenhum router selecionado'} +

+
+
+ +
0 + ? 'border border-emerald-500/20 bg-emerald-500/10 text-emerald-200' + : 'border border-white/10 bg-white/[0.03] text-slate-400' + }`} + > + {routerDataError + ? 'Router inacessível' + : loadingRouterData + ? 'A ligar...' + : routerRules.length > 0 + ? 'Ligado' + : 'Não carregado'} +
+
+ + {routerDataError && ( +
+

+ Não foi possível carregar as regras do router. +

+ +

+ {routerDataError} +

+
+ )} +
+ +
+
+
+

Controladores

+

+ Associados ao router selecionado. +

+
+ +
+ {!selectedRouterGroup ? ( +
+ Seleciona um router. +
+ ) : ( + selectedRouterGroup.controllers.map((controller) => ( +
+
+
+

+ {controller.name} +

+ +

+ Externa {controller.externalPort} +

+
+ + + {controller.password} + +
+
+ )) + )} +
+
+ +
+
+
+

Regras DNAT

+

+ Portas externas e destinos internos. +

+
+ + +
+ +
+ {routerRules.length === 0 ? ( +
+

Nenhuma regra carregada ainda.

+

+ Carrega o router para listar as regras DNAT. +

+
+ ) : ( + routerRules.map((rule) => ( +
+
+
+

+ {rule.name || rule.id} +

+ +

+ {rule.externalPort} → {rule.internalIp}:{rule.internalPort} +

+
+ +
+ + {rule.proto} + + + + + +
+
+
+ )) + )} +
+
+
+ + ) : ( +
+ Seleciona um cliente para gerir o router.
-
- ) : ( -
- Nenhum cliente selecionado. -
- )} - + )} + +
{editingClient && ( setEditingClient(null)} + onSaved={async () => { + await loadClients(); + await refreshRouterPanel(); + }} + /> + )} + + {creatingClient && ( + setCreatingClient(false)} + onSaved={(clientId) => { + setSearch(clientId); + setControllerFilter('all'); + setPage(1); + + return loadClients(clientId) + }} + /> + )} + + {clientToDelete && ( +
+
+
+

+ Apagar Cliente +

+ +

+ Tem a certeza? +

+ +

+ Vai apagar o ficheiro do cliente{' '} + + {clientToDelete.name} + + . +

+
+ +
+ + + +
+
+
+ )} + + {creatingRule && ( + setCreatingRule(false)} + onSaved={async () => { + setCreatingRule(false); + await loadRouterRules(); + }} + /> + )} + + {ruleToUpdate && ( + setRuleToUpdate(null)} + onSaved={async () => { + setRuleToUpdate(null); + await loadRouterRules(); + }} + /> + )} + + {ruleToDelete && ( + setRuleToDelete(null)} + onConfirm={async () => { + try { + setSavingRule(true); + await vpsApi.deleteRouterFirewallRule( + selectedRouterIp, + routerPassword, + ruleToDelete.id, + ); + setRuleToDelete(null); + await loadRouterRules(); + } finally { + setSavingRule(false); + } + }} /> )}
@@ -441,17 +977,182 @@ type EditableController = { password: string; }; +function CreateClientModal({ + clients, + onClose, + onSaved, +}: { + clients: ControllerClient[]; + onClose: () => void; + onSaved: (clientId: string) => Promise | void; +}) { + const [name, setName] = useState(''); + const [password, setPassword] = useState(generateClientPassword()); + const [saving, setSaving] = useState(false); + const [error, setError] = useState(''); + + const cleanName = name.trim(); + + const nameError = useMemo(() => { + if (!cleanName) return 'O nome do cliente é obrigatório.'; + + if (!/^[A-Za-z0-9 _-]+$/.test(cleanName)) { + return 'Usa apenas letras, números, espaços, "_" ou "-".'; + } + + if (hasTxtSeparator(cleanName)) { + return 'O nome não pode conter "xxx" ou quebras de linha.'; + } + + const clientId = normalizeClientId(cleanName); + + const duplicateClient = clients.some( + (client) => normalizeClientId(client.id) === clientId, + ); + + if (duplicateClient) { + return 'Já existe um cliente com esse nome.'; + } + + return ''; + }, [cleanName, clients]); + + const passwordError = useMemo(() => { + if (!password.trim()) return 'A palavra-passe é obrigatória.'; + + if (hasTxtSeparator(password)) { + return 'A palavra-passe não pode conter "xxx" ou quebras de linha.'; + } + + return ''; + }, [password]); + + const formIsValid = !nameError && !passwordError; + + async function createClient() { + try { + setSaving(true); + setError(''); + + await vpsApi.createControllerClient(cleanName, password); + await onSaved(cleanName); + + onClose(); + } catch (err) { + setError(String(err)); + } finally { + setSaving(false); + } + } + + function normalizeClientId(value: string) { + return value.trim().toLowerCase().replace(/\s+/g, '_'); + } + + return ( +
+
+
+
+

+ Novo Cliente +

+ +

+ Criar ficheiro VPS +

+ +

+ Cria um novo cliente com apenas a primeira linha do ficheiro. +

+
+ + +
+ +
+ {error && ( +
+ Erro ao criar cliente: {error} +
+ )} + + + setName(value.replace(/[^\w\- ]/g, '')) + } + autoFocus + /> + +
+ + + +
+
+ +
+ + + +
+
+
+ ); +} + function EditClientModal({ client, onClose, + onSaved, }: { client: ControllerClient; onClose: () => void; + onSaved: () => Promise | void; }) { const [clientPassword, setClientPassword] = useState(''); const [controllers, setControllers] = useState([]); const [loadingClientFile, setLoadingClientFile] = useState(true); const [clientFileError, setClientFileError] = useState(''); + const [saving, setSaving] = useState(false); + const [saveError, setSaveError] = useState(''); useEffect(() => { let cancelled = false; @@ -556,6 +1257,22 @@ function EditClientModal({ ); } + async function saveClientFile() { + try { + setSaving(true); + setSaveError(''); + + await vpsApi.updateControllerClient(client.id, txtPreview); + await onSaved(); + + onClose(); + } catch (err) { + setSaveError(String(err)); + } finally { + setSaving(false); + } + } + return (
@@ -583,6 +1300,12 @@ function EditClientModal({
+ {saveError && ( +
+ Erro ao guardar: {saveError} +
+ )} + {loadingClientFile ? (
A carregar ficheiro do cliente... @@ -592,7 +1315,7 @@ function EditClientModal({ Erro ao carregar ficheiro do cliente: {clientFileError}
) : ( -
+

@@ -621,14 +1344,15 @@ function EditClientModal({

- +
@@ -661,7 +1385,7 @@ function EditClientModal({ onChange={(value) => updateController(controller.id, { name: value.replace( - /[^A-Za-z0-9_-]/g, + /[^\w\- ]/g, '', ), }) @@ -750,22 +1474,24 @@ function EditClientModal({

- + - + {saving ? 'A guardar...' : 'Guardar alterações'} +
@@ -773,6 +1499,284 @@ function EditClientModal({ ); } +function RuleModal({ + title, + routerHost, + routerPassword, + rule, + defaultExternalPort = '', + onClose, + onSaved, +}: { + title: string; + routerHost: string; + routerPassword: string; + rule?: RouterFirewallRule; + defaultExternalPort?: string; + onClose: () => void; + onSaved: () => Promise | void; +}) { + const editing = Boolean(rule); + const [id, setId] = useState(rule?.id ?? ''); + const [name, setName] = useState(rule?.name ?? ''); + const [proto, setProto] = useState(rule?.proto ?? 'tcp'); + const [srcZone, setSrcZone] = useState(rule?.srcZone ?? 'vpn'); + const [destZone, setDestZone] = useState(rule?.destZone ?? 'lan'); + const [externalPort, setExternalPort] = useState(rule?.externalPort ?? defaultExternalPort); + const [internalIp, setInternalIp] = useState(rule?.internalIp ?? ''); + const [internalPort, setInternalPort] = useState(rule?.internalPort ?? '5900'); + const [saving, setSaving] = useState(false); + const [error, setError] = useState(''); + + const cleanId = id.trim(); + const formIsValid = + cleanId && + name.trim() && + proto.trim() && + srcZone.trim() && + destZone.trim() && + isValidPort(externalPort) && + isValidPort(internalPort) && + IPV4_REGEX.test(internalIp.trim()); + + async function saveRule() { + if (!formIsValid) return; + + const payload: RouterFirewallRule = { + id: cleanId, + name: name.trim(), + proto: proto.trim(), + srcZone: srcZone.trim(), + destZone: destZone.trim(), + externalPort: externalPort.trim(), + internalIp: internalIp.trim(), + internalPort: internalPort.trim(), + target: 'DNAT', + }; + + try { + setSaving(true); + setError(''); + + if (editing) { + await vpsApi.updateRouterFirewallRule(routerHost, routerPassword, payload); + } else { + await vpsApi.createRouterFirewallRule(routerHost, routerPassword, payload); + } + + await onSaved(); + } catch (err) { + setError(String(err)); + } finally { + setSaving(false); + } + } + + return ( +
+
+
+
+

+ Regra DNAT +

+ +

+ {title} +

+ +

+ Router: {routerHost} +

+
+ + +
+ +
+ {error && ( +
+ Erro ao guardar regra: {error} +
+ )} + +
+ + setId(value.replace(/[^\w-]/g, '').toLowerCase()) + } + /> + + + + setProto(value.toLowerCase())} + /> + + setExternalPort(value.replace(/\D/g, ''))} + /> + + + + setInternalPort(value.replace(/\D/g, ''))} + /> + + + + +
+ +
+

+ Preview +

+ +

+ {externalPort || '—'} → {internalIp || '—'}:{internalPort || '—'} · {proto || 'tcp'} +

+
+
+ +
+ + + +
+
+
+ ); +} + +function DeleteRuleModal({ + rule, + loading, + onClose, + onConfirm, +}: { + rule: RouterFirewallRule; + loading: boolean; + onClose: () => void; + onConfirm: () => Promise | void; +}) { + return ( +
+
+
+

+ Apagar Regra +

+ +

+ Tem a certeza? +

+ +

+ Vai apagar a regra{' '} + + {rule.name || rule.id} + + . +

+ +

+ {rule.externalPort} → {rule.internalIp}:{rule.internalPort} +

+
+ +
+ + + +
+
+
+ ); +} + function parseClientTxt(content: string): { password: string; controllers: EditableController[]; @@ -817,7 +1821,8 @@ function Field({ step, hideLabel = false, placeholder, - autoFocus = false + autoFocus = false, + disabled = false }: { label: string; value: string; @@ -832,6 +1837,7 @@ function Field({ hideLabel?: boolean; placeholder?: string; autoFocus?: boolean; + disabled?: boolean; }) { return (
@@ -848,6 +1854,7 @@ function Field({ autoFocus={autoFocus} min={min} max={max} + disabled={disabled} placeholder={placeholder} step={step} inputMode={inputMode} @@ -1067,6 +2074,12 @@ function validatePort(value: string) { return ''; } +function isValidPort(value: string) { + const port = Number(value); + + return /^\d+$/.test(value) && port >= 1 && port <= 65535; +} + function getNextAvailablePort(controllers: EditableController[]) { const usedPorts = new Set( controllers @@ -1164,18 +2177,18 @@ function SmartRouterField({ onChange(nextValue); } return ( -
setIsFocused(true)} - onBlur={() => { - setIsFocused(false); +
setIsFocused(true)} + onBlur={() => { + setIsFocused(false); - if (!value.trim()) { - setMode('host'); - setFocusOctetIndex(0); - } - }} - > -
+ if (!value.trim()) { + setMode('host'); + setFocusOctetIndex(0); + } + }} + > +
@@ -1208,4 +2221,14 @@ function SmartRouterField({ )}
); -} \ No newline at end of file +} + +function generateClientPassword() { + const alphabet = + 'ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789'; + + return Array.from({ length: 8 }, () => + alphabet[Math.floor(Math.random() * alphabet.length)], + ).join(''); +} + diff --git a/src/components/settings/BackendSettings.tsx b/src/components/settings/BackendSettings.tsx index 19e4f74..342bdb6 100644 --- a/src/components/settings/BackendSettings.tsx +++ b/src/components/settings/BackendSettings.tsx @@ -1,13 +1,36 @@ import { useMemo, useState } from 'react'; import { + AlertTriangle, + BookOpen, CheckCircle2, + ClipboardCheck, + Copy, KeyRound, Link2, MonitorCog, + Router, Save, + Search, Server, ShieldCheck, + Terminal, + Wrench, + LockKeyhole, + Network, + UploadCloud, + Rocket, + Cpu, + PlugZap, + FileUp, + Activity, + ShieldAlert, + Clock3, + Pencil, + ServerCrash, + MonitorX, + Bug, + Trash2 } from 'lucide-react'; import { Badge } from '@/components/ui/Badge'; @@ -25,11 +48,25 @@ const DEFAULT_PLC_IP = '198.51.100.50'; const DEFAULT_FIRMWARE = 'openwrt-23.05.5-zbt-we826-16m-litoral-golden-sysupgrade.bin'; -export function BackendSettings() { - const [settings, setSettings] = - useState(getSettings()); +const manualTabs = [ + 'Painel', + 'Controladores', + 'UDP2RAW', + 'Provisionamento', + 'Registos de Atividade', + 'Manual Rápido', + 'Fluxos Operacionais', + 'Troubleshooting', + 'Convenções', +] as const; +type ManualTab = typeof manualTabs[number]; + +export function BackendSettings() { + const [settings, setSettings] = useState(getSettings()); const [saved, setSaved] = useState(false); + const [activeTab, setActiveTab] = useState('Manual Rápido'); + const [manualSearch, setManualSearch] = useState(''); const backendHost = useMemo(() => { try { @@ -56,8 +93,8 @@ export function BackendSettings() { Posto de Trabalho -

- Configuração local da consola técnica para provisionamento de routers. +

+ Configuração local da consola técnica, referência operacional e manual rápido para uso em produção.

@@ -88,7 +125,7 @@ export function BackendSettings() {

- Endpoint API usado para atribuição de IP VPN e registo de peers. + Endpoint API usado pela consola para comunicar com a VPS.

@@ -126,7 +163,7 @@ export function BackendSettings() {

- Alvo Ligado + Alvo ligado

@@ -169,37 +206,19 @@ export function BackendSettings() {

- Valores de produção apenas leitura. + Valores de referência para instalações e suporte.

- - - - - - - + + + +
- +
@@ -219,27 +238,1024 @@ export function BackendSettings() {

Base OpenWrt 23.05, alvo ZBT-WE826 16M, firewall fw4/nftables, - LuCI sobre WireGuard, topologia LAN estável e registo automático - de peers VPS. + LuCI sobre WireGuard, topologia LAN estável e gestão de regras + DNAT através da VPS.

- - OpenWrt 23.05 - - - - WireGuard - - - - fw4/nftables - + OpenWrt 23.05 + WireGuard + fw4/nftables
+ + +
+
+
+ +
+ +
+

+ Manual Operacional +

+ +

+ Guia rápido para uso da consola em produção: clientes, controladores, + routers, regras DNAT, erros comuns e procedimentos seguros. +

+
+
+ +
+ + + setManualSearch(event.target.value)} + placeholder="Pesquisar no manual..." + className="w-full rounded-2xl border border-white/10 bg-slate-950 py-3 pl-10 pr-3 text-sm text-white outline-none transition placeholder:text-slate-600 focus:border-blue-500/40" + /> +
+
+ +
+ {manualTabs.map((tab) => { + const active = activeTab === tab; + + return ( + + ); + })} +
+ + +
+
+ ); +} + +function ManualContent({ + activeTab, + search, +}: { + activeTab: ManualTab; + search: string; +}) { + const normalizedSearch = search.trim().toLowerCase(); + + const sections = getManualSections(activeTab); + + const filteredSections = normalizedSearch + ? sections.filter((section) => + [ + section.title, + section.description, + ...section.items, + ] + .join(' ') + .toLowerCase() + .includes(normalizedSearch), + ) + : sections; + + if (filteredSections.length === 0) { + return ( +
+ Nenhum resultado encontrado para esta pesquisa. +
+ ); + } + + return ( +
+ {filteredSections.map((section) => ( + + ))} +
+ ); +} + +function getManualSections(tab: ManualTab) { + if (tab === 'Painel') { + return [ + { + icon: , + tone: 'blue' as const, + title: 'Objetivo do Painel', + description: 'O Painel é a vista principal de operação e estado geral da plataforma.', + items: [ + 'Mostra rapidamente se a VPS, VPN e serviços principais estão operacionais.', + 'Ajuda a perceber se existe algum problema antes de mexer em clientes, routers ou regras.', + 'Deve ser a primeira página consultada quando algo parece não estar a funcionar.', + 'Serve como ponto de partida para diagnóstico e navegação operacional.', + ], + }, + { + icon: , + tone: 'green' as const, + title: 'Estado da VPS', + description: 'Indica se o backend consegue comunicar corretamente com a VPS.', + items: [ + 'Estado saudável significa que a API consegue obter dados da VPS.', + 'Se aparecer erro, pode haver falha de SSH, backend mal configurado ou VPS indisponível.', + 'Antes de alterar routers ou DNAT, confirma que a VPS responde corretamente.', + 'Se a VPS estiver indisponível, as restantes operações podem falhar.', + ], + }, + { + icon: , + tone: 'purple' as const, + title: 'WireGuard / VPN', + description: 'Mostra o estado da camada VPN usada para chegar aos routers e controladores.', + items: [ + 'A VPN deve estar ativa para que os routers sejam alcançáveis pelo IP WireGuard.', + 'Sem VPN, o painel de Controladores pode listar clientes, mas pode falhar ao carregar regras do router.', + 'Se houver problemas de ligação a routers, verificar primeiro a VPN.', + 'Handshakes recentes indicam comunicação ativa com peers.', + ], + }, + { + icon: , + tone: 'blue' as const, + title: 'UDP2RAW', + description: 'Ajuda a perceber se o túnel UDP2RAW está ativo e a transportar tráfego.', + items: [ + 'Tráfego ativo indica que o túnel está a ser usado.', + 'Se UDP2RAW estiver parado, a ligação pode ficar degradada ou indisponível em alguns cenários.', + 'Verifica esta secção quando houver falhas intermitentes de comunicação.', + 'Comparar tráfego WireGuard e UDP2RAW ajuda a perceber onde está o problema.', + ], + }, + { + icon: , + tone: 'red' as const, + title: 'Quando algo aparece a vermelho', + description: 'Estados vermelhos devem ser tratados como alerta operacional.', + items: [ + 'Confirmar primeiro se o backend e a VPS estão acessíveis.', + 'Depois verificar VPN/WireGuard.', + 'Se a VPN estiver saudável mas o router falhar, testar password SSH e IP do router.', + 'Não fazer alterações DNAT enquanto o estado base estiver instável.', + ], + }, + { + icon: , + tone: 'green' as const, + title: 'Ordem recomendada de diagnóstico', + description: 'Sequência simples para resolver problemas a partir do Painel.', + items: [ + '1. Confirmar backend configurado em Posto de Trabalho.', + '2. Confirmar VPS saudável no Painel.', + '3. Confirmar WireGuard/VPN ativa.', + '4. Confirmar UDP2RAW se aplicável.', + '5. Ir para Controladores e carregar regras do router.', + '6. Validar cliente/controlador afetado.', + ], + }, + ]; + } + + if (tab === 'Controladores') { + return [ + { + icon: , + tone: 'blue' as const, + title: 'Objetivo da página', + description: 'Gestão completa de clientes, controladores e regras DNAT.', + items: [ + 'Permite criar, editar e remover clientes da VPS.', + 'Controla os ficheiros .txt usados pelos controladores.', + 'Agrupa automaticamente controladores por router.', + 'Permite consultar e gerir regras DNAT diretamente no router.', + 'É a principal área operacional da plataforma.', + ], + }, + { + icon: , + tone: 'green' as const, + title: 'Clientes', + description: 'Cada cliente representa um ficheiro dentro da VPS.', + items: [ + 'Os ficheiros são armazenados em /var/litoral_regas_app/maquinas.', + 'A primeira linha do ficheiro representa a password principal do cliente.', + 'Cada linha seguinte representa um controlador.', + 'O número apresentado na lista corresponde ao total de controladores.', + 'Apagar um cliente remove permanentemente o ficheiro da VPS.', + ], + }, + { + icon: , + tone: 'purple' as const, + title: 'Formato dos controladores', + description: 'Cada controlador é armazenado numa linha do ficheiro.', + items: [ + 'Formato: nomexxxrouterxxxportaxxxpassword', + 'O separador "xxx" é obrigatório.', + 'Cada controlador deve ter porta externa única.', + 'O PIN/password deve ter exatamente 6 dígitos.', + 'Os routers podem ser IPv4 ou hostname.', + ], + }, + { + icon: , + tone: 'blue' as const, + title: 'Gestão do Router', + description: 'A secção Router / Firewall comunica diretamente por SSH.', + items: [ + 'As regras são carregadas usando UCI firewall.', + 'O backend comunica via SSH usando password.', + 'O sistema trata automaticamente problemas de known_hosts.', + 'Routers antigos com ssh-rsa também são suportados.', + 'Se o router estiver inacessível, nenhuma alteração DNAT será aplicada.', + ], + }, + { + icon: , + tone: 'green' as const, + title: 'Regras DNAT', + description: 'As regras DNAT permitem acesso externo aos equipamentos internos.', + items: [ + 'Cada regra associa porta externa → IP interno:porta.', + 'As alterações são aplicadas diretamente no firewall do router.', + 'Criar regra adiciona redirect UCI.', + 'Editar regra altera a configuração existente.', + 'Apagar regra remove permanentemente a entrada UCI.', + ], + }, + { + icon: , + tone: 'yellow' as const, + title: 'Boas práticas operacionais', + description: 'Recomendações para evitar falhas operacionais.', + items: [ + 'Carregar sempre as regras antes de criar novas.', + 'Nunca reutilizar portas externas já existentes.', + 'Evitar editar regras críticas sem confirmação do destino.', + 'Após alterações DNAT, validar acesso ao controlador.', + 'Confirmar sempre router correto antes de guardar.', + ], + }, + { + icon: , + tone: 'red' as const, + title: 'Situações de erro', + description: 'Problemas mais comuns nesta página.', + items: [ + 'Router inacessível → SSH falhou ou VPN indisponível.', + 'Host key changed → resolvido automaticamente pelo backend.', + 'Porta duplicada → regra rejeitada pelo sistema.', + 'Rule already exists → ID técnico já existe no router.', + 'Falha ao carregar regras → confirmar password SSH.', + ], + }, + { + icon: , + tone: 'green' as const, + title: 'Fluxo recomendado', + description: 'Sequência operacional recomendada.', + items: [ + '1. Selecionar cliente.', + '2. Confirmar controladores.', + '3. Carregar regras do router.', + '4. Validar portas existentes.', + '5. Criar ou editar regra.', + '6. Testar conectividade após alteração.', + ], + }, + ]; + } + + if (tab === 'UDP2RAW') { + return [ + { + icon: , + tone: 'blue' as const, + title: 'Objetivo da página', + description: 'Instalação, arranque e validação do túnel UDP2RAW no router.', + items: [ + 'Esta página configura o UDP2RAW diretamente no router.', + 'É usada quando o túnel precisa de transportar WireGuard de forma mais resiliente.', + 'Permite verificar estado, enviar binário, enviar script, executar setup e testar o túnel.', + 'Deve ser usada com cuidado porque altera ficheiros e serviços no router.', + ], + }, + { + icon: , + tone: 'purple' as const, + title: 'Router alvo', + description: 'Define o router onde o UDP2RAW será instalado ou validado.', + items: [ + 'O IP deve ser o endereço acessível pela rede técnica/VPN.', + 'A password SSH deve pertencer ao router selecionado.', + 'Se a password estiver errada, todos os passos vão falhar.', + 'Antes de executar setup, confirma que estás no router correto.', + ], + }, + { + icon: , + tone: 'green' as const, + title: 'Verificar Estado', + description: 'Primeiro passo recomendado antes de qualquer alteração.', + items: [ + 'Confirma se o binário udp2raw existe no router.', + 'Confirma se o serviço init.d está instalado.', + 'Confirma se existe processo ativo.', + 'Confirma se a porta local esperada está disponível.', + ], + }, + { + icon: , + tone: 'blue' as const, + title: 'Enviar Binário', + description: 'Copia o binário UDP2RAW para o router.', + items: [ + 'O destino esperado é /usr/bin/udp2raw.', + 'Este passo deve ser feito quando o binário não existe ou está desatualizado.', + 'Depois de enviar, o binário deve ter permissões de execução.', + 'Se falhar, verificar espaço disponível e permissões no router.', + ], + }, + { + icon: , + tone: 'purple' as const, + title: 'Enviar Script', + description: 'Envia o script de setup usado para criar/configurar o serviço.', + items: [ + 'O script é copiado temporariamente para o router.', + 'Este passo prepara o router para executar a instalação.', + 'Não valida sozinho se o túnel ficou ativo.', + 'Após enviar o script, executar o passo de setup.', + ], + }, + { + icon: , + tone: 'blue' as const, + title: 'Executar Setup', + description: 'Cria ou atualiza o serviço UDP2RAW no router.', + items: [ + 'Cria o serviço init.d quando necessário.', + 'Configura o comando de arranque do túnel.', + 'Arranca ou reinicia o serviço.', + 'Este é o passo mais sensível, porque altera a configuração ativa do router.', + ], + }, + { + icon: , + tone: 'green' as const, + title: 'Testar Túnel', + description: 'Valida se o UDP2RAW e WireGuard estão operacionais.', + items: [ + 'Confirma processo UDP2RAW ativo.', + 'Valida listener/porta local.', + 'Executa testes de conectividade.', + 'Confirma se WireGuard continua funcional após o setup.', + ], + }, + { + icon: , + tone: 'red' as const, + title: 'Erros comuns', + description: 'Problemas típicos nesta página.', + items: [ + 'Password SSH errada → nenhum passo consegue comunicar com o router.', + 'Router inacessível → confirmar VPN, IP e rede.', + 'Binário incompatível → confirmar arquitetura do router.', + 'Serviço não arranca → verificar script, permissões e logs do router.', + 'Túnel falha no teste → validar portas, firewall e configuração WireGuard.', + ], + }, + { + icon: , + tone: 'green' as const, + title: 'Fluxo recomendado', + description: 'Ordem segura para usar esta página.', + items: [ + '1. Inserir IP e password do router.', + '2. Executar Verificar Estado.', + '3. Enviar Binário se necessário.', + '4. Enviar Script.', + '5. Executar Setup.', + '6. Testar Túnel.', + '7. Confirmar no Painel se UDP2RAW/WireGuard mostram tráfego saudável.', + ], + }, + ]; + } + + if (tab === 'Provisionamento') { + return [ + { + icon: , + tone: 'blue' as const, + title: 'Objetivo da página', + description: 'Provisionamento completo ou parcial de routers.', + items: [ + 'Permite preparar routers novos ou já existentes.', + 'Pode fazer flash de firmware e aplicar configuração automática.', + 'Cria ficheiros router.env e executa scripts de provisionamento.', + 'Regista o peer WireGuard na VPS quando aplicável.', + ], + }, + { + icon: , + tone: 'green' as const, + title: 'Detetar Router', + description: 'Primeiro passo antes de qualquer operação.', + items: [ + 'Testa se o router está acessível no IP escolhido.', + 'Valida comunicação SSH.', + 'Identifica se a password é necessária.', + 'Pode detetar problemas de chave SSH antiga.', + ], + }, + { + icon: , + tone: 'purple' as const, + title: 'Enviar Firmware', + description: 'Copia a imagem OpenWrt para o router.', + items: [ + 'Usado no modo provisionamento completo.', + 'O firmware é enviado para /tmp no router.', + 'Confirmar sempre se o modelo do router é compatível.', + 'Não interromper esta fase depois de iniciada.', + ], + }, + { + icon: , + tone: 'red' as const, + title: 'Gravar Firmware', + description: 'Executa sysupgrade no router.', + items: [ + 'Esta é a fase mais crítica do processo.', + 'O router pode reiniciar e ficar temporariamente inacessível.', + 'Não desligar energia durante o flash.', + 'Aguardar o tempo indicado antes de tentar reconectar.', + ], + }, + { + icon: , + tone: 'blue' as const, + title: 'Reconectar Router', + description: 'Após flash/reboot, o router volta com a configuração base.', + items: [ + 'Reconectar cabo Ethernet se necessário.', + 'Confirmar novo IP LAN.', + 'Aguardar SSH voltar a responder.', + 'Só avançar quando o router estiver novamente acessível.', + ], + }, + { + icon: , + tone: 'green' as const, + title: 'Enviar pacote de provisionamento', + description: 'Envia router.env e provision.sh para o router.', + items: [ + 'router.env contém hostname, WireGuard IP e dados de rede.', + 'provision.sh aplica a configuração no router.', + 'Verificar os campos antes de enviar.', + 'Evitar nomes de router duplicados.', + ], + }, + { + icon: , + tone: 'purple' as const, + title: 'Executar Provisionamento', + description: 'Aplica a configuração final no router.', + items: [ + 'Configura LAN, WireGuard, firewall e serviços necessários.', + 'Pode alterar hostname e rede do router.', + 'Deve ser executado apenas depois de validar router.env.', + 'Se falhar, consultar logs e repetir apenas a fase necessária.', + ], + }, + { + icon: , + tone: 'green' as const, + title: 'Registar Peer VPS', + description: 'Adiciona o router como peer WireGuard na VPS.', + items: [ + 'Necessário para o router comunicar pela VPN.', + 'O IP WireGuard deve ser único.', + 'Depois de registar, validar handshake no Painel.', + 'Se já existir peer com o mesmo IP, rever configuração antes de avançar.', + ], + }, + { + icon: , + tone: 'red' as const, + title: 'Erros comuns', + description: 'Falhas frequentes durante provisionamento.', + items: [ + 'Password SSH errada.', + 'Router não está no IP esperado.', + 'Firmware incompatível.', + 'Router ainda está a reiniciar.', + 'Peer WireGuard duplicado.', + 'Cabo/rede local mal ligada.', + ], + }, + { + icon: , + tone: 'green' as const, + title: 'Fluxo recomendado', + description: 'Sequência segura para provisionar.', + items: [ + '1. Escolher modo: completo ou apenas provisionamento.', + '2. Preencher dados do router.', + '3. Detetar router.', + '4. Enviar firmware se necessário.', + '5. Aguardar reboot.', + '6. Enviar pacote de provisionamento.', + '7. Executar provisionamento.', + '8. Registar peer VPS.', + '9. Validar VPN e acesso no Painel.', + ], + }, + ]; + } + + if (tab === 'Registos de Atividade') { + return [ + { + icon: , + tone: 'blue' as const, + title: 'Objetivo da página', + description: 'Consulta centralizada de eventos e ações do sistema.', + items: [ + 'Mostra operações executadas pela plataforma.', + 'Ajuda a diagnosticar falhas operacionais.', + 'Permite rastrear alterações feitas nos routers e VPS.', + 'Serve como histórico técnico para suporte e auditoria.', + ], + }, + { + icon: , + tone: 'green' as const, + title: 'Pesquisa e filtros', + description: 'Filtragem rápida de eventos específicos.', + items: [ + 'Pode pesquisar por router, cliente, IP ou ação.', + 'Filtros ajudam a localizar eventos críticos.', + 'Utilizar pesquisa parcial quando o nome completo não é conhecido.', + 'Eventos mais recentes aparecem primeiro.', + ], + }, + { + icon: , + tone: 'purple' as const, + title: 'Eventos da VPS', + description: 'Ações relacionadas com a infraestrutura principal.', + items: [ + 'Criação e atualização de clientes.', + 'Rollback de backups WireGuard.', + 'Operações de provisionamento.', + 'Alterações de peers e rede VPN.', + ], + }, + { + icon: , + tone: 'blue' as const, + title: 'Eventos do Router', + description: 'Operações executadas diretamente nos routers.', + items: [ + 'Leitura de regras firewall.', + 'Criação, edição e remoção de DNAT.', + 'Instalação e setup UDP2RAW.', + 'Execução de scripts remotos.', + ], + }, + { + icon: , + tone: 'red' as const, + title: 'Eventos críticos', + description: 'Falhas e situações que exigem atenção.', + items: [ + 'Falhas SSH.', + 'Routers inacessíveis.', + 'Problemas de autenticação.', + 'Erros durante provisionamento.', + 'Falhas WireGuard ou UDP2RAW.', + ], + }, + { + icon: , + tone: 'purple' as const, + title: 'Linha temporal', + description: 'Interpretação cronológica dos eventos.', + items: [ + 'Cada registo contém timestamp.', + 'Os eventos são ordenados do mais recente para o mais antigo.', + 'Eventos relacionados normalmente aparecem próximos.', + 'Útil para perceber sequência de falhas.', + ], + }, + { + icon: , + tone: 'green' as const, + title: 'Boas práticas', + description: 'Recomendações operacionais.', + items: [ + 'Consultar logs antes de repetir operações.', + 'Verificar timestamps ao investigar falhas.', + 'Correlacionar eventos entre VPS e router.', + 'Guardar screenshots/logs em situações críticas.', + ], + }, + { + icon: , + tone: 'red' as const, + title: 'Situações comuns', + description: 'Problemas normalmente encontrados nos registos.', + items: [ + 'Timeout SSH.', + 'Host key changed.', + 'Porta DNAT duplicada.', + 'Erro de autenticação.', + 'Provisionamento interrompido.', + 'Firewall reload falhou.', + ], + }, + ]; + } + + if (tab === 'Manual Rápido') { + return [ + { + icon: , + tone: 'blue' as const, + title: 'Criar um cliente', + description: 'Fluxo base para criar um novo cliente na VPS.', + items: [ + 'Abrir Controladores.', + 'Clicar em Novo Cliente.', + 'Inserir nome e password inicial.', + 'Guardar cliente.', + 'Confirmar que o ficheiro foi criado na VPS.', + ], + }, + { + icon: , + tone: 'purple' as const, + title: 'Adicionar controlador', + description: 'Adiciona uma nova entrada ao ficheiro do cliente.', + items: [ + 'Selecionar cliente.', + 'Clicar em Editar Cliente.', + 'Adicionar controlador.', + 'Definir router, porta externa e PIN.', + 'Guardar alterações.', + 'Confirmar que o controlador aparece na lista.', + ], + }, + { + icon: , + tone: 'green' as const, + title: 'Carregar regras DNAT', + description: 'Lê as regras reais diretamente do router.', + items: [ + 'Selecionar router.', + 'Introduzir password SSH.', + 'Clicar em Carregar regras.', + 'Aguardar estado Ligado.', + 'Validar total de regras carregadas.', + ], + }, + { + icon: , + tone: 'blue' as const, + title: 'Criar regra DNAT', + description: 'Cria uma nova regra no firewall do router.', + items: [ + 'Carregar regras antes de criar.', + 'Clicar em Nova Regra.', + 'Definir ID técnico único.', + 'Escolher porta externa livre.', + 'Definir IP interno correto.', + 'Guardar e testar acesso.', + ], + }, + { + icon: , + tone: 'purple' as const, + title: 'Editar regra DNAT', + description: 'Atualiza uma regra já existente.', + items: [ + 'Carregar regras do router.', + 'Selecionar Editar.', + 'Alterar IP, portas ou protocolo.', + 'Guardar alterações.', + 'Validar funcionamento após update.', + ], + }, + { + icon: , + tone: 'red' as const, + title: 'Remover regra DNAT', + description: 'Remove uma regra do firewall.', + items: [ + 'Confirmar router correto.', + 'Selecionar regra.', + 'Clicar em eliminar.', + 'Confirmar operação.', + 'Validar que a regra desapareceu da lista.', + ], + }, + ]; + } + + if (tab === 'Fluxos Operacionais') { + return [ + { + icon: , + tone: 'green' as const, + title: 'Nova instalação completa', + description: 'Fluxo recomendado para instalação nova.', + items: [ + 'Provisionar router.', + 'Registar peer WireGuard.', + 'Criar cliente.', + 'Adicionar controlador.', + 'Carregar regras DNAT.', + 'Criar regra VNC.', + 'Testar acesso remoto.', + ], + }, + { + icon: , + tone: 'blue' as const, + title: 'Troca de controlador', + description: 'Quando um controlador muda de IP interno.', + items: [ + 'Carregar regras atuais.', + 'Editar regra DNAT existente.', + 'Atualizar IP interno.', + 'Guardar alterações.', + 'Testar VNC/comunicação.', + ], + }, + { + icon: , + tone: 'purple' as const, + title: 'Cliente multi-router', + description: 'Clientes com vários routers associados.', + items: [ + 'Selecionar cliente.', + 'Escolher router correto.', + 'Carregar regras apenas desse router.', + 'Executar alterações nesse contexto.', + 'Validar alterações antes de trocar de router.', + ], + }, + { + icon: , + tone: 'green' as const, + title: 'Manutenção preventiva', + description: 'Validações recomendadas após alterações.', + items: [ + 'Confirmar handshake WireGuard.', + 'Validar tráfego UDP2RAW.', + 'Confirmar acesso VNC.', + 'Validar portas DNAT.', + 'Consultar Registos de Atividade.', + ], + }, + { + icon: , + tone: 'red' as const, + title: 'Recuperação de falhas', + description: 'Fluxo para incidentes comuns.', + items: [ + 'Verificar logs.', + 'Confirmar VPN.', + 'Testar SSH ao router.', + 'Recarregar regras.', + 'Reaplicar DNAT se necessário.', + 'Validar serviço final.', + ], + }, + ]; + } + + if (tab === 'Troubleshooting') { + return [ + { + icon: , + tone: 'red' as const, + title: 'Router inacessível', + description: 'Erro de comunicação SSH.', + items: [ + 'Confirmar router online.', + 'Confirmar VPN operacional.', + 'Validar password SSH.', + 'Testar ping ao router.', + 'Verificar firewall/rede.', + ], + }, + { + icon: , + tone: 'red' as const, + title: 'Host key changed', + description: 'O router alterou fingerprint SSH.', + items: [ + 'O backend tenta resolver automaticamente.', + 'Known_hosts antigo é removido.', + 'Nova chave SSH é aceite.', + 'Se persistir, validar IP correto.', + ], + }, + { + icon: , + tone: 'purple' as const, + title: 'Porta DNAT duplicada', + description: 'Uma porta externa já está em uso.', + items: [ + 'Carregar regras atuais.', + 'Localizar regra existente.', + 'Escolher porta diferente.', + 'Evitar reutilização manual.', + ], + }, + { + icon: , + tone: 'red' as const, + title: 'UDP2RAW offline', + description: 'O túnel não está funcional.', + items: [ + 'Validar processo ativo.', + 'Confirmar binário instalado.', + 'Reexecutar setup.', + 'Validar portas locais/remotas.', + ], + }, + { + icon: , + tone: 'red' as const, + title: 'VNC sem acesso', + description: 'Controlador não responde remotamente.', + items: [ + 'Confirmar regra DNAT.', + 'Validar IP interno.', + 'Testar porta externa.', + 'Confirmar VNC ativo no controlador.', + ], + }, + { + icon: , + tone: 'purple' as const, + title: 'Falha inesperada', + description: 'Erro genérico da plataforma.', + items: [ + 'Consultar Registos de Atividade.', + 'Validar backend VPS.', + 'Repetir operação.', + 'Confirmar estado do router.', + 'Recolher logs antes de escalar.', + ], + }, + ]; + } + + return [ + { + icon: , + tone: 'green' as const, + title: 'Novo cliente', + description: 'Checklist para cliente novo.', + items: [ + 'Cliente criado.', + 'Password inicial definida.', + 'Controlador criado.', + 'Router selecionado.', + 'Regras carregadas.', + 'DNAT criado.', + 'VNC testado.', + ], + }, + { + icon: , + tone: 'blue' as const, + title: 'Alteração de controlador', + description: 'Checklist para mudança de equipamento/IP.', + items: [ + 'Regra atual identificada.', + 'Novo IP interno confirmado.', + 'Regra editada.', + 'Firewall recarregada.', + 'Acesso validado.', + ], + }, + { + icon: , + tone: 'purple' as const, + title: 'Antes de terminar intervenção', + description: 'Validação final.', + items: [ + 'Sem erros ativos na UI.', + 'Router mostra estado Ligado.', + 'Regras listadas corretamente.', + 'Cliente atualizado.', + 'Teste real feito pelo operador.', + ], + }, + { + icon: , + tone: 'red' as const, + title: 'Bloqueios obrigatórios', + description: 'Não avançar se isto falhar.', + items: [ + 'Password SSH errada.', + 'Router inacessível.', + 'Porta externa duplicada.', + 'IP interno inválido.', + 'Firewall reload falhou.', + ], + }, + ]; +} + +function ManualSection({ + icon, + tone, + title, + description, + items, +}: { + icon: React.ReactNode; + tone: 'blue' | 'green' | 'purple' | 'red' | 'yellow'; + title: string; + description: string; + items: string[]; +}) { + const toneClass = { + blue: 'bg-blue-500/10 text-blue-300', + green: 'bg-green-500/10 text-green-300', + purple: 'bg-purple-500/10 text-purple-300', + red: 'bg-red-500/10 text-red-300', + yellow: 'bg-yellow-500/10 text-yellow-300', + }[tone]; + + return ( +
+
+
+ {icon} +
+ +
+

+ {title} +

+ +

+ {description} +

+
+
+ +
+ {items.map((item, index) => ( +
+ + {index + 1} + + + + {item} + +
+ ))} +
); } @@ -259,22 +1275,20 @@ function SettingsInput({ }) { return (
-