summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/luasrc/view/cbi/value.htm
blob: e6e0287ef334d65ac0a905f420504ebeece05dfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<%+cbi/valueheader%>
	<input data-update="change"<%=
		attr("id", cbid) ..
		attr("name", cbid) ..
		attr("type", self.password and "password" or "text") ..
		attr("class", self.password and "cbi-input-password" or "cbi-input-text") ..
		attr("value", self:cfgvalue(section) or self.default) ..
		ifattr(self.size, "size") ..
		ifattr(self.placeholder, "placeholder") ..
		ifattr(self.readonly, "readonly") ..
		ifattr(self.maxlength, "maxlength") ..
		ifattr(self.datatype, "data-type", self.datatype) ..
		ifattr(self.datatype, "data-optional", self.optional or self.rmempty) ..
		ifattr(self.combobox_manual, "data-manual", self.combobox_manual) ..
		ifattr(#self.keylist > 0, "data-choices", luci.util.serialize_json({ self.keylist, self.vallist }))
	%> />
	<% if self.password then %><img src="<%=resource%>/cbi/reload.gif" style="vertical-align:middle" title="<%:Reveal/hide password%>" onclick="var e = document.getElementById('<%=cbid%>'); e.type = (e.type=='password') ? 'text' : 'password';" /><% end %>
<%+cbi/valuefooter%>