luci-app-ssr-plus: update ping value displayed integer.

This commit is contained in:
zxlhhyccc committed 2026-02-10 22:29:21 +08:00
1 parent 6b8211c530
commit ca3d7071ea
1 file changed
+5 -1
@@ -98,10 +98,14 @@ function act_ping()
end
if not e.ping then
e.ping = tonumber(luci.sys.exec(string.format(
local ping_result = tonumber(luci.sys.exec(string.format(
"nping --udp -c 1 -p %d %s 2>/dev/null | grep -o 'Avg rtt: [0-9.]*ms' | awk '{print $3}' | sed 's/ms//' | head -1",
port, domain
)))
local ping_num = tonumber(ping_result)
if ping_num then
e.ping = math.floor(ping_num)
end
end
end