diff --git a/README.md b/README.md index f45b8d8..6585d10 100644 --- a/README.md +++ b/README.md @@ -15,44 +15,25 @@ Internet-detector is an application for checking the availability of the Interne ## Installation notes -**OpenWrt >= 21.02:** +**OpenWrt 19.07:** - wget --no-check-certificate -O /tmp/internet-detector_0.4-3_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector_0.4-3_all.ipk + wget --no-check-certificate -O /tmp/internet-detector_0.4-3_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/19.07/internet-detector_0.4-3_all.ipk opkg install /tmp/internet-detector_0.4-3_all.ipk rm /tmp/internet-detector_0.4-3_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.4-3_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/luci-app-internet-detector_0.4-3_all.ipk + wget --no-check-certificate -O /tmp/luci-app-internet-detector_0.4-3_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/19.07/luci-app-internet-detector_0.4-3_all.ipk opkg install /tmp/luci-app-internet-detector_0.4-3_all.ipk rm /tmp/luci-app-internet-detector_0.4-3_all.ipk /etc/init.d/rpcd restart i18n-ru: - wget --no-check-certificate -O /tmp/luci-i18n-internet-detector-ru_0.4-3_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/luci-i18n-internet-detector-ru_0.4-3_all.ipk + wget --no-check-certificate -O /tmp/luci-i18n-internet-detector-ru_0.4-3_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/19.07/luci-i18n-internet-detector-ru_0.4-3_all.ipk opkg install /tmp/luci-i18n-internet-detector-ru_0.4-3_all.ipk rm /tmp/luci-i18n-internet-detector-ru_0.4-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 - rm /tmp/internet-detector_0.3.0-1_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-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 restart - -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 - ## Screenshots: ![](https://github.com/gSpotx2f/luci-app-internet-detector/blob/master/screenshots/01.jpg) diff --git a/luci-app-internet-detector/Makefile b/luci-app-internet-detector/Makefile index 2c63288..fa56857 100644 --- a/luci-app-internet-detector/Makefile +++ b/luci-app-internet-detector/Makefile @@ -4,7 +4,8 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=0.4-3 +PKG_VERSION:=0.4 +PKG_RELEASE:=3 LUCI_TITLE:=LuCI support for internet-detector LUCI_DEPENDS:=+internet-detector LUCI_PKGARCH:=all diff --git a/luci-app-internet-detector/htdocs/luci-static/resources/view/internet-detector.js b/luci-app-internet-detector/htdocs/luci-static/resources/view/internet-detector.js index fcf8516..68fad8f 100644 --- a/luci-app-internet-detector/htdocs/luci-static/resources/view/internet-detector.js +++ b/luci-app-internet-detector/htdocs/luci-static/resources/view/internet-detector.js @@ -1,18 +1,15 @@ '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 view.extend({ +return L.view.extend({ execPath : '/usr/bin/internet-detector', upScriptPath : '/etc/internet-detector/up-script', downScriptPath : '/etc/internet-detector/down-script', @@ -74,14 +71,14 @@ return view.extend({ }, serviceRestart: function(ev) { - poll.stop(); + L.Poll.stop(); return this.handleServiceAction('restart').then(() => { this.servicePoll(); - poll.start(); + L.Poll.start(); }); }, - fileEditDialog: baseclass.extend({ + fileEditDialog: L.Class.extend({ __init__: function(file, title, description, callback, fileExists=false) { this.file = file; this.title = title; @@ -655,7 +652,7 @@ return view.extend({ settingsNode.replaceWith(settingsTabs); if(this.currentAppMode !== '0') { - poll.add( + L.Poll.add( L.bind((this.currentAppMode === '2') ? this.servicePoll : this.uiPoll, this), this.pollInterval ); diff --git a/luci-app-internet-detector/htdocs/luci-static/resources/view/status/include/00_internet.js b/luci-app-internet-detector/htdocs/luci-static/resources/view/status/include/00_internet.js index fd995fa..88026c2 100644 --- a/luci-app-internet-detector/htdocs/luci-static/resources/view/status/include/00_internet.js +++ b/luci-app-internet-detector/htdocs/luci-static/resources/view/status/include/00_internet.js @@ -1,9 +1,8 @@ 'use strict'; -'require baseclass'; 'require fs'; 'require uci'; -return baseclass.extend({ +return L.Class.extend({ title : _('Internet'), execPath : '/usr/bin/internet-detector', inetStatus : null, diff --git a/luci-app-internet-detector/luasrc/controller/internet-detector.lua b/luci-app-internet-detector/luasrc/controller/internet-detector.lua new file mode 100644 index 0000000..bcc05de --- /dev/null +++ b/luci-app-internet-detector/luasrc/controller/internet-detector.lua @@ -0,0 +1,8 @@ + +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'), 80).acl_depends = { 'luci-app-internet-detector' } + end +end