Skip to content

Commit

Permalink
update 2022-06-11 20:16:47
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jun 11, 2022
1 parent cd3f45b commit c20a144
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
7 changes: 5 additions & 2 deletions luci-app-openclash/luasrc/controller/openclash.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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
Expand Down Expand Up @@ -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
end
6 changes: 3 additions & 3 deletions luci-app-openclash/luasrc/view/openclash/sub_info_show.htm
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
function progressbar_<%=idname%>(v, m, pc, np, f, t, tr) {
return String.format(
'<div style="width:250px; max-width:500px; position:relative; border:1px solid #999999; border-radius: 6px">' +
(pc <= 50 ? '<div style="background-color:#9edd9e; width:%d%%; height:35px; border-radius: 6px">' : (pc > 50 && pc <= 80 ? '<div style="background-color:#ffc99f; width:%d%%; height:35px">' : '<div style="background-color:#ffb9b9; width:%d%%; height:35px">')) +
'<div style="position:absolute; left:0; top:0; text-align:center; width:100%%">' +
'<small>%s '+(f ? f : '/')+' %s ' + (np ? "" : '(%s%%)') + '<br/>' + '%s (<%:Remaining%> %s <%:days%>)</small>' +
(pc <= 50 ? '<div style="background-color:#9edd9e; width:%d%%; height:36px; border-radius: 6px">' : (pc > 50 && pc <= 80 ? '<div style="background-color:#ffc99f; width:%d%%; height:35px">' : '<div style="background-color:#ffb9b9; width:%d%%; height:35px">')) +
'<div style="position:absolute; left:0;' + (t == "null" ? 'top:12px;' : 'top:0;') + 'text-align:center; width:100%%">' +
'<small>%s '+ (f ? f : '/') +' %s ' + (np ? "" : '(%s%%)') + (t == "null" ? '<div style="visibility: hidden;">' : '<div style="visibility: visible;">') + '%s (<%:Remaining%> %s <%:days%>)</small>' +
'</div>' +
'</div>' +
'</div>', pc, v, m, pc, t, tr
Expand Down
4 changes: 2 additions & 2 deletions natflow/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
Expand Down

0 comments on commit c20a144

Please sign in to comment.