small-package/luci-app-ddns-go/luasrc/model/cbi/ddns-go.lua

28 lines
956 B
Lua
Raw Normal View History

2023-01-27 16:01:21 +08:00
-- Copyright (C) 2021-2022 sirpdboy <herboy2008@gmail.com> https://github.com/sirpdboy/luci-app-ddns-go
local m, s ,o
2023-06-24 16:24:41 +08:00
m = Map("ddns-go")
2023-01-27 16:01:21 +08:00
m.title = translate("DDNS-GO")
m.description = translate("DDNS-GO automatically obtains your public IPv4 or IPv6 address and resolves it to the corresponding domain name service.")..translate("</br>For specific usage, see:")..translate("<a href=\'https://github.com/sirpdboy/luci-app-ddns-go.git' target=\'_blank\'>GitHub @sirpdboy/luci-app-ddns-go </a>")
2023-06-24 16:24:41 +08:00
m:section(SimpleSection).template = "ddns-go_status"
2023-01-27 16:01:21 +08:00
2023-06-24 16:24:41 +08:00
s = m:section(TypedSection, "ddns-go", translate("Global Settings"))
2023-01-27 16:01:21 +08:00
s.addremove = false
s.anonymous = true
o = s:option(Flag,"enabled",translate("Enable"))
o.default = 0
o = s:option(Value, "port",translate("Set the DDNS-TO access port"))
o.datatype = "uinteger"
o.default=9876
m.apply_on_parse = true
m.on_after_apply = function(self,map)
2023-06-24 16:24:41 +08:00
luci.sys.exec("/etc/init.d/ddns-go restart")
2023-01-27 16:01:21 +08:00
end
return m