X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;f=modules%2Fluci-mod-admin-full%2Fluasrc%2Fmodel%2Fcbi%2Fadmin_network%2Fiface_add.lua;h=e48e3b4bdf9932211ff1108ded4f2ef4fa562a8d;hb=005f4fb7d4069d1d19506b539fd190a95eacf1e2;hp=4c360839a2a981fec8817667d09e6b0067251d38;hpb=7a3493b1f7d75a3945279115324cf2ff4da26b7b;p=project%2Fluci.git 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 4c360839a..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,4 +1,4 @@ --- Copyright 2009-2010 Jo-Philipp Wich +-- Copyright 2009-2010 Jo-Philipp Wich -- Licensed to the public under the Apache License 2.0. local nw = require "luci.model.network".init() @@ -17,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"))