9287ba8d0f0a3077a6ebe27f9b32cfcc11214344
[project/luci.git] / modules / niu / luasrc / model / cbi / niu / network / wandevice.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2009 Steven Barth <steven@midlink.org>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10         http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13 ]]--
14
15 local niulib = require "luci.niulib"
16
17 m = Map("network", "Configure Internet Connection")
18 s = m:section(NamedSection, "wan", "interface", "Internet Connection Device")
19 s.anonymous = true
20 s.addremove = false
21
22 l = s:option(ListValue, "_wandev", "Internet Connection via")
23
24 for _, ifc in ipairs(niulib.eth_get_available("wan")) do
25         l:value("ethernet:%s" % ifc, "Cable / DSL / Ethernet-Adapter (%s)" % ifc)
26 end
27
28 for _, wifi in ipairs(niulib.wifi_get_available("client")) do
29         l:value("wlan:%s" % wifi, "WLAN-Adapter (%s)" % wifi)
30 end
31
32
33 l:value("none", "No Internet Connection")
34
35 return m