mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-02 00:40:10 +00:00
Migrates to Bootstrap 5
Adds bootstrap-5.0.0-beta3-dist Adds bootstrap-5.0.0 Updates bootstrap-5.0.0-beta3-dist to bootstrap-5.0.0-dist initial migration to bs v5 porting to bs5 improvements on dropdown menu filter fixed host map dropdown removed excessive padding fix button toggle re-add blog news removed text decoration for links fix button layout (#5348) remove underscore from href (#5347)
This commit is contained in:
parent
83ff018198
commit
1dce9e5842
252 changed files with 60805 additions and 30259 deletions
|
|
@ -17,7 +17,7 @@ local dirs = ntop.getDirs()
|
|||
local alert_severities = {
|
||||
debug = {
|
||||
severity_id = 1,
|
||||
label = "badge-info",
|
||||
label = "bg-info",
|
||||
icon = "fas fa-fw fa-bug text-info",
|
||||
color = "#a8e4ef",
|
||||
i18n_title = "alerts_dashboard.debug",
|
||||
|
|
@ -26,7 +26,7 @@ local alert_severities = {
|
|||
},
|
||||
info = {
|
||||
severity_id = 2,
|
||||
label = "badge-info",
|
||||
label = "bg-info",
|
||||
icon = "fas fa-fw fa-info-circle text-info",
|
||||
color = "#adebad",
|
||||
i18n_title = "alerts_dashboard.info",
|
||||
|
|
@ -36,7 +36,7 @@ local alert_severities = {
|
|||
},
|
||||
notice = {
|
||||
severity_id = 3,
|
||||
label = "badge-info",
|
||||
label = "bg-info",
|
||||
icon = "fas fa-fw fa-hand-paper text-primary",
|
||||
color = "#70db70",
|
||||
i18n_title = "alerts_dashboard.notice",
|
||||
|
|
@ -46,7 +46,7 @@ local alert_severities = {
|
|||
},
|
||||
warning = {
|
||||
severity_id = 4,
|
||||
label = "badge-warning",
|
||||
label = "bg-warning",
|
||||
icon = "fas fa-fw fa-exclamation-triangle text-warning",
|
||||
color = "#ffc007",
|
||||
i18n_title = "alerts_dashboard.warning",
|
||||
|
|
@ -56,7 +56,7 @@ local alert_severities = {
|
|||
},
|
||||
error = {
|
||||
severity_id = 5,
|
||||
label = "badge-danger",
|
||||
label = "bg-danger",
|
||||
icon = "fas fa-fw fa-exclamation-triangle text-danger",
|
||||
color = "#ff3231",
|
||||
i18n_title = "alerts_dashboard.error",
|
||||
|
|
@ -66,7 +66,7 @@ local alert_severities = {
|
|||
},
|
||||
critical = {
|
||||
severity_id = 6,
|
||||
label = "badge-danger",
|
||||
label = "bg-danger",
|
||||
icon = "fas fa-fw fa-exclamation-triangle text-danger",
|
||||
color = "#fb6962",
|
||||
i18n_title = "alerts_dashboard.critical",
|
||||
|
|
@ -75,7 +75,7 @@ local alert_severities = {
|
|||
},
|
||||
alert = {
|
||||
severity_id = 7,
|
||||
label = "badge-danger",
|
||||
label = "bg-danger",
|
||||
icon = "fas fa-fw fa-bomb text-danger",
|
||||
color = "#fb6962",
|
||||
i18n_title = "alerts_dashboard.alert",
|
||||
|
|
@ -84,7 +84,7 @@ local alert_severities = {
|
|||
},
|
||||
emergency = {
|
||||
severity_id = 8,
|
||||
label = "badge-danger text-danger",
|
||||
label = "bg-danger text-danger",
|
||||
icon = "fas fa-fw fa-bomb",
|
||||
color = "#fb6962",
|
||||
i18n_title = "alerts_dashboard.emergency",
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ function custom_column_utils.printCustomColumnDropdown(base_url, page_params)
|
|||
custom_column_params["custom_column"] = nil
|
||||
|
||||
print[[\
|
||||
<button class="btn btn-link dropdown-toggle" data-toggle="dropdown"><i class="fas fa-columns" aria-hidden="true"></i><span class="caret"></span></button>\
|
||||
<button class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown"><i class="fas fa-columns" aria-hidden="true"></i><span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu scrollable-dropdown" role="menu" id="custom_column_dropdown">]]
|
||||
|
||||
for _, lg in ipairs(custom_column_utils.available_custom_columns) do
|
||||
|
|
|
|||
|
|
@ -379,7 +379,7 @@ end
|
|||
-- ################################################################################
|
||||
|
||||
function discover.printDeviceTypeSelector(device_type, field_name)
|
||||
print [[<div class="form-group"><select name="]] print(field_name) print[[" class="form-control">\
|
||||
print [[<div class="form-group mb-3"><select name="]] print(field_name) print[[" class="form-select">\
|
||||
<option value="0"></option>]]
|
||||
|
||||
discover.printDeviceTypeSelectorOptions(device_type, true)
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ function ebpf_utils.draw_ndpi_piecharts(ifstats, url, host_info, username, pid_n
|
|||
|
||||
<table class="table table-bordered table-striped">
|
||||
<tr>
|
||||
<th class="text-left" colspan=2>]] print(i18n("ndpi_page.overview", {what = i18n("protocol")})) print[[</th>
|
||||
<th class="text-start" colspan=2>]] print(i18n("ndpi_page.overview", {what = i18n("protocol")})) print[[</th>
|
||||
<td>
|
||||
<div class="pie-chart" id="topApplicationProtocols"></div>
|
||||
</td>
|
||||
|
|
@ -214,7 +214,7 @@ function ebpf_utils.draw_ndpi_piecharts(ifstats, url, host_info, username, pid_n
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-left" colspan=2>]] print(i18n("ndpi_page.overview", {what = i18n("category")})) print[[</th>
|
||||
<th class="text-start" colspan=2>]] print(i18n("ndpi_page.overview", {what = i18n("category")})) print[[</th>
|
||||
<td colspan=2>
|
||||
<div class="pie-chart" id="topApplicationCategories"></div>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ function formatTrafficProfile(profile)
|
|||
local res = ""
|
||||
|
||||
if not isEmptyString(profile) then
|
||||
res = "<span class='badge badge-primary'>"..profile.."</span> "
|
||||
res = "<span class='badge bg-primary'>"..profile.."</span> "
|
||||
end
|
||||
|
||||
return res
|
||||
|
|
@ -558,9 +558,9 @@ local function formatFlowHost(flow, cli_or_srv, historical_bounds, hyperlink_suf
|
|||
host_name = host_name.." <i class='fas fa-ban' aria-hidden='true' title='Blacklisted'></i>"
|
||||
end
|
||||
if(flow[cli_or_srv .. ".localhost"] == true) then
|
||||
host_name = host_name .. ' <abbr title=\"'.. i18n("details.label_local_host") ..'\"><span class="badge badge-success">'..i18n("details.label_short_local_host")..'</span></abbr>'
|
||||
host_name = host_name .. ' <abbr title=\"'.. i18n("details.label_local_host") ..'\"><span class="badge bg-success">'..i18n("details.label_short_local_host")..'</span></abbr>'
|
||||
else
|
||||
host_name = host_name .. ' <abbr title=\"'.. i18n("details.label_remote") ..'\"><span class="badge badge-secondary">'..i18n("details.label_short_remote")..'</span></abbr>'
|
||||
host_name = host_name .. ' <abbr title=\"'.. i18n("details.label_remote") ..'\"><span class="badge bg-secondary">'..i18n("details.label_short_remote")..'</span></abbr>'
|
||||
end
|
||||
|
||||
return hostinfo2detailshref(flow2hostinfo(flow, cli_or_srv), hyperlink_params, host_name, nil, true --[[ perform link existance checks --]])
|
||||
|
|
@ -1432,8 +1432,8 @@ function printBlockFlowJs()
|
|||
var row_id = flow_key + "_" + flow_hash_id;
|
||||
if (data.status == "BLOCKED") {
|
||||
$('#'+row_id+'_block')
|
||||
.removeClass('badge-secondary')
|
||||
.addClass('badge-danger')
|
||||
.removeClass('bg-secondary')
|
||||
.addClass('bg-danger')
|
||||
.attr('title', ']] print(i18n("flow_details.flow_traffic_is_dropped")) print[[');
|
||||
}
|
||||
},
|
||||
|
|
@ -1466,8 +1466,8 @@ function printL4ProtoDropdown(base_url, page_params, l4_proto)
|
|||
end
|
||||
|
||||
print[[\
|
||||
<button class="btn btn-link dropdown-toggle" data-toggle="dropdown">]] print(i18n("flows_page.l4_protocol")) print[[]] print(l4proto_filter) print[[<span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu dropdown-menu-right scrollable-dropdown" role="menu" id="flow_dropdown">\
|
||||
<button class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown">]] print(i18n("flows_page.l4_protocol")) print[[]] print(l4proto_filter) print[[<span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu dropdown-menu-end scrollable-dropdown" role="menu" id="flow_dropdown">\
|
||||
<li><a class="dropdown-item" href="]] print(getPageUrl(base_url, l4proto_params_non_tcp)) print[[">]] print(i18n("flows_page.all_l4_protocols")) print[[</a></li>]]
|
||||
|
||||
if l4_proto then
|
||||
|
|
@ -1517,8 +1517,8 @@ local function printFlowDevicesFilterDropdown(base_url, page_params)
|
|||
end
|
||||
|
||||
print[[, '<div class="btn-group float-right">\
|
||||
<button class="btn btn-link dropdown-toggle" data-toggle="dropdown">]] print(i18n("flows_page.device_ip")) print[[]] print(cur_dev_filter) print[[<span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu dropdown-menu-right scrollable-dropdown" role="menu" id="flow_dropdown">\
|
||||
<button class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown">]] print(i18n("flows_page.device_ip")) print[[]] print(cur_dev_filter) print[[<span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu dropdown-menu-end scrollable-dropdown" role="menu" id="flow_dropdown">\
|
||||
<li><a class="dropdown-item" href="]] print(getPageUrl(base_url, dev_params)) print[[">]] print(i18n("flows_page.all_devices")) print[[</a></li>\]]
|
||||
for _, dev_ip in ipairs(devips) do
|
||||
local dev_name = dev_ip
|
||||
|
|
@ -1559,7 +1559,7 @@ local function printFlowDevicesFilterDropdown(base_url, page_params)
|
|||
|
||||
if_params[direction] = nil
|
||||
print[[, '<div class="btn-group float-right">\
|
||||
<button class="btn btn-link dropdown-toggle" data-toggle="dropdown">]] print(i18n("flows_page."..direction)) print[[]] print(cur_if_filter) print[[<span class="caret"></span></button>\
|
||||
<button class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown">]] print(i18n("flows_page."..direction)) print[[]] print(cur_if_filter) print[[<span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu scrollable-dropdown" role="menu" id="flow_dropdown">\
|
||||
<li><a class="dropdown-item" href="]] print(getPageUrl(base_url, if_params)) print[[">]] print(i18n("flows_page.all_"..direction)) print[[</a></li>\]]
|
||||
|
||||
|
|
@ -1613,7 +1613,7 @@ function printActiveFlowsDropdown(base_url, page_params, ifstats, flowstats, is_
|
|||
|
||||
print[['\
|
||||
<div class="btn-group">\
|
||||
<button class="btn btn-link dropdown-toggle" data-toggle="dropdown">]] print(i18n("flows_page.hosts")) print(getParamFilter(page_params, "flowhosts_type")) print[[<span class="caret"></span></button>\
|
||||
<button class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown">]] print(i18n("flows_page.hosts")) print(getParamFilter(page_params, "flowhosts_type")) print[[<span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu scrollable-dropdown" role="menu" id="flow_dropdown">\
|
||||
<li><a class="dropdown-item" href="]] print(getPageUrl(base_url, flowhosts_type_params)) print[[">]] print(i18n("flows_page.all_hosts")) print[[</a></li>\]]
|
||||
printDropdownEntries({
|
||||
|
|
@ -1634,7 +1634,7 @@ function printActiveFlowsDropdown(base_url, page_params, ifstats, flowstats, is_
|
|||
|
||||
print[[, '\
|
||||
<div class="btn-group">\
|
||||
<button class="btn btn-link dropdown-toggle" data-toggle="dropdown">]] print(i18n("status")) print(getParamFilter(page_params, "alert_type")) print[[<span class="caret"></span></button>\
|
||||
<button class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown">]] print(i18n("status")) print(getParamFilter(page_params, "alert_type")) print[[<span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu scrollable-dropdown" role="menu">\
|
||||
<li><a class="dropdown-item" href="]] print(getPageUrl(base_url, alert_type_params)) print[[">]] print(i18n("flows_page.all_flows")) print[[</a></li>\]]
|
||||
|
||||
|
|
@ -1681,7 +1681,7 @@ function printActiveFlowsDropdown(base_url, page_params, ifstats, flowstats, is_
|
|||
|
||||
print[[, '\
|
||||
<div class="btn-group">\
|
||||
<button class="btn btn-link dropdown-toggle" data-toggle="dropdown">]] print(i18n("flows_page.alert_type_severity")) print(getParamFilter(page_params, "alert_type_severity")) print[[<span class="caret"></span></button>\
|
||||
<button class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown">]] print(i18n("flows_page.alert_type_severity")) print(getParamFilter(page_params, "alert_type_severity")) print[[<span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu scrollable-dropdown" role="menu">\
|
||||
<li><a class="dropdown-item" href="]] print(getPageUrl(base_url, alert_type_severity_params)) print[[">]] print(i18n("flows_page.all_flows")) print[[</a></li>]]
|
||||
|
||||
|
|
@ -1713,7 +1713,7 @@ function printActiveFlowsDropdown(base_url, page_params, ifstats, flowstats, is_
|
|||
|
||||
print[[, '\
|
||||
<div class="btn-group">\
|
||||
<button class="btn btn-link dropdown-toggle" data-toggle="dropdown">]] print(i18n("flows_page.tcp_state")) print(getParamFilter(page_params, "tcp_flow_state")) print[[<span class="caret"></span></button>\
|
||||
<button class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown">]] print(i18n("flows_page.tcp_state")) print(getParamFilter(page_params, "tcp_flow_state")) print[[<span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu scrollable-dropdown" role="menu">\
|
||||
<li><a class="dropdown-item" href="]] print(getPageUrl(base_url, tcp_state_params)) print[[">]] print(i18n("flows_page.all_flows")) print[[</a></li>\]]
|
||||
|
||||
|
|
@ -1736,7 +1736,7 @@ function printActiveFlowsDropdown(base_url, page_params, ifstats, flowstats, is_
|
|||
|
||||
print[[, '\
|
||||
<div class="btn-group">\
|
||||
<button class="btn btn-link dropdown-toggle" data-toggle="dropdown">]] print(i18n("flows_page.direction")) print(getParamFilter(page_params, "traffic_type")) print[[<span class="caret"></span></button>\
|
||||
<button class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown">]] print(i18n("flows_page.direction")) print(getParamFilter(page_params, "traffic_type")) print[[<span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu scrollable-dropdown" role="menu">\
|
||||
<li><a class="dropdown-item" href="]] print(getPageUrl(base_url, traffic_type_params)) print[[">]] print(i18n("flows_page.all_flows")) print[[</a></li>\]]
|
||||
printDropdownEntries({
|
||||
|
|
@ -1760,7 +1760,7 @@ function printActiveFlowsDropdown(base_url, page_params, ifstats, flowstats, is_
|
|||
if not table.empty(pods) then
|
||||
print[[, '\
|
||||
<div class="btn-group">\
|
||||
<button class="btn btn-link dropdown-toggle" data-toggle="dropdown">]] print(i18n("containers_stats.pod")) print(getParamFilter(page_params, "pod")) print[[<span class="caret"></span></button>\
|
||||
<button class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown">]] print(i18n("containers_stats.pod")) print(getParamFilter(page_params, "pod")) print[[<span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu scrollable-dropdown" role="menu">\
|
||||
]]
|
||||
local entries = {}
|
||||
|
|
@ -1789,7 +1789,7 @@ function printActiveFlowsDropdown(base_url, page_params, ifstats, flowstats, is_
|
|||
if not table.empty(containers) then
|
||||
print[[, '\
|
||||
<div class="btn-group">\
|
||||
<button class="btn btn-link dropdown-toggle" data-toggle="dropdown">]] print(i18n("containers_stats.container")) print(getParamFilter(page_params, "container")) print[[<span class="caret"></span></button>\
|
||||
<button class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown">]] print(i18n("containers_stats.container")) print(getParamFilter(page_params, "container")) print[[<span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu scrollable-dropdown" role="menu">\
|
||||
]]
|
||||
local entries = {}
|
||||
|
|
@ -1810,7 +1810,7 @@ function printActiveFlowsDropdown(base_url, page_params, ifstats, flowstats, is_
|
|||
end
|
||||
|
||||
-- L7 Application
|
||||
print(', \'<div class="btn-group"><button class="btn btn-link dropdown-toggle" data-toggle="dropdown">'..i18n("report.applications")..' ' .. getParamFilter(page_params, "application") .. '<span class="caret"></span></button> <ul class="dropdown-menu scrollable-dropdown" role="menu" id="flow_dropdown">')
|
||||
print(', \'<div class="btn-group"><button class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown">'..i18n("report.applications")..' ' .. getParamFilter(page_params, "application") .. '<span class="caret"></span></button> <ul class="dropdown-menu scrollable-dropdown" role="menu" id="flow_dropdown">')
|
||||
print('<li><a class="dropdown-item" href="')
|
||||
|
||||
-- table.clone needed to modify some parameters while keeping the original unchanged
|
||||
|
|
@ -1846,7 +1846,7 @@ function printActiveFlowsDropdown(base_url, page_params, ifstats, flowstats, is_
|
|||
print("</ul> </div>'")
|
||||
|
||||
-- L7 Application Category
|
||||
print(', \'<div class="btn-group"><button class="btn btn-link dropdown-toggle" data-toggle="dropdown">'..i18n("users.categories")..' ' .. getParamFilter(page_params, "category") .. '<span class="caret"></span></button> <ul class="dropdown-menu scrollable-dropdown" role="menu" id="flow_dropdown">')
|
||||
print(', \'<div class="btn-group"><button class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown">'..i18n("users.categories")..' ' .. getParamFilter(page_params, "category") .. '<span class="caret"></span></button> <ul class="dropdown-menu scrollable-dropdown" role="menu" id="flow_dropdown">')
|
||||
print('<li><a class="dropdown-item" href="')
|
||||
-- table.clone needed to modify some parameters while keeping the original unchanged
|
||||
local category_filter_params = table.clone(page_params)
|
||||
|
|
@ -1925,7 +1925,7 @@ function printActiveFlowsDropdown(base_url, page_params, ifstats, flowstats, is_
|
|||
|
||||
if profiles_defined then
|
||||
-- Traffic Profiles
|
||||
print(', \'<div class="btn-group"><button class="btn btn-link dropdown-toggle" data-toggle="dropdown">'..i18n("traffic_profiles.traffic_profiles")..' ' .. getParamFilter(page_params, "traffic_profile") .. '<span class="caret"></span></button> <ul class="dropdown-menu scrollable-dropdown" role="menu" id="flow_dropdown">')
|
||||
print(', \'<div class="btn-group"><button class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown">'..i18n("traffic_profiles.traffic_profiles")..' ' .. getParamFilter(page_params, "traffic_profile") .. '<span class="caret"></span></button> <ul class="dropdown-menu scrollable-dropdown" role="menu" id="flow_dropdown">')
|
||||
print('<li><a class="dropdown-item" href="')
|
||||
-- table.clone needed to modify some parameters while keeping the original unchanged
|
||||
local traffic_profile_filter_params = table.clone(page_params)
|
||||
|
|
|
|||
|
|
@ -354,15 +354,15 @@ function format_utils.formatFullAddressCategory(host)
|
|||
end
|
||||
|
||||
if(host["is_broadcast"] == true) then
|
||||
addr_category = addr_category .. " <abbr title=\"".. i18n("broadcast") .."\"><span class='badge badge-dark'>" ..i18n("short_broadcast").. "</span></abbr>"
|
||||
addr_category = addr_category .. " <abbr title=\"".. i18n("broadcast") .."\"><span class='badge bg-dark'>" ..i18n("short_broadcast").. "</span></abbr>"
|
||||
end
|
||||
|
||||
if(host["broadcast_domain_host"] == true) then
|
||||
addr_category = addr_category .. " <span class='badge badge-info'><i class='fas fa-sitemap' title='"..i18n("hosts_stats.label_broadcast_domain_host").."'></i></span>"
|
||||
addr_category = addr_category .. " <span class='badge bg-info'><i class='fas fa-sitemap' title='"..i18n("hosts_stats.label_broadcast_domain_host").."'></i></span>"
|
||||
end
|
||||
|
||||
if(host["privatehost"] == true) then
|
||||
addr_category = addr_category .. ' <abbr title=\"'.. i18n("details.label_private_ip") ..'\"><span class="badge badge-warning">'..i18n("details.label_short_private_ip")..'</span></abbr>'
|
||||
addr_category = addr_category .. ' <abbr title=\"'.. i18n("details.label_private_ip") ..'\"><span class="badge bg-warning">'..i18n("details.label_short_private_ip")..'</span></abbr>'
|
||||
end
|
||||
|
||||
if(host["dhcpHost"] == true) then
|
||||
|
|
|
|||
|
|
@ -264,7 +264,7 @@ function graph_utils.stackedProgressBars(total, bars, other_label, formatter, cs
|
|||
res[#res + 1] = [[<span>]]
|
||||
if(num > 0) then res[#res + 1] = [[<br>]] end
|
||||
if bar.link ~= nil then res[#res + 1] = [[<a href="]] .. bar.link .. [[">]] end
|
||||
res[#res + 1] = [[<span class="badge badge-]].. (bar.class) ..[[" style="]] .. bar.style .. [["> </span>]]
|
||||
res[#res + 1] = [[<span class="badge bg-]].. (bar.class) ..[[" style="]] .. bar.style .. [["> </span>]]
|
||||
if bar.link ~= nil then res[#res + 1] = [[</a>]] end
|
||||
res[#res + 1] = [[<span> ]] .. bar.title .. " (".. formatter(bar.value) ..")</span></span>"
|
||||
num = num + 1
|
||||
|
|
@ -417,13 +417,13 @@ function graph_utils.drawGraphs(ifid, schema, tags, zoomLevel, baseurl, selected
|
|||
<div class='card'>
|
||||
<div class='card-header'>
|
||||
<ul class="nav nav-tabs card-header-tabs" role="tablist" id="historical-tabs-container">
|
||||
<li class="nav-item active"> <a class="nav-link active" href="#historical-tab-chart" role="tab" data-toggle="tab"> Chart </a> </li>
|
||||
<li class="nav-item active"> <a class="nav-link active" href="#historical-tab-chart" role="tab" data-bs-toggle="tab"> Chart </a> </li>
|
||||
]]
|
||||
|
||||
local show_historical_tabs = ntop.getPrefs().is_dump_flows_to_mysql_enabled and options.show_historical
|
||||
|
||||
if show_historical_tabs then
|
||||
print('<li class="nav-item"><a class="nav-link" href="#historical-flows" role="tab" data-toggle="tab" id="tab-flows-summary"> Flows </a> </li>\n')
|
||||
print('<li class="nav-item"><a class="nav-link" href="#historical-flows" role="tab" data-bs-toggle="tab" id="tab-flows-summary"> Flows </a> </li>\n')
|
||||
end
|
||||
|
||||
print[[
|
||||
|
|
@ -446,7 +446,7 @@ function graph_utils.drawGraphs(ifid, schema, tags, zoomLevel, baseurl, selected
|
|||
if(options.timeseries) then
|
||||
print [[
|
||||
<div class="dropdown d-inline">
|
||||
<button class="btn btn-light btn-sm dropdown-toggle" data-toggle="dropdown">Timeseries <span class="caret"></span></button>
|
||||
<button class="btn btn-light btn-sm dropdown-toggle" data-bs-toggle="dropdown">Timeseries <span class="caret"></span></button>
|
||||
<div class="dropdown-menu scrollable-dropdown">
|
||||
]]
|
||||
|
||||
|
|
@ -459,7 +459,7 @@ function graph_utils.drawGraphs(ifid, schema, tags, zoomLevel, baseurl, selected
|
|||
]]
|
||||
end -- options.timeseries
|
||||
|
||||
print('<span class="mx-1">Timeframe:</span><div class="btn-group btn-group-toggle" data-toggle="buttons" id="graph_zoom">\n')
|
||||
print('<span class="mx-1">Timeframe:</span><div class="btn-group" role="group" id="graph_zoom">\n')
|
||||
|
||||
for k,v in ipairs(graph_common.zoom_vals) do
|
||||
-- display 1 minute button only for networks and interface stats
|
||||
|
|
@ -470,13 +470,7 @@ function graph_utils.drawGraphs(ifid, schema, tags, zoomLevel, baseurl, selected
|
|||
elseif graph_common.zoom_vals[k][1] == '5m' and min_zoom ~= '1m' and min_zoom ~= '5m' then
|
||||
goto continue
|
||||
end
|
||||
|
||||
if(graph_common.zoom_vals[k][1] == zoomLevel) then
|
||||
print([[<label class="btn bg-primary text-white">]])
|
||||
else
|
||||
print([[<label class="btn btn-link">]])
|
||||
end
|
||||
|
||||
|
||||
local params = table.merge(page_params, {zoom=graph_common.zoom_vals[k][1]})
|
||||
|
||||
-- Additional parameters
|
||||
|
|
@ -488,8 +482,15 @@ function graph_utils.drawGraphs(ifid, schema, tags, zoomLevel, baseurl, selected
|
|||
end
|
||||
|
||||
local url = getPageUrl(baseurl, params)
|
||||
print('<input type="radio" class="btn-check" name="options" id="zoom_level_'..k..'" value="'..url..'">')
|
||||
|
||||
if(graph_common.zoom_vals[k][1] == zoomLevel) then
|
||||
print([[<label class="btn bg-primary text-white" for='zoom_level_]].. k ..[['>]].. graph_common.zoom_vals[k][1] ..[[</label>]])
|
||||
else
|
||||
print([[<label class="btn btn-outline-secondary" for='zoom_level_]].. k ..[['>]].. graph_common.zoom_vals[k][1] ..[[</label>]])
|
||||
end
|
||||
|
||||
|
||||
print('<input type="radio" name="options" id="zoom_level_'..k..'" value="'..url..'">'.. graph_common.zoom_vals[k][1] ..'</input></label>\n')
|
||||
::continue::
|
||||
end
|
||||
|
||||
|
|
@ -869,7 +870,7 @@ function graph_utils.printProtocolQuota(proto, ndpi_stats, category_stats, quota
|
|||
if not traffic_quota_ratio then traffic_quota_ratio = 0 end
|
||||
|
||||
if show_td then
|
||||
output[#output + 1] = [[<td class='text-right']]..ternary(bytes_exceeded, ' style=\'color:red;\'', '').."><span>"..lb_bytes..ternary(hide_limit, "", " / "..lb_bytes_quota).."</span>"
|
||||
output[#output + 1] = [[<td class='text-end']]..ternary(bytes_exceeded, ' style=\'color:red;\'', '').."><span>"..lb_bytes..ternary(hide_limit, "", " / "..lb_bytes_quota).."</span>"
|
||||
end
|
||||
|
||||
output[#output + 1] = [[
|
||||
|
|
@ -891,7 +892,7 @@ function graph_utils.printProtocolQuota(proto, ndpi_stats, category_stats, quota
|
|||
local duration_quota_ratio = round(duration_taken * 100 / (duration_taken+duration_remaining), 0) or 0
|
||||
|
||||
if show_td then
|
||||
output[#output + 1] = [[<td class='text-right']]..ternary(time_exceeded, ' style=\'color:red;\'', '').."><span>"..lb_duration..ternary(hide_limit, "", " / "..lb_duration_quota).."</span>"
|
||||
output[#output + 1] = [[<td class='text-end']]..ternary(time_exceeded, ' style=\'color:red;\'', '').."><span>"..lb_duration..ternary(hide_limit, "", " / "..lb_duration_quota).."</span>"
|
||||
end
|
||||
|
||||
output[#output + 1] = ([[
|
||||
|
|
@ -954,7 +955,7 @@ function graph_utils.printPoolChangeDropdown(ifId, pool_id, have_nedge)
|
|||
output[#output + 1] = [[<tr>
|
||||
<th>]] .. i18n(ternary(have_nedge, "nedge.user", "host_config.host_pool")) .. [[</th>
|
||||
<td>
|
||||
<select name="pool" class="form-control" style="width:20em; display:inline;">]]
|
||||
<select name="pool" class="form-select" style="width:20em; display:inline;">]]
|
||||
|
||||
output[#output + 1] = graph_utils.poolDropdown(ifId, pool_id)
|
||||
|
||||
|
|
@ -962,7 +963,7 @@ function graph_utils.printPoolChangeDropdown(ifId, pool_id, have_nedge)
|
|||
|
||||
output[#output + 1] = [[
|
||||
</select>
|
||||
<a class='ml-1' href="]] .. ntop.getHttpPrefix() .. edit_pools_link .. [["><i class="fas fa-edit" aria-hidden="true" title="]]
|
||||
<a class='ms-1' href="]] .. ntop.getHttpPrefix() .. edit_pools_link .. [["><i class="fas fa-edit" aria-hidden="true" title="]]
|
||||
..(have_nedge and i18n("edit") or '')
|
||||
.. [["></i></a>
|
||||
</tr>]]
|
||||
|
|
@ -982,7 +983,7 @@ function graph_utils.printCategoryDropdownButton(by_id, cat_id_or_name, base_url
|
|||
count_callback = count_callback or count_all
|
||||
|
||||
-- 'Category' button
|
||||
print('\'<div class="btn-group float-right"><div class="btn btn-link dropdown-toggle" data-toggle="dropdown">'..
|
||||
print('\'<div class="btn-group float-right"><div class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown">'..
|
||||
i18n("category") .. ternary(not isEmptyString(cat_id_or_name), '<span class="fas fa-filter"></span>', '') ..
|
||||
'<span class="caret"></span></div> <ul class="dropdown-menu scrollable-dropdown" role="menu" style="min-width: 90px;">')
|
||||
|
||||
|
|
|
|||
|
|
@ -1190,7 +1190,7 @@ function historicalFlowsTab(ifId, host, epoch_begin, epoch_end, l7proto, l4proto
|
|||
<br>
|
||||
<div class="container-fluid" id="historical-flows-container">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item active"> <a class="nav-link active" href="#historical-flows-summary" role="tab" data-toggle="tab"> ]] print(i18n("db_explorer.summary")) print[[ </a> </li>
|
||||
<li class="nav-item active"> <a class="nav-link active" href="#historical-flows-summary" role="tab" data-bs-toggle="tab"> ]] print(i18n("db_explorer.summary")) print[[ </a> </li>
|
||||
]]
|
||||
|
||||
print '<li class="nav-item" id="tab-ipv4-li" style="display: none;"> <a class="nav-link" href="#tab-ipv4" role="tab"> ' print(i18n("ipv4")) print' </a> </li>'
|
||||
|
|
@ -1285,7 +1285,7 @@ $('a[href="#historical-flows"]').on('shown.bs.tab', function (e) {
|
|||
$('a[href="#historical-flows"]').attr("loaded", 1);
|
||||
|
||||
// disable all tabs
|
||||
$("#historical-flows-container").find("li").addClass("disabled").find("a").removeAttr("data-toggle");
|
||||
$("#historical-flows-container").find("li").addClass("disabled").find("a").removeAttr("data-bs-toggle");
|
||||
|
||||
xhr = $.ajax({
|
||||
type: 'GET',]]
|
||||
|
|
@ -1320,7 +1320,7 @@ print[[
|
|||
}
|
||||
|
||||
// re-enable all tabs
|
||||
$("#historical-flows-container").find("li").removeClass("disabled").find("a").attr("data-toggle", "tab");
|
||||
$("#historical-flows-container").find("li").removeClass("disabled").find("a").attr("data-bs-toggle", "tab");
|
||||
|
||||
// populate the number of flows
|
||||
$("#tab-ipv4").attr("num_flows", msg.count.IPv4.tot_flows)
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ local function printHashTablesDropdown(base_url, page_params)
|
|||
hash_table_params["hash_table"] = nil
|
||||
|
||||
print[[\
|
||||
<button class="btn btn-link dropdown-toggle" data-toggle="dropdown">]] print(i18n("internals.hash_table")) print[[]] print(hash_table_filter) print[[<span class="caret"></span></button>\
|
||||
<button class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown">]] print(i18n("internals.hash_table")) print[[]] print(hash_table_filter) print[[<span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu scrollable-dropdown" role="menu" id="flow_dropdown">\]]
|
||||
|
||||
print[[<li><a class="dropdown-item" href="]] print(getPageUrl(base_url, hash_table_params)) print[[">]] print(i18n("internals.all_hash_tables")) print[[</a></li>\]]
|
||||
|
|
@ -210,7 +210,7 @@ local function printPeriodicactivityIssuesDropdown(base_url, page_params)
|
|||
periodic_activity_issue_params["periodic_script_issue"] = nil
|
||||
|
||||
print[[\
|
||||
<button class="btn btn-link dropdown-toggle" data-toggle="dropdown">]] print(i18n("internals.periodic_activity_issues")) print[[]] print(periodic_activity_issue_filter) print[[<span class="caret"></span></button>\
|
||||
<button class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown">]] print(i18n("internals.periodic_activity_issues")) print[[]] print(periodic_activity_issue_filter) print[[<span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu scrollable-dropdown" role="menu" id="flow_dropdown">\]]
|
||||
|
||||
print[[<li><a class="dropdown-item" href="]] print(getPageUrl(base_url, periodic_activity_issue_params)) print[[">]] print(i18n("internals.all_periodic_activities")) print[[</a></li>\]]
|
||||
|
|
@ -239,7 +239,7 @@ local function printPeriodicactivityDropdown(base_url, page_params)
|
|||
periodic_activity_params["periodic_script"] = nil
|
||||
|
||||
print[[\
|
||||
<button class="btn btn-link dropdown-toggle" data-toggle="dropdown">]] print(i18n("internals.periodic_activity")) print[[]] print(periodic_activity_filter) print[[<span class="caret"></span></button>\
|
||||
<button class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown">]] print(i18n("internals.periodic_activity")) print[[]] print(periodic_activity_filter) print[[<span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu scrollable-dropdown" role="menu" id="flow_dropdown">\]]
|
||||
|
||||
print[[<li><a class="dropdown-item" href="]] print(getPageUrl(base_url, periodic_activity_params)) print[[">]] print(i18n("internals.all_periodic_activities")) print[[</a></li>\]]
|
||||
|
|
@ -264,9 +264,9 @@ local function printPeriodicActivitiesTable(base_url, ifid, ts_creation)
|
|||
<b>]] print(i18n("notes")) print[[</b>
|
||||
<ul>
|
||||
<li>]] print(i18n("internals.status_description")) print[[</li><ul>
|
||||
<li><span class="badge badge-secondary">]] print(i18n("internals.sleeping")) print[[</span> ]] print(i18n("internals.status_sleeping_descr")) print[[</li>
|
||||
<li><span class="badge badge-warning">]] print(i18n("internals.queued")) print[[</span> ]] print(i18n("internals.status_queued_descr")) print[[</li>
|
||||
<li><span class="badge badge-success">]] print(i18n("running")) print[[</span> ]] print(i18n("internals.status_running_descr")) print[[</li>
|
||||
<li><span class="badge bg-secondary">]] print(i18n("internals.sleeping")) print[[</span> ]] print(i18n("internals.status_sleeping_descr")) print[[</li>
|
||||
<li><span class="badge bg-warning">]] print(i18n("internals.queued")) print[[</span> ]] print(i18n("internals.status_queued_descr")) print[[</li>
|
||||
<li><span class="badge bg-success">]] print(i18n("running")) print[[</span> ]] print(i18n("internals.status_running_descr")) print[[</li>
|
||||
</ul>
|
||||
<li>]] print(i18n("internals.periodic_activities_descr")) print[[</li>
|
||||
<li>]] print(i18n("internals.periodic_activities_periodicity_descr")) print[[</li>
|
||||
|
|
@ -281,7 +281,7 @@ local function printPeriodicActivitiesTable(base_url, ifid, ts_creation)
|
|||
</ul>
|
||||
<script type='text/javascript'>
|
||||
$(document).ready(function(){
|
||||
$('[data-toggle="popover"]').popover({
|
||||
$('[data-bs-toggle="popover"]').popover({
|
||||
placement : 'top',
|
||||
trigger : 'hover'
|
||||
});
|
||||
|
|
@ -465,7 +465,7 @@ local function printUserScriptsDropdown(base_url, page_params)
|
|||
user_script_target_params["user_script_target"] = nil
|
||||
|
||||
print[[\
|
||||
<button class="btn btn-link dropdown-toggle" data-toggle="dropdown">]] print(i18n("internals.user_script_target")) print[[]] print(user_script_target_filter) print[[<span class="caret"></span></button>\
|
||||
<button class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown">]] print(i18n("internals.user_script_target")) print[[]] print(user_script_target_filter) print[[<span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu" role="menu" id="flow_dropdown">\]]
|
||||
|
||||
print[[<li><a class="dropdown-item" href="]] print(getPageUrl(base_url, user_script_target_params)) print[[">]] print(i18n("internals.all_user_script_targets")) print[[</a></li>\]]
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ function live_traffic_utils.printLiveTrafficForm(ifid, host_info)
|
|||
|
||||
print[[
|
||||
<div class="input-group mb-1">
|
||||
<div class="input-group-prepend">
|
||||
<select class="btn border bg-white" id="duration" name=duration>
|
||||
<option value=10>10 sec</option>
|
||||
<option value=30>30 sec</option>
|
||||
|
|
@ -41,7 +40,6 @@ function live_traffic_utils.printLiveTrafficForm(ifid, host_info)
|
|||
<option value=300>5 min</option>
|
||||
<option value=600>10 min</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label for="bpf_filter" class="sr-only">]] print(i18n("db_explorer.filter_bpf")) print[[</label>
|
||||
<input type="text" class="form-control" id="live-capture-bpf-filter" name="bpf_filter" placeholder="]] print(i18n("db_explorer.filter_bpf")) print[["></input>
|
||||
|
|
|
|||
|
|
@ -405,7 +405,7 @@ function printIpVersionDropdown(base_url, page_params)
|
|||
ipversion_params["version"] = nil
|
||||
|
||||
print[[\
|
||||
<button class="btn btn-link dropdown-toggle" data-toggle="dropdown">]] print(i18n("flows_page.ip_version")) print[[]] print(ipversion_filter) print[[<span class="caret"></span></button>\
|
||||
<button class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown">]] print(i18n("flows_page.ip_version")) print[[]] print(ipversion_filter) print[[<span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu scrollable-dropdown" role="menu" id="flow_dropdown">\
|
||||
<li><a class="dropdown-item" href="]] print(getPageUrl(base_url, ipversion_params)) print[[">]] print(i18n("flows_page.all_ip_versions")) print[[</a></li>\
|
||||
<li><a class="dropdown-item ]] if ipversion == "4" then print('active') end print[[" href="]] ipversion_params["version"] = "4"; print(getPageUrl(base_url, ipversion_params)); print[[">]] print(i18n("flows_page.ipv4_only")) print[[</a></li>\
|
||||
|
|
@ -437,7 +437,7 @@ function printVLANFilterDropdown(base_url, page_params)
|
|||
vlan_id_params["vlan"] = nil
|
||||
|
||||
print[[\
|
||||
<button class="btn btn-link dropdown-toggle" data-toggle="dropdown">]] print(i18n("flows_page.vlan")) print[[]] print(vlan_id_filter) print[[<span class="caret"></span></button>\
|
||||
<button class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown">]] print(i18n("flows_page.vlan")) print[[]] print(vlan_id_filter) print[[<span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu scrollable-dropdown" role="menu" id="flow_dropdown">\
|
||||
<li><a class="dropdown-item" href="]] print(getPageUrl(base_url, vlan_id_params)) print[[">]] print(i18n("flows_page.all_vlan_ids")) print[[</a></li>\]]
|
||||
for _, vid in ipairs(ids) do
|
||||
|
|
@ -481,8 +481,8 @@ function printDSCPDropdown(base_url, page_params, dscp_list)
|
|||
end
|
||||
|
||||
print[[\
|
||||
<button class="btn btn-link dropdown-toggle" data-toggle="dropdown">]] print(i18n("flows_page.dscp")) print[[]] print(dscp_filter) print[[<span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu dropdown-menu-right scrollable-dropdown" role="menu" id="flow_dropdown">\
|
||||
<button class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown">]] print(i18n("flows_page.dscp")) print[[]] print(dscp_filter) print[[<span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu dropdown-menu-end scrollable-dropdown" role="menu" id="flow_dropdown">\
|
||||
<li><a class="dropdown-item" href="]] print(getPageUrl(base_url, dscp_params_non_filter)) print[[">]] print(i18n("flows_page.all_dscp")) print[[</a></li>]]
|
||||
|
||||
for key, value in pairsByKeys(ordered_dscp_list, asc) do
|
||||
|
|
@ -538,8 +538,8 @@ function printHostPoolDropdown(base_url, page_params, host_pool_list)
|
|||
end
|
||||
|
||||
print[[\
|
||||
<button class="btn btn-link dropdown-toggle" data-toggle="dropdown">]] print(i18n("details.host_pool")) print[[]] print(host_pool_filter) print[[<span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu dropdown-menu-right scrollable-dropdown" role="menu" id="flow_dropdown">\
|
||||
<button class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown">]] print(i18n("details.host_pool")) print[[]] print(host_pool_filter) print[[<span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu dropdown-menu-end scrollable-dropdown" role="menu" id="flow_dropdown">\
|
||||
<li><a class="dropdown-item" href="]] print(getPageUrl(base_url, host_pool_params_non_filter)) print[[">]] print(i18n("flows_page.all_host_pool")) print[[</a></li>]]
|
||||
|
||||
for key, value in pairsByKeys(ordered_host_pool_list, asc) do
|
||||
|
|
@ -572,7 +572,7 @@ function printTrafficTypeFilterDropdown(base_url, page_params)
|
|||
traffic_type_params["traffic_type"] = nil
|
||||
|
||||
print[[\
|
||||
<button class="btn btn-link dropdown-toggle" data-toggle="dropdown">]] print(i18n("flows_page.direction")) print[[]] print(traffic_type_filter) print[[<span class="caret"></span></button>\
|
||||
<button class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown">]] print(i18n("flows_page.direction")) print[[]] print(traffic_type_filter) print[[<span class="caret"></span></button>\
|
||||
<ul class="dropdown-menu scrollable-dropdown" role="menu" id="flow_dropdown">\
|
||||
<li><a class="dropdown-item" href="]] print(getPageUrl(base_url, traffic_type_params)) print[[">]] print(i18n("hosts_stats.traffic_type_all")) print[[</a></li>\]]
|
||||
|
||||
|
|
@ -1833,7 +1833,7 @@ function hostinfo2detailshref(host_info, href_params, href_value, href_tooltip,
|
|||
local hostdetails_url = hostinfo2detailsurl(host_info, href_params, href_check)
|
||||
|
||||
if not isEmptyString(hostdetails_url) then
|
||||
res = string.format("<a href='%s' data-toggle='tooltip' title='%s'>%s</a>",
|
||||
res = string.format("<a href='%s' data-bs-toggle='tooltip' title='%s'>%s</a>",
|
||||
hostdetails_url, href_tooltip or '', href_value or '')
|
||||
else
|
||||
res = href_value or ''
|
||||
|
|
@ -2938,14 +2938,14 @@ end
|
|||
|
||||
-- print TCP flags
|
||||
function printTCPFlags(flags)
|
||||
if(hasbit(flags,0x01)) then print('<span class="badge badge-info">FIN</span> ') end
|
||||
if(hasbit(flags,0x02)) then print('<span class="badge badge-info">SYN</span> ') end
|
||||
if(hasbit(flags,0x04)) then print('<span class="badge badge-danger">RST</span> ') end
|
||||
if(hasbit(flags,0x08)) then print('<span class="badge badge-info">PUSH</span> ') end
|
||||
if(hasbit(flags,0x10)) then print('<span class="badge badge-info">ACK</span> ') end
|
||||
if(hasbit(flags,0x20)) then print('<span class="badge badge-info">URG</span> ') end
|
||||
if(hasbit(flags,0x40)) then print('<span class="badge badge-info">ECE</span> ') end
|
||||
if(hasbit(flags,0x80)) then print('<span class="badge badge-info">CWR</span> ') end
|
||||
if(hasbit(flags,0x01)) then print('<span class="badge bg-info">FIN</span> ') end
|
||||
if(hasbit(flags,0x02)) then print('<span class="badge bg-info">SYN</span> ') end
|
||||
if(hasbit(flags,0x04)) then print('<span class="badge bg-danger">RST</span> ') end
|
||||
if(hasbit(flags,0x08)) then print('<span class="badge bg-info">PUSH</span> ') end
|
||||
if(hasbit(flags,0x10)) then print('<span class="badge bg-info">ACK</span> ') end
|
||||
if(hasbit(flags,0x20)) then print('<span class="badge bg-info">URG</span> ') end
|
||||
if(hasbit(flags,0x40)) then print('<span class="badge bg-info">ECE</span> ') end
|
||||
if(hasbit(flags,0x80)) then print('<span class="badge bg-info">CWR</span> ') end
|
||||
end
|
||||
|
||||
-- convert the integer carrying TCP flags in a more convenient lua table
|
||||
|
|
@ -2983,7 +2983,7 @@ function historicalProtoHostHref(ifId, host, l4_proto, ndpi_proto_id, info)
|
|||
if((ndpi_proto_id ~= nil) and (ndpi_proto_id ~= "")) then hist_url = hist_url.."&protocol="..ndpi_proto_id end
|
||||
if((info ~= nil) and (info ~= "")) then hist_url = hist_url.."&info="..info end
|
||||
print(' ')
|
||||
-- print('<span class="badge badge-info">')
|
||||
-- print('<span class="badge bg-info">')
|
||||
print('<a href="'..hist_url..'&epoch_begin='..tostring(ago1h)..'" title="'..i18n("db_explorer.last_hour_flows")..'"><i class="fas fa-history fa-lg"></i></a>')
|
||||
-- print('</span>')
|
||||
end
|
||||
|
|
@ -3289,26 +3289,30 @@ function makeResolutionButtons(fmt_to_data, ctrl_id, fmt, value, extra, max_val)
|
|||
end
|
||||
|
||||
local style = table.merge({display="flex"}, extra.style or {})
|
||||
html_lines[#html_lines+1] = [[<div class="btn-group btn-group-toggle ]] .. table.concat(extra.classes or {}, "") .. [[" id="]] .. ctrl_id .. [[" data-toggle="buttons" style="]] .. table.tconcat(style, ":", "; ", ";") .. [[">]]
|
||||
html_lines[#html_lines+1] = [[<div class="btn-group ]] .. table.concat(extra.classes or {}, "") .. [[" id="]] .. ctrl_id .. [[" role="group" style="]] .. table.tconcat(style, ":", "; ", ";") .. [[">]]
|
||||
|
||||
-- foreach character in format
|
||||
string.gsub(fmt, ".", function(k)
|
||||
|
||||
local v = fmt_to_data[k]
|
||||
if v ~= nil then
|
||||
local line = {}
|
||||
local line = {}
|
||||
|
||||
if((max_val == nil) or (v.value < max_val)) then
|
||||
line[#line+1] = [[<label class="btn]]
|
||||
if selected == k then
|
||||
line[#line+1] = [[ btn-primary active]]
|
||||
else
|
||||
line[#line+1] = [[ btn-secondary]]
|
||||
end
|
||||
line[#line+1] = [[ btn-sm"><input data-resol="]] .. k .. [[" value="]] .. truncate(v.value) .. [[" title="]] .. v.label .. [[" name="opt_resbt_]] .. k .. [[_]] .. ctrl_id .. [[" autocomplete="off" type="radio"]]
|
||||
if selected == k then line[#line+1] = [[ checked="checked"]] end
|
||||
line[#line+1] = [[/>]] .. v.label .. [[</label>]]
|
||||
if((max_val == nil) or (v.value < max_val)) then
|
||||
|
||||
html_lines[#html_lines+1] = table.concat(line, "")
|
||||
local input_name = ("opt_resbt_%s_%s"):format(k, ctrl_id)
|
||||
local input = ([[
|
||||
<input class='btn-check' data-resol="%s" value="%s" title="%s" name="%s" id="input-%s" autocomplete="off" type="radio" %s/>
|
||||
]]):format(k, truncate(v.value), v.label, input_name, input_name, ternary((selected == k), "checked='checked'", ""))
|
||||
|
||||
local label = ([[
|
||||
<label class="btn btn-sm %s" for="input-%s">%s</label>
|
||||
]]):format(ternary((selected == k), "btn-primary active", "btn-secondary"), input_name, v.label)
|
||||
|
||||
line[#line+1] = input
|
||||
line[#line+1] = label
|
||||
|
||||
html_lines[#html_lines+1] = table.concat(line, "")
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
|
@ -3321,11 +3325,11 @@ function makeResolutionButtons(fmt_to_data, ctrl_id, fmt, value, extra, max_val)
|
|||
var _resol_inputs = [];
|
||||
|
||||
function resol_selector_get_input(a_button) {
|
||||
return $("input", $(a_button).closest(".form-group")).last();
|
||||
return $("input", $(a_button).closest(".form-group.mb-3")).last();
|
||||
}
|
||||
|
||||
function resol_selector_get_buttons(an_input) {
|
||||
return $(".btn-group", $(an_input).closest(".form-group")).first().find("input");
|
||||
return $(".btn-group", $(an_input).closest(".form-group.mb-3")).first().find("input");
|
||||
}
|
||||
|
||||
/* This function scales values wrt selected resolution */
|
||||
|
|
@ -3657,10 +3661,10 @@ end
|
|||
|
||||
function printWarningAlert(message)
|
||||
print[[<div class="alert alert-warning alert-dismissable" role="alert">]]
|
||||
print[[<a class="close" data-dismiss="alert" aria-label="close">×</a>]]
|
||||
print[[<i class="fas fa-exclamation-triangle fa-sm"></i> ]]
|
||||
print[[<strong>]] print(i18n("warning")) print[[</strong> ]]
|
||||
print(message)
|
||||
print[[<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>]]
|
||||
print[[</div>]]
|
||||
end
|
||||
|
||||
|
|
@ -3738,9 +3742,7 @@ function printMessageBanners(banners)
|
|||
for _, msg in ipairs(banners) do
|
||||
print[[
|
||||
<div class="alert alert-]] print(msg.type) print([[ alert-dismissible" style="margin-top:2em; margin-bottom:0em;">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="]]..i18n("close")..[[">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>]])
|
||||
]])
|
||||
|
||||
if (msg.type == "warning") then
|
||||
print("<b>".. i18n("warning") .. "</b>: ")
|
||||
|
|
@ -3751,6 +3753,7 @@ function printMessageBanners(banners)
|
|||
print(msg.text)
|
||||
|
||||
print[[
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>]]
|
||||
end
|
||||
end
|
||||
|
|
@ -3858,7 +3861,7 @@ function generate_select(id, name, is_required, is_disabled, options, additional
|
|||
end
|
||||
|
||||
return ([[
|
||||
<select id="]].. id ..[[" class="form-control ]] .. (additional_classes or "") .. [[" ]].. name_attr ..[[ ]].. required_flag ..[[ ]] .. disabled_flag ..[[>
|
||||
<select id="]].. id ..[[" class="form-select ]] .. (additional_classes or "") .. [[" ]].. name_attr ..[[ ]].. required_flag ..[[ ]] .. disabled_flag ..[[>
|
||||
]].. parsed_options ..[[
|
||||
</select>
|
||||
]])
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ function page_utils.print_page_title(title)
|
|||
print("<header class='mb-3 d-flex align-items-center'>")
|
||||
print("<h2 class='d-inline-block'>".. title .."</h2>")
|
||||
if (not isEmptyString(help_link)) then
|
||||
print("<a data-toggle='tooltip' title='".. i18n("open_documentation") .."' target='_newtab' href='".. help_link .."' class='text-muted ml-auto'><i class='fas fa-question-circle'></i></a>")
|
||||
print("<a data-bs-toggle='tooltip' title='".. i18n("open_documentation") .."' target='_newtab' href='".. help_link .."' class='text-muted ms-auto'><i class='fas fa-question-circle'></i></a>")
|
||||
end
|
||||
print("</header>")
|
||||
|
||||
|
|
@ -291,7 +291,7 @@ function page_utils.print_header(title)
|
|||
print[[<link href="]] print(http_prefix) print[[/css/minified/bootstrap-orange.min.css" rel="stylesheet">]]
|
||||
print[[<link href="]] print(http_prefix) print[[/css/minified/dark-mode.min.css?]] print(static_file_epoch) print[[" rel="stylesheet">]]
|
||||
else
|
||||
print[[ <link href="]] print(http_prefix) print[[/bootstrap-4.4.0-dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-SI27wrMjH3ZZ89r4o+fGIJtnzkAnFs3E4qz9DIYioCQ5l9Rd/7UAa8DHcaL8jkWt" crossorigin="anonymous">]]
|
||||
print[[ <link href="]] print(http_prefix) print[[/bootstrap/css/bootstrap.min.css" rel="stylesheet">]]
|
||||
end
|
||||
print[[
|
||||
<link href="]] print(http_prefix) print[[/css/minified/ntopng.min.css?]] print(static_file_epoch) print[[" rel="stylesheet">
|
||||
|
|
@ -319,12 +319,10 @@ function page_utils.print_header(title)
|
|||
<script src="]] print(http_prefix) print[[/js/html5shiv.js"></script>
|
||||
<![endif]-->
|
||||
<script type="text/javascript" src="]] print(http_prefix) print[[/js/jquery_bootstrap.min.js?]] print(static_file_epoch) print[["></script>
|
||||
<script type="text/javascript" src="]] print(http_prefix) print[[/popper-1.12.9/js/popper.min.js" crossorigin="anonymous"></script>
|
||||
<script type="text/javascript" src="]] print(http_prefix) print[[/bootstrap-4.4.0-dist/js/bootstrap.min.js?]] print(static_file_epoch) print[[" integrity="sha384-3qaqj0lc6sV/qpzrc1N5DC6i1VRn/HyX4qdPaiEFbn54VjQBEU341pvjz7Dv3n6P" crossorigin="anonymous"></script>
|
||||
<script type="text/javascript" src="]] print(http_prefix) print[[/js/popper/popper.min.js" crossorigin="anonymous"></script>
|
||||
<script type="text/javascript" src="]] print(http_prefix) print[[/js/deps.min.js?]] print(static_file_epoch) print[["></script>
|
||||
<script type="text/javascript" src="]] print(http_prefix) print[[/js/ntop.min.js?]] print(static_file_epoch) print[["></script>
|
||||
<script type="text/javascript" src="]] print(http_prefix) print[[/js/tempusdominus.min.js?]] print(static_file_epoch) print[["></script>
|
||||
<script type="text/javascript" src="]] print(http_prefix) print[[/selectpicker/js/bootstrap-select.min.js?]] print(static_file_epoch) print[["></script>
|
||||
</head>]]
|
||||
print([[
|
||||
<body class="body ]].. (dark_mode and "dark" or "") ..[[">
|
||||
|
|
@ -348,7 +346,7 @@ function page_utils.print_header_minimal(title)
|
|||
<title>]] print(page_title) print[[</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<link href="]] print(http_prefix) print[[/bootstrap-4.4.0-dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-SI27wrMjH3ZZ89r4o+fGIJtnzkAnFs3E4qz9DIYioCQ5l9Rd/7UAa8DHcaL8jkWt" crossorigin="anonymous">
|
||||
<link href="]] print(http_prefix) print[[/bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="]] print(http_prefix) print[[/fontawesome-free-5.11.2-web/css/fontawesome.css" rel="stylesheet">
|
||||
<link href="]] print(http_prefix) print[[/fontawesome-free-5.11.2-web/css/brands.css" rel="stylesheet">
|
||||
<link href="]] print(http_prefix) print[[/fontawesome-free-5.11.2-web/css/solid.css" rel="stylesheet">
|
||||
|
|
@ -451,7 +449,7 @@ local function print_submenu(section, container_list_name)
|
|||
print[["]]
|
||||
|
||||
if section_has_submenu then
|
||||
print[[ data-toggle="collapse" ]]
|
||||
print[[ data-bs-toggle="collapse" ]]
|
||||
end
|
||||
|
||||
print[[ href="]]
|
||||
|
|
@ -472,7 +470,7 @@ local function print_submenu(section, container_list_name)
|
|||
print[["]]
|
||||
|
||||
if section_entry.entry.is_modal then
|
||||
print(' data-toggle="modal"')
|
||||
print(' data-bs-toggle="modal"')
|
||||
end
|
||||
|
||||
if external_link then
|
||||
|
|
@ -548,7 +546,7 @@ local function print_section(section, list_name)
|
|||
print[[" ]]
|
||||
|
||||
if section_has_submenu then
|
||||
print[[ data-toggle="collapse" ]]
|
||||
print[[ data-bs-toggle="collapse" ]]
|
||||
end
|
||||
|
||||
print[[href="]]
|
||||
|
|
@ -603,7 +601,7 @@ function page_utils.print_menubar()
|
|||
})
|
||||
..[[
|
||||
</form>
|
||||
<button data-toggle="]] .. list_name .. [[" class='ml-5'><i class="fas fa-times"></i></button>
|
||||
<button data-bs-toggle="]] .. list_name .. [[" class='ms-5'><i class="fas fa-times"></i></button>
|
||||
</div>
|
||||
<div class="mobile-menu-stats">
|
||||
]])
|
||||
|
|
@ -761,12 +759,12 @@ function page_utils.generate_info_stats()
|
|||
<div class='up'>
|
||||
<i class="fas fa-arrow-up"></i>
|
||||
<span style='display: none;' class="network-load-chart-upload">0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</span>
|
||||
<span class="text-right chart-upload-text"></span>
|
||||
<span class="text-end chart-upload-text"></span>
|
||||
</div>
|
||||
<div class='down'>
|
||||
<i class="fas fa-arrow-down"></i>
|
||||
<span style='display: none;' class="network-load-chart-download">0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</span>
|
||||
<span class="text-right chart-download-text"></span>
|
||||
<span class="text-end chart-download-text"></span>
|
||||
</div>
|
||||
</a>
|
||||
]])
|
||||
|
|
@ -774,7 +772,7 @@ function page_utils.generate_info_stats()
|
|||
return ([[
|
||||
<a href=']].. ntop.getHttpPrefix() ..[[/lua/if_stats.lua'>
|
||||
<span style='display: none;' class="network-load-chart-total">0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</span>
|
||||
<span class="text-right chart-total-text"></span>
|
||||
<span class="text-end chart-total-text"></span>
|
||||
</a>
|
||||
]])
|
||||
end
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ function prefsInputFieldPrefs(label, comment, prekey, key, default_value, _input
|
|||
|
||||
print [[
|
||||
<td align=right>
|
||||
<table class="table table-borderless form-group" style="margin-bottom: 0; min-width:22em;">
|
||||
<table class="table table-borderless form-group mb-3" style="margin-bottom: 0; min-width:22em;">
|
||||
<tr>
|
||||
<td width="100%;"></td>
|
||||
<td style="vertical-align:top;">]]
|
||||
|
|
@ -320,7 +320,7 @@ function prefsInputFieldPrefs(label, comment, prekey, key, default_value, _input
|
|||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" style="padding:0;">
|
||||
<div class="help-block with-errors text-right" style="height:1em;"></div>
|
||||
<div class="help-block with-errors text-end" style="height:1em;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
@ -360,7 +360,7 @@ function prefsDropdownFieldPrefs(label, comment, key, values, default_value, sho
|
|||
|
||||
print [[
|
||||
<td align=right>
|
||||
<table class="form-group" style="margin-bottom: 0; min-width:22em;">
|
||||
<table class="form-group mb-3" style="margin-bottom: 0; min-width:22em;">
|
||||
<tr>
|
||||
<td width="100%;"></td>]]
|
||||
|
||||
|
|
@ -377,7 +377,7 @@ function prefsDropdownFieldPrefs(label, comment, key, values, default_value, sho
|
|||
|
||||
print[[
|
||||
<td style="vertical-align:top; padding-left: 2em;">
|
||||
<select id="id_input_]] print(key) print [[" class="form-control" ]] print(table.tconcat(attributes, "=", " ", nil, '"')) print[[ name="]] print(key) print [[" style="]] print(table.tconcat(style, ":", "; ", ";")) print[[" value="]] print((value or '')..'"') print[[>]]
|
||||
<select id="id_input_]] print(key) print [[" class="form-select" ]] print(table.tconcat(attributes, "=", " ", nil, '"')) print[[ name="]] print(key) print [[" style="]] print(table.tconcat(style, ":", "; ", ";")) print[[" value="]] print((value or '')..'"') print[[>]]
|
||||
if extra.keys == nil then
|
||||
for _, optname in pairs(values) do
|
||||
print("<option " .. ternary(optname == default_value, "selected", "") .. ">"..optname.."</option>")
|
||||
|
|
@ -395,7 +395,7 @@ function prefsDropdownFieldPrefs(label, comment, key, values, default_value, sho
|
|||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" style="padding:0;">
|
||||
<div class="help-block with-errors text-right" style="height:1em;"></div>
|
||||
<div class="help-block with-errors text-end" style="height:1em;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
@ -515,9 +515,9 @@ local function toggleTableButtonPrefs(label, comment, on_label, on_value, on_col
|
|||
if(label ~= "") then print('<tr id="row_'..submit_field..'"'..objRow..'><td width=50%><strong>'..label..'</strong><p><small>'..comment..'</small></td><td align=right>\n') end
|
||||
|
||||
print([[
|
||||
<div class="custom-control custom-switch ">
|
||||
<input ]].. (value == off_value and '' or 'checked') ..[[ type="checkbox" class="custom-control-input" id="check-]].. submit_field ..[[">
|
||||
<label class="custom-control-label custom-control-label-lg " for="check-]].. submit_field ..[["></label>
|
||||
<div class="form-check form-switch">
|
||||
<input ]].. (value == off_value and '' or 'checked') ..[[ type="checkbox" class="form-check-input" id="check-]].. submit_field ..[[">
|
||||
<label class="form-check-label" for="check-]].. submit_field ..[["></label>
|
||||
<input hidden id="input-]].. submit_field ..[[" name="]].. submit_field ..[[" value="]].. value ..[[">
|
||||
]])
|
||||
print([[</div>]])
|
||||
|
|
@ -658,7 +658,7 @@ function multipleTableButtonPrefs(label, comment, array_labels, array_values, de
|
|||
end
|
||||
if(value ~= nil) then
|
||||
if(label ~= "") then print('<tr id="row_'..submit_field..'"'..objRow..'><td width=50%><strong>'..label..'</strong><p><small>'..comment..'</small></td><td align=right>\n') end
|
||||
print('<div class="btn-group" data-toggle="buttons-radio" data-toggle-name="'..submit_field..'">')
|
||||
print('<div class="btn-group" data-bs-toggle="buttons-radio" data-bs-toggle-name="'..submit_field..'">')
|
||||
|
||||
for nameCount = 1, #array_labels do
|
||||
local type_button = "btn-secondary"
|
||||
|
|
@ -671,7 +671,7 @@ function multipleTableButtonPrefs(label, comment, array_labels, array_values, de
|
|||
end
|
||||
type_button = "btn-"..color.." active"
|
||||
end
|
||||
print('<button id="id_'..submit_field..'_'..array_values[nameCount]..'" value="'..array_values[nameCount]..'" type="button" class="btn btn-sm '..type_button..' ' .. disabled .. '"'.. disabled_attr ..' data-toggle="button">'..array_labels[nameCount]..'</button>\n')
|
||||
print('<button id="id_'..submit_field..'_'..array_values[nameCount]..'" value="'..array_values[nameCount]..'" type="button" class="btn btn-sm '..type_button..' ' .. disabled .. '"'.. disabled_attr ..' data-bs-toggle="button">'..array_labels[nameCount]..'</button>\n')
|
||||
end
|
||||
print('</div>\n')
|
||||
print('<input type="hidden" id="id-toggle-'..submit_field..'" name="'..submit_field..'" value="'..value..'" />\n')
|
||||
|
|
|
|||
|
|
@ -143,9 +143,9 @@ function system_setup_ui_utils.printConfigChange(sys_config, warnings)
|
|||
]]
|
||||
|
||||
if sys_config:needsReboot() then
|
||||
print[[<button type="button" data-toggle="modal" data-target="#config_apply_dialog_reboot" class="btn btn-primary">]] print(i18n("nedge.setup_apply")) print[[</button>]]
|
||||
print[[<button type="button" data-bs-toggle="modal" data-target="#config_apply_dialog_reboot" class="btn btn-primary">]] print(i18n("nedge.setup_apply")) print[[</button>]]
|
||||
elseif sys_config:needsSelfRestart() then
|
||||
print[[<button type="button" data-toggle="modal" data-target="#config_apply_dialog_restart_self" class="btn btn-primary">]] print(i18n("nedge.setup_apply")) print[[</button>]]
|
||||
print[[<button type="button" data-bs-toggle="modal" data-target="#config_apply_dialog_restart_self" class="btn btn-primary">]] print(i18n("nedge.setup_apply")) print[[</button>]]
|
||||
else
|
||||
print[[<button type="submit" class="btn btn-primary">]] print(i18n("nedge.setup_apply")) print[[</button>]]
|
||||
end
|
||||
|
|
@ -279,12 +279,12 @@ function system_setup_ui_utils.printPrivateAddressSelector(label, comment, ip_ke
|
|||
print('<tr id="'..field_id..'" style="display: '..showEnabled..';"><td width=50%><strong>'..label..'</strong><p><small>'..comment..'</small></td>')
|
||||
print [[
|
||||
<td align=right>
|
||||
<table class="form-group" style="margin-bottom: 0; min-width:22em;">
|
||||
<table class="form-group mb-3" style="margin-bottom: 0; min-width:22em;">
|
||||
<tr class='border-0'>
|
||||
]]
|
||||
|
||||
print[[
|
||||
<td class="local-ip-selector border-0 text-right" style="vertical-align:top; padding-left: 2em;">]]
|
||||
<td class="local-ip-selector border-0 text-end" style="vertical-align:top; padding-left: 2em;">]]
|
||||
|
||||
-- Find initial netmask
|
||||
for _, preset in pairs(networks_presets) do
|
||||
|
|
@ -294,7 +294,7 @@ function system_setup_ui_utils.printPrivateAddressSelector(label, comment, ip_ke
|
|||
end
|
||||
|
||||
if extra.net_select ~= false then
|
||||
print[[<select name="]] print(field_id) print[[_net" class="form-control d-inline-block" style="width: 9.6rem">]]
|
||||
print[[<select name="]] print(field_id) print[[_net" class="form-select d-inline-block" style="width: 9.6rem">]]
|
||||
|
||||
for _, preset in pairs(networks_presets) do
|
||||
print[[<option value="]] print(preset.prefix) print[["]]
|
||||
|
|
@ -338,7 +338,7 @@ function system_setup_ui_utils.printPrivateAddressSelector(label, comment, ip_ke
|
|||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" style="padding:0;">
|
||||
<div class="help-block with-errors text-right" style="height:1em;"></div>
|
||||
<div class="help-block with-errors text-end" style="height:1em;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
@ -416,7 +416,7 @@ function system_setup_ui_utils.prefsDateTimeFieldPrefs(label, comment, key, defa
|
|||
|
||||
print [[
|
||||
<td align=right>
|
||||
<table class="form-group" style="margin-bottom: 0; min-width:22em;">
|
||||
<table class="form-group mb-3" style="margin-bottom: 0; min-width:22em;">
|
||||
<tr>
|
||||
<td width="100%;"></td>]]
|
||||
|
||||
|
|
@ -439,7 +439,7 @@ function system_setup_ui_utils.prefsDateTimeFieldPrefs(label, comment, key, defa
|
|||
<input type="hidden" id="]] print(orig_name) print[[" name="]] print(orig_name) print[[" value="" />
|
||||
<div class='input-group date' id=']] print(picker_name) print[[' style="width: 20em;" data-target-input="nearest">
|
||||
<input id="]] print(key) print[[" name="]] print(key) print[[" type="text" class="form-control datetimepicker-input" data_target="#]] print(picker_name) print[["/>
|
||||
<div class="input-group-append" data-target="#]] print(picker_name) print[[" data-toggle="datetimepicker">
|
||||
<div class="input-group-append" data-target="#]] print(picker_name) print[[" data-bs-toggle="datetimepicker">
|
||||
<div class="input-group-text"><i class="fas fa-calendar"></i></div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
|
@ -464,7 +464,7 @@ function system_setup_ui_utils.prefsDateTimeFieldPrefs(label, comment, key, defa
|
|||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" style="padding:0;">
|
||||
<div class="help-block with-errors text-right" style="height:1em;"></div>
|
||||
<div class="help-block with-errors text-end" style="height:1em;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -60,9 +60,9 @@ function telemetry_utils.print_overview()
|
|||
]]
|
||||
|
||||
if telemetry_utils.telemetry_enabled() then
|
||||
print('<span class="badge badge-success">'..i18n('prefs.telemetry_contribute')..'</span>')
|
||||
print('<span class="badge bg-success">'..i18n('prefs.telemetry_contribute')..'</span>')
|
||||
elseif telemetry_utils.telemetry_disabled() then
|
||||
print('<span class="badge badge-secondary">'..i18n('prefs.telemetry_do_not_contribute')..'</span>')
|
||||
print('<span class="badge bg-secondary">'..i18n('prefs.telemetry_do_not_contribute')..'</span>')
|
||||
else -- no preference expressed
|
||||
print('<i>'..i18n('telemetry_page.telemetry_data_no_consent')..'</i>')
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
Template used by the 'Elephant Flows' User Script.
|
||||
#}
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="mb-3 row">
|
||||
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
%}
|
||||
|
||||
<input hidden type="number" value="{{ hook_conf.script_conf.min_duration }}" name="min_duration">
|
||||
<div class="form-group row">
|
||||
<div class="mb-3 row">
|
||||
<label class="col-sm-2 col-form-label">{{ i18n("enabled") }}</label>
|
||||
<div class="col-2">
|
||||
<div class="custom-control custom-switch">
|
||||
|
|
@ -42,7 +42,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="mb-3 row">
|
||||
<label class="col-sm-2 col-form-label">{{ i18n("scripts_list.templates.flow_duration_threshold") }}</label>
|
||||
<div class="col-2">
|
||||
<div id="time-toggles" class="btn-group btn-group-toggle w-100" data-toggle="buttons">
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
local default_operator_not_defined = isEmptyString(user_script.default_value.operator)
|
||||
%}
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="mb-3 row">
|
||||
<label class="col-sm-2 col-form-label">{{ i18n("enabled") }}</label>
|
||||
<div class="col-2">
|
||||
<div class="custom-control custom-switch">
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="mb-3 row">
|
||||
<label class="col-sm-2 col-form-label">{{ i18n("edit_user_script.hooks_name." .. hook_name) or hook_name }}</label>
|
||||
<div class="col-2">
|
||||
<div class="input-group">
|
||||
|
|
@ -41,7 +41,7 @@
|
|||
{% end %}
|
||||
</div>
|
||||
<input type="number" class="form-control text-right" required {{ (hook_conf.enabled and '' or 'disabled') }} value="{{ hook_conf.script_conf.threshold }}" name="threshold">
|
||||
<span class="mt-auto mb-auto ml-2 mr-2">{{ field_unit }}</span>
|
||||
<span class="mt-auto mb-auto ms-2 me-2">{{ field_unit }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1882,7 +1882,7 @@ local function printUserScriptsTable()
|
|||
<td>%s</td>
|
||||
<td>%s</td>
|
||||
<td>%s</td>
|
||||
<td class="text-right">%u</td>
|
||||
<td class="text-end">%u</td>
|
||||
<td class="text-center">%s</td></tr>
|
||||
]]), name, info.label, available, hooks, filters, script.num_filtered, edit_url or ""))
|
||||
::skip::
|
||||
|
|
@ -1914,7 +1914,7 @@ function user_scripts.printUserScripts()
|
|||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<link href="]].. ntop.getHttpPrefix() ..[[/datatables/datatables.min.css" rel="stylesheet"/>
|
||||
<link href="]].. ntop.getHttpPrefix() ..[[/css/dataTables.bootstrap5.min.css" rel="stylesheet"/>
|
||||
<script type='text/javascript'>
|
||||
|
||||
$(document).ready(function() {
|
||||
|
|
@ -1936,7 +1936,7 @@ function user_scripts.printUserScripts()
|
|||
|
||||
const dropdownId = `${title}-filter-menu`;
|
||||
const $dropdownContainer = $(`<div id='${dropdownId}' class='dropdown d-inline'></div>`);
|
||||
const $dropdownButton = $(`<button class='btn-link btn dropdown-toggle' data-toggle='dropdown' type='button'></button>`);
|
||||
const $dropdownButton = $(`<button class='btn-link btn dropdown-toggle' data-bs-toggle='dropdown' type='button'></button>`);
|
||||
const $dropdownTitle = $(`<span>${title}</span>`);
|
||||
$dropdownButton.append($dropdownTitle);
|
||||
|
||||
|
|
|
|||
|
|
@ -119,13 +119,13 @@ function MosPercentageBar(value)
|
|||
value = tonumber(value)
|
||||
|
||||
if (value >= 4.0) then
|
||||
ret_bar = '<span class="badge badge-success">'..value..' '..i18n("flow_details.desirable_label")..'</span>'
|
||||
ret_bar = '<span class="badge bg-success">'..value..' '..i18n("flow_details.desirable_label")..'</span>'
|
||||
elseif ((value >= 3.6) and (value < 4.0)) then
|
||||
ret_bar = '<span class="badge badge-info">'..value..' '..i18n("flow_details.acceptable_label")..'</span>'
|
||||
ret_bar = '<span class="badge bg-info">'..value..' '..i18n("flow_details.acceptable_label")..'</span>'
|
||||
elseif ((value >= 2.6) and (value < 3.6)) then
|
||||
ret_bar = '<span class="badge badge-warning">'..value..' '..i18n("flow_details.reach_connection_label")..'</span>'
|
||||
ret_bar = '<span class="badge bg-warning">'..value..' '..i18n("flow_details.reach_connection_label")..'</span>'
|
||||
elseif ((value > 0) and (value < 2.6)) then
|
||||
ret_bar = '<span class="badge badge-danger">'..value..' '..i18n("flow_details.not_recommended_label")..'</span>'
|
||||
ret_bar = '<span class="badge bg-danger">'..value..' '..i18n("flow_details.not_recommended_label")..'</span>'
|
||||
end
|
||||
|
||||
return ret_bar
|
||||
|
|
@ -138,13 +138,13 @@ function RFactorPercentageBar(value)
|
|||
value = tonumber(value)
|
||||
|
||||
if (value >= 80.0) then
|
||||
ret_bar = '<span class="badge badge-success">'..value..' '..i18n("flow_details.desirable_label")..'</span>'
|
||||
ret_bar = '<span class="badge bg-success">'..value..' '..i18n("flow_details.desirable_label")..'</span>'
|
||||
elseif ((value >= 70.0) and (value < 80.0)) then
|
||||
ret_bar = '<span class="badge badge-info">'..value..' '..i18n("flow_details.acceptable_label")..'</span>'
|
||||
ret_bar = '<span class="badge bg-info">'..value..' '..i18n("flow_details.acceptable_label")..'</span>'
|
||||
elseif ((value >= 50.0) and (value < 70.0)) then
|
||||
ret_bar = '<span class="badge badge-warning">'..value..' '..i18n("flow_details.reach_connection_label")..'</span>'
|
||||
ret_bar = '<span class="badge bg-warning">'..value..' '..i18n("flow_details.reach_connection_label")..'</span>'
|
||||
elseif ((value >= 0) and (value < 50.0)) then
|
||||
ret_bar = '<span class="badge badge-danger">'..value..' '..i18n("flow_details.not_recommended_label")..'</span>'
|
||||
ret_bar = '<span class="badge bg-danger">'..value..' '..i18n("flow_details.not_recommended_label")..'</span>'
|
||||
end
|
||||
|
||||
return ret_bar
|
||||
|
|
@ -154,34 +154,34 @@ end
|
|||
|
||||
function SipCallStatePercentageBar(state)
|
||||
-- Wireshark use different state http://wiki.wireshark.org/VoIP_calls
|
||||
label_class = "badge-secondary"
|
||||
label_class = "bg-secondary"
|
||||
|
||||
if (state == "REGISTER") then
|
||||
label_class = "badge-info"
|
||||
label_class = "bg-info"
|
||||
end
|
||||
|
||||
if (state == "CALL_STARTED") then
|
||||
label_class = "badge-info"
|
||||
label_class = "bg-info"
|
||||
end
|
||||
|
||||
if (state == "CALL_IN_PROGRESS") then
|
||||
label_class = "badge-progress"
|
||||
label_class = "bg-progress"
|
||||
end
|
||||
|
||||
if (state == "CALL_COMPLETED") then
|
||||
label_class = "badge-success"
|
||||
label_class = "bg-success"
|
||||
end
|
||||
|
||||
if (state == "CALL_ERROR") then
|
||||
label_class = "badge-danger"
|
||||
label_class = "bg-danger"
|
||||
end
|
||||
|
||||
if (state == "CALL_CANCELED") then
|
||||
label_class = "badge-warning"
|
||||
label_class = "bg-warning"
|
||||
end
|
||||
|
||||
if (state == "UNKNOWN") then
|
||||
label_class = "badge-warning"
|
||||
label_class = "bg-warning"
|
||||
end
|
||||
|
||||
print('<span class="badge '..label_class..'">'..state..'</span>')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue