Remove location and owner info from config mode
This commit is contained in:
parent
fa9a473207
commit
6550841235
|
@ -18,10 +18,6 @@ o.value = uci:get_first("system", "system", "hostname")
|
|||
o.rmempty = false
|
||||
o.datatype = "hostname"
|
||||
|
||||
o = s:option(Flag, "_autoupdate", "Firmware automatisch aktualisieren")
|
||||
o.default = uci:get_bool("autoupdater", "settings", "enabled") and o.enabled or o.disabled
|
||||
o.rmempty = false
|
||||
|
||||
s = f:section(SimpleSection, nil, [[Falls du deinen Knoten über das Internet
|
||||
mit Freifunk verbinden möchtest, kannst du hier das Mesh-VPN aktivieren.
|
||||
Solltest du dich dafür entscheiden, hast du die Möglichkeit die dafür
|
||||
|
@ -48,49 +44,10 @@ o.value = uci:get("gluon-simple-tc", meshvpn_name, "limit_egress")
|
|||
o.rmempty = false
|
||||
o.datatype = "integer"
|
||||
|
||||
s = f:section(SimpleSection, nil, [[Um deinen Knoten auf der Karte anzeigen
|
||||
zu können, benötigen wir seine Koordinaten. Hier hast du die Möglichkeit,
|
||||
diese zu hinterlegen.]])
|
||||
|
||||
o = s:option(Flag, "_location", "Knoten auf der Karte anzeigen")
|
||||
o.default = uci:get_first("gluon-node-info", "location", "share_location", o.disabled)
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "_latitude", "Breitengrad")
|
||||
o.default = uci:get_first("gluon-node-info", "location", "latitude")
|
||||
o:depends("_location", "1")
|
||||
o.rmempty = false
|
||||
o.datatype = "float"
|
||||
o.description = "z.B. 53.873621"
|
||||
|
||||
o = s:option(Value, "_longitude", "Längengrad")
|
||||
o.default = uci:get_first("gluon-node-info", "location", "longitude")
|
||||
o:depends("_location", "1")
|
||||
o.rmempty = false
|
||||
o.datatype = "float"
|
||||
o.description = "z.B. 10.689901"
|
||||
|
||||
s = f:section(SimpleSection, nil, [[Hier kannst du einen
|
||||
<em>öffentlichen</em> Hinweis hinterlegen um anderen Freifunkern zu
|
||||
ermöglichen Kontakt mit dir aufzunehmen. Bitte beachte, dass dieser Hinweis
|
||||
auch öffentlich im Internet, zusammen mit den Koordinaten deines Knotens,
|
||||
einsehbar sein wird.]])
|
||||
|
||||
o = s:option(Value, "_contact", "Kontakt")
|
||||
o.default = uci:get_first("gluon-node-info", "owner", "contact", "")
|
||||
o.rmempty = true
|
||||
o.datatype = "string"
|
||||
o.description = "z.B. E-Mail oder Telefonnummer"
|
||||
o.maxlen = 140
|
||||
|
||||
function f.handle(self, state, data)
|
||||
if state == FORM_VALID then
|
||||
local stat = false
|
||||
|
||||
uci:set("autoupdater", "settings", "enabled", data._autoupdate)
|
||||
uci:save("autoupdater")
|
||||
uci:commit("autoupdater")
|
||||
|
||||
-- checks for nil needed due to o:depends(...)
|
||||
if data._limit_enabled ~= nil then
|
||||
uci:set("gluon-simple-tc", meshvpn_name, "interface")
|
||||
|
@ -116,20 +73,6 @@ function f.handle(self, state, data)
|
|||
uci:save("system")
|
||||
uci:commit("system")
|
||||
|
||||
local sname = uci:get_first("gluon-node-info", "location")
|
||||
uci:set("gluon-node-info", sname, "share_location", data._location)
|
||||
if data._location and data._latitude ~= nil and data._longitude ~= nil then
|
||||
uci:set("gluon-node-info", sname, "latitude", data._latitude)
|
||||
uci:set("gluon-node-info", sname, "longitude", data._longitude)
|
||||
end
|
||||
if data._contact ~= nil then
|
||||
uci:set("gluon-node-info", uci:get_first("gluon-node-info", "owner"), "contact", data._contact)
|
||||
else
|
||||
uci:delete("gluon-node-info", uci:get_first("gluon-node-info", "owner"), "contact")
|
||||
end
|
||||
uci:save("gluon-node-info")
|
||||
uci:commit("gluon-node-info")
|
||||
|
||||
luci.http.redirect(luci.dispatcher.build_url("gluon-config-mode", "reboot"))
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue