You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.4 KiB
Lua

--[[
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:") .. ' <a href=\"https://github.com/APPNAME/APPNAME/\" target=\"_blank\">https://github.com/APPNAME/APPNAME/</a>')
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").."<b>*</b>")
o.rmempty = false
o.default = "{port}"
o.datatype = "{port}"
o = s:option(Value, "image_name", translate("Image").."<b>*</b>")
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").."<b>*</b>")
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