diff --git a/luci-app-snmpd/luasrc/model/cbi/snmpd.lua b/luci-app-snmpd/luasrc/model/cbi/snmpd.lua index 4c8cdea5a..132b3a1d2 100644 --- a/luci-app-snmpd/luasrc/model/cbi/snmpd.lua +++ b/luci-app-snmpd/luasrc/model/cbi/snmpd.lua @@ -16,7 +16,17 @@ network.rmempty = true network.cast = "string" network.nocreate = true -s = m:section(TypedSection, "com2sec", translate("com2sec")) +s = m:section(TypedSection, "system", translate("System")) +s.addremove = false + +sysLocation = s:option(Value, "sysLocation", translate("Location")) +sysContact = s:option(Value, "sysContact", translate("Contact")) +sysName = s:option(Value, "sysName", translate("Name")) +--sysServices = s:option(Value, "sysServices", translate("Services")) +--sysDescr = s:option(Value, "sysDescr", translate("Description")) +--sysObjectID = s:option(Value, "sysObjectID", translate("ObjectID")) + +s = m:section(TypedSection, "com2sec", translate("com2sec security")) s.addremove = true secname = s:option(ListValue, "secname", translate("Server")) @@ -33,24 +43,24 @@ community = s:option(Value, "community", translate("Community")) community.optional = false community.rmempty = false -s = m:section(TypedSection, "com2sec6", translate("com2sec6")) -s.addremove = true +--s = m:section(TypedSection, "com2sec6", translate("com2sec6")) +--s.addremove = true -secname = s:option(ListValue, "secname", translate("secname")) -secname.optional = false -secname:value("ro",translate("Read-only")) -secname:value("rw",translate("Read-write")) +--secname = s:option(ListValue, "secname", translate("secname")) +--secname.optional = false +--secname:value("ro",translate("Read-only")) +--secname:value("rw",translate("Read-write")) -source = s:option(Value, "source", translate("Source")) -source.datatype = "host" -source.optional = false -source.rmempty = false +--source = s:option(Value, "source", translate("Source")) +--source.datatype = "host" +--source.optional = false +--source.rmempty = false -community = s:option(Value, "community", translate("Community")) -community.optional = false -community.rmempty = false +--community = s:option(Value, "community", translate("Community")) +--community.optional = false +--community.rmempty = false -s = m:section(TypedSection, "group", translate("Group")) +s = m:section(TypedSection, "group", translate("Group"), translate("Groups help define access methods")) s.addremove = true s.anonymous = false @@ -59,10 +69,9 @@ secname.optional = false secname:value("ro",translate("Read-only")) secname:value("rw",translate("Read-write")) -group = s:option(ListValue, "group", translate("Group")) +group = s:option(Value, "group", translate("Group")) group.optional = false -group:value("public","public") -group:value("private","private") +group.rmempty = false version = s:option(ListValue, "version", translate("version")) version.optional = false @@ -74,10 +83,9 @@ s = m:section(TypedSection, "access", translate("Access")) s.addremove = true s.anonymous = false -group = s:option(ListValue, "group", translate("Group")) +group = s:option(Value, "group", translate("Group")) group.optional = false -group:value("public","public") -group:value("private","private") +group.rmempty = false version = s:option(ListValue, "version", translate("version")) version.optional = false @@ -110,28 +118,16 @@ notify.optional = false notify:value("all","all") notify:value("none","none") -s = m:section(TypedSection, "engineid", translate("engineid")) -s.addremove = false -s.anonymous = true +--s = m:section(TypedSection, "engineid", translate("engineid")) +--s.addremove = false +--s.anonymous = true -engineid = s:option(Value, "engineid", translate("engineid")) -engineidtype = s:option(ListValue, "engineidtype", translate("engineidtype")) -engineidtype:value("1",translate("IPv4")) -engineidtype:value("2",translate("IPv6")) -engineidtype:value("3",translate("MAC")) - -engineidnic = s:option(Value, "engineidnic", translate("engineidnic")) - -s = m:section(TypedSection, "system", translate("System")) -s.addremove = true -s.anonymous = true - -sysLocation = s:option(Value, "sysLocation", translate("Location")) -sysContact = s:option(Value, "sysContact", translate("Contact")) -sysName = s:option(Value, "sysName", translate("Name")) -sysServices = s:option(Value, "sysServices", translate("Services")) -sysDescr = s:option(Value, "sysDescr", translate("Description")) -sysObjectID = s:option(Value, "sysObjectID", translate("ObjectID")) +--engineid = s:option(Value, "engineid", translate("engineid")) +--engineidtype = s:option(ListValue, "engineidtype", translate("engineidtype")) +--engineidtype:value("1",translate("IPv4")) +--engineidtype:value("2",translate("IPv6")) +--engineidtype:value("3",translate("MAC")) +--engineidnic = s:option(Value, "engineidnic", translate("engineidnic")) s = m:section(TypedSection, "exec", translate("Exec")) s.addremove = true diff --git a/luci-app-snmpd/luasrc/view/snmpd.htm b/luci-app-snmpd/luasrc/view/snmpd.htm new file mode 100644 index 000000000..74e60ca9a --- /dev/null +++ b/luci-app-snmpd/luasrc/view/snmpd.htm @@ -0,0 +1,132 @@ +<%+header%> + + + +<% + local uci = require("luci.model.uci").cursor() + local hosts = uci:get_list("dhcp", uci:get_first("dhcp","dnsmasq"), "ipset") + local ips = uci:get_list("omr-bypass", "ips", "ip") + local dpi = uci:get_list("omr-bypass", "dpi", "proto") + local tmpfile = os.tmpname() + local dpi_available_proto = luci.util.execi("cat /proc/net/xt_ndpi/proto | awk '{print $3}' | sort -u | head -n -1") + local sys = require "luci.sys" + local ifaces = sys.net:devices() + local bypassif = uci:get("omr-bypass","defaults","ifname") or "" +%> +<% if stderr and #stderr > 0 then %>
<%=pcdata(stderr)%><% end %> +