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%2Fiface_add.lua;h=e48e3b4bdf9932211ff1108ded4f2ef4fa562a8d;hp=92026b157be697fb8da835e822367438b88ebc69;hb=9adbd79faa8b2d50e92bd2fd6bc21aabe396591f;hpb=1bb4822dca6113f73e3bc89e2acf15935e6f8e92 diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/iface_add.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/iface_add.lua index 92026b157..e48e3b4bd 100644 --- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/iface_add.lua +++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/iface_add.lua @@ -1,17 +1,5 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2009-2010 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 2009-2010 Jo-Philipp Wich +-- Licensed to the public under the Apache License 2.0. local nw = require "luci.model.network".init() local fw = require "luci.model.firewall".init() @@ -29,7 +17,12 @@ newnet = m:field(Value, "_netname", translate("Name of the new interface"), newnet:depends("_attach", "") newnet.default = arg[1] and "net_" .. arg[1]:gsub("[^%w_]+", "_") -newnet.datatype = "uciname" +newnet.datatype = "and(uciname,maxlength(15))" + +advice = m:field(DummyValue, "d1", translate("Note: interface name length"), + translate("Maximum length of the name is 15 characters including " .. + "the automatic protocol/bridge prefix (br-, 6in4-, pppoe- etc.)" + )) newproto = m:field(ListValue, "_netproto", translate("Protocol of the new interface"))