diff --git a/autoinstall/autoinstall.sh b/autoinstall/autoinstall.sh
index 85fede1..b8862c4 100755
--- a/autoinstall/autoinstall.sh
+++ b/autoinstall/autoinstall.sh
@@ -10,6 +10,8 @@ LUCI_APP=1
OWRT_VERSION="19.07"
RUAB_VERSION="0.9.0-1"
+RUAB_MOD_LUA_VERSION="0.9.0-1"
+RUAB_LUCI_APP_VERSION="0.9.0-2"
BASE_URL="https://raw.githubusercontent.com/gSpotx2f/ruantiblock_openwrt/master"
PKG_DIR="/tmp"
@@ -21,9 +23,9 @@ fi
### packages
URL_RUAB_PKG="${BASE_URL}/packages/${OWRT_VERSION}/ruantiblock_${RUAB_VERSION}_all.ipk"
-URL_MOD_LUA_PKG="${BASE_URL}/packages/${OWRT_VERSION}/ruantiblock-mod-lua_${RUAB_VERSION}_all.ipk"
-URL_LUCI_APP_PKG="${BASE_URL}/packages/${OWRT_VERSION}/luci-app-ruantiblock_${RUAB_VERSION}_all.ipk"
-URL_LUCI_APP_RU_PKG="${BASE_URL}/packages/${OWRT_VERSION}/luci-i18n-ruantiblock-ru_${RUAB_VERSION}_all.ipk"
+URL_MOD_LUA_PKG="${BASE_URL}/packages/${OWRT_VERSION}/ruantiblock-mod-lua_${RUAB_MOD_LUA_VERSION}_all.ipk"
+URL_LUCI_APP_PKG="${BASE_URL}/packages/${OWRT_VERSION}/luci-app-ruantiblock_${RUAB_LUCI_APP_VERSION}_all.ipk"
+URL_LUCI_APP_RU_PKG="${BASE_URL}/packages/${OWRT_VERSION}/luci-i18n-ruantiblock-ru_${RUAB_LUCI_APP_VERSION}_all.ipk"
### tor
URL_TORRC="${BASE_URL}/tor/etc/tor/torrc"
### ruantiblock-mod-lua
@@ -40,9 +42,9 @@ DATA_DIR_RAM="/var/ruantiblock"
RC_LOCAL="/etc/rc.local"
### packages
FILE_RUAB_PKG="${PKG_DIR}/ruantiblock_${RUAB_VERSION}_all.ipk"
-FILE_MOD_LUA_PKG="${PKG_DIR}/ruantiblock-mod-lua_${RUAB_VERSION}_all.ipk"
-FILE_LUCI_APP_PKG="${PKG_DIR}/luci-app-ruantiblock_${RUAB_VERSION}_all.ipk"
-FILE_LUCI_APP_RU_PKG="${PKG_DIR}/luci-i18n-ruantiblock-ru_${RUAB_VERSION}_all.ipk"
+FILE_MOD_LUA_PKG="${PKG_DIR}/ruantiblock-mod-lua_${RUAB_MOD_LUA_VERSION}_all.ipk"
+FILE_LUCI_APP_PKG="${PKG_DIR}/luci-app-ruantiblock_${RUAB_LUCI_APP_VERSION}_all.ipk"
+FILE_LUCI_APP_RU_PKG="${PKG_DIR}/luci-i18n-ruantiblock-ru_${RUAB_LUCI_APP_VERSION}_all.ipk"
### ruantiblock
FILE_CONFIG="${RUAB_CFG_DIR}/ruantiblock.conf"
FILE_FQDN_FILTER="${RUAB_CFG_DIR}/fqdn_filter"
diff --git a/luci-app-ruantiblock/Makefile b/luci-app-ruantiblock/Makefile
index 1821eec..eaa1ef4 100644
--- a/luci-app-ruantiblock/Makefile
+++ b/luci-app-ruantiblock/Makefile
@@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk
PKG_VERSION:=0.9.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
LUCI_TITLE:=LuCI support for ruantiblock
LUCI_DEPENDS:=+ruantiblock +luci-mod-admin-full
LUCI_PKGARCH:=all
diff --git a/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/cron.js b/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/cron.js
index db4b56e..7652f8f 100644
--- a/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/cron.js
+++ b/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/cron.js
@@ -94,7 +94,6 @@ function onchange_hour_interval(e) {
cron_hour.disabled = bool;
cron_day_interval.disabled = bool;
- // For luci-theme-material
if(bool) {
cron_hour.style.opacity = '50%';
cron_day_interval.style.opacity = '50%';
@@ -121,7 +120,7 @@ return L.view.extend({
let cron_status = E('textarea', {
'id': 'cron_status',
'name': 'cron_status',
- 'style': 'width:30em; padding:5px 10px 5px 10px !important; vertical-align:middle; resize:none !important;',
+ 'style': 'width:100% !important; padding:5px 10px 5px 10px !important; resize:none !important;',
'readonly': 'readonly',
'wrap': 'off',
'rows': 2,
@@ -139,7 +138,11 @@ return L.view.extend({
E('div', { 'class': 'cbi-value' }, [
E('label', { 'class': 'cbi-value-title', 'for': 'cron_status' },
_('Current schedule')),
- E('div', { 'class': 'cbi-value-field' }, [ cron_status, ' ', btn_cron_del ]),
+ E('div', { 'class': 'cbi-value-field' }, cron_status),
+ ]),
+ E('div', { 'class': 'cbi-value' }, [
+ E('label', { 'class': 'cbi-value-title', 'for': 'btn_cron_del' }),
+ E('div', { 'class': 'cbi-value-field' }, btn_cron_del),
])
]);
diff --git a/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/info.js b/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/info.js
index 4b9b03d..2e3b047 100644
--- a/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/info.js
+++ b/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/info.js
@@ -105,23 +105,23 @@ return L.view.extend({
if(data.last_blacklist_update.status) {
update_status.append(
E('div', { 'class': 'tr' }, [
- E('div', { 'class': 'td left', 'width': '33%' },
- _('Last blacklist update')),
+ E('div', { 'class': 'td left', 'style': 'min-width:33%' },
+ _('Last blacklist update') + ':'),
E('div', { 'class': 'td left', 'id': 'last_blacklist_update.date' },
data.last_blacklist_update.date),
]),
E('div', { 'class': 'tr' }, [
- E('div', { 'class': 'td left', 'width': '33%' }, 'IP'),
+ E('div', { 'class': 'td left' }, 'IP:'),
E('div', { 'class': 'td left', 'id': 'last_blacklist_update.ip' },
data.last_blacklist_update.ip),
]),
E('div', { 'class': 'tr' }, [
- E('div', { 'class': 'td left', 'width': '33%' }, 'CIDR'),
+ E('div', { 'class': 'td left' }, 'CIDR:'),
E('div', { 'class': 'td left', 'id': 'last_blacklist_update.cidr' },
data.last_blacklist_update.cidr),
]),
E('div', { 'class': 'tr' }, [
- E('div', { 'class': 'td left', 'width': '33%' }, 'FQDN'),
+ E('div', { 'class': 'td left' }, 'FQDN:'),
E('div', { 'class': 'td left', 'id': 'last_blacklist_update.fqdn' },
data.last_blacklist_update.fqdn),
])
@@ -129,7 +129,7 @@ return L.view.extend({
} else {
update_status.append(
E('div', { 'class': 'tr' }, [
- E('div', { 'class': 'td left', 'width': '33%' },
+ E('div', { 'class': 'td left' },
_('Last blacklist update')),
E('div', { 'class': 'td left' }, _('No data')),
])
@@ -139,7 +139,7 @@ return L.view.extend({
if(data.iptables) {
let table_iptables = E('div', { 'class': 'table' }, [
E('div', { 'class': 'tr table-titles' }, [
- E('div', { 'class': 'th left', 'width': '33%' },
+ E('div', { 'class': 'th left', 'style': 'min-width:33%' },
_('Match-set')),
E('div', { 'class': 'th left' }, _('Bytes')),
]),
@@ -150,10 +150,15 @@ return L.view.extend({
table_iptables.append(
E('div', { 'class': 'tr' }, [
- E('div', { 'class': 'td left', 'width': '33%' },
- k),
- E('div', { 'class': 'td left', 'id': 'iptables.' + k },
- v),
+ E('div', {
+ 'class': 'td left',
+ 'data-title': _('Match-set'),
+ }, k),
+ E('div', {
+ 'class': 'td left',
+ 'id': 'iptables.' + k,
+ 'data-title': _('Bytes'),
+ }, v),
])
);
};
@@ -167,7 +172,7 @@ return L.view.extend({
if(data.ipset) {
let table_ipset = E('div', { 'class': 'table' },
E('div', { 'class': 'tr table-titles' }, [
- E('div', { 'class': 'th left', 'width': '33%' }, _('Name')),
+ E('div', { 'class': 'th left', 'style': 'min-width:33%' }, _('Name')),
E('div', { 'class': 'th left' }, _('Size in memory')),
E('div', { 'class': 'th left' }, _('Number of entries')),
])
@@ -178,11 +183,20 @@ return L.view.extend({
table_ipset.append(
E('div', { 'class': 'tr' }, [
- E('div', { 'class': 'td left', 'width': '33%' }, k),
- E('div', { 'class': 'td left', 'id': 'ipset.' + k + '.' + '0' },
- v[0]),
- E('div', { 'class': 'td left', 'id': 'ipset.' + k + '.' + '1' },
- v[1]),
+ E('div', {
+ 'class': 'td left',
+ 'data-title': _('Name'),
+ }, k),
+ E('div', {
+ 'class': 'td left',
+ 'id': 'ipset.' + k + '.' + '0',
+ 'data-title': _('Size in memory'),
+ }, v[0]),
+ E('div', {
+ 'class': 'td left',
+ 'id': 'ipset.' + k + '.' + '1',
+ 'data-title': _('Number of entries'),
+ }, v[1]),
])
);
};
diff --git a/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/log.js b/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/log.js
index b6786a5..438cde2 100644
--- a/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/log.js
+++ b/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/log.js
@@ -31,13 +31,13 @@ return L.view.extend({
},
render: function(logdata) {
- let nav_btns_top = '120px';
+ let nav_btns_top = '1px';
let loglines = this.parse_log_data(logdata);
let log_textarea = E('textarea', {
'id': 'syslog',
'class': 'cbi-input-textarea',
- 'style': 'width:100% !important; padding: 0 0 0 45px; font-size:12px',
+ 'style': 'width:100% !important; resize:horizontal; padding: 0 0 0 45px; font-size:12px',
'readonly': 'readonly',
'wrap': 'off',
'rows': this.tail_default,
@@ -50,7 +50,7 @@ return L.view.extend({
'type': 'text',
'form': 'log_form',
'class': 'cbi-input-text',
- 'style': 'width:4em !important; min-width:4em !important',
+ 'style': 'width:4em !important; min-width:4em !important; margin-bottom:0.3em !important',
'maxlength': 5,
});
tail_value.value = this.tail_default;
@@ -62,7 +62,7 @@ return L.view.extend({
'type': 'text',
'form': 'log_form',
'class': 'cbi-input-text',
- 'style': 'margin-left:1em !important; width:16em !important; min-width:16em !important',
+ 'style': 'min-width:16em !important; margin-right:1em !important; margin-bottom:0.3em !important',
'placeholder': _('Message filter'),
'data-tooltip': _('Filter messages with a regexp'),
});
@@ -70,8 +70,8 @@ return L.view.extend({
let log_form_submit_btn = E('input', {
'type': 'submit',
'form': 'log_form',
- 'class': 'cbi-button btn',
- 'style': 'margin-left:1em !important; vertical-align:middle',
+ 'class': 'cbi-button btn cbi-button-action',
+ 'style': 'margin-right:1em !important; margin-bottom:0.3em !important;',
'value': _('Apply'),
'click': ev => ev.target.blur(),
});
@@ -113,8 +113,11 @@ return L.view.extend({
E('div', { 'class': 'cbi-section fade-in' },
E('div', { 'class': 'cbi-section-node' },
E('div', { 'class': 'cbi-value' }, [
- E('label', { 'class': 'cbi-value-title', 'for': 'tail_value' },
- _('Show only the last messages')),
+ E('label', {
+ 'class': 'cbi-value-title',
+ 'for': 'tailValue',
+ 'style': 'margin-bottom:0.3em !important',
+ }, _('Show only the last messages')),
E('div', { 'class': 'cbi-value-field' }, [
tail_value,
E('input', {
@@ -127,25 +130,14 @@ return L.view.extend({
log_form_submit_btn.click();
ev.target.blur();
},
-
+ 'style': 'margin-right:1em !important; margin-bottom:0.3em !important; max-width:4em !important',
}),
log_filter,
- E('input', {
- 'type': 'button',
- 'form': 'log_form',
- 'class': 'cbi-button btn cbi-button-reset',
- 'value': 'Χ',
- 'click': ev => {
- log_filter.value = null;
- log_form_submit_btn.click();
- ev.target.blur();
- },
- }),
log_form_submit_btn,
E('form', {
'id': 'log_form',
'name': 'log_form',
- 'style': 'display:inline-block; margin-left:1em !important',
+ 'style': 'display:inline-block; margin-bottom:0.3em !important',
'submit': ui.createHandlerFn(this, function(ev) {
ev.preventDefault();
let form_elems = Array.from(document.forms.log_form.elements);
@@ -154,6 +146,8 @@ return L.view.extend({
return this.load().then(logdata => {
let loglines = set_log_filter(set_log_tail(
this.parse_log_data(logdata)));
+ log_textarea.rows = (loglines.length < this.tail_default) ?
+ this.tail_default : loglines.length;
log_textarea.value = loglines.join('\n');
}).finally(() => {
form_elems.forEach(e => e.disabled = false);
@@ -173,7 +167,7 @@ return L.view.extend({
'style': 'position:relative; display:block; margin:0 !important; left:1px; top:'
+ nav_btns_top,
'click': ev => {
- log_textarea.scrollTop = 0;
+ document.getElementById('log_title').scrollIntoView(true);
ev.target.blur();
},
}, '↑'),
@@ -182,7 +176,7 @@ return L.view.extend({
'style': 'position:relative; display:block; margin:0 !important; margin-top:1px !important; left:1px; top:'
+ nav_btns_top,
'click': ev => {
- log_textarea.scrollTop = log_textarea.scrollHeight;
+ log_textarea.scrollIntoView(false);
ev.target.blur();
},
}, '↓'),
diff --git a/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/settings.js b/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/settings.js
index c33de5c..c278fe3 100644
--- a/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/settings.js
+++ b/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/settings.js
@@ -247,6 +247,7 @@ return L.view.extend({
o.description = _('e.g:') + ' 192.168.1.';
o.placeholder = _('e.g:') + ' 192.168.1.';
o.default = '';
+
depends_bllist_module(o);
// SUMMARIZE_IP
diff --git a/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/tools.js b/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/tools.js
index b30a301..671498a 100644
--- a/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/tools.js
+++ b/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/tools.js
@@ -89,8 +89,8 @@ return L.Class.extend({
app_status_label = this.info_label_error;
return `