luci-mod-system: disable redundant page actions in crontab, startup views
authorJo-Philipp Wich <jo@mein.io>
Wed, 18 Sep 2019 05:23:01 +0000 (07:23 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 18 Sep 2019 05:23:01 +0000 (07:23 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-mod-system/htdocs/luci-static/resources/view/system/crontab.js
modules/luci-mod-system/htdocs/luci-static/resources/view/system/startup.js

index c8baa472292596a95fea30ee0805ce55179ca1b8..286155790a08ae7ebb099e75e4c49ab25a13f3ae 100644 (file)
@@ -40,13 +40,10 @@ return L.view.extend({
                        E('p', {},
                                _('This is the system crontab in which scheduled tasks can be defined.') +
                                _('<br/>Note: you need to manually restart the cron service if the crontab file was empty before editing.')),
-                       E('p', {}, E('textarea', { 'style': 'width:100%', 'rows': 10 }, crontab != null ? crontab : '')),
-                       E('div', { 'class': 'right' }, [
-                               E('button', {
-                                       'class': 'btn cbi-button-positive important',
-                                       'click': L.ui.createHandlerFn(this, 'handleSave')
-                               }, _('Save'))
-                       ])
+                       E('p', {}, E('textarea', { 'style': 'width:100%', 'rows': 10 }, crontab != null ? crontab : ''))
                ]);
-       }
+       },
+
+       handleSaveApply: null,
+       handleReset: null
 });
index 3c026e0889ca527056e095d36d276bcfb28c19c3..365e6c8ed8fc8a3f4a75539224e606157bbed73f 100644 (file)
@@ -55,7 +55,7 @@ return L.view.extend({
                }, this, name, !isEnabled, ev.currentTarget.parentNode));
        },
 
-       handleSave: function(ev) {
+       handleRcLocalSave: function(ev) {
                var value = (document.querySelector('textarea').value || '').trim().replace(/\r\n/g, '\n') + '\n';
 
                return this.callFileWrite('/etc/rc.local', value).then(function(rc) {
@@ -126,10 +126,10 @@ return L.view.extend({
                                E('div', { 'data-tab': 'rc', 'data-tab-title': _('Local Startup') }, [
                                        E('p', {}, _('This is the content of /etc/rc.local. Insert your own commands here (in front of \'exit 0\') to execute them at the end of the boot process.')),
                                        E('p', {}, E('textarea', { 'style': 'width:100%', 'rows': 20 }, rcLocal != null ? rcLocal : '')),
-                                       E('div', { 'class': 'right' }, [
+                                       E('div', { 'class': 'cbi-page-actions' }, [
                                                E('button', {
-                                                       'class': 'btn cbi-button-positive important',
-                                                       'click': L.ui.createHandlerFn(this, 'handleSave')
+                                                       'class': 'btn cbi-button-save',
+                                                       'click': L.ui.createHandlerFn(this, 'handleRcLocalSave')
                                                }, _('Save'))
                                        ])
                                ])
@@ -139,5 +139,9 @@ return L.view.extend({
                L.ui.tabs.initTabGroup(view.lastElementChild.childNodes);
 
                return view;
-       }
+       },
+
+       handleSaveApply: null,
+       handleSave: null,
+       handleReset: null
 });