diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2014-06-11 13:29:05 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2014-06-11 13:29:05 +0000 |
commit | 7043c30e0e55bbbfacdddf97619b6bae96d20ddb (patch) | |
tree | ece3254350b3ba01ba3135caed2364cc7ca7804c /libs/web/luasrc/view | |
parent | bbb44cf245c11bc0c1d59e836007c9e8c3bfa209 (diff) |
build: introduce luci-base
Merges libs/core, libs/ipkg, libs/web, libs/sys, libs/sgi-cgi, libs/sgi-uhttpd,
modules/admin-core, themes/base and protcols/core into modules/base and renames
luci-lib-core to luci-base.
Diffstat (limited to 'libs/web/luasrc/view')
36 files changed, 0 insertions, 1219 deletions
diff --git a/libs/web/luasrc/view/cbi/apply_xhr.htm b/libs/web/luasrc/view/cbi/apply_xhr.htm deleted file mode 100644 index 1814c9393..000000000 --- a/libs/web/luasrc/view/cbi/apply_xhr.htm +++ /dev/null @@ -1,43 +0,0 @@ -<% export("cbi_apply_xhr", function(id, configs, redirect) -%> -<fieldset class="cbi-section" id="cbi-apply-<%=id%>"> - <legend><%:Applying changes%></legend> - <script type="text/javascript">//<![CDATA[ - var apply_xhr = new XHR(); - - apply_xhr.get('<%=luci.dispatcher.build_url("servicectl", "restart", table.concat(configs, ","))%>', null, - function() { - var checkfinish = function() { - apply_xhr.get('<%=luci.dispatcher.build_url("servicectl", "status")%>', null, - function(x) { - if( x.responseText == 'finish' ) - { - var e = document.getElementById('cbi-apply-<%=id%>-status'); - if( e ) - { - e.innerHTML = '<%:Configuration applied.%>'; - window.setTimeout(function() { - e.parentNode.style.display = 'none'; - <% if redirect then %>location.href='<%=redirect%>';<% end %> - }, 1000); - } - } - else - { - var e = document.getElementById('cbi-apply-<%=id%>-status'); - if( e && x.responseText ) e.innerHTML = x.responseText; - - window.setTimeout(checkfinish, 1000); - } - } - ); - } - - window.setTimeout(checkfinish, 1000); - } - ); - //]]></script> - - <img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> - <span id="cbi-apply-<%=id%>-status"><%:Waiting for changes to be applied...%></span> -</fieldset> -<%- end) %> diff --git a/libs/web/luasrc/view/cbi/browser.htm b/libs/web/luasrc/view/cbi/browser.htm deleted file mode 100644 index e4a4077d5..000000000 --- a/libs/web/luasrc/view/cbi/browser.htm +++ /dev/null @@ -1,7 +0,0 @@ -<% local v = self:cfgvalue(section) -%> -<%+cbi/valueheader%> - <input class="cbi-input-text" type="text"<%= attr("value", v) .. attr("name", cbid) .. attr("id", cbid) %> /> - <script type="text/javascript"> -cbi_browser_init('<%=cbid%>', '<%=resource%>', '<%=luci.dispatcher.build_url("admin", "filebrowser")%>'<%=self.default_path and ", '"..self.default_path.."'"%>); - </script> -<%+cbi/valuefooter%> diff --git a/libs/web/luasrc/view/cbi/button.htm b/libs/web/luasrc/view/cbi/button.htm deleted file mode 100644 index 30f8ddfda..000000000 --- a/libs/web/luasrc/view/cbi/button.htm +++ /dev/null @@ -1,7 +0,0 @@ -<%+cbi/valueheader%> - <% if self:cfgvalue(section) ~= false then %> - <input class="cbi-button cbi-input-<%=self.inputstyle or "button" %>" type="submit"<%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self.inputtitle or self.title)%> /> - <% else %> - - - <% end %> -<%+cbi/valuefooter%> diff --git a/libs/web/luasrc/view/cbi/cell_valuefooter.htm b/libs/web/luasrc/view/cbi/cell_valuefooter.htm deleted file mode 100644 index 220ebd42b..000000000 --- a/libs/web/luasrc/view/cbi/cell_valuefooter.htm +++ /dev/null @@ -1,20 +0,0 @@ -</div> -<div id="cbip-<%=self.config.."-"..section.."-"..self.option%>"></div> -</td> - -<% if #self.deps > 0 then -%> - <script type="text/javascript"> - <% for j, d in ipairs(self.deps) do -%> - cbi_d_add("cbi-<%=self.config.."-"..section.."-"..self.option..d.add%>", { - <%- - for k,v in pairs(d.deps) do - -%> - <%-=string.format('"cbid.%s.%s.%s"', self.config, section, k) .. ":" .. string.format("%q", v)-%> - <%-if next(d.deps, k) then-%>,<%-end-%> - <%- - end - -%> - }, "cbip-<%=self.config.."-"..section.."-"..self.option%>"); - <%- end %> - </script> -<%- end %> diff --git a/libs/web/luasrc/view/cbi/cell_valueheader.htm b/libs/web/luasrc/view/cbi/cell_valueheader.htm deleted file mode 100644 index 9e2e145dd..000000000 --- a/libs/web/luasrc/view/cbi/cell_valueheader.htm +++ /dev/null @@ -1,2 +0,0 @@ -<td class="cbi-value-field<% if self.error and self.error[section] then %> cbi-value-error<% end %>"> -<div id="cbi-<%=self.config.."-"..section.."-"..self.option%>"> diff --git a/libs/web/luasrc/view/cbi/compound.htm b/libs/web/luasrc/view/cbi/compound.htm deleted file mode 100644 index 12d02bb1d..000000000 --- a/libs/web/luasrc/view/cbi/compound.htm +++ /dev/null @@ -1 +0,0 @@ -<%- self:render_children() %> diff --git a/libs/web/luasrc/view/cbi/delegator.htm b/libs/web/luasrc/view/cbi/delegator.htm deleted file mode 100644 index 4fd19265d..000000000 --- a/libs/web/luasrc/view/cbi/delegator.htm +++ /dev/null @@ -1,24 +0,0 @@ -<%- self.active:render() %> - <div class="cbi-page-actions"> - <input type="hidden" name="cbi.delg.current" value="<%=self.current%>" /> -<% for _, x in ipairs(self.chain) do %> - <input type="hidden" name="cbi.delg.path" value="<%=x%>" /> -<% end %> -<% if not self.disallow_pageactions then %> -<% if self.allow_finish and not self:get_next(self.current) then %> - <input class="cbi-button cbi-button-finish" type="submit" value="<%:Finish%>" /> -<% elseif self:get_next(self.current) then %> - <input class="cbi-button cbi-button-next" type="submit" value="<%:Next »%>" /> -<% end %> -<% if self.allow_cancel then %> - <input class="cbi-button cbi-button-cancel" type="submit" name="cbi.cancel" value="<%:Cancel%>" /> -<% end %> -<% if self.allow_reset then %> - <input class="cbi-button cbi-button-reset" type="reset" value="<%:Reset%>" /> -<% end %> -<% if self.allow_back and self:get_prev(self.current) then %> - <input class="cbi-button cbi-button-back" type="submit" name="cbi.delg.back" value="<%:« Back%>" /> -<% end %> -<% end %> - <script type="text/javascript">cbi_d_update();</script> - </div> diff --git a/libs/web/luasrc/view/cbi/dvalue.htm b/libs/web/luasrc/view/cbi/dvalue.htm deleted file mode 100644 index 78e6f323d..000000000 --- a/libs/web/luasrc/view/cbi/dvalue.htm +++ /dev/null @@ -1,13 +0,0 @@ -<%+cbi/valueheader%> -<% if self.href then %><a href="<%=self.href%>"><% end -%> - <% - local val = self:cfgvalue(section) or self.default or "" - if not self.rawhtml then - write(pcdata(val)) - else - write(val) - end - %> -<%- if self.href then %></a><%end%> -<input type="hidden" id="<%=cbid%>" value="<%=pcdata(self:cfgvalue(section) or self.default or "")%>" /> -<%+cbi/valuefooter%> diff --git a/libs/web/luasrc/view/cbi/dynlist.htm b/libs/web/luasrc/view/cbi/dynlist.htm deleted file mode 100644 index fd626a4ec..000000000 --- a/libs/web/luasrc/view/cbi/dynlist.htm +++ /dev/null @@ -1,26 +0,0 @@ -<%+cbi/valueheader%> -<div> -<% - local vals = self:cfgvalue(section) or {} - for i=1, #vals + 1 do - local val = vals[i] - if (val and #val > 0) or (i == 1) then -%> - <input class="cbi-input-text" value="<%=pcdata(val)%>" onchange="cbi_d_update(this.id)" type="text"<%= - attr("id", cbid .. "." .. i) .. attr("name", cbid) .. ifattr(self.size, "size") .. - ifattr(i == 1 and self.placeholder, "placeholder", self.placeholder) - %> /><br /> -<% end end %> -</div> -<script type="text/javascript"> -cbi_dynlist_init( - '<%=cbid%>', '<%=resource%>', '<%=self.datatype%>', - <%=tostring(self.optional or self.rmempty)%> - <%- if #self.keylist > 0 then -%>, [{ - <%- for i, k in ipairs(self.keylist) do -%> - <%-=string.format("%q", k) .. ":" .. string.format("%q", self.vallist[i])-%> - <%-if i<#self.keylist then-%>,<%-end-%> - <%- end -%> - }, '<%: -- custom -- %>']<% end -%>); -</script> -<%+cbi/valuefooter%> diff --git a/libs/web/luasrc/view/cbi/filebrowser.htm b/libs/web/luasrc/view/cbi/filebrowser.htm deleted file mode 100644 index a79beebba..000000000 --- a/libs/web/luasrc/view/cbi/filebrowser.htm +++ /dev/null @@ -1,108 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title>Filebrowser - LuCI</title> - <style type="text/css"> - #path, #listing { - font-size: 85%; - } - - ul { - padding-left: 0; - list-style-type: none; - } - - li img { - vertical-align: bottom; - margin-right: 0.2em; - } - </style> - - <script type="text/javascript"> - function callback(path) { - if( window.opener ) { - var input = window.opener.document.getElementById('<%=luci.http.formvalue('field')%>'); - if( input ) { - input.value = path; - window.close(); - } - } - } - </script> -</head> -<body> - <% - require("nixio.fs") - require("nixio.util") - require("luci.http") - require("luci.dispatcher") - - local field = luci.http.formvalue('field') - local request = luci.dispatcher.context.args - local path = { '' } - - for i = 1, #request do - if request[i] ~= '..' and #request[i] > 0 then - path[#path+1] = request[i] - end - end - - local filepath = table.concat( path, '/' ) - local filestat = nixio.fs.stat( filepath ) - local baseurl = luci.dispatcher.build_url('admin', 'filebrowser') - - if filestat and filestat.type == "reg" then - table.remove( path, #path ) - filepath = table.concat( path, '/' ) .. '/' - elseif not ( filestat and filestat.type == "dir" ) then - path = { '' } - filepath = '/' - else - filepath = filepath .. '/' - end - - local entries = nixio.util.consume((nixio.fs.dir(filepath))) - -%> - <div id="path"> - Location: - <% for i, dir in ipairs(path) do %> - <% if i == 1 then %> - <a href="<%=baseurl%>?field=<%=field%>">(root)</a> - <% elseif next(path, i) then %> - <% baseurl = baseurl .. '/' .. dir %> - / <a href="<%=baseurl%>?field=<%=field%>"><%=dir%></a> - <% else %> - <% baseurl = baseurl .. '/' .. dir %> - / <%=dir%> - <% end %> - <% end %> - </div> - - <hr /> - - <div id="listing"> - <ul> - <% for _, e in luci.util.vspairs(entries) do - local stat = nixio.fs.stat(filepath..e) - if stat and stat.type == 'dir' then - -%> - <li class="dir"> - <img src="<%=resource%>/cbi/folder.gif" alt="<%:Directory%>" /> - <a href="<%=baseurl%>/<%=e%>?field=<%=field%>"><%=e%>/</a> - </li> - <% end end -%> - - <% for _, e in luci.util.vspairs(entries) do - local stat = nixio.fs.stat(filepath..e) - if stat and stat.type ~= 'dir' then - -%> - <li class="file"> - <img src="<%=resource%>/cbi/file.gif" alt="<%:File%>" /> - <a href="#" onclick="callback('<%=filepath..e%>')"><%=e%></a> - </li> - <% end end -%> - </ul> - </div> -</body> -</html> diff --git a/libs/web/luasrc/view/cbi/firewall_zoneforwards.htm b/libs/web/luasrc/view/cbi/firewall_zoneforwards.htm deleted file mode 100644 index 2a433b569..000000000 --- a/libs/web/luasrc/view/cbi/firewall_zoneforwards.htm +++ /dev/null @@ -1,59 +0,0 @@ -<%+cbi/valueheader%> - -<%- - local utl = require "luci.util" - local fwm = require "luci.model.firewall".init() - local nwm = require "luci.model.network".init() - - local zone, fwd, fz - local value = self:formvalue(section) - if not value or value == "-" then - value = self:cfgvalue(section) or self.default - end - - local def = fwm:get_defaults() - local zone = fwm:get_zone(value) - local empty = true --%> - -<% if zone then %> -<div style="white-space:nowrap"> - <label class="zonebadge" style="background-color:<%=zone:get_color()%>"> - <strong><%=zone:name()%>:</strong> - <%- - local zempty = true - for _, net in ipairs(zone:get_networks()) do - net = nwm:get_network(net) - if net then - zempty = false - -%> - <span class="ifacebadge<% if net:name() == self.network then %> ifacebadge-active<% end %>"><%=net:name()%>: - <% - local nempty = true - for _, iface in ipairs(net:is_bridge() and net:get_interfaces() or { net:get_interface() }) do - nempty = false - %> - <img<%=attr("title", iface:get_i18n())%> style="width:16px; height:16px; vertical-align:middle" src="<%=resource%>/icons/<%=iface:type()%><%=iface:is_up() and "" or "_disabled"%>.png" /> - <% end %> - <% if nempty then %><em><%:(empty)%></em><% end %> - </span> - <%- end end -%> - <%- if zempty then %><em><%:(empty)%></em><% end -%> - </label> -  ⇒  - <% for _, fwd in ipairs(zone:get_forwardings_by("src")) do - fz = fwd:dest_zone() - empty = false %> - <label class="zonebadge" style="background-color:<%=fz:get_color()%>"> - <strong><%=fz:name()%></strong> - </label>  - <% end %> - <% if empty then %> - <label class="zonebadge zonebadge-empty"> - <strong><%=zone:forward():upper()%></strong> - </label> - <% end %> -</div> -<% end %> - -<%+cbi/valuefooter%> diff --git a/libs/web/luasrc/view/cbi/firewall_zonelist.htm b/libs/web/luasrc/view/cbi/firewall_zonelist.htm deleted file mode 100644 index 7973437f4..000000000 --- a/libs/web/luasrc/view/cbi/firewall_zonelist.htm +++ /dev/null @@ -1,89 +0,0 @@ -<%+cbi/valueheader%> - -<%- - local utl = require "luci.util" - local fwm = require "luci.model.firewall".init() - local nwm = require "luci.model.network".init() - - local zone, net, iface - local zones = fwm:get_zones() - local value = self:formvalue(section) - if not value or value == "-" then - value = self:cfgvalue(section) or self.default - end - - local selected = false - local checked = { } - - for value in utl.imatch(value) do - checked[value] = true - end - - if not next(checked) then - checked[""] = true - end --%> - -<ul style="margin:0; list-style-type:none; text-align:left"> - <% if self.allowlocal then %> - <li style="padding:0.5em"> - <input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%=attr("type", self.widget or "radio") .. attr("id", cbid .. "_empty") .. attr("name", cbid) .. attr("value", "") .. ifattr(checked[""], "checked", "checked")%> />   - <label<%=attr("for", cbid .. "_empty")%> style="background-color:<%=fwm.zone.get_color()%>" class="zonebadge"> - <strong><%:Device%></strong> - <% if self.allowany and self.allowlocal then %>(<%:input%>)<% end %> - </label> - </li> - <% end %> - <% if self.allowany then %> - <li style="padding:0.5em"> - <input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%=attr("type", self.widget or "radio") .. attr("id", cbid .. "_any") .. attr("name", cbid) .. attr("value", "*") .. ifattr(checked["*"], "checked", "checked")%> />   - <label<%=attr("for", cbid .. "_any")%> style="background-color:<%=fwm.zone.get_color()%>" class="zonebadge"> - <strong><%:Any zone%></strong> - <% if self.allowany and self.allowlocal then %>(<%:forward%>)<% end %> - </label> - </li> - <% end %> - <% - for _, zone in utl.spairs(zones, function(a,b) return (zones[a]:name() < zones[b]:name()) end) do - if zone:name() ~= self.exclude then - selected = selected or (value == zone:name()) - %> - <li style="padding:0.5em"> - <input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%=attr("type", self.widget or "radio") .. attr("id", cbid .. "." .. zone:name()) .. attr("name", cbid) .. attr("value", zone:name()) .. ifattr(checked[zone:name()], "checked", "checked")%> />   - <label<%=attr("for", cbid .. "." .. zone:name())%> style="background-color:<%=zone:get_color()%>" class="zonebadge"> - <strong><%=zone:name()%>:</strong> - <% - local zempty = true - for _, net in ipairs(zone:get_networks()) do - net = nwm:get_network(net) - if net then - zempty = false - %> - <span class="ifacebadge<% if net:name() == self.network then %> ifacebadge-active<% end %>"><%=net:name()%>: - <% - local nempty = true - for _, iface in ipairs(net:is_bridge() and net:get_interfaces() or { net:get_interface() }) do - nempty = false - %> - <img<%=attr("title", iface:get_i18n())%> style="width:16px; height:16px; vertical-align:middle" src="<%=resource%>/icons/<%=iface:type()%><%=iface:is_up() and "" or "_disabled"%>.png" /> - <% end %> - <% if nempty then %><em><%:(empty)%></em><% end %> - </span> - <% end end %> - <% if zempty then %><em><%:(empty)%></em><% end %> - </label> - </li> - <% end end %> - - <% if self.widget ~= "checkbox" and not self.nocreate then %> - <li style="padding:0.5em"> - <input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)" type="radio"<%=attr("id", cbid .. "_new") .. attr("name", cbid) .. attr("value", "-") .. ifattr(not selected, "checked", "checked")%> />   - <div onclick="document.getElementById('<%=cbid%>_new').checked=true" class="zonebadge" style="background-color:<%=fwm.zone.get_color()%>"> - <em><%:unspecified -or- create:%> </em> - <input type="text"<%=attr("name", cbid .. ".newzone") .. ifattr(not selected, "value", luci.http.formvalue(cbid .. ".newzone") or self.default)%> onfocus="document.getElementById('<%=cbid%>_new').checked=true" /> - </div> - </li> - <% end %> -</ul> - -<%+cbi/valuefooter%> diff --git a/libs/web/luasrc/view/cbi/footer.htm b/libs/web/luasrc/view/cbi/footer.htm deleted file mode 100644 index 2c34028e5..000000000 --- a/libs/web/luasrc/view/cbi/footer.htm +++ /dev/null @@ -1,26 +0,0 @@ - <%- if pageaction then -%> - <div class="cbi-page-actions"> - <% if redirect then %> - <div style="float:left"> - <input class="cbi-button cbi-button-link" type="button" value="<%:Back to Overview%>" onclick="location.href='<%=pcdata(redirect)%>'" /> - </div> - <% end %> - - <% if flow.skip then %> - <input class="cbi-button cbi-button-skip" type="submit" name="cbi.skip" value="<%:Skip%>" /> - <% end %> - <% if not autoapply and not flow.hideapplybtn then %> - <input class="cbi-button cbi-button-apply" type="submit" name="cbi.apply" value="<%:Save & Apply%>" /> - <% end %> - <% if not flow.hidesavebtn then %> - <input class="cbi-button cbi-button-save" type="submit" value="<%:Save%>" /> - <% end %> - <% if not flow.hideresetbtn then %> - <input class="cbi-button cbi-button-reset" type="reset" value="<%:Reset%>" /> - <% end %> - - <script type="text/javascript">cbi_d_update();</script> - </div> - <%- end -%> -</form> -<%+footer%> diff --git a/libs/web/luasrc/view/cbi/full_valuefooter.htm b/libs/web/luasrc/view/cbi/full_valuefooter.htm deleted file mode 100644 index 4876fbcc9..000000000 --- a/libs/web/luasrc/view/cbi/full_valuefooter.htm +++ /dev/null @@ -1,59 +0,0 @@ - <% if self.description and #self.description > 0 then -%> - <% if not luci.util.instanceof(self, luci.cbi.DynamicList) and (not luci.util.instanceof(self, luci.cbi.Flag) or self.orientation == "horizontal") then -%> - <br /> - <%- end %> - <div class="cbi-value-description"> - <span class="cbi-value-helpicon"><img src="<%=resource%>/cbi/help.gif" alt="<%:help%>" /></span> - <%=self.description%> - </div> - <%- end %> - <%- if self.title and #self.title > 0 then -%> - </div> - <%- end -%> -</div> - - -<% if #self.deps > 0 or #self.subdeps > 0 then -%> - <script type="text/javascript" id="cbip-<%=self.config.."-"..section.."-"..self.option%>"> - <% for j, d in ipairs(self.subdeps) do -%> - cbi_d_add("cbi-<%=self.config.."-"..section.."-"..self.option..d.add%>", { - <%- - for k,v in pairs(d.deps) do - local depk - if k:find("!", 1, true) then - depk = string.format('"%s"', k) - elseif k:find(".", 1, true) then - depk = string.format('"cbid.%s"', k) - else - depk = string.format('"cbid.%s.%s.%s"', self.config, section, k) - end - -%> - <%-= depk .. ":" .. string.format("%q", v)-%> - <%-if next(d.deps, k) then-%>,<%-end-%> - <%- - end - -%> - }, "cbip-<%=self.config.."-"..section.."-"..self.option..d.add%>"); - <%- end %> - <% for j, d in ipairs(self.deps) do -%> - cbi_d_add("cbi-<%=self.config.."-"..section.."-"..self.option..d.add%>", { - <%- - for k,v in pairs(d.deps) do - local depk - if k:find("!", 1, true) then - depk = string.format('"%s"', k) - elseif k:find(".", 1, true) then - depk = string.format('"cbid.%s"', k) - else - depk = string.format('"cbid.%s.%s.%s"', self.config, section, k) - end - -%> - <%-= depk .. ":" .. string.format("%q", v)-%> - <%-if next(d.deps, k) then-%>,<%-end-%> - <%- - end - -%> - }, "cbip-<%=self.config.."-"..section.."-"..self.option..d.add%>"); - <%- end %> - </script> -<%- end %> diff --git a/libs/web/luasrc/view/cbi/full_valueheader.htm b/libs/web/luasrc/view/cbi/full_valueheader.htm deleted file mode 100644 index aaf085473..000000000 --- a/libs/web/luasrc/view/cbi/full_valueheader.htm +++ /dev/null @@ -1,9 +0,0 @@ -<div class="cbi-value<% if self.error and self.error[section] then %> cbi-value-error<% end %><% if self.last_child then %> cbi-value-last<% end %>" id="cbi-<%=self.config.."-"..section.."-"..self.option%>"> - <%- if self.title and #self.title > 0 then -%> - <label class="cbi-value-title"<%= attr("for", cbid) %>> - <%- if self.titleref then -%><a title="<%=self.titledesc or translate('Go to relevant configuration page')%>" class="cbi-title-ref" href="<%=self.titleref%>"><%- end -%> - <%-=self.title-%> - <%- if self.titleref then -%></a><%- end -%> - </label> - <div class="cbi-value-field"> - <%- end -%> diff --git a/libs/web/luasrc/view/cbi/fvalue.htm b/libs/web/luasrc/view/cbi/fvalue.htm deleted file mode 100644 index a1e0808e8..000000000 --- a/libs/web/luasrc/view/cbi/fvalue.htm +++ /dev/null @@ -1,9 +0,0 @@ -<%+cbi/valueheader%> - <input type="hidden" value="1"<%= - attr("name", "cbi.cbe." .. self.config .. "." .. section .. "." .. self.option) - %> /> - <input class="cbi-input-checkbox" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)" type="checkbox"<%= - attr("id", cbid) .. attr("name", cbid) .. attr("value", self.enabled or 1) .. - ifattr((self:cfgvalue(section) or self.default) == self.enabled, "checked", "checked") - %> /> -<%+cbi/valuefooter%> diff --git a/libs/web/luasrc/view/cbi/header.htm b/libs/web/luasrc/view/cbi/header.htm deleted file mode 100644 index 2bddaba61..000000000 --- a/libs/web/luasrc/view/cbi/header.htm +++ /dev/null @@ -1,7 +0,0 @@ -<%+header%> -<form method="post" name="cbi" action="<%=REQUEST_URI%>" enctype="multipart/form-data" onreset="return cbi_validate_reset(this)" onsubmit="return cbi_validate_form(this, '<%:Some fields are invalid, cannot save values!%>')"> - <div> - <script type="text/javascript" src="<%=resource%>/cbi.js"></script> - <input type="hidden" name="cbi.submit" value="1" /> - <input type="submit" value="<%:Save%>" class="hidden" /> - </div> diff --git a/libs/web/luasrc/view/cbi/lvalue.htm b/libs/web/luasrc/view/cbi/lvalue.htm deleted file mode 100644 index 8cc086db4..000000000 --- a/libs/web/luasrc/view/cbi/lvalue.htm +++ /dev/null @@ -1,18 +0,0 @@ -<%+cbi/valueheader%> -<% if self.widget == "select" then %> - <select class="cbi-input-select" onchange="cbi_d_update(this.id)"<%= attr("id", cbid) .. attr("name", cbid) .. ifattr(self.size, "size") %>> - <% for i, key in pairs(self.keylist) do -%> - <option id="cbi-<%=self.config.."-"..section.."-"..self.option.."-"..key%>"<%= attr("value", key) .. ifattr(tostring(self:cfgvalue(section) or self.default) == key, "selected", "selected") %>><%=striptags(self.vallist[i])%></option> - <%- end %> - </select> -<% elseif self.widget == "radio" then - local c = 0 - for i, key in pairs(self.keylist) do - c = c + 1 -%> - <input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)" type="radio"<%= attr("id", cbid..c) .. attr("name", cbid) .. attr("value", key) .. ifattr((self:cfgvalue(section) or self.default) == key, "checked", "checked") %> /> - <label<%= attr("for", cbid..c) %>><%=self.vallist[i]%></label> -<% if c == self.size then c = 0 %><% if self.orientation == "horizontal" then %> <% else %><br /><% end %> -<% end end %> -<% end %> -<%+cbi/valuefooter%> diff --git a/libs/web/luasrc/view/cbi/map.htm b/libs/web/luasrc/view/cbi/map.htm deleted file mode 100644 index 053220d18..000000000 --- a/libs/web/luasrc/view/cbi/map.htm +++ /dev/null @@ -1,13 +0,0 @@ -<%- if firstmap and messages then local msg; for _, msg in ipairs(messages) do -%> - <div class="errorbox"><%=pcdata(msg)%></div> -<%- end end -%> - -<%-+cbi/apply_xhr-%> - -<div class="cbi-map" id="cbi-<%=self.config%>"> - <% if self.title and #self.title > 0 then %><h2><a id="content" name="content"><%=self.title%></a></h2><% end %> - <% if self.description and #self.description > 0 then %><div class="cbi-map-descr"><%=self.description%></div><% end %> - <%- if firstmap and applymap then cbi_apply_xhr(self.config, parsechain, redirect) end -%> - <%- self:render_children() %> - <br /> -</div> diff --git a/libs/web/luasrc/view/cbi/mvalue.htm b/libs/web/luasrc/view/cbi/mvalue.htm deleted file mode 100644 index 6a0b3881d..000000000 --- a/libs/web/luasrc/view/cbi/mvalue.htm +++ /dev/null @@ -1,19 +0,0 @@ -<% local v = self:valuelist(section) or {} -%> -<%+cbi/valueheader%> -<% if self.widget == "select" then %> - <select class="cbi-input-select" multiple="multiple" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%= attr("name", cbid) .. ifattr(self.size, "size") %>> - <% for i, key in pairs(self.keylist) do -%> - <option<%= attr("value", key) .. ifattr(luci.util.contains(v, key), "selected", "selected") %>><%=striptags(self.vallist[i])%></option> - <%- end %> - </select> -<% elseif self.widget == "checkbox" then - local c = 0; - for i, key in pairs(self.keylist) do - c = c + 1 -%> - <input class="cbi-input-checkbox" type="checkbox" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%= attr("id", cbid..c) .. attr("name", cbid) .. attr("value", key) .. ifattr(luci.util.contains(v, key), "checked", "checked") %> /> - <label<%= attr("for", cbid..c) %>><%=self.vallist[i]%></label><br /> -<% if c == self.size then c = 0 %><br /> -<% end end %> -<% end %> -<%+cbi/valuefooter%> diff --git a/libs/web/luasrc/view/cbi/network_ifacelist.htm b/libs/web/luasrc/view/cbi/network_ifacelist.htm deleted file mode 100644 index 643d849a5..000000000 --- a/libs/web/luasrc/view/cbi/network_ifacelist.htm +++ /dev/null @@ -1,81 +0,0 @@ -<%+cbi/valueheader%> - -<%- - local utl = require "luci.util" - local net = require "luci.model.network".init() - local cbeid = luci.cbi.FEXIST_PREFIX .. self.config .. "." .. section .. "." .. self.option - - local iface - local ifaces = net:get_interfaces() - local value - - if self.map:formvalue(cbeid) == "1" then - value = self:formvalue(section) or self.default or "" - else - value = self:cfgvalue(section) or self.default - end - - local checked = { } - - if value then - for value in utl.imatch(value) do - checked[value] = true - end - else - local n = self.network and net:get_network(self.network) - if n then - local i - for _, i in ipairs(n:get_interfaces() or { n:get_interface() }) do - checked[i:name()] = true - end - end - end --%> - -<input type="hidden" name="<%=cbeid%>" value="1" /> -<ul style="margin:0; list-style-type:none"> - <% for _, iface in ipairs(ifaces) do - local link = iface:adminlink() - if (not self.nobridges or not iface:is_bridge()) and - (not self.noinactive or iface:is_up()) and - iface:name() ~= self.exclude - then %> - <li> - <input class="cbi-input-<%=self.widget or "radio"%>" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%= - attr("type", self.widget or "radio") .. - attr("id", cbid .. "." .. iface:name()) .. - attr("name", cbid) .. attr("value", iface:name()) .. - ifattr(checked[iface:name()], "checked", "checked") - %> />   - <label<%=attr("for", cbid .. "." .. iface:name())%>> - <% if link then -%><a href="<%=link%>"><% end -%> - <img<%=attr("title", iface:get_i18n())%> style="width:16px; height:16px; vertical-align:middle" src="<%=resource%>/icons/<%=iface:type()%><%=iface:is_up() and "" or "_disabled"%>.png" /> - <% if link then -%></a><% end -%> - <%=pcdata(iface:get_i18n())%> - <% local ns = iface:get_networks(); if #ns > 0 then %>( - <%- local i, n; for i, n in ipairs(ns) do -%> - <%-= (i>1) and ', ' -%> - <a href="<%=n:adminlink()%>"><%=n:name()%></a> - <%- end -%> - )<% end %> - </label> - </li> - <% end end %> - <% if not self.nocreate then %> - <li> - <input class="cbi-input-<%=self.widget or "radio"%>" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%= - attr("type", self.widget or "radio") .. - attr("id", cbid .. "_custom") .. - attr("name", cbid) .. - attr("value", " ") - %> />   - <label<%=attr("for", cbid .. "_custom")%>> - <img title="<%:Custom Interface%>" style="width:16px; height:16px; vertical-align:middle" src="<%=resource%>/icons/ethernet_disabled.png" /> - <%:Custom Interface%>: - </label> - <input type="text" style="width:50px" onfocus="document.getElementById('<%=cbid%>_custom').checked=true" onblur="var x=document.getElementById('<%=cbid%>_custom'); x.value=this.value; x.checked=true" /> - </li> - <% end %> -</ul> - -<%+cbi/valuefooter%> diff --git a/libs/web/luasrc/view/cbi/network_netinfo.htm b/libs/web/luasrc/view/cbi/network_netinfo.htm deleted file mode 100644 index 4fd84112a..000000000 --- a/libs/web/luasrc/view/cbi/network_netinfo.htm +++ /dev/null @@ -1,27 +0,0 @@ -<%+cbi/valueheader%> - -<%- - local value = self:formvalue(section) - if not value or value == "-" then - value = self:cfgvalue(section) or self.default - end - - local nwm = require "luci.model.network".init() - local net = nwm:get_network(value) --%> - -<% if net then %> -<span class="ifacebadge"><%=net:name()%>: - <% - local empty = true - for _, iface in ipairs(net:get_interfaces() or { net:get_interface() }) do - if not iface:is_bridge() then - empty = false - %> - <img<%=attr("title", iface:get_i18n())%> style="width:16px; height:16px; vertical-align:middle" src="<%=resource%>/icons/<%=iface:type()%><%=iface:is_up() and "" or "_disabled"%>.png" /> - <% end end %> - <% if empty then %><em><%:(no interfaces attached)%></em><% end %> -</span> -<% end %> - -<%+cbi/valuefooter%> diff --git a/libs/web/luasrc/view/cbi/network_netlist.htm b/libs/web/luasrc/view/cbi/network_netlist.htm deleted file mode 100644 index 7e23d149a..000000000 --- a/libs/web/luasrc/view/cbi/network_netlist.htm +++ /dev/null @@ -1,81 +0,0 @@ -<%+cbi/valueheader%> - -<%- - local utl = require "luci.util" - local nwm = require "luci.model.network".init() - - local net, iface - local networks = nwm:get_networks() - local value = self:formvalue(section) - - self.cast = nil - - if not value or value == "-" then - value = self:cfgvalue(section) or self.default - end - - local checked = { } - for value in utl.imatch(value) do - checked[value] = true - end --%> - -<ul style="margin:0; list-style-type:none; text-align:left"> - <% for _, net in ipairs(networks) do - if (net:name() ~= "loopback") and - (net:name() ~= self.exclude) and - (not self.novirtual or not net:is_virtual()) - then %> - <li style="padding:0.25em 0"> - <input class="cbi-input-<%=self.widget or "radio"%>" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%= - attr("type", self.widget or "radio") .. - attr("id", cbid .. "." .. net:name()) .. - attr("name", cbid) .. attr("value", net:name()) .. - ifattr(checked[net:name()], "checked", "checked") - %> />   - <label<%=attr("for", cbid .. "." .. net:name())%>> - <span class="ifacebadge"><%=net:name()%>: - <% - local empty = true - for _, iface in ipairs(net:is_bridge() and net:get_interfaces() or { net:get_interface() }) do - if not iface:is_bridge() then - empty = false - %> - <img<%=attr("title", iface:get_i18n())%> style="width:16px; height:16px; vertical-align:middle" src="<%=resource%>/icons/<%=iface:type()%><%=iface:is_up() and "" or "_disabled"%>.png" /> - <% end end %> - <% if empty then %><em><%:(no interfaces attached)%></em><% end %> - </span> - </label> - </li> - <% end end %> - - <% if not self.nocreate then %> - <li style="padding:0.25em 0"> - <input class="cbi-input-<%=self.widget or "radio"%>" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%=attr("type", self.widget or "radio") .. attr("id", cbid .. "_new") .. attr("name", cbid) .. attr("value", "-") .. ifattr(not value and self.widget ~= "checkbox", "checked", "checked")%> />   - <div style="padding:0.5em; display:inline"> - <label<%=attr("for", cbid .. "_new")%>><em> - <%- if self.widget == "checkbox" then -%> - <%:create:%> - <%- else -%> - <%:unspecified -or- create:%> - <%- end -%> </em></label> - <input style="width:6em" type="text"<%=attr("name", cbid .. ".newnet")%> onfocus="document.getElementById('<%=cbid%>_new').checked=true" /> - </div> - </li> - <% elseif self.widget ~= "checkbox" and self.unspecified then %> - <li style="padding:0.25em 0"> - <input class="cbi-input-<%=self.widget or "radio"%>" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%= - attr("type", self.widget or "radio") .. - attr("id", cbid .. "_uns") .. - attr("name", cbid) .. - attr("value", "") .. - ifattr(not value or #value == 0, "checked", "checked") - %> />   - <div style="padding:0.5em; display:inline"> - <label<%=attr("for", cbid .. "_uns")%>><em><%:unspecified%></em></label> - </div> - </li> - <% end %> -</ul> - -<%+cbi/valuefooter%> diff --git a/libs/web/luasrc/view/cbi/nsection.htm b/libs/web/luasrc/view/cbi/nsection.htm deleted file mode 100644 index 95e765882..000000000 --- a/libs/web/luasrc/view/cbi/nsection.htm +++ /dev/null @@ -1,31 +0,0 @@ -<% if self:cfgvalue(self.section) then section = self.section %> - <fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=section%>"> - <% if self.title and #self.title > 0 then -%> - <legend><%=self.title%></legend> - <%- end %> - <% if self.description and #self.description > 0 then -%> - <div class="cbi-section-descr"><%=self.description%></div> - <%- end %> - <% if self.addremove then -%> - <div class="cbi-section-remove right"> - <input type="submit" name="cbi.rns.<%=self.config%>.<%=section%>" value="<%:Delete%>" /> - </div> - <%- end %> - <%+cbi/tabmenu%> - <div class="cbi-section-node<% if self.tabs then %> cbi-section-node-tabbed<% end %>" id="cbi-<%=self.config%>-<%=section%>"> - <%+cbi/ucisection%> - </div> - <br /> - </fieldset> -<% elseif self.addremove then %> - <% if self.template_addremove then include(self.template_addremove) else -%> - <fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.section%>"> - <% if self.title and #self.title > 0 then -%> - <legend><%=self.title%></legend> - <%- end %> - <div class="cbi-section-descr"><%=self.description%></div> - <input type="submit" class="cbi-button-add" name="cbi.cns.<%=self.config%>.<%=self.section%>" value="<%:Add%>" /> - </fieldset> - <%- end %> -<% end %> -<!-- /nsection --> diff --git a/libs/web/luasrc/view/cbi/nullsection.htm b/libs/web/luasrc/view/cbi/nullsection.htm deleted file mode 100644 index bd4895095..000000000 --- a/libs/web/luasrc/view/cbi/nullsection.htm +++ /dev/null @@ -1,38 +0,0 @@ -<fieldset class="cbi-section"> - <% if self.title and #self.title > 0 then -%> - <legend><%=self.title%></legend> - <%- end %> - <% if self.description and #self.description > 0 then -%> - <div class="cbi-section-descr"><%=self.description%></div> - <%- end %> - <div class="cbi-section-node" id="cbi-<%=self.config%>-<%=tostring(self):sub(8)%>"> - <div> - <% self:render_children(1, scope or {}) %> - </div> - <% if self.error and self.error[1] then -%> - <div class="cbi-section-error"> - <ul><% for _, e in ipairs(self.error[1]) do -%> - <li> - <%- if e == "invalid" then -%> - <%:One or more fields contain invalid values!%> - <%- elseif e == "missing" then -%> - <%:One or more required fields have no value!%> - <%- else -%> - <%=pcdata(e)%> - <%- end -%> - </li> - <%- end %></ul> - </div> - <%- end %> - </div> - <br /> -</fieldset> -<%- - if type(self.hidden) == "table" then - for k, v in pairs(self.hidden) do --%> - <input type="hidden" id="<%=k%>" name="<%=k%>" value="<%=pcdata(v)%>" /> -<%- - end - end -%> diff --git a/libs/web/luasrc/view/cbi/simpleform.htm b/libs/web/luasrc/view/cbi/simpleform.htm deleted file mode 100644 index 5216cd50f..000000000 --- a/libs/web/luasrc/view/cbi/simpleform.htm +++ /dev/null @@ -1,57 +0,0 @@ -<% if not self.embedded then %> -<form method="post" enctype="multipart/form-data" action="<%=REQUEST_URI%>"> - <div> - <script type="text/javascript" src="<%=resource%>/cbi.js"></script> - <input type="hidden" name="cbi.submit" value="1" /> - </div> -<% end %> - <div class="cbi-map" id="cbi-<%=self.config%>"> - <% if self.title and #self.title > 0 then %><h2><a id="content" name="content"><%=self.title%></a></h2><% end %> - <% if self.description and #self.description > 0 then %><div class="cbi-map-descr"><%=self.description%></div><% end %> - <% self:render_children() %> - <br /> - </div> -<%- if self.message then %> - <div><%=self.message%></div> -<%- end %> -<%- if self.errmessage then %> - <div class="error"><%=self.errmessage%></div> -<%- end %> -<% if not self.embedded then %> - <div class="cbi-page-actions"> -<%- - if type(self.hidden) == "table" then - for k, v in pairs(self.hidden) do --%> - <input type="hidden" id="<%=k%>" name="<%=k%>" value="<%=pcdata(v)%>" /> -<%- - end - end -%> -<% if redirect then %> - <div style="float:left"> - <input class="cbi-button cbi-button-link" type="button" value="<%:Back to Overview%>" onclick="location.href='<%=pcdata(redirect)%>'" /> - </div> -<% end %> -<%- if self.flow and self.flow.skip then %> - <input class="cbi-button cbi-button-skip" type="submit" name="cbi.skip" value="<%:Skip%>" /> -<% end %> -<%- if self.submit ~= false then %> - <input class="cbi-button cbi-button-save" type="submit" value=" - <%- if not self.submit then -%><%-:Submit-%><%-else-%><%=self.submit%><%end-%> - " /> -<% end %> -<%- if self.reset ~= false then %> - <input class="cbi-button cbi-button-reset" type="reset" value=" - <%- if not self.reset then -%><%-:Reset-%><%-else-%><%=self.reset%><%end-%> - " /> -<% end %> -<%- if self.cancel ~= false and self.on_cancel then %> - <input class="cbi-button cbi-button-reset" type="submit" name="cbi.cancel" value=" - <%- if not self.cancel then -%><%-:Cancel-%><%-else-%><%=self.cancel%><%end-%> - " /> -<% end %> - <script type="text/javascript">cbi_d_update();</script> - </div> -</form> -<% end %> diff --git a/libs/web/luasrc/view/cbi/tabcontainer.htm b/libs/web/luasrc/view/cbi/tabcontainer.htm deleted file mode 100644 index 38c435d6a..000000000 --- a/libs/web/luasrc/view/cbi/tabcontainer.htm +++ /dev/null @@ -1,7 +0,0 @@ -<% for tab, data in pairs(self.tabs) do %> - <div class="cbi-tabcontainer" id="container.<%=self.config%>.<%=section%>.<%=tab%>"<% if tab ~= self.selected_tab then %> style="display:none"<% end %>> - <% if data.description then %><div class="cbi-tab-descr"><%=data.description%></div><% end %> - <% self:render_tab(tab, section, scope or {}) %> - </div> - <script type="text/javascript">cbi_t_add('<%=self.config%>.<%=section%>', '<%=tab%>')</script> -<% end %> diff --git a/libs/web/luasrc/view/cbi/tabmenu.htm b/libs/web/luasrc/view/cbi/tabmenu.htm deleted file mode 100644 index b96ac9ce4..000000000 --- a/libs/web/luasrc/view/cbi/tabmenu.htm +++ /dev/null @@ -1,13 +0,0 @@ -<%- if self.tabs then %> - <ul class="cbi-tabmenu"> - <%- self.selected_tab = luci.http.formvalue("tab." .. self.config .. "." .. section) %> - <%- for _, tab in ipairs(self.tab_names) do if #self.tabs[tab].childs > 0 then %> - <script type="text/javascript">cbi_c['container.<%=self.config%>.<%=section%>.<%=tab%>'] = <%=#self.tabs[tab].childs%>;</script> - <%- if not self.selected_tab then self.selected_tab = tab end %> - <li id="tab.<%=self.config%>.<%=section%>.<%=tab%>" class="cbi-tab<%=(tab == self.selected_tab) and '' or '-disabled'%>"> - <a onclick="this.blur(); return cbi_t_switch('<%=self.config%>.<%=section%>', '<%=tab%>')" href="<%=REQUEST_URI%>?tab.<%=self.config%>.<%=section%>=<%=tab%>"><%=self.tabs[tab].title%></a> - <% if tab == self.selected_tab then %><input type="hidden" id="tab.<%=self.config%>.<%=section%>" name="tab.<%=self.config%>.<%=section%>" value="<%=tab%>" /><% end %> - </li> - <% end end -%> - </ul> -<% end -%> diff --git a/libs/web/luasrc/view/cbi/tblsection.htm b/libs/web/luasrc/view/cbi/tblsection.htm deleted file mode 100644 index d92879116..000000000 --- a/libs/web/luasrc/view/cbi/tblsection.htm +++ /dev/null @@ -1,146 +0,0 @@ -<%- -local rowcnt = 1 -function rowstyle() - rowcnt = rowcnt + 1 - return (rowcnt % 2) + 1 -end - -function width(o) - if o.width then - if type(o.width) == 'number' then - return ' style="width:%dpx"' % o.width - end - return ' style="width:%s"' % o.width - end - return '' -end --%> - -<!-- tblsection --> -<fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>"> - <% if self.title and #self.title > 0 then -%> - <legend><%=self.title%></legend> - <%- end %> - <%- if self.sortable then -%> - <input type="hidden" id="cbi.sts.<%=self.config%>.<%=self.sectiontype%>" name="cbi.sts.<%=self.config%>.<%=self.sectiontype%>" value="" /> - <%- end -%> - <div class="cbi-section-descr"><%=self.description%></div> - <div class="cbi-section-node"> - <%- local count = 0 -%> - <table class="cbi-section-table"> - <tr class="cbi-section-table-titles"> - <%- if not self.anonymous then -%> - <%- if self.sectionhead then -%> - <th class="cbi-section-table-cell"><%=self.sectionhead%></th> - <%- else -%> - <th> </th> - <%- end -%> - <%- end -%> - <%- for i, k in pairs(self.children) do if not k.optional then -%> - <th class="cbi-section-table-cell"<%=width(k)%>> - <%- if k.titleref then -%><a title="<%=self.titledesc or translate('Go to relevant configuration page')%>" class="cbi-title-ref" href="<%=k.titleref%>"><%- end -%> - <%-=k.title-%> - <%- if k.titleref then -%></a><%- end -%> - </th> - <%- count = count + 1; end; end; if self.sortable then -%> - <th class="cbi-section-table-cell"><%:Sort%></th> - <%- end; if self.extedit or self.addremove then -%> - <th class="cbi-section-table-cell"> </th> - <%- count = count + 1; end -%> - </tr> - <tr class="cbi-section-table-descr"> - <%- if not self.anonymous then -%> - <%- if self.sectiondesc then -%> - <th class="cbi-section-table-cell"><%=self.sectiondesc%></th> - <%- else -%> - <th></th> - <%- end -%> - <%- end -%> - <%- for i, k in pairs(self.children) do if not k.optional then -%> - <th class="cbi-section-table-cell"<%=width(k)%>><%=k.description%></th> - <%- end; end; if self.sortable then -%> - <th class="cbi-section-table-cell"></th> - <%- end; if self.extedit or self.addremove then -%> - <th class="cbi-section-table-cell"></th> - <%- end -%> - </tr> - <%- local isempty = true - for i, k in ipairs(self:cfgsections()) do - section = k - isempty = false - scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" } - -%> - <tr class="cbi-section-table-row<% if self.extedit or self.rowcolors then %> cbi-rowstyle-<%=rowstyle()%><% end %>" id="cbi-<%=self.config%>-<%=section%>"> - <% if not self.anonymous then -%> - <th><h3><%=(type(self.sectiontitle) == "function") and self:sectiontitle(section) or k%></h3></th> - <%- end %> - - - <%- - for k, node in ipairs(self.children) do - if not node.optional then - node:render(section, scope or {}) - end - end - -%> - - <%- if self.sortable then -%> - <td class="cbi-section-table-cell"> - <input class="cbi-button cbi-button-up" type="button" value="" onclick="return cbi_row_swap(this, true, 'cbi.sts.<%=self.config%>.<%=self.sectiontype%>')" alt="<%:Move up%>" title="<%:Move up%>" /> - <input class="cbi-button cbi-button-down" type="button" value="" onclick="return cbi_row_swap(this, false, 'cbi.sts.<%=self.config%>.<%=self.sectiontype%>')" alt="<%:Move down%>" title="<%:Move down%>" /> - </td> - <%- end -%> - - <%- if self.extedit or self.addremove then -%> - <td class="cbi-section-table-cell"> - <%- if self.extedit then -%> - <input class="cbi-button cbi-button-edit" type="button" value="<%:Edit%>" - <%- if type(self.extedit) == "string" then - %> onclick="location.href='<%=self.extedit:format(section)%>'" - <%- elseif type(self.extedit) == "function" then - %> onclick="location.href='<%=self:extedit(section)%>'" - <%- end - %> alt="<%:Edit%>" title="<%:Edit%>" /> - <%- end; if self.addremove then %> - <input class="cbi-button cbi-button-remove" type="submit" value="<%:Delete%>" onclick="this.form.cbi_state='del-section'; return true" name="cbi.rts.<%=self.config%>.<%=k%>" alt="<%:Delete%>" title="<%:Delete%>" /> - <%- end -%> - </td> - <%- end -%> - </tr> - <%- end -%> - - <%- if isempty then -%> - <tr class="cbi-section-table-row"> - <td colspan="<%=count%>"><em><br /><%:This section contains no values yet%></em></td> - </tr> - <%- end -%> - </table> - - <% if self.error then %> - <div class="cbi-section-error"> - <ul><% for _, c in pairs(self.error) do for _, e in ipairs(c) do -%> - <li><%=pcdata(e):gsub("\n","<br />")%></li> - <%- end end %></ul> - </div> - <% end %> - - <%- if self.addremove then -%> - <% if self.template_addremove then include(self.template_addremove) else -%> - <div class="cbi-section-create cbi-tblsection-create"> - <% if self.anonymous then %> - <input class="cbi-button cbi-button-add" type="submit" value="<%:Add%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" title="<%:Add%>" /> - <% else %> - <% if self.invalid_cts then -%><div class="cbi-section-error"><% end %> - <input type="text" class="cbi-section-create-name" id="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" /> - <script type="text/javascript">cbi_validate_field('cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>', true, 'uciname');</script> - <input class="cbi-button cbi-button-add" type="submit" onclick="this.form.cbi_state='add-section'; return true" value="<%:Add%>" title="<%:Add%>" /> - <% if self.invalid_cts then -%> - <br /><%:Invalid%></div> - <%- end %> - <% end %> - </div> - <%- end %> - <%- end -%> - </div> -</fieldset> -<!-- /tblsection --> diff --git a/libs/web/luasrc/view/cbi/tsection.htm b/libs/web/luasrc/view/cbi/tsection.htm deleted file mode 100644 index 087548bf2..000000000 --- a/libs/web/luasrc/view/cbi/tsection.htm +++ /dev/null @@ -1,48 +0,0 @@ -<fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>"> - <% if self.title and #self.title > 0 then -%> - <legend><%=self.title%></legend> - <%- end %> - <div class="cbi-section-descr"><%=self.description%></div> - <% local isempty = true for i, k in ipairs(self:cfgsections()) do -%> - <% if self.addremove then -%> - <div class="cbi-section-remove right"> - <input type="submit" name="cbi.rts.<%=self.config%>.<%=k%>" onclick="this.form.cbi_state='del-section'; return true" value="<%:Delete%>" class="cbi-button" /> - </div> - <%- end %> - - <%- section = k; isempty = false -%> - - <% if not self.anonymous then -%> - <h3><%=section:upper()%></h3> - <%- end %> - - <%+cbi/tabmenu%> - - <fieldset class="cbi-section-node<% if self.tabs then %> cbi-section-node-tabbed<% end %>" id="cbi-<%=self.config%>-<%=section%>"> - <%+cbi/ucisection%> - </fieldset> - <br /> - <%- end %> - - <% if isempty then -%> - <em><%:This section contains no values yet%><br /><br /></em> - <%- end %> - - <% if self.addremove then -%> - <% if self.template_addremove then include(self.template_addremove) else -%> - <div class="cbi-section-create"> - <% if self.anonymous then -%> - <input type="submit" class="cbi-button cbi-button-add" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" value="<%:Add%>" /> - <%- else -%> - <% if self.invalid_cts then -%><div class="cbi-section-error"><% end %> - <input type="text" class="cbi-section-create-name" id="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" /> - <script type="text/javascript">cbi_validate_field('cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>', true, 'uciname');</script> - <input type="submit" class="cbi-button cbi-button-add" onclick="this.form.cbi_state='add-section'; return true" value="<%:Add%>" /> - <% if self.invalid_cts then -%> - <br /><%:Invalid%></div> - <%- end %> - <%- end %> - </div> - <%- end %> - <%- end %> -</fieldset> diff --git a/libs/web/luasrc/view/cbi/tvalue.htm b/libs/web/luasrc/view/cbi/tvalue.htm deleted file mode 100644 index fcf7a6c94..000000000 --- a/libs/web/luasrc/view/cbi/tvalue.htm +++ /dev/null @@ -1,5 +0,0 @@ -<%+cbi/valueheader%> - <textarea class="cbi-input-textarea" <% if not self.size then %> style="width: 100%"<% else %> cols="<%=self.size%>"<% end %> onchange="cbi_d_update(this.id)"<%= attr("name", cbid) .. attr("id", cbid) .. ifattr(self.rows, "rows") .. ifattr(self.wrap, "wrap") %>> - <%-=pcdata(self:cfgvalue(section))-%> - </textarea> -<%+cbi/valuefooter%> diff --git a/libs/web/luasrc/view/cbi/ucisection.htm b/libs/web/luasrc/view/cbi/ucisection.htm deleted file mode 100644 index 3b69f12f2..000000000 --- a/libs/web/luasrc/view/cbi/ucisection.htm +++ /dev/null @@ -1,75 +0,0 @@ -<%- - if type(self.hidden) == "table" then - for k, v in pairs(self.hidden) do --%> - <input type="hidden" id="<%=k%>" name="<%=k%>" value="<%=pcdata(v)%>" /> -<%- - end - end -%> - -<% if self.tabs then %> - <%+cbi/tabcontainer%> -<% else %> - <% self:render_children(section, scope or {}) %> -<% end %> - -<% if self.error and self.error[section] then -%> - <div class="cbi-section-error"> - <ul><% for _, e in ipairs(self.error[section]) do -%> - <li> - <%- if e == "invalid" then -%> - <%:One or more fields contain invalid values!%> - <%- elseif e == "missing" then -%> - <%:One or more required fields have no value!%> - <%- else -%> - <%=pcdata(e)%> - <%- end -%> - </li> - <%- end %></ul> - </div> -<%- end %> - -<% if self.optionals[section] and #self.optionals[section] > 0 or self.dynamic then %> - <div class="cbi-optionals"> - <% if self.dynamic then %> - <input type="text" id="cbi.opt.<%=self.config%>.<%=section%>" name="cbi.opt.<%=self.config%>.<%=section%>" /> - <% if self.optionals[section] and #self.optionals[section] > 0 then %> - <script type="text/javascript"> - cbi_combobox_init('cbi.opt.<%=self.config%>.<%=section%>', { - <%- - for i, val in pairs(self.optionals[section]) do - -%> - <%-=string.format("%q", val.option) .. ":" .. string.format("%q", striptags(val.title))-%> - <%-if next(self.optionals[section], i) then-%>,<%-end-%> - <%- - end - -%> - }, '', '<%-: -- custom -- -%>'); - </script> - <% end %> - <% else %> - <select id="cbi.opt.<%=self.config%>.<%=section%>" name="cbi.opt.<%=self.config%>.<%=section%>"> - <option><%: -- Additional Field -- %></option> - <% for key, val in pairs(self.optionals[section]) do -%> - <option id="cbi-<%=self.config.."-"..section.."-"..val.option%>" value="<%=val.option%>"><%=striptags(val.title)%></option> - <%- end %> - </select> - <script type="text/javascript"><% for key, val in pairs(self.optionals[section]) do %> - <% if #val.deps > 0 then %><% for j, d in ipairs(val.deps) do -%> - cbi_d_add("cbi-<%=self.config.."-"..section.."-"..val.option..d.add%>", { - <%- - for k,v in pairs(d.deps) do - -%> - <%-=string.format('"cbid.%s.%s.%s"', self.config, section, k) .. ":" .. string.format("%q", v)-%> - <%-if next(d.deps, k) then-%>,<%-end-%> - <%- - end - -%> - }); - <%- end %><% end %> - <% end %></script> - <% end %> - <input type="submit" class="cbi-button cbi-button-fieldadd" value="<%:Add%>" /> - </div> -<% end %> diff --git a/libs/web/luasrc/view/cbi/upload.htm b/libs/web/luasrc/view/cbi/upload.htm deleted file mode 100644 index 777093411..000000000 --- a/libs/web/luasrc/view/cbi/upload.htm +++ /dev/null @@ -1,14 +0,0 @@ -<% - local t = require("luci.tools.webadmin") - local v = self:cfgvalue(section) - local s = v and nixio.fs.stat(v) --%> -<%+cbi/valueheader%> - <% if s then %> - <%:Uploaded File%> (<%=t.byte_format(s.size)%>) - <input type="hidden"<%= attr("value", v) .. attr("name", cbid) .. attr("id", cbid) %> /> - <input class="cbi-button cbi-input-image" type="image" value="<%:Replace entry%>" name="cbi.rlf.<%=section .. "." .. self.option%>" alt="<%:Replace entry%>" title="<%:Replace entry%>" src="<%=resource%>/cbi/reload.gif" /> - <% else %> - <input class="cbi-input-file" type="file"<%= attr("name", cbid) .. attr("id", cbid) %> /> - <% end %> -<%+cbi/valuefooter%> diff --git a/libs/web/luasrc/view/cbi/value.htm b/libs/web/luasrc/view/cbi/value.htm deleted file mode 100644 index d1a7bea5c..000000000 --- a/libs/web/luasrc/view/cbi/value.htm +++ /dev/null @@ -1,35 +0,0 @@ -<%+cbi/valueheader%> - <input type="<%=self.password and 'password" class="cbi-input-password' or 'text" class="cbi-input-text' %>" onchange="cbi_d_update(this.id)"<%= - attr("name", cbid) .. attr("id", cbid) .. attr("value", self:cfgvalue(section) or self.default) .. - ifattr(self.size, "size") .. ifattr(self.placeholder, "placeholder") - %> /> - <% 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 %> - <% if #self.keylist > 0 or self.datatype then -%> - <script type="text/javascript">//<![CDATA[ - <% if #self.keylist > 0 then -%> - cbi_combobox_init('<%=cbid%>', { - <%- - for i, k in ipairs(self.keylist) do - -%> - <%-=string.format("%q", k) .. ":" .. string.format("%q", self.vallist[i])-%> - <%-if i<#self.keylist then-%>,<%-end-%> - <%- - end - -%> - }, '<%- if not self.rmempty and not self.optional then -%> - <%-: -- Please choose -- -%> - <%- elseif self.placeholder then -%> - <%-= pcdata(self.placeholder) -%> - <%- end -%>', ' - <%- if self.combobox_manual then -%> - <%-=self.combobox_manual-%> - <%- else -%> - <%-: -- custom -- -%> - <%- end -%>'); - <%- end %> - <% if self.datatype then -%> - cbi_validate_field('<%=cbid%>', <%=tostring((self.optional or self.rmempty) == true)%>, '<%=self.datatype:gsub("'", "\\'")%>'); - <%- end %> - //]]></script> - <% end -%> -<%+cbi/valuefooter%> diff --git a/libs/web/luasrc/view/cbi/valuefooter.htm b/libs/web/luasrc/view/cbi/valuefooter.htm deleted file mode 100644 index 805312e45..000000000 --- a/libs/web/luasrc/view/cbi/valuefooter.htm +++ /dev/null @@ -1 +0,0 @@ -<% include( valuefooter or "cbi/full_valuefooter" ) %> diff --git a/libs/web/luasrc/view/cbi/valueheader.htm b/libs/web/luasrc/view/cbi/valueheader.htm deleted file mode 100644 index 761a54aed..000000000 --- a/libs/web/luasrc/view/cbi/valueheader.htm +++ /dev/null @@ -1 +0,0 @@ -<% include( valueheader or "cbi/full_valueheader" ) %> |