mirror of
https://github.com/Waujito/youtubeUnblock.git
synced 2026-01-31 14:40:36 +03:00
Update UI for luci-app status
This commit is contained in:
@@ -52,6 +52,12 @@ function handleAction(act, event) {
|
|||||||
} else {
|
} else {
|
||||||
fs.exec_direct('/etc/init.d/youtubeUnblock', [ 'disable' ]).then(thn_inc);
|
fs.exec_direct('/etc/init.d/youtubeUnblock', [ 'disable' ]).then(thn_inc);
|
||||||
}
|
}
|
||||||
|
} else if (act == "reset_configs") {
|
||||||
|
fs.exec_direct('/usr/share/youtubeUnblock/youtubeUnblock_defaults.sh', [ '--force' ])
|
||||||
|
.then(function() {
|
||||||
|
fs.exec_direct('/etc/init.d/youtubeUnblock', [ 'restart' ])
|
||||||
|
.then(thn_disp);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
unroll_inact(event.target);
|
unroll_inact(event.target);
|
||||||
}
|
}
|
||||||
@@ -210,15 +216,25 @@ return view.extend({
|
|||||||
return handleAction('fw_reload', event);
|
return handleAction('fw_reload', event);
|
||||||
})
|
})
|
||||||
}, [ _('Firewall reload') ]),
|
}, [ _('Firewall reload') ]),
|
||||||
|
'\xa0\xa0\xa0',
|
||||||
|
E('button', {
|
||||||
|
'class': 'btn cbi-button cbi-button-negative',
|
||||||
|
'id': 'btn_reset_configs',
|
||||||
|
'click': ui.createHandlerFn(this, function(event) {
|
||||||
|
return handleAction('reset_configs', event);
|
||||||
|
})
|
||||||
|
}, [ _('Reset configuration') ]),
|
||||||
|
|
||||||
])
|
])
|
||||||
]);
|
]);
|
||||||
}, o, this);
|
}, o, this);
|
||||||
|
|
||||||
const logs_s = m.section(form.NamedSection, 'ytb_logs');
|
const logs_s = m.section(form.NamedSection, 'ytb_logs', _("Logs"), _("If you want to scroll logs, disable refreshing by clicking the button in the upper right corner of the screen"));
|
||||||
logs_s.render = L.bind(function(view, section_id) {
|
logs_s.render = L.bind(function(view, section_id) {
|
||||||
return E('div', { class: 'cbi-map' },
|
return E('div', { class: 'cbi-map' },
|
||||||
E('div', { class: 'cbi-section' }, [
|
E('div', { class: 'cbi-section' }, [
|
||||||
E('div', { class: 'cbi-section-descr' }, _('The syslog output, pre-filtered for messages related to: youtubeUnblock')),
|
E('h3', _('Logs')),
|
||||||
|
E('div', { class: 'cbi-section-descr' }, _('If you want to scroll logs, disable refreshing by clicking the button in the upper right corner of the screen')),
|
||||||
E('textarea', {
|
E('textarea', {
|
||||||
'id': 'ytb_logger',
|
'id': 'ytb_logger',
|
||||||
'style': 'width: 100% !important; padding: 5px; font-family: monospace',
|
'style': 'width: 100% !important; padding: 5px; font-family: monospace',
|
||||||
|
|||||||
@@ -14,7 +14,8 @@
|
|||||||
"/etc/init.d/firewall reload" : [ "exec" ],
|
"/etc/init.d/firewall reload" : [ "exec" ],
|
||||||
"/usr/bin/youtubeUnblock --version" : [ "exec" ],
|
"/usr/bin/youtubeUnblock --version" : [ "exec" ],
|
||||||
"/sbin/logread -e youtubeUnblock -l [0-9]*": [ "exec" ],
|
"/sbin/logread -e youtubeUnblock -l [0-9]*": [ "exec" ],
|
||||||
"/usr/sbin/logread -e youtubeUnblock -l [0-9]*": [ "exec" ]
|
"/usr/sbin/logread -e youtubeUnblock -l [0-9]*": [ "exec" ],
|
||||||
|
"/usr/share/youtubeUnblock/youtubeUnblock_defaults.sh --force": [ "exec" ]
|
||||||
},
|
},
|
||||||
"uci": [ "youtubeUnblock" ]
|
"uci": [ "youtubeUnblock" ]
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user