summaryrefslogtreecommitdiffhomepage
path: root/modules/admin-full/luasrc/controller
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-09-11 14:18:28 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-09-11 14:18:28 +0000
commit57e51eba60cd95b82b11c5857651861decf8dcbe (patch)
treeeca82dc0108f5675f09e76f4a3743c9b8a0f1509 /modules/admin-full/luasrc/controller
parent1aa81b4ae095cea55119e8bc4142fbfb61cf40ff (diff)
modules/admin-full, modules/admin-core, themes/base: add port status indicators to switch config page
Diffstat (limited to 'modules/admin-full/luasrc/controller')
-rw-r--r--modules/admin-full/luasrc/controller/admin/network.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/modules/admin-full/luasrc/controller/admin/network.lua b/modules/admin-full/luasrc/controller/admin/network.lua
index 00e1fe2ff1..85dc68fff0 100644
--- a/modules/admin-full/luasrc/controller/admin/network.lua
+++ b/modules/admin-full/luasrc/controller/admin/network.lua
@@ -10,7 +10,6 @@ You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
-$Id$
]]--
module("luci.controller.admin.network", package.seeall)
@@ -39,6 +38,9 @@ function index()
page.target = cbi("admin_network/vlan")
page.title = _("Switch")
page.order = 20
+
+ page = entry({"admin", "network", "switch_status"}, call("switch_status"), nil)
+ page.leaf = true
end
@@ -417,6 +419,14 @@ function lease_status()
luci.http.write(']')
end
+function switch_status()
+ local path = luci.dispatcher.context.requestpath
+ local s = require "luci.tools.status"
+
+ luci.http.prepare_content("application/json")
+ luci.http.write_json(s.switch_status(path[#path]))
+end
+
function diag_command(cmd)
local path = luci.dispatcher.context.requestpath
local addr = path[#path]