summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2018-10-01 14:27:15 +0200
committerGitHub <noreply@github.com>2018-10-01 14:27:15 +0200
commit229c00227297b2f82af7bdb7b300c00f2a70cb99 (patch)
tree54511122417e5919b6f569a39a0abcf8fb98187b
parentaf96d94ad1359254a9b78ff25ce2b9fb60b96c71 (diff)
parentff5f68d86857cd635e5400894cded5b78239f553 (diff)
Merge pull request #2191 from Ansuel/zram
luci-mod-system: add zram options
-rw-r--r--modules/luci-mod-system/luasrc/model/cbi/admin_system/system.lua26
1 files changed, 25 insertions, 1 deletions
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 c7fdfcddb..a68c43914 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,6 +107,29 @@ o:value(9, translate("Warning"))
--
+-- 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
+
+
+--
-- Langauge & Style
--