diff --git a/src/assets/locales/en.json b/src/assets/locales/en.json
index b7cb3005..04c10f8e 100644
--- a/src/assets/locales/en.json
+++ b/src/assets/locales/en.json
@@ -1276,8 +1276,7 @@
"2": "2. Open DevTools or inspect the page",
"3": "3. Go to Application tab → Cookies",
"4": "4. Copy the 'ui' cookie's value.",
- "5": "5. Close the tab, but do NOT logout!",
- "warning": "(Do not share this token!)"
+ "5": "5. Close the tab, but do NOT logout!"
},
"tokenLabel": "Token",
"tokenExample": {
@@ -1286,7 +1285,9 @@
"description": "This is what a Febbox UI token looks like:",
"warning": "Don't try to use, it's fake.",
"close": "Got it"
- }
+ },
+ "traffic": "{{used}} / {{limit}} High-speed Traffic • Resets in {{reset}}",
+ "trafficExplanation": "Febbox gives you 100GB/month of high-speed traffic, the streams might buffer more after you've used up your quota. Depends on your internet speed and the quality of the stream."
},
"status": {
"success": "success",
diff --git a/src/pages/parts/settings/ConnectionsPart.tsx b/src/pages/parts/settings/ConnectionsPart.tsx
index c0888c3d..443b916a 100644
--- a/src/pages/parts/settings/ConnectionsPart.tsx
+++ b/src/pages/parts/settings/ConnectionsPart.tsx
@@ -24,6 +24,7 @@ import { Heading1, Heading2, Paragraph } from "@/components/utils/Text";
import {
SetupPart,
Status,
+ fetchFebboxQuota,
testFebboxKey,
testTorboxToken,
testdebridToken,
@@ -237,9 +238,10 @@ function BackendEdit({ backendUrl, setBackendUrl }: BackendEditProps) {
async function getFebboxKeyStatus(febboxKey: string | null) {
if (febboxKey) {
const status: Status = await testFebboxKey(febboxKey);
- return status;
+ const quota = await fetchFebboxQuota(febboxKey);
+ return { status, quota };
}
- return "unset";
+ return { status: "unset" as Status, quota: null };
}
interface FebboxSetupProps extends FebboxKeyProps {
@@ -282,6 +284,7 @@ export function FebboxSetup({
}, [user.account, febboxKey, preferences.febboxKey, setFebboxKey, mode]);
const [status, setStatus] = useState
-
+ {t("fedapi.setup.traffic", { used, limit, reset })} +
++ {t("fedapi.setup.trafficExplanation")} +
+ > + ); + })()} > ) : null} diff --git a/src/pages/parts/settings/SetupPart.tsx b/src/pages/parts/settings/SetupPart.tsx index 0dd9ca3c..897ca4ef 100644 --- a/src/pages/parts/settings/SetupPart.tsx +++ b/src/pages/parts/settings/SetupPart.tsx @@ -58,6 +58,33 @@ function testProxy(url: string) { }); } +export async function fetchFebboxQuota(febboxKey: string | null): Promise