upgrade_confirm.htm 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <%#
  2. LuCI - Lua Configuration Interface
  3. Copyright 2008 Steven Barth <steven@midlink.org>
  4. Copyright 2008-2009 Jo-Philipp Wich <xm@subsignal.org>
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. $Id$
  10. -%>
  11. <%+header%>
  12. <h2><%:Upgrade firmware%></h2>
  13. <p>
  14. <%:The firmware image has been transmitted. Please ensure the MD5 checksum and image size are correct and click "continue".%>
  15. </p>
  16. <% if flashsize > 0 and filesize > flashsize then %>
  17. <p class="error"><%:The firmware is too big for your device's storage.%></p>
  18. <% end %>
  19. <p>
  20. <ul>
  21. <li>md5sum: <code><%=checksum%></code></li>
  22. <li><%:Size%>: <%
  23. function byte_format(byte)
  24. local suff = {"B", "KB", "MB", "GB", "TB"}
  25. for i=1, 5 do
  26. if byte > 1024 and i < 5 then
  27. byte = byte / 1024
  28. else
  29. return string.format("%.2f %s", byte, suff[i])
  30. end
  31. end
  32. end
  33. write(byte_format(filesize))
  34. if flashsize > 0 then
  35. write(luci.i18n.translatef(
  36. " (%s available)",
  37. byte_format(flashsize)
  38. ))
  39. end
  40. %></li>
  41. </ul>
  42. </p>
  43. <div class="cbi-page-actions">
  44. <form method="post" action="<%=REQUEST_URI%>" style="display:inline">
  45. <input type="hidden" name="step" value="3" />
  46. <input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>" />
  47. <input type="hidden" name="token" value="<%=token%>" />
  48. <input class="cbi-button cbi-button-apply" type="submit" value="<%:Continue%>" />
  49. </form>
  50. <form method="post" action="<%=REQUEST_URI%>" style="display:inline">
  51. <input type="hidden" name="step" value="1" />
  52. <input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>" />
  53. <input type="hidden" name="token" value="<%=token%>" />
  54. <input class="cbi-button cbi-button-reset" type="submit" value="<%:Cancel%>" />
  55. </form>
  56. </div>
  57. <%+footer%>