luci-mod-system: flash.js: disable mtdblock downloads on mtd-less systems

Ref: 3c40a7450a (commitcomment-35233073)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2019-09-25 19:42:06 +02:00
parent e17cd94be7
commit 855208c59d

View file

@ -508,20 +508,22 @@ return L.view.extend({
o.onclick = L.bind(this.handleRestore, this);
o = s.option(form.SectionValue, 'actions', form.NamedSection, 'actions', 'actions', _('Save mtdblock contents'), _('Click "Save mtdblock" to download specified mtdblock file. (NOTE: THIS FEATURE IS FOR PROFESSIONALS! )'));
ss = o.subsection;
if (procmtd.length) {
o = s.option(form.SectionValue, 'actions', form.NamedSection, 'actions', 'actions', _('Save mtdblock contents'), _('Click "Save mtdblock" to download specified mtdblock file. (NOTE: THIS FEATURE IS FOR PROFESSIONALS! )'));
ss = o.subsection;
o = ss.option(form.ListValue, 'mtdselect', _('Choose mtdblock'));
procmtd.split(/\n/).forEach(function(ln) {
var match = ln.match(/^mtd(\d+): .+ "(.+?)"$/);
if (match)
o.value(match[1], match[2]);
});
o = ss.option(form.ListValue, 'mtdselect', _('Choose mtdblock'));
procmtd.split(/\n/).forEach(function(ln) {
var match = ln.match(/^mtd(\d+): .+ "(.+?)"$/);
if (match)
o.value(match[1], match[2]);
});
o = ss.option(form.Button, 'mtddownload', _('Download mtdblock'));
o.inputstyle = 'action important';
o.inputtitle = _('Save mtdblock');
o.onclick = L.bind(this.handleBlock, this, hostname);
o = ss.option(form.Button, 'mtddownload', _('Download mtdblock'));
o.inputstyle = 'action important';
o.inputtitle = _('Save mtdblock');
o.onclick = L.bind(this.handleBlock, this, hostname);
}
o = s.option(form.SectionValue, 'actions', form.NamedSection, 'actions', 'actions', _('Flash new firmware image'),