From 9ea7d36cd28d564acc939ea0ef5b283794f6024e Mon Sep 17 00:00:00 2001 From: SirPdboy <63764630+sirpdboy@users.noreply.github.com> Date: Sat, 4 Sep 2021 09:46:01 +0800 Subject: [PATCH] v0.5.23-2 2021.9.4 --- .../luasrc/controller/dockerman.lua | 54 +- .../model/cbi/dockerman/configuration.lua | 25 +- .../luasrc/model/cbi/dockerman/container.lua | 2 +- .../model/cbi/dockerman/newcontainer.lua | 2 - luci-app-dockerman/luasrc/model/docker.lua | 29 +- .../luasrc/view/dockerman/container.htm | 3 +- .../dockerman/containers_running_stats.htm | 36 + luci-app-dockerman/po/zh-cn/dockerman.po | 718 ++++++++++-------- luci-app-dockerman/root/etc/init.d/dockerman | 54 +- .../root/usr/share/dockerman/dockerd-ac.lua | 41 +- .../share/rpcd/acl.d/luci-app-dockerman.json | 4 +- 11 files changed, 568 insertions(+), 400 deletions(-) diff --git a/luci-app-dockerman/luasrc/controller/dockerman.lua b/luci-app-dockerman/luasrc/controller/dockerman.lua index 41c60cc..b51e8dd 100644 --- a/luci-app-dockerman/luasrc/controller/dockerman.lua +++ b/luci-app-dockerman/luasrc/controller/dockerman.lua @@ -10,7 +10,7 @@ module("luci.controller.dockerman",package.seeall) function index() entry({"admin", "services", "docker"}, - alias("admin", "services", "docker", "overview"), + alias("admin", "services", "docker", "config"), _("Docker"), 40).acl_depends = { "luci-app-dockerman" } @@ -45,7 +45,8 @@ function index() entry({"admin", "services","docker", "newnetwork"}, form("dockerman/newnetwork")).leaf=true entry({"admin", "services","docker", "container"}, form("dockerman/container")).leaf=true - entry({"admin", "services","docker", "container_stats"}, call("action_get_container_stats")).leaf=true + entry({"admin", "services", "container_stats"}, call("action_get_container_stats")).leaf=true + entry({"admin", "services","docker", "containers_stats"}, call("action_get_containers_stats")).leaf=true entry({"admin", "services","docker", "container_get_archive"}, call("download_archive")).leaf=true entry({"admin", "services","docker", "container_put_archive"}, call("upload_archive")).leaf=true entry({"admin", "services","docker","container_list_file"},call("list_file")).leaf=true @@ -206,7 +207,7 @@ local calculate_cpu_percent = function(d) local cpu_count = tonumber(d["cpu_stats"]["online_cpus"]) local cpu_percent = 0.0 local cpu_delta = tonumber(d["cpu_stats"]["cpu_usage"]["total_usage"]) - tonumber(d["precpu_stats"]["cpu_usage"]["total_usage"]) - local system_delta = tonumber(d["cpu_stats"]["system_cpu_usage"]) - tonumber(d["precpu_stats"]["system_cpu_usage"]) + local system_delta = tonumber(d["cpu_stats"]["system_cpu_usage"]) -- tonumber(d["precpu_stats"]["system_cpu_usage"]) if system_delta > 0.0 then cpu_percent = string.format("%.2f", cpu_delta / system_delta * 100.0 * cpu_count) end @@ -222,7 +223,6 @@ local get_memory = function(d) -- local limit = string.format("%.2f", tonumber(d["memory_stats"]["limit"]) / 1024 / 1024) -- local usage = string.format("%.2f", (tonumber(d["memory_stats"]["usage"]) - tonumber(d["memory_stats"]["stats"]["total_cache"])) / 1024 / 1024) -- return usage .. "MB / " .. limit.. "MB" - -- luci.util.perror(luci.jsonc.stringify(d)) local limit =tonumber(d["memory_stats"]["limit"]) local usage = tonumber(d["memory_stats"]["usage"]) @@ -249,49 +249,59 @@ local get_rx_tx = function(d) return data end -function action_get_container_stats(container_id) +local function get_stat(container_id) if container_id then local dk = docker.new() local response = dk.containers:inspect({id = container_id}) if response.code == 200 and response.body.State.Running then - response = dk.containers:stats({id = container_id, query = {stream = false}}) + response = dk.containers:stats({id = container_id, query = {stream = false, ["one-shot"] = true}}) if response.code == 200 then local container_stats = response.body local cpu_percent = calculate_cpu_percent(container_stats) local mem_useage, mem_limit = get_memory(container_stats) local bw_rxtx = get_rx_tx(container_stats) - luci.http.status(response.code, response.body.message) - luci.http.prepare_content("application/json") - luci.http.write_json({ + return response.code, response.body.message, { cpu_percent = cpu_percent, memory = { mem_useage = mem_useage, mem_limit = mem_limit }, bw_rxtx = bw_rxtx - }) + } else - luci.http.status(response.code, response.body.message) - luci.http.prepare_content("text/plain") - luci.http.write(response.body.message) + return response.code, response.body.message end else if response.code == 200 then - luci.http.status(500, "container "..container_id.." not running") - luci.http.prepare_content("text/plain") - luci.http.write("Container "..container_id.." not running") + return 500, "container "..container_id.." not running" else - luci.http.status(response.code, response.body.message) - luci.http.prepare_content("text/plain") - luci.http.write(response.body.message) + return response.code, response.body.message end end else - luci.http.status(404, "No container name or id") - luci.http.prepare_content("text/plain") - luci.http.write("No container name or id") + return 404, "No container name or id" end end +function action_get_container_stats(container_id) + local code, msg, res = get_stat(container_id) + luci.http.status(code, msg) + luci.http.prepare_content("application/json") + luci.http.write_json(res) +end + +function action_get_containers_stats() + local res = luci.http.formvalue(containers) or "" + local stats = {} + res = luci.jsonc.parse(res.containers) + if res and type(res) == "table" then + for i, v in ipairs(res) do + _,_,stats[v] = get_stat(v) + end + end + luci.http.status(200, "OK") + luci.http.prepare_content("application/json") + luci.http.write_json(stats) +end function action_confirm() local data = docker:read_status() diff --git a/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua b/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua index b0b10a4..b958070 100644 --- a/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua +++ b/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua @@ -1,5 +1,8 @@ --- Copyright 2021 Florian Eckert --- Licensed to the public under the Apache License 2.0. +--[[ +LuCI - Lua Configuration Interface +Copyright 2021 Florian Eckert +Copyright 2021 lisaac +]]-- local uci = (require "luci.model.uci").cursor() @@ -14,7 +17,6 @@ if nixio.fs.access("/usr/bin/dockerd") and not m.uci:get_bool("dockerd", "docker o = s:option(Flag, "auto_start", translate("Auto start")) o.rmempty = false - o.default = "no" o.write = function(self, section, value) if value == "1" then luci.util.exec("/etc/init.d/dockerd enable") @@ -119,9 +121,22 @@ if nixio.fs.access("/usr/bin/dockerd") and not m.uci:get_bool("dockerd", "docker o:value(v, v) end o = s:taboption("ac", DynamicList, "ac_allowed_container", translate("Containers allowed to be accessed"), translate("Which container(s) under bridge network can be accessed, even from interfaces that are not allowed, fill-in Container Id or Name")) + local docker = require "luci.model.docker" + local containers, res, lost_state + local dk = docker.new() + if dk:_ping().code ~= 200 then + lost_state = true + else + lost_state = false + res = dk.containers:list() + if res and res.code and res.code < 300 then + containers = res.body + end + end + -- allowed_container.placeholder = "container name_or_id" - if containers_list then - for i, v in ipairs(containers_list) do + if containers then + for i, v in ipairs(containers) do if v.State == "running" and v.NetworkSettings and v.NetworkSettings.Networks and v.NetworkSettings.Networks.bridge and v.NetworkSettings.Networks.bridge.IPAddress then o:value(v.Id:sub(1,12), v.Names[1]:sub(2) .. " | " .. v.NetworkSettings.Networks.bridge.IPAddress) end diff --git a/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua b/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua index 0e18aa8..81c8a53 100644 --- a/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua +++ b/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua @@ -392,7 +392,7 @@ if action == "info" then for k,v in pairs(info_networks) do table_info["14network"..k] = { _key = translate("Network"), - value = k.. (v~="" and (" | ".. v) or ""), + _value = k.. (v~="" and (" | ".. v) or ""), _button=translate("Disconnect") } list_networks[k]=nil diff --git a/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua b/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua index 2460036..3a6ae3d 100644 --- a/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua +++ b/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua @@ -377,8 +377,6 @@ if cmd_line and cmd_line:match("^DOCKERCLI.+") then elseif cmd_line and cmd_line:match("^duplicate/[^/]+$") then local container_id = cmd_line:match("^duplicate/(.+)") create_body = dk:containers_duplicate_config({id = container_id}) or {} - luci.util.perror(luci.jsonc.stringify(create_body)) - if not create_body.HostConfig then create_body.HostConfig = {} end diff --git a/luci-app-dockerman/luasrc/model/docker.lua b/luci-app-dockerman/luasrc/model/docker.lua index 1b8225e..a89cf68 100644 --- a/luci-app-dockerman/luasrc/model/docker.lua +++ b/luci-app-dockerman/luasrc/model/docker.lua @@ -215,16 +215,9 @@ local upgrade = function(self, request) return {code = 305, body = {message = "Already up to date"}} end - _docker:append_status("Container: " .. "Stop" .. " " .. container_name .. "...") - res = self.containers:stop({name = container_name}) - if res and res.code and res.code < 305 then - _docker:append_status("done\n") - else - return res - end - - _docker:append_status("Container: rename" .. " " .. container_name .. " to ".. container_name .. "_old ...") - res = self.containers:rename({name = container_name, query = { name = container_name .. "_old" }}) + local t = os.date("%Y%m%d%H%M%S") + _docker:append_status("Container: rename" .. " " .. container_name .. " to ".. container_name .. "_old_".. t .. "...") + res = self.containers:rename({name = container_name, query = { name = container_name .. "_old_" ..t }}) if res and res.code and res.code < 300 then _docker:append_status("done\n") else @@ -253,6 +246,22 @@ local upgrade = function(self, request) _docker:append_status("done\n") end + _docker:append_status("Container: " .. "Stop" .. " " .. container_name .. "_old_".. t .. "...") + res = self.containers:stop({name = container_name .. "_old_" ..t }) + if res and res.code and res.code < 305 then + _docker:append_status("done\n") + else + return res + end + + _docker:append_status("Container: " .. "Start" .. " " .. container_name .. "...") + res = self.containers:start({name = container_name}) + if res and res.code and res.code < 305 then + _docker:append_status("done\n") + else + return res + end + _docker:clear_status() return res end diff --git a/luci-app-dockerman/luasrc/view/dockerman/container.htm b/luci-app-dockerman/luasrc/view/dockerman/container.htm index 0e6668e..cc53f28 100644 --- a/luci-app-dockerman/luasrc/view/dockerman/container.htm +++ b/luci-app-dockerman/luasrc/view/dockerman/container.htm @@ -20,7 +20,8 @@ document.getElementById("a-cbi-tab-container_" + item).href= path[0]+"/admin/services/docker/container/"+container_id+'/'+item if (action === item) { document.getElementById("cbi-tab-container_" + item).className="cbi-tab" - } else { + } + else { document.getElementById("cbi-tab-container_" + item).className="cbi-tab-disabled" } }) diff --git a/luci-app-dockerman/luasrc/view/dockerman/containers_running_stats.htm b/luci-app-dockerman/luasrc/view/dockerman/containers_running_stats.htm index 2a43d97..a30b8c7 100644 --- a/luci-app-dockerman/luasrc/view/dockerman/containers_running_stats.htm +++ b/luci-app-dockerman/luasrc/view/dockerman/containers_running_stats.htm @@ -13,6 +13,7 @@ let last_bw_tx = {} let last_bw_rx = {} let interval = 5 + let containers = [] lines.forEach((item) => { let containerId = item.id.match(/cbi-containers-.+_id_(.*)/) if (!containerId) { return } @@ -40,7 +41,42 @@ } }) }) + // containers.push(containerId) }) + // XHR.post('<%=luci.dispatcher.build_url("admin/docker/containers_stats")%>', { + // containers: JSON.stringify(containers) + // }, (x, info) => { + // lines.forEach((item) => { + // if (!info) { return } + + // let containerId = item.id.match(/cbi-containers-.+_id_(.*)/) + // if (!containerId) { return } + // containerId = containerId[1] + // if (!info[containerId]) { return } + // infoC = info[containerId] + // if (item.getElementsByClassName("container_not_running").length > 0) { return } + // item.childNodes.forEach((cell) => { + // if (cell && cell.attributes) { + // if (cell.getAttribute("data-name") == "_status" || cell.childNodes[1] && cell.childNodes[1].id.match(/_status/)) { + // let runningStats = cell.getElementsByClassName("container_cpu_status") + // runningStats[0].innerText = "CPU: " + infoC.cpu_percent + "%" + // runningStats = cell.getElementsByClassName("container_mem_status") + // runningStats[0].innerText = "MEM: " + niceBytes(infoC.memory.mem_useage) + // runningStats = cell.getElementsByClassName("container_network_status") + // for (var eth in infoC.bw_rxtx) { + // if (last_bw_tx[containerId] != undefined && last_bw_rx[containerId] != undefined) { + // runningStats[0].innerText = '↑' + niceBytes((infoC.bw_rxtx[eth].bw_tx - last_bw_tx[containerId]) / interval) + '/s ↓' + niceBytes((infoC.bw_rxtx[eth].bw_rx - last_bw_rx[containerId]) / interval) + '/s' + // } + // last_bw_rx[containerId] = infoC.bw_rxtx[eth].bw_rx + // last_bw_tx[containerId] = infoC.bw_rxtx[eth].bw_tx + // } + // } + // } + // }) + // }) + // }) + + XHR.run() XHR.halt() } diff --git a/luci-app-dockerman/po/zh-cn/dockerman.po b/luci-app-dockerman/po/zh-cn/dockerman.po index 6119eb6..3e6ed51 100644 --- a/luci-app-dockerman/po/zh-cn/dockerman.po +++ b/luci-app-dockerman/po/zh-cn/dockerman.po @@ -10,131 +10,147 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Weblate 4.5.2-dev\n" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:604 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:621 msgid "A list of kernel capabilities to add to the container" msgstr "要添加到容器的内核功能列表" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:183 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:69 +msgid "Access Control" +msgstr "访问控制" + +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:223 msgid "Add" msgstr "新增" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:580 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:597 msgid "Add host device to the container" msgstr "将主机设备添加到容器" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:556 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:573 msgid "Advance" msgstr "高级选项" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:571 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:588 msgid "Allocates an ephemeral host port for all of a container's exposed ports" msgstr "为容器的所有暴露端口分配临时主机端口" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:483 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:118 +msgid "Allowed access interfaces" +msgstr "允许的访问接口" + +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:500 msgid "Always pull image first" msgstr "总是先拉取镜像" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:23 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:29 msgid "" "An overview with the relevant data is displayed here with which the LuCI " "docker client is connected." -msgstr "" +msgstr "在此展示与LuCI docker客户端相连接的相关数据的概览。" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:27 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:43 msgid "Api Version" msgstr "Api 版本" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:84 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:94 msgid "Auto create macvlan interface in Openwrt" msgstr "在 Openwrt 中自动创建 macvlan 界面" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:64 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:18 +msgid "Auto start" +msgstr "自动启动" + +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:134 msgid "Available" msgstr "可用" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:39 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:47 msgid "Base device" msgstr "基设备" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:538 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:555 msgid "Bind Mount(-v)" -msgstr "绑定挂载 (-v)" +msgstr "绑定挂载(-v)" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:539 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:556 msgid "Bind mount a volume" msgstr "绑定挂载卷" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:588 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:637 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:596 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:654 msgid "Block IO Weight" msgstr "块 IO 权重" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:638 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:655 msgid "" "Block IO weight (relative weight) accepts a weight value between 10 and 1000" -msgstr "块 IO 权重(相对权重)接受10到1000之间的数值" +msgstr "块 IO 权重(相对权重)接受10到1000之间的数值" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:589 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:597 msgid "" "Block IO weight (relative weight) accepts a weight value between 10 and 1000." -msgstr "块 IO 权重(相对权重)接受10到1000之间的数值。" +msgstr "块 IO 权重(相对权重)接受10到1000之间的数值。" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:51 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:61 msgid "Bridge (Support direct communication between MAC VLANs)" -msgstr "桥接 ( 支持 MAC VLAN 之间的直接通信 )" +msgstr "桥接(支持 MAC VLAN 之间的直接通信)" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:34 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:42 msgid "Bridge device" -msgstr "网桥设备" +msgstr "Bridge device" #: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:84 msgid "" "By entering a valid image name with the corresponding version, the docker " "image can be downloaded from the configured registry." -msgstr "" +msgstr "通过输入具有相应版本的有效映像名称,可以从镜像存储中心(Registry)中下载docker映像。" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:603 -msgid "CAP-ADD(--cap-add)" -msgstr "权限控制 (--cap-add)" - -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:573 #: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:620 +msgid "CAP-ADD(--cap-add)" +msgstr "权限控制(--cap-add)" + +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:581 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:637 msgid "CPU Shares Weight" msgstr "CPU 共享权重" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:770 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:779 msgid "CPU Useage" msgstr "CPU 使用率" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:621 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:638 msgid "" "CPU shares relative weight, if 0 is set, the system will ignore the value " "and use the default of 1024" msgstr "CPU 共享相对权重,如果设置为 0,则系统将忽略该值并使用默认值 1024" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:574 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:582 msgid "" "CPU shares relative weight, if 0 is set, the system will ignore the value " "and use the default of 1024." msgstr "CPU 共享相对权重,如果设置为 0,则系统将忽略该值并使用默认值 1024。" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:565 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:611 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:28 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:573 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:628 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:44 msgid "CPUs" -msgstr "CPU数量" +msgstr "线程数量" + +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:159 +msgid "Can NOT connect to docker daemon, please check!!" +msgstr "无法连接到docker守护进程(docker daemon),请检查!!" #: applications/luci-app-dockerman/luasrc/view/dockerman/newcontainer_resolve.htm:91 msgid "Cancel" msgstr "取消" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:65 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:60 msgid "Client connection" msgstr "客户端连接" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:339 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:678 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:142 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:347 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:687 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:182 msgid "Command" msgstr "命令" @@ -146,153 +162,172 @@ msgstr "命令行" msgid "Command line Error" msgstr "命令行错误" -#: applications/luci-app-dockerman/luasrc/controller/dockerman.lua:16 +#: applications/luci-app-dockerman/luasrc/controller/dockerman.lua:17 msgid "Configuration" msgstr "配置" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:42 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:36 msgid "Configure the default bridge network" msgstr "配置默认桥接网络" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:397 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:698 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:405 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:707 msgid "Connect" msgstr "连接" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:395 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:429 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:465 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:403 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:437 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:473 msgid "Connect Network" msgstr "连接网络" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:14 -msgid "Connect to remote endpoint" -msgstr "连接到远程终端" +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:74 +msgid "Connect to remote docker endpoint" +msgstr "连接到远程docker" #: applications/luci-app-dockerman/luasrc/view/dockerman/container.htm:7 msgid "Console" msgstr "控制台" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:641 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:161 +msgid "Container Info" +msgstr "容器信息" + +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:650 msgid "Container Inspect" msgstr "检查容器" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:662 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:671 msgid "Container Logs" msgstr "容器日志" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:125 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:458 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:475 msgid "Container Name" msgstr "容器名称" +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:92 #: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:58 #: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/volumes.lua:29 msgid "Container detail" msgstr "容器详情" -#: applications/luci-app-dockerman/luasrc/controller/dockerman.lua:37 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:109 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:143 +#: applications/luci-app-dockerman/luasrc/controller/dockerman.lua:38 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:142 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:148 #: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/volumes.lua:87 #: applications/luci-app-dockerman/luasrc/view/dockerman/overview.htm:133 msgid "Containers" msgstr "容器" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:107 -msgid "Containers overview" -msgstr "" +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:123 +msgid "Containers allowed to be accessed" +msgstr "允许访问的容器" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:84 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:94 msgid "Create macvlan interface" msgstr "创建 macvlan 接口" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:450 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:467 msgid "Create new docker container" msgstr "创建 docker 容器" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:23 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:31 msgid "Create new docker network" msgstr "创建 docker 网络" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:304 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:148 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:312 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:153 #: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/volumes.lua:92 msgid "Created" msgstr "创建时间" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:363 +#: applications/luci-app-dockerman/luasrc/view/dockerman/container_file_manager.htm:33 +msgid "DELETING" +msgstr "删除中" + +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:371 msgid "DNS" msgstr "DNS" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:56 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:51 msgid "Debug" msgstr "调试" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:41 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:35 msgid "Default bridge" msgstr "默认桥接" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:355 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:363 msgid "Device" msgstr "设备" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:579 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:596 msgid "Device(--device)" -msgstr "设备 (--device)" +msgstr "设备(--device)" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:388 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:396 msgid "Disconnect" msgstr "断开" -#: applications/luci-app-dockerman/luasrc/controller/dockerman.lua:13 -#: applications/luci-app-dockerman/luasrc/view/dockerman/logs.htm:3 +#: applications/luci-app-dockerman/luasrc/controller/dockerman.lua:14 msgid "Docker" msgstr "Docker" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:7 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:12 msgid "Docker - Configuration" -msgstr "" +msgstr "Docker - 配置" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:199 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:192 msgid "Docker - Container (%s)" -msgstr "" +msgstr "Docker - 容器 (%s)" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:94 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:439 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:128 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:452 msgid "Docker - Containers" -msgstr "" +msgstr "Docker - 容器" + +#: applications/luci-app-dockerman/luasrc/view/dockerman/logs.htm:3 +msgid "Docker - Events" +msgstr "Docker - 事件" #: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:72 msgid "Docker - Images" -msgstr "" +msgstr "Docker - 镜像" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:12 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:15 msgid "Docker - Network" -msgstr "" +msgstr "Docker - 网络" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/networks.lua:51 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/networks.lua:54 msgid "Docker - Networks" -msgstr "" +msgstr "Docker - 网络" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:22 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:28 msgid "Docker - Overview" -msgstr "" +msgstr "Docker - 概览" #: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/volumes.lua:69 msgid "Docker - Volumes" -msgstr "" +msgstr "Docker - 存储卷" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:474 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:16 +msgid "Docker Daemon settings" +msgstr "Docker 服务端(Docker Daemon)设置" + +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:491 msgid "Docker Image" msgstr "Docker 镜像" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:36 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:30 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:30 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:46 msgid "Docker Root Dir" msgstr "Docker 根目录" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:26 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:93 +msgid "Docker Socket Path" +msgstr "Docker 套接字路径" + +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:42 msgid "Docker Version" msgstr "Docker 版本" @@ -300,85 +335,93 @@ msgstr "Docker 版本" msgid "Docker actions done." msgstr "Docker 执行完成。" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:8 -msgid "DockerMan is a simple docker manager client for LuCI" -msgstr "" +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:70 +msgid "DockerMan" +msgstr "DockerMan" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/networks.lua:79 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:32 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:13 +msgid "DockerMan is a simple docker manager client for LuCI" +msgstr "DockerMan是用于LuCI的简单docker管理器客户端" + +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:68 +msgid "DockerMan settings" +msgstr "DockerMan设置" + +#: applications/luci-app-dockerman/luasrc/view/dockerman/container_file_manager.htm:172 +msgid "Download" +msgstr "下载" + +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/networks.lua:82 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:40 #: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/volumes.lua:85 msgid "Driver" msgstr "驱动" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:263 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:265 msgid "Duplicate/Edit" msgstr "复制/编辑" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:110 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:120 msgid "Enable IPv6" msgstr "启用 IPv6" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:343 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:351 msgid "Env" msgstr "环境变量" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:531 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:548 msgid "Environmental Variable(-e)" -msgstr "环境变量 (-e)" +msgstr "环境变量(-e)" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:59 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:54 msgid "Error" -msgstr "" +msgstr "错误" -#: applications/luci-app-dockerman/luasrc/controller/dockerman.lua:41 +#: applications/luci-app-dockerman/luasrc/controller/dockerman.lua:42 #: applications/luci-app-dockerman/luasrc/view/dockerman/logs.htm:5 msgid "Events" msgstr "事件" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:50 -msgid "Example: https://hub-mirror.c.163.com" -msgstr "" - -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:67 -msgid "Example: tcp://0.0.0.0:2375" -msgstr "" - -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:106 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:116 msgid "Exclude IPs" msgstr "排除 IP" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:570 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:247 +msgid "Export" +msgstr "导出" + +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:587 msgid "Exposed All Ports(-P)" -msgstr "暴露所有端口 (-P)" +msgstr "暴露所有端口(-P)" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:545 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:562 msgid "Exposed Ports(-p)" -msgstr "暴露端口 (-p)" +msgstr "暴露端口(-p)" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:60 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:55 msgid "Fatal" -msgstr "" +msgstr "致命的" #: applications/luci-app-dockerman/luasrc/view/dockerman/container.htm:6 msgid "File" msgstr "文件" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:316 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:324 msgid "Finish Time" msgstr "完成时间" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:217 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:220 msgid "Force Remove" msgstr "强制移除" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/networks.lua:85 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:96 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/networks.lua:88 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:106 msgid "Gateway" msgstr "网关" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:10 -msgid "Global settings" -msgstr "全局设定" +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:33 +msgid "Github" +msgstr "Github" #: applications/luci-app-dockerman/luasrc/view/dockerman/cbi/inlinevalue.htm:4 msgid "Go to relevant configuration page" @@ -388,84 +431,82 @@ msgstr "进入相关配置页面" msgid "Grant UCI access for luci-app-dockerman" msgstr "授予 UCI 访问 luci-app-dockerman 的权限" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:322 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:330 msgid "Healthy" msgstr "健康" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:563 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:580 msgid "Host Name" msgstr "主机名" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:19 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:100 msgid "Host or IP Address for the connection to a remote docker instance" -msgstr "需要连接的远程 docker 实例主机地址" +msgstr "连接到远程Docker实例的主机名或IP地址" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:292 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:122 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:150 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/networks.lua:75 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:300 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:142 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/networks.lua:78 msgid "ID" msgstr "ID" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:36 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:44 msgid "IP VLAN" msgstr "IP VLAN" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:101 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:111 msgid "IP range" msgstr "IP 范围" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:507 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:524 msgid "IPv4 Address" msgstr "IPv4 地址" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:122 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:132 msgid "IPv6 Gateway" msgstr "IPv6 网关" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:116 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:126 msgid "IPv6 Subnet" msgstr "IPv6 子网" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:296 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:139 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:304 #: applications/luci-app-dockerman/luasrc/view/dockerman/images_import.htm:54 msgid "Image" msgstr "镜像" -#: applications/luci-app-dockerman/luasrc/controller/dockerman.lua:38 +#: applications/luci-app-dockerman/luasrc/controller/dockerman.lua:39 #: applications/luci-app-dockerman/luasrc/view/dockerman/overview.htm:151 msgid "Images" msgstr "镜像" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:130 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:132 msgid "Images overview" -msgstr "" +msgstr "镜像概览" #: applications/luci-app-dockerman/luasrc/view/dockerman/images_import.htm:4 msgid "Import" msgstr "导入" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:124 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:125 msgid "Import Image" -msgstr "" +msgstr "导入镜像" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:31 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:47 msgid "Index Server Address" msgstr "索引服务器地址" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:57 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:406 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:35 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:52 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:414 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:102 #: applications/luci-app-dockerman/luasrc/view/dockerman/container.htm:3 msgid "Info" msgstr "信息" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:64 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:74 msgid "Ingress" msgstr "入口" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:65 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:75 msgid "" "Ingress network is the network which provides the routing-mesh in swarm mode" msgstr "入口网络是以群模式提供路由网格的网络" @@ -474,54 +515,54 @@ msgstr "入口网络是以群模式提供路由网格的网络" msgid "Inspect" msgstr "检查" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:462 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:479 msgid "Interactive (-i)" -msgstr "交互 (-i)" +msgstr "交互(-i)" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:76 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:86 msgid "Internal" msgstr "内部" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:56 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:66 msgid "Ipvlan Mode" msgstr "Ipvlan 模式" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:49 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:43 msgid "" "It replaces the daemon registry mirrors with a new set of registry mirrors" -msgstr "" +msgstr "设置新的镜像存储中心(Registry)镜像源,这将取代服务端(daemon)配置的镜像存储中心(Registry)的镜像源" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:245 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:220 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:238 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:264 msgid "Kill" msgstr "强制关闭" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:60 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:70 msgid "L2 bridge" msgstr "L2 桥接" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:61 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:71 msgid "L3 bridge" msgstr "L3 桥接" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:351 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:359 msgid "Links" msgstr "链接" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:512 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:529 msgid "Links with other containers" msgstr "与其他容器的链接" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:276 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:283 #: applications/luci-app-dockerman/luasrc/view/dockerman/images_load.htm:2 msgid "Load" msgstr "负载" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:54 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:49 msgid "Log Level" msgstr "日志等级" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:646 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:663 msgid "Log driver options" msgstr "日志驱动选项" @@ -529,36 +570,36 @@ msgstr "日志驱动选项" msgid "Logs" msgstr "日志" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:35 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:43 msgid "MAC VLAN" msgstr "MAC VLAN" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:581 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:629 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:589 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:646 msgid "Memory" msgstr "内存" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:774 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:783 msgid "Memory Useage" msgstr "内存使用率" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:630 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:647 msgid "" "Memory limit (format: []). Number is a positive integer. Unit " "can be one of b, k, m, or g. Minimum is 4M" msgstr "" -"内存限制 (格式:<数字>[<单位>])。数字是正整数。单位可以是 b、k、m 或 g 之一。" +"内存限制(格式:<数字>[<单位>])。数字是正整数。单位可以是 b、k、m 或 g 之一。" "最小值为 4M" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:582 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:590 msgid "" "Memory limit (format: []). Number is a positive integer. Unit " "can be one of b, k, m, or g. Minimum is 4M." msgstr "" -"内存限制 (格式:<数字>[<单位>])。数字是正整数。单位可以是 b、k、m 或 g 之一。" +"内存限制(格式:<数字>[<单位>])。数字是正整数。单位可以是 b、k、m 或 g 之一。" "最小值为 4M。" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:47 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:57 msgid "Mode" msgstr "模式" @@ -566,46 +607,50 @@ msgstr "模式" msgid "Mount Point" msgstr "挂载点" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:588 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:605 msgid "Mount tmpfs directory" msgstr "挂载 tmpfs 目录" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:335 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:343 msgid "Mount/Volume" msgstr "挂载/卷" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:287 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:411 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:175 +msgid "Mounts" +msgstr "挂载点" + +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:295 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:419 #: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/volumes.lua:83 msgid "Name" msgstr "名称" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:29 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:37 msgid "Name of the network that can be selected during container creation" msgstr "在容器创建时可以选择网络的名称" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:386 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:520 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:132 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:394 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:528 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:169 msgid "Network" msgstr "网络" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/networks.lua:77 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:28 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/networks.lua:80 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:36 msgid "Network Name" msgstr "网络名称" -#: applications/luci-app-dockerman/luasrc/controller/dockerman.lua:39 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:503 +#: applications/luci-app-dockerman/luasrc/controller/dockerman.lua:40 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:520 #: applications/luci-app-dockerman/luasrc/view/dockerman/overview.htm:169 msgid "Networks" msgstr "网络" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/networks.lua:56 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/networks.lua:59 msgid "Networks overview" -msgstr "" +msgstr "网络概览" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/networks.lua:101 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/networks.lua:104 msgid "New" msgstr "新建" @@ -614,11 +659,11 @@ msgstr "新建" msgid "New tag" msgstr "新建标签" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:612 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:629 msgid "Number of CPUs. Number is a fractional number. 0.000 means no limit" msgstr "CPU 数量。数字是小数。0.000 表示没有限制" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:566 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:574 msgid "Number of CPUs. Number is a fractional number. 0.000 means no limit." msgstr "CPU 数量。数字是小数。0.000 表示没有限制。" @@ -626,66 +671,70 @@ msgstr "CPU 数量。数字是小数。0.000 表示没有限制。" msgid "" "On this page all images are displayed that are available on the system and " "with which a container can be created." -msgstr "" +msgstr "在此页面上,显示系统上可用的所有镜像文件,并可以用它们来创建容器" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:200 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:193 msgid "On this page, the selected container can be managed." -msgstr "" +msgstr "在此页面可以管理所选的容器。" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:72 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:82 msgid "Options" msgstr "选项" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:37 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:45 msgid "Overlay network" -msgstr "Overlay 网络" +msgstr "Overlay network" -#: applications/luci-app-dockerman/luasrc/controller/dockerman.lua:36 +#: applications/luci-app-dockerman/luasrc/controller/dockerman.lua:37 msgid "Overview" msgstr "概览" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/networks.lua:81 +#: applications/luci-app-dockerman/luasrc/view/dockerman/container_file_manager.htm:33 +msgid "PLEASE CONFIRM" +msgstr "请确认" + +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/networks.lua:84 msgid "Parent Interface" msgstr "父接口" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:54 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:64 msgid "Pass-through (Mirror physical device to single MAC VLAN)" -msgstr "直通 ( 将物理设备镜像到单独的 MAC VLAN )" - -#: applications/luci-app-dockerman/luasrc/view/dockerman/container_file.htm:7 -msgid "Path" -msgstr "路径" +msgstr "直通(将物理设备镜像到单独的 MAC VLAN)" #: applications/luci-app-dockerman/luasrc/view/dockerman/images_import.htm:54 msgid "Please input new tag" msgstr "请输入新的标签" -#: applications/luci-app-dockerman/luasrc/view/dockerman/container_file.htm:62 -msgid "Please input the PATH !" -msgstr "请输入合法路径!" - -#: applications/luci-app-dockerman/luasrc/view/dockerman/container_file.htm:24 +#: applications/luci-app-dockerman/luasrc/view/dockerman/container_file_manager.htm:270 msgid "Please input the PATH and select the file !" msgstr "请输入路径并选择文件!" +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:82 +msgid "Please input the PORT or HOST IP of remote docker instance!" +msgstr "请输入合法的远程docker实例端口和主机IP" + +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:86 +msgid "Please input the SOCKET PATH of docker daemon!" +msgstr "请输入合法docker服务端(docker daemon)的SOCKET地址" + #: applications/luci-app-dockerman/luasrc/view/dockerman/newcontainer_resolve.htm:91 msgid "Plese input command line:" msgstr "请输入 的命令行:" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:347 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:135 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:355 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:172 msgid "Ports" msgstr "端口" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:52 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:62 msgid "Private (Prevent communication between MAC VLANs)" -msgstr "专用 ( 阻止 MAC VLAN 之间的通信 )" +msgstr "专用(阻止 MAC VLAN 之间的通信)" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:489 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:506 msgid "Privileged" msgstr "特权模式" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:546 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:563 msgid "Publish container's port(s) to the host" msgstr "将容器的端口发布到主机" @@ -697,28 +746,29 @@ msgstr "拉取" msgid "Pull Image" msgstr "拉取镜像" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:48 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:32 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:42 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:48 msgid "Registry Mirrors" -msgstr "注册表镜像" +msgstr "镜像加速器" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:13 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:73 msgid "Remote Endpoint" msgstr "远程实例" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:18 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:99 msgid "Remote Host" msgstr "远程主机" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:27 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:106 msgid "Remote Port" msgstr "远程端口" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:272 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:229 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:208 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/networks.lua:111 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:274 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:274 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:210 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/networks.lua:115 #: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/volumes.lua:108 +#: applications/luci-app-dockerman/luasrc/view/dockerman/container_file_manager.htm:173 msgid "Remove" msgstr "移除" @@ -727,11 +777,15 @@ msgstr "移除" msgid "Remove tag" msgstr "移除标签" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:140 +#: applications/luci-app-dockerman/luasrc/view/dockerman/container_file_manager.htm:171 +msgid "Rename" +msgstr "重命名" + +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:145 msgid "RepoTags" msgstr "仓库标签" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:454 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:471 msgid "Resolve CLI" msgstr "解析 CLI" @@ -739,18 +793,19 @@ msgstr "解析 CLI" msgid "Resources" msgstr "资源" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:227 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:202 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:220 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:244 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:87 msgid "Restart" msgstr "重新启动" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:326 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:419 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:495 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:334 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:427 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:512 msgid "Restart Policy" msgstr "重启策略" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:76 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:86 msgid "Restrict external access to the network" msgstr "限制外部网络访问" @@ -758,59 +813,61 @@ msgstr "限制外部网络访问" msgid "Reveal/hide password" msgstr "显示/隐藏 密码" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:551 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:568 msgid "Run command" msgstr "运行命令" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:226 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:230 msgid "Save" msgstr "保存" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:518 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:535 msgid "Set custom DNS servers" msgstr "设置自定义 DNS 服务器" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:532 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:549 msgid "Set environment variables to inside the container" msgstr "在容器内部设置环境变量" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:55 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:50 msgid "Set the logging level" msgstr "设置日志记录级别" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:146 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:151 msgid "Size" msgstr "大小" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:66 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:61 msgid "" "Specifies where the Docker daemon will listen for client connections " "(default: unix:///var/run/docker.sock)" msgstr "" -"指定Docker守护程序将在何处侦听客户端连接(默认: unix:///var/run/docker.sock)" +"指定Docker服务端(Docker daemon)将在何处侦听客户端连接(默认: unix:///var/run/docker.sock)" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:218 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:193 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:211 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:234 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:65 msgid "Start" msgstr "启动" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:311 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:319 msgid "Start Time" msgstr "开始时间" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:780 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:781 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:789 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:790 #: applications/luci-app-dockerman/luasrc/view/dockerman/container.htm:5 msgid "Stats" msgstr "状态" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:300 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:128 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:308 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:165 msgid "Status" msgstr "状态" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:236 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:211 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:229 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:254 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:65 msgid "Stop" msgstr "停止" @@ -818,96 +875,96 @@ msgstr "停止" msgid "Submit" msgstr "提交" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/networks.lua:83 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:91 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/networks.lua:86 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:101 msgid "Subnet" msgstr "子网" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:367 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:375 msgid "Sysctl" msgstr "系统控制" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:595 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:612 msgid "Sysctl(--sysctl)" -msgstr "系统控制 (--sysctl)" +msgstr "系统控制(--sysctl)" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:596 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:613 msgid "Sysctls (kernel parameters) options" -msgstr "系统控制(内核参数)选项" +msgstr "系统控制(内核参数)选项" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:783 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:792 msgid "TOP" msgstr "TOP" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:468 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:485 msgid "TTY (-t)" -msgstr "TTY (-t)" +msgstr "TTY(-t)" #: applications/luci-app-dockerman/luasrc/view/dockerman/container_stats.htm:56 msgid "TX/RX" msgstr "发射/接收" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:564 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:581 msgid "The hostname to use for the container" msgstr "容器使用的主机名" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:647 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:664 msgid "The logging configuration for this container" msgstr "该容器的日志记录配置" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:525 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:542 msgid "" "The user that commands are run as inside the container.(format: name|uid[:" "group|gid])" -msgstr "在容器中以用户运行命令。(格式:name|uid[:group|gid])" +msgstr "在容器中以用户运行命令。(格式:name|uid[:group|gid])" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:95 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua:129 msgid "" "This page displays all containers that have been created on the connected " "docker host." -msgstr "" +msgstr "此页面显示在连接的Docker主机上已创建的所有容器。" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/networks.lua:52 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/networks.lua:55 msgid "" "This page displays all docker networks that have been created on the " "connected docker host." -msgstr "" +msgstr "此页面显示在已连接的Docker主机上创建的所有Docker网络。" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:359 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:367 msgid "Tmpfs" msgstr "Tmpfs" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:587 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:604 msgid "Tmpfs(--tmpfs)" -msgstr "Tmpfs (--tmpfs)" +msgstr "Tmpfs(--tmpfs)" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:29 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/overview.lua:45 msgid "Total Memory" msgstr "总内存" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:688 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:697 msgid "UID" msgstr "UID" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:289 -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:328 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:297 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:336 msgid "Update" msgstr "更新" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:254 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:256 msgid "Upgrade" msgstr "升级" -#: applications/luci-app-dockerman/luasrc/view/dockerman/container_file.htm:2 -#: applications/luci-app-dockerman/luasrc/view/dockerman/container_file.htm:13 +#: applications/luci-app-dockerman/luasrc/view/dockerman/container_file_manager.htm:7 msgid "Upload" msgstr "上传" -#: applications/luci-app-dockerman/luasrc/view/dockerman/container_file.htm:46 +#: applications/luci-app-dockerman/luasrc/view/dockerman/container_file_manager.htm:303 +#: applications/luci-app-dockerman/luasrc/view/dockerman/container_file_manager.htm:304 msgid "Upload Error" msgstr "上传错误" -#: applications/luci-app-dockerman/luasrc/view/dockerman/container_file.htm:43 +#: applications/luci-app-dockerman/luasrc/view/dockerman/container_file_manager.htm:294 msgid "Upload Success" msgstr "上传成功" @@ -915,32 +972,32 @@ msgstr "上传成功" msgid "Upload/Download" msgstr "上传/下载" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:331 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua:339 msgid "User" msgstr "用户" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:524 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua:541 msgid "User(-u)" -msgstr "用户 (-u)" +msgstr "用户(-u)" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:53 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua:63 msgid "VEPA (Virtual Ethernet Port Aggregator)" -msgstr "VEPA ( 虚拟以太网端口聚合器 )" +msgstr "VEPA(虚拟以太网端口聚合器)" -#: applications/luci-app-dockerman/luasrc/controller/dockerman.lua:40 +#: applications/luci-app-dockerman/luasrc/controller/dockerman.lua:41 #: applications/luci-app-dockerman/luasrc/view/dockerman/overview.htm:187 msgid "Volumes" msgstr "存储卷" #: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/volumes.lua:73 msgid "Volumes overview" -msgstr "" +msgstr "卷概览" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:58 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:53 msgid "Warning" -msgstr "" +msgstr "警告" -#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:125 +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua:126 msgid "" "When pressing the Import button, both a local image can be loaded onto the " "system and a valid image tar can be downloaded from remote." @@ -948,18 +1005,40 @@ msgstr "" "按下导入按钮时,既可以将本地镜像文件加载到系统上,也可以从远程下载有效的Tar格" "式的镜像文件。" +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:123 +msgid "" +"Which container(s) under bridge network can be accessed, even from " +"interfaces that are not allowed, fill-in Container Id or Name" +msgstr "" +"桥接网络下哪些容器可以访问,即使是不允许从接口访问,也要填写容器 ID 或名称" + +#: applications/luci-app-dockerman/luasrc/model/cbi/dockerman/configuration.lua:118 +msgid "" +"Which interface(s) can access containers under the bridge network, fill-in " +"Interface Name" +msgstr "哪些接口可以访问桥接网络下的容器,请填写接口名称" + +#~ msgid "Connect to remote endpoint" +#~ msgstr "连接到远程终端" + +#~ msgid "Global settings" +#~ msgstr "全局设定" + +#~ msgid "Path" +#~ msgstr "路径" + +#~ msgid "Please input the PATH !" +#~ msgstr "请输入合法路径!" + #~ msgid "Setting" #~ msgstr "设置" #~ msgid "Specifies where the Docker daemon will listen for client connections" -#~ msgstr "指定Docker守护程序侦听客户端连接的位置" +#~ msgstr "指定Docker服务端(Docker daemon)侦听客户端连接的位置" #~ msgid "Docker Container" #~ msgstr "Docker 容器" -#~ msgid "Docker Socket Path" -#~ msgstr "Docker 套接字路径" - #~ msgid "" #~ "DockerMan is a Simple Docker manager client for LuCI, If you have any " #~ "issue please visit:" @@ -967,9 +1046,6 @@ msgstr "" #~ "DockerMan 是一个简单的 LuCI 客户端 Docker 管理器,如果您有任何问题,请访" #~ "问:" -#~ msgid "Github" -#~ msgstr "Github" - #~ msgid "Import Images" #~ msgstr "导入镜像" @@ -982,15 +1058,6 @@ msgstr "" #~ msgid "Macvlan Mode" #~ msgstr "Macvlan 模式" -msgid "Access Control" -msgstr "访问控制" - -msgid "Allowed access interfaces" -msgstr "允许的访问接口" - -msgid "Containers allowed to be accessed" -msgstr "允许访问的容器" - #~ msgid "" #~ "Daemon unix socket (unix:///var/run/docker.sock) or TCP Remote Hosts " #~ "(tcp://0.0.0.0:2375), default: unix:///var/run/docker.sock" @@ -998,11 +1065,8 @@ msgstr "允许访问的容器" #~ "守护进程 unix 套接字 (unix:///var/run/docker.sock) 或 TCP 远程主机 " #~ "(tcp://0.0.0.0:2375),默认值:unix:///var/run/docker.sock" -msgid "Docker Daemon" -msgstr "Docker 守护程序" - -msgid "DockerMan" -msgstr "DockerMan" +#~ msgid "Docker Daemon" +#~ msgstr "Docker 服务端" #~ msgid "Dockerman connect to remote endpoint" #~ msgstr "Dockerman 连接到远程端点" @@ -1013,19 +1077,5 @@ msgstr "DockerMan" #~ msgid "Server Host" #~ msgstr "服务器主机" -msgid "" -"Which container(s) under bridge network can be accessed, even from " -"interfaces that are not allowed, fill-in Container Id or Name" -msgstr "" -"桥接网络下哪些容器可以访问,即使是不允许从接口访问,也要填写容器 ID 或名称" - -msgid "Sysctls (kernel parameters) options" -msgstr "Sysctls(内核参数)选项" - -msgid "Contaienr Info" -msgstr "容器信息" - -msgid "" -"Which interface(s) can access containers under the bridge network, fill-" -"in Interface Name" -msgstr "哪些接口可以访问桥接网络下的容器,请填写接口名称" +#~ msgid "Contaienr Info" +#~ msgstr "容器信息" diff --git a/luci-app-dockerman/root/etc/init.d/dockerman b/luci-app-dockerman/root/etc/init.d/dockerman index dc3f303..47b371f 100644 --- a/luci-app-dockerman/root/etc/init.d/dockerman +++ b/luci-app-dockerman/root/etc/init.d/dockerman @@ -1,10 +1,16 @@ #!/bin/sh /etc/rc.common START=99 - -config_load dockerd +USE_PROCD=1 +# PROCD_DEBUG=1 +config_load 'dockerd' # config_get daemon_ea "dockerman" daemon_ea +docker_running(){ + docker version > /dev/null 2>&1 + return $? +} + init_dockerman_chain(){ iptables -N DOCKER-MAN >/dev/null 2>&1 iptables -F DOCKER-MAN >/dev/null 2>&1 @@ -12,27 +18,57 @@ init_dockerman_chain(){ iptables -I DOCKER-USER -j DOCKER-MAN >/dev/null 2>&1 } +delete_dockerman_chain(){ + iptables -D DOCKER-USER -j DOCKER-MAN >/dev/null 2>&1 + iptables -F DOCKER-MAN >/dev/null 2>&1 + iptables -X DOCKER-MAN >/dev/null 2>&1 +} + add_allowed_interface(){ iptables -A DOCKER-MAN -i $1 -o docker0 -j RETURN } -add_allowed_ip(){ - iptables -A DOCKER-MAN -d $1 -o docker0 -j ACCEPT +add_allowed_container(){ + ip=$(docker inspect --format '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${1} 2>/dev/null) + [ -n "$ip" ] && iptables -A DOCKER-MAN -d $ip -o docker0 -j ACCEPT +} + +handle_allowed_container(){ + config_list_foreach "dockerman" "ac_allowed_container" add_allowed_container } handle_allowed_interface(){ #config_list_foreach "dockerman" allowed_ip add_allowed_ip - config_list_foreach "dockerman" ac_allowed_interface add_allowed_interface + config_list_foreach "dockerman" "ac_allowed_interface" add_allowed_interface iptables -A DOCKER-MAN -m conntrack --ctstate ESTABLISHED,RELATED -o docker0 -j RETURN >/dev/null 2>&1 iptables -A DOCKER-MAN -m conntrack --ctstate NEW,INVALID -o docker0 -j DROP >/dev/null 2>&1 iptables -A DOCKER-MAN -j RETURN >/dev/null 2>&1 } -start(){ - [ ! -x "/etc/init.d/dockerd" ] && return 0 +start_service(){ + _DOCKERD=/etc/init.d/dockerd + [ -x "$_DOCKERD" ] && $($_DOCKERD enabled) || return 0 + delete_dockerman_chain + $($_DOCKERD running) && docker_running || return 0 init_dockerman_chain - # if [ -n "$daemon_ea" ]; then + # handle_allowed_container handle_allowed_interface lua /usr/share/dockerman/dockerd-ac.lua - # fi +} + +stop_service(){ + delete_dockerman_chain +} + +service_triggers() { + procd_add_reload_trigger 'dockerd' +} + +reload_service() { + start +} + +boot() { + sleep 5s + start } diff --git a/luci-app-dockerman/root/usr/share/dockerman/dockerd-ac.lua b/luci-app-dockerman/root/usr/share/dockerman/dockerd-ac.lua index 6e7bc30..80df638 100644 --- a/luci-app-dockerman/root/usr/share/dockerman/dockerd-ac.lua +++ b/luci-app-dockerman/root/usr/share/dockerman/dockerd-ac.lua @@ -1,20 +1,33 @@ +#!/usr/bin/env lua + require "luci.util" docker = require "luci.docker" uci = (require "luci.model.uci").cursor() dk = docker.new({socket_path = "/var/run/docker.sock"}) -if dk:_ping().code ~= 200 then return end -containers_list = dk.containers:list({query = {all=true}}).body -allowed_container = uci:get("dockerd", "dockerman", "ac_allowed_container") - -if not allowed_container or next(allowed_container)==nil then return end -allowed_ip = {} -for i, v in ipairs(containers_list) do - for ii, vv in ipairs(allowed_container) do - if v.Id:sub(1,12) == vv and v.NetworkSettings and v.NetworkSettings.Networks and v.NetworkSettings.Networks.bridge and v.NetworkSettings.Networks.bridge.IPAddress then - print(v.NetworkSettings.Networks.bridge.IPAddress) - luci.util.exec("iptables -I DOCKER-MAN -d "..v.NetworkSettings.Networks.bridge.IPAddress.." -o docker0 -j ACCEPT") - table.remove(allowed_container, ii) - end - end +if dk:_ping().code ~= 200 then + return +end + +allowed_container = uci:get("dockerd", "dockerman", "ac_allowed_container") +if not allowed_container or next(allowed_container)==nil then + return +end +-- for i,v in ipairs(allowed_container) do +-- print(v) +-- end +containers_list = dk.containers:list({ + query={ + filters={ + id=allowed_container + } + } +}).body + +-- allowed_ip = {} +for i, v in ipairs(containers_list) do + if v.NetworkSettings and v.NetworkSettings.Networks and v.NetworkSettings.Networks.bridge and v.NetworkSettings.Networks.bridge.IPAddress and v.NetworkSettings.Networks.bridge.IPAddress ~= "" then + -- print(v.NetworkSettings.Networks.bridge.IPAddress) + luci.util.exec("iptables -I DOCKER-MAN -d "..v.NetworkSettings.Networks.bridge.IPAddress.." -o docker0 -j ACCEPT") + end end diff --git a/luci-app-dockerman/root/usr/share/rpcd/acl.d/luci-app-dockerman.json b/luci-app-dockerman/root/usr/share/rpcd/acl.d/luci-app-dockerman.json index adee61c..78c2c64 100644 --- a/luci-app-dockerman/root/usr/share/rpcd/acl.d/luci-app-dockerman.json +++ b/luci-app-dockerman/root/usr/share/rpcd/acl.d/luci-app-dockerman.json @@ -2,10 +2,10 @@ "luci-app-dockerman": { "description": "Grant UCI access for luci-app-dockerman", "read": { - "uci": [ "dockerman" ] + "uci": [ "dockerd" ] }, "write": { - "uci": [ "dockerman" ] + "uci": [ "dockerd" ] } } }