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

1 year ago
--[[
LuCI - Lua Configuration Interface
]]--
local taskd = require "luci.model.tasks"
local wordpress_model = require "luci.model.wordpress"
local m, s, o
m = taskd.docker_map("wordpress", "wordpress", "/usr/libexec/apps/wordpress/wordpress.sh",
translate("wordpress"),
translate("WordPress is an open-source content management system (CMS) software used to build, modify, and maintain websites. In technical terms, WordPress is written in PHP and run on a MySQL or MariaDB database.")
.. translate("Official website:") .. ' <a href=\"https://wordpress.org/\" target=\"_blank\">https://wordpress.org/</a>')
s = m:section(SimpleSection, translate("Service Status"), translate("wordpress status:"))
s:append(Template("wordpress/status"))
s = m:section(TypedSection, "wordpress", 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 = "88"
o.datatype = "port"
o = s:option(Value, "image_name", translate("Image").."<b>*</b>")
o.rmempty = false
o.datatype = "string"
o:value("wordpress:latest", "wordpress:latest")
o.default = "wordpress:latest"
local blocks = wordpress_model.blocks()
local home = wordpress_model.home()
o = s:option(Value, "config_path", translate("Config path").."<b>*</b>")
o.rmempty = false
o.datatype = "string"
o:value("/opt/docker2/compose/wordpress", "/opt/docker2/compose/wordpress")
o.default = "/opt/docker2/compose/wordpress"
local paths, default_path = wordpress_model.find_paths(blocks, home, "Configs")
for _, val in pairs(paths) do
o:value(val, val)
end
o.default = default_path
return m