--[[
LuCI - Lua Configuration Interface
]]--
local taskd = require "luci.model.tasks"
local seafile_model = require "luci.model.seafile"
local m, s, o
m = taskd.docker_map("seafile", "seafile", "/usr/libexec/apps/seafile/seafile.sh",
translate("Seafile"),
translate("Seafile is an open-source, cross-platform file-hosting software system. Files are stored on a central server and can be synchronized with personal computers and mobile devices through apps.")
.. translate("Official website:") .. ' https://www.seafile.com/en/home/')
s = m:section(SimpleSection, translate("Service Status"), translate("seafile status:"))
s:append(Template("seafile/status"))
s = m:section(TypedSection, "seafile", translate("Setup"), translate("Default user: me@example.com Default pass: asecret"))
s.addremove=false
s.anonymous=true
o = s:option(Value, "port", translate("Port").."*")
o.rmempty = false
o.default = "8160"
o.datatype = "port"
o = s:option(Value, "image_name", translate("Image").."*")
o.rmempty = false
o.datatype = "string"
o:value("seafileltd/seafile-mc:latest", "seafileltd/seafile-mc:latest")
o.default = "seafileltd/seafile-mc:latest"
local blocks = seafile_model.blocks()
local home = seafile_model.home()
o = s:option(Value, "config_path", translate("Config path").."*")
o.rmempty = false
o.datatype = "string"
o:value("/opt/docker2/compose/seafile-app/", "/opt/docker2/compose/seafile-app/")
o.default = "/opt/docker2/compose/seafile-app/"
local paths, default_path = seafile_model.find_paths(blocks, home, "Configs")
for _, val in pairs(paths) do
o:value(val, val)
end
o.default = default_path
return m