Skip to content

Commit

Permalink
containers: mounts display adjust
Browse files Browse the repository at this point in the history
  • Loading branch information
lisaac committed Jun 6, 2021
1 parent 011b1ee commit 739fa94
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ local get_mounts = function(d)
local v_dest = ""
for v_sorce_d in v["Source"]:gmatch('[^/]+') do
if v_sorce_d and #v_sorce_d > 12 then
v_sorce = v_sorce .. "/" .. v_sorce_d:sub(1,12) .. "..."
v_sorce = v_sorce .. "/" .. v_sorce_d:sub(1,8) .. "..."
else
v_sorce = v_sorce .."/".. v_sorce_d
end
end
for v_dest_d in v["Destination"]:gmatch('[^/]+') do
if v_dest_d and #v_dest_d > 12 then
v_dest = v_dest .. "/" .. v_dest_d:sub(1,12) .. "..."
v_dest = v_dest .. "/" .. v_dest_d:sub(1,8) .. "..."
else
v_dest = v_dest .."/".. v_dest_d
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,24 @@ function get_containers()
if type(v.Mounts) == "table" and next(v.Mounts) then
for _, v2 in pairs(v.Mounts) do
if v2.Type ~= "volume" then
data[index]["_mounts"] = (data[index]["_mounts"] and (data[index]["_mounts"] .. "<br>") or "") .. v2.Source .. "" .. v2.Destination
local v_sorce_d, v_dest_d
local v_sorce = ""
local v_dest = ""
for v_sorce_d in v2["Source"]:gmatch('[^/]+') do
if v_sorce_d and #v_sorce_d > 12 then
v_sorce = v_sorce .. "/" .. v_sorce_d:sub(1,8) .. ".."
else
v_sorce = v_sorce .."/".. v_sorce_d
end
end
for v_dest_d in v2["Destination"]:gmatch('[^/]+') do
if v_dest_d and #v_dest_d > 12 then
v_dest = v_dest .. "/" .. v_dest_d:sub(1,8) .. ".."
else
v_dest = v_dest .."/".. v_dest_d
end
end
data[index]["_mounts"] = '<span title="'.. v2.Source.. "" .. v2.Destination .. '" >' ..(data[index]["_mounts"] and (data[index]["_mounts"] .. "<br>") or "") .. v_sorce .. "" .. v_dest..'</span>'
end
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/sh

touch /etc/config/dockerd
uci -q batch <<-EOF >/dev/null
set uhttpd.main.script_timeout="3600"
commit uhttpd
Expand All @@ -16,7 +17,6 @@ uci -q batch <<-EOF >/dev/null
set dockerd.dockerman.daemon_log_level='warn'
commit dockerd
EOF
/etc/init.d/dockerd disable
[ -x "$(which dockerd)" ] && chmod +x /etc/init.d/dockerman && /etc/init.d/dockerman enable >/dev/null 2>&1
sed -i 's/self:cfgvalue(section) or {}/self:cfgvalue(section) or self.default or {}/' /usr/lib/lua/luci/view/cbi/dynlist.htm
/etc/init.d/uhttpd restart >/dev/null 2>&1
Expand Down

0 comments on commit 739fa94

Please sign in to comment.