module("luci.controller.vpnbypass", package.seeall)
function index()
if nixio.fs.access("/etc/config/vpnbypass") then
- entry({"admin", "vpn"}, firstchild(), _("VPN"), 60).dependent=false
+ local e = entry({"admin", "vpn"}, firstchild(), _("VPN"), 60)
+ e.dependent = false
+ e.acl_depends = { "luci-app-vpnbypass" }
+
entry({"admin", "vpn", "vpnbypass"}, cbi("vpnbypass"), _("VPN Bypass"))
entry({"admin", "vpn", "vpnbypass", "action"}, call("vpnbypass_action"), nil).leaf = true
end
local packageName = "vpnbypass"
local packageVersion, statusText = nil, nil
-packageVersion = tostring(util.trim(sys.exec("opkg list-installed " .. packageName .. " | awk '{print $3}'")))
-if not packageVersion or packageVersion == "" then
- packageVersion = ""
- statusText = packageName .. " " .. translate("is not installed or not found")
-else
- packageVersion = " [" .. packageName .. " " .. packageVersion .. "]"
+packageVersion = tostring(util.trim(sys.exec("opkg list-installed " .. packageName .. " | awk '{print $3}'"))) or ""
+if packageVersion == "" then
+ statusText = translatef("%s is not installed or not found", packageName)
end
local serviceRunning, serviceEnabled = false, false
else
statusText = translate("Stopped")
if not serviceEnabled then
- statusText = statusText .. " (" .. translate("disabled") .. ")"
+ statusText = translatef("%s (disabled)", statusText)
end
end
m = Map("vpnbypass", translate("VPN Bypass Settings"))
-h = m:section(NamedSection, "config", packageName, translate("Service Status") .. packageVersion)
+h = m:section(NamedSection, "config", packageName, translatef("Service Status [%s %s]", packageName, packageVersion))
ss = h:option(DummyValue, "_dummy", translate("Service Status"))
ss.template = packageName .. "/status"
ss.value = statusText
s4 = d:section(TypedSection, "dnsmasq")
s4.anonymous = true
di = s4:option(DynamicList, "ipset", translate("Domains to Bypass"),
- translate("Domains to be accessed directly (outside of the VPN tunnel), see ")
- .. [[<a href="]] .. readmeURL .. [[#bypass-domains-formatsyntax" target="_blank">]]
- .. translate("README") .. [[</a> ]] .. translate("for syntax"))
+ translatef("Domains to be accessed directly (outside of the VPN tunnel), see %sREADME%s for syntax",
+ "<a href=\"" .. readmeURL .. "#bypass-domains-formatsyntax" .. "\" target=\"_blank\">", "</a>"))
function d.on_after_commit(map)
util.exec("/etc/init.d/dnsmasq restart >/dev/null 2>&1")
end
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:26
+msgid "%s (disabled)"
+msgstr ""
+
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:10
+msgid "%s is not installed or not found"
+msgstr ""
+
#: applications/luci-app-vpnbypass/luasrc/view/vpnbypass/buttons.htm:57
msgid "Disable"
msgstr ""
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:77
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:74
msgid "Domains to Bypass"
msgstr ""
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:78
-msgid "Domains to be accessed directly (outside of the VPN tunnel), see"
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:75
+msgid ""
+"Domains to be accessed directly (outside of the VPN tunnel), see %sREADME%s "
+"for syntax"
msgstr ""
#: applications/luci-app-vpnbypass/luasrc/view/vpnbypass/buttons.htm:54
msgid "Loading"
msgstr ""
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:60
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:57
msgid "Local IP Addresses to Bypass"
msgstr ""
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:60
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:57
msgid ""
"Local IP addresses or subnets with direct internet access (outside of the "
"VPN tunnel)"
msgstr ""
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:46
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:43
msgid "Local Ports to Bypass"
msgstr ""
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:46
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:43
msgid "Local ports to trigger VPN Bypass"
msgstr ""
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:80
-msgid "README"
-msgstr ""
-
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:67
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:64
msgid "Remote IP Addresses to Bypass"
msgstr ""
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:67
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:64
msgid ""
"Remote IP addresses or subnets which will be accessed directly (outside of "
"the VPN tunnel)"
msgstr ""
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:53
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:50
msgid "Remote Ports to Bypass"
msgstr ""
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:53
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:50
msgid "Remote ports to trigger VPN Bypass"
msgstr ""
msgid "Restart"
msgstr ""
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:25
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:22
msgid "Running"
msgstr ""
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:35
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:36
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:33
msgid "Service Status"
msgstr ""
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:32
+msgid "Service Status [%s %s]"
+msgstr ""
+
#: applications/luci-app-vpnbypass/luasrc/view/vpnbypass/buttons.htm:41
msgid "Start"
msgstr ""
msgid "Stop"
msgstr ""
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:27
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:24
msgid "Stopped"
msgstr ""
msgid "VPN"
msgstr ""
-#: applications/luci-app-vpnbypass/luasrc/controller/vpnbypass.lua:5
+#: applications/luci-app-vpnbypass/luasrc/controller/vpnbypass.lua:8
msgid "VPN Bypass"
msgstr ""
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:44
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:41
msgid "VPN Bypass Rules"
msgstr ""
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:33
+#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:30
msgid "VPN Bypass Settings"
msgstr ""
-
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:29
-msgid "disabled"
-msgstr ""
-
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:80
-msgid "for syntax"
-msgstr ""
-
-#: applications/luci-app-vpnbypass/luasrc/model/cbi/vpnbypass.lua:11
-msgid "is not installed or not found"
-msgstr ""