Skip to content
Snippets Groups Projects
Commit 8423c810 authored by Philippe's avatar Philippe
Browse files

convert zip packages to gluon-web

parent bead07dc
No related branches found
No related tags found
No related merge requests found
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")
function M.section(form) local s = form:section(Section, nil, text)
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) local o = s:option(Value, "zip", translate("ZIP-Code"), translatef("e.g. %s", "70499"))
o.value = uci:get_first("gluon-node-info", "location", "zip") o.default = uci:get("gluon-node-info", location, "zip")
o.rmempty = true
o.datatype = "uinteger" o.datatype = "uinteger"
o.description = i18n.translatef("e.g. %s", "70499") o.optional = true
function o:write(data)
uci:set("gluon-node-info", location, "zip", data)
end end
function M.handle(data) return {'gluon-node-info'}
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 end
\ No newline at end of file
return M
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment