mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Ported AS table to new table (#8475)
* Fixes parsing error while pasing XML strings with comments * Ported host countries table to new vue table * Added country filter when redirected to hosts list page * Ported network discovery table to TableWithConfig vue component * FIxed indentation * Added documentation for VueJS, Lua and cpp used in ntopng * Fixed error * Added Netbox pref entry for default site, customizable input box size. To implement cpp side for netbox default site * Removed tprint * Ported AS table to new table * Started fixing live flow IP filter * Fixed date formatter * Removed debug code * Removed tprint * Removed unused import --------- Co-authored-by: DGabri <gabriele.deri@gmail.com> Co-authored-by: Luca Deri <lucaderi@users.noreply.github.com>
This commit is contained in:
parent
d6965f24b7
commit
43dcd76e2f
19 changed files with 247 additions and 413 deletions
|
|
@ -2245,13 +2245,13 @@ if auth.has_capability(auth.capabilities.preferences) then
|
|||
return
|
||||
end
|
||||
|
||||
print('<form method="post">')
|
||||
print('<form id="assetsInventory" method="post">')
|
||||
print('<table class="table">')
|
||||
print('<thead class="table-primary"><tr><th colspan=2 class="info">Assets Inventory</th></tr></thead>')
|
||||
print('<thead class="table-primary"><tr><th colspan=2 class="info">' .. i18n("prefs.assets_inventory") .. '</th></tr></thead>')
|
||||
local disabled = not info["version.enterprise_edition"]
|
||||
|
||||
-- show or not show table entries for netbox configuration
|
||||
local showNetboxConfiguration = true
|
||||
local showNetboxConfiguration = false
|
||||
|
||||
local elementToSwitch = {"netbox_activation_url", "netbox_default_site", "netbox_personal_access_token"}
|
||||
|
||||
|
|
@ -2261,6 +2261,8 @@ if auth.has_capability(auth.capabilities.preferences) then
|
|||
showNetboxConfiguration = false
|
||||
end
|
||||
|
||||
-- tprint(ntop.getPref("ntopng.prefs.toggle_netbox") .. " " .. tostring(showNetboxConfiguration))
|
||||
|
||||
prefsToggleButton(subpage_active, {
|
||||
field = "toggle_netbox",
|
||||
default = "0",
|
||||
|
|
@ -2271,34 +2273,39 @@ if auth.has_capability(auth.capabilities.preferences) then
|
|||
|
||||
--(label, comment, prekey, key, default_value, _input_type, showEnabled, disableAutocomplete, allowURLs, extra)
|
||||
-- Netbox Activation URL
|
||||
-- tprint(prefs)
|
||||
-- Render the NetBox Activation URL input field
|
||||
prefsInputFieldPrefs(subpage_active.entries["netbox_activation_url"].title,
|
||||
subpage_active.entries["netbox_activation_url"].description, "ntopng.prefs.", "netbox_activation_url",
|
||||
"", false, showNetboxConfiguration, nil, nil, {
|
||||
attributes = {
|
||||
spellcheck = "false",
|
||||
},
|
||||
required = true,
|
||||
disabled = disabled
|
||||
subpage_active.entries["netbox_activation_url"].description, "ntopng.prefs.", "netbox_activation_url",
|
||||
ntop.getPref("ntopng.prefs.netbox_activation_url") or "", "text", showNetboxConfiguration, nil, nil, {
|
||||
attributes = {
|
||||
spellcheck = "false",
|
||||
},
|
||||
required = true,
|
||||
disabled = disabled,
|
||||
pattern = "[^\\s]+" -- pattern to validate URL
|
||||
})
|
||||
|
||||
-- Netbox Asset default Site
|
||||
|
||||
-- Render the NetBox Default Site input field
|
||||
prefsInputFieldPrefs(subpage_active.entries["netbox_default_site"].title,
|
||||
subpage_active.entries["netbox_default_site"].description, "ntopng.prefs.", "netbox_default_site",
|
||||
"", false, showNetboxConfiguration, nil, nil, {
|
||||
attributes = {
|
||||
spellcheck = "false",
|
||||
},
|
||||
required = true,
|
||||
disabled = disabled
|
||||
subpage_active.entries["netbox_default_site"].description, "ntopng.prefs.", "netbox_default_site",
|
||||
ntop.getPref("ntopng.prefs.netbox_default_site") or "", "text", showNetboxConfiguration, nil, nil, {
|
||||
attributes = {
|
||||
spellcheck = "false",
|
||||
},
|
||||
required = true,
|
||||
disabled = disabled,
|
||||
pattern = "[^\\s]+" -- pattern to validate site name
|
||||
})
|
||||
|
||||
-- Netbox Personal Access token
|
||||
prefsInputFieldPrefs(subpage_active.entries["netbox_personal_access_token"].title,
|
||||
subpage_active.entries["netbox_personal_access_token"].description, "ntopng.prefs.", "netbox_personal_access_token", "",
|
||||
"", showNetboxConfiguration, nil, nil, {
|
||||
subpage_active.entries["netbox_personal_access_token"].description, "ntopng.prefs.", "netbox_personal_access_token",
|
||||
ntop.getPref("ntopng.prefs.netbox_personal_access_token") or "", "text", showNetboxConfiguration, nil, nil, {
|
||||
required = true,
|
||||
inputBoxWidth = "40em"
|
||||
})
|
||||
inputBoxWidth = "40em",
|
||||
disabled = disabled
|
||||
})
|
||||
|
||||
if (disabled) then
|
||||
prefsInformativeField(i18n("notes"), i18n("enterpriseOnly"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue