end
end
+ local uci = require("luci.model.uci").cursor()
+
local root = node()
if not root.target then
root.target = alias("admin")
end
local page = node("admin")
+
page.title = _("Administration")
page.order = 10
page.sysauth = "root"
page.index = true
toplevel_page(page, false, false)
+ if nixio.fs.access("/etc/config/dhcp") then
+ page = entry({"admin", "dhcplease_status"}, call("lease_status"), nil)
+ page.leaf = true
+ end
+
+ local has_wifi = false
+
+ uci:foreach("wireless", "wifi-device",
+ function(s)
+ has_wifi = true
+ return false
+ end)
+
+ if has_wifi then
+ page = entry({"admin", "wireless_assoclist"}, call("wifi_assoclist"), nil)
+ page.leaf = true
+ end
+
-- Logout is last
entry({"admin", "logout"}, call("action_logout"), _("Logout"), 999)
end
luci.http.redirect(dsp.build_url())
end
+
+
+function lease_status()
+ local s = require "luci.tools.status"
+
+ luci.http.prepare_content("application/json")
+ luci.http.write('[')
+ luci.http.write_json(s.dhcp_leases())
+ luci.http.write(',')
+ luci.http.write_json(s.dhcp6_leases())
+ luci.http.write(']')
+end
+
+function wifi_assoclist()
+ local s = require "luci.tools.status"
+
+ luci.http.prepare_content("application/json")
+ luci.http.write_json(s.wifi_assoclist())
+end
<script type="text/javascript">//<![CDATA[
- XHR.poll(5, '<%=url('admin/network/dhcplease_status')%>', null,
+ XHR.poll(5, '<%=url('admin/dhcplease_status')%>', null,
function(x, st)
{
var tb = document.getElementById('lease_status_table');
return s;
}
- XHR.poll(5, '<%=url('admin/network/wireless_assoclist')%>', null,
+ XHR.poll(5, '<%=url('admin/wireless_assoclist')%>', null,
function(x, st)
{
var tb = document.getElementById('wifi_assoclist_table');
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI Administration - full-featured for full control
-LUCI_DEPENDS:=+luci-base
+LUCI_DEPENDS:=+luci-base +luci-mod-status +luci-mod-system +luci-mod-network
-PKG_BUILD_DEPENDS:=iwinfo
PKG_LICENSE:=Apache-2.0
include ../../luci.mk
--- /dev/null
+#
+# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
+#
+# This is free software, licensed under the Apache License, Version 2.0 .
+#
+
+include $(TOPDIR)/rules.mk
+
+LUCI_TITLE:=LuCI Network Administration
+LUCI_DEPENDS:=+luci-base +libiwinfo-lua
+
+PKG_LICENSE:=Apache-2.0
+
+include ../../luci.mk
+
+# call BuildPackage - OpenWrt buildroot signature
+
end)
if has_wifi then
- page = entry({"admin", "network", "wireless_assoclist"}, call("wifi_assoclist"), nil)
- page.leaf = true
-
page = entry({"admin", "network", "wireless_join"}, post("wifi_join"), nil)
page.leaf = true
page.title = _("DHCP and DNS")
page.order = 30
- page = entry({"admin", "network", "dhcplease_status"}, call("lease_status"), nil)
- page.leaf = true
-
page = node("admin", "network", "hosts")
page.target = cbi("admin_network/hosts")
page.title = _("Hostnames")
end
end
-function wifi_assoclist()
- local s = require "luci.tools.status"
-
- luci.http.prepare_content("application/json")
- luci.http.write_json(s.wifi_assoclist())
-end
-
-
local function _wifi_get_scan_results(cache_key)
local results = luci.util.ubus("session", "get", {
ubus_rpc_session = luci.model.uci:get_session_id(),
end
end
-function lease_status()
- local s = require "luci.tools.status"
-
- luci.http.prepare_content("application/json")
- luci.http.write('[')
- luci.http.write_json(s.dhcp_leases())
- luci.http.write(',')
- luci.http.write_json(s.dhcp6_leases())
- luci.http.write(']')
-end
-
function switch_status(switches)
local s = require "luci.tools.status"
o.optional = true
o:depends("nonwildcard", true)
-m:section(SimpleSection).template = "admin_network/lease_status"
+m:section(SimpleSection).template = "lease_status"
s = m:section(TypedSection, "host", translate("Static Leases"),
translate("Static leases are used to assign fixed IP addresses and symbolic hostnames to " ..
function s.render(self, sid)
tpl.render_string([[
<h2><%:Associated Stations%></h2>
- <%+admin_network/wifi_assoclist%>
+ <%+wifi_assoclist%>
]])
end
--- /dev/null
+#
+# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
+#
+# This is free software, licensed under the Apache License, Version 2.0 .
+#
+
+include $(TOPDIR)/rules.mk
+
+LUCI_TITLE:=LuCI Status Pages
+LUCI_DEPENDS:=+luci-base +libiwinfo +libiwinfo-lua
+
+PKG_BUILD_DEPENDS:=iwinfo
+PKG_LICENSE:=Apache-2.0
+
+include ../../luci.mk
+
+# call BuildPackage - OpenWrt buildroot signature
+
<%
if has_dhcp then
- include("admin_network/lease_status")
+ include("lease_status")
end
%>
<div class="cbi-section">
<h3><%:Associated Stations%></h3>
- <%+admin_network/wifi_assoclist%>
+ <%+wifi_assoclist%>
</div>
<% end %>
--- /dev/null
+#
+# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
+#
+# This is free software, licensed under the Apache License, Version 2.0 .
+#
+
+include $(TOPDIR)/rules.mk
+
+LUCI_TITLE:=LuCI Administration - Global System Settings
+LUCI_DEPENDS:=+luci-base
+
+PKG_LICENSE:=Apache-2.0
+
+include ../../luci.mk
+
+# call BuildPackage - OpenWrt buildroot signature
+