local map      = Map("cronosagent", "CronosAgent")
local section  = map:section(TypedSection, "cronosagent", "Configuration")

local number   = section:option(Value, "number",          "Repeater ID",      "DMR ID assigned to your repeater"  )
local repeater = section:option(Value, "repeaterAddress", "Repeater address", "Address of your KAIROS repeater"   )
local server   = section:option(Value, "serverAddress",   "Server address",   "Address of BrandMeister DMR Server")
local password = section:option(Value, "serverPassword",  "Password",         "Password to login to the server"   )

number.datatype     = "range(1,16777215)"
repeater.datatype   = "ip4addr"

server.datatype     = "host"
password.datatype   = "string"
password.password   = true

function map.on_after_commit(self)
  luci.sys.call("/etc/init.d/cronosagent restart")
end

return map