luci-app-dockerman: fix markup which is not valid XHTML
authorJo-Philipp Wich <redacted>
Fri, 8 Oct 2021 17:42:04 +0000 (19:42 +0200)
committerJo-Philipp Wich <redacted>
Fri, 8 Oct 2021 17:53:09 +0000 (19:53 +0200)
XHTML does not specify `&nbsp;`, use `&#160;` instead.
Also replace `<br>` with `<br />`.

Signed-off-by: Jo-Philipp Wich <redacted>
applications/luci-app-dockerman/luasrc/controller/dockerman.lua
applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua
applications/luci-app-dockerman/luasrc/model/cbi/dockerman/containers.lua
applications/luci-app-dockerman/luasrc/model/cbi/dockerman/images.lua
applications/luci-app-dockerman/luasrc/model/cbi/dockerman/networks.lua
applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua
applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newnetwork.lua
applications/luci-app-dockerman/luasrc/model/cbi/dockerman/volumes.lua
applications/luci-app-dockerman/luasrc/view/dockerman/container.htm
applications/luci-app-dockerman/luasrc/view/dockerman/container_file.htm
applications/luci-app-dockerman/luasrc/view/dockerman/newcontainer_resolve.htm

index 6a60382289e16c69d7c5766c99323d11ccc1b4ae..0b8dd5d900f2c4a1a2ea09c211af9f70995f8de2 100644 (file)
@@ -183,7 +183,7 @@ end
 function action_confirm()
        local data = docker:read_status()
        if data then
-               data = data:gsub("\n","<br>"):gsub(" ","&nbsp;")
+               data = data:gsub("\n","<br />"):gsub(" ","&#160;")
                code = 202
                msg = data
        else
index 4ad1dc1631323b8d621e24cf4cbaec53e2563428..5e3771aa467cb4214f18c8729cb4040295e098bb 100644 (file)
@@ -37,7 +37,7 @@ local get_ports = function(d)
 
        if d.HostConfig and d.HostConfig.PortBindings then
                for inter, out in pairs(d.HostConfig.PortBindings) do
-                       data = (data and (data .. "<br>") or "") .. out[1]["HostPort"] .. ":" .. inter
+                       data = (data and (data .. "<br />") or "") .. out[1]["HostPort"] .. ":" .. inter
                end
        end
 
@@ -49,7 +49,7 @@ local get_env = function(d)
 
        if d.Config and d.Config.Env then
                for _,v in ipairs(d.Config.Env) do
-                       data = (data and (data .. "<br>") or "") .. v
+                       data = (data and (data .. "<br />") or "") .. v
                end
        end
 
@@ -90,7 +90,7 @@ local get_mounts = function(d)
                                        v_dest = v_dest .."/".. v_dest_d
                                end
                        end
-                       data = (data and (data .. "<br>") or "") .. v_sorce .. ":" .. v["Destination"] .. (v["Mode"] ~= "" and (":" .. v["Mode"]) or "")
+                       data = (data and (data .. "<br />") or "") .. v_sorce .. ":" .. v["Destination"] .. (v["Mode"] ~= "" and (":" .. v["Mode"]) or "")
                end
        end
 
@@ -102,7 +102,7 @@ local get_device = function(d)
 
        if d.HostConfig and d.HostConfig.Devices then
                for _,v in ipairs(d.HostConfig.Devices) do
-                       data = (data and (data .. "<br>") or "") .. v["PathOnHost"] .. ":" .. v["PathInContainer"] .. (v["CgroupPermissions"] ~= "" and (":" .. v["CgroupPermissions"]) or "")
+                       data = (data and (data .. "<br />") or "") .. v["PathOnHost"] .. ":" .. v["PathInContainer"] .. (v["CgroupPermissions"] ~= "" and (":" .. v["CgroupPermissions"]) or "")
                end
        end
 
@@ -114,7 +114,7 @@ local get_links = function(d)
 
        if d.HostConfig and d.HostConfig.Links then
                for _,v in ipairs(d.HostConfig.Links) do
-                       data = (data and (data .. "<br>") or "") .. v
+                       data = (data and (data .. "<br />") or "") .. v
                end
        end
 
@@ -126,7 +126,7 @@ local get_tmpfs = function(d)
 
        if d.HostConfig and d.HostConfig.Tmpfs then
                for k, v in pairs(d.HostConfig.Tmpfs) do
-                       data = (data and (data .. "<br>") or "") .. k .. (v~="" and ":" or "")..v
+                       data = (data and (data .. "<br />") or "") .. k .. (v~="" and ":" or "")..v
                end
        end
 
@@ -138,7 +138,7 @@ local get_dns = function(d)
 
        if d.HostConfig and d.HostConfig.Dns then
                for _, v in ipairs(d.HostConfig.Dns) do
-                       data = (data and (data .. "<br>") or "") .. v
+                       data = (data and (data .. "<br />") or "") .. v
                end
        end
 
