summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-diag-devinfo/luasrc/view/diag
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2014-12-03 15:17:05 +0100
committerJo-Philipp Wich <jow@openwrt.org>2015-01-08 16:26:20 +0100
commit1bb4822dca6113f73e3bc89e2acf15935e6f8e92 (patch)
tree35e16f100466e4e00657199b38bb3d87d52bf73f /applications/luci-app-diag-devinfo/luasrc/view/diag
parent9edd0e46c3f880727738ce8ca6ff1c8b85f99ef4 (diff)
Rework LuCI build system
* Rename subdirectories to their repective OpenWrt package names * Make each LuCI module its own standalone package * Deploy a shared luci.mk which is used by each module Makefile Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'applications/luci-app-diag-devinfo/luasrc/view/diag')
-rw-r--r--applications/luci-app-diag-devinfo/luasrc/view/diag/smapsection.htm137
-rw-r--r--applications/luci-app-diag-devinfo/luasrc/view/diag/smapvalue.htm21
2 files changed, 158 insertions, 0 deletions
diff --git a/applications/luci-app-diag-devinfo/luasrc/view/diag/smapsection.htm b/applications/luci-app-diag-devinfo/luasrc/view/diag/smapsection.htm
new file mode 100644
index 0000000000..742f659575
--- /dev/null
+++ b/applications/luci-app-diag-devinfo/luasrc/view/diag/smapsection.htm
@@ -0,0 +1,137 @@
+<%#
+LuCI - Lua Configuration Interface
+(c) 2009 Daniel Dickinson
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+-%>
+<%-
+local rowcnt = 1
+function rowstyle()
+ rowcnt = rowcnt + 1
+ return (rowcnt % 2) + 1
+end
+-%>
+
+<!-- smapsection -->
+<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>
+ <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>&#160;</th>
+ <%- end -%>
+ <%- end -%>
+ <%- for i, k in pairs(self.children) do if not k.optional then -%>
+ <th class="cbi-section-table-cell">
+ <%- 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.extedit or self.addremove then -%>
+ <th class="cbi-section-table-cell">&#160;</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"><%=k.description%></th>
+ <%- end; 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><%=k%></h3></th>
+ <%- end %>
+
+ <%- for k, node in ipairs(self.children) do -%>
+ <%- if not node.optional then -%>
+ <%- nodevalue = node:cfgvalue(section) -%>
+ <%- if nodevalue and ( nodevalue ~= "" ) and string.find(nodevalue, 'http://', 1, plain) then
+ node.href = nodevalue
+ node.template = "diag/smapvalue"
+ end
+ -%>
+ <%- node:render(section, scope or {}) -%>
+ <%- end -%>
+ <%- end -%>
+
+ <%- if self.extedit or self.addremove then -%>
+ <td class="cbi-section-table-cell">
+ <%- if self.extedit then -%>
+ <a href="
+ <%- if type(self.extedit) == "string" then -%>
+ <%=self.extedit:format(section)%>
+ <%- elseif type(self.extedit) == "function" then -%>
+ <%=self:extedit(section)%>
+ <%- end -%>
+ " title="<%:Edit%>"><img style="border: none" src="<%=resource%>/cbi/edit.gif" alt="<%:Edit%>" /></a>
+ <%- end; if self.addremove then %>
+ <input type="image" value="<%:Delete%>" name="cbi.rts.<%=self.config%>.<%=k%>" alt="<%:Delete%>" title="<%:Delete%>" src="<%=resource%>/cbi/remove.gif" />
+ <%- 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><%=luci.util.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-smapsection-create">
+ <% if self.anonymous then %>
+ <input class="cbi-button cbi-button-add" type="submit" value="<%:Add%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" title="<%:Add%>" />
+ <% else %>
+ <% if self.invalid_cts then -%><div class="cbi-section-error"><% end %>
+ <input type="text" class="cbi-section-create-name" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" />
+ <input class="cbi-button cbi-button-add" type="submit" value="<%:Add%>" title="<%:Add%>" />
+ <% if self.invalid_cts then -%>
+ <br /><%:Invalid%></div>
+ <%- end %>
+ <% end %>
+ </div>
+ <%- end %>
+ <%- end -%>
+ </div>
+</fieldset>
+<!-- /smapsection -->
diff --git a/applications/luci-app-diag-devinfo/luasrc/view/diag/smapvalue.htm b/applications/luci-app-diag-devinfo/luasrc/view/diag/smapvalue.htm
new file mode 100644
index 0000000000..60aa70a300
--- /dev/null
+++ b/applications/luci-app-diag-devinfo/luasrc/view/diag/smapvalue.htm
@@ -0,0 +1,21 @@
+<%#
+LuCI - Lua Configuration Interface
+(c) 2009 Daniel Dickinson
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+-%>
+
+<%+cbi/valueheader%>
+<% if self.href then %><a href="<%=self.href%>" target="_blank"><% end -%>
+ <%=luci.util.pcdata(self:cfgvalue(section))%>
+<%- if self.href then %></a><%end%>
+&#160;
+<input type="hidden" id="<%=cbid%>" value="<%=luci.util.pcdata(self:cfgvalue(section))%>" />
+<%+cbi/valuefooter%>