From fdc2ff603de95e7d51519877dcafe9ea0ccef7ba Mon Sep 17 00:00:00 2001 From: MatteoBiscosi Date: Thu, 10 Dec 2020 12:43:46 +0100 Subject: [PATCH] Fixed maximum hosts/flows wizard --- packages/wizard/ntopng-config | 5 ++--- scripts/locales/en.lua | 2 ++ scripts/lua/modules/configuration_utils.lua | 2 +- .../lua/modules/toasts/predicates_defined_toasts.lua | 12 ++++++------ 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/packages/wizard/ntopng-config b/packages/wizard/ntopng-config index 0bfe6c56b8..6faa5aea78 100755 --- a/packages/wizard/ntopng-config +++ b/packages/wizard/ntopng-config @@ -66,9 +66,8 @@ function fastChangeOption { fi fi - echo "$(<$NTOPNG_CONFIG_PATH/$NTOPNG_STD_NAME)" | sed 's/root/0/' - >$NTOPNG_CONFIG_PATH/$NTOPNG_STD_NAME - # Sed cannot be used due to ownership problems - # sed -i "/-$1=/c\\-$1=$INPUT" $NTOPNG_CONFIG_PATH/$NTOPNG_STD_NAME 2>/dev/null + sed "/-$1=/c\\-$1=$INPUT" $NTOPNG_CONFIG_PATH/$NTOPNG_STD_NAME > /tmp/$NTOPNG_STD_NAME + mv -f /tmp/$NTOPNG_STD_NAME $NTOPNG_CONFIG_PATH/$NTOPNG_STD_NAME exitstatus=$? if [ "$exitstatus" = "0" ]; then diff --git a/scripts/locales/en.lua b/scripts/locales/en.lua index da8e26b660..cfb2619f75 100644 --- a/scripts/locales/en.lua +++ b/scripts/locales/en.lua @@ -494,6 +494,8 @@ local lang = { ["too_many_drops"] = "%{iface} has too many dropped packets [> %{max_drops}%%]", ["too_many_flows"] = "%{iface} has too many flows. Please extend the %{option} command line option.", ["too_many_flows_title"] = "Double Max Flows", + ["too_many_flows_details"] = "Do you want to double the actual number of maximum Flows?" + ["too_many_hosts_details"] = "Do you want to double the actual number of maximum Hosts?" ["too_many_hosts"] = "%{iface} has too many hosts. Please extend the %{option} command line option.", ["too_many_hosts_title"] = "Double Max Hosts", ["x_alerts"] = "%{num} alerts", diff --git a/scripts/lua/modules/configuration_utils.lua b/scripts/lua/modules/configuration_utils.lua index 6adeab4cf1..78c07e9142 100644 --- a/scripts/lua/modules/configuration_utils.lua +++ b/scripts/lua/modules/configuration_utils.lua @@ -9,7 +9,7 @@ local rest_utils = require("rest_utils") local conf_utils = {} local redis_key = "increased_max_num_host_or_flows" -local dir = "/bin/ntopng/ntopng-config" +local dir = "/usr/bin/ntopng-config" -- ################################################################ diff --git a/scripts/lua/modules/toasts/predicates_defined_toasts.lua b/scripts/lua/modules/toasts/predicates_defined_toasts.lua index 50dce2edb1..a7dee78158 100644 --- a/scripts/lua/modules/toasts/predicates_defined_toasts.lua +++ b/scripts/lua/modules/toasts/predicates_defined_toasts.lua @@ -142,10 +142,10 @@ local function create_too_many_flows_toast(toast, level) dialog = { id = 'toast-config-change-modal', action = 'toastConfigFlowChanges()', - title = i18n("restart.restart_product", {product=info.product}), - message = i18n("restart.confirm", {product=info.product}), + title = i18n("too_many_flows"), + message = i18n("too_many_flows_details"), custom_alert_class = 'alert alert-danger', - confirm = i18n('restart.restart'), + confirm = i18n('too_many_flows'), confirm_button = 'btn-danger' } } @@ -169,10 +169,10 @@ local function create_too_many_hosts_toast(toast, level) dialog = { id = 'toast-config-change-modal', action = 'toastConfigHostChanges()', - title = i18n("restart.restart_product", {product=info.product}), - message = i18n("restart.confirm", {product=info.product}), + title = i18n("too_many_hosts"), + message = i18n("too_many_hosts_details"), custom_alert_class = 'alert alert-danger', - confirm = i18n('restart.restart'), + confirm = i18n('too_many_hosts'), confirm_button = 'btn-danger' } }