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.

68 lines
2.4 KiB
Lua

--[[
LuCI - Lua Configuration Interface
]]--
local taskd = require "luci.model.tasks"
local webtop_model = require "luci.model.webtop"
local m, s, o
m = taskd.docker_map("webtop", "webtop", "/usr/libexec/apps/webtop/webtop.sh",
translate("webtop"),
translate("Get Virtual Desktops of all flavors, Alpine, Ubuntu, Fedora, and Arch based containers containing full desktop environments in officially supported versions accessible via any modern web browser.")
.. translate("Official website:") .. ' <a href=\"https://docs.linuxserver.io/images/docker-webtop\" target=\"_blank\">hhttps://docs.linuxserver.io/images/docker-webtop/</a>')
s = m:section(SimpleSection, translate("Service Status"), translate("webtop status:"))
s:append(Template("webtop/status"))
s = m:section(TypedSection, "webtop", 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 = "3000"
o.datatype = "port"
o = s:option(Value, "image_name", translate("Image").."<b>*</b>")
o.rmempty = false
o.datatype = "string"
o:value("fedora-xfce", "fedora-xfce")
o:value("arch-xfce", "arch-xfce")
o:value("alpine-kde", "alpine-kde")
o:value("ubuntu-kde", "ubuntu-kde")
o:value("fedora-kde", "fedora-kde")
o:value("arch-kde", "arch-kde")
o:value("alpine-mate", "alpine-mate")
o:value("ubuntu-mate", "ubuntu-mate")
o:value("alpine-i3", "alpine-i3")
o:value("ubuntu-i3", "ubuntu-i3")
o:value("fedora-i3", "fedora-i3")
o:value("arch-i3", "arch-i3")
o:value("alpine-openbox", "alpine-openbox")
o:value("ubuntu-openbox", "ubuntu-openbox")
o:value("fedora-openbox", "fedora-openbox")
o:value("arch-openbox", "arch-openbox")
o:value("alpine-icewm", "alpine-icewm")
o:value("ubuntu-icewm", "ubuntu-icewm")
o:value("fedora-icewm", "fedora-icewm")
o:value("arch-icewm", "arch-icewm")
o.default = "ubuntu-xfce"
local blocks = webtop_model.blocks()
local home = webtop_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:value("/mnt/data", "/mnt/data")
o.default = "/opt/docker2/compose/webtop/Config"
local paths, default_path = webtop_model.find_paths(blocks, home, "Configs")
for _, val in pairs(paths) do
o:value(val, val)
end
o.default = default_path
return m