Added ch flows export to file before ttl delete #9398 (#9427)

* Added ch flows export to file before ttl delete. Need to add pref for path getter

* Added clickhouse ttl export path pref

* Fixed naming in clickhouse flow archive

* Updated naming in clickhouse flow archive pref

* Removed clickhouse archive path pref

* Added IXP mode pref #9421

* Removed unused prefs ch flows archive
This commit is contained in:
GabrieleDeri 2025-07-28 11:06:05 +02:00 committed by GitHub
parent 0f0e949868
commit 935146cfac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 738 additions and 14 deletions

View file

@ -2167,7 +2167,15 @@ if auth.has_capability(auth.capabilities.preferences) then
min = 1,
max = 365 * 10
})
-- export flows for retention, only if ch and enterprise XL
prefsToggleButton(subpage_active, {
field = "toggle_data_archive_before_ttl_delete",
default = "0",
pref = "data_archive_before_ttl_delete",
hidden = not showAggregateFlowsPrefs
})
prefsInputFieldPrefs(subpage_active.entries["aggregated_flows_data_retention"].title,
subpage_active.entries["aggregated_flows_data_retention"].description, "ntopng.prefs.",
"aggregated_flows_data_retention_days", data_retention_utils.getAggregatedFlowsDataRetention(), "number",
@ -2221,6 +2229,31 @@ if auth.has_capability(auth.capabilities.preferences) then
print [[ </table>]]
end
function printIXPModeOptions()
print('<form method="post">')
print('<table class="table">')
print('<thead class="table-primary"><tr><th colspan=2 class="info">' .. i18n("prefs.ixp_mode") ..
'</th></tr></thead>')
local enabledIXP = ntop.getPref("ntopng.prefs.toggle_ixp_mode")
-- enable ixp mode toggle button
prefsToggleButton(subpage_active, {
field = "ixp_mode_enabled",
default = "0",
pref = "toggle_ixp_mode"
})
print(
'<tr><th colspan=2 style="text-align:right;"><button type="submit" class="btn btn-primary" style="width:115px" disabled="disabled">' ..
i18n("save") .. '</button></th></tr>')
print [[<input name="csrf" type="hidden" value="]]
print(ntop.getRandomCSRFValue())
print [[" />]]
print [[ </form>]]
print [[ </table>]]
end
function printNames()
print('<form method="post">')
print('<table class="table">')
@ -2414,6 +2447,10 @@ if auth.has_capability(auth.capabilities.preferences) then
printClickHouseOptions()
end
if (tab == "ixp_settings") then
printIXPModeOptions()
end
if (tab == "dump_settings") then
printDumpSettings()
end