diff --git a/backend/package.json b/backend/package.json index 28a2390..d2656be 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.264", + "version": "2.14.265", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/utils/flow.js b/backend/src/utils/flow.js index 9e2b7cf..a35fb1e 100644 --- a/backend/src/utils/flow.js +++ b/backend/src/utils/flow.js @@ -138,10 +138,10 @@ export function parseFlowHeaders(flowHeaders) { return { expires, total, usage: { upload, download } }; } export function flowTransfer(flow, unit = 'B') { - const unitList = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB']; + const unitList = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; let unitIndex = unitList.indexOf(unit); - return flow < 1024 + return flow < 1024 || unitIndex === unitList.length - 1 ? { value: flow.toFixed(1), unit: unit } : flowTransfer(flow / 1024, unitList[++unitIndex]); }