diff --git a/package/lean/luci-app-zerotier/Makefile b/package/lean/luci-app-zerotier/Makefile index dbe9900fc..4f8b6034d 100644 --- a/package/lean/luci-app-zerotier/Makefile +++ b/package/lean/luci-app-zerotier/Makefile @@ -10,7 +10,7 @@ LUCI_TITLE:=LuCI for Zerotier LUCI_DEPENDS:=+zerotier LUCI_PKGARCH:=all PKG_VERSION:=1.0 -PKG_RELEASE:=11 +PKG_RELEASE:=12 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/package/lean/luci-app-zerotier/luasrc/model/cbi/zerotier.lua b/package/lean/luci-app-zerotier/luasrc/model/cbi/zerotier.lua index e9d752f8b..c63848981 100644 --- a/package/lean/luci-app-zerotier/luasrc/model/cbi/zerotier.lua +++ b/package/lean/luci-app-zerotier/luasrc/model/cbi/zerotier.lua @@ -10,21 +10,41 @@ t=a:section(NamedSection,"sample_config","zerotier") t.anonymous=true t.addremove=false -e=t:option(Flag,"enabled",translate("Enable")) +t:tab("basic", translate("Base Setting")) + +e=t:taboption("basic", Flag,"enabled",translate("Enable")) e.default=0 e.rmempty=false -e=t:option(DynamicList,"join",translate('ZeroTier Network ID')) +e=t:taboption("basic", DynamicList,"join",translate('ZeroTier Network ID')) e.password=true e.rmempty=false -e=t:option(Flag,"nat",translate("Auto NAT Clients")) +e=t:taboption("basic", Flag,"nat",translate("Auto NAT Clients")) e.default=0 e.rmempty=false e.description = translate("Allow zerotier clients access your LAN network") -e=t:option(DummyValue,"opennewwindow" , +e=t:taboption("basic", DummyValue,"opennewwindow" , translate("")) e.description = translate("Create or manage your zerotier network, and auth clients who could access") +local dog = "/tmp/zero.info" +t:tab("watchdog", translate("Interface Info")) +log = t:taboption("watchdog", TextValue, "sylogtext") +log.template = "cbi/tvalue" +log.rows = 8 +log.wrap = "off" +log.readonly="readonly" + +function log.cfgvalue(self, section) + luci.sys.exec("ifconfig $(ifconfig | grep zt | awk '{print $1}') > /tmp/zero.info") + return nixio.fs.readfile(dog) or "" +end + +function log.write(self, section, value) + value = value:gsub("\r\n?", "\n") + nixio.fs.writefile(dog, value) +end + return a diff --git a/package/lean/luci-app-zerotier/po/zh-cn/zerotier.po b/package/lean/luci-app-zerotier/po/zh-cn/zerotier.po index 491ca5a87..3787a890d 100644 --- a/package/lean/luci-app-zerotier/po/zh-cn/zerotier.po +++ b/package/lean/luci-app-zerotier/po/zh-cn/zerotier.po @@ -1,3 +1,11 @@ +msgid "" +msgstr "" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Gtranslator 2.91.7\n" +"Plural-Forms: nplurals=1; plural=0;\n" + msgid "Zerotier is an open source, cross-platform and easy to use virtual LAN" msgstr "Zerotier是一个开源,跨平台,而且适合内网穿透互联的傻瓜配置虚拟 VPN LAN" @@ -5,7 +13,10 @@ msgid "Auto NAT Clients" msgstr "自动允许客户端NAT" msgid "Allow zerotier clients access your LAN network" -msgstr "允许Zerotier的拨入客户端访问LAN局域网" +msgstr "允许Zerotier的拨入客户端访问路由器LAN资源(需要在 Zerotier管理页面设定到LAN网段的路由表)" msgid "Create or manage your zerotier network, and auth clients who could access" msgstr "点击跳转到Zerotier官网管理平台,新建或者管理网络,并允许客户端接入访问你私人网路(新接入的节点默认不允许访问)" + +msgid "Interface Info" +msgstr "接口信息" diff --git a/package/lean/luci-app-zerotier/root/etc/zerotier.start b/package/lean/luci-app-zerotier/root/etc/zerotier.start index e64da6930..7bfc2acf5 100755 --- a/package/lean/luci-app-zerotier/root/etc/zerotier.start +++ b/package/lean/luci-app-zerotier/root/etc/zerotier.start @@ -7,8 +7,7 @@ if [ $zero_enable -eq 1 ]; then if [ -f /tmp/zero.log ];then while [ "$(ifconfig | grep zt | awk '{print $1}')" = "" ] do - echo "zt interface not started yet, try build rules after 5s" - sleep 5 + sleep 1 done fi