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:
parent
e17cd94be7
commit
855208c59d
1 changed files with 14 additions and 12 deletions
|
@ -508,20 +508,22 @@ return L.view.extend({
|
||||||
o.onclick = L.bind(this.handleRestore, this);
|
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! )'));
|
if (procmtd.length) {
|
||||||
ss = o.subsection;
|
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'));
|
o = ss.option(form.ListValue, 'mtdselect', _('Choose mtdblock'));
|
||||||
procmtd.split(/\n/).forEach(function(ln) {
|
procmtd.split(/\n/).forEach(function(ln) {
|
||||||
var match = ln.match(/^mtd(\d+): .+ "(.+?)"$/);
|
var match = ln.match(/^mtd(\d+): .+ "(.+?)"$/);
|
||||||
if (match)
|
if (match)
|
||||||
o.value(match[1], match[2]);
|
o.value(match[1], match[2]);
|
||||||
});
|
});
|
||||||
|
|
||||||
o = ss.option(form.Button, 'mtddownload', _('Download mtdblock'));
|
o = ss.option(form.Button, 'mtddownload', _('Download mtdblock'));
|
||||||
o.inputstyle = 'action important';
|
o.inputstyle = 'action important';
|
||||||
o.inputtitle = _('Save mtdblock');
|
o.inputtitle = _('Save mtdblock');
|
||||||
o.onclick = L.bind(this.handleBlock, this, hostname);
|
o.onclick = L.bind(this.handleBlock, this, hostname);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
o = s.option(form.SectionValue, 'actions', form.NamedSection, 'actions', 'actions', _('Flash new firmware image'),
|
o = s.option(form.SectionValue, 'actions', form.NamedSection, 'actions', 'actions', _('Flash new firmware image'),
|
||||||
|
|
Loading…
Reference in a new issue