summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-system/htdocs
diff options
context:
space:
mode:
Diffstat (limited to 'modules/luci-mod-system/htdocs')
-rw-r--r--modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js28
1 files changed, 15 insertions, 13 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 bea587625..08c97650e 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
@@ -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;
-
- 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]);
- });
+ 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.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'),