luci-app-lxc: fix "plain-vanilla" integration
[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 local fs = require "nixio.fs"
18
19 m = Map("lxc", translate("LXC Containers"),
20         translate("<b>Please note:</b> For LXC Containers you need a custom OpenWrt image.<br />")
21         .. translate("The image should include at least support for 'kernel cgroups', 'kernel namespaces' and 'miscellaneous LXC related options'."))
22
23 if fs.access("/etc/config/lxc") then
24         m:section(SimpleSection).template = "lxc"
25
26         s = m:section(TypedSection, "lxc", translate("Options"))
27         s.anonymous = true
28         s.addremove = false
29
30         s:option(Value, "url", translate("Containers URL"))
31 end
32
33 return m