Commit 8423c810 authored by Philippe's avatar Philippe
Browse files

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")
function M.handle(data)
local sname = uci:get_first("gluon-node-info", "location")
uci:set("gluon-node-info", sname, "zip", data._zip:trim())
return M
o.optional = true
function o:write(data)
uci:set("gluon-node-info", location, "zip", data)
return {'gluon-node-info'}
\ 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