Minor fixes.

This commit is contained in:
gSpot
2025-10-02 18:23:46 +03:00
parent 1720662f73
commit 10fedfded1
12 changed files with 60 additions and 47 deletions

View File

@@ -20,22 +20,22 @@ Internet-detector is an application for checking the availability of the Interne
## Installation notes:
opkg update
wget --no-check-certificate -O /tmp/internet-detector_1.6.5-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector_1.6.5-r1_all.ipk
opkg install /tmp/internet-detector_1.6.5-r1_all.ipk
rm /tmp/internet-detector_1.6.5-r1_all.ipk
wget --no-check-certificate -O /tmp/internet-detector_1.6.6-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector_1.6.6-r1_all.ipk
opkg install /tmp/internet-detector_1.6.6-r1_all.ipk
rm /tmp/internet-detector_1.6.6-r1_all.ipk
service internet-detector start
service internet-detector enable
wget --no-check-certificate -O /tmp/luci-app-internet-detector_1.6.5-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/luci-app-internet-detector_1.6.5-r1_all.ipk
opkg install /tmp/luci-app-internet-detector_1.6.5-r1_all.ipk
rm /tmp/luci-app-internet-detector_1.6.5-r1_all.ipk
wget --no-check-certificate -O /tmp/luci-app-internet-detector_1.6.6-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/luci-app-internet-detector_1.6.6-r1_all.ipk
opkg install /tmp/luci-app-internet-detector_1.6.6-r1_all.ipk
rm /tmp/luci-app-internet-detector_1.6.6-r1_all.ipk
service rpcd restart
i18n-ru:
wget --no-check-certificate -O /tmp/luci-i18n-internet-detector-ru_1.6.5-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/luci-i18n-internet-detector-ru_1.6.5-r1_all.ipk
opkg install /tmp/luci-i18n-internet-detector-ru_1.6.5-r1_all.ipk
rm /tmp/luci-i18n-internet-detector-ru_1.6.5-r1_all.ipk
wget --no-check-certificate -O /tmp/luci-i18n-internet-detector-ru_1.6.6-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/luci-i18n-internet-detector-ru_1.6.6-r1_all.ipk
opkg install /tmp/luci-i18n-internet-detector-ru_1.6.6-r1_all.ipk
rm /tmp/luci-i18n-internet-detector-ru_1.6.6-r1_all.ipk
## Screenshots:
@@ -47,9 +47,9 @@ i18n-ru:
**Dependences:** modemmanager.
wget --no-check-certificate -O /tmp/internet-detector-mod-modem-restart_1.6.5-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector-mod-modem-restart_1.6.5-r1_all.ipk
opkg install /tmp/internet-detector-mod-modem-restart_1.6.5-r1_all.ipk
rm /tmp/internet-detector-mod-modem-restart_1.6.5-r1_all.ipk
wget --no-check-certificate -O /tmp/internet-detector-mod-modem-restart_1.6.6-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector-mod-modem-restart_1.6.6-r1_all.ipk
opkg install /tmp/internet-detector-mod-modem-restart_1.6.6-r1_all.ipk
rm /tmp/internet-detector-mod-modem-restart_1.6.6-r1_all.ipk
service internet-detector restart
![](https://github.com/gSpotx2f/luci-app-internet-detector/blob/master/screenshots/04.jpg)
@@ -58,9 +58,9 @@ i18n-ru:
**Dependences:** mailsend.
wget --no-check-certificate -O /tmp/internet-detector-mod-email_1.6.5-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector-mod-email_1.6.5-r1_all.ipk
opkg install /tmp/internet-detector-mod-email_1.6.5-r1_all.ipk
rm /tmp/internet-detector-mod-email_1.6.5-r1_all.ipk
wget --no-check-certificate -O /tmp/internet-detector-mod-email_1.6.6-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector-mod-email_1.6.6-r1_all.ipk
opkg install /tmp/internet-detector-mod-email_1.6.6-r1_all.ipk
rm /tmp/internet-detector-mod-email_1.6.6-r1_all.ipk
service internet-detector restart
![](https://github.com/gSpotx2f/luci-app-internet-detector/blob/master/screenshots/05.jpg)
@@ -69,9 +69,9 @@ i18n-ru:
**Dependences:** curl.
wget --no-check-certificate -O /tmp/internet-detector-mod-telegram_1.6.5-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector-mod-telegram_1.6.5-r1_all.ipk
opkg install /tmp/internet-detector-mod-telegram_1.6.5-r1_all.ipk
rm /tmp/internet-detector-mod-telegram_1.6.5-r1_all.ipk
wget --no-check-certificate -O /tmp/internet-detector-mod-telegram_1.6.6-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/current/internet-detector-mod-telegram_1.6.6-r1_all.ipk
opkg install /tmp/internet-detector-mod-telegram_1.6.6-r1_all.ipk
rm /tmp/internet-detector-mod-telegram_1.6.6-r1_all.ipk
service internet-detector restart
![](https://github.com/gSpotx2f/luci-app-internet-detector/blob/master/screenshots/06.jpg)

View File

@@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=internet-detector-mod-email
PKG_VERSION:=1.6.5
PKG_VERSION:=1.6.6
PKG_RELEASE:=1
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/luci-app-internet-detector>

View File

@@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=internet-detector-mod-modem-restart
PKG_VERSION:=1.6.5
PKG_VERSION:=1.6.6
PKG_RELEASE:=1
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/luci-app-internet-detector>

View File

@@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=internet-detector-mod-telegram
PKG_VERSION:=1.6.5
PKG_VERSION:=1.6.6
PKG_RELEASE:=1
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/luci-app-internet-detector>

View File

@@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=internet-detector
PKG_VERSION:=1.6.5
PKG_VERSION:=1.6.6
PKG_RELEASE:=1
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/luci-app-internet-detector>

View File

@@ -18,7 +18,7 @@ run_instance() {
}
start_service() {
config_load internet-detector
config_load "internet-detector"
config_get mode "config" mode "0"
if [ $mode = "1" ]; then
config_foreach run_instance "instance"

View File

@@ -88,28 +88,21 @@ function InternetDetector:prequire(package)
return ok and pkg
end
function InternetDetector:loadUCIConfig(sType, instance)
local success
local num = 0
uciCursor:foreach(
self.appName,
sType,
function(s)
if s[".name"] == instance then
for k, v in pairs(s) do
if type(v) == "string" and v:match("^[%d]+$") then
v = tonumber(v)
end
self.serviceConfig[k] = v
end
success = true
self.serviceConfig.instanceNum = num
function InternetDetector:loadInstanceConfig(instance)
local sections = uciCursor:get_all(self.appName)
local t = sections[instance]
if t then
for k, v in pairs(t) do
if type(v) == "string" and v:match("^[%d]+$") then
v = tonumber(v)
end
num = num + 1
self.serviceConfig[k] = v
end
)
self.serviceConfig.instance = instance
return success
self.serviceConfig.instance = instance
self.serviceConfig.instanceNum = t[".index"]
return true
end
return false
end
function InternetDetector:writeValueToFile(filePath, str)
@@ -693,7 +686,7 @@ function InternetDetector:daemon()
end
function InternetDetector:setServiceConfig(instance)
if self:loadUCIConfig("instance", instance) then
if self:loadInstanceConfig(instance) then
self:parseHosts()
if self.mode == 2 then
self.loggingLevel = 0

View File

@@ -1,7 +1,7 @@
local stdlib = require("posix.stdlib")
local unistd = require("posix.unistd")
local time = require("posix.time")
local unistd = require("posix.unistd")
local Module = {
name = "mod_regular_script",

View File

@@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-internet-detector
PKG_VERSION:=1.6.5
PKG_VERSION:=1.6.6
PKG_RELEASE:=1
LUCI_TITLE:=LuCI support for internet-detector
LUCI_DEPENDS:=+internet-detector

View File

@@ -773,7 +773,7 @@ return view.extend({
'hosts', _('Hosts'),
_('Hosts to check Internet availability. Hosts are polled (in list order) until at least one of them responds.')
);
o.datatype = 'or(or(host,hostport),ipaddrport(1))';
o.datatype = 'or(host,hostport,ipaddrport(1))';
o.default = this.defaultHosts;
o.rmempty = false;
@@ -895,6 +895,14 @@ return view.extend({
s.addModalOptions = (s, section_id, ev) => {
if(section_id == 'config') {
s.map.children = [];
s.map.readonly = true;
s.map.children.push(new form.NamedSection(s.map, '_dummy', '_dummy',
_('Error!'), _('Invalid instance name...')));
return;
};
if(this.currentAppMode !== '2') {
// LED control

View File

@@ -175,6 +175,9 @@ msgstr "Включен"
msgid "Error"
msgstr "Ошибка"
msgid "Error!"
msgstr "Ошибка!"
msgid "Expecting:"
msgstr "Ожидается:"
@@ -272,6 +275,9 @@ msgstr "Интервал между запусками down-script."
msgid "Interval between up-script runs."
msgstr "Интервал между запусками up-script."
msgid "Invalid instance name..."
msgstr "Недопустимое имя экземпляра..."
msgid "Jumbo: 9000 bytes"
msgstr "Гигантский: 9000 байт"

View File

@@ -162,6 +162,9 @@ msgstr ""
msgid "Error"
msgstr ""
msgid "Error!"
msgstr ""
msgid "Expecting:"
msgstr ""
@@ -257,6 +260,9 @@ msgstr ""
msgid "Interval between up-script runs."
msgstr ""
msgid "Invalid instance name..."
msgstr ""
msgid "Jumbo: 9000 bytes"
msgstr ""