mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-12 18:41:51 +00:00
Add a LuCI interface for omr-tracker
This commit is contained in:
parent
6e313a25b8
commit
559e8216af
5 changed files with 66 additions and 2 deletions
15
luci-app-omr-tracker/Makefile
Normal file
15
luci-app-omr-tracker/Makefile
Normal 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
|
7
luci-app-omr-tracker/luasrc/controller/omr-tracker.lua
Normal file
7
luci-app-omr-tracker/luasrc/controller/omr-tracker.lua
Normal 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
|
32
luci-app-omr-tracker/luasrc/model/cbi/omr-tracker.lua
Normal file
32
luci-app-omr-tracker/luasrc/model/cbi/omr-tracker.lua
Normal 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
|
|
@ -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
|
|
@ -18,7 +18,6 @@ MY_DEPENDS := \
|
||||||
unbound \
|
unbound \
|
||||||
netifd \
|
netifd \
|
||||||
mc \
|
mc \
|
||||||
omr-tracker \
|
|
||||||
openmptcprouter \
|
openmptcprouter \
|
||||||
dnsmasq-full \
|
dnsmasq-full \
|
||||||
uhttpd \
|
uhttpd \
|
||||||
|
@ -38,7 +37,7 @@ MY_DEPENDS := \
|
||||||
luci-i18n-firewall-en \
|
luci-i18n-firewall-en \
|
||||||
luci-i18n-firewall-fr \
|
luci-i18n-firewall-fr \
|
||||||
ca-bundle ca-certificates \
|
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)
|
define Package/$(PKG_NAME)
|
||||||
|
|
Loading…
Reference in a new issue