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

1 year ago
--[[
LuCI - Lua Configuration Interface
]]--
local taskd = require "luci.model.tasks"
local joplin_model = require "luci.model.joplin"
local m, s, o
m = taskd.docker_map("joplin", "joplin", "/usr/libexec/apps/joplin/joplin.sh",
translate("joplin"),
translate("Joplin Server can run in a Docker container on your server or anywhere you want to run it with Docker. Joplin Server will allow you to sync notes from the desktop application and mobile phone applications so you can view, edit or add notes anywhere on the go.")
.. translate("Official website:") .. ' <a href=\"https://hub.docker.com/r/florider89/joplin-server/\" target=\"_blank\">https://hub.docker.com/r/florider89/joplin-server/</a>')
s = m:section(SimpleSection, translate("Service Status"), translate("joplin status:"))
s:append(Template("joplin/status"))
s = m:section(TypedSection, "joplin", translate("Setup"), translate("The following parameters will only take effect during installation or upgrade:"))
s.addremove=false
s.anonymous=true
o = s:option(Value, "port", translate("Port").."<b>*</b>")
o.rmempty = false
o.default = "22300"
o.datatype = "port"
o = s:option(Value, "image_name", translate("Image").."<b>*</b>")
o.rmempty = false
o.datatype = "string"
o:value("florider89/joplin-server:latest", "florider89/joplin-server:latest")
o.default = "florider89/joplin-server:latest"
local blocks = joplin_model.blocks()
local home = joplin_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", "/opt/docker2/compose/Config")
o.default = "/opt/docker2/compose/Config"
local paths, default_path = joplin_model.find_paths(blocks, home, "Configs")
for _, val in pairs(paths) do
o:value(val, val)
end
o.default = default_path
return m