luci-app-lxc: small fixes & cosmetics
[project/luci.git] / applications / luci-app-lxc / luasrc / model / cbi / lxc.lua
1 --[[
2
3 LuCI LXC module
4
5 Copyright (C) 2014, Cisco Systems, Inc.
6
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
10
11 http://www.apache.org/licenses/LICENSE-2.0
12
13 Author: Petar Koretic <petar.koretic@sartura.hr>
14
15 ]]--
16
17 m = Map("lxc", translate("LXC Containers"),
18 translate("<b>Please note:</b> For LXC Containers you need a custom OpenWrt image.<br />")
19 .. translate("The image should include at least support for 'kernel cgroups', 'kernel namespaces' and 'miscellaneous LXC related options' plus 'kmod-veth' for optional network support."))
20 m:section(SimpleSection).template = "lxc"
21
22 s = m:section(TypedSection, "lxc", translate("Options"))
23 s.anonymous = true
24
25 o1 = s:option(Value, "url", translate("Containers URL"))
26 o1:value("images.linuxcontainers.org")
27 o1:value("repo.turris.cz/lxc", "repo.turris.cz/lxc (SSL req.)")
28 o1.default = "images.linuxcontainers.org"
29 o1.rmempty = false
30
31 o2 = s:option(Flag, "ssl_enabled", translate("Enable SSL"),
32 translate("Enable optional SSL encryption support. This requires additional packages like 'wget', 'ca-certificates', 'gnupg' and 'gnupg-utils'."))
33 o2.default = o2.disabled
34 o2.rmempty = false
35
36 o3 = s:option(Value, "min_space", translate("Free Space Threshold"),
37 translate("Minimum required free space for LXC Container creation in KB"))
38 o3.default = "100000"
39 o3.datatype = "min(50000)"
40 o3.rmempty = false
41
42 o4 = s:option(Value, "min_temp", translate("Free Temp Threshold"),
43 translate("Minimum required free temp space for LXC Container creation in KB"))
44 o4.default = "100000"
45 o4.datatype = "min(50000)"
46 o4.rmempty = false
47
48 return m