<%# Copyright 2008-2009 Steven Barth Copyright 2008-2015 Jo-Philipp Wich Licensed to the public under the Apache License 2.0. -%> <%- local ip = require "luci.ip" local fs = require "nixio.fs" local utl = require "luci.util" local uci = require "luci.model.uci".cursor() local ntm = require "luci.model.network" local fwm = require "luci.model.firewall".init() local ATRP = require "luci.tools.autorepeater" -- autorepeater multiused functions maintitle = [[]] .. translate("Auto Repeater") .. [[]] local has_iwinfo = pcall(require, "iwinfo") ntm.init(uci) local inet local ifaces = { } local inetlist = { } for _, inet in ipairs(ntm:get_networks()) do local tiface = inet:get_interface() local z = fwm:get_zone_by_network(inet:name()) if z ~= nil and tiface ~= nil and inet:name() ~= "loopback" and tiface:type() ~= "ethernet" and z:name() ~= "lan" then ifaces[#ifaces+1] = inet:name() inetlist[#inetlist+1] = { inet:name(), z and z:name() or "-", z } end end table.sort(inetlist, function(a, b) if a[2] ~= b[2] then return a[2] < b[2] else return a[1] < b[1] end end) -%> <%+header%> <% if not has_iwinfo then %>
<%:Package libiwinfo required!%>
<%_The libiwinfo-lua package is not installed. You must install this component for working wireless configuration!%>
<% end %>

<%=maintitle%>

<%:Auto Repeater helps you turn your router as a repeater, join a wireless station by scan station ssid or bssid first.%>
<% local cbi_list = {"hints","global","logview"} local tpl_list = {"","",""} local title_list = {"Setting Hints","Global Settings","Log Viewer"} local value_list = {"Hints","Global Settings","Log Viewer"} for i, cbiname in ipairs(cbi_list) do local tplname = tpl_list[i] local title = title_list[i] local value = translate(value_list[i]) %> <% end %>

<%:Wireless wan Interfaces%>

<% for i, net in ipairs(inetlist) do local z = net[3] local c = z and z:get_color() or "#EEEEEE" local t = z and translate("Part of zone %q" % z:name()) or translate("No zone assigned") %> <% end %>
<%:Network%> <%:Actions%>
<%=net[1]:upper()%>

?
<%+footer%>