upgrade_confirm.html 2.0 KB

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