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.5 KiB
Lua

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