update 05-03 23:05:47

This commit is contained in:
github-actions[bot]
2022-05-03 23:05:47 +08:00
parent 1bcaa400f9
commit 8925f29fcc
7 changed files with 30 additions and 17 deletions

View File

@@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support arp online
LUCI_DEPENDS:=
LUCI_DEPENDS:=+luci-app-nlbwmon
LUCI_PKGARCH:=all
PKG_NAME:=luci-app-onliner
PKG_VERSION:=1.1
@@ -15,8 +15,13 @@ PKG_RELEASE:=5
define Package/luci-app-onliner/install
$(INSTALL_DIR) $(1)/usr/lib/lua/luci
cp -pR ./luasrc/* $(1)/usr/lib/lua/luci
$(INSTALL_DIR) $(1)/
cp -pR ./root/* $(1)/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
po2lmo ./po/zh-cn/onliner.po $(1)/usr/lib/lua/luci/i18n/onliner.zh-cn.lmo
endef
define Package/luci-app-onliner/postinst

View File

@@ -1,10 +1,11 @@
module("luci.controller.onliner",package.seeall)
nixio=require"nixio"
function index()
entry({"admin","status","onliner"},alias("admin","status","onliner","onliner"),_("Online User"))
entry({"admin","status","onliner","onliner"},template("onliner/onliner"),_("Online User"),1)
entry({"admin", "status","onliner","speed"}, template("onliner/display"), _("speed"), 2)
entry({"admin", "status","onliner","setnlbw"}, call("set_nlbw"))
entry({"admin","status","onliner"},alias("admin","status","onliner","onliner"),_("Online User"), 50)
entry({"admin","status","onliner","onliner"},template("onliner/onliner"),_("User List"), 1)
entry({"admin","status","onliner","speed"}, template("onliner/display"), _("speed"), 2)
entry({"admin","status","onliner","setnlbw"}, call("set_nlbw"))
end
function set_nlbw()
if nixio.fs.access("/var/run/onsetnlbw") then

View File

@@ -357,11 +357,11 @@ function fetchData(period)
if (res !== null && typeof(res) === 'object' && typeof(res.columns) === 'object' && typeof(res.data) === 'object')
trafficData = res;
trafficData["data"].sort();
bakdatanew = JSON.parse(JSON.stringify(trafficData["data"]));
bakdatanew = $.extend(true, {}, trafficData["data"]);
if (bakdataold){
var j=0;
var k=j;
var ll=bakdataold.length;
var ll=Object.getOwnPropertyNames(bakdataold).length;
for (i=0,l=trafficData["data"].length; i<l ; i++){
one=trafficData["data"][i];
for (j=k;j<ll;j++){
@@ -394,7 +394,7 @@ function fetchData(period)
renderLayer7Data();
renderIPv6Data();
});
XHR.poll(5,'<%=url([[admin]], [[status]], [[onliner]], [[setnlbw]])%>', null, function(xhr, res) {
XHR.poll(5,'<%=url([[admin]], [[nlbw]], [[onliner]], [[setnlbw]])%>', null, function(xhr, res) {
});
}

View File

@@ -71,17 +71,17 @@ end
var td = tr.insertCell(-1);
td.colSpan = 4;
td.innerHTML = '<em><br /><%:What? There is no one online.%></em>';
td.innerHTML = '<em><br /><%:There is no one online now.%></em>';
}
}
}
);
//]]></script>
<h2 name="content"><%:Status%></h2>
<h2 name="content" style="display:none"><%:Status%></h2>
<fieldset class="cbi-section">
<legend><%:user online%></legend>
<legend style="display:none"><%:user online%></legend>
<table class="cbi-section-table" id="online_status_table">
<tr class="cbi-section-table-titles">

View File

@@ -0,0 +1,12 @@
msgid "Online User"
msgstr "在线用户"
msgid "User List"
msgstr "用户列表"
msgid "user online"
msgstr "客户端"
msgid "speed"
msgstr "网速监控"

1
luci-app-onliner/po/zh_Hans Symbolic link
View File

@@ -0,0 +1 @@
zh-cn

View File

@@ -1,6 +0,0 @@
### 通过arp实现的在线人员查看的luci界面统计误差为arp老化时间 ###
### 通过nlbwmon实现的实时网速查看每两秒更新 需要luci-app-nlbwmon ###
![图片](https://user-images.githubusercontent.com/22387141/70726447-0c01b000-1d39-11ea-914c-f539cf4943a0.png)
![图片](https://user-images.githubusercontent.com/22387141/70726285-d2c94000-1d38-11ea-8ee6-10fc083533d3.png)