up onliner

This commit is contained in:
sirpdboy 2021-02-07 11:31:45 +08:00
parent 62c8c05a20
commit 3e27903304
8 changed files with 23 additions and 234 deletions

View File

@ -1,2 +0,0 @@
# Auto detect text files and perform LF normalization
* text=auto

View File

@ -1,2 +0,0 @@
*.bak

View File

@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support arp online
LUCI_DEPENDS:=+luci-app-wrtbwmon +luci-app-nlbwmon
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"),_("Connection info"))
entry({"admin","status","onliner","onliner"},template("onliner/onliner"),_("Online User"),1)
entry({"admin", "status","onliner","speed"}, template("onliner/display"), _("Speed monitor"), 2)
entry({"admin", "status","onliner","setnlbw"}, call("set_nlbw"))
entry({"admin","nlbw","onliner"},alias("admin","nlbw","onliner","onliner"),_("speed monitoring"), 50)
entry({"admin","nlbw","onliner","onliner"},template("onliner/onliner"),_("Online User"), 1)
entry({"admin","nlbw","onliner","speed"}, template("onliner/display"), _("speed"), 2)
entry({"admin","nlbw","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 = $.extend(true, {}, trafficData["data"]);
bakdatanew = JSON.parse(JSON.stringify(trafficData["data"]));
if (bakdataold){
var j=0;
var k=j;
var ll=Object.getOwnPropertyNames(bakdataold).length;
var ll=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,7 +71,7 @@ end
var td = tr.insertCell(-1);
td.colSpan = 4;
td.innerHTML = '<em><br /><%:There is no one online now.%></em>';
td.innerHTML = '<em><br /><%:What? There is no one online.%></em>';
}
}
}
@ -81,7 +81,7 @@ end
<h2 name="content"><%:Status%></h2>
<fieldset class="cbi-section">
<legend><%:Online User%></legend>
<legend><%:user online%></legend>
<table class="cbi-section-table" id="online_status_table">
<tr class="cbi-section-table-titles">

View File

