2011-10-24 01:10:34 +00:00
< %#
2015-01-16 22:38:38 +00:00
Copyright 2008 Steven Barth < steven @ midlink . org >
2015-10-20 19:01:41 +00:00
Copyright 2008-2015 Jo-Philipp Wich < jow @ openwrt . org >
2015-01-16 22:38:38 +00:00
Licensed to the public under the Apache License 2.0.
2011-10-24 01:10:34 +00:00
-%>
< %+header%>
2015-10-06 11:29:43 +00:00
< h2 name = "content" > < %:Flash operations%>< / h2 >
2011-10-24 01:10:34 +00:00
< ul class = "cbi-tabmenu" >
< li class = "cbi-tab" > < a href = "#" > < %:Actions%>< / a > < / li >
2018-05-15 13:02:24 +00:00
< li class = "cbi-tab-disabled" > < a href = "<%=url('admin/system/flashops/backupfiles')%>" > < %:Configuration%>< / a > < / li >
2011-10-24 01:10:34 +00:00
< / ul >
2018-06-19 15:17:04 +00:00
< div class = "cbi-section" >
2018-07-03 15:58:00 +00:00
< h3 > < %:Backup%>< / h3 >
< div class = "cbi-section-descr" > < %:Click "Generate archive" to download a tar archive of the current configuration files.%>< / div >
2018-06-19 15:17:04 +00:00
< div class = "cbi-section-node" >
< form class = "inline" method = "post" action = "<%=url('admin/system/flashops/backup')%>" >
< input type = "hidden" name = "token" value = "<%=token%>" / >
< div class = "cbi-value<% if not reset_avail then %> cbi-value-last<% end %>" >
2018-08-17 10:52:36 +00:00
< label class = "cbi-value-title" for = "image" > < %:Download backup%>< / label >
2018-06-19 15:17:04 +00:00
< div class = "cbi-value-field" >
< input class = "cbi-button cbi-button-action important" type = "submit" name = "backup" value = "<%:Generate archive%>" / >
2011-10-24 01:10:34 +00:00
< / div >
2018-06-19 15:17:04 +00:00
< / div >
< / form >
2018-07-03 15:58:00 +00:00
< / div >
< h3 > < %:Restore%>< / h3 >
< div class = "cbi-section-descr" > < %:To restore configuration files, you can upload a previously generated backup archive here. To reset the firmware to its initial state, click "Perform reset" (only possible with squashfs images).%>< / div >
< div class = "cbi-section-node" >
2018-01-24 13:57:08 +00:00
< % if reset_avail then %>
2018-06-19 15:17:04 +00:00
< form class = "inline" method = "post" action = "<%=url('admin/system/flashops/reset')%>" >
< input type = "hidden" name = "token" value = "<%=token%>" / >
< div class = "cbi-value cbi-value-last" >
2018-08-17 10:52:36 +00:00
< label class = "cbi-value-title" > < %:Reset to defaults%>< / label >
2018-06-19 15:17:04 +00:00
< div class = "cbi-value-field" >
< input onclick = "return confirm('<%:Really reset all changes?%>')" class = "cbi-button cbi-button-reset" type = "submit" name = "reset" value = "<%:Perform reset%>" / >
< / div >
< / div >
< / form >
2018-01-24 13:57:08 +00:00
< % end %>
2018-06-19 15:17:04 +00:00
< form class = "inline" method = "post" action = "<%=url('admin/system/flashops/restore')%>" enctype = "multipart/form-data" >
< div class = "cbi-value cbi-value-last" >
2018-08-17 10:52:36 +00:00
< label class = "cbi-value-title" for = "archive" > < %:Restore backup%>< / label >
2018-06-19 15:17:04 +00:00
< div class = "cbi-value-field" >
< input type = "hidden" name = "token" value = "<%=token%>" / >
< input type = "file" name = "archive" id = "archive" / >
< input type = "submit" class = "cbi-button cbi-button-action important" name = "restore" value = "<%:Upload archive...%>" / >
2018-07-03 15:58:00 +00:00
< % if reset_avail then %>
< div class = "cbi-value-description" > < %:Custom files (certificates, scripts) may remain on the system. To prevent this, perform a factory-reset first.%>< / div >
< % end %>
2018-06-19 15:17:04 +00:00
< / div >
< / div >
< / form >
2018-05-15 09:35:40 +00:00
< % if backup_invalid then %>
< div class = "cbi-section-error" > < %:The backup archive does not appear to be a valid gzip file.%>< / div >
< % end %>
2018-06-19 15:17:04 +00:00
< / div >
2018-09-08 07:07:01 +00:00
< % local mtds = require("luci.sys").mtds(); if #mtds > 0 then -%>
< h3 > < %:Save mtdblock contents%>< / h3 >
< div class = "cbi-section-descr" > < %:Click "Save mtdblock" to download specified mtdblock file. (NOTE: THIS FEATURE IS FOR PROFESSIONALS! )%>< / div >
< div class = "cbi-section-node" >
< form class = "inline" method = "post" action = "<%=url('admin/system/flashops/backupmtdblock')%>" >
< input type = "hidden" name = "token" value = "<%=token%>" / >
< div class = "cbi-value" >
< label class = "cbi-value-title" for = "mtdblockname" > < %:Choose mtdblock%>< / label >
< div class = "cbi-value-field" >
< select class = "cbi-input-select" data-update = "change" name = "mtdblockname" id = "mtdblockname" >
< % for i, key in ipairs(mtds) do
if key and key.name ~= "rootfs_data" then -%>
< option < % =
attr("id", "mtdblockname-" .. key.name) ..
attr("value", key.name .. '/'.. key.size .. '/' .. i - 1) ..
attr("data-index", i) ..
ifattr(key.name == "linux" or key.name == "firmware", "selected", "selected")
%>>< %=pcdata(key.name)%>< / option >
< % end
end -%>
< / select >
< / div >
< / div >
< div class = "cbi-value cbi-value-last<% if reset_avail then %> cbi-value-error<% end %>" >
< label class = "cbi-value-title" for = "image" > < %:Download mtdblock%>< / label >
< div class = "cbi-value-field" >
< input type = "submit" class = "cbi-button cbi-button-action important" value = "<%:Save mtdblock%>" / >
< / div >
< / div >
< / form >
< / div >
< % end %>
2018-06-19 15:17:04 +00:00
< / div >
2011-10-24 01:10:34 +00:00
2018-06-19 15:17:04 +00:00
< div class = "cbi-section" >
2018-07-02 06:45:02 +00:00
< h3 > < %:Flash new firmware image%>< / h3 >
2018-06-19 15:17:04 +00:00
< % if upgrade_avail then %>
< form method = "post" action = "<%=url('admin/system/flashops/sysupgrade')%>" enctype = "multipart/form-data" >
< input type = "hidden" name = "token" value = "<%=token%>" / >
< div class = "cbi-section-descr" > < %:Upload a sysupgrade-compatible image here to replace the running firmware. Check "Keep settings" to retain the current configuration (requires a compatible firmware image).%>< / div >
< div class = "cbi-section-node" >
< div class = "cbi-value" >
2018-08-17 10:52:36 +00:00
< label class = "cbi-value-title" for = "keep" > < %:Keep settings%>< / label >
2018-06-19 15:17:04 +00:00
< div class = "cbi-value-field" >
< input type = "checkbox" name = "keep" id = "keep" checked = "checked" / >
2011-10-24 01:10:34 +00:00
< / div >
2018-06-19 15:17:04 +00:00
< / div >
2018-08-17 10:52:36 +00:00
< % if image_invalid then %>
< div class = "cbi-value" >
< label class = "cbi-value-title" for = "force" > < %:Force upgrade%>< / label >
< div class = "cbi-value-field" >
< input type = "checkbox" name = "force" id = "force" / >
< / div >
< div class = "cbi-section-error" >
< %:The uploaded image file does not contain a supported format. Make sure that you choose the generic image format for your platform. %>
< %:Select 'Force upgrade' to flash the image even if the image format check fails. Use only if you are sure that the firmware is correct and meant for your device! %>
< / div >
< / div >
< % end %>
2018-06-19 15:17:04 +00:00
< div class = "cbi-value cbi-value-last<% if image_invalid then %> cbi-value-error<% end %>" >
2018-08-17 10:52:36 +00:00
< label class = "cbi-value-title" for = "image" > < %:Image%>< / label >
2018-06-19 15:17:04 +00:00
< div class = "cbi-value-field" >
< input type = "file" name = "image" id = "image" / >
< input type = "submit" class = "cbi-button cbi-button-action important" value = "<%:Flash image...%>" / >
2011-10-24 01:10:34 +00:00
< / div >
< / div >
2018-06-19 15:17:04 +00:00
< / div >
< / form >
< % else %>
< div class = "cbi-section-descr" > < %:Sorry, there is no sysupgrade support present; a new firmware image must be flashed manually. Please refer to the wiki for device specific install instructions.%>< / div >
< % end %>
< / div >
2011-10-24 01:10:34 +00:00
< %+footer%>