Commit 8423c810 authored by Philippe's avatar Philippe

convert zip packages to gluon-web

parent bead07dc
local cbi = require "luci.cbi"
local i18n = require "luci.i18n"
local uci = require("simple-uci").cursor()
local M = {}
return function(form, uci)
local location = uci:get_first("gluon-node-info", "location")
local text = translate("gluon-config-mode:zip-help")
local s = form:section(Section, nil, text)
function M.section(form)
local text = i18n.translate("gluon-config-mode:zip-help")
local fieldlabel = i18n.translate("ZIP-Code")
local s = form:section(cbi.SimpleSection, nil, text)
local o = s:option(cbi.Value, "_zip", fieldlabel)
o.value = uci:get_first("gluon-node-info", "location", "zip")
o.rmempty = true
local o = s:option(Value, "zip", translate("ZIP-Code"), translatef("e.g. %s", "70499"))
o.default = uci:get("gluon-node-info", location, "zip")
o.datatype = "uinteger"
o.description = i18n.translatef("e.g. %s", "70499")
end
function M.handle(data)
local sname = uci:get_first("gluon-node-info", "location")
uci:set("gluon-node-info", sname, "zip", data._zip:trim())
uci:save("gluon-node-info")
uci:commit("gluon-node-info")
end
return M
o.optional = true
function o:write(data)
uci:set("gluon-node-info", location, "zip", data)
end
return {'gluon-node-info'}
end
\ No newline at end of file
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