@ -1,219 +1,12 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: PACKAGE VERSION\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: zh_Hans\n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
#: /luasrc/view/onliner/display.htm:769
msgid "%d IPv4-only hosts"
msgstr ""
#: /luasrc/view/onliner/display.htm:776
msgid "%d IPv6-only hosts"
msgstr ""
#: /luasrc/view/onliner/display.htm:783
msgid "%d dual-stack hosts"
msgstr ""
#: /luasrc/view/onliner/display.htm:260
msgid "%s and %s"
msgstr ""
#: /luasrc/view/onliner/display.htm:258
msgid "%s, %s and %s"
msgstr ""
#: /luasrc/view/onliner/display.htm:836
msgid "<big id=\"conn-total\">0</big> connections"
msgstr ""
#: /luasrc/view/onliner/display.htm:833
msgid "<big id=\"host-total\">0</big> hosts"
msgstr ""
#: /luasrc/view/onliner/display.htm:877
msgid "<big id=\"ipv6-hosts\">0%</big> IPv6 support rate among hosts"
msgstr ""
#: /luasrc/view/onliner/display.htm:879
msgid "<big id=\"ipv6-rx\">0B</big> total IPv6 download"
msgstr ""
#: /luasrc/view/onliner/display.htm:878
msgid "<big id=\"ipv6-share\">0%</big> of the total traffic is IPv6"
msgstr ""
#: /luasrc/view/onliner/display.htm:880
msgid "<big id=\"ipv6-tx\">0B</big> total IPv6 upload"
msgstr ""
#: /luasrc/view/onliner/display.htm:858
msgid "<big id=\"layer7-most-conn\">0</big> cause the most connections"
msgstr ""
#: /luasrc/view/onliner/display.htm:856
msgid "<big id=\"layer7-most-rx\">0</big> cause the most download"
msgstr ""
#: /luasrc/view/onliner/display.htm:857
msgid "<big id=\"layer7-most-tx\">0</big> cause the most upload"
msgstr ""
#: /luasrc/view/onliner/display.htm:855
msgid "<big id=\"layer7-total\">0</big> different application protocols"
msgstr ""
#: /luasrc/view/onliner/display.htm:834
msgid "<big id=\"rx-total\">0</big> download"
msgstr ""
#: /luasrc/view/onliner/display.htm:835
msgid "<big id=\"tx-total\">0</big> upload"
msgstr ""
#: /luasrc/view/onliner/display.htm:864
msgid "Application"
msgstr ""
#: /luasrc/view/onliner/display.htm:825
msgid "Application Protocols"
msgstr ""
#: /luasrc/view/onliner/onliner.htm:94
msgid "Collecting data..."
msgstr ""
#: /luasrc/view/onliner/display.htm:434
msgid "Conn."
msgstr ""
#: /luasrc/controller/onliner.lua:4
msgid "Connection info"
msgstr "连接信息"
#: /luasrc/view/onliner/display.htm:844
#: /luasrc/view/onliner/display.htm:865
msgid "Connections"
msgstr ""
#: /luasrc/view/onliner/display.htm:435
msgid "Down. (Bytes / Pkts.)"
msgstr ""
#: /luasrc/view/onliner/display.htm:845
#: /luasrc/view/onliner/display.htm:866
#: /luasrc/view/onliner/display.htm:889
msgid "Download (Bytes / Packets)"
msgstr ""
#: /luasrc/view/onliner/display.htm:888
msgid "Family"
msgstr ""
#: /luasrc/view/onliner/display.htm:577
#: /luasrc/view/onliner/display.htm:633
#: /luasrc/view/onliner/display.htm:747
msgid "Force reload…"
msgstr ""
#: /luasrc/view/onliner/display.htm:842
#: /luasrc/view/onliner/display.htm:886
msgid "Host"
msgstr ""
#: /luasrc/view/onliner/onliner.htm:88
msgid "Hostname"
msgstr ""
#: /luasrc/view/onliner/display.htm:814
msgid "Hostname: <big id=\"bubble-hostname\">example.org</big>"
msgstr ""
#: /luasrc/view/onliner/onliner.htm:89
msgid "IPv4-Address"
msgstr ""
#: /luasrc/view/onliner/display.htm:826
msgid "IPv6"
msgstr ""
#: /luasrc/view/onliner/onliner.htm:91
msgid "Interface"
msgstr ""
#: /luasrc/view/onliner/display.htm:843
#: /luasrc/view/onliner/display.htm:887
msgid "MAC"
msgstr ""
#: /luasrc/view/onliner/onliner.htm:90
msgid "MAC-Address"
msgstr ""
#: /luasrc/view/onliner/display.htm:805
msgid "Netlink Bandwidth Monitor"
msgstr ""
#: /luasrc/view/onliner/display.htm:577
#: /luasrc/view/onliner/display.htm:633
#: /luasrc/view/onliner/display.htm:747
msgid "No data recorded yet."
msgstr ""
#: /luasrc/controller/onliner.lua:5
#: /luasrc/view/onliner/onliner.htm:84
msgid "Online User"
msgstr "在线用户"
msgstr "用户列表"
#: /luasrc/view/onliner/display.htm:545
msgid "Protocol"
msgstr ""
msgid "speed monitoring"
msgstr "实时网速监控"
#: /luasrc/view/onliner/display.htm:538
msgid "Source IP"
msgstr ""
msgid "user online"
msgstr "客户端"
#: /luasrc/controller/onliner.lua:6
msgid "Speed monitor"
msgstr "宽带监视"
msgid "speed"
msgstr "网速监控"
#: /luasrc/view/onliner/onliner.htm:81
msgid "Status"
msgstr ""
#: /luasrc/view/onliner/onliner.htm:74
msgid "There is no one online now."
msgstr "当前无任何设备在线。"
#: /luasrc/view/onliner/display.htm:824
msgid "Traffic Distribution"
msgstr ""
#: /luasrc/view/onliner/display.htm:436
msgid "Up. (Bytes / Pkts.)"
msgstr ""
#: /luasrc/view/onliner/display.htm:846
#: /luasrc/view/onliner/display.htm:867
#: /luasrc/view/onliner/display.htm:890
msgid "Upload (Bytes / Packets)"
msgstr ""
#: /luasrc/view/onliner/display.htm:815
msgid "Vendor: <big id=\"bubble-vendor\">Example Corp.</big>"
msgstr ""
#: /luasrc/view/onliner/display.htm:443
#: /luasrc/view/onliner/display.htm:451
#: /luasrc/view/onliner/display.htm:456
#: /luasrc/view/onliner/display.htm:539
#: /luasrc/view/onliner/display.htm:607
#: /luasrc/view/onliner/display.htm:612
#: /luasrc/view/onliner/display.htm:615
msgid "other"
msgstr ""

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)