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

1 year ago
--[[
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:") .. ' <a href=\"https://www.seafile.com/en/home/\" target=\"_blank\">https://www.seafile.com/en/home/</a>')
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").."<b>*</b>")
o.rmempty = false
o.default = "8160"
o.datatype = "port"
o = s:option(Value, "image_name", translate("Image").."<b>*</b>")
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").."<b>*</b>")
o.rmempty = false
o.datatype = "string"
o:value("/opt/docker2/compose/Config/Seafile", "/opt/docker2/compose/Config/Seafile")
o.default = "/opt/docker2/compose/Config/Seafile"
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