up onliner

This commit is contained in:
sirpdboy 2020-11-11 16:23:59 +08:00
parent 4d787b8f2e
commit a0d5bbe80b
6 changed files with 24 additions and 8 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
@ -17,6 +17,10 @@ define Package/luci-app-onliner/install
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,10 @@
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","nlbw","onliner"},alias("admin","nlbw","onliner","onliner"),_("speed monitoring"), 1)
entry({"admin","nlbw","onliner","onliner"},template("onliner/onliner"),_("Online User"), 2)
entry({"admin","nlbw","onliner","speed"}, template("onliner/display"), _("speed"), 3)
entry({"admin","nlbw","onliner","setnlbw"}, call("set_nlbw"))
end
function set_nlbw()
if nixio.fs.access("/var/run/onsetnlbw") then

View File

@ -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

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

View File

@ -2,7 +2,7 @@
if [ "$PKG_UPGRADE" != 1 ]; then
uci batch <<-EOF
set luci.themes.Btmod=/luci-static/btmod
set luci.main.mediaurlbase=/luci-static/btmod
#set luci.main.mediaurlbase=/luci-static/btmod
commit luci
EOF
if

View File

@ -2,7 +2,7 @@
if [ "$PKG_UPGRADE" != 1 ]; then
uci batch <<-EOF
set luci.themes.opentomcat=/luci-static/opentomcat
set luci.main.mediaurlbase=/luci-static/opentomcat
#set luci.main.mediaurlbase=/luci-static/opentomcat
commit luci
EOF
fi