luci-app-dockerman: sync with upstream source

This commit is contained in:
CN_SZTL 2020-01-23 19:27:44 +08:00
parent 634f01c35c
commit ec3418fed1
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
3 changed files with 7 additions and 4 deletions

View File

@ -115,7 +115,7 @@ local start_stop_remove = function(m, cmd)
end
end
m=SimpleForm("docker", container_info.Name:sub(2), translate("Docker Contaienr") )
m=SimpleForm("docker", container_info.Name:sub(2), translate("Docker Container") )
m.template = "docker/cbi/xsimpleform"
m.redirect = luci.dispatcher.build_url("admin/docker/containers")
-- m:append(Template("docker/container"))

View File

@ -328,7 +328,7 @@ m.handle = function(self, state, data)
local interactive = type(data.interactive) == "number" and (data.interactive == 1 and true or false) or default_config.interactive or false
local image = data.image
local user = data.user
if not image:match(".-:.+") then
if image and not image:match(".-:.+") then
image = image .. ":latest"
end
local privileged = type(data.privileged) == "number" and (data.privileged == 1 and true or false) or default_config.privileged or false

View File

@ -150,17 +150,20 @@ m.handle = function(self, state, data)
Internal = internal
}
if subnet or gateway or ip_range or next(aux_address)~=nil then
if subnet or gateway or ip_range then
create_body["IPAM"]["Config"] = {
{
Subnet = subnet,
Gateway = gateway,
IPRange = ip_range,
-- AuxAddress = aux_address
AuxiliaryAddresses = aux_address
-- AuxiliaryAddresses = aux_address
}
}
end
if next(aux_address)~=nil then
create_body["IPAM"]["Config"]["AuxiliaryAddresses"] = aux_address
end
if driver == "macvlan" then
create_body["IPAM"]["Options"] = {
macvlan_mode = data.macvlan_mode,