diff options
author | Florian Eckert <fe@dev.tdt.de> | 2021-04-08 16:11:07 +0200 |
---|---|---|
committer | Florian Eckert <fe@dev.tdt.de> | 2021-04-08 16:26:04 +0200 |
commit | a9b196edafe4c751dbdb45937c76ad7a3a7abe38 (patch) | |
tree | 02af18f09c0d30b5ec7e4a625bf0375a9c2251f5 /applications/luci-app-dockerman/luasrc/model | |
parent | 483f1005b1f635fd6ccf92b6fc0c1df5755280de (diff) |
luci-app-dockerman: move docker uci configuration to own page
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Diffstat (limited to 'applications/luci-app-dockerman/luasrc/model')
-rw-r--r-- | applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua | 72 | ||||
-rw-r--r-- | applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua | 62 |
2 files changed, 72 insertions, 62 deletions
diff --git a/applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua b/applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua new file mode 100644 index 0000000000..73987cadb6 --- /dev/null +++ b/applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua @@ -0,0 +1,72 @@ +-- Copyright 2021 Florian Eckert <fe@dev.tdt.de> +-- Licensed to the public under the Apache License 2.0. + +local m, s, o + +m = Map("dockerd", + translate("Docker"), + translate("DockerMan is a Simple Docker manager client for LuCI")) + +s = m:section(NamedSection, "globals", "section", translate("Setting")) + +o = s:option(Flag, "remote_endpoint", + translate("Remote Endpoint"), + translate("Connect to remote endpoint")) +o.rmempty = false + +o = s:option(Value, "remote_host", + translate("Remote Host"), + translate("Host or IP Address for the connection to a remote docker instance")) +o.datatype = "host" +o.rmempty = false +o.optional = false +o.placeholder = "10.1.1.2" +o:depends("remote_endpoint", 1) + +o = s:option(Value, "remote_port", + translate("Remote Port")) +o.placeholder = "2375" +o.datatype = "port" +o.rmempty = false +o.optional = false +o:depends("remote_endpoint", 1) + +if nixio.fs.access("/usr/bin/dockerd") then + o = s:option(Value, "data_root", + translate("Docker Root Dir")) + o.placeholder = "/opt/docker/" + o:depends("remote_endpoint", 0) + + o = s:option(Value, "bip", + translate("Default bridge"), + translate("Configure the default bridge network")) + o.placeholder = "172.17.0.1/16" + o.datatype = "ipaddr" + o:depends("remote_endpoint", 0) + + o = s:option(DynamicList, "registry_mirrors", + translate("Registry Mirrors"), + translate("It replaces the daemon registry mirrors with a new set of registry mirrors")) + o.placeholder = translate("Example: https://hub-mirror.c.163.com") + o:depends("remote_endpoint", 0) + + o = s:option(ListValue, "log_level", + translate("Log Level"), + translate('Set the logging level')) + o:value("debug", translate("Debug")) + o:value("", translate("Info")) -- This is the default debug level from the deamon is optin is not set + o:value("warn", translate("Warning")) + o:value("error", translate("Error")) + o:value("fatal", translate("Fatal")) + o.rmempty = true + o:depends("remote_endpoint", 0) + + o = s:option(DynamicList, "hosts", + translate("Client connection"), + translate('Specifies where the Docker daemon will listen for client connections (default: unix:///var/run/docker.sock)')) + o.placeholder = translate("Example: tcp://0.0.0.0:2375") + o.rmempty = true + o:depends("remote_endpoint", 0) +end + +return m diff --git a/applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua b/applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua index e28343f1a7..76a4dfd794 100644 --- a/applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua +++ b/applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua @@ -90,66 +90,4 @@ if docker.new():_ping().code == 200 then s.volumes_total = tostring(#volumes_list) end -s = m:section(NamedSection, "globals", "section", translate("Setting")) - -o = s:option(Flag, "remote_endpoint", - translate("Remote Endpoint"), - translate("Connect to remote endpoint")) -o.rmempty = false - -o = s:option(Value, "remote_host", - translate("Remote Host"), - translate("Host or IP Address for the connection to a remote docker instance")) -o.datatype = "host" -o.rmempty = false -o.optional = false -o.placeholder = "10.1.1.2" -o:depends("remote_endpoint", 1) - -o = s:option(Value, "remote_port", - translate("Remote Port")) -o.placeholder = "2375" -o.datatype = "port" -o.rmempty = false -o.optional = false -o:depends("remote_endpoint", 1) - -if nixio.fs.access("/usr/bin/dockerd") then - o = s:option(Value, "data_root", - translate("Docker Root Dir")) - o.placeholder = "/opt/docker/" - o:depends("remote_endpoint", 0) - - o = s:option(Value, "bip", - translate("Default bridge"), - translate("Configure the default bridge network")) - o.placeholder = "172.17.0.1/16" - o.datatype = "ipaddr" - o:depends("remote_endpoint", 0) - - o = s:option(DynamicList, "registry_mirrors", - translate("Registry Mirrors"), - translate("It replaces the daemon registry mirrors with a new set of registry mirrors")) - o.placeholder = translate("Example: https://hub-mirror.c.163.com") - o:depends("remote_endpoint", 0) - - o = s:option(ListValue, "log_level", - translate("Log Level"), - translate('Set the logging level')) - o:value("debug", translate("Debug")) - o:value("", translate("Info")) -- This is the default debug level from the deamon is optin is not set - o:value("warn", translate("Warning")) - o:value("error", translate("Error")) - o:value("fatal", translate("Fatal")) - o.rmempty = true - o:depends("remote_endpoint", 0) - - o = s:option(DynamicList, "hosts", - translate("Client connection"), - translate('Specifies where the Docker daemon will listen for client connections (default: unix:///var/run/docker.sock)')) - o.placeholder = translate("Example: tcp://0.0.0.0:2375") - o.rmempty = true - o:depends("remote_endpoint", 0) -end - return m |