luci-app-vpn-policy-routing: add note about default routing 3455/head
authorStan Grishin <stangri@melmac.net>
Fri, 3 Jan 2020 04:14:18 +0000 (21:14 -0700)
committerStan Grishin <stangri@melmac.net>
Fri, 3 Jan 2020 04:14:18 +0000 (21:14 -0700)
Signed-off-by: Stan Grishin <stangri@melmac.net>
applications/luci-app-vpn-policy-routing/Makefile
applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua
applications/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/status-gateways.htm [new file with mode: 0644]

index 8dd26c6de43a7c87cbc068393760199f98317185..56e22fc5f1078b23c66be17d7d61ab0b381f30e5 100644 (file)
@@ -10,7 +10,7 @@ LUCI_TITLE:=VPN Policy-Based Routing Service Web UI
 LUCI_DESCRIPTION:=Provides Web UI for vpn-policy-routing service.
 LUCI_DEPENDS:=+luci-compat +luci-mod-admin-full +vpn-policy-routing
 LUCI_PKGARCH:=all
-PKG_RELEASE:=67
+PKG_RELEASE:=68
 
 include ../../luci.mk
 
index e6b1156eb3ab451b03a6da0e74c162969367630f..95d42945eb37a9a2792e4381b4a2ad3af7a7f552 100644 (file)
@@ -1,9 +1,4 @@
 local readmeURL = "https://github.com/openwrt/packages/tree/master/net/vpn-policy-routing/files/README.md"
--- local readmeURL = "https://github.com/stangri/openwrt_packages/tree/master/vpn-policy-routing/files/README.md"
-
--- function log(obj)
---     if obj ~= nil then if type(obj) == "table" then luci.util.dumptable(obj) else luci.util.perror(obj) end else luci.util.perror("Empty object") end
--- end
 
 local packageName = "vpn-policy-routing"
 local uci = require "luci.model.uci".cursor()
@@ -73,13 +68,13 @@ end
 local lanIPAddr = uci:get("network", "lan", "ipaddr")
 local lanNetmask = uci:get("network", "lan", "netmask")
 -- if multiple ip addresses on lan interface, will be return as table of CIDR notations i.e. {"10.0.0.1/24","10.0.0.2/24"}
-if (type(lanIPAddr) == "table") then                                                                                   
-                               first = true                                                                                             
-                               for i,line in ipairs(lanIPAddr) do                                                                  
-                                                               lanIPAddr = lanIPAddr[i]                                                                    
-                                                               break                                           
-                               end                                                     
-                               lanIPAddr = string.match(lanIPAddr,"[0-9.]+")                                                            
+if (type(lanIPAddr) == "table") then
+                               first = true
+                               for i,line in ipairs(lanIPAddr) do
+                                                               lanIPAddr = lanIPAddr[i]
+                                                               break
+                               end
+                               lanIPAddr = string.match(lanIPAddr,"[0-9.]+")
 end          
 if lanIPAddr and lanNetmask then
        laPlaceholder = ip.new(lanIPAddr .. "/" .. lanNetmask )
@@ -125,7 +120,7 @@ status.template = "vpn-policy-routing/status"
 status.value = pkgStatusLabel
 if pkgStatus:match("Running") and pkgGateways and pkgGateways ~= "" then
        gateways = h:option(DummyValue, "_dummy", translate("Service Gateways"))
-       gateways.template = packageName .. "/status-textarea"
+       gateways.template = packageName .. "/status-gateways"
        gateways.value = pkgGateways
 end
 if pkgErrors and pkgErrors ~= "" then
diff --git a/applications/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/status-gateways.htm b/applications/luci-app-vpn-policy-routing/luasrc/view/vpn-policy-routing/status-gateways.htm
new file mode 100644 (file)
index 0000000..d349083
--- /dev/null
@@ -0,0 +1,18 @@
+<%#
+Copyright 2017-2019 Stan Grishin (stangri@melmac.net)
+This is free software, licensed under the Apache License, Version 2.0
+-%>
+
+<%+cbi/valueheader%>
+
+<textarea rows="<%=select(2, self:cfgvalue(section):gsub('\n', '\n'))%>"
+       style="outline:none;border:none;box-shadow:none;background:transparent;font-weight:bold;line-height:20px;width:50em;padding:none;margin:6px;resize:none;overflow:hidden;"
+       disabled="disabled"><%=self:cfgvalue(section):gsub('\n', '\n')%>
+</textarea>
+
+<%- local readmeURL = "https://github.com/openwrt/packages/tree/master/net/vpn-policy-routing/files/README.md" -%>
+<%=translate("Checkmark represents the default gateway. See the") .. " " 
+.. [[<a href="]] .. readmeURL .. [[#a-word-about-default-routing" target="_blank">]] 
+.. translate("README") .. [[</a>]] .. " " .. translate("for details.")%>
+
+<%+cbi/valuefooter%>
\ No newline at end of file