diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-02-08 03:56:50 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-02-08 03:56:50 +0000 |
commit | f52ec227175c9db1bfee95f8a59c7c56d01911d4 (patch) | |
tree | 7ba7e2d346b2cea378267fee607001d4eb841a9d /modules/admin-full/luasrc/controller | |
parent | e3c8b9a10b383138ba1a5ed7bea51fd3694f596d (diff) |
modules/admin-full: implement iptables status page
i18n/english: resync xml, add strings for iptables page
libs/sys/iptparser: implement chain() and is_custom_target()
Diffstat (limited to 'modules/admin-full/luasrc/controller')
-rw-r--r-- | modules/admin-full/luasrc/controller/admin/status.lua | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/modules/admin-full/luasrc/controller/admin/status.lua b/modules/admin-full/luasrc/controller/admin/status.lua index 09e7766c1..fd61459e9 100644 --- a/modules/admin-full/luasrc/controller/admin/status.lua +++ b/modules/admin-full/luasrc/controller/admin/status.lua @@ -19,7 +19,8 @@ function index() entry({"admin", "status"}, template("admin_status/index"), i18n("status", "Status"), 20).index = true entry({"admin", "status", "syslog"}, call("action_syslog"), i18n("syslog", "Systemprotokoll"), 1) - entry({"admin", "status", "dmesg"}, call("action_dmesg"), i18n("dmesg", "Kernelprotokoll"), 2) + entry({"admin", "status", "dmesg"}, call("action_dmesg"), i18n("dmesg", "Kernelprotokoll"), 2) + entry({"admin", "status", "iptables"}, call("action_iptables"), i18n("a_s_ipt", "Firewall"), 3) end function action_syslog() @@ -31,3 +32,19 @@ function action_dmesg() local dmesg = luci.sys.dmesg() luci.template.render("admin_status/dmesg", {dmesg=dmesg}) end + +function action_iptables() + if luci.http.formvalue("zero") == "1" then + luci.util.exec("iptables -Z") + luci.http.redirect( + luci.dispatcher.build_url("admin", "status", "iptables") + ) + elseif luci.http.formvalue("restart") == "1" then + luci.util.exec("/etc/init.d/firewall restart") + luci.http.redirect( + luci.dispatcher.build_url("admin", "status", "iptables") + ) + else + luci.template.render("admin_status/iptables") + end +end |