luci/modules/admin-full/luasrc/view/admin_system/upgrade.htm
2008-09-18 21:26:34 +00:00

61 lines
No EOL
1.6 KiB
HTML

<%#
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id$
-%>
<%+header%>
<h1><%:system%></h1>
<h2><%:a_s_flash%></h2>
<p><%:a_s_flash_upgrade1%></p>
<br />
<% if next(blocks) and not next(flash) then %>
<form method="post" action="<%=REQUEST_URI%>" enctype="multipart/form-data">
<div class="left"><%:a_s_flash_fwimage%>:</div>
<div>
<% for name, v in pairs(blocks) do %>
<%=name%>: <input type="file" size="30" name="<%=name%>" /><br />
<% end %>
<br />
<% if keep_avail then -%>
<input type="checkbox" name="keepcfg" value="1" checked="checked" />
<span class="bold"><%:a_s_flash_keepcfg%></span>
<% end -%>
</div>
<div>
<input type="submit" value="<%:a_s_flash_fwupgrade%>" />
</div>
</form>
<% elseif next(flash) then %>
<p><%:a_s_flash_received%></p>
<% reboot.exec = false
for i, entry in ipairs(flash) do
local name, func = entry.name, entry.func %>
<%:a_s_flash_inprogress%> <%=name%>...
<%=string.rep(" ", 32*1024)%>
<%
local stat, code = func()
reboot.exec = reboot.exec or stat
if stat and code then %>
<%:ok%><br />
<% else %>
<%:a_s_flash_flasherr%>! (<%:code%> <%=code%>)<br />
<% end %>
<% if reboot.exec then %>
<br />
<div><%:a_s_flash_flashed%></div>
<% end %>
<% end %>
<% else %>
<div class="error"><%:a_s_flash_notimplemented%></div>
<% end %>
<%+footer%>