mirror of https://github.com/openwrt/luci.git
luci-mod-system: flash.js: add mtdblock name to filename
When you download a partition, the name is hostname+mtdX.bin and that can be confusing if you go back and try to remember what mtdX was if you have 10+ partitions. So let us add the partition name to the filename like: hostname.mtdX.boot.bin hostname.mtdX.firmware.bin Note: If there is a better, easier and simpler way to do the same thing, please let me know. Signed-off-by: Kristian Skramstad <kristian+github@83.no>pull/7124/head
parent
05c6a0887f
commit
08b8b1d0e3
|
@ -170,15 +170,17 @@ return view.extend({
|
|||
},
|
||||
|
||||
handleBlock: function(hostname, ev) {
|
||||
var mtdblock = dom.parent(ev.target, '.cbi-section').querySelector('[data-name="mtdselect"] select').value;
|
||||
var mtdblock = dom.parent(ev.target, '.cbi-section').querySelector('[data-name="mtdselect"] select');
|
||||
var mtdnumber = mtdblock.value;
|
||||
var mtdname = mtdblock.selectedOptions[0].text;
|
||||
var form = E('form', {
|
||||
'method': 'post',
|
||||
'action': L.env.cgi_base + '/cgi-download',
|
||||
'enctype': 'application/x-www-form-urlencoded'
|
||||
}, [
|
||||
E('input', { 'type': 'hidden', 'name': 'sessionid', 'value': rpc.getSessionID() }),
|
||||
E('input', { 'type': 'hidden', 'name': 'path', 'value': '/dev/mtdblock%d'.format(mtdblock) }),
|
||||
E('input', { 'type': 'hidden', 'name': 'filename', 'value': '%s.mtd%d.bin'.format(hostname, mtdblock) })
|
||||
E('input', { 'type': 'hidden', 'name': 'path', 'value': '/dev/mtdblock%d'.format(mtdnumber) }),
|
||||
E('input', { 'type': 'hidden', 'name': 'filename', 'value': '%s.mtd%d.%s.bin'.format(hostname, mtdnumber, mtdname) })
|
||||
]);
|
||||
|
||||
ev.currentTarget.parentNode.appendChild(form);
|
||||
|
|
Loading…
Reference in New Issue