mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-01 16:30:10 +00:00
Initial import from SVN
This commit is contained in:
parent
1601f6bbf2
commit
730d76b9f5
1612 changed files with 715104 additions and 0 deletions
74
scripts/lua/vlan_stats.lua
Normal file
74
scripts/lua/vlan_stats.lua
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
--
|
||||
-- (C) 2013-15 - ntop.org
|
||||
--
|
||||
|
||||
dirs = ntop.getDirs()
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
|
||||
require "lua_utils"
|
||||
|
||||
sendHTTPHeader('text/html; charset=iso-8859-1')
|
||||
|
||||
if (group_col == nil) then
|
||||
group_col = "asn"
|
||||
end
|
||||
|
||||
ntop.dumpFile(dirs.installdir .. "/httpdocs/inc/header.inc")
|
||||
|
||||
active_page = "hosts"
|
||||
dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua")
|
||||
|
||||
print [[
|
||||
<hr>
|
||||
<div id="table-vlan"></div>
|
||||
<script>
|
||||
var url_update = "]]
|
||||
print (ntop.getHttpPrefix())
|
||||
print [[/lua/get_grouped_hosts_data.lua?grouped_by=vlan]]
|
||||
|
||||
print ('";')
|
||||
ntop.dumpFile(dirs.installdir .. "/httpdocs/inc/vlan_stats_id.inc")
|
||||
|
||||
print [[
|
||||
$("#table-vlan").datatable({
|
||||
title: "VLAN List",
|
||||
url: url_update ,
|
||||
]]
|
||||
|
||||
print('title: "VLANs",\n')
|
||||
print ('rowCallback: function ( row ) { return vlan_table_setID(row); },')
|
||||
|
||||
-- Set the preference table
|
||||
preference = tablePreferences("rows_number",_GET["perPage"])
|
||||
if (preference ~= "") then print ('perPage: '..preference.. ",\n") end
|
||||
|
||||
-- Automatic default sorted. NB: the column must exist.
|
||||
print ('sort: [ ["' .. getDefaultTableSort("vlan") ..'","' .. getDefaultTableSortOrder("vlan").. '"] ],')
|
||||
|
||||
|
||||
print [[
|
||||
showPagination: true,
|
||||
columns: [
|
||||
{
|
||||
title: "Key",
|
||||
field: "key",
|
||||
hidden: true,
|
||||
css: {
|
||||
textAlign: 'center'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "VLAN ID",
|
||||
field: "column_id",
|
||||
sortable: true,
|
||||
css: {
|
||||
textAlign: 'left'
|
||||
}
|
||||
},
|
||||
]]
|
||||
|
||||
|
||||
ntop.dumpFile(dirs.installdir .. "/httpdocs/inc/vlan_stats_top.inc")
|
||||
|
||||
ntop.dumpFile(dirs.installdir .. "/httpdocs/inc/hosts_stats_bottom.inc")
|
||||
dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")
|
||||
Loading…
Add table
Add a link
Reference in a new issue