Merge branch 'ent-9662-second-round' into 'develop'

Ent 9662 second round

See merge request artica/pandorafms!5609
This commit is contained in:
daniel 2023-03-16 18:50:46 +00:00
commit 4c465e450f
37 changed files with 964 additions and 596 deletions

View File

@ -441,84 +441,95 @@ function quickShellSettings()
}
// Form. Using old style.
echo '<fieldset>';
echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('Quickshell').'</legend>';
$t = new StdClass();
$t->data = [];
$t->width = '100%';
$t->class = 'databox filters';
$t->class = 'filter-table-adv';
$t->data = [];
$t->style = [];
$t->style[0] = 'font-weight: bold; width: 40%;';
$t->style[0] = 'width: 50%;';
$t->data[0][0] = __('Gotty path');
$t->data[0][1] = html_print_input_text(
'gotty',
$config['gotty'],
'',
30,
100,
true
$t->data[0][] = html_print_label_input_block(
__('Gotty path'),
html_print_input_text(
'gotty',
$config['gotty'],
'',
30,
100,
true
)
);
$t->data[1][0] = __('Gotty host');
$t->data[1][1] = html_print_input_text(
'gotty_host',
$config['gotty_host'],
'',
30,
100,
true
$t->data[0][] = html_print_label_input_block(
__('Gotty host'),
html_print_input_text(
'gotty_host',
$config['gotty_host'],
'',
30,
100,
true
)
);
$t->data[2][0] = __('Gotty ssh port');
$t->data[2][1] = html_print_input_text(
'gotty_ssh_port',
$config['gotty_ssh_port'],
'',
30,
100,
true
$t->data[1][] = html_print_label_input_block(
__('Gotty ssh port'),
html_print_input_text(
'gotty_ssh_port',
$config['gotty_ssh_port'],
'',
30,
100,
true
)
);
$t->data[3][0] = __('Gotty telnet port');
$t->data[3][1] = html_print_input_text(
'gotty_telnet_port',
$config['gotty_telnet_port'],
'',
30,
100,
true
$t->data[1][] = html_print_label_input_block(
__('Gotty telnet port'),
html_print_input_text(
'gotty_telnet_port',
$config['gotty_telnet_port'],
'',
30,
100,
true
)
);
$hidden = new StdClass();
$hidden = new stdClass();
$hidden->data = [];
$hidden->width = '100%';
$hidden->class = 'databox filters';
$hidden->class = 'filter-table-adv';
$hidden->data = [];
$hidden->style[0] = 'font-weight: bold;width: 40%;';
$hidden->style[0] = 'width: 50%;';
$hidden->data[0][0] = __('Gotty user');
$hidden->data[0][1] = html_print_input_text(
'gotty_user',
$config['gotty_user'],
'',
30,
100,
true
$hidden->data[0][] = html_print_label_input_block(
__('Gotty user'),
html_print_input_text(
'gotty_user',
$config['gotty_user'],
'',
30,
100,
true
)
);
$hidden->data[1][0] = __('Gotty password');
$hidden->data[1][1] = html_print_input_password(
'gotty_pass',
io_output_password($config['gotty_pass']),
'',
30,
100,
true
$hidden->data[0][] = html_print_label_input_block(
__('Gotty password'),
html_print_input_password(
'gotty_pass',
io_output_password($config['gotty_pass']),
'',
30,
100,
true
)
);
$hidden->data[1][1] .= ui_print_reveal_password('gotty_pass', true);
html_print_table($t);

View File

@ -458,6 +458,7 @@ if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
'enterprise/images/custom_splash_login/'.$config['custom_splash_login'],
false,
[
'class' => 'splash-logo',
'alt' => 'splash',
'border' => 0,
],

View File

@ -1907,62 +1907,64 @@ if ($create_module) {
);
}
if (is_error($id_agent_module) === true) {
switch ($id_agent_module) {
case ERR_EXIST:
$msg = __('There was a problem adding module. Another module already exists with the same name.');
break;
if ($update_module || $create_module) {
if (is_error($id_agent_module) === true) {
switch ($id_agent_module) {
case ERR_EXIST:
$msg = __('There was a problem adding module. Another module already exists with the same name.');
break;
case ERR_INCOMPLETE:
$msg = __('There was a problem adding module. Some required fields are missed : (name)');
break;
case ERR_INCOMPLETE:
$msg = __('There was a problem adding module. Some required fields are missed : (name)');
break;
case ERR_DB:
case ERR_GENERIC:
default:
$msg = __('There was a problem adding module. Processing error');
break;
}
case ERR_DB:
case ERR_GENERIC:
default:
$msg = __('There was a problem adding module. Processing error');
break;
}
// I save the result of the action (insert or update).
$success_action = $id_agent_module;
// I save the result of the action (insert or update).
$success_action = $id_agent_module;
$id_agent_module = false;
ui_print_error_message($msg);
$edit_module = true;
$moduletype = $id_module;
db_pandora_audit(
AUDIT_LOG_AGENT_MANAGEMENT,
"Fail to try added module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias'])
);
} else {
if ($prediction_module === MODULE_PREDICTION_SYNTHETIC) {
enterprise_hook(
'modules_create_synthetic_operations',
[
$id_agent_module,
$serialize_ops,
]
$id_agent_module = false;
ui_print_error_message($msg);
$edit_module = true;
$moduletype = $id_module;
db_pandora_audit(
AUDIT_LOG_AGENT_MANAGEMENT,
"Fail to try added module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias'])
);
} else {
if ($prediction_module === MODULE_PREDICTION_SYNTHETIC) {
enterprise_hook(
'modules_create_synthetic_operations',
[
$id_agent_module,
$serialize_ops,
]
);
}
// Update the module interval.
cron_update_module_interval($id_agent_module, $cron_interval);
ui_print_success_message(__('Module added successfully'));
$id_agent_module = false;
$edit_module = false;
$info = '';
$agent = db_get_row('tagente', 'id_agente', $id_agente);
db_pandora_audit(
AUDIT_LOG_AGENT_MANAGEMENT,
"Added module '".db_escape_string_sql($name)."' for agent ".io_safe_output($agent['alias']),
false,
true,
io_json_mb_encode($values)
);
}
// Update the module interval.
cron_update_module_interval($id_agent_module, $cron_interval);
ui_print_success_message(__('Module added successfully'));
$id_agent_module = false;
$edit_module = false;
$info = '';
$agent = db_get_row('tagente', 'id_agente', $id_agente);
db_pandora_audit(
AUDIT_LOG_AGENT_MANAGEMENT,
"Added module '".db_escape_string_sql($name)."' for agent ".io_safe_output($agent['alias']),
false,
true,
io_json_mb_encode($values)
);
}
}

View File

@ -907,12 +907,12 @@ if ($agents !== false) {
$agentDisableEnableTitle = __('Enable agent');
$agentDisableEnableAction = 'enable_agent';
$agentDisableEnableCaption = __('You are going to enable a cluster agent. Are you sure?');
$agentDisableEnableIcon = 'change-pause.svg';
$agentDisableEnableIcon = 'change-active.svg';
} else {
$agentDisableEnableTitle = __('Disable agent');
$agentDisableEnableAction = 'disable_agent';
$agentDisableEnableCaption = __('You are going to disable a cluster agent. Are you sure?');
$agentDisableEnableIcon = 'change-active.svg';
$agentDisableEnableIcon = 'change-pause.svg';
}
$agentActionButtons[] = html_print_menu_button(

View File

@ -123,7 +123,7 @@ $table->data[1][0] = html_print_label_input_block(
'w100p',
false,
'width: 100%;'
).'<span id="advanced_action" class="advanced_actions invisible"><br>'.__('Number of alerts match from').' '.html_print_input_text('fires_min', '', '', 4, 10, true).' '.__('to').' '.html_print_input_text('fires_max', '', '', 4, 10, true).'</span>'.$create_action
).'<span id="advanced_action" class="advanced_actions invisible"><br>'.__('Number of alerts match from').' '.html_print_input_text('fires_min', '', '', 4, 10, true).' '.__('to').' '.html_print_input_text('fires_max', '', '', 4, 10, true).'</span><div class="flex_justify_end">'.$create_action.'</div>'
);
$own_info = get_user_info($config['id_user']);
@ -162,7 +162,7 @@ $table->data[1][1] = html_print_label_input_block(
'w100p',
false,
'width: 100%;'
).' <a class="template_details invisible" href="#">'.html_print_image('images/zoom.png', true, ['class' => 'img_help']).'</a>'.$create_template
).' <a class="template_details invisible" href="#">'.html_print_image('images/zoom.png', true, ['class' => 'img_help']).'</a><div class="flex_justify_end">'.$create_template.'</div>'
);
$table->data[2][0] = html_print_label_input_block(

View File

@ -132,7 +132,7 @@ $table->data[1][1] = '<a href="javascript:">'.html_print_image(
[
'id' => 'right',
'title' => __('Add fields to select'),
'style' => 'rotate: 180deg; width: 40px',
'style' => 'rotate: 180deg;',
]
).'</a>';
$table->data[1][1] .= '<br><br><br><br><a href="javascript:">'.html_print_image(
@ -141,7 +141,7 @@ $table->data[1][1] .= '<br><br><br><br><a href="javascript:">'.html_print_image(
[
'id' => 'left',
'title' => __('Delete fields to select'),
'style' => 'width: 40px',
'style' => '',
]
).'</a>';

View File

@ -211,7 +211,6 @@ $buttons = html_print_submit_button(
true
);
// hd($filters);
if (empty($filters) === false) {
echo '<form id="multiple_delete" method="POST" action="'.$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_edit&pure='.$pure.'">';
html_print_input_hidden('multiple_delete', 1);

View File

@ -55,7 +55,7 @@ $iconData[] = html_print_select(
$iconData[] = html_print_div(
[
'id' => 'icon_image',
'class' => 'inverse_filter main_menu_icon',
'class' => 'invert_filter main_menu_icon',
'style' => 'margin-left: 10px',
'content' => ui_print_os_icon($idOS, false, true),
],

View File

@ -133,7 +133,7 @@ foreach ($osList as $os) {
$data[] = html_print_anchor(
[
'href' => $hrefDelete,
'class' => 'inverse_filter main_menu_icon',
'class' => 'invert_filter main_menu_icon',
'content' => html_print_image('images/delete.svg', true),
],
true

View File

@ -14,7 +14,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License

View File

@ -178,18 +178,18 @@ $select_in = html_print_select(
$table_ichanges = '<table>
<tr>
<td>'.__('Out of black list').'</td>
<td></td>
<td>'.__('In black list').'</td>
<td style="width: 45%">'.__('Out of black list').'</td>
<td style="width: 10%"></td>
<td style="width: 45%">'.__('In black list').'</td>
</tr>
<tr>
<td>'.$select_out.'</td>
<td>
<td style="width: 45%">'.$select_out.'</td>
<td style="width: 10%">
<a href="javascript:">'.html_print_image('images/arrow@svg.svg', true, ['style' => 'rotate: 180deg;', 'id' => 'right_iblacklist', 'alt' => __('Push selected modules into blacklist'), 'title' => __('Push selected modules into blacklist'), 'class' => 'main_menu_icon invert_filter']).'</a>
<br><br>
<a href="javascript:">'.html_print_image('images/arrow@svg.svg', true, ['style' => 'rotate: 0', 'id' => 'left_iblacklist', 'alt' => __('Pop selected modules out of blacklist'), 'title' => __('Pop selected modules out of blacklist'), 'class' => 'main_menu_icon invert_filter']).'</a>
</td>
<td>'.$select_in.'</td>
<td style="width: 45%">'.$select_in.'</td>
</tr>
</table>';
@ -680,7 +680,7 @@ $table->data[$i][] = html_print_label_input_block(
echo '<form class="max_floating_element_size" id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=general&amp;pure='.$config['pure'].'">';
echo '<fieldset>';
echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('General options').'</legend>';
html_print_input_hidden('update_config', 1);
@ -695,7 +695,7 @@ $encryption = [
echo '</fieldset>';
echo '<fieldset>';
echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('Mail configuration').'</legend>';
ui_print_warning_message(

View File

@ -14,7 +14,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -37,46 +37,66 @@ $update = (bool) get_parameter('update');
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filter-table-adv';
$table->border = 0;
$table->cellspacing = 3;
$table->cellpadding = 5;
$table->class = 'databox filters';
$table->data = [];
$table->data[0][0] = '<b>'.__('Data storage path').'</b>';
$table->data[0][1] = html_print_input_text('netflow_path', $config['netflow_path'], false, 50, 200, true);
$table->data[0][] = html_print_label_input_block(
__('Data storage path'),
html_print_input_text('netflow_path', $config['netflow_path'], false, 50, 200, true)
);
$table->data[1][0] = '<b>'.__('Daemon interval').'</b>';
$table->data[1][1] = html_print_input_text('netflow_interval', $config['netflow_interval'], false, 50, 200, true);
$table->data[0][] = html_print_label_input_block(
__('Daemon interval'),
html_print_input_text('netflow_interval', $config['netflow_interval'], false, 50, 200, true)
);
$table->data[2][0] = '<b>'.__('Daemon binary path').'</b>';
$table->data[2][1] = html_print_input_text('netflow_daemon', $config['netflow_daemon'], false, 50, 200, true);
$table->data[1][] = html_print_label_input_block(
__('Daemon binary path'),
html_print_input_text('netflow_daemon', $config['netflow_daemon'], false, 50, 200, true)
);
$table->data[3][0] = '<b>'.__('Nfdump binary path').'</b>';
$table->data[3][1] = html_print_input_text('netflow_nfdump', $config['netflow_nfdump'], false, 50, 200, true);
$table->data[1][] = html_print_label_input_block(
__('Nfdump binary path'),
html_print_input_text('netflow_nfdump', $config['netflow_nfdump'], false, 50, 200, true)
);
$table->data[4][0] = '<b>'.__('Nfexpire binary path').'</b>';
$table->data[4][1] = html_print_input_text('netflow_nfexpire', $config['netflow_nfexpire'], false, 50, 200, true);
$table->data[2][] = html_print_label_input_block(
__('Nfexpire binary path'),
html_print_input_text('netflow_nfexpire', $config['netflow_nfexpire'], false, 50, 200, true)
);
$table->data[5][0] = '<b>'.__('Maximum chart resolution').'</b>';
$table->data[5][1] = html_print_input_text('netflow_max_resolution', $config['netflow_max_resolution'], false, 50, 200, true);
$table->data[2][] = html_print_label_input_block(
__('Maximum chart resolution'),
html_print_input_text('netflow_max_resolution', $config['netflow_max_resolution'], false, 50, 200, true)
);
$table->data[6][0] = '<b>'.__('Disable custom live view filters').'</b>';
$table->data[6][1] = html_print_checkbox_switch('netflow_disable_custom_lvfilters', 1, $config['netflow_disable_custom_lvfilters'], true);
$table->data[7][0] = '<b>'.__('Netflow max lifetime').'</b>';
$table->data[7][1] = html_print_input_text('netflow_max_lifetime', $config['netflow_max_lifetime'], false, 50, 200, true);
$table->data[3][] = html_print_label_input_block(
__('Disable custom live view filters'),
html_print_checkbox_switch('netflow_disable_custom_lvfilters', 1, $config['netflow_disable_custom_lvfilters'], true)
);
$table->data[3][] = html_print_label_input_block(
__('Netflow max lifetime'),
html_print_input_text('netflow_max_lifetime', $config['netflow_max_lifetime'], false, 50, 200, true)
);
$table->data[8][0] = '<b>'.__('Name resolution for IP address').'</b>';
$onclick = "if (!confirm('".__('Warning').'. '.__('IP address resolution can take a lot of time')."')) return false;";
$table->data[8][1] = html_print_checkbox_switch_extended('netflow_get_ip_hostname', 1, $config['netflow_get_ip_hostname'], false, $onclick, '', true);
echo '<form id="netflow_setup" method="post">';
$table->data[4][] = html_print_label_input_block(
__('Name resolution for IP address'),
html_print_checkbox_switch_extended('netflow_get_ip_hostname', 1, $config['netflow_get_ip_hostname'], false, $onclick, '', true)
);
echo '<form class="max_floating_element_size" id="netflow_setup" method="post">';
html_print_table($table);
// Update button.
echo '<div class="action-buttons w100p">';
html_print_input_hidden('update_config', 1);
html_print_submit_button(__('Update'), 'upd_button', false, 'class="sub upd"');
echo '</div></form>';
html_print_input_hidden('update_config', 1);
html_print_action_buttons(
html_print_submit_button(
__('Update'),
'upd_button',
false,
['icon' => 'update'],
true
)
);
echo '</form>';

View File

@ -65,7 +65,7 @@ require_once 'include/functions_themes.php';
require_once 'include/functions_gis.php';
$row = 0;
echo '<form id="form_setup" method="post">';
echo '<form id="form_setup" class="max_floating_element_size" method="post">';
html_print_input_hidden('update_config', 1);
$performance_variables_control = (array) json_decode(io_safe_output($config['performance_variables_control']));
@ -352,6 +352,42 @@ $table_styles->data[$row][] = html_print_label_input_block(
'width: 100%'
)
);
$table_styles->data[$row][] = html_print_label_input_block(
__('Status icon set'),
html_print_div(
[
'class' => 'select-with-sibling',
'content' => html_print_select(
$iconsets,
'status_images_set',
$config['status_images_set'],
'',
'',
'',
true,
false,
true,
'',
false,
'width: 240px'
).html_print_button(
__('View'),
'status_set_preview',
false,
'',
[
'icon' => 'camera',
'mode' => 'link',
'class' => 'logo_preview',
],
true
),
],
true
)
);
$row++;
$table_styles->data[$row][] = html_print_label_input_block(
__('Custom favicon'),
@ -374,7 +410,10 @@ $table_styles->data[$row][] = html_print_label_input_block(
).html_print_image(
ui_get_favicon(),
true,
['id' => 'favicon_preview']
[
'id' => 'favicon_preview',
'style' => 'margin-left: 10px',
]
),
],
true
@ -392,7 +431,7 @@ $table_styles->data[$row][] = html_print_label_input_block(
$config['login_background'],
'',
__('Default'),
'',
'background_pandora_console_keys.jpg',
true,
false,
true,
@ -498,7 +537,7 @@ $table_styles->data[$row][] = html_print_label_input_block(
html_print_div(
[
'class' => 'select-with-sibling',
'content' => $entOpenFilesInput.html_print_button(
'content' => $customLogoLoginInput.html_print_button(
__('View'),
'custom_logo_login_preview',
$open,
@ -532,7 +571,7 @@ if (enterprise_installed() === true) {
$config['custom_splash_login'],
'',
__('Default'),
'default',
'default.svg',
true,
false,
true,
@ -648,7 +687,7 @@ if (enterprise_installed() === true) {
$config['custom_network_center_logo'],
'',
__('Default'),
'',
'bola_pandora_network_maps.png',
true,
false,
true,
@ -1588,44 +1627,84 @@ $switchProminentTime .= html_print_radio_button(
true
);
if ($config['csv_divider'] !== ';' && $config['csv_divider'] !== ',' && $config['csv_divider'] !== '|') {
$csvDividerInputs = html_print_input_text(
'csv_divider',
$config['csv_divider'],
'',
20,
255,
true
);
$csvDividerInputs .= '<a id="csv_divider_custom" onclick="javascript: edit_csv_divider();">'.html_print_image(
'images/logs@svg.svg',
true,
[
'id' => 'select',
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
} else {
$csvDividerInputs = html_print_select(
$common_dividers,
'csv_divider',
$config['csv_divider'],
'',
'',
'',
true,
false,
false
);
$csvDividerInputs .= '<a id="csv_divider_custom" onclick="javascript: edit_csv_divider();">'.html_print_image(
'images/edit.svg',
true,
[
'id' => 'pencil',
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
}
$csvDividerIconEdit = 'images/edit.svg';
$csvDividerIconFile = 'images/logs@svg.svg';
$isCommonDivider = (in_array($config['csv_divider'], $common_dividers) === true);
$csvDividerIcon = ($isCommonDivider === false) ? $csvDividerIconEdit : $csvDividerIconFile;
$csvDividerInputsSub = html_print_div(
[
'class' => ($isCommonDivider === false) ? 'invisible' : '',
'id' => 'custom_divider_input',
'content' => html_print_input_text(
'csv_divider',
$config['csv_divider'],
'',
20,
255,
true,
false,
false,
'',
'',
'',
'off',
false,
'',
'',
'',
($isCommonDivider === false)
),
],
true
);
$csvDividerInputsSub .= html_print_div(
[
'class' => ($isCommonDivider === true) ? 'invisible' : '',
'id' => 'common_divider_input',
'content' => html_print_select(
$common_dividers,
'csv_divider',
$config['csv_divider'],
'',
'',
'',
true,
false,
false,
'',
($isCommonDivider === true),
),
],
true
);
$csvDividerInputs = html_print_div(
[
'class' => 'mrgn_right_10px',
'content' => $csvDividerInputsSub,
],
true
);
$csvDividerInputs .= html_print_image(
$csvDividerIcon,
true,
[
'id' => 'select_csv_divider',
'class' => 'invert_filter',
]
);
$csvDividerBlock = html_print_div(
[
'class' => 'flex-row-center',
'content' => $csvDividerInputs,
],
true
);
$options_data_multiplier = [];
$options_data_multiplier[0] = __('Use 1024 when module unit are bytes');
@ -1980,7 +2059,7 @@ $row++;
$table_other->data[$row][] = html_print_label_input_block(
__('CSV divider'),
$csvDividerInputs
$csvDividerBlock
);
$table_other->data[$row][] = html_print_label_input_block(
@ -2001,47 +2080,47 @@ $row++;
*
*/
echo '<fieldset class="max_floating_element_size">';
echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('Behaviour configuration').' '.ui_print_help_icon('behavoir_conf_tab', true).'</legend>';
html_print_table($table_behaviour);
echo '</fieldset>';
echo '<fieldset class="max_floating_element_size">';
echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('GIS configuration').' '.ui_print_help_icon('gis_conf_tab', true).'</legend>';
html_print_table($table_gis);
echo '</fieldset>';
echo '<fieldset class="max_floating_element_size">';
echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('Style configuration').' '.ui_print_help_icon('style_conf_tab', true).'</legend>';
html_print_table($table_styles);
echo '</fieldset>';
echo '<fieldset class="max_floating_element_size">';
echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('Charts configuration').' '.ui_print_help_icon('charts_conf_tab', true).'</legend>';
html_print_table($table_chars);
echo '</fieldset>';
echo '<fieldset class="max_floating_element_size">';
echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('Font and Text configuration').' '.ui_print_help_icon('front_and_text_conf_tab', true).'</legend>';
html_print_table($table_font);
echo '</fieldset>';
echo '<fieldset class="max_floating_element_size">';
echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('Visual consoles configuration').' '.ui_print_help_icon('visual_consoles_conf_tab', true).'</legend>';
html_print_table($table_vc);
echo '</fieldset>';
echo '<fieldset class="max_floating_element_size">';
echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('Reports configuration ').ui_print_help_icon('reports_configuration_tab', true).'</legend>';
html_print_table($table_report);
echo '</fieldset>';
echo '<fieldset class="max_floating_element_size">';
echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('Services configuration').' '.ui_print_help_icon('services_conf_tab', true).'</legend>';
html_print_table($table_ser);
echo '</fieldset>';
echo '<fieldset class="max_floating_element_size">';
echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('Other configuration').' '.ui_print_help_icon('other_conf_tab', true).'</legend>';
html_print_table($table_other);
echo '</fieldset>';
@ -2068,26 +2147,21 @@ ui_require_javascript_file('pandora');
?>
<script language="javascript" type="text/javascript">
function edit_csv_divider () {
if ($("#csv_divider_custom img").attr("id") == "pencil") {
$("#csv_divider_custom img").attr("src", "images/default_list.png");
$("#csv_divider_custom img").attr("id", "select");
var value = $("#csv_divider").val();
$("#csv_divider").replaceWith("<input id='text-csv_divider' name='csv_divider' type='text'>");
$("#text-csv_divider").val(value);
}
else {
$("#csv_divider_custom img").attr("src", "images/edit.svg");
$("#csv_divider_custom img").attr("id", "pencil");
$("#text-csv_divider").replaceWith("<select id='csv_divider' name='csv_divider'>");
var o = new Option(";", ";");
var o1 = new Option(",", ",");
var o2 = new Option("|", "|");
$("#csv_divider").append(o);
$("#csv_divider").append(o1);
$("#csv_divider").append(o2);
}
}
$(document).ready(function(){
var editIcon = "<?php echo $csvDividerIconEdit; ?>";
var listIcon = "<?php echo $csvDividerIconFile; ?>";
$("#select_csv_divider").click(function(){
$("#custom_divider_input").toggleClass('invisible');
$("#common_divider_input").toggleClass('invisible');
let iconPath = $("#select_csv_divider").attr("src");
if (iconPath.includes(editIcon)) {
$("#select_csv_divider").attr("src", listIcon);
} else {
$("#select_csv_divider").attr("src", editIcon);
}
})
})
// Juanma (07/05/2014) New feature: Custom front page for reports
function display_custom_report_front (show,table) {
@ -2213,17 +2287,15 @@ $(document).ready (function () {
$("input[name='custom_value']").val("");
$("input[name='custom_text']").val("");
$('#submit-update_button').trigger('click');
$('#button-update_button').trigger('click');
});
$("#button-custom_value_add_btn").click( function() {
$('#hidden-custom_value_add').val(1);
$('#submit-update_button').trigger('click');
$('#button-update_button').trigger('click');
});
//------------------------------------------------------------------
//------------------------------------------------------------------
// CUSTOM INTERVAL VALUES
//------------------------------------------------------------------
@ -2234,10 +2306,11 @@ $(document).ready (function () {
});
$("#button-interval_add_btn").click( function() {
$('#hidden-interval_values').val(1);
$('#button-update_button').trigger('click');
});
//------------------------------------------------------------------
//------------------------------------------------------------------
// CUSTOM MODULE UNITS
//------------------------------------------------------------------

View File

@ -14,7 +14,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -32,68 +32,70 @@ $url = ui_get_full_url(
'index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=websocket_engine&amp;pure='.$config['pure']
);
echo '<form id="form_setup" method="post" action="'.$url.'">';
echo '<form class="max_floating_element_size" id="form_setup" method="post" action="'.$url.'">';
echo '<fieldset>';
echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('WebSocket settings').'</legend>';
$t = new StdClass();
$t->data = [];
$t->width = '100%';
$t->class = 'databox filters';
$t->class = 'databox filter-table-adv';
$t->data = [];
$t->style[0] = 'font-weight: bold';
$t->data[0][0] = __('Bind address');
$t->data[0][1] = html_print_input_text(
'ws_bind_address',
$config['ws_bind_address'],
'',
30,
100,
true
$t->data[0][] = html_print_label_input_block(
__('Bind address'),
html_print_input_text(
'ws_bind_address',
$config['ws_bind_address'],
'',
30,
100,
true
)
);
$t->data[1][0] = __('Bind port');
$t->data[1][2] = html_print_input_text(
'ws_port',
$config['ws_port'],
'',
30,
100,
true
$t->data[0][] = html_print_label_input_block(
__('Bind port'),
html_print_input_text(
'ws_port',
$config['ws_port'],
'',
30,
100,
true
)
);
$t->data[2][0] = __('WebSocket proxy url');
$t->data[2][2] = html_print_input_text(
'ws_proxy_url',
$config['ws_proxy_url'],
'',
30,
100,
true
$t->data[1][] = html_print_label_input_block(
__('WebSocket proxy url'),
html_print_input_text(
'ws_proxy_url',
$config['ws_proxy_url'],
'',
30,
100,
true
)
);
html_print_input_hidden('update_config', 1);
html_print_table($t);
echo '</fieldset>';
if (function_exists('quickShellSettings') === true) {
quickShellSettings();
}
html_print_div(
[
'class' => 'action-buttons w100p',
'content' => html_print_submit_button(
__('Update'),
'update_button',
false,
[ 'icon' => 'update' ],
true
),
]
html_print_action_buttons(
html_print_submit_button(
__('Update'),
'update_button',
false,
[ 'icon' => 'update' ],
true
)
);
echo '</form>';

View File

@ -14,7 +14,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -203,132 +203,161 @@ class ExternalTools extends HTML
}
}
html_print_div(['id' => 'layer_sound_alert']);
html_print_div(['id' => 'layer_sound_critical']);
html_print_div(['id' => 'layer_sound_warning']);
// Make the table for show the form.
$table = new stdClass();
$table->width = '100%';
$table->class = 'filter-table-adv';
$table->id = 'commandsTable';
$table->data = [];
$table->data[$i][0] = __('Sound for Alert fired');
$table->data[$i][1] = html_print_select(
$sounds,
'sound_alert',
$config['sound_alert'],
'replaySound(\'alert\');',
'',
'',
true
);
$table->data[$i][1] .= html_print_anchor(
[
'href' => 'javascript:toggleButton(\'alert\')',
'content' => html_print_image(
'images/control_play_col.png',
true,
[
'id' => 'button_sound_warning',
'style' => 'vertical-align: middle;',
'width' => '16',
'title' => __('Play sound'),
'class' => 'invert_filter',
]
),
],
true
);
$table->data[$i++][1] .= '<div id="layer_sound_alert"></div>';
$table->data[$i][0] = __('Sound for Monitor critical');
$table->data[$i][1] = html_print_select(
$sounds,
'sound_critical',
$config['sound_critical'],
'replaySound(\'critical\');',
'',
'',
true
);
$table->data[$i][1] .= html_print_anchor(
[
'href' => 'javascript:toggleButton(\'critical\')',
'content' => html_print_image(
'images/control_play_col.png',
true,
[
'id' => 'button_sound_warning',
'style' => 'vertical-align: middle;',
'width' => '16',
'title' => __('Play sound'),
'class' => 'invert_filter',
]
),
],
true
);
$table->data[$i++][1] .= '<div id="layer_sound_critical"></div>';
$table->data[$i][0] = __('Sound for Monitor warning');
$table->data[$i][1] = html_print_select(
$sounds,
'sound_warning',
$config['sound_warning'],
'replaySound(\'warning\');',
'',
'',
true
);
$table->data[$i][1] .= html_print_anchor(
[
'href' => 'javascript:toggleButton(\'warning\')',
'content' => html_print_image(
'images/control_play_col.png',
true,
[
'id' => 'button_sound_warning',
'style' => 'vertical-align: middle;',
'width' => '16',
'title' => __('Play sound'),
'class' => 'invert_filter',
]
),
],
true
);
$table->data[$i++][1] .= '<div id="layer_sound_warning"></div>';
$table->data[$i][0] = __('Custom graphviz directory');
$table->data[$i++][1] = html_print_input_text(
'graphviz_bin_dir',
$config['graphviz_bin_dir'],
'',
25,
255,
true
$table->data[$i][] = html_print_label_input_block(
__('Sound for Alert fired'),
html_print_div(
[
'class' => '',
'content' => html_print_select(
$sounds,
'sound_alert',
$config['sound_alert'],
'replaySound(\'alert\');',
'',
'',
true
).html_print_anchor(
[
'href' => 'javascript:toggleButton(\'alert\')',
'content' => html_print_image(
'images/change-active.svg',
true,
[
'id' => 'button_sound_warning',
'style' => 'vertical-align: middle; margin-left: 10px',
'width' => '16',
'title' => __('Play sound'),
'class' => 'invert_filter',
]
),
],
true
),
],
true
),
);
$table->data[$i][0] = __('Traceroute path');
$table->data[$i++][1] = html_print_input_text('traceroute_path', $this->pathTraceroute, '', 40, 255, true);
$table->data[$i++][] = html_print_label_input_block(
__('Sound for Monitor critical'),
html_print_div(
[
'class' => '',
'content' => html_print_select(
$sounds,
'sound_critical',
$config['sound_critical'],
'replaySound(\'critical\');',
'',
'',
true
).html_print_anchor(
[
'href' => 'javascript:toggleButton(\'critical\')',
'content' => html_print_image(
'images/change-active.svg',
true,
[
'id' => 'button_sound_warning',
'style' => 'vertical-align: middle; margin-left: 10px',
'width' => '16',
'title' => __('Play sound'),
'class' => 'invert_filter',
]
),
],
true
),
],
true
),
);
$table->data[$i][0] = __('Ping path');
$table->data[$i++][1] = html_print_input_text('ping_path', $this->pathPing, '', 40, 255, true);
$table->data[$i++][] = html_print_label_input_block(
__('Sound for Monitor warning'),
html_print_div(
[
'class' => '',
'content' => html_print_select(
$sounds,
'sound_warning',
$config['sound_warning'],
'replaySound(\'warning\');',
'',
'',
true
).html_print_anchor(
[
'href' => 'javascript:toggleButton(\'warning\')',
'content' => html_print_image(
'images/change-active.svg',
true,
[
'id' => 'button_sound_warning',
'style' => 'vertical-align: middle; margin-left: 10px',
'width' => '16',
'title' => __('Play sound'),
'class' => 'invert_filter',
]
),
],
true
),
],
true
),
);
$table->data[$i][0] = __('Nmap path');
$table->data[$i++][1] = html_print_input_text('nmap_path', $this->pathNmap, '', 40, 255, true);
$table->data[$i][] = html_print_label_input_block(
__('Custom graphviz directory'),
html_print_input_text(
'graphviz_bin_dir',
$config['graphviz_bin_dir'],
'',
25,
255,
true
)
);
$table->data[$i][0] = __('Dig path');
$table->data[$i++][1] = html_print_input_text('dig_path', $this->pathDig, '', 40, 255, true);
$table->data[$i++][] = html_print_label_input_block(
__('Snmpget path'),
html_print_input_text('snmpget_path', $this->pathSnmpget, '', 40, 255, true)
);
$table->data[$i][0] = __('Snmpget path');
$table->data[$i++][1] = html_print_input_text('snmpget_path', $this->pathSnmpget, '', 40, 255, true);
$table->data[$i][] = html_print_label_input_block(
__('Traceroute path'),
html_print_input_text('traceroute_path', $this->pathTraceroute, '', 40, 255, true)
);
$table->data[$i++][] = html_print_label_input_block(
__('Ping path'),
html_print_input_text('ping_path', $this->pathPing, '', 40, 255, true)
);
$table->data[$i][] = html_print_label_input_block(
__('Nmap path'),
html_print_input_text('nmap_path', $this->pathNmap, '', 40, 255, true)
);
$table->data[$i++][] = html_print_label_input_block(
__('Dig path'),
html_print_input_text('dig_path', $this->pathDig, '', 40, 255, true)
);
$table->data[$i][0] = html_print_div(
[
'class' => 'title_custom_commands bolder float-left',
'content' => __('Custom commands'),
'content' => '<label>'.__('Custom commands').'</label>',
],
true
);
@ -336,13 +365,13 @@ class ExternalTools extends HTML
[
'id' => 'add_button_custom_command',
'content' => html_print_image(
'images/add.png',
'images/plus@svg.svg',
true,
[
'title' => __('Add new custom command'),
'onclick' => 'manageCommandLines(event)',
'id' => 'img_add_button_custom_command',
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
),
@ -350,8 +379,8 @@ class ExternalTools extends HTML
true
);
$table->data[$i][0] = __('Command');
$table->data[$i++][1] = __('Parameters').ui_print_help_tip(__('Adding `_address_` macro will use agent\'s IP when perform the execution'), true);
$table->data[$i][0] = '<div><label>'.__('Command').'</label></div>';
$table->data[$i++][1] = '<div style="flex-direction: row;justify-content: flex-start;"><label>'.__('Parameters').'</label>'.ui_print_help_tip(__('Adding `_address_` macro will use agent\'s IP when perform the execution'), true, '', false, 'margin-top: 2px').'</div>';
$y = 1;
$iRow = $i;
@ -378,30 +407,27 @@ class ExternalTools extends HTML
}
}
$form = '<form id="form_setup" method="post" >';
$form = '<form class="max_floating_element_size" id="form_setup" method="POST" >';
$form .= '<fieldset>';
$form .= '<legend>'.__('Options').'</legend>';
$form .= html_print_input_hidden('update_paths', 1, true);
$form .= html_print_table($table, true);
$form .= '</fieldset>';
$form .= html_print_div(
[
'id' => '',
'class' => 'action-buttons',
'style' => 'width: 100%',
'content' => html_print_submit_button(
__('Update'),
'update_button',
false,
[ 'icon' => 'update' ],
true
),
],
true
);
$form .= '</form>';
html_print_action_buttons(
html_print_submit_button(
__('Update'),
'update_button',
false,
[
'icon' => 'update',
'form' => 'form_setup',
],
true
)
);
echo $form;
}
@ -436,15 +462,14 @@ class ExternalTools extends HTML
$output = html_print_div(
[
'id' => 'delete_button_custom_'.$index,
'class' => '',
'content' => html_print_image(
'images/delete.png',
'images/delete.svg',
true,
[
'title' => __('Delete this custom command'),
'onclick' => 'manageCommandLines(event)',
'id' => 'img_delete_button_custom_'.$index,
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
),
],

View File

@ -453,7 +453,7 @@ class ManageNetScanScripts extends Wizard
'delete',
'images/delete.svg',
1,
'width:40px;',
'',
true,
[
'title' => __('Delete Script'),

View File

@ -868,7 +868,7 @@ class ModuleTemplates extends HTML
'delete_profile',
'images/delete.svg',
$row['id_np'],
'width:40px',
'',
true,
[
'onclick' => 'if (!confirm(\''.__('Are you sure?').'\')) return false;',
@ -1156,7 +1156,7 @@ class ModuleTemplates extends HTML
'del_block_'.$id_group.'_',
'images/delete.svg',
1,
'width: 40px',
'',
true,
[
'title' => __('Delete this block'),
@ -1253,7 +1253,7 @@ class ModuleTemplates extends HTML
'del_module_'.$module['component_id'].'_',
'images/delete.svg',
1,
'width:40px;',
'',
true,
[
'title' => __('Delete this module'),

View File

@ -121,6 +121,10 @@ class TipsWindow
}
ui_require_css_file('tips_window');
if ($config['style'] === 'pandora_black' && is_metaconsole() === false) {
ui_require_css_file('pandora_black');
}
ui_require_css_file('jquery.bxslider');
ui_require_javascript_file('tipsWindow');
ui_require_javascript_file('jquery.bxslider.min');
@ -435,7 +439,14 @@ class TipsWindow
'title',
'text',
'enable',
'actions',
[
'text' => 'edit',
'class' => 'table_action_buttons',
],
[
'text' => 'delete',
'class' => 'table_action_buttons',
],
];
$columnNames = [
@ -443,7 +454,8 @@ class TipsWindow
__('Title'),
__('Text'),
__('Enable'),
__('Actions'),
__('Edit'),
__('Delete'),
];
// Load datatables user interface.
@ -451,7 +463,9 @@ class TipsWindow
[
'id' => 'list_tips_windows',
'class' => 'info_table',
'style' => 'width: 100%',
'style' => 'width: 99%',
'dom_elements' => 'lpfti',
'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar',
'columns' => $columns,
'column_names' => $columnNames,
'ajax_url' => $this->ajaxController,
@ -474,18 +488,21 @@ class TipsWindow
],
]
);
echo '<div class="action-buttons w100p">';
echo '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&section=welcome_tips&view=create">';
html_print_submit_button(
echo '<div class="action-buttons w100p" style="width: 100%">';
$buttonCreate = '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&section=welcome_tips&view=create">';
$buttonCreate .= html_print_submit_button(
__('Create tip'),
'create',
false,
[
'class' => 'sub',
'icon' => 'create_file',
]
''
],
true
);
echo '</a>';
$buttonCreate .= '</a>';
html_print_action_buttons($buttonCreate);
echo '</div>';
} catch (Exception $e) {
echo $e->getMessage();
@ -585,16 +602,15 @@ class TipsWindow
$data[$key]['title'] = io_safe_output($row['title']);
$data[$key]['text'] = io_safe_output($row['text']);
$data[$key]['url'] = io_safe_output($row['url']);
$data[$key]['actions'] = '<div class="buttons_actions">';
$data[$key]['actions'] .= '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&section=welcome_tips&view=edit&idTip='.$row['id'].'">';
$data[$key]['actions'] .= html_print_image(
$data[$key]['edit'] = '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&section=welcome_tips&view=edit&idTip='.$row['id'].'">';
$data[$key]['edit'] .= html_print_image(
'images/edit.svg',
true,
['class' => 'main_menu_icon']
);
$data[$key]['actions'] .= '</a>';
$data[$key]['actions'] .= '<form name="grupo" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&section=welcome_tips&action=delete">';
$data[$key]['actions'] .= html_print_input_image(
$data[$key]['edit'] .= '</a>';
$data[$key]['delete'] .= '<form name="grupo" method="post" class="rowPair table_action_buttons" action="index.php?sec=gsetup&sec2=godmode/setup/setup&section=welcome_tips&action=delete">';
$data[$key]['delete'] .= html_print_input_image(
'button_delete_tip',
'images/delete.svg',
'',
@ -602,12 +618,11 @@ class TipsWindow
true,
[
'onclick' => 'if (!confirm(\''.__('Are you sure?').'\')) return false;',
'class' => 'main_menu_icon',
'class' => 'main_menu_icon invert_filter',
]
);
$data[$key]['actions'] .= html_print_input_hidden('idTip', $row['id'], true);
$data[$key]['actions'] .= '</form>';
$data[$key]['actions'] .= '</div>';
$data[$key]['delete'] .= html_print_input_hidden('idTip', $row['id'], true);
$data[$key]['delete'] .= '</form>';
}
if (empty($data) === true) {
@ -680,14 +695,50 @@ class TipsWindow
</script>';
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->class = 'databox filter-table-adv';
$table->style[0] = 'font-weight: bold';
$table->style[0] = 'width: 50%';
$table->data = [];
$table->data[0][0] = __('Images');
$table->data[0][1] .= html_print_div(['id' => 'inputs_images'], true);
$table->data[0][1] .= html_print_div(
$table->data[0][0] = html_print_label_input_block(
__('Language'),
html_print_select_from_sql(
'SELECT id_language, name FROM tlanguage',
'id_lang',
'',
'',
'',
'0',
true,
false,
true,
false,
'width: 100%;'
)
);
$table->data[0][1] = html_print_label_input_block(
__('Profile'),
html_print_select($profiles, 'id_profile', '0', '', __('All'), 0, true)
);
$table->data[1][0] = html_print_label_input_block(
__('Title'),
html_print_input_text('title', '', '', 35, 100, true)
);
$table->data[1][1] = html_print_label_input_block(
__('Url'),
html_print_input_text('url', '', '', 35, 100, true)
);
$table->data[2][0] = html_print_label_input_block(
__('Text'),
html_print_textarea('text', 5, 50, '', '', true),
);
$table->data[2][1] = html_print_label_input_block(
__('Enable'),
html_print_checkbox_switch('enable', true, true, true)
);
$inputImages = html_print_div(['id' => 'inputs_images'], true);
$inputImages .= html_print_div(
[
'id' => 'notices_images',
'class' => 'invisible',
@ -695,41 +746,36 @@ class TipsWindow
],
true
);
$table->data[0][1] .= html_print_button(__('Add image'), 'button_add_image', false, '', '', true);
$table->data[1][0] = __('Language');
$table->data[1][1] = html_print_select_from_sql(
'SELECT id_language, name FROM tlanguage',
'id_lang',
'',
'',
'',
'0',
$inputImages .= html_print_div(
[
'id' => 'notices_images',
'class' => 'invisible empty_input_images',
'content' => '<p>'.__('Please select a image').'</p>',
],
true
);
$table->data[2][0] = __('Profile');
$table->data[2][1] = html_print_select($profiles, 'id_profile', '0', '', __('All'), 0, true);
$table->data[3][0] = __('Title');
$table->data[3][1] = html_print_input_text('title', '', '', 35, 100, true);
$table->data[4][0] = __('Text');
$table->data[4][1] = html_print_textarea('text', 5, 50, '', '', true);
$table->data[5][0] = __('Url');
$table->data[5][1] = html_print_input_text('url', '', '', 35, 100, true);
$table->data[6][0] = __('Enable');
$table->data[6][1] = html_print_checkbox_switch('enable', true, true, true);
$inputImages .= html_print_button(__('Add image'), 'button_add_image', false, '', ['class' => 'button-add-image'], true);
echo '<form name="grupo" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&section=welcome_tips&view=create&action=create" enctype="multipart/form-data">';
$table->data[3][0] = html_print_label_input_block(
__('Images'),
$inputImages
);
echo '<form method="post" class="max_floating_element_size" action="index.php?sec=gsetup&sec2=godmode/setup/setup&section=welcome_tips&view=create&action=create" enctype="multipart/form-data">';
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_submit_button(
$actionButtons = html_print_submit_button(
__('Send'),
'submit_button',
false,
[
'class' => 'sub',
'icon' => 'update',
]
],
true
);
html_print_submit_button(
$actionButtons .= html_print_submit_button(
__('Preview'),
'preview_button',
false,
@ -737,8 +783,11 @@ class TipsWindow
'class' => 'sub preview',
'id' => 'prev_button',
'icon' => 'preview',
]
],
true
);
html_print_action_buttons($actionButtons);
echo '</div>';
echo '</form>';
html_print_div(['id' => 'tips_window_modal_preview']);
@ -812,16 +861,52 @@ class TipsWindow
</script>';
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->class = 'databox filter-table-adv';
$table->style[0] = 'font-weight: bold';
$table->style[0] = 'width: 50%';
$table->data = [];
$table->data[0][0] = __('Images');
$table->data[0][1] .= $outputImagesTip;
$table->data[0][1] .= html_print_div(['id' => 'inputs_images'], true);
$table->data[0][1] .= html_print_input_hidden('images_to_delete', '{}', true);
$table->data[0][1] .= html_print_div(
$table->data[0][0] = html_print_label_input_block(
__('Language'),
html_print_select_from_sql(
'SELECT id_language, name FROM tlanguage',
'id_lang',
$tip['id_lang'],
'',
'',
'0',
true,
false,
true,
false,
'width: 100%;'
)
);
$table->data[0][1] = html_print_label_input_block(
__('Profile'),
html_print_select($profiles, 'id_profile', $tip['id_profile'], '', __('All'), 0, true)
);
$table->data[1][0] = html_print_label_input_block(
__('Title'),
html_print_input_text('title', $tip['title'], '', 35, 100, true)
);
$table->data[1][1] = html_print_label_input_block(
__('Url'),
html_print_input_text('url', $tip['url'], '', 35, 100, true)
);
$table->data[2][0] = html_print_label_input_block(
__('Text'),
html_print_textarea('text', 5, 50, $tip['text'], '', true),
);
$table->data[2][1] = html_print_label_input_block(
__('Enable'),
html_print_checkbox_switch('enable', 1, ($tip['enable'] === '1') ? true : false, true)
);
$inputImages = $outputImagesTip;
$inputImages .= html_print_div(['id' => 'inputs_images'], true);
$inputImages .= html_print_input_hidden('images_to_delete', '{}', true);
$inputImages .= html_print_div(
[
'id' => 'notices_images',
'class' => 'invisible',
@ -829,41 +914,35 @@ class TipsWindow
],
true
);
$table->data[0][1] .= html_print_button(__('Add image'), 'button_add_image', false, '', '', true);
$table->data[1][0] = __('Language');
$table->data[1][1] = html_print_select_from_sql(
'SELECT id_language, name FROM tlanguage',
'id_lang',
$tip['id_lang'],
'',
'',
'0',
$inputImages .= html_print_div(
[
'id' => 'notices_images',
'class' => 'invisible empty_input_images',
'content' => '<p>'.__('Please select a image').'</p>',
],
true
);
$table->data[2][0] = __('Profile');
$table->data[2][1] = html_print_select($profiles, 'id_profile', $tip['id_profile'], '', __('All'), 0, true);
$table->data[3][0] = __('Title');
$table->data[3][1] = html_print_input_text('title', $tip['title'], '', 35, 100, true);
$table->data[4][0] = __('Text');
$table->data[4][1] = html_print_textarea('text', 5, 50, $tip['text'], '', true);
$table->data[5][0] = __('Url');
$table->data[5][1] = html_print_input_text('url', $tip['url'], '', 35, 100, true);
$table->data[6][0] = __('Enable');
$table->data[6][1] = html_print_checkbox_switch('enable', 1, ($tip['enable'] === '1') ? true : false, true);
$inputImages .= html_print_button(__('Add image'), 'button_add_image', false, '', ['class' => 'button-add-image'], true);
$table->data[3][0] = html_print_label_input_block(
__('Images'),
$inputImages
);
echo '<form name="grupo" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&section=welcome_tips&view=edit&action=edit&idTip='.$tip['id'].'" enctype="multipart/form-data">';
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_submit_button(
$actionButtons = html_print_submit_button(
__('Send'),
'submit_button',
false,
[
'class' => 'sub',
'icon' => 'update',
]
],
true
);
html_print_submit_button(
$actionButtons .= html_print_submit_button(
__('Preview'),
'preview_button',
false,
@ -871,9 +950,12 @@ class TipsWindow
'class' => 'sub preview',
'id' => 'prev_button',
'icon' => 'preview',
]
],
true
);
html_print_action_buttons($actionButtons);
echo '</div>';
echo '</form>';
html_print_div(['id' => 'tips_window_modal_preview']);

View File

@ -2752,6 +2752,146 @@ function events_print_type_img(
}
/**
* Prints the event type image.
*
* @param string $type Event type from SQL.
* @param boolean $return Whether to return or print.
*
* @return string HTML with img.
*/
function events_print_type_img_pdf(
$type,
$return=false
) {
$svg = '';
switch ($type) {
case 'alert_recovered':
$svg = '<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Dark / 20 / alert@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-alert" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M10,20 C11.4190985,20 12.5702076,18.8808594 12.5702076,17.5 L7.42979244,17.5 C7.42979244,18.8808594 8.5809015,20 10,20 Z M18.6540098,14.1519531 C17.8777645,13.3410156 16.425318,12.1210937 16.425318,8.125 C16.425318,5.08984375 14.2364028,2.66015625 11.2849029,2.0640625 L11.2849029,1.25 C11.2849029,0.559765625 10.7095493,0 10,0 C9.29045075,0 8.71509711,0.559765625 8.71509711,1.25 L8.71509711,2.0640625 C5.76359722,2.66015625 3.57468198,5.08984375 3.57468198,8.125 C3.57468198,12.1210938 2.12223547,13.3410156 1.3459902,14.1519531 C1.10492023,14.4039062 0.998045886,14.7050781 1.00002702,15 C1.00447442,15.640625 1.52156948,16.25 2.28977909,16.25 L17.7102209,16.25 C18.4784305,16.25 18.9959274,15.640625 18.999973,15 C19.0019541,14.7050781 18.8950798,14.4035156 18.6540098,14.1519531 L18.6540098,14.1519531 Z" id="Shape" fill="#82b92e"></path>
</g>
</svg>';
break;
case 'alert_manual_validation':
$svg = '<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Dark / 20 / validate@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-validate" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
<g id="Group" transform="translate(1.000000, 1.000000)" stroke="#3F3F3F" stroke-width="2">
<circle id="Oval" cx="9" cy="9" r="9"></circle>
<polyline id="Path-10" points="4.93746567 8.98550486 7 12 12.9374657 7.03800583"></polyline>
</g>
</g>
</svg>';
break;
case 'going_down_critical':
case 'going_up_critical':
$svg = '<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Dark / 20 / modules@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-modules" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M18.7929688,3.18164062 L10.8789062,0.162109375 C10.59375,0.0540234375 10.296875,0 10,0 C9.703125,0 9.40625,0.0540234375 9.12109375,0.161914062 L1.20664062,3.18164062 C0.480078125,3.45898438 0,4.15625 0,4.93359375 L0,15.0664062 C0,15.8441406 0.480078125,16.5410156 1.20664062,16.8183594 L9.12070313,19.8378906 C9.40625,19.9453125 9.703125,20 10,20 C10.296875,20 10.5949219,19.9459766 10.8777344,19.8380859 L18.7917969,16.8185547 C19.5195312,16.5429688 20,15.84375 20,15.0664062 L20,4.93359375 C20,4.15625 19.5195312,3.45898438 18.7929688,3.18164062 Z M10,2.50273437 L16.4921875,4.9796875 L10,7.4140625 L3.50664062,4.98046875 L10,2.50273437 Z M11.25,17.0273438 L11.25,9.6171875 L17.5,7.2734375 L17.5,14.6367188 L11.25,17.0273438 Z" id="Shape" fill="#e63c52"></path>
</g>
</svg>';
break;
case 'going_up_normal':
case 'going_down_normal':
$svg = '<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Dark / 20 / modules@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-modules" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M18.7929688,3.18164062 L10.8789062,0.162109375 C10.59375,0.0540234375 10.296875,0 10,0 C9.703125,0 9.40625,0.0540234375 9.12109375,0.161914062 L1.20664062,3.18164062 C0.480078125,3.45898438 0,4.15625 0,4.93359375 L0,15.0664062 C0,15.8441406 0.480078125,16.5410156 1.20664062,16.8183594 L9.12070313,19.8378906 C9.40625,19.9453125 9.703125,20 10,20 C10.296875,20 10.5949219,19.9459766 10.8777344,19.8380859 L18.7917969,16.8185547 C19.5195312,16.5429688 20,15.84375 20,15.0664062 L20,4.93359375 C20,4.15625 19.5195312,3.45898438 18.7929688,3.18164062 Z M10,2.50273437 L16.4921875,4.9796875 L10,7.4140625 L3.50664062,4.98046875 L10,2.50273437 Z M11.25,17.0273438 L11.25,9.6171875 L17.5,7.2734375 L17.5,14.6367188 L11.25,17.0273438 Z" id="Shape" fill="#82b92e"></path>
</g>
</svg>';
break;
case 'going_up_warning':
case 'going_down_warning':
$svg = '<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Dark / 20 / modules@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-modules" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M18.7929688,3.18164062 L10.8789062,0.162109375 C10.59375,0.0540234375 10.296875,0 10,0 C9.703125,0 9.40625,0.0540234375 9.12109375,0.161914062 L1.20664062,3.18164062 C0.480078125,3.45898438 0,4.15625 0,4.93359375 L0,15.0664062 C0,15.8441406 0.480078125,16.5410156 1.20664062,16.8183594 L9.12070313,19.8378906 C9.40625,19.9453125 9.703125,20 10,20 C10.296875,20 10.5949219,19.9459766 10.8777344,19.8380859 L18.7917969,16.8185547 C19.5195312,16.5429688 20,15.84375 20,15.0664062 L20,4.93359375 C20,4.15625 19.5195312,3.45898438 18.7929688,3.18164062 Z M10,2.50273437 L16.4921875,4.9796875 L10,7.4140625 L3.50664062,4.98046875 L10,2.50273437 Z M11.25,17.0273438 L11.25,9.6171875 L17.5,7.2734375 L17.5,14.6367188 L11.25,17.0273438 Z" id="Shape" fill="#fcab10"></path>
</g>
</svg>';
break;
case 'going_unknown':
$svg = '<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Dark / 20 / modules@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-modules" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M18.7929688,3.18164062 L10.8789062,0.162109375 C10.59375,0.0540234375 10.296875,0 10,0 C9.703125,0 9.40625,0.0540234375 9.12109375,0.161914062 L1.20664062,3.18164062 C0.480078125,3.45898438 0,4.15625 0,4.93359375 L0,15.0664062 C0,15.8441406 0.480078125,16.5410156 1.20664062,16.8183594 L9.12070313,19.8378906 C9.40625,19.9453125 9.703125,20 10,20 C10.296875,20 10.5949219,19.9459766 10.8777344,19.8380859 L18.7917969,16.8185547 C19.5195312,16.5429688 20,15.84375 20,15.0664062 L20,4.93359375 C20,4.15625 19.5195312,3.45898438 18.7929688,3.18164062 Z M10,2.50273437 L16.4921875,4.9796875 L10,7.4140625 L3.50664062,4.98046875 L10,2.50273437 Z M11.25,17.0273438 L11.25,9.6171875 L17.5,7.2734375 L17.5,14.6367188 L11.25,17.0273438 Z" id="Shape" fill="#808080"></path>
</g>
</svg>';
break;
case 'system':
$svg = '<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Dark / 20 / configuration@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-configuration" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M18.7953273,7.94064046 L18.0028475,7.94064046 C17.3563508,7.94064046 16.8141278,7.38349388 16.8141278,6.72220776 C16.8141278,6.38896121 16.9548972,6.08695652 17.205154,5.8630565 L17.7160949,5.36318667 C18.2218222,4.86331684 18.2218222,4.0458214 17.7160949,3.54595158 L16.5534436,2.39520958 C16.3240416,2.16610258 15.9851522,2.03072117 15.6410491,2.03072117 C15.296946,2.03072117 14.9632703,2.16610258 14.7286546,2.39520958 L14.2385684,2.88466545 C14.0039526,3.14501432 13.6911316,3.28560271 13.3522422,3.28560271 C12.6848908,3.28560271 12.1270267,2.74407706 12.1270267,2.10361885 L12.1270267,1.30695131 C12.1270267,0.604009373 11.5587353,0 10.8496744,0 L9.26471474,0 C8.55565385,0 7.99257608,0.598802395 7.99257608,1.30695131 L7.99257608,2.09841187 C7.99257608,2.73887009 7.434712,3.28039573 6.76736057,3.28039573 C6.43368486,3.28039573 6.12607756,3.13980734 5.90188919,2.89507941 L5.39616194,2.39520958 C5.16675988,2.1608956 4.82787048,2.03072117 4.48376741,2.03072117 C4.13966433,2.03072117 3.80598861,2.16610258 3.57137287,2.39520958 L2.39829419,3.5407446 C1.89778062,4.04061442 1.89778062,4.85810987 2.39829419,5.35277272 L2.8883804,5.84222859 C3.14906455,6.07654257 3.29504767,6.38896121 3.29504767,6.72220776 C3.29504767,7.38870086 2.75282464,7.94064046 2.10632794,7.94064046 L1.31384812,7.94064046 C0.599573548,7.94064046 0,8.49778703 0,9.20593595 L0,9.99739651 L0,10.7888571 C0,11.491799 0.599573548,12.0541526 1.31384812,12.0541526 L2.10632794,12.0541526 C2.75282464,12.0541526 3.29504767,12.6112991 3.29504767,13.2725853 C3.29504767,13.6058318 3.14906455,13.9182505 2.8883804,14.1525644 L2.39829419,14.6368133 C1.89778062,15.1366832 1.89778062,15.9541786 2.39829419,16.4488414 L3.56094551,17.6047904 C3.79034756,17.8391044 4.12923696,17.9692788 4.47334004,17.9692788 C4.81744312,17.9692788 5.15111883,17.8338974 5.38573457,17.6047904 L5.89146182,17.1049206 C6.11043651,16.8601927 6.42325749,16.7196043 6.75693321,16.7196043 C7.42428463,16.7196043 7.98214872,17.2611299 7.98214872,17.9015881 L7.98214872,18.6930487 C7.98214872,19.3959906 8.54522648,20 9.25950106,20 L10.8444607,20 C11.5535216,20 12.1165994,19.4011976 12.1165994,18.6930487 L12.1165994,17.9015881 C12.1165994,17.2611299 12.6744634,16.7196043 13.3418149,16.7196043 C13.6754906,16.7196043 13.9883116,16.8653996 14.228141,17.1205415 L14.7182272,17.6099974 C14.9528429,17.8391044 15.2865186,17.9744858 15.6306217,17.9744858 C15.9747248,17.9744858 16.3084005,17.8391044 16.5430163,17.6099974 L17.7056676,16.4540484 C18.2061811,15.9541786 18.2061811,15.1366832 17.7056676,14.6368133 L17.1947266,14.1369435 C16.9444698,13.9130435 16.8037004,13.6058318 16.8037004,13.2777922 C16.8037004,12.6112991 17.3459234,12.0593595 17.9924201,12.0593595 L18.7849,12.0593595 C19.4939608,12.0593595 19.9998464,11.502213 19.9998464,10.794064 L19.9998464,9.99739651 L19.9998464,9.20593595 C20.0101155,8.49778703 19.5043882,7.94064046 18.7953273,7.94064046 Z M14.2229273,9.99739651 L14.2229273,9.99739651 C14.2229273,12.2936735 12.3616425,14.1629784 10.0519809,14.1629784 C7.7423193,14.1629784 5.88103446,12.2936735 5.88103446,9.99739651 L5.88103446,9.99739651 L5.88103446,9.99739651 C5.88103446,7.7011195 7.7423193,5.83181463 10.0519809,5.83181463 C12.3616425,5.83181463 14.2229273,7.7011195 14.2229273,9.99739651 L14.2229273,9.99739651 Z" id="Path-2" fill="#3F3F3F"></path>
</g>
</svg>';
break;
case 'new_agent':
$svg = '<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Dark / 20 / agents@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-agents" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Group" transform="translate(0.000000, 1.000000)">
<rect id="Rectangle" fill="#3F3F3F" x="0" y="6" width="10" height="6" rx="1"></rect>
<polyline id="Path-43" stroke="#3F3F3F" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" points="3 4 6.9967103 -2.30926389e-14 15 -2.30926389e-14 19 4 19 14 15 18 6.9967103 18 3 14.0223656"></polyline>
</g>
</g>
</svg>';
break;
case 'configuration_change':
$svg = '<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Dark / 20 / configuration@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-configuration" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M18.7953273,7.94064046 L18.0028475,7.94064046 C17.3563508,7.94064046 16.8141278,7.38349388 16.8141278,6.72220776 C16.8141278,6.38896121 16.9548972,6.08695652 17.205154,5.8630565 L17.7160949,5.36318667 C18.2218222,4.86331684 18.2218222,4.0458214 17.7160949,3.54595158 L16.5534436,2.39520958 C16.3240416,2.16610258 15.9851522,2.03072117 15.6410491,2.03072117 C15.296946,2.03072117 14.9632703,2.16610258 14.7286546,2.39520958 L14.2385684,2.88466545 C14.0039526,3.14501432 13.6911316,3.28560271 13.3522422,3.28560271 C12.6848908,3.28560271 12.1270267,2.74407706 12.1270267,2.10361885 L12.1270267,1.30695131 C12.1270267,0.604009373 11.5587353,0 10.8496744,0 L9.26471474,0 C8.55565385,0 7.99257608,0.598802395 7.99257608,1.30695131 L7.99257608,2.09841187 C7.99257608,2.73887009 7.434712,3.28039573 6.76736057,3.28039573 C6.43368486,3.28039573 6.12607756,3.13980734 5.90188919,2.89507941 L5.39616194,2.39520958 C5.16675988,2.1608956 4.82787048,2.03072117 4.48376741,2.03072117 C4.13966433,2.03072117 3.80598861,2.16610258 3.57137287,2.39520958 L2.39829419,3.5407446 C1.89778062,4.04061442 1.89778062,4.85810987 2.39829419,5.35277272 L2.8883804,5.84222859 C3.14906455,6.07654257 3.29504767,6.38896121 3.29504767,6.72220776 C3.29504767,7.38870086 2.75282464,7.94064046 2.10632794,7.94064046 L1.31384812,7.94064046 C0.599573548,7.94064046 0,8.49778703 0,9.20593595 L0,9.99739651 L0,10.7888571 C0,11.491799 0.599573548,12.0541526 1.31384812,12.0541526 L2.10632794,12.0541526 C2.75282464,12.0541526 3.29504767,12.6112991 3.29504767,13.2725853 C3.29504767,13.6058318 3.14906455,13.9182505 2.8883804,14.1525644 L2.39829419,14.6368133 C1.89778062,15.1366832 1.89778062,15.9541786 2.39829419,16.4488414 L3.56094551,17.6047904 C3.79034756,17.8391044 4.12923696,17.9692788 4.47334004,17.9692788 C4.81744312,17.9692788 5.15111883,17.8338974 5.38573457,17.6047904 L5.89146182,17.1049206 C6.11043651,16.8601927 6.42325749,16.7196043 6.75693321,16.7196043 C7.42428463,16.7196043 7.98214872,17.2611299 7.98214872,17.9015881 L7.98214872,18.6930487 C7.98214872,19.3959906 8.54522648,20 9.25950106,20 L10.8444607,20 C11.5535216,20 12.1165994,19.4011976 12.1165994,18.6930487 L12.1165994,17.9015881 C12.1165994,17.2611299 12.6744634,16.7196043 13.3418149,16.7196043 C13.6754906,16.7196043 13.9883116,16.8653996 14.228141,17.1205415 L14.7182272,17.6099974 C14.9528429,17.8391044 15.2865186,17.9744858 15.6306217,17.9744858 C15.9747248,17.9744858 16.3084005,17.8391044 16.5430163,17.6099974 L17.7056676,16.4540484 C18.2061811,15.9541786 18.2061811,15.1366832 17.7056676,14.6368133 L17.1947266,14.1369435 C16.9444698,13.9130435 16.8037004,13.6058318 16.8037004,13.2777922 C16.8037004,12.6112991 17.3459234,12.0593595 17.9924201,12.0593595 L18.7849,12.0593595 C19.4939608,12.0593595 19.9998464,11.502213 19.9998464,10.794064 L19.9998464,9.99739651 L19.9998464,9.20593595 C20.0101155,8.49778703 19.5043882,7.94064046 18.7953273,7.94064046 Z M14.2229273,9.99739651 L14.2229273,9.99739651 C14.2229273,12.2936735 12.3616425,14.1629784 10.0519809,14.1629784 C7.7423193,14.1629784 5.88103446,12.2936735 5.88103446,9.99739651 L5.88103446,9.99739651 L5.88103446,9.99739651 C5.88103446,7.7011195 7.7423193,5.83181463 10.0519809,5.83181463 C12.3616425,5.83181463 14.2229273,7.7011195 14.2229273,9.99739651 L14.2229273,9.99739651 Z" id="Path-2" fill="#3F3F3F"></path>
</g>
</svg>';
break;
case 'unknown':
default:
$svg = '<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Dark / 20 / event@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-event" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g>
<rect id="Rectangle" x="0" y="0" width="20" height="20"></rect>
<path d="M15.9503156,6.25 L10.901623,6.25 L12.7653518,1.1796875 C12.9403498,0.5859375 12.4372305,0 11.7503633,0 L5.45043493,0 C4.9254409,0 4.47919597,0.34765625 4.40919676,0.8125 L3.00921267,10.1875 C2.92608862,10.75 3.41608305,11.25 4.05045084,11.25 L9.24351682,11.25 L7.22666474,18.8476562 C7.06916653,19.4414062 7.57666077,20 8.24602816,20 C8.61352398,20 8.96352,19.828125 9.15601782,19.53125 L16.8559303,7.65625 C17.2628007,7.03515625 16.7596814,6.25 15.9503156,6.25 Z" id="Path" fill="#3F3F3F"></path>
</g>
</g>
</svg>';
break;
}
$output = '<div style="width:20px;height:20px">'.$svg.'</div>';
if ($return) {
return $output;
}
echo $output;
}
/**
* Prints the event type description
*

View File

@ -4816,7 +4816,7 @@ function graph_nodata_image($options)
$height = $options['height'];
}
$width_style = '';
$width_style = 'width: 200px';
if (isset($options['width']) === true
&& empty($options['width']) === false
) {
@ -4835,7 +4835,7 @@ function graph_nodata_image($options)
true,
[
'title' => __('No data'),
'style' => 'height:'.$height.'px;'.$width_style,
'style' => $width_style,
]
);
}

View File

@ -4565,12 +4565,6 @@ function html_print_image(
// Dont use safe_input here or the performance will dead.
$style = '';
if (empty($options) === false && isset($options['class']) === true) {
$options['class'] .= ' main_menu_icon';
} else {
$options['class'] = 'main_menu_icon invert_filter';
}
if (!empty($options)) {
// Deprecated or value-less attributes.
if (isset($options['align'])) {

View File

@ -202,7 +202,7 @@ function netflow_stat_table($data, $start_date, $end_date, $aggregate)
$table = new stdClass();
$table->width = '100%';
$table->cellspacing = 0;
$table->class = 'databox';
$table->class = 'info_table';
$table->data = [];
$j = 0;
$x = 0;
@ -270,7 +270,7 @@ function netflow_data_table($data, $start_date, $end_date, $aggregate, $pdf=fals
$table->size = ['100%'];
}
$table->class = 'databox w100p';
$table->class = 'info_table w100p';
$table->cellspacing = 0;
$table->data = [];
@ -339,7 +339,7 @@ function netflow_top_n_table(array $data, int $total_bytes)
$values = [];
$table = new stdClass();
$table->class = 'w100p';
$table->class = 'info_table w100p';
$table->cellspacing = 0;
$table->data = [];
@ -405,7 +405,7 @@ function netflow_summary_table($data)
$values = [];
$table = new stdClass();
$table->cellspacing = 0;
$table->class = 'databox';
$table->class = 'info_table';
$table->styleTable = 'width: 100%';
$table->data = [];
@ -1323,7 +1323,7 @@ function netflow_draw_item(
}
if ($output === 'HTML' || $output === 'PDF') {
$html = '<table class="w100p">';
$html = '<table class="databox w100p">';
$html .= '<tr>';
$html .= '<td class="w50p">';
$html .= netflow_summary_table($data_summary);

View File

@ -1075,24 +1075,6 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
}
foreach ($item['data'] as $k => $event) {
// First pass along the class of this row.
if ($item['show_summary_group']) {
$table1->cellclass[$k][2] = get_priority_class($event['criticity']);
$table1->cellclass[$k][3] = get_priority_class($event['criticity']);
$table1->cellclass[$k][4] = get_priority_class($event['criticity']);
$table1->cellclass[$k][5] = get_priority_class($event['criticity']);
$table1->cellclass[$k][6] = get_priority_class($event['criticity']);
$table1->cellclass[$k][7] = get_priority_class($event['criticity']);
$table1->cellclass[$k][8] = get_priority_class($event['criticity']);
} else {
$table1->cellclass[$k][2] = get_priority_class($event['criticity']);
$table1->cellclass[$k][3] = get_priority_class($event['criticity']);
$table1->cellclass[$k][4] = get_priority_class($event['criticity']);
$table1->cellclass[$k][5] = get_priority_class($event['criticity']);
$table1->cellclass[$k][6] = get_priority_class($event['criticity']);
$table1->cellclass[$k][7] = get_priority_class($event['criticity']);
}
$data = [];
// Colored box.
@ -1125,7 +1107,11 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
]
);
$data[] = events_print_type_img($event['event_type'], true);
if ($pdf) {
$data[] = events_print_type_img_pdf($event['event_type'], true);
} else {
$data[] = events_print_type_img($event['event_type'], true);
}
if ($item['show_summary_group']) {
$data[] = $event['event_rep'];
@ -1343,19 +1329,6 @@ function reporting_html_event_report_module($table, $item, $pdf=0)
if (is_array($item_data) || is_object($item_data)) {
foreach ($item_data as $i => $event) {
$data = [];
if ($show_summary_group) {
$table1->cellclass[$i][2] = get_priority_class($event['criticity']);
$table1->cellclass[$i][3] = get_priority_class($event['criticity']);
$table1->cellclass[$i][4] = get_priority_class($event['criticity']);
$table1->cellclass[$i][5] = get_priority_class($event['criticity']);
$table1->cellclass[$i][6] = get_priority_class($event['criticity']);
} else {
$table1->cellclass[$i][2] = get_priority_class($event['criticity']);
$table1->cellclass[$i][3] = get_priority_class($event['criticity']);
$table1->cellclass[$i][4] = get_priority_class($event['criticity']);
$table1->cellclass[$i][6] = get_priority_class($event['criticity']);
}
// Colored box.
switch ($event['estado']) {
case 0:
@ -1386,7 +1359,12 @@ function reporting_html_event_report_module($table, $item, $pdf=0)
]
);
$data[1] = events_print_type_img($event['event_type'], true);
if ($pdf) {
$data[1] = events_print_type_img_pdf($event['event_type'], true);
} else {
$data[1] = events_print_type_img($event['event_type'], true);
}
$data[2] = io_safe_output($event['evento']);
$data[3] = get_priority_name($event['criticity']);
if ($show_summary_group) {
@ -2671,21 +2649,6 @@ function reporting_html_event_report_agent($table, $item, $pdf=0)
}
foreach ($item['data'] as $i => $event) {
if ($item['show_summary_group']) {
$table1->cellclass[$i][2] = get_priority_class($event['criticity']);
$table1->cellclass[$i][3] = get_priority_class($event['criticity']);
$table1->cellclass[$i][4] = get_priority_class($event['criticity']);
$table1->cellclass[$i][5] = get_priority_class($event['criticity']);
$table1->cellclass[$i][6] = get_priority_class($event['criticity']);
$table1->cellclass[$i][7] = get_priority_class($event['criticity']);
} else {
$table1->cellclass[$i][2] = get_priority_class($event['criticity']);
$table1->cellclass[$i][3] = get_priority_class($event['criticity']);
$table1->cellclass[$i][4] = get_priority_class($event['criticity']);
$table1->cellclass[$i][5] = get_priority_class($event['criticity']);
$table1->cellclass[$i][6] = get_priority_class($event['criticity']);
}
$data = [];
// Colored box.
switch ($event['status']) {
@ -2716,7 +2679,11 @@ function reporting_html_event_report_agent($table, $item, $pdf=0)
]
);
$data[] = events_print_type_img($event['type'], true);
if ($pdf) {
$data[] = events_print_type_img_pdf($event['type'], true);
} else {
$data[] = events_print_type_img($event['type'], true);
}
if ($item['show_summary_group']) {
$data[] = $event['count'];
@ -3284,6 +3251,7 @@ function get_alert_table($data)
{
$table = new StdCLass();
$table->width = '99%';
$table->class = 'info_table';
$table->data = [];
$table->head = [];
$table->headstyle = [];

View File

@ -352,10 +352,10 @@ function load_modal(settings) {
}
} else {
// No onsumbit configured. Directly close.
d.dialog("close");
if (document.getElementById(settings.form) != undefined) {
document.getElementById(settings.form).submit();
}
d.dialog("close");
}
};

View File

@ -2,15 +2,16 @@
$(document).ready(function() {
$("#button-button_add_image").on("click", function() {
var numberImages = $("#inputs_images").children().length;
$(".input-file").each(function(index) {
$(this).attr("name", "file_" + index);
});
var div_image = document.createElement("div");
$(div_image).attr("class", "action_image");
$(div_image).append(
`<input type="file" accept="image/png,image/jpeg,image/gif" name="file_${numberImages +
1}" onchange="checkImage(this)"/>`
`<input type="file" accept="image/png,image/jpeg,image/gif" class="input-file" name="file_${numberImages}" onchange="checkImage(this)"/>`
);
$(div_image).append(
`<input type="image" src="images/delete.svg" onclick="removeInputImage('file_${numberImages +
1}');" class="remove-image" value="-"/>`
`<input type="image" src="images/delete.svg" onclick="removeInputImage(this);" class="remove-image main_menu_icon" value="-"/>`
);
$("#inputs_images").append(div_image);
});
@ -72,8 +73,8 @@ function activeCarousel() {
$(".carousel .images").bxSlider({ controls: true });
}
}
function removeInputImage(name) {
$(`input[name=${name}]`)
function removeInputImage(e) {
$(e)
.parent()
.remove();
if ($(".action_image").length === 0) {
@ -314,7 +315,7 @@ function previewTip() {
//Images in client
var totalInputsFiles = $("input[type=file]").length;
if (totalInputsFiles > 0) {
if (totalInputsFiles > 0 && validateImages()) {
extradata["totalFiles64"] = totalInputsFiles;
$("input[type=file]").each(function(index) {
var reader = new FileReader();
@ -352,3 +353,15 @@ function previewTip() {
});
}
}
function validateImages() {
$(".empty_input_images").addClass("invisible");
let validate = true;
$("input[type=file]").each(function() {
if (this.files.length == 0) {
$(".empty_input_images").removeClass("invisible");
validate = false;
}
});
return validate;
}

View File

@ -304,6 +304,8 @@ td input[type="checkbox"] {
input[type="image"] {
border: 0px;
background-color: transparent;
height: auto;
padding: 0px;
}
.container-div-input-password input {
@ -1421,7 +1423,7 @@ div#menu_container {
div#menu {
width: 45px;
float: left;
z-index: 2;
z-index: 3;
position: absolute;
}
@ -1436,7 +1438,7 @@ div#head {
min-width: 882px;
background-color: #fff;
color: #000;
z-index: 2;
z-index: 3;
}
.fixed_header {
@ -1793,7 +1795,7 @@ div.title_line {
#menu_tab_frame_view_bc {
position: sticky;
top: 61px;
z-index: 1;
z-index: 2;
display: flex;
align-items: flex-end;
justify-content: space-between;
@ -8255,6 +8257,11 @@ div.graph div.legend table {
justify-content: center;
}
.flex_justify_end {
display: flex;
justify-content: end;
}
.span_priority {
width: 20px;
height: 10px;
@ -11245,8 +11252,9 @@ img.main_menu_icon[src$=".svg"] {
}
input.main_menu_icon[src$=".svg"] {
width: 22px;
height: 22px;
width: 20px;
height: 20px;
padding: 0px;
}
.header_help_icon {
@ -11695,3 +11703,8 @@ div#menu_full > div#menu_tabs > ul.tabs_ul {
display: flex;
flex-direction: column;
}
div.relative > div > div#ui-datepicker-div {
top: 55px !important;
left: 5px !important;
}

View File

@ -216,6 +216,19 @@ table tbody td.cellBig {
font-size: 18px;
}
table.info_table > tbody > tr:nth-child(even) {
background-color: #e5e9ed !important;
table.info_table {
border-collapse: collapse;
}
table.info_table thead tr th,
table.info_table thead tr td {
background-color: white !important;
}
table.info_table thead tr th {
border-bottom: 1px solid #333333;
}
table.info_table tbody tr td {
border-bottom: 1px solid #e5e5e5;
}

View File

@ -1515,3 +1515,13 @@ div.fixed-bottom-box
span.select2 {
border-radius: 6px;
}
.ui-dialog .tips_header.ui-dialog-titlebar {
color: white !important;
background-color: #222222 !important;
}
#tips_window_modal > div.window > div.description > #title_tip,
#tips_window_modal > div.window > div.description > #text_tip {
color: white !important;
}

View File

@ -1,9 +1,10 @@
#form_setup {
display: flex;
/*display: flex;
flex-direction: row;
justify-items: baseline;
justify-content: space-between;
flex-wrap: wrap;
*/
}
fieldset {

View File

@ -236,7 +236,8 @@
.table_action_buttons > a,
.table_action_buttons > img,
.table_action_buttons > button,
.table_action_buttons > form {
.table_action_buttons > form,
.table_action_buttons > div {
visibility: hidden;
}
.info_table > tbody > tr:hover {
@ -248,7 +249,8 @@
.info_table > tbody > tr:hover .table_action_buttons > a,
.info_table > tbody > tr:hover .table_action_buttons > img,
.info_table > tbody > tr:hover .table_action_buttons > button,
.info_table > tbody > tr:hover .table_action_buttons > form {
.info_table > tbody > tr:hover .table_action_buttons > form,
.info_table > tbody > tr:hover .table_action_buttons > div {
visibility: visible;
}
@ -460,9 +462,6 @@ a.pandora_pagination.current:hover {
.table_action_buttons input[type="image"],
.action_button_img {
border-radius: 4px;
/*border: 1px solid #dcdcdc !important;*/
padding: 1px !important;
/*box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);*/
}
/* This class is for only one icon to be a button type. */

View File

@ -172,17 +172,17 @@ span.count-round-tip.active {
}
span.enable {
display: block;
width: 15px;
height: 15px;
border-radius: 15px;
width: 40px;
height: 20px;
border-radius: 4px;
background-color: #82b92e;
margin: 0 auto;
}
span.disable {
display: block;
width: 15px;
height: 15px;
border-radius: 15px;
width: 40px;
height: 20px;
border-radius: 4px;
background-color: #e63c52;
margin: 0 auto;
}
@ -212,3 +212,12 @@ span.disable {
opacity: 0;
pointer-events: none;
}
#list_tips_windows .main_menu_icon {
padding: 0px;
}
#list_tips_windows .table_action_buttons {
text-align: center;
}
.button-add-image {
max-width: fit-content;
}

View File

@ -1522,13 +1522,6 @@ require 'include/php_to_js_values.php';
<script type="text/javascript" language="javascript">
// Handle the scroll.
$(document).ready(scrollFunction());
// When there are less than 5 rows, all rows must be white
var theme = "<?php echo $config['style']; ?>";
if (theme === 'pandora') {
if ($('table.info_table tr').length < 5) {
$('table.info_table tbody > tr').css('background-color', '#fff');
}
}
// When the user scrolls down 400px from the top of the document, show the
// button.

View File

@ -107,9 +107,6 @@ if (!empty($table->data)) {
'white-box-content',
'box-flat white_thable_graph mrgn_top_30px'
);
} else {
ui_print_info_message(['no_close' => true, 'message' => __('No log sources found') ]);
$log_sources_defined = false;
}
// Hidden form to perform post request to Log Viewer page when clicking on the Review field icon.

View File

@ -1759,7 +1759,7 @@ if (empty($result) === false) {
true,
[
'title' => $row['tags'],
'class' => 'inverse_filter main_menu_icon',
'class' => 'invert_filter main_menu_icon',
]
);
}

View File

@ -622,10 +622,13 @@ if (empty($draw) === false) {
'selected_style_theme',
$config['style']
);
$netflowContainerClass = ($chart_type === 'netflow_data' || $chart_type === 'netflow_summary' || $chart_type === 'netflow_top_N') ? '' : 'white_box';
// Draw the netflow chart.
html_print_div(
[
'class' => 'white_box',
'class' => $netflowContainerClass,
'content' => netflow_draw_item(
$start_date,
$end_date,

View File

@ -192,7 +192,7 @@ if ($in_planned_downtime && !$cluster->agent()->disabled() && !$cluster->agent()
$table_agent_header = '<div class="agent_details_agent_alias">';
$table_agent_header .= $agent_name;
$table_agent_header .= '</div>';
$table_agent_header .= '<div class="agent_details_agent_name">';
$table_agent_header .= '<div class="agent_details_agent_name mrgn_lft_10px">';
if (!$config['show_group_name']) {
$table_agent_header .= ui_print_group_icon(
$cluster->agent()->id_grupo(),
@ -385,7 +385,7 @@ $table_events .= '</div>';
<div class="agent_details_header">
<?php echo $table_agent_header; ?>
</div>
<div class="agent_details_content">
<div class="agent_details_content pdd_l_50px">
<div class="agent_details_graph">
<?php echo $table_agent_graph; ?>
<div class="agent_details_bullets">

View File

@ -49,11 +49,11 @@ $output .= '<div class="images">';
if ($files !== false) {
if ($preview === true) {
foreach ($files as $key => $file) {
$output .= html_print_image($file, true);
$output .= html_print_image($file, true, ['class' => 'main_menu_icon']);
}
} else {
foreach ($files as $key => $file) {
$output .= html_print_image($file['path'].$file['filename'], true);
$output .= html_print_image($file['path'].$file['filename'], true, ['class' => 'main_menu_icon']);
}
}
}
@ -83,7 +83,7 @@ $output .= '<a href="'.$url.'" class="'.$link_class.'" target="_blank" id="url_t
$output .= '</div>';
$output .= '<div class="ui-dialog-buttonset">';
// TODO Delete this buttons and use html_print_button when merge new design
$output .= html_print_button(
__('Maybe later'),
'',