upgrade.htm 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <%#
  2. Copyright 2008 Steven Barth <steven@midlink.org>
  3. Copyright 2008-2009 Jo-Philipp Wich <jow@openwrt.org>
  4. Licensed to the public under the Apache License 2.0.
  5. -%>
  6. <%+header%>
  7. <h2 name="content"><%:System%></h2>
  8. <h3><%:Flash Firmware%></h3>
  9. <% if step == 1 then %>
  10. <% if supported then %>
  11. <form method="post" action="<%=REQUEST_URI%>" enctype="multipart/form-data">
  12. <p>
  13. <%:Upload a sysupgrade-compatible image file to reflash the device.%>
  14. <% if bad_image then %>
  15. <br /><br />
  16. <div class="error"><%:The uploaded image file does not
  17. contain a supported format. Make sure that you choose the generic
  18. image format for your platform. %></div>
  19. <% end %>
  20. </p>
  21. <div>
  22. <%:Firmware image%>:<br />
  23. <input type="hidden" name="step" value="2" />
  24. <input type="file" size="30" name="image" />
  25. <br />
  26. <br />
  27. <% if keepavail then -%>
  28. <input type="checkbox" name="keepcfg" value="1" checked="checked" />
  29. <span class="bold"><%:Keep configuration files%></span>
  30. <% end -%>
  31. <br />
  32. <input class="cbi-button cbi-button-apply" type="submit" value="<%:Upload image%>" />
  33. </div>
  34. </form>
  35. <% else %>
  36. <div class="error"><%_ Sorry.
  37. A system upgrade is not supported on this platform.<br />
  38. You need to manually flash your device. %></div>
  39. <% end %>
  40. <% elseif step == 2 then %>
  41. <p>
  42. <%_ The flash image was uploaded.
  43. Below is the checksum and file size listed,
  44. compare them with the original file to ensure data integrity.<br />
  45. Click "Proceed" below to start the flash procedure. %>
  46. <% if flashsize > 0 and filesize > flashsize then %>
  47. <br /><br />
  48. <div class="error"><%:It appears that you are trying to
  49. flash an image that does not fit into the flash memory, please verify
  50. the image file! %></div>
  51. <% end %>
  52. <br />
  53. <ul>
  54. <li><%:Checksum%>: <code><%=checksum%></code></li>
  55. <li><%:Size%>: <%
  56. local w = require "luci.tools.webadmin"
  57. write(w.byte_format(filesize))
  58. if flashsize > 0 then
  59. write(luci.i18n.translatef(
  60. " (%s available)",
  61. w.byte_format(flashsize)
  62. ))
  63. end
  64. %></li>
  65. </ul>
  66. </p>
  67. <div class="cbi-page-actions right">
  68. <form style="display:inline">
  69. <input type="hidden" name="step" value="3" />
  70. <input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>" />
  71. <input class="cbi-button cbi-button-apply" type="submit" value="<%:Proceed%>" />
  72. </form>
  73. <form style="display:inline">
  74. <input type="hidden" name="step" value="1" />
  75. <input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>" />
  76. <input class="cbi-button cbi-button-reset" type="submit" value="<%:Cancel%>" />
  77. </form>
  78. </div>
  79. <% elseif step == 3 then %>
  80. <p><%_ The system is flashing now.<br />
  81. DO NOT POWER OFF THE DEVICE!<br />
  82. Wait a few minutes before you try to reconnect.
  83. It might be necessary to renew the address of your computer to reach the device
  84. again, depending on your settings. %></p>
  85. <iframe src="<%=REQUEST_URI%>?step=4&#38;keepcfg=<%=keepconfig and "1" or "0"%>" style="border:1px solid black; width:100%; height:150px"></iframe>
  86. <% end %>
  87. <%+footer%>