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.4 KiB
Lua
48 lines
1.4 KiB
Lua
--[[
|
|
LuCI - Lua Configuration Interface
|
|
]]--
|
|
|
|
local taskd = require "luci.model.tasks"
|
|
local gotify_model = require "luci.model.gotify"
|
|
local m, s, o
|
|
|
|
m = taskd.docker_map("gotify", "gotify", "/usr/libexec/apps/gotify/gotify.sh",
|
|
translate("gotify"),
|
|
translate("a simple server for sending and receiving messages.")
|
|
.. translate("Official website:") .. ' <a href=\"https://gotify.net/\" target=\"_blank\">https://gotify.net/</a>')
|
|
|
|
s = m:section(SimpleSection, translate("Service Status"), translate("gotify status:"))
|
|
s:append(Template("gotify/status"))
|
|
|
|
s = m:section(TypedSection, "gotify", translate("Setup"), translate("Refresh to update settings."))
|
|
s.addremove=false
|
|
s.anonymous=true
|
|
|
|
o = s:option(Value, "port", translate("Port").."<b>*</b>")
|
|
o.rmempty = false
|
|
o.default = "8050"
|
|
o.datatype = "port"
|
|
|
|
o = s:option(Value, "image_name", translate("Image").."<b>*</b>")
|
|
o.rmempty = false
|
|
o.datatype = "string"
|
|
o:value("gotify/server", "gotify/server")
|
|
o.default = "gotify/server"
|
|
|
|
local blocks = gotify_model.blocks()
|
|
local home = gotify_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/gotify", "/opt/docker2/compose/Config/gotify")
|
|
o.default = "/opt/docker2/compose/Config/gotify"
|
|
|
|
local paths, default_path = gotify_model.find_paths(blocks, home, "Configs")
|
|
for _, val in pairs(paths) do
|
|
o:value(val, val)
|
|
end
|
|
o.default = default_path
|
|
|
|
return m
|