luci-app-olsr: handle empty result for non-status tables
[oweals/luci.git] / modules / luci-mod-system / luasrc / model / cbi / admin_system / fstab.lua
index 02fe9cc05e1906d04199530b45396e19c98232e0..4a31146a03e13cf735865e9b5067dcd85df82780 100644 (file)
@@ -117,14 +117,14 @@ function used.cfgvalue(self, section)
 end
 
 unmount = v:option(Button, "unmount", translate("Unmount"))
+function unmount.cfgvalue(self, section)
+       return non_system_mounts[section].umount
+end
+
 unmount.render = function(self, section, scope)
-       if non_system_mounts[section].umount then
-               self.title = translate("Unmount")
-               self.inputstyle = "remove"
-               Button.render(self, section, scope)
-       else
-               luci.http.write(" ")
-       end
+       self.title = translate("Unmount")
+       self.inputstyle = "remove"
+       Button.render(self, section, scope)
 end
 
 unmount.write = function(self, section)
@@ -233,7 +233,7 @@ ck.cfgvalue = function(self, section)
 end
 
 
-swap = m:section(TypedSection, "swap", "SWAP", translate("If your physical memory is insufficient unused data can be temporarily swapped to a swap-device resulting in a higher amount of usable <abbr title=\"Random Access Memory\">RAM</abbr>. Be aware that swapping data is a very slow process as the swap-device cannot be accessed with the high datarates of the <abbr title=\"Random Access Memory\">RAM</abbr>."))
+swap = m:section(TypedSection, "swap", translate("SWAP"), translate("If your physical memory is insufficient unused data can be temporarily swapped to a swap-device resulting in a higher amount of usable <abbr title=\"Random Access Memory\">RAM</abbr>. Be aware that swapping data is a very slow process as the swap-device cannot be accessed with the high datarates of the <abbr title=\"Random Access Memory\">RAM</abbr>."))
 swap.anonymous = true
 swap.addremove = true
 swap.template = "cbi/tblsection"