modules/admin-full: add missing class attributes
[project/luci.git] / modules / admin-full / luasrc / view / admin_system / packages.htm
index 0b00324..51a1211 100644 (file)
@@ -24,11 +24,6 @@ function rowstyle()
        return (rowcnt % 2) + 1
 end
 
-function opkg_error(code)
-       code = bit.rshift(tonumber(code), 8)
-       return translate("OPKG error code %i" % code)
-end
-
 local fstat = fs.statvfs(opkg.overlay_root())
 local space_total = fstat and fstat.blocks or 0
 local space_free  = fstat and fstat.bfree  or 0
@@ -37,6 +32,8 @@ local space_used  = space_total - space_free
 local used_perc = math.floor(0.5 + ((space_total > 0) and ((100 / space_total) * space_used) or 100))
 local free_byte = space_free * fstat.frsize
 
+local filter = { }
+
 -%>
 <%+header%>
 <h2><a id="content" name="content"><%:System%> - <%:Software%></a></h2>
@@ -54,7 +51,7 @@ local free_byte = space_free * fstat.frsize
                                        <label class="cbi-value-title"><%:Download and install package%>:</label>
                                        <div class="cbi-value-field">
                                                <input type="text" name="url" size="30" value="" />
-                                               <input class="cbi-input-save" type="submit" name="submit" value="<%:OK%>" />
+                                               <input class="cbi-button cbi-input-save" type="submit" name="submit" value="<%:OK%>" />
                                        </div>
                                </div>
 
@@ -62,7 +59,7 @@ local free_byte = space_free * fstat.frsize
                                        <label class="cbi-value-title"><%:Filter%>:</label>
                                        <div class="cbi-value-field">
                                                <input type="text" name="query" size="20" value="<%=pcdata(query)%>" />
-                                               <input type="submit" class="cbi-input-find" name="search" value="<%:Find package%>" />
+                                               <input type="submit" class="cbi-button cbi-input-find" name="search" value="<%:Find package%>" />
                                        </div>
                                </div>
                        </fieldset>
@@ -73,23 +70,13 @@ local free_byte = space_free * fstat.frsize
                <fieldset class="cbi-section">
                        <%:Free space%>: <strong><%=(100-used_perc)%>%</strong> (<strong><%=wa.byte_format(free_byte)%></strong>)
                        <div style="margin:3px 0; width:300px; height:10px; border:1px solid #000000; background-color:#80C080">
-                               <div style="background-color:#F08080; border-right:1px solid #000000; height:100%; width:<%=used_perc%>%">&nbsp;</div>
+                               <div style="background-color:#F08080; border-right:1px solid #000000; height:100%; width:<%=used_perc%>%">&#160;</div>
                        </div>
 
                        <% if (install and next(install)) or (remove and next(remove)) or update or upgrade then %>
                                <br /><hr /><br />
-                               <% if update then %>
-                                       <%:Package lists updated%>: <% if update == 0 then %><span class="ok"><%:OK%></span><% else %><span class="error"><%:Error%> (<%=opkg_error(update)%>)</span><% end %><br />
-                               <% end %>
-                               <% if upgrade then%>
-                                       <%:Upgrade installed packages%>: <% if upgrade == 0 then %><span class="ok"><%:OK%></span><% else %><span class="error"><%:Error%> (<%=opkg_error(upgrade)%>)</span><% end %><br />
-                               <% end %>
-                               <% if install then for k,v in pairs(install) do %>
-                                       <%:Install%> '<%=k%>': <% if v == 0 then %><span class="ok"><%:OK%></span><% else %><span class="error"><%:Error%> (<%=opkg_error(v)%>)</span><% end %><br />
-                               <% end end %>
-                               <% if remove then for k,v in pairs(remove) do %>
-                                       <%:Remove%> '<%=k%>': <% if v == 0 then %><span class="ok"><%:OK%></span><% else %><span class="error"><%:Error%> (<%=opkg_error(v)%>)</span><% end %><br />
-                               <% end end %>
+                               <% if #stdout > 0 then %><pre><%=pcdata(stdout)%></pre><% end %>
+                               <% if #stderr > 0 then %><pre class="error"><%=pcdata(stderr)%></pre><% end %>
                        <% end %>
                </fieldset>
                <br />
@@ -99,11 +86,11 @@ local free_byte = space_free * fstat.frsize
                <fieldset class="cbi-section">
                        <table class="cbi-section-table" style="width:100%">
                                <tr class="cbi-section-table-titles">
-                                       <th class="cbi-section-table-cell" style="text-align:left">&nbsp;</th>
+                                       <th class="cbi-section-table-cell" style="text-align:left">&#160;</th>
                                        <th class="cbi-section-table-cell" style="text-align:left"><%:Package name%></th>
                                        <th class="cbi-section-table-cell" style="text-align:left"><%:Version%></th>
                                </tr>
-                               <% local empty = true; luci.model.ipkg.list_installed(query, function(n, v, d) empty = false %>
+                               <% local empty = true; luci.model.ipkg.list_installed(query, function(n, v, d) empty = false; filter[n] = true %>
                                <tr class="cbi-section-table-row cbi-rowstyle-<%=rowstyle()%>">
                                        <td style="text-align:left; width:10%"><a onclick="return window.confirm('<%:Remove%> &quot;<%=luci.util.pcdata(n)%>&quot; ?')" href="<%=REQUEST_URI%>?submit=1&amp;remove=<%=luci.util.pcdata(n)%>"><%:Remove%></a></td>
                                        <td style="text-align:left"><%=luci.util.pcdata(n)%></td>
@@ -112,7 +99,7 @@ local free_byte = space_free * fstat.frsize
                                <% end) %>
                                <% if empty then %>
                                <tr class="cbi-section-table-row">
-                                       <td style="text-align:left">&nbsp;</td>
+                                       <td style="text-align:left">&#160;</td>
                                        <td style="text-align:left"><em><%:none%></em></td>
                                        <td style="text-align:left"><em><%:none%></em></td>
                                </tr>
@@ -127,12 +114,12 @@ local free_byte = space_free * fstat.frsize
                <fieldset class="cbi-section">
                        <table class="cbi-section-table" style="width:100%">
                                <tr class="cbi-section-table-titles">
-                                       <th class="cbi-section-table-cell" style="text-align:left">&nbsp;</th>
+                                       <th class="cbi-section-table-cell" style="text-align:left">&#160;</th>
                                        <th class="cbi-section-table-cell" style="text-align:left"><%:Package name%></th>
                                        <th class="cbi-section-table-cell" style="text-align:left"><%:Version%></th>
                                        <th class="cbi-section-table-cell" style="text-align:left"><%:Description%></th>
                                </tr>
-                               <% local empty = true; luci.model.ipkg.list_all(query, function(n, v, d) empty = false %>
+                               <% local empty = true; luci.model.ipkg.list_all(query, function(n, v, d) if filter[n] then return end; empty = false %>
                                <tr class="cbi-section-table-row cbi-rowstyle-<%=rowstyle()%>">
                                        <td style="text-align:left; width:10%"><a onclick="return window.confirm('<%:Install%> &quot;<%=luci.util.pcdata(n)%>&quot; ?')" href="<%=REQUEST_URI%>?submit=1&amp;install=<%=luci.util.pcdata(n)%>"><%:Install%></a></td>
                                        <td style="text-align:left"><%=luci.util.pcdata(n)%></td>
@@ -142,7 +129,7 @@ local free_byte = space_free * fstat.frsize
                                <% end) %>
                                <% if empty then %>
                                <tr class="cbi-section-table-row">
-                                       <td style="text-align:left">&nbsp;</td>
+                                       <td style="text-align:left">&#160;</td>
                                        <td style="text-align:left"><em><%:none%></em></td>
                                        <td style="text-align:left"><em><%:none%></em></td>
                                        <td style="text-align:left"><em><%:none%></em></td>