// 2020 - ntop.org const special_characters_regex = /[\@\#\<\>\\\/\?\'\"\`\~\|\.\:\;\,\!\&\*\(\)\{\}\[\]\_\-\+\=\%\$\^]/g; const get_configuration_data = ($config_table, $button_caller) => { // get row data const row_data = $config_table.row($button_caller.parent().parent()).data(); return { config_id: row_data.id, config_name: row_data.name, config_pools: row_data.pools } } const resetConfig = () => { var params = {}; params.csrf = pageCsrf; params.action = "reset_config"; var form = NtopUtils.paramsToForm('
', params); form.appendTo('body').submit(); } $(function() { const add_columns = () => { const pools_column = { data: 'pools', render: function(data, type, row) { // show pools as a string into display mode // if there aren't ant pools then show an alert if (type == "display" && data.length > 0) { const flat = data.map((f) => f.label); return flat.join(', '); } else if (type == 'display' && data.length == 0) { return `${i18n.no_pools_applied}` } // return pools as a string const flat = data.map((f) => f.label); return flat.join(', '); } } const name_column = { data: 'name', defaultContent: '{Config Name}', render: (data, type, row) => `${data}` } const action_column = { pools: -1, width: '200px', data: null, className: 'text-center', render: function(data, type, row) { let rv = ` `; return `