diff --git a/htdocs/luci-static/resources/view/homeproxy/status.js b/htdocs/luci-static/resources/view/homeproxy/status.js index f8a6170009..f7c219e9a3 100644 --- a/htdocs/luci-static/resources/view/homeproxy/status.js +++ b/htdocs/luci-static/resources/view/homeproxy/status.js @@ -47,7 +47,7 @@ function getConnStat(o, site) { let ele = o.default.firstElementChild.nextElementSibling; if (ret.result) { ele.style.setProperty('color', 'green'); - ele.innerHTML = _('passed'); + ele.innerHTML = ret.elapsed ? _('passed (%dms)').format(ret.elapsed) : _('passed'); } else { ele.style.setProperty('color', 'red'); ele.innerHTML = _('failed'); diff --git a/po/templates/homeproxy.pot b/po/templates/homeproxy.pot index 0fa7165548..ccf9a6a2e2 100644 --- a/po/templates/homeproxy.pot +++ b/po/templates/homeproxy.pot @@ -2958,6 +2958,9 @@ msgstr "" msgid "passed" msgstr "" +msgid "passed (%dms)" +msgstr "" + #: htdocs/luci-static/resources/view/homeproxy/server.js:791 msgid "private key" msgstr "" diff --git a/po/zh_Hans/homeproxy.po b/po/zh_Hans/homeproxy.po index 68d3e066ac..5168a97122 100644 --- a/po/zh_Hans/homeproxy.po +++ b/po/zh_Hans/homeproxy.po @@ -3027,6 +3027,9 @@ msgstr "packet addr (v2ray-core v5+)" msgid "passed" msgstr "通过" +msgid "passed (%dms)" +msgstr "通过(%dms)" + #: htdocs/luci-static/resources/view/homeproxy/server.js:791 msgid "private key" msgstr "私钥" diff --git a/root/usr/share/rpcd/ucode/luci.homeproxy b/root/usr/share/rpcd/ucode/luci.homeproxy index c87a9544ed..7c6d068566 100644 --- a/root/usr/share/rpcd/ucode/luci.homeproxy +++ b/root/usr/share/rpcd/ucode/luci.homeproxy @@ -137,7 +137,12 @@ const methods = { break; } - return { result: (system(`/usr/bin/wget --spider -qT3 ${url} 2>"/dev/null"`, 3100) === 0) }; + let start = clock(true); + let ret = system(`/usr/bin/wget --spider -qT3 ${url} 2>"/dev/null"`, 3100); + let end = clock(true); + let elapsed = (end[0] - start[0]) * 1000 + int((end[1] - start[1]) / 1000000); + + return { result: (ret === 0), elapsed: elapsed }; } },