<commit_before>--[[
LuCI - Lua Configuration Interface

Copyright 2008 <NAME> <<EMAIL>>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

	http://www.apache.org/licenses/LICENSE-2.0

$Id$
]]--

local wa = require "luci.tools.webadmin"
local fs = require "nixio.fs"

arg[1] = arg[1] or ""

m = Map("wireless", translate("networks"), translate("a_w_networks1"))


local iw = nil
local tx_powers = nil

m.uci:foreach("wireless", "wifi-iface",
	function(s)
		if s.device == arg[1] and s.ifname and not iw then
			iw = luci.sys.wifi.getiwinfo(s.ifname)
			tx_powers = iw.txpwrlist or { }
		end
	end)

s = m:section(NamedSection, arg[1], "wifi-device", translate("device") .. " " .. arg[1])
s.addremove = false

s:tab("general", translate("a_w_general", "General Setup"))
s:tab("macfilter", translate("a_w_macfilter", "MAC-Filter"))
s:tab("advanced", translate("a_w_advanced", "Advanced Settings"))

--[[
back = s:option(DummyValue, "_overview", translate("overview"))
back.value = ""
back.titleref = luci.dispatcher.build_url("admin", "network", "wireless")
]]

en = s:taboption("general", Flag, "disabled", translate("enable"))
en.enabled = "0"
en.disabled = "1"
en.rmempty = false

function en.cfgvalue(self, section)
	return Flag.cfgvalue(self, section) or "0"
end

s:taboption("general", DummyValue, "type", translate("type"))

local hwtype = m:get(arg[1], "type")
-- NanoFoo<commit_msg>modules/admin-full: prevent crash in wifi model if no tx power list is available<commit_after>--[[
LuCI - Lua Configuration Interface

Copyright 2008 <NAME> <<EMAIL>>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

	http://www.apache.org/licenses/LICENSE-2.0

$Id$
]]--

local wa = require "luci.tools.webadmin"
local fs = require "nixio.fs"

arg[1] = arg[1] or ""

m = Map("wireless", translate("networks"), translate("a_w_networks1"))


local iw = nil
local tx_powers = nil

m.uci:foreach("wireless", "wifi-iface",
	function(s)
		if s.device == arg[1] and not iw then
			iw = luci.sys.wifi.getiwinfo(s.ifname or s.device)
			tx_powers = iw.txpwrlist or { }
		end
	end)

s = m:section(NamedSection, arg[1], "wifi-device", translate("device") .. " " .. arg[1])
s.addremove = false

s:tab("general", translate("a_w_general", "General Setup"))
s:tab("macfilter", translate("a_w_macfilter", "MAC-Filter"))
s:tab("advanced", translate("a_w_advanced", "Advanced Settings"))

--[[
back = s:option(DummyValue, "_overview", translate("overview"))
back.value = ""
back.titleref = luci.dispatcher.build_url("admin", "network", "wireless")
]]

en = s:taboption("general", Flag, "disabled", translate("enable"))
en.enabled = "0"
en.disabled = "1"
en.rmempty = false

function en.cfgvalue(self, section)
	return Flag.cfgvalue(self, section) or "0"
end

s:taboption("general", DummyValue, "type", translate("type"))

local hwtype = m:get(arg[1], "type")
-- NanoFoo
{'fraction_non_alphanumeric': 0.1711038961038961, 'fraction_numerical': 0.011688311688311689, 'mean_word_length': 5.053045186640471, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '12231', 'n_tokens_mistral': 1136, 'n_tokens_neox': 1082, 'n_words': 287}