--[[ LuCI - Lua Configuration Interface ]]-- local taskd = require "luci.model.tasks" local APPNAME_model = require "luci.model.APPNAME" local m, s, o m = taskd.docker_map("APPNAME", "APPNAME", "/usr/libexec/apps/APPNAME/APPNAME.sh", translate("APPNAME"), translate(" APPNAME is a portmanteau of libre (meaning freedom). It is a private frontend for your data.") .. translate("Official website:") .. ' https://github.com/APPNAME/APPNAME/') s = m:section(SimpleSection, translate("Service Status"), translate("APPNAME status:")) s:append(Template("APPNAME/status")) s = m:section(TypedSection, "APPNAME", translate("Setup"), translate("Refresh to update settings.")) s.addremove=false s.anonymous=true o = s:option(Value, "port", translate("Port").."*") o.rmempty = false o.default = "{port}" o.datatype = "{port}" o = s:option(Value, "image_name", translate("Image").."*") o.rmempty = false o.datatype = "string" o:value("{image}") o.default = "{image}" local blocks = APPNAME_model.blocks() local home = APPNAME_model.home() o = s:option(Value, "config_path", translate("Config path").."*") o.rmempty = false o.datatype = "string" o:value("{config}", "{config}") o.default = "{config}" local paths, default_path = APPNAME_model.find_paths(blocks, home, "Configs") for _, val in pairs(paths) do o:value(val, val) end o.default = default_path return m