summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-compat/luasrc
diff options
context:
space:
mode:
Diffstat (limited to 'modules/luci-compat/luasrc')
-rw-r--r--modules/luci-compat/luasrc/model/network/proto_vpnc.lua1
-rw-r--r--modules/luci-compat/luasrc/tools/webadmin.lua18
-rw-r--r--modules/luci-compat/luasrc/view/cbi/button.htm2
-rw-r--r--modules/luci-compat/luasrc/view/cbi/cell_valuefooter.htm2
-rw-r--r--modules/luci-compat/luasrc/view/cbi/cell_valueheader.htm2
-rw-r--r--modules/luci-compat/luasrc/view/cbi/delegator.htm10
-rw-r--r--modules/luci-compat/luasrc/view/cbi/error.htm2
-rw-r--r--modules/luci-compat/luasrc/view/cbi/ipaddr.htm2
-rw-r--r--modules/luci-compat/luasrc/view/cbi/nsection.htm8
-rw-r--r--modules/luci-compat/luasrc/view/cbi/nullsection.htm2
-rw-r--r--modules/luci-compat/luasrc/view/cbi/simpleform.htm10
-rw-r--r--modules/luci-compat/luasrc/view/cbi/tblsection.htm50
-rw-r--r--modules/luci-compat/luasrc/view/cbi/tsection.htm8
-rw-r--r--modules/luci-compat/luasrc/view/cbi/ucisection.htm2
14 files changed, 59 insertions, 60 deletions
diff --git a/modules/luci-compat/luasrc/model/network/proto_vpnc.lua b/modules/luci-compat/luasrc/model/network/proto_vpnc.lua
index 6c3136e384..899a67ad0a 100644
--- a/modules/luci-compat/luasrc/model/network/proto_vpnc.lua
+++ b/modules/luci-compat/luasrc/model/network/proto_vpnc.lua
@@ -43,4 +43,3 @@ function proto.contains_interface(self, ifc)
end
netmod:register_pattern_virtual("^vpn%-%w")
-
diff --git a/modules/luci-compat/luasrc/tools/webadmin.lua b/modules/luci-compat/luasrc/tools/webadmin.lua
index 106810aa03..350c1fed2b 100644
--- a/modules/luci-compat/luasrc/tools/webadmin.lua
+++ b/modules/luci-compat/luasrc/tools/webadmin.lua
@@ -14,8 +14,8 @@ function byte_format(byte)
if byte > 1024 and i < 5 then
byte = byte / 1024
else
- return string.format("%.2f %s", byte, suff[i])
- end
+ return string.format("%.2f %s", byte, suff[i])
+ end
end
end
@@ -24,23 +24,23 @@ function date_format(secs)
local mins = 0
local hour = 0
local days = 0
-
+
secs = math.floor(secs)
if secs > 60 then
mins = math.floor(secs / 60)
secs = secs % 60
end
-
+
if mins > 60 then
hour = math.floor(mins / 60)
mins = mins % 60
end
-
+
if hour > 24 then
days = math.floor(hour / 24)
hour = hour % 24
end
-
+
if days > 0 then
return string.format("%.0fd %02.0fh %02.0fmin %02.0fs", days, hour, mins, secs)
else
@@ -70,15 +70,15 @@ end
function firewall_find_zone(name)
local find
-
- luci.model.uci.cursor():foreach("firewall", "zone",
+
+ luci.model.uci.cursor():foreach("firewall", "zone",
function (section)
if section.name == name then
find = section[".name"]
end
end
)
-
+
return find
end
diff --git a/modules/luci-compat/luasrc/view/cbi/button.htm b/modules/luci-compat/luasrc/view/cbi/button.htm
index 6ccba58f23..1f9d164240 100644
--- a/modules/luci-compat/luasrc/view/cbi/button.htm
+++ b/modules/luci-compat/luasrc/view/cbi/button.htm
@@ -1,6 +1,6 @@
<%+cbi/valueheader%>
<% if self:cfgvalue(section) ~= false then %>
- <input class="cbi-button cbi-button-<%=self.inputstyle or "button" %>" type="submit"<%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self.inputtitle or self.title)%> />
+ <input class="btn cbi-button cbi-button-<%=self.inputstyle or "button" %>" type="submit"<%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self.inputtitle or self.title)%> />
<% else %>
-
<% end %>
diff --git a/modules/luci-compat/luasrc/view/cbi/cell_valuefooter.htm b/modules/luci-compat/luasrc/view/cbi/cell_valuefooter.htm
index bdd6bc9687..786ee43d10 100644
--- a/modules/luci-compat/luasrc/view/cbi/cell_valuefooter.htm
+++ b/modules/luci-compat/luasrc/view/cbi/cell_valuefooter.htm
@@ -1,2 +1,2 @@
</div>
-</div>
+</td>
diff --git a/modules/luci-compat/luasrc/view/cbi/cell_valueheader.htm b/modules/luci-compat/luasrc/view/cbi/cell_valueheader.htm
index db5c66850d..31d1acee48 100644
--- a/modules/luci-compat/luasrc/view/cbi/cell_valueheader.htm
+++ b/modules/luci-compat/luasrc/view/cbi/cell_valueheader.htm
@@ -3,7 +3,7 @@
local descr = luci.util.trim(striptags(self.description))
local ftype = self.typename or (self.template and self.template:gsub("^.+/", ""))
-%>
-<div class="td cbi-value-field<% if self.error and self.error[section] then %> cbi-value-error<% end %><% if self.password then %> nowrap<% end %>"<%=
+<td class="td cbi-value-field<% if self.error and self.error[section] then %> cbi-value-error<% end %><% if self.password then %> nowrap<% end %>"<%=
attr("data-name", self.option) ..
ifattr(ftype and #ftype > 0, "data-widget", ftype) ..
ifattr(title and #title > 0, "data-title", title, true) ..
diff --git a/modules/luci-compat/luasrc/view/cbi/delegator.htm b/modules/luci-compat/luasrc/view/cbi/delegator.htm
index 4fd19265d8..2606e7f6d7 100644
--- a/modules/luci-compat/luasrc/view/cbi/delegator.htm
+++ b/modules/luci-compat/luasrc/view/cbi/delegator.htm
@@ -6,18 +6,18 @@
<% 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%>" />
+ <input class="btn 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 »%>" />
+ <input class="btn 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%>" />
+ <input class="btn 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%>" />
+ <input class="btn 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%>" />
+ <input class="btn cbi-button cbi-button-back" type="submit" name="cbi.delg.back" value="<%:« Back%>" />
<% end %>
<% end %>
<script type="text/javascript">cbi_d_update();</script>
diff --git a/modules/luci-compat/luasrc/view/cbi/error.htm b/modules/luci-compat/luasrc/view/cbi/error.htm
index 75ec1082aa..9d63f66763 100644
--- a/modules/luci-compat/luasrc/view/cbi/error.htm
+++ b/modules/luci-compat/luasrc/view/cbi/error.htm
@@ -14,6 +14,6 @@
</p>
<div class="cbi-page-actions">
- <input class="cbi-button cbi-button-apply" type="submit" name="cbi.save" value="<%:Save%>" />
+ <input class="btn cbi-button cbi-button-apply" type="submit" name="cbi.save" value="<%:Save%>" />
</div>
</div>
diff --git a/modules/luci-compat/luasrc/view/cbi/ipaddr.htm b/modules/luci-compat/luasrc/view/cbi/ipaddr.htm
index 1c924e1544..d34d8d9865 100644
--- a/modules/luci-compat/luasrc/view/cbi/ipaddr.htm
+++ b/modules/luci-compat/luasrc/view/cbi/ipaddr.htm
@@ -23,5 +23,5 @@
ifattr(self.combobox_manual, "data-manual", self.combobox_manual) ..
ifattr(#self.keylist > 0, "data-choices", { self.keylist, self.vallist })
%> /><!--
- --><button class="cbi-button cbi-button-neutral" title="<%:Switch to CIDR list notation%>" aria-label="<%:Switch to CIDR list notation%>" onclick="switchToCIDRList(event)">…</button>
+ --><button class="btn cbi-button cbi-button-neutral" title="<%:Switch to CIDR list notation%>" aria-label="<%:Switch to CIDR list notation%>" onclick="switchToCIDRList(event)">…</button>
<%+cbi/valuefooter%>
diff --git a/modules/luci-compat/luasrc/view/cbi/nsection.htm b/modules/luci-compat/luasrc/view/cbi/nsection.htm
index 14232e3d94..511a59b6f3 100644
--- a/modules/luci-compat/luasrc/view/cbi/nsection.htm
+++ b/modules/luci-compat/luasrc/view/cbi/nsection.htm
@@ -1,14 +1,14 @@
<% if self:cfgvalue(self.section) then section = self.section %>
<div class="cbi-section">
<% if self.title and #self.title > 0 then -%>
- <legend><%=self.title%></legend>
+ <h3><%=self.title%></h3>
<%- 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" class="cbi-button" name="cbi.rns.<%=self.config%>.<%=section%>" value="<%:Delete%>" />
+ <input type="submit" class="btn cbi-button" name="cbi.rns.<%=self.config%>.<%=section%>" value="<%:Delete%>" />
</div>
<%- end %>
<div class="cbi-section-node<% if self.tabs then %> cbi-section-node-tabbed<% end %>" id="cbi-<%=self.config%>-<%=section%>">
@@ -19,10 +19,10 @@
<% if self.template_addremove then include(self.template_addremove) else -%>
<div class="cbi-section" id="cbi-<%=self.config%>-<%=self.section%>">
<% if self.title and #self.title > 0 then -%>
- <legend><%=self.title%></legend>
+ <h3><%=self.title%></h3>
<%- end %>
<div class="cbi-section-descr"><%=self.description%></div>
- <input type="submit" class="cbi-button cbi-button-add" name="cbi.cns.<%=self.config%>.<%=self.section%>" value="<%:Add%>" />
+ <input type="submit" class="btn cbi-button cbi-button-add" name="cbi.cns.<%=self.config%>.<%=self.section%>" value="<%:Add%>" />
</div>
<%- end %>
<% end %>
diff --git a/modules/luci-compat/luasrc/view/cbi/nullsection.htm b/modules/luci-compat/luasrc/view/cbi/nullsection.htm
index 7230719d19..156f29d18c 100644
--- a/modules/luci-compat/luasrc/view/cbi/nullsection.htm
+++ b/modules/luci-compat/luasrc/view/cbi/nullsection.htm
@@ -1,6 +1,6 @@
<div class="cbi-section">
<% if self.title and #self.title > 0 then -%>
- <legend><%=self.title%></legend>
+ <h3><%=self.title%></h3>
<%- end %>
<% if self.description and #self.description > 0 then -%>
<div class="cbi-section-descr"><%=self.description%></div>
diff --git a/modules/luci-compat/luasrc/view/cbi/simpleform.htm b/modules/luci-compat/luasrc/view/cbi/simpleform.htm
index 3e10724ec5..9e1514546e 100644
--- a/modules/luci-compat/luasrc/view/cbi/simpleform.htm
+++ b/modules/luci-compat/luasrc/view/cbi/simpleform.htm
@@ -45,26 +45,26 @@
%><div class="cbi-page-actions"><%
if display_back then
- %><input class="cbi-button cbi-button-link" type="button" value="<%:Back to Overview%>" onclick="location.href='<%=pcdata(redirect)%>'" /> <%
+ %><input class="btn cbi-button cbi-button-link" type="button" value="<%:Back to Overview%>" onclick="location.href='<%=pcdata(redirect)%>'" /> <%
end
if display_cancel then
local label = pcdata(self.cancel or translate("Cancel"))
- %><input class="cbi-button cbi-button-link" type="button" value="<%=label%>" onclick="cbi_submit(this, 'cbi.cancel')" /> <%
+ %><input class="btn cbi-button cbi-button-link" type="button" value="<%=label%>" onclick="cbi_submit(this, 'cbi.cancel')" /> <%
end
if display_skip then
- %><input class="cbi-button cbi-button-neutral" type="button" value="<%:Skip%>" onclick="cbi_submit(this, 'cbi.skip')" /> <%
+ %><input class="btn cbi-button cbi-button-neutral" type="button" value="<%:Skip%>" onclick="cbi_submit(this, 'cbi.skip')" /> <%
end
if display_submit then
local label = pcdata(self.submit or translate("Submit"))
- %><input class="cbi-button cbi-button-save" type="submit" value="<%=label%>" /> <%
+ %><input class="btn cbi-button cbi-button-save" type="submit" value="<%=label%>" /> <%
end
if display_reset then
local label = pcdata(self.reset or translate("Reset"))
- %><input class="cbi-button cbi-button-reset" type="reset" value="<%=label%>" /> <%
+ %><input class="btn cbi-button cbi-button-reset" type="reset" value="<%=label%>" /> <%
end
%></div><%
diff --git a/modules/luci-compat/luasrc/view/cbi/tblsection.htm b/modules/luci-compat/luasrc/view/cbi/tblsection.htm
index 1e067edf38..048eb22c41 100644
--- a/modules/luci-compat/luasrc/view/cbi/tblsection.htm
+++ b/modules/luci-compat/luasrc/view/cbi/tblsection.htm
@@ -46,12 +46,12 @@ function render_titles()
return
end
- %><div class="tr cbi-section-table-titles <%=anonclass%>"<%=titlename%>><%
+ %><tr class="tr cbi-section-table-titles <%=anonclass%>"<%=titlename%>><%
local i, k
for i, k in ipairs(self.children) do
if not k.optional then
- %><div class="th cbi-section-table-cell"<%=
+ %><th class="th cbi-section-table-cell"<%=
width(k) .. attr('data-widget', k.typename) %>><%
if k.titleref then
@@ -64,15 +64,15 @@ function render_titles()
%></a><%
end
- %></div><%
+ %></th><%
end
end
if self.sortable or self.extedit or self.addremove then
- %><div class="th cbi-section-table-cell cbi-section-actions"></div><%
+ %><th class="th cbi-section-table-cell cbi-section-actions"></th><%
end
- %></div><%
+ %></tr><%
rowcnt = rowcnt + 1
end
@@ -82,25 +82,25 @@ function render_descriptions()
return
end
- %><div class="tr cbi-section-table-descr <%=anonclass%>"><%
+ %><tr class="tr cbi-section-table-descr <%=anonclass%>"><%
local i, k
for i, k in ipairs(self.children) do
if not k.optional then
- %><div class="th cbi-section-table-cell"<%=
+ %><th class="th cbi-section-table-cell"<%=
width(k) .. attr("data-widget", k.typename) %>><%
write(k.description)
- %></div><%
+ %></th><%
end
end
if self.sortable or self.extedit or self.addremove then
- %><div class="th cbi-section-table-cell cbi-section-actions"></div><%
+ %><th class="th cbi-section-table-cell cbi-section-actions"></th><%
end
- %></div><%
+ %></tr><%
rowcnt = rowcnt + 1
end
@@ -116,7 +116,7 @@ end
<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="table cbi-section-table">
+ <table class="table cbi-section-table">
<%-
render_titles()
render_descriptions()
@@ -134,7 +134,7 @@ end
valuefooter = "cbi/cell_valuefooter"
}
-%>
- <div class="tr cbi-section-table-row<%=colorclass%>" id="cbi-<%=self.config%>-<%=section%>"<%=sectiontitle%>>
+ <tr class="tr cbi-section-table-row<%=colorclass%>" id="cbi-<%=self.config%>-<%=section%>"<%=sectiontitle%>>
<%-
local node
for k, node in ipairs(self.children) do
@@ -145,13 +145,13 @@ end
-%>
<%- if self.sortable or self.extedit or self.addremove then -%>
- <div class="td cbi-section-table-cell nowrap cbi-section-actions">
+ <td class="td cbi-section-table-cell nowrap cbi-section-actions">
<div>
<%- if self.sortable then -%>
- <input class="cbi-button cbi-button-up" type="button" value="<%:Up%>" onclick="return cbi_row_swap(this, true, 'cbi.sts.<%=self.config%>.<%=self.sectiontype%>')" title="<%:Move up%>" />
- <input class="cbi-button cbi-button-down" type="button" value="<%:Down%>" onclick="return cbi_row_swap(this, false, 'cbi.sts.<%=self.config%>.<%=self.sectiontype%>')" title="<%:Move down%>" />
+ <input class="btn cbi-button cbi-button-up" type="button" value="<%:Up%>" onclick="return cbi_row_swap(this, true, 'cbi.sts.<%=self.config%>.<%=self.sectiontype%>')" title="<%:Move up%>" />
+ <input class="btn cbi-button cbi-button-down" type="button" value="<%:Down%>" onclick="return cbi_row_swap(this, false, 'cbi.sts.<%=self.config%>.<%=self.sectiontype%>')" title="<%:Move down%>" />
<% end; if self.extedit then -%>
- <input class="cbi-button cbi-button-edit" type="button" value="<%:Edit%>"
+ <input class="btn 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
@@ -159,20 +159,20 @@ end
<%- 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%>" />
+ <input class="btn 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 -%>
</div>
- </div>
+ </td>
<%- end -%>
- </div>
+ </tr>
<%- end -%>
<%- if isempty then -%>
- <div class="tr cbi-section-table-row placeholder">
- <div class="td"><em><%:This section contains no values yet%></em></div>
- </div>
+ <tr class="tr cbi-section-table-row placeholder">
+ <td class="td"><em><%:This section contains no values yet%></em></td>
+ </tr>
<%- end -%>
- </div>
+ </table>
<% if self.error then %>
<div class="cbi-section-error">
@@ -186,7 +186,7 @@ end
<% 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%>" />
+ <input class="btn 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"><%:Invalid%></div>
@@ -194,7 +194,7 @@ end
<div>
<input type="text" class="cbi-section-create-name" id="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" data-type="uciname" data-optional="true" />
</div>
- <input class="cbi-button cbi-button-add" type="submit" onclick="this.form.cbi_state='add-section'; return true" value="<%:Add%>" title="<%:Add%>" />
+ <input class="btn cbi-button cbi-button-add" type="submit" onclick="this.form.cbi_state='add-section'; return true" value="<%:Add%>" title="<%:Add%>" />
<% end %>
</div>
<%- end %>
diff --git a/modules/luci-compat/luasrc/view/cbi/tsection.htm b/modules/luci-compat/luasrc/view/cbi/tsection.htm
index 8f3b7f0ffb..45e51cc69f 100644
--- a/modules/luci-compat/luasrc/view/cbi/tsection.htm
+++ b/modules/luci-compat/luasrc/view/cbi/tsection.htm
@@ -1,6 +1,6 @@
<div class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
<% if self.title and #self.title > 0 then -%>
- <legend><%=self.title%></legend>
+ <h3><%=self.title%></h3>
<%- end %>
<% if self.error_msg and #self.error_msg > 0 then -%>
<div class="cbi-section-error">
@@ -13,7 +13,7 @@
<% 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" />
+ <input type="submit" name="cbi.rts.<%=self.config%>.<%=k%>" onclick="this.form.cbi_state='del-section'; return true" value="<%:Delete%>" class="btn cbi-button" />
</div>
<%- end %>
@@ -36,7 +36,7 @@
<% 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%>" />
+ <input type="submit" class="btn 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"><%:Invalid%></div>
@@ -44,7 +44,7 @@
<div>
<input type="text" class="cbi-section-create-name" id="cbi.cts.<%=self.config%>.<%=self.sectiontype%>." name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>." data-type="uciname" data-optional="true" />
</div>
- <input class="cbi-button cbi-button-add" type="submit" onclick="this.form.cbi_state='add-section'; return true" value="<%:Add%>" title="<%:Add%>" />
+ <input class="btn cbi-button cbi-button-add" type="submit" onclick="this.form.cbi_state='add-section'; return true" value="<%:Add%>" title="<%:Add%>" />
<%- end %>
</div>
<%- end %>
diff --git a/modules/luci-compat/luasrc/view/cbi/ucisection.htm b/modules/luci-compat/luasrc/view/cbi/ucisection.htm
index 8fa11d68f8..930d41583e 100644
--- a/modules/luci-compat/luasrc/view/cbi/ucisection.htm
+++ b/modules/luci-compat/luasrc/view/cbi/ucisection.htm
@@ -51,6 +51,6 @@
<%- end %>
</select>
<%- end -%>
- <input type="submit" class="cbi-button cbi-button-fieldadd" value="<%:Add%>" />
+ <input type="submit" class="btn cbi-button cbi-button-fieldadd" value="<%:Add%>" />
</div>
<% end %>