<%# LuCI - Lua Configuration Interface Copyright 2008 Steven Barth Copyright 2008 Jo-Philipp Wich 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 bit = require "bit" local rowcnt = 1 function rowstyle() rowcnt = rowcnt + 1 return (rowcnt % 2) + 1 end function opkg_error(code) code = bit.rshift(tonumber(code), 8) return translate("OPKG error code %i" % code) end -%> <%+header%>

<%:System%>

<%:Software%>


<% if install or remove or update or upgrade then %>
<%:Status%>:
<% if update then %> <%:Package lists updated%>: <% if update == 0 then %><%:OK%><% else %><%:Error%> (<%=opkg_error(update)%>)<% end %>
<% end %> <% if upgrade then%> <%:Upgrade installed packages%>: <% if upgrade == 0 then %><%:OK%><% else %><%:Error%> (<%=opkg_error(upgrade)%>)<% end %>
<% end %> <% if install then for k,v in pairs(install) do %> <%:Install%> '<%=k%>': <% if v == 0 then %><%:OK%><% else %><%:Error%> (<%=opkg_error(v)%>)<% end %>
<% end end %> <% if remove then for k,v in pairs(remove) do %> <%:Remove%> '<%=k%>': <% if v == 0 then %><%:OK%><% else %><%:Error%> (<%=opkg_error(v)%>)<% end %>
<% end end %>

<% end %>

<% for k, pkg in pairs(pkgs) do %> <% end %>
<%:Package name%> <%:Version%> <%:Install%> <%:Delete%> <%:Description%>
<%=luci.util.pcdata(pkg.Package)%> <%=luci.util.pcdata(pkg.Version)%> <% if not pkg.Status or not pkg.Status.installed then %><% else %><%:installed%><% end %> <% if pkg.Status and pkg.Status.installed then %><% else %><%:not installed%><% end %> <%=luci.util.pcdata(pkg.Description)%>

<%+footer%>