--[[
LuCI - Lua Configuration Interface
]]--
local taskd = require "luci.model.tasks"
local alltube_model = require "luci.model.alltube"
local m, s, o
m = taskd.docker_map("alltube", "alltube", "/usr/libexec/apps/alltube/alltube.sh",
translate("alltube"),
translate("HTML GUI for youtube-dl")
.. translate("Official website:") .. ' https://github.com/Rudloff/alltube/')
s = m:section(SimpleSection, translate("Service Status"), translate("alltube status:"))
s:append(Template("alltube/status"))
s = m:section(TypedSection, "alltube", translate("Setup"), translate("Use default port or choose custom."))
s.addremove=false
s.anonymous=true
o = s:option(Value, "port", translate("Port").."*")
o.rmempty = false
o.default = "5993"
o.datatype = "port"
o = s:option(Value, "image_name", translate("Image").."*")
o.rmempty = false
o.datatype = "string"
o:value("rudloff/alltube", "rudloff/alltube")
o.default = "rudloff/alltube"
local blocks = alltube_model.blocks()
local home = alltube_model.home()
o = s:option(Value, "config_path", translate("Data path").."*")
o.rmempty = false
o.datatype = "string"
o:value("/opt/docker2/compose/alltube/data", "/opt/docker2/compose/alltube/data")
o.default = "/opt/docker2/compose/alltube/data"
local paths, default_path = alltube_model.find_paths(blocks, home, "Configs")
for _, val in pairs(paths) do
o:value(val, val)
end
o.default = default_path
return m