From c91d8e28e4e93cfa159f3c62d5af061e5ad2c74d Mon Sep 17 00:00:00 2001 From: xream Date: Tue, 30 Apr 2024 15:38:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=93=AA=E5=90=92=E6=8E=A2=E9=92=88?= =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E6=97=B6=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/restful/download.js | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/backend/package.json b/backend/package.json index 82b15ae..8b7e39d 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.301", + "version": "2.14.303", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/restful/download.js b/backend/src/restful/download.js index d3f0dac..eab328a 100644 --- a/backend/src/restful/download.js +++ b/backend/src/restful/download.js @@ -469,7 +469,11 @@ function nezhaTransform(output) { // 简单判断下 if (/^[a-z]{2}$/i.test(CountryCode)) { // 如果节点上有数据 就取节点上的数据 - let time = proxy._unavailable ? 0 : Date.now(); + let now = Math.round(new Date().getTime() / 1000); + let time = proxy._unavailable ? 0 : now; + + const uptime = parseInt(proxy._uptime || 0, 10); + result.result.push({ id: index, name: proxy.name, @@ -489,7 +493,7 @@ function nezhaTransform(output) { SwapTotal: 1024, Arch: '', Virtualization: '', - BootTime: time, + BootTime: now - uptime, CountryCode, // 目前需要 Version: '0.0.1', }, @@ -502,7 +506,7 @@ function nezhaTransform(output) { NetOutTransfer: 0, NetInSpeed: 0, NetOutSpeed: 0, - Uptime: parseInt(proxy._uptime ?? index, 10), + Uptime: uptime, Load1: 0, Load5: 0, Load15: 0,