1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-12 10:31:51 +00:00

Add a LuCI interface for omr-tracker

This commit is contained in:
Ycarus 2018-02-28 16:05:10 +01:00
parent 6e313a25b8
commit 559e8216af
5 changed files with 66 additions and 2 deletions

View file

@ -0,0 +1,15 @@
#
# Copyright (C) 2018 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
#
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI Support for omr-tracker
LUCI_DEPENDS:=+omr-tracker
PKG_LICENSE:=Apache-2.0
include ../luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View file

@ -0,0 +1,7 @@
module("luci.controller.omr-tracker", package.seeall)
function index()
entry(
{"admin", "services", "omr-tracker"},
cbi("omr-tracker"), _("OMR-Tracker"), 55)
end

View file

@ -0,0 +1,32 @@
local m, s, o
m = Map("omr-tracker", translate("OMR-Tracker"), translate("OMR-Tracker detect when a connection is down"))
s = m:section(TypedSection, "defaults", translate("Defaults Settings"))
s.anonymous = true
o = s:option(Value, "timeout", translate("Timeout Connect (s)"))
o.placeholder = "1"
o.default = "1"
o.datatype = "range(1, 100)"
o.rmempty = false
o = s:option(Value, "tries", translate("Tries"))
o.placeholder = "4"
o.default = "4"
o.datatype = "range(1, 10)"
o.rmempty = false
o = s:option(Value, "interval", translate("Interval (s)"))
o.placeholder = "2"
o.default = "2"
o.datatype = "range(1, 100)"
o.rmempty = false
o = s:option(DynamicList, "hosts", translate("Hosts"))
o.placeholder = "4.2.2.1"
o.default = "4.2.2.1"
o.rmempty = false
return m

View file

@ -0,0 +1,11 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
delete ucitrack.@omr-tracker[-1]
add ucitrack omr-tracker
set ucitrack.@omr-tracker[-1].init=omr-tracker
commit ucitrack
EOF
rm -f /tmp/luci-indexcache
exit 0

View file

@ -18,7 +18,6 @@ MY_DEPENDS := \
unbound \
netifd \
mc \
omr-tracker \
openmptcprouter \
dnsmasq-full \
uhttpd \
@ -38,7 +37,7 @@ MY_DEPENDS := \
luci-i18n-firewall-en \
luci-i18n-firewall-fr \
ca-bundle ca-certificates \
luci-mod-admin-full luci-app-firewall luci-app-glorytun luci-app-shadowsocks-libev luci-app-unbound luci-theme-openmptcprouter luci-base luci-app-haproxy-tcp
luci-mod-admin-full luci-app-firewall luci-app-glorytun luci-app-shadowsocks-libev luci-app-unbound luci-theme-openmptcprouter luci-base luci-app-haproxy-tcp luci-app-omr-tracker
define Package/$(PKG_NAME)