X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=modules%2Fluci-mod-admin-full%2Fluasrc%2Fmodel%2Fcbi%2Fadmin_network%2Fnetwork.lua;h=83fdaadcbb961915d3c375454d9737f10f63cd5f;hp=f2984b5810edf1dfe9c142a4a966c50b34f26a41;hb=f0716ecd6e807799c8e16bea72d6ea98ec803d1b;hpb=1bb4822dca6113f73e3bc89e2acf15935e6f8e92 diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/network.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/network.lua index f2984b581..83fdaadcb 100644 --- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/network.lua +++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/network.lua @@ -1,24 +1,72 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich - -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$ -]]-- +-- Copyright 2008 Steven Barth +-- Copyright 2008 Jo-Philipp Wich +-- Licensed to the public under the Apache License 2.0. local fs = require "nixio.fs" +local json = require "luci.jsonc" m = Map("network", translate("Interfaces")) m.pageaction = false m:section(SimpleSection).template = "admin_network/iface_overview" +if fs.access("/etc/init.d/dsl_control") then + local ok, boarddata = pcall(json.parse, fs.readfile("/etc/board.json")) + local modemtype = (ok == true) + and (type(boarddata) == "table") + and (type(boarddata.dsl) == "table") + and (type(boarddata.dsl.modem) == "table") + and boarddata.dsl.modem.type + + dsl = m:section(TypedSection, "dsl", translate("DSL")) + dsl.anonymous = true + + annex = dsl:option(ListValue, "annex", translate("Annex")) + annex:value("a", translate("Annex A + L + M (all)")) + annex:value("b", translate("Annex B (all)")) + annex:value("j", translate("Annex J (all)")) + annex:value("m", translate("Annex M (all)")) + annex:value("bdmt", translate("Annex B G.992.1")) + annex:value("b2", translate("Annex B G.992.3")) + annex:value("b2p", translate("Annex B G.992.5")) + annex:value("at1", translate("ANSI T1.413")) + annex:value("admt", translate("Annex A G.992.1")) + annex:value("alite", translate("Annex A G.992.2")) + annex:value("a2", translate("Annex A G.992.3")) + annex:value("a2p", translate("Annex A G.992.5")) + annex:value("l", translate("Annex L G.992.3 POTS 1")) + annex:value("m2", translate("Annex M G.992.3")) + annex:value("m2p", translate("Annex M G.992.5")) + + tone = dsl:option(ListValue, "tone", translate("Tone")) + tone:value("", translate("auto")) + tone:value("a", translate("A43C + J43 + A43")) + tone:value("av", translate("A43C + J43 + A43 + V43")) + tone:value("b", translate("B43 + B43C")) + tone:value("bv", translate("B43 + B43C + V43")) + + if modemtype == "vdsl" then + xfer_mode = dsl:option(ListValue, "xfer_mode", translate("Encapsulation mode")) + xfer_mode:value("", translate("auto")) + xfer_mode:value("atm", translate("ATM (Asynchronous Transfer Mode)")) + xfer_mode:value("ptm", translate("PTM/EFM (Packet Transfer Mode)")) + + line_mode = dsl:option(ListValue, "line_mode", translate("DSL line mode")) + line_mode:value("", translate("auto")) + line_mode:value("adsl", translate("ADSL")) + line_mode:value("vdsl", translate("VDSL")) + + ds_snr = dsl:option(ListValue, "ds_snr_offset", translate("Downstream SNR offset")) + ds_snr:depends("line_mode", "adsl") + for i = -50, 50, 5 do + ds_snr:value(i, translate("%.1f dB" %{ i / 10} )) + end + end + + firmware = dsl:option(Value, "firmware", translate("Firmware File")) + + m.pageaction = true +end + -- Show ATM bridge section if we have the capabilities if fs.access("/usr/sbin/br2684ctl") then atm = m:section(TypedSection, "atm-bridge", translate("ATM Bridges"),