upgrade.htm 3.3 KB

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