Developing lightweight computation at the DSG edge

Commit 4787216b authored by Roger Pueyo Centelles's avatar Roger Pueyo Centelles
Browse files

[qmp-system] Rename "Basic settings" as "Node settings". Update it.

parent a52959c9
......@@ -39,7 +39,7 @@ function index()
entry({"qmp","configuration"}, cbi("qmp/easy_setup"), "Device configuration", 4).dependent=false
entry({"qmp","configuration","easy_setup"}, cbi("qmp/easy_setup"), "qMp easy setup", 10).dependent=false
entry({"qmp","configuration","basic"}, cbi("qmp/basic"), "Basic settings", 20).dependent=false
entry({"qmp","configuration","node"}, cbi("qmp/node"), "Node settings", 20).dependent=false
entry({"qmp","configuration","network"}, cbi("qmp/network_basic"), "Network settings", 30).dependent=false
entry({"qmp","configuration","network","basic"}, cbi("qmp/network_basic"), "Basic settings", 31).dependent=false
entry({"qmp","configuration","network","wired"}, cbi("qmp/network_wired"), "Wired interfaces", 32).dependent=false
......
......@@ -16,36 +16,34 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
--]]
package.path = package.path .. ";/etc/qmp/?.lua"
require("luci.sys")
local http = require "luci.http"
local uciout = uci.cursor()
local qmpinfo = require "qmpinfo"
m = Map("qmp", "Basic qMp device settings")
local networkmode
if uciout:get("qmp","roaming","ignore") == "1" then
networkmode="community"
else
networkmode="roaming"
end
m = Map("qmp", "qMp node settings", translate("This page allows to configure the basic node settings, like the device identification, location and contact details.") .. "<br/> <br/>" .. translate("You can check the on-line documentation at <a href=\"https://www.qmp.cat/Web_interface\">https://www.qmp.cat/Web_interface</a> for more information about the different options."))
device_section = m:section(NamedSection, "node", "qmp", translate("Device identity"), translate("Use this page to define basic qMp settings, like the device\'s name, etc."))
device_section = m:section(NamedSection, "node", "qmp", translate("Device identification"), translate("The following settings are used to identify the device all over the mesh network."))
device_section.addremove = False
device_name = device_section:option(Value,"device_name", translate("Device name"), translate("Use only alphanumeric characters, dots, dashes and underscores."))
device_name.default = "qMp"
device_name.datatype = "hostname"
device_name.optional = false
device_name.rmempty = false
device_name.default = "qMp"
community_name = device_section:option(Value, "community_name", translate ("Community Network name"), translate("Select a predefined Community Network or type your own name."))
community_name = device_section:option(Value, "community_name", translate ("Community Network name"), translate("Select a predefined Community Network or type your own name (optional)."))
community_name.datatype="string"
community_name:value("Bogotá Mesh","Bogotá Mesh")
community_name:value("DigitalMerthyr","Digital Merthyr")
community_name:value("Guifi.net","Guifi.net")
community_name:value("NYCMesh","NYC Mesh")
guifimesh_name = device_section:option(Value, "mesh_name", translate ("Mesh Network name"), translate("Select a predefined community network, type your own name or leave it blank."))
guifimesh_name = device_section:option(Value, "mesh_name", translate ("Mesh Network name"), translate("Select a predefined community subnetwork or type your own name (optional)."))
guifimesh_name:depends("community_name","Guifi.net")
guifimesh_name.datatype="string"
guifimesh_name:value("GuifiBaix", "Baix Llobregat (GuifiBaix)")
......@@ -58,27 +56,55 @@ guifimesh_name:value("GuifiSants", "Sants-Les Corts-UPC (GS)")
guifimesh_name:value("SantAndreu", "Sant Andreu (SAND)")
guifimesh_name:value("Vallcarca", "Vallcarca (VKK)")
device_id = device_section:option(Value,"device_id", translate("Device id"), translate("The id of this device in the mesh network (use alphanumeric characters, without spaces)."))
device_id = device_section:option(Value,"device_id", translate("Device ID"), translate("The ID of this device in the mesh network (optional). Use alphanumeric characters only, without spaces or symbols."))
device_id.datatype = "string"
device_id.optional = true
device_id.rmempty = false
devices = qmpinfo.get_devices()
primary_device = device_section:option(Value,"primary_device", translate("Primary network device"), translate("The name of the node's primary network device. The last four digits of this device's MAC address will be appended to the node name."))
primary_device.default = "eth0"
primary_device = device_section:option(Value,"primary_device", translate("Primary network interface"), translate("The name of the node's primary network interface. The last four digits of this device's MAC address will be appended to the node name."))
primary_device.datatype = "network"
primary_device.optional = false
primary_device.rmempty = false
primary_device.default = "eth0"
for k,v in pairs (devices) do
for l,w in pairs(v) do
primary_device:value(w, w)
end
end
location_section = m:section(NamedSection, "node", "qmp", translate("Device location"))
location_section.addremove = False
geopos_lat = location_section:option(Value,"latitude", translate("Latitude"), translate("Latitude geoposition to use in the maps (optional)."))
geopos_lon = location_section:option(Value,"longitude", translate("Longitude"), translate("Longitude geoposition to use in the maps (optional)."))
geopos_elv = location_section:option(Value,"elevation", translate("Elevation"), translate("Elevation of the node relative to the ground level (optional)."))
location_section = m:section(NamedSection, "node", "qmp", translate("Device location"), translate("The following settings are used to geolocate the device on tools like <a href=\"http://libremap.guifi.net\">LibreMap</a>."))
location_section.addremove = False
contact_section = m:section(NamedSection, "node", "qmp", translate("Contact information"))
geopos_lat = location_section:option(Value,"latitude", translate("Latitude"), translate("Use a dot as the decimal separator (ex.: 7.51)"))
geopos_lat.datatype = "range(-90, 90)"
geopos_lat.optional = true
geopos_lat.rmempty = false
geopos_lat.default = "0"
geopos_lon = location_section:option(Value,"longitude", translate("Longitude"), translate("Use a dot as the decimal separator (ex.: 76.83)"))
geopos_lon.datatype = "range(-180, 180)"
geopos_lon.optional = true
geopos_lon.rmempty = false
geopos_lon.default = "0"
geopos_elv = location_section:option(Value,"elevation", translate("Elevation"), translate("Node elevation, relative to the ground level, in meters (optional). Use a dot as the decimal separator (ex.: 20.5)"))
geopos_elv.datatype = "range(-11034, 300000)"
geopos_elv.optional = true
geopos_elv.rmempty = false
geopos_elv.default = "0"
contact_section = m:section(NamedSection, "node", "qmp", translate("Contact information"), translate("The contact information can be used to reach the owner of a node."))
contact_section.addremove = False
contact = contact_section:option(Value,"contact", translate("Contact e-mail"), translate("An e-mail to contact you if needed (optional)."))
contact.datatype = string
contact.optional = true
contact.rmempty = false
contact.default = "admin@qmp.cat"
function m.on_commit(self,map)
http.redirect("/luci-static/resources/qmp/wait_short.html")
......
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