mirror of
https://github.com/gSpotx2f/luci-app-internet-detector.git
synced 2025-12-09 13:06:51 +03:00
Changes for OpenWrt 21.02
This commit is contained in:
31
README.md
31
README.md
@@ -5,7 +5,28 @@ OpenWrt >= 19.07.
|
||||
|
||||
Dependences: lua, luci-lib-nixio, libuci-lua
|
||||
|
||||
**Installation notes:**
|
||||
## Installation notes
|
||||
|
||||
**OpenWrt >= 21.02:**
|
||||
|
||||
wget --no-check-certificate -O /tmp/internet-detector_0.3.0-2_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector_0.3.0-2_all.ipk
|
||||
opkg install /tmp/internet-detector_0.3.0-2_all.ipk
|
||||
rm /tmp/internet-detector_0.3.0-2_all.ipk
|
||||
/etc/init.d/internet-detector start
|
||||
/etc/init.d/internet-detector enable
|
||||
|
||||
wget --no-check-certificate -O /tmp/luci-app-internet-detector_0.3.0-3_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/luci-app-internet-detector_0.3.0-3_all.ipk
|
||||
opkg install /tmp/luci-app-internet-detector_0.3.0-3_all.ipk
|
||||
rm /tmp/luci-app-internet-detector_0.3.0-3_all.ipk
|
||||
/etc/init.d/rpcd restart
|
||||
|
||||
i18n-ru:
|
||||
|
||||
wget --no-check-certificate -O /tmp/luci-i18n-internet-detector-ru_0.3.0-3_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/luci-i18n-internet-detector-ru_0.3.0-3_all.ipk
|
||||
opkg install /tmp/luci-i18n-internet-detector-ru_0.3.0-3_all.ipk
|
||||
rm /tmp/luci-i18n-internet-detector-ru_0.3.0-3_all.ipk
|
||||
|
||||
**OpenWrt 19.07:**
|
||||
|
||||
wget --no-check-certificate -O /tmp/internet-detector_0.3.0-1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/19.07/internet-detector_0.3.0-1_all.ipk
|
||||
opkg install /tmp/internet-detector_0.3.0-1_all.ipk
|
||||
@@ -16,15 +37,15 @@ Dependences: lua, luci-lib-nixio, libuci-lua
|
||||
wget --no-check-certificate -O /tmp/luci-app-internet-detector_0.3.0-2_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/19.07/luci-app-internet-detector_0.3.0-2_all.ipk
|
||||
opkg install /tmp/luci-app-internet-detector_0.3.0-2_all.ipk
|
||||
rm /tmp/luci-app-internet-detector_0.3.0-2_all.ipk
|
||||
/etc/init.d/rpcd reload
|
||||
/etc/init.d/rpcd restart
|
||||
|
||||
**i18n-ru:**
|
||||
i18n-ru:
|
||||
|
||||
wget --no-check-certificate -O /tmp/luci-i18n-internet-detector-ru_0.3.0-2_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/19.07/luci-i18n-internet-detector-ru_0.3.0-2_all.ipk
|
||||
opkg install /tmp/luci-i18n-internet-detector-ru_0.3.0-2_all.ipk
|
||||
rm /tmp/luci-i18n-internet-detector-ru_0.3.0-2_all.ipk
|
||||
|
||||
**Script for LED control:**
|
||||
## Script for LED control:
|
||||
|
||||

|
||||
|
||||
@@ -38,7 +59,7 @@ LED is on when Internet is available. A specific LED can be set in `/etc/interne
|
||||
uci commit
|
||||
/etc/init.d/internet-detector restart
|
||||
|
||||
### Screenshots:
|
||||
## Screenshots:
|
||||
|
||||

|
||||

|
||||
|
||||
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=internet-detector
|
||||
PKG_VERSION:=0.3.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/luci-app-internet-detector>
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_VERSION:=0.3.0
|
||||
PKG_RELEASE:=2
|
||||
PKG_VERSION:=0.3.0-3
|
||||
LUCI_TITLE:=LuCI support for internet-detector
|
||||
LUCI_DEPENDS:=+internet-detector
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
'use strict';
|
||||
'require baseclass';
|
||||
'require form';
|
||||
'require fs';
|
||||
'require poll';
|
||||
'require rpc';
|
||||
'require uci';
|
||||
'require ui';
|
||||
'require view';
|
||||
|
||||
const btnStyleEnabled = 'btn cbi-button-save';
|
||||
const btnStyleDisabled = 'btn cbi-button-reset';
|
||||
const btnStyleApply = 'btn cbi-button-apply';
|
||||
|
||||
return L.view.extend({
|
||||
return view.extend({
|
||||
execPath : '/usr/bin/internet-detector',
|
||||
upScriptPath : '/etc/internet-detector/up-script',
|
||||
downScriptPath : '/etc/internet-detector/down-script',
|
||||
@@ -69,14 +72,14 @@ return L.view.extend({
|
||||
},
|
||||
|
||||
serviceRestart: function(ev) {
|
||||
L.Poll.stop();
|
||||
poll.stop();
|
||||
return this.handleServiceAction('restart').then(() => {
|
||||
this.servicePoll();
|
||||
L.Poll.start();
|
||||
poll.start();
|
||||
});
|
||||
},
|
||||
|
||||
fileEditDialog: L.Class.extend({
|
||||
fileEditDialog: baseclass.extend({
|
||||
__init__: function(file, title, description, callback, fileExists=false) {
|
||||
this.file = file;
|
||||
this.title = title;
|
||||
@@ -553,7 +556,7 @@ return L.view.extend({
|
||||
o.value(10, "10 " + _('sec'));
|
||||
|
||||
if(this.currentAppMode !== '0') {
|
||||
L.Poll.add(
|
||||
poll.add(
|
||||
L.bind((this.currentAppMode === '2') ? this.servicePoll : this.uiPoll, this),
|
||||
this.pollInterval
|
||||
);
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
'use strict';
|
||||
'require baseclass';
|
||||
'require fs';
|
||||
'require uci';
|
||||
|
||||
return L.Class.extend({
|
||||
return baseclass.extend({
|
||||
title : _('Internet'),
|
||||
execPath : '/usr/bin/internet-detector',
|
||||
inetStatus : null,
|
||||
@@ -36,7 +37,6 @@ return L.Class.extend({
|
||||
};
|
||||
|
||||
window.internetDetectorCounter = 0;
|
||||
|
||||
return L.resolveDefault(fs.exec(this.execPath, [ 'inet-status' ]), null);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
|
||||
module('luci.controller.internet-detector', package.seeall)
|
||||
|
||||
function index()
|
||||
if nixio.fs.access('/usr/bin/internet-detector', 'x') then
|
||||
entry({'admin', 'services', 'internet-detector'}, view('internet-detector'), _('Internet detector'), 10).acl_depends = { 'luci-app-internet-detector' }
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user