diff options
Diffstat (limited to 'modules/luci-mod-system/htdocs/luci-static/resources')
-rw-r--r-- | modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js index 8661181781..6c67859f12 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js @@ -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); |