@@ -150,7 +150,7 @@ local get_sysctl = function(d)
 
        if d.HostConfig and d.HostConfig.Sysctls then
                for k, v in pairs(d.HostConfig.Sysctls) do
-                       data = (data and (data .. "<br>") or "") .. k..":"..v
+                       data = (data and (data .. "<br />") or "") .. k..":"..v
                end
        end
 
@@ -203,7 +203,7 @@ m.redirect = luci.dispatcher.build_url("admin/docker/containers")
 s = m:section(SimpleSection)
 s.template = "dockerman/apply_widget"
 s.err=docker:read_status()
-s.err=s.err and s.err:gsub("\n","<br>"):gsub(" ","&nbsp;")
+s.err=s.err and s.err:gsub("\n","<br />"):gsub(" ","&#160;")
 if s.err then
        docker:clear_status()
 end
@@ -294,7 +294,7 @@ if action == "info" then
                },
                ["03image"] = {
                        _key = translate("Image"),
-                       _value = container_info.Config.Image .. "<br>" .. container_info.Image
+                       _value = container_info.Config.Image .. "<br />" .. container_info.Image
                },
                ["04status"] = {
                        _key = translate("Status"),
index f851f8a0344b29f1a49ce5b1291e351dc1a3a5cc..a48118ec0c7d3f0fb5d7a416b1ee81906cb0ddb6 100644 (file)
@@ -99,7 +99,7 @@ m.reset=false
 s = m:section(SimpleSection)
 s.template = "dockerman/apply_widget"
 s.err=docker:read_status()
-s.err=s.err and s.err:gsub("\n","<br>"):gsub(" ","&nbsp;")
+s.err=s.err and s.err:gsub("\n","<br />"):gsub(" ","&#160;")
 if s.err then
        docker:clear_status()
 end
index 2381df4634ba46f3c42bf760ee9c3c396af2e2d7..2b84de3b8f950a9d47e29774d69ccc6852782a23 100644 (file)
@@ -40,7 +40,7 @@ function get_images()
 
                if v.RepoTags and next(v.RepoTags)~=nil then
                        for i, v1 in ipairs(v.RepoTags) do
-                               data[index]["_tags"] =(data[index]["_tags"] and ( data[index]["_tags"] .. "<br>" )or "") .. ((v1:match("<none>") or (#v.RepoTags == 1)) and v1 or ('<a href="javascript:un_tag(\''..v1..'\')" class="dockerman_link" title="'..translate("Remove tag")..'" >' .. v1 .. '</a>'))
+                               data[index]["_tags"] =(data[index]["_tags"] and ( data[index]["_tags"] .. "<br />" )or "") .. ((v1:match("<none>") or (#v.RepoTags == 1)) and v1 or ('<a href="javascript:un_tag(\''..v1..'\')" class="dockerman_link" title="'..translate("Remove tag")..'" >' .. v1 .. '</a>'))
 
                                if not data[index]["tag"] then
                                        data[index]["tag"] = v1
@@ -155,7 +155,7 @@ local remove_action = function(force)
 
        for k in pairs(image_list) do
                if image_list[k]._selected == 1 then
-                       image_selected[#image_selected+1] = (image_list[k]["_tags"]:match("<br>") or image_list[k]["_tags"]:match("&lt;none&gt;")) and image_list[k].id or image_list[k].tag
+                       image_selected[#image_selected+1] = (image_list[k]["_tags"]:match("<br />") or image_list[k]["_tags"]:match("&lt;none&gt;")) and image_list[k].id or image_list[k].tag
                end
        end
 
@@ -194,7 +194,7 @@ end
 s = m:section(SimpleSection)
 s.template = "dockerman/apply_widget"
 s.err = docker:read_status()
-s.err = s.err and s.err:gsub("\n","<br>"):gsub(" ","&nbsp;")
+s.err = s.err and s.err:gsub("\n","<br />"):gsub(" ","&#160;")
 if s.err then
        docker:clear_status()
 end
index f7152a59d0878da44c5c56307d4c49c31f93d77f..007e087424ee325c6885d9c8bc8aafbbd2277145 100644 (file)
@@ -87,7 +87,7 @@ o = s:option(DummyValue, "_gateway", translate("Gateway"))
 s = m:section(SimpleSection)
 s.template = "dockerman/apply_widget"
 s.err = docker:read_status()
-s.err = s.err and s.err:gsub("\n","<br>"):gsub(" ","&nbsp;")
+s.err = s.err and s.err:gsub("\n","<br />"):gsub(" ","&#160;")
 if s.err then
        docker:clear_status()
 end
index 37734ad0158dcda36d4e80f362b5412c3cbd7529..c5909bac2e0822990fb1c7bfce5e99ec09d6e176 100644 (file)
@@ -442,7 +442,7 @@ m.redirect = luci.dispatcher.build_url("admin", "docker", "containers")
 s = m:section(SimpleSection)
 s.template = "dockerman/apply_widget"
 s.err=docker:read_status()
-s.err=s.err and s.err:gsub("\n","<br>"):gsub(" ","&nbsp;")
+s.err=s.err and s.err:gsub("\n","<br />"):gsub(" ","&#160;")
 if s.err then
        docker:clear_status()
 end
index b89686b2ab0d71542598d4ae9bb46b75504d567c..a9cd67e1a10ef8167af3e40a80fd5791c6613099 100644 (file)
@@ -15,7 +15,7 @@ m.redirect = luci.dispatcher.build_url("admin", "docker", "networks")
 s = m:section(SimpleSection)
 s.template = "dockerman/apply_widget"
 s.err=docker:read_status()
-s.err=s.err and s.err:gsub("\n","<br>"):gsub(" ","&nbsp;")
+s.err=s.err and s.err:gsub("\n","<br />"):gsub(" ","&#160;")
 if s.err then
        docker:clear_status()
 end
index 865c913d30afe13720d8619651b89610ec93c4d7..5fbd55f7b5b64dde990e5219d6a57c5ae9b76c87 100644 (file)
@@ -94,7 +94,7 @@ o = s:option(DummyValue, "_created", translate("Created"))
 s = m:section(SimpleSection)
 s.template = "dockerman/apply_widget"
 s.err=docker:read_status()
-s.err=s.err and s.err:gsub("\n","<br>"):gsub(" ","&nbsp;")
+s.err=s.err and s.err:gsub("\n","<br />"):gsub(" ","&#160;")
 if s.err then
        docker:clear_status()
 end
index 9f05d9d58944172710bc1e02a2092c570f3e8c69..3684b64473901a5b87c5210dd69e041825e3d83d 100644 (file)
@@ -1,4 +1,4 @@
-<br>
+<br />
 <ul class="cbi-tabmenu">
        <li id="cbi-tab-container_info"><a id="a-cbi-tab-container_info" href=""><%:Info%></a></li>
        <li id="cbi-tab-container_resources"><a id="a-cbi-tab-container_resources" href=""><%:Resources%></a></li>
index ab5ecdd488ca10b97ca5b8ca17e8389fa89ef467..46d4278cf7b91a8111f116514373af8a5fa04dd2 100644 (file)
@@ -3,12 +3,12 @@
        <div class="cbi-value-field">
                <input type="file" name="upload_archive" accept="application/x-tar" id="upload_archive" />
        </div>
-       <br>
+       <br />
        <label class="cbi-value-title" for="path"><%:Path%></label>
        <div class="cbi-value-field">
                <input type="text" class="cbi-input-text" name="path" value="/tmp/" id="path" />
        </div>
-       <br>
+       <br />
        <div class="cbi-value-field">
                <input type="button"" class="btn cbi-button cbi-button-action important" id="upload" name="upload" value="<%:Upload%>" />
                <input type="button"" class="btn cbi-button cbi-button-action important" id="download" name="download" value="<%:Download%>" />
index dd6cafa062b14948288fa80fcb4ce7c593ab7442..c5966835fe9d63d0f4f930f7e0ba4c632a65e815 100644 (file)
@@ -88,7 +88,7 @@
        }
 
        function show_reslov_dialog() {
-               document.getElementById('dialog_reslov') || document.body.insertAdjacentHTML("beforeend", '<div id="dialog_reslov"><div class="dialog_box"><div class="dialog_line"></div><div class="dialog_line"><span><%:Plese input <docker create/run> command line:%></span><br><span id="cmd-line-status"></span></div><div class="dialog_line"><textarea class="cbi-input-textarea" id="dialog_reslov_text" style="width: 100%; height:100%;" rows="15" onkeyup="clear_text()"></textarea></div><div class="dialog_line" style="text-align: right;"><input type="button" class="btn cbi-button cbi-button-apply" type="submit" value="<%:Submit%>" onclick="reslov_container()" /> <input type="button" class="btn cbi-button cbi-button-reset" type="reset" value="<%:Cancel%>" onclick="close_reslov_dialog()" /></div><div class="dialog_line"></div></div></div>')
+               document.getElementById('dialog_reslov') || document.body.insertAdjacentHTML("beforeend", '<div id="dialog_reslov"><div class="dialog_box"><div class="dialog_line"></div><div class="dialog_line"><span><%:Plese input <docker create/run> command line:%></span><br /><span id="cmd-line-status"></span></div><div class="dialog_line"><textarea class="cbi-input-textarea" id="dialog_reslov_text" style="width: 100%; height:100%;" rows="15" onkeyup="clear_text()"></textarea></div><div class="dialog_line" style="text-align: right;"><input type="button" class="btn cbi-button cbi-button-apply" type="submit" value="<%:Submit%>" onclick="reslov_container()" /> <input type="button" class="btn cbi-button cbi-button-reset" type="reset" value="<%:Cancel%>" onclick="close_reslov_dialog()" /></div><div class="dialog_line"></div></div></div>')
                document.body.classList.add('dialog-reslov-active')
                let s = document.getElementById('cmd-line-status')
                s.innerHTML = ""
git clone https://git.99rst.org/PROJECT