Changes for OpenWrt 21.02

This commit is contained in:
gSpot
2021-12-05 19:18:32 +03:00
parent 1c30a83ba0
commit f75599bb80
13 changed files with 78 additions and 84 deletions
+4 -4
View File
@@ -8,10 +8,10 @@ RAM_CONFIG=0
LUA_MODULE=1
LUCI_APP=1
OWRT_VERSION="19.07"
RUAB_VERSION="0.9.0-2"
RUAB_MOD_LUA_VERSION="0.9.0-2"
RUAB_LUCI_APP_VERSION="0.9.0-7"
OWRT_VERSION="current"
RUAB_VERSION="0.9.0-3"
RUAB_MOD_LUA_VERSION="0.9.0-3"
RUAB_LUCI_APP_VERSION="0.9.0-8"
BASE_URL="https://github.com/gSpotx2f/packages-openwrt/raw/master"
PKG_DIR="/tmp"
+1 -2
View File
@@ -4,8 +4,7 @@
include $(TOPDIR)/rules.mk
PKG_VERSION:=0.9.0
PKG_RELEASE:=7
PKG_VERSION:=0.9.0-8
LUCI_TITLE:=LuCI support for ruantiblock
LUCI_DEPENDS:=+ruantiblock
LUCI_PKGARCH:=all
@@ -1,5 +1,7 @@
'use strict';
'require baseclass';
'require ui';
'require view';
document.head.append(E('style', {'type': 'text/css'},
`
@@ -132,9 +134,8 @@ log-emerg td {
}
`));
return L.Class.extend({
view: L.view.extend({
return baseclass.extend({
view: view.extend({
/**
* View name (for local storage and downloads).
* Must be overridden by a subclass!
@@ -420,7 +421,6 @@ return L.Class.extend({
if(logSortingLocal) {
this.logSortingValue = logSortingLocal;
};
return this.getLogData(this.tailValue);
},
@@ -633,8 +633,8 @@ return L.Class.extend({
]);
},
handleSave : null,
handleSaveApply: null,
handleSave : null,
handleReset : null,
}),
})
@@ -1,9 +1,10 @@
'use strict';
'require fs';
'require ui';
'require view';
'require view.ruantiblock.tools as tools';
return L.view.extend({
return view.extend({
crontabRegexp: new RegExp(
`^(\\*?\\/?(\\d){0,2}\\s){5}${tools.execPath} update(\n)?`, 'gm'),
@@ -1,15 +1,17 @@
'use strict';
'require fs';
'require poll';
'require ui';
'require view';
'require view.ruantiblock.tools as tools';
return L.view.extend({
return view.extend({
infoPoll: function() {
return fs.exec_direct(tools.execPath, [ 'html-info' ], 'json').catch(e => {
ui.addNotification(null, E('p', _('Unable to execute or read contents')
+ ': %s [ %s ]'.format(e.message, tools.execPath)
));
L.Poll.stop();
poll.stop();
}).then(data => {
if(!data) {
return;
@@ -71,8 +73,8 @@ return L.view.extend({
};
};
} else {
if(L.Poll.active()) {
L.Poll.stop();
if(poll.active()) {
poll.stop();
};
};
});
@@ -151,6 +153,7 @@ return L.view.extend({
for(let [k, v] of Object.entries(data.iptables)) {
if(k === '_dummy') continue;
table_iptables.append(
E('div', { 'class': 'tr' }, [
E('div', {
@@ -213,7 +216,7 @@ return L.view.extend({
]);
};
L.Poll.add(this.infoPoll);
poll.add(this.infoPoll);
} else {
update_status = E('em', {}, _('Status') + ' : ' + _('disabled'));
};
@@ -1,7 +1,9 @@
'use strict';
'require fs';
'require poll';
'require uci';
'require ui';
'require view';
'require view.ruantiblock.tools as tools';
const btn_style_neutral = 'btn'
@@ -10,7 +12,7 @@ const btn_style_positive = 'btn cbi-button-save important';
const btn_style_negative = 'btn cbi-button-reset important';
const btn_style_warning = 'btn cbi-button-negative important'
return L.view.extend({
return view.extend({
statusTokenValue: null,
disableButtons: function(bool, btn, elems=[]) {
@@ -155,8 +157,8 @@ return L.view.extend({
tp_status_code,
vpn_route_status_code);
if(!L.Poll.active()) {
L.Poll.start();
if(!poll.active()) {
poll.start();
};
},
@@ -166,7 +168,7 @@ return L.view.extend({
this.disableButtons(true, elem);
};
L.Poll.stop();
poll.stop();
return tools.handleServiceAction(tools.appName, action).then(() => {
return this.getAppStatus().then(
@@ -183,7 +185,7 @@ return L.view.extend({
this.disableButtons(true, elem);
};
L.Poll.stop();
poll.stop();
if(action === 'update') {
this.getAppStatus().then(status_array => {
@@ -326,7 +328,7 @@ return L.view.extend({
btn_destroy,
]);
L.Poll.add(L.bind(this.statusPoll, this));
poll.add(L.bind(this.statusPoll, this));
return E([
E('h2', { 'class': 'fade-in' }, _('Ruantiblock')),
@@ -4,9 +4,10 @@
'require form';
'require ui';
'require tools.widgets as widgets';
'require view';
'require view.ruantiblock.tools as tools';
return L.view.extend({
return view.extend({
availableParsers: {},
appStatusCode : null,
@@ -1,4 +1,5 @@
'use strict';
'require baseclass';
'require fs';
'require rpc';
'require ui';
@@ -35,7 +36,7 @@ document.head.append(E('style', {'type': 'text/css'},
}
`));
return L.Class.extend({
return baseclass.extend({
appName : 'ruantiblock',
execPath : '/usr/bin/ruantiblock',
tokenFile : '/var/run/ruantiblock.token',
@@ -191,7 +192,7 @@ return L.Class.extend({
);
},
fileEditDialog: L.Class.extend({
fileEditDialog: baseclass.extend({
__init__: function(file, title, description, callback, file_exists=false) {
this.file = file;
this.title = title;
@@ -1,13 +0,0 @@
module('luci.controller.ruantiblock', package.seeall)
function index()
if nixio.fs.access('/etc/config/ruantiblock') and nixio.fs.access('/usr/bin/ruantiblock') then
entry({'admin', 'services', 'ruantiblock'}, firstchild(), _('Ruantiblock'), 60).acl_depends = { 'luci-app-ruantiblock' }
entry({'admin', 'services', 'ruantiblock', 'service'}, view('ruantiblock/service'), _('Service'), 10)
entry({'admin', 'services', 'ruantiblock', 'settings'}, view('ruantiblock/settings'), _('Settings'), 20)
entry({'admin', 'services', 'ruantiblock', 'cron'}, view('ruantiblock/cron'), _('Blacklist updates'), 30)
entry({'admin', 'services', 'ruantiblock', 'info'}, view('ruantiblock/info'), _('Statistics'), 40)
entry({'admin', 'services', 'ruantiblock', 'log'}, view('ruantiblock/log'), _('Log'), 50)
end
end
+1 -1
View File
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ruantiblock-mod-lua
PKG_VERSION:=0.9.0
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+1 -1
View File
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ruantiblock-mod-py
PKG_VERSION:=0.9.0
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+1 -1
View File
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ruantiblock
PKG_VERSION:=0.9.0
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)