--[[
LuCI - Lua Configuration Interface
]]--
local taskd = require "luci.model.tasks"
local bookstack_model = require "luci.model.bookstack"
local m, s, o
m = taskd.docker_map("bookstack", "bookstack", "/usr/libexec/apps/bookstack/bookstack.sh",
translate("Bookstack"),
translate("Bookstack is a free and open source Wiki designed for creating beautiful documentation. Featuring a simple, but powerful WYSIWYG editor it allows for teams to create detailed and useful documentation with ease.")
.. translate("Official website:") .. ' https://www.bookstackapp.com/')
s = m:section(SimpleSection, translate("Service Status"), translate("bookstack status:"))
s:append(Template("bookstack/status"))
s = m:section(TypedSection, "bookstack", translate("Setup"), translate("Refresh to update settings."))
s.addremove=false
s.anonymous=true
o = s:option(Value, "port", translate("Port").."*")
o.rmempty = false
o.default = "6875"
o.datatype = "port"
o = s:option(Value, "image_name", translate("Image").."*")
o.rmempty = false
o.datatype = "string"
o:value("lscr.io/linuxserver/bookstack", "lscr.io/linuxserver/bookstack")
o.default = "lscr.io/linuxserver/bookstack"
local blocks = bookstack_model.blocks()
local home = bookstack_model.home()
o = s:option(Value, "config_path", translate("Config path").."*")
o.rmempty = false
o.datatype = "string"
o:value("/opt/docker2/compose/bookstack", "/opt/docker2/compose/bookstack")
o.default = "/opt/docker2/compose/bookstack"
local paths, default_path = bookstack_model.find_paths(blocks, home, "Configs")
for _, val in pairs(paths) do
o:value(val, val)
end
o.default = default_path
return m