diff options
Diffstat (limited to 'modules/luci-mod-system/luasrc')
3 files changed, 31 insertions, 7 deletions
diff --git a/modules/luci-mod-system/luasrc/model/cbi/admin_system/fstab.lua b/modules/luci-mod-system/luasrc/model/cbi/admin_system/fstab.lua index 02fe9cc05e..6f0921fdcf 100644 --- a/modules/luci-mod-system/luasrc/model/cbi/admin_system/fstab.lua +++ b/modules/luci-mod-system/luasrc/model/cbi/admin_system/fstab.lua @@ -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" diff --git a/modules/luci-mod-system/luasrc/model/cbi/admin_system/system.lua b/modules/luci-mod-system/luasrc/model/cbi/admin_system/system.lua index c7fdfcddba..7558d42161 100644 --- a/modules/luci-mod-system/luasrc/model/cbi/admin_system/system.lua +++ b/modules/luci-mod-system/luasrc/model/cbi/admin_system/system.lua @@ -9,6 +9,7 @@ local conf = require "luci.config" local m, s, o local has_ntpd = fs.access("/usr/sbin/ntpd") +local has_zram = fs.access("/etc/init.d/zram") m = Map("system", translate("System"), translate("Here you can configure the basic aspects of your device like its hostname or the timezone.")) m:chain("luci") @@ -21,7 +22,7 @@ s.addremove = false s:tab("general", translate("General Settings")) s:tab("logging", translate("Logging")) s:tab("language", translate("Language and Style")) - +if has_zram then s:tab("zram", translate("ZRam Settings")) end -- -- System Properties @@ -106,7 +107,30 @@ o:value(9, translate("Warning")) -- --- Langauge & Style +-- Zram Properties +-- +if has_zram then + o = s:taboption("zram", Value, "zram_size_mb", translate("ZRam Size"), translate("Size of the ZRam device in megabytes")) + o.optional = true + o.placeholder = 16 + o.datatype = "uinteger" + + o = s:taboption("zram", ListValue, "zram_comp_algo", translate("ZRam Compression Algorithm")) + o.optional = true + o.placeholder = lzo + o:value("lzo", "lzo") + o:value("lz4", "lz4") + o:value("deflate", "deflate") + + o = s:taboption("zram", Value, "zram_comp_streams", translate("ZRam Compression Streams"), translate("Number of parallel threads used for compression")) + o.optional = true + o.placeholder = 1 + o.datatype = "uinteger" +end + + +-- +-- Language & Style -- o = s:taboption("language", ListValue, "_lang", translate("Language")) diff --git a/modules/luci-mod-system/luasrc/view/admin_system/packages.htm b/modules/luci-mod-system/luasrc/view/admin_system/packages.htm index 0adbcb4934..9e364d69ae 100644 --- a/modules/luci-mod-system/luasrc/view/admin_system/packages.htm +++ b/modules/luci-mod-system/luasrc/view/admin_system/packages.htm @@ -102,16 +102,16 @@ end <div class="cbi-value"> <label class="cbi-value-title"><%:Download and install package%>:</label> <div class="cbi-value-field"> - <span><input type="text" name="url" size="30" value="" /></span> - <input class="cbi-button cbi-button-save" type="submit" name="go" value="<%:OK%>" /> + <span><input type="text" name="url" size="30" <% if no_lists then %>disabled="disabled" placeholder="<%:Please update package lists first%>"<% end %> value="" /></span> + <input class="cbi-button cbi-button-save" type="submit" name="go" <% if no_lists then %>disabled="disabled"<% end %> value="<%:OK%>" /> </div> </div> <div class="cbi-value cbi-value-last"> <label class="cbi-value-title"><%:Filter%>:</label> <div class="cbi-value-field"> - <span><input type="text" name="query" size="20" value="<%=pcdata(query)%>" /></span> - <input type="submit" class="cbi-button cbi-button-action" name="search" value="<%:Find package%>" /> + <span><input type="text" name="query" size="20" <% if no_lists then %>disabled="disabled" placeholder="<%:Please update package lists first%>"<% else %>value="<%=pcdata(query)%>"<% end %> /></span> + <input type="submit" class="cbi-button cbi-button-action" name="search" <% if no_lists then %>disabled="disabled"<% end %> value="<%:Find package%>" /> </div> </div> </div> |