mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-07-30 10:51:32 +08:00
18 lines
641 B
HTML
18 lines
641 B
HTML
<%+cbi/valueheader%>
|
|
<%
|
|
local hint = self:cfgvalue(section)
|
|
local cache = self.detect_cache
|
|
local is_clash = self.type == "clash"
|
|
local text = is_clash and "N/A" or "--- ms"
|
|
local color = is_clash and "#999999" or "#ff0000"
|
|
if not is_clash and cache and tonumber(cache.ping or 0) > 0 then
|
|
local ping = tonumber(cache.ping)
|
|
text = tostring(ping) .. " ms"
|
|
if ping < 300 then color = "#ff3300" end
|
|
if ping < 200 then color = "#ff7700" end
|
|
if ping < 100 then color = "#249400" end
|
|
end
|
|
%>
|
|
<span class="pingtime" hint="<%=hint%>" data-sid="<%=section%>"><font style="color:<%=color%>"><%=text%></font></span>
|
|
<%+cbi/valuefooter%>
|