From c20a1449f1ef44e0c4a4e6e7e15c9d57f9d8bd00 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 11 Jun 2022 20:16:47 +0800 Subject: [PATCH] update 2022-06-11 20:16:47 --- luci-app-openclash/luasrc/controller/openclash.lua | 7 +++++-- luci-app-openclash/luasrc/view/openclash/sub_info_show.htm | 6 +++--- natflow/Makefile | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/luci-app-openclash/luasrc/controller/openclash.lua b/luci-app-openclash/luasrc/controller/openclash.lua index ddf63dff7..e03b17d3e 100644 --- a/luci-app-openclash/luasrc/controller/openclash.lua +++ b/luci-app-openclash/luasrc/controller/openclash.lua @@ -596,7 +596,9 @@ function sub_info_get() download = string.sub(string.match(info, "download=%d+"), 10, -1) or nil total = tonumber(string.format("%.1f",string.sub(string.match(info, "total=%d+"), 7, -1))) or nil used = tonumber(string.format("%.1f",(upload + download))) or nil - day_expire = tonumber(string.sub(string.match(info, "expire=%d+"), 8, -1)) or nil + if string.match(info, "expire=%d+") then + day_expire = tonumber(string.sub(string.match(info, "expire=%d+"), 8, -1)) or nil + end expire = os.date("%Y-%m-%d", day_expire) or "null" if day_expire and os.time() <= day_expire then day_left = math.ceil((day_expire - os.time()) / (3600*24)) @@ -605,6 +607,7 @@ function sub_info_get() else day_left = 0 end + if used and total and used <= total then percent = string.format("%.1f",(used/total)*100) or nil elseif used == nil or total == nil or total == 0 then @@ -1491,4 +1494,4 @@ function process_status(name) else return luci.sys.call(string.format("ps -w |grep '%s' |grep -v grep >/dev/null", name)) == 0 end -end \ No newline at end of file +end diff --git a/luci-app-openclash/luasrc/view/openclash/sub_info_show.htm b/luci-app-openclash/luasrc/view/openclash/sub_info_show.htm index bf162b889..95f9b6e61 100644 --- a/luci-app-openclash/luasrc/view/openclash/sub_info_show.htm +++ b/luci-app-openclash/luasrc/view/openclash/sub_info_show.htm @@ -39,9 +39,9 @@ sub_info_get_<%=idname%>(); function progressbar_<%=idname%>(v, m, pc, np, f, t, tr) { return String.format( '
' + - (pc <= 50 ? '
' : (pc > 50 && pc <= 80 ? '
' : '
')) + - '
' + - '%s '+(f ? f : '/')+' %s ' + (np ? "" : '(%s%%)') + '
' + '%s (<%:Remaining%> %s <%:days%>)
' + + (pc <= 50 ? '
' : (pc > 50 && pc <= 80 ? '
' : '
')) + + '
' + + '%s '+ (f ? f : '/') +' %s ' + (np ? "" : '(%s%%)') + (t == "null" ? '
' : '
') + '%s (<%:Remaining%> %s <%:days%>)' + '
' + '
' + '
', pc, v, m, pc, t, tr diff --git a/natflow/Makefile b/natflow/Makefile index e100f0f19..8cf1203a0 100644 --- a/natflow/Makefile +++ b/natflow/Makefile @@ -9,10 +9,10 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=natflow -PKG_VERSION:=20220608 +PKG_VERSION:=20220611 PKG_SOURCE_URL:=https://codeload.github.com/ptpt52/natflow/tar.gz/$(PKG_VERSION)? -PKG_HASH:=2d3d6e1f151c03467c91ef2400d2721226e71f1c6b3a54363fbb6813d234d0e8 +PKG_HASH:=2dd92f15e4ee753c6af6a09078183e65763a104db5c996250121acf909ea9d23 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_MAINTAINER:=Chen Minqiang