luci-base, luci-app-firewall: port custom rules to client side view
[project/luci.git] / modules / luci-base / luasrc / view / cbi / ipaddr.htm
1 <%+cbi/valueheader%>
2 <script type="text/javascript">
3 function switchToCIDRList(ev) {
4 var input = ev.target.previousElementSibling,
5 usecidr = document.getElementById(input.id + '_usecidr');
6
7 ev.preventDefault();
8
9 usecidr.value = '1';
10 cbi_d_update();
11 }
12 </script>
13 <input data-update="change"<%=
14 attr("id", cbid) ..
15 attr("name", cbid) ..
16 attr("type", "text") ..
17 attr("class", "cbi-input-text") ..
18 attr("value", self:cfgvalue(section) or self.default) ..
19 ifattr(self.size, "size") ..
20 ifattr(self.placeholder, "placeholder") ..
21 ifattr(self.datatype, "data-type", self.datatype) ..
22 ifattr(self.datatype, "data-optional", self.optional or self.rmempty) ..
23 ifattr(self.combobox_manual, "data-manual", self.combobox_manual) ..
24 ifattr(#self.keylist > 0, "data-choices", { self.keylist, self.vallist })
25 %> /><!--
26 --><button class="cbi-button cbi-button-neutral" title="<%:Switch to CIDR list notation%>" aria-label="<%:Switch to CIDR list notation%>" onclick="switchToCIDRList(event)"></button>
27 <%+cbi/valuefooter%>