Merge pull request #3804 from dibdot/adb-fixes
luci-app-adblock: small visual tweaks for OpenWrt 2020
This commit is contained in:
commit
5dc4b459c8
2 changed files with 32 additions and 29 deletions
|
@ -8,9 +8,9 @@
|
||||||
function handleAction(ev) {
|
function handleAction(ev) {
|
||||||
if (ev.target && ev.target.getAttribute('name') === 'blacklist') {
|
if (ev.target && ev.target.getAttribute('name') === 'blacklist') {
|
||||||
L.ui.showModal(_('Add Blacklist Domain'), [
|
L.ui.showModal(_('Add Blacklist Domain'), [
|
||||||
E('p', {}, _('Add this (sub-)domain to your local blacklist.')),
|
E('p', _('Add this (sub-)domain to your local blacklist.')),
|
||||||
E('div', { 'class': 'left' }, [
|
E('div', { 'class': 'left', 'style': 'display:flex; flex-direction:column' }, [
|
||||||
E('label', { 'class': 'cbi-input-text', 'style': 'float:left; padding-top:.5em' }, [
|
E('label', { 'class': 'cbi-input-text', 'style': 'padding-top:.5em' }, [
|
||||||
E('input', { 'class': 'cbi-input-text', 'style': 'width:300px', 'id': 'blacklist', 'value': ev.target.getAttribute('value') }, [])
|
E('input', { 'class': 'cbi-input-text', 'style': 'width:300px', 'id': 'blacklist', 'value': ev.target.getAttribute('value') }, [])
|
||||||
])
|
])
|
||||||
]),
|
]),
|
||||||
|
@ -43,9 +43,9 @@ function handleAction(ev) {
|
||||||
|
|
||||||
if (ev.target && ev.target.getAttribute('name') === 'whitelist') {
|
if (ev.target && ev.target.getAttribute('name') === 'whitelist') {
|
||||||
L.ui.showModal(_('Add Whitelist Domain'), [
|
L.ui.showModal(_('Add Whitelist Domain'), [
|
||||||
E('p', {}, _('Add this (sub-)domain to your local whitelist.')),
|
E('p', _('Add this (sub-)domain to your local whitelist.')),
|
||||||
E('div', { 'class': 'left' }, [
|
E('div', { 'class': 'left', 'style': 'display:flex; flex-direction:column' }, [
|
||||||
E('label', { 'class': 'cbi-input-text', 'style': 'float:left; padding-top:.5em' }, [
|
E('label', { 'class': 'cbi-input-text', 'style': 'padding-top:.5em' }, [
|
||||||
E('input', { 'class': 'cbi-input-text', 'style': 'width:300px', 'id': 'whitelist', 'value': ev.target.getAttribute('value') }, [])
|
E('input', { 'class': 'cbi-input-text', 'style': 'width:300px', 'id': 'whitelist', 'value': ev.target.getAttribute('value') }, [])
|
||||||
])
|
])
|
||||||
]),
|
]),
|
||||||
|
@ -78,9 +78,9 @@ function handleAction(ev) {
|
||||||
|
|
||||||
if (ev === 'query') {
|
if (ev === 'query') {
|
||||||
L.ui.showModal(_('Blocklist Query'), [
|
L.ui.showModal(_('Blocklist Query'), [
|
||||||
E('p', {}, _('Query active blocklists and backups for a specific domain.')),
|
E('p', _('Query active blocklists and backups for a specific domain.')),
|
||||||
E('div', { 'class': 'left' }, [
|
E('div', { 'class': 'left', 'style': 'display:flex; flex-direction:column' }, [
|
||||||
E('label', { 'style': 'float:left; padding-top:.5em', 'id': 'run' }, [
|
E('label', { 'style': 'padding-top:.5em', 'id': 'run' }, [
|
||||||
E('input', {
|
E('input', {
|
||||||
'class': 'cbi-input-text',
|
'class': 'cbi-input-text',
|
||||||
'placeholder': 'google.com',
|
'placeholder': 'google.com',
|
||||||
|
@ -89,7 +89,8 @@ function handleAction(ev) {
|
||||||
})
|
})
|
||||||
])
|
])
|
||||||
]),
|
]),
|
||||||
E('div', { 'class': 'left' }, [
|
E('div', { 'class': 'left', 'style': 'display:flex; flex-direction:column' }, [
|
||||||
|
'\xa0',
|
||||||
E('h5', _('Result')),
|
E('h5', _('Result')),
|
||||||
E('textarea', {
|
E('textarea', {
|
||||||
'id': 'result',
|
'id': 'result',
|
||||||
|
@ -134,7 +135,8 @@ function handleAction(ev) {
|
||||||
|
|
||||||
if (ev === 'refresh') {
|
if (ev === 'refresh') {
|
||||||
L.ui.showModal(_('Refresh DNS Report'), [
|
L.ui.showModal(_('Refresh DNS Report'), [
|
||||||
E('div', { 'class': 'left' }, [
|
E('div', { 'class': 'left', 'style': 'display:flex; flex-direction:column' }, [
|
||||||
|
E('label', { 'class': 'cbi-input-select', 'style': 'padding-top:.5em' }, [
|
||||||
E('select', { 'class': 'cbi-input-select', 'id': 'count' }, [
|
E('select', { 'class': 'cbi-input-select', 'id': 'count' }, [
|
||||||
E('option', { 'value': '50' }, '50'),
|
E('option', { 'value': '50' }, '50'),
|
||||||
E('option', { 'value': '100' }, '100'),
|
E('option', { 'value': '100' }, '100'),
|
||||||
|
@ -144,8 +146,9 @@ function handleAction(ev) {
|
||||||
]),
|
]),
|
||||||
'\xa0\xa0\xa0',
|
'\xa0\xa0\xa0',
|
||||||
_('max. result set size')
|
_('max. result set size')
|
||||||
|
])
|
||||||
]),
|
]),
|
||||||
E('label', { 'class': 'cbi-input-text', 'style': 'float:left; padding-top:.5em' }, [
|
E('label', { 'class': 'cbi-input-text', 'style': 'padding-top:.5em' }, [
|
||||||
E('input', { 'class': 'cbi-input-text', 'id': 'search' }, [
|
E('input', { 'class': 'cbi-input-text', 'id': 'search' }, [
|
||||||
]),
|
]),
|
||||||
'\xa0\xa0\xa0',
|
'\xa0\xa0\xa0',
|
||||||
|
@ -161,7 +164,7 @@ function handleAction(ev) {
|
||||||
'class': 'btn cbi-button-action',
|
'class': 'btn cbi-button-action',
|
||||||
'id': 'refresh',
|
'id': 'refresh',
|
||||||
'click': ui.createHandlerFn(this, async function(ev) {
|
'click': ui.createHandlerFn(this, async function(ev) {
|
||||||
var count = document.getElementById('count').value
|
var count = document.getElementById('count').value;
|
||||||
var search = document.getElementById('search').value.trim().replace(/[^a-z0-9\.\-]/g,'') || '+';
|
var search = document.getElementById('search').value.trim().replace(/[^a-z0-9\.\-]/g,'') || '+';
|
||||||
L.resolveDefault(fs.exec_direct('/etc/init.d/adblock', ['report', search, count, 'true', 'json']),'');
|
L.resolveDefault(fs.exec_direct('/etc/init.d/adblock', ['report', search, count, 'true', 'json']),'');
|
||||||
var running = 1;
|
var running = 1;
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
async function handleAction(ev) {
|
async function handleAction(ev) {
|
||||||
if (ev === 'timer') {
|
if (ev === 'timer') {
|
||||||
L.ui.showModal(_('Refresh Timer'), [
|
L.ui.showModal(_('Refresh Timer'), [
|
||||||
E('p', {}, _('To keep your adblock lists up-to-date, you should setup an automatic update job for these lists.')),
|
E('p', _('To keep your adblock lists up-to-date, you should setup an automatic update job for these lists.')),
|
||||||
E('div', { 'class': 'left' }, [
|
E('div', { 'class': 'left', 'style': 'display:flex; flex-direction:column' }, [
|
||||||
E('h5', _('Existing job(s)')),
|
E('h5', _('Existing job(s)')),
|
||||||
E('textarea', {
|
E('textarea', {
|
||||||
'id': 'cronView',
|
'id': 'cronView',
|
||||||
|
@ -22,8 +22,8 @@ async function handleAction(ev) {
|
||||||
'rows': 5
|
'rows': 5
|
||||||
})
|
})
|
||||||
]),
|
]),
|
||||||
E('div', { 'class': 'left' }, [
|
E('div', { 'class': 'left', 'style': 'display:flex; flex-direction:column' }, [
|
||||||
E('label', { 'class': 'cbi-input-select', 'style': 'float:left; padding-top:.5em' }, [
|
E('label', { 'class': 'cbi-input-select', 'style': 'padding-top:.5em' }, [
|
||||||
E('h5', _('Set/Replace a new adblock job')),
|
E('h5', _('Set/Replace a new adblock job')),
|
||||||
E('select', { 'class': 'cbi-input-select', 'id': 'timerA' }, [
|
E('select', { 'class': 'cbi-input-select', 'id': 'timerA' }, [
|
||||||
E('option', { 'value': 'start' }, 'Start'),
|
E('option', { 'value': 'start' }, 'Start'),
|
||||||
|
@ -33,18 +33,18 @@ async function handleAction(ev) {
|
||||||
'\xa0\xa0\xa0',
|
'\xa0\xa0\xa0',
|
||||||
_('Adblock action')
|
_('Adblock action')
|
||||||
]),
|
]),
|
||||||
E('label', { 'class': 'cbi-input-text', 'style': 'float:left; padding-top:.5em' }, [
|
E('label', { 'class': 'cbi-input-text', 'style': 'padding-top:.5em' }, [
|
||||||
E('input', { 'class': 'cbi-input-text', 'id': 'timerH', 'maxlength': '2' }, [
|
E('input', { 'class': 'cbi-input-text', 'id': 'timerH', 'maxlength': '2' }, [
|
||||||
]),
|
]),
|
||||||
'\xa0\xa0\xa0',
|
'\xa0\xa0\xa0',
|
||||||
_('The hours portition (req., range: 0-23)')
|
_('The hours portition (req., range: 0-23)')
|
||||||
]),
|
]),
|
||||||
E('label', { 'class': 'cbi-input-text', 'style': 'float:left; padding-top:.5em' }, [
|
E('label', { 'class': 'cbi-input-text', 'style': 'padding-top:.5em' }, [
|
||||||
E('input', { 'class': 'cbi-input-text', 'id': 'timerM', 'maxlength': '2' }),
|
E('input', { 'class': 'cbi-input-text', 'id': 'timerM', 'maxlength': '2' }),
|
||||||
'\xa0\xa0\xa0',
|
'\xa0\xa0\xa0',
|
||||||
_('The minutes portion (opt., range: 0-59)')
|
_('The minutes portion (opt., range: 0-59)')
|
||||||
]),
|
]),
|
||||||
E('label', { 'class': 'cbi-input-text', 'style': 'float:left; padding-top:.5em' }, [
|
E('label', { 'class': 'cbi-input-text', 'style': 'padding-top:.5em' }, [
|
||||||
E('input', { 'class': 'cbi-input-text', 'id': 'timerD', 'maxlength': '13' }),
|
E('input', { 'class': 'cbi-input-text', 'id': 'timerD', 'maxlength': '13' }),
|
||||||
'\xa0\xa0\xa0',
|
'\xa0\xa0\xa0',
|
||||||
_('The day of the week (opt., values: 1-7 possibly sep. by , or -)')
|
_('The day of the week (opt., values: 1-7 possibly sep. by , or -)')
|
||||||
|
|
Loading…
Reference in a new issue