Luci opkg/packages: Show package size in list of available packages
[project/luci.git] / modules / luci-mod-admin-full / luasrc / view / admin_system / packages.htm
index 00b4be4..fe2fe04 100644 (file)
@@ -1,17 +1,10 @@
 <%#
-LuCI - Lua Configuration Interface
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008-2010 Jo-Philipp Wich <xm@subsignal.org>
-
-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
-
+ Copyright 2008 Steven Barth <steven@midlink.org>
+ Copyright 2008-2010 Jo-Philipp Wich <jow@openwrt.org>
+ Licensed to the public under the Apache License 2.0.
 -%>
+
 <%-
-local bit = require "bit"
 local opkg = require "luci.model.ipkg"
 local fs = require "nixio.fs"
 local wa = require "luci.tools.webadmin"
@@ -139,7 +132,7 @@ end
                                                <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(querypat, function(n, v, d) empty = false; filter[n] = true %>
+                                       <% local empty = true; luci.model.ipkg.list_installed(querypat, function(n, v, s, 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>
@@ -171,13 +164,15 @@ end
                                                <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:right"><%:Size (.ipk)%></th>
                                                <th class="cbi-section-table-cell" style="text-align:left"><%:Description%></th>
                                        </tr>
-                                       <% local empty = true; opkg_list(querypat or letterpat, function(n, v, d) if filter[n] then return end; empty = false %>
+                                       <% local empty = true; opkg_list(querypat or letterpat, function(n, v, s, 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>
                                                <td style="text-align:left"><%=luci.util.pcdata(v)%></td>
+                                               <td style="text-align:right"><%=luci.util.pcdata(s)%></td>
                                                <td style="text-align:left"><%=luci.util.pcdata(d)%></td>
                                        </tr>
                                        <% end) %>
@@ -186,6 +181,7 @@ end
                                                <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:right"><em><%:none%></em></td>
                                                <td style="text-align:left"><em><%:none%></em></td>
                                        </tr>
                                        <% end %>