diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-03-28 20:15:53 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-03-28 20:15:53 +0000 |
commit | e4a3fd177c9ff4dc9113af22a72e930f257514ea (patch) | |
tree | 56bca777351ba7e530190924fa4782ed6f0da458 /modules/admin-full/luasrc/view/admin_system | |
parent | 275470fe6315dbaf5fde99f2dc5bba8dd63e2743 (diff) |
modules/admin-full: improve opkg error reporting
Diffstat (limited to 'modules/admin-full/luasrc/view/admin_system')
-rw-r--r-- | modules/admin-full/luasrc/view/admin_system/packages.htm | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/modules/admin-full/luasrc/view/admin_system/packages.htm b/modules/admin-full/luasrc/view/admin_system/packages.htm index 084dab2fe..b52529ea8 100644 --- a/modules/admin-full/luasrc/view/admin_system/packages.htm +++ b/modules/admin-full/luasrc/view/admin_system/packages.htm @@ -13,11 +13,24 @@ $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( + 'a_s_packages_code%i' % code, + translate( + 'a_s_packages_code%i' % code, + '%s %i' % { translate('code'), code } + ) + ) +end -%> <%+header%> <h2><a id="content" name="content"><%:system%></a></h2> @@ -28,16 +41,16 @@ end <% if install or remove or update or upgrade then %> <div class="code"><strong><%:status%>:</strong><br /> <% if update then %> - <%:a_s_packages_update%>: <% if update == 0 then %><span class="ok"><%:ok%></span><% else %><span class="error"><%:error%> (<%:code%> <%=update%>)</span><% end %><br /> + <%:a_s_packages_update%>: <% if update == 0 then %><span class="ok"><%:ok%></span><% else %><span class="error"><%:error%> (<%=opkg_error(update)%>)</span><% end %><br /> <% end %> <% if upgrade then%> - <%:a_s_packages_upgrade%>: <% if upgrade == 0 then %><span class="ok"><%:ok%></span><% else %><span class="error"><%:error%> (<%:code%> <%=upgrade%>)</span><% end %><br /> + <%:a_s_packages_upgrade%>: <% 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 %> - <%:a_s_packages_install%> '<%=k%>': <% if v == 0 then %><span class="ok"><%:ok%></span><% else %><span class="error"><%:error%> (<%:code%> <%=v%>)</span><% end %><br /> + <%:a_s_packages_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 %> - <%:a_s_packages_remove%> '<%=k%>': <% if v == 0 then %><span class="ok"><%:ok%></span><% else %><span class="error"><%:error%> (<%:code%> <%=v%>)</span><% end %><br /> + <%:a_s_packages_remove%> '<%=k%>': <% if v == 0 then %><span class="ok"><%:ok%></span><% else %><span class="error"><%:error%> (<%=opkg_error(v)%>)</span><% end %><br /> <% end end %> </div> <br /> |