luci-base: Enforce maximal firewall zone length in the Create / Assign scenario as...
authorJan Pazdziora <jan.pazdziora@code.adelton.com>
Tue, 14 Jan 2025 17:07:33 +0000 (18:07 +0100)
committerPaul Donald <newtwen+github@gmail.com>
Wed, 22 Jan 2025 14:48:09 +0000 (15:48 +0100)
Signed-off-by: Jan Pazdziora <jan.pazdziora@code.adelton.com>
modules/luci-base/htdocs/luci-static/resources/tools/widgets.js

index 0ba07afcde8acd848d60b0b5b6df91d5d8da3602..497044d00017d5b1160a7b94490ef1e9d1cce714 100644 (file)
@@ -148,6 +148,9 @@ var CBIZoneSelect = form.ListValue.extend({
                        display_items: this.display_size || this.size || 3,
                        dropdown_items: this.dropdown_size || this.size || 5,
                        validate: L.bind(this.validate, this, section_id),
+                       datatype: L.hasSystemFeature('firewall4')
+                               ? ( this.multiple ? 'list(uciname)' : 'uciname' )
+                               : this.multiple ? 'list(and(uciname,maxlength(11)))' : 'and(uciname,maxlength(11))',
                        create: !this.nocreate,
                        create_markup: '' +
                                '<li data-value="{{value}}">' +