mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Implements captive portal users
This commit is contained in:
parent
d9af0c8025
commit
4e2c7b8e8b
12 changed files with 138 additions and 30 deletions
|
|
@ -1,3 +1,22 @@
|
|||
local captive_portal_btn = ""
|
||||
|
||||
local get_users_url = ntop.getHttpPrefix().."/lua/admin/get_users.lua"
|
||||
local users_type = {ntopng="ntopng Users", captive_portal="Captive Portal Users"}
|
||||
|
||||
local title = users_type["ntopng"]
|
||||
if is_bridge_iface then
|
||||
if _GET["captive_portal_users"] ~= nil then
|
||||
title = users_type["captive_portal"]
|
||||
get_users_url = get_users_url.."?captive_portal_users=1"
|
||||
end
|
||||
|
||||
local url = ntop.getHttpPrefix().."/lua/admin/users.lua"
|
||||
-- prepare a button to manage captive portal users
|
||||
captive_portal_btn = "<div class='btn-group'><button class='btn btn-link dropdown-toggle' data-toggle='dropdown'>Users Type<span class='caret'></span></button> <ul class='dropdown-menu' role='menu'>"
|
||||
captive_portal_btn = captive_portal_btn.."<li><a href='"..url.."'>"..users_type["ntopng"].."</a></li>"
|
||||
captive_portal_btn = captive_portal_btn.."<li><a href='"..url.."?captive_portal_users=1'>"..users_type["captive_portal"].."</a></li>"
|
||||
captive_portal_btn = captive_portal_btn.."</ul></div>"
|
||||
end
|
||||
|
||||
print [[
|
||||
|
||||
|
|
@ -7,12 +26,12 @@ print [[
|
|||
<script>
|
||||
$("#table-users").datatable({
|
||||
url: "]]
|
||||
print (ntop.getHttpPrefix())
|
||||
print [[/lua/admin/get_users.lua",
|
||||
print (get_users_url)
|
||||
print [[",
|
||||
showPagination: true,
|
||||
title: "Users",
|
||||
title: "]] print(title) print[[",
|
||||
buttons: [
|
||||
"<a href='#add_user_dialog' role='button' class='add-on btn' data-toggle='modal'><i class='fa fa-user-plus fa-lg'></i></a>"
|
||||
"]] print(captive_portal_btn) print[[<a href='#add_user_dialog' role='button' class='add-on btn' data-toggle='modal'><i class='fa fa-user-plus fa-sm'></i></a>"
|
||||
],
|
||||
columns: [
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue