* luci/admin-full: cope with nil values in fstab overview
This commit is contained in:
parent
922f92cd7d
commit
7dfe9098a5
1 changed files with 3 additions and 3 deletions
|
@ -40,9 +40,9 @@ mp = v:option(DummyValue, "mountpoint", translate("a_s_fstab_mountpoint"))
|
||||||
avail = v:option(DummyValue, "avail", translate("a_s_fstab_avail"))
|
avail = v:option(DummyValue, "avail", translate("a_s_fstab_avail"))
|
||||||
function avail.cfgvalue(self, section)
|
function avail.cfgvalue(self, section)
|
||||||
return luci.tools.webadmin.byte_format(
|
return luci.tools.webadmin.byte_format(
|
||||||
tonumber(mounts[section].available) * 1024
|
( tonumber(mounts[section].available) or 0 ) * 1024
|
||||||
) .. " / " .. luci.tools.webadmin.byte_format(
|
) .. " / " .. luci.tools.webadmin.byte_format(
|
||||||
tonumber(mounts[section].blocks) * 1024
|
( tonumber(mounts[section].blocks) or 0 ) * 1024
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ used = v:option(DummyValue, "used", translate("a_s_fstab_used"))
|
||||||
function used.cfgvalue(self, section)
|
function used.cfgvalue(self, section)
|
||||||
return mounts[section].percent .. " (" ..
|
return mounts[section].percent .. " (" ..
|
||||||
luci.tools.webadmin.byte_format(
|
luci.tools.webadmin.byte_format(
|
||||||
tonumber(mounts[section].used) * 1024
|
( tonumber(mounts[section].used) or 0 ) * 1024
|
||||||
) .. ")"
|
) .. ")"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue