Developing lightweight computation at the DSG edge

Commit b83d08a8 authored by Roger Pueyo Centelles's avatar Roger Pueyo Centelles
Browse files

Menus reviewed. Configuration pages reviewed.

parent c4581c74
......@@ -47,9 +47,9 @@ function index()
entry({"qmp","configuration","gateways"}, cbi("qmp/gateways"), "qMp gateways", 6).dependent=false
entry({"qmp","tools"}, call("action_tools"), "Tools", 5).dependent=false
entry({"qmp","tools","tools"}, call("action_tools"), "Tools", 1).dependent=false
entry({"qmp","tools","splash"}, call("action_splash"), "Splash", 2).dependent=false
entry({"qmp","tools","map"}, call("action_map"), "Map", 3).dependent=false
entry({"qmp","tools","tools"}, call("action_tools"), "Network testing", 1).dependent=false
-- entry({"qmp","tools","splash"}, call("action_splash"), "Splash", 2).dependent=false
-- entry({"qmp","tools","map"}, call("action_map"), "Map", 3).dependent=false
entry({"qmp","about"}, call("action_status"), "About", 9).dependent=false
end
......
......@@ -29,23 +29,14 @@ local uciout = uci.cursor()
package.path = package.path .. ";/etc/qmp/?.lua"
qmpinfo = require "qmpinfo"
m = SimpleForm("qmp", translate("qMp easy setup"))
m = SimpleForm("qmp", translate("qMp easy setup"),translate("This page provides a fast and simple way to configure the basic settings of a qMp node.").." "..translate("Use the fields below to specify the network mode, the IP addressing and the interface modes."))
m:section(NamedSection, "interfaces", "qmp", translate("Network mode"), translate("Select mutually exclusive. <strong>Do set LAN and WAN modes.</strong>"))
local mode_help
mode_help = m:field(DummyValue,"mode_help")
mode_help.rawhtml = true
mode_help.default = "<strong>"..translate("Network mode").."</strong>".."<br/> <br/>"..translate("qMp nodes can operate in two different modes, depending on the kind of network to deploy.").." "..translate("According to your needs, you can choose between")..":<br/> <br/> · "..translate("roaming mode, for quick, temporal deployments. User devices connected to the network can roam between Access Points without loosing connectivity. However, they can not see other devices connected to the Mesh.").."<br/> · "..translate("community mode for static, long-term deployments (such as community networks). User devices connected to the network get an IP address from a specific range and are accessible from the rest of the Mesh. However, roaming between stations is not possible.").."<br/> <br/>"
local roaming_help
roaming_help = m:field(DummyValue,"roaming_help")
roaming_help:depends("_netmode","roaming")
roaming_help.rawhtml = true
roaming_help.default = translate("This page provides a simple way to configure the basic settings of a qMp node. <br/> <br/> qMp can work in two modes, \"roaming\" and \"community\":<br/> <br/> · Roaming mode is used for quick, temporal deployments. User devices connected to the network can roam between Access Points without loosing connectivity. However, they can not see other devices connected to the Mesh.<br/> <br/> · Community mode is used for static, long-term deployments (such as community networks). User devices connected to the network get an IP address from a specific range and are accessible from the rest of the Mesh. However, roaming between stations is not possible.<br/> <br/>")
local community_help
community_help = m:field(DummyValue,"community_help")
community_help:depends("_netmode","community")
community_help.rawhtml = true
community_help.default = translate("This page provides a simple way to configure the basic settings of a qMp node. <br/> <br/> qMp can work in two modes, \"roaming\" and \"community\":<br/> <br/> · Roaming mode is used for quick, temporal deployments. User devices connected to the network can roam between Access Points without loosing connectivity. However, they can not see other devices connected to the Mesh.<br/> <br/> · Community mode is used for static, long-term deployments (such as community networks). User devices connected to the network get an IP address from a specific range and are accessible from the rest of the Mesh. However, roaming between stations is not possible.<br/> <br/>")
netmode = m:field(ListValue, "_netmode",translate("Network mode"),translate("\"Roaming\" mode is best for quick, temporal network setups.<br/>Choose \"community\" mode for community networks and long-term deployments."))
netmode = m:field(ListValue, "_netmode","<strong>"..translate(" ").."</strong>",translate("\"Roaming\" mode for quick, temporal network setups. \"Community\" mode for community networks and long-term deployments."))
netmode:value("community","community")
netmode:value("roaming","roaming")
......@@ -64,8 +55,15 @@ else
end
netmode.default=networkmode
local nodeip_roaming = m:field(Value, "_nodeip_roaming", translate("IP address"),
translate("Main IPv4 address for this node. This IP must be unique in the Mesh network. <br/>Leave it blank to get a random one."))
local roaming_ipaddress_help
roaming_ipaddress_help = m:field(DummyValue,"roaming_ipaddress_help")
roaming_ipaddress_help.rawhtml = true
roaming_ipaddress_help:depends("_netmode","roaming")
roaming_ipaddress_help.default = "<strong>"..translate("IP address").."</strong>".."<br/> <br/>"..translate("Specify here an IP address for this node.").." "..translate("In roaming mode, all qMp nodes in a mesh network need a unique IPv4 address.").." "..translate("If unsure about which one to select, leave the field blank and a random one will be assigned automatically.").."<br/> <br/>"
local nodeip_roaming = m:field(Value, "_nodeip_roaming", " ",
translate("Main IPv4 address for this node.").." "..translate("Leave it blank to get a random one."))
nodeip_roaming:depends("_netmode","roaming")
......@@ -80,7 +78,13 @@ end
nodeip_roaming.default=rip
nodeip_roaming.datatype="ip4prefix"
local nodename = m:field(Value, "_nodename", translate("Node name"),
local community_name_help
community_name_help = m:field(DummyValue,"community_name_help")
community_name_help.rawhtml = true
community_name_help:depends("_netmode","community")
community_name_help.default = "<strong>"..translate("Node name").."</strong>".."<br/> <br/>"..translate("Choose a name for this node. It will be used to identify the device in the network. Use only alphanumeric characters, spaces are not allowed.").."<br/> <br/>"
local nodename = m:field(Value, "_nodename", " ",
translate("The name of this node. Four hex numbers will be appended, according the the device's MAC address."))
nodename:depends("_netmode","community")
......@@ -90,19 +94,31 @@ if uciout:get("qmp","node","community_id") ~= nil then
nodename.default=uciout:get("qmp","node","community_id")
end
local nodeip = m:field(Value, "_nodeip", translate("IP address"),
translate("Main IPv4 address for this node. This IP must be unique in the Mesh network. It will be used in the LAN for end users."))
local community_addressing_help
community_addressing_help = m:field(DummyValue,"community_addressing_help")
community_addressing_help.rawhtml = true
community_addressing_help:depends("_netmode","community")
community_addressing_help.default = "<strong>"..translate("IP address and network mask").."</strong>".."<br/> <br/>"..translate("Specify the IP address and the network mask for this node, according to the planification of your community or your network deployment.").." "..translate("End-user devices will get an IP address within the valid range determined by these two values.").."<br/> <br/>"
local nodeip = m:field(Value, "_nodeip", " ",
translate("Main IPv4 address for this node."))
nodeip:depends("_netmode","community")
nodeip.default = "10.30."..util.trim(util.exec("echo $((($(date +%M)*$(date +%S)%254)+1))"))..".1"
nodeip.datatype="ip4addr"
local nodemask = m:field(Value, "_nodemask",translate("Network mask"),
translate("Network mask to be used with the IPv4 address above. This mask will be used in the LAN for end users."))
local nodemask = m:field(Value, "_nodemask"," ",
translate("Network mask to be used with the IPv4 address above."))
nodemask:depends("_netmode","community")
nodemask.default = "255.255.255.0"
nodemask.datatype="ip4addr"
local interface_mode_help
interface_mode_help = m:field(DummyValue,"interface_mode_help")
interface_mode_help.rawhtml = true
interface_mode_help.default = "<strong>"..translate("Interface modes").."</strong>".."<br/> <br/>"..translate("Select the working mode of the network interfaces")..":<br/> <br/> · "..translate("LAN mode is used to provide connectivity to end-users (a DHCP server will be enabled to assign IP addresses to the devices connecting)").."<br/> · "..translate("WAN mode is used on interfaces connected to an Internet up-link or any other gateway connection").."<br/> · "..translate("Mesh mode is used on wireless interfaces to join the qMp mesh and, on wired interfaces, to link with other qMp nodes").."<br/> · "..translate("AP mode is used on wireless interfaces to act as an access point and provide connectivity to end-users").."<br/> <br/>"
if networkmode == "community" then
nodeip.default=uciout:get("qmp","networks","lan_address")
nodemask.default=uciout:get("qmp","networks","lan_netmask")
......@@ -125,7 +141,7 @@ local function is_a(dev, what)
end
for i,v in ipairs(devices.eth) do
tmp = m:field(ListValue, "_" .. v, translatef("Wired interface <strong>%s</strong> mode",v))
tmp = m:field(ListValue, "_" .. v, translatef("Wired interface <strong>%s</strong>",v))
tmp:value("Mesh")
tmp:value("Lan")
tmp:value("Wan")
......@@ -145,7 +161,7 @@ end
nodedevs_wifi = {}
for i,v in ipairs(devices.wifi) do
tmp = m:field(ListValue, "_" .. v, translatef("Wireless interface <strong>%s</strong> mode",v))
tmp = m:field(ListValue, "_" .. v, translatef("Wireless interface <strong>%s</strong>",v))
tmp:value("Mesh")
tmp:value("AP")
tmp.default = ""
......
......@@ -24,7 +24,7 @@ local http = require "luci.http"
local uci = luci.model.uci.cursor()
local sys = require("luci.sys")
m = Map("gateways", "Quick Mesh Project")
m = Map("gateways", "qMp gateway announcements")
-- GET GATEWAYS NAMES
gw_names = {}
......@@ -35,7 +35,7 @@ uci:foreach('gateways','gateway', function (s)
end
end)
gw_section = m:section(TypedSection, "gateway", translate("Gateways"),translate("Network announcements (i.e publish your home LAN) and network searches (i.e look for an Internet connection)."))
gw_section = m:section(TypedSection, "gateway", translate("qMp gateway announcements"),translate("Use this page to configure gateways and network announcements for your node (i.e. to publish your home LAN) and searches (i.e. look for an Internet gateway or a subnetwork announcement).").."<br/> <br/><strong>"..translate("Use with care!").."</strong> "..translate("Publising incorrect announcements might cause other nodes to lose Internet connection or render the mesh network inoperative."))
gw_section.addremove = true
gw_section.anonymous = false
......
......@@ -25,7 +25,7 @@ require("luci.sys")
local http = require "luci.http"
m = Map("qmp", "qMp network settings")
eth_section = m:section(NamedSection, "interfaces", "qmp", translate("Network mode"), translate("Select the working mode of the wired network interfaces: <br/> · LAN mode is used to provide end-users connectivity and a DHCP will be enabled to assign IP addresses to the devices connecting.<br/> · WAN mode is used on interfaces connected to an Internet up-link or any other gateway connection.<br/> <br/>LAN and WAN modes are mutually exclusive. <strong>Do set an interface in both LAN and WAN modes.</strong>"))
eth_section = m:section(NamedSection, "interfaces", "qmp", translate("Network mode"), translate("Select the working mode of the wired network interfaces: <br/> · LAN mode is used to provide end-users connectivity and a DHCP will be enabled to assign IP addresses to the devices connecting.<br/> · WAN mode is used on interfaces connected to an Internet up-link or any other gateway connection.<br/> <br/>LAN and WAN modes are mutually exclusive. <strong>Do not set an interface in both LAN and WAN modes.</strong>"))
eth_section.addremove = False
mesh_section = m:section(NamedSection, "interfaces", "qmp", translate("Mesh interfaces"), translate("Select the devices that will be used in the mesh network. It is recommended to select them all."))
......
......@@ -21,53 +21,46 @@
require("luci.sys")
local http = require "luci.http"
m = Map("qmp", "Quick Mesh Project")
m = Map("qmp", "qMp advanced network settings")
ethernet_interfaces = { 'eth', 'ath', 'wlan' }
wireless_interfaces = { 'ath', 'wlan' }
eth_section = m:section(NamedSection, "networks", "qmp", "Interfaces", "Interfaces")
eth_section = m:section(NamedSection, "networks", "qmp", translate("IP addressing"), translate("Use this section to modify the advanced network settings that are not displayed in the qMp easy setup page."))
eth_section.addremove = False
-- Option: DNS
eth_section:option(Value, "dns", "Nameservers",translate("Define the nameservers to use."))
eth_section:option(Value, "dns", "DNS nameservers",translate("Define the nameservers to use.").." "..translate("Separate them with a blank space"))
-- Option: lan addresses
eth_section:option(Value, "lan_address", "LAN address",translate("IPv4 address for LAN interfaces."))
eth_section:option(Value, "lan_address", "LAN IP address",translate("IPv4 address for the LAN interfaces."))
-- Option: lan addresses
eth_section:option(Value, "lan_netmask", "LAN netmask",translate("IPv4 netmask for LAN interfaces."))
eth_section:option(Value, "lan_netmask", "LAN netmask",translate("IPv4 netmask for the LAN interfaces."))
-- Option: publish lan
--eth_section:option(Flag, "publish_lan", "Publish LAN", "Publish LAN network through the mesh")
-- Option: disable dhcp
eth_section:option(Flag, "disable_lan_dhcp", "Disable DHCP from LAN",
eth_section:option(Flag, "disable_lan_dhcp", "Disable DHCP in LAN",
translate("Disable DHCP server in LAN network (not recommended)."))
-- Option bmx6_ipv4_address
eth_section:option(Value, "bmx6_ipv4_address", "Main IPv4 address",
translate("IPv4 address used for bmx6 (main address). Leave blank to randomize."))
translate("Main IPv4 address used in bmx6. Leave it blank to get a random one."))
-- Option: bmx6_ipv4_prefix24
eth_section:option(Value, "bmx6_ipv4_prefix24", "Random-IPv4 prefix 24",
translate("Used to calculate the IP if it is not defined in the field before (example: 10.40.50)."))
translate("Network prefix used to calculate a random IP address if the field above is left blank (example: 10.40.50)."))
-- Option: bmx6_ripe_prefix48
eth_section:option(Value, "bmx6_ripe_prefix48", "Main IPv6 prefix",
translate("If you have a global IPv6 48bits prefix, specify it here. Otherwise leave it blank."))
-- Option: netserver
nts = eth_section:option(ListValue, "netserver", "Permit bandwidth test",
translate("If enabled all nodes will be able to perform bandwidth tests with your node"))
nts:value("0","no")
nts:value("1","yes")
-- Option force_internet
fint = eth_section:option(ListValue, "force_internet", "Force internet",
translate("Usese it if you want force the system to share/unshare Internet (not recommended)"))
translate("Use it if you want force the system to share/unshare Internet (it is recommended to leave it as disabled)"))
fint:value("","disabled")
fint:value("1","yes")
fint:value("0","no")
......@@ -76,21 +69,19 @@ fint:value("0","no")
-- Non overlapping
---------------------------
overlapping_section = m:section(NamedSection, "roaming", "qmp",
translate("Roaming", "Layer3 Roaming"))
overlapping_section = m:section(NamedSection, "roaming", "qmp", translate("Roaming mode"))
overlapping_section.addremove = False
ignore = overlapping_section:option(ListValue, "ignore",
translate("Roaming","If yes, the roaming will be enabled. Each mesh node will give a different /24 to the LAN clients from the same /16."))
ignore = overlapping_section:option(ListValue, "ignore", translate("Roaming"),translate("If roaming mode is enabled, each node will provide its LAN clients with IP addresses from different /24 pools in the same /16 subnetwork.").." "..translate("Leave it disabled for community networks or long-term deployments."))
ignore:value("1","no")
ignore:value("0","yes")
-- Option: dhcp_offset
overlapping_section:option(Value, "dhcp_offset", "DHCP offset",
translate("Offset to calculate the first IP to give throw DHCP"))
translate("Offset to calculate the first IP to give via DHCP"))
-- Option: Leassetime
overlapping_section:option(Value, "qmp_leasetime", "DHCP leassetime",translate("Leassetime for DHCP"))
overlapping_section:option(Value, "qmp_leasetime", "DHCP leas etime",translate("Lease time for the DHCP server"))
--------------------------
......
......@@ -22,49 +22,54 @@
require("luci.sys")
local http = require "luci.http"
local m = Map("qmp", "Quick Mesh Project")
local m = Map("qmp", "qMp node services")
local section = m:section(NamedSection, "services", "qmp", translate("Services"), translate("System services control"))
section.addremove = False
local basic_services = m:section(NamedSection, "services", "qmp", translate("Basic qMp services"),
translate("These are the basic qMp services running on this node.").." "..translate("It is recommended to enable them, since they play an important role for end-user connectiviy and mesh network administration."))
basic_services.addremove = False
local additional_services = m:section(NamedSection, "services", "qmp", translate("Additional qMp services"),
translate("These are the additional services provided by this qMp node.").." "..translate("You can safely enable or disable them according to your needs without affecting basic node features or end-user connectivity."))
additional_services.addremove = False
-- Option: VPN
local vpn = section:option(Flag, "vpn", translate("Management VPN"),
translate("The Management VPN is used to control the nodes in remote from a central point"))
local vpn = additional_services:option(Flag, "vpn", translate("Management VPN"),
translate("The Management VPN is used to control the nodes remotely from a central point"))
vpn.default=0
-- Option: Captive Portal
local cp = section:option(Flag, "captive_portal", translate("Captive Portal"),
translate("The captive portal is a small http proxy used to show a HTML page the first time someone connects to the node's Access Point"))
cp.default=0
-- local cp = additional_services:option(Flag, "captive_portal", translate("Captive Portal"),
-- translate("The captive portal is a small http proxy used to show an HTML page the first time someone connects to the node's Access Point"))
-- cp.default=0
-- Option: b6m
local b6m = section:option(Flag, "b6m", translate("BMX6 map"),
translate("The b6m is a real time descentralized geopositioning map based on OpenStreetMaps (Internet access only required for the OSM but not for the status/topology)"))
b6m.default=0
-- local b6m = additional_services:option(Flag, "b6m", translate("BMX6 map"),
-- translate("B6m is a decentralized, real-time geopositioning map based on OpenStreetMaps (Internet connection is only required for the OSM but not for the status/topology)"))
-- b6m.default=0
-- Option: libremap
local alt = section:option(Flag, "libremap", translate("LibreMap"),
translate("LibreMap is a centralized geopositioning map. Internet and the previous creation of the node in the map page are required (http://libremap.net)"))
local alt = additional_services:option(Flag, "libremap", translate("LibreMap"),
translate("LibreMap is a centralized geopositioning map (Internet connection is required, as well as registering the node in the map page (http://libremap.net)"))
alt.default=0
-- Option: gwck
local gwck = section:option(Flag, "gwck", translate("Gateway Checker"),
translate("GWCK is a tool automatic discover and publish Internet access among the Mesh network"))
gwck.default=0
local gwck = basic_services:option(Flag, "gwck", translate("Gateway Checker").." "..translate("(GWCK)"),
translate("GWCK is a tool to automatically discover and publish Internet gateways among the Mesh network"))
gwck.default=1
-- Option: bwtest
local bwt = section:option(Flag, "bwtest", translate("Bandwidth test"),
local bwt = basic_services:option(Flag, "bwtest", translate("Bandwidth test"),
translate("If enabled, the node will be available to perform bandwidth test from other locations"))
bwt.default=0
bwt.default=1
-- Option: mdns
local mdns = section:option(Flag, "mesh_dns", translate("Mesh distributed DNS"),
translate("A distributed DNS system to publish and get domain names (i.e myNode01.qmp)"))
mdns.default=0
local mdns = basic_services:option(Flag, "mesh_dns", translate("Mesh distributed DNS"),
translate("A distributed DNS system to publish and get domain names (example: myNode01.qmp)"))
mdns.default=1
-- Option: munin
local munin = section:option(Flag, "munin", translate("Munin agent"),
translate("Munin agent (listen on port 4949) for monitorization and statistics"))
local munin = additional_services:option(Flag, "munin", translate("Munin agent"),
translate("Munin agent (listening on port 4949) for monitorization and statistics purposes"))
munin.default=0
function m.on_commit(self,map)
......
......@@ -27,12 +27,12 @@ function parse_result(txt) {
</script>
<h2>Tools</h2>
<h2>Network testing tools</h2>
<div class="cbi-map">
<form>
<fieldset class="cbi-section">
<legend><%:Nodes found in the network%></legend>
<legend><%:Test network parameters with the nodes available in the network%></legend>
<table class="cbi-section-table" >
<tr class="cbi-section-table-titles">
......@@ -54,7 +54,7 @@ function parse_result(txt) {
</table>
<br /><br />
<div style="clear:both;height:30px;float:left">
<strong>Specify Custom ip:</strong>
<strong>Test a custom IP address:</strong>
<input type="text" name="custom" />
<input type="button" value="bandwidth" onclick="do_test(this.form.custom.value,'custom','<%=key%>','bwtest')" />
<input type="button" value="ping" onclick="do_test(this.form.custom.value,'custom','<%=key%>','ping')" />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment