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

Ent 9662 second round

See merge request artica/pandorafms!5594
This commit is contained in:
daniel 2023-03-13 18:33:26 +00:00
commit 92ab4c3ca8
61 changed files with 1677 additions and 1064 deletions

View File

@ -140,25 +140,26 @@ function quickShell()
ui_print_error_message(__('WebService engine has not been started, please check documentation.')); ui_print_error_message(__('WebService engine has not been started, please check documentation.'));
$wiz->printForm( $wiz->printForm(
[ [
'form' => [ 'form' => [
'method' => 'POST', 'method' => 'POST',
'action' => '#', 'action' => '#',
], 'id' => 'retry_form',
'inputs' => [
[
'class' => 'w100p',
'arguments' => [
'name' => 'submit',
'label' => __('Retry'),
'type' => 'submit',
'attributes' => ['icon' => 'next'],
'return' => true,
],
],
], ],
] ]
); );
html_print_action_buttons(
html_print_submit_button(
__('Retry'),
'submit',
false,
[
'icon' => 'next',
'form' => 'retry_form',
],
true
)
);
return; return;
} }
@ -168,6 +169,7 @@ function quickShell()
'action' => '#', 'action' => '#',
'class' => 'wizard', 'class' => 'wizard',
'method' => 'post', 'method' => 'post',
'id' => 'connect_form',
], ],
'inputs' => [ 'inputs' => [
[ [
@ -198,19 +200,24 @@ function quickShell()
'script' => "p=22; if(this.value == 'telnet') { p=23; } $('#text-port').val(p);", 'script' => "p=22; if(this.value == 'telnet') { p=23; } $('#text-port').val(p);",
], ],
], ],
[
'arguments' => [
'type' => 'submit',
'label' => __('Connect'),
'attributes' => ['icon' => 'cog'],
],
],
], ],
], ],
false, false,
true true
); );
html_print_action_buttons(
html_print_submit_button(
__('Connect'),
'submit',
false,
[
'icon' => 'cog',
'form' => 'connect_form',
],
true
)
);
return; return;
} }

View File

@ -61,79 +61,110 @@ ui_print_warning_message(
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox filter-table-adv mrgn_top_15px pdd_t_0px_important';
$table->data = []; $table->data = [];
$table->cellpadding = 0; $table->cellpadding = 0;
$table->cellspacing = 0; $table->cellspacing = 0;
$table->head[0] = __('Agent position'); $table->head[0] = __('Agent position');
$table->head_colspan[0] = 4; $table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align:center'; $table->headstyle[0] = 'text-align:center';
$table->style[0] = 'font-weight: bold; '; $table->size[0] = '50%';
$table->style[2] = 'font-weight: bold; '; $table->size[2] = '50%';
$table->data[1][0] = __('Latitude: '); $table->data[1][0] = html_print_label_input_block(
$table->data[1][1] = html_print_input_text_extended( __('Latitude: '),
'latitude', html_print_input_text_extended(
$agentData['stored_latitude'], 'latitude',
'text-latitude', $agentData['stored_latitude'],
'', 'text-latitude',
20, '',
20, 20,
false, 20,
'', false,
[ '',
'onchange' => 'setIgnoreGISDataEnabled()', [
'onkeyup' => 'setIgnoreGISDataEnabled()', 'onchange' => 'setIgnoreGISDataEnabled()',
], 'onkeyup' => 'setIgnoreGISDataEnabled()',
true ],
true
)
); );
$table->data[1][2] = __('Longitude: '); $table->data[1][1] = html_print_label_input_block(
$table->data[1][3] = html_print_input_text_extended( __('Longitude: '),
'longitude', html_print_input_text_extended(
$agentData['stored_longitude'], 'longitude',
'text-longitude', $agentData['stored_longitude'],
'', 'text-longitude',
20, '',
20, 20,
false, 20,
'', false,
[ '',
'onchange' => 'setIgnoreGISDataEnabled()', [
'onkeyup' => 'setIgnoreGISDataEnabled()', 'onchange' => 'setIgnoreGISDataEnabled()',
], 'onkeyup' => 'setIgnoreGISDataEnabled()',
true ],
true
)
); );
$table->data[2][0] = __('Altitude: '); $table->data[2][0] = html_print_label_input_block(
$table->data[2][1] = html_print_input_text_extended( __('Altitude: '),
'altitude', html_print_input_text_extended(
$agentData['stored_altitude'], 'altitude',
'text-altitude', $agentData['stored_altitude'],
'', 'text-altitude',
10, '',
10, 10,
false, 10,
'', false,
[ '',
'onchange' => 'setIgnoreGISDataEnabled()', [
'onkeyup' => 'setIgnoreGISDataEnabled()', 'onchange' => 'setIgnoreGISDataEnabled()',
], 'onkeyup' => 'setIgnoreGISDataEnabled()',
true ],
true
)
); );
$table->data[2][2] = __('Ignore new GIS data:'); $table->data[2][1] = html_print_label_input_block(
$table->data[2][3] = __('Yes').' '.html_print_radio_button_extended('update_gis_data', 0, '', $updateGisData, false, '', 'class="mrgn_right_40px"', true); __('Ignore new GIS data: '),
$table->data[2][3] .= __('No').' '.html_print_radio_button_extended('update_gis_data', 1, '', $updateGisData, false, '', 'class="mrgn_right_40px"', true); '<div class="flex mrgn_top_5px">'.__('Yes').' '.html_print_radio_button_extended(
'update_gis_data',
0,
'',
$updateGisData,
false,
'',
'class="mrgn_right_40px"',
true
).__('No').' '.html_print_radio_button_extended(
'update_gis_data',
1,
'',
$updateGisData,
false,
'',
'class="mrgn_right_40px"',
true
).'</div>'
);
$url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=gis&id_agente='.$id_agente; $url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=gis&id_agente='.$id_agente;
echo "<form method='post' action='".$url."' onsubmit ='return validateFormFields();'>"; echo "<form method='post' action='".$url."' onsubmit ='return validateFormFields();' class='max_floating_element_size'>";
html_print_input_hidden('update_gis', 1); html_print_input_hidden('update_gis', 1);
html_print_table($table); html_print_table($table);
echo '<div class="action-buttons float-left" style="width: '.$table->width.';">'; html_print_action_buttons(
html_print_submit_button(__('Update'), '', false, 'class="sub upd"'); html_print_submit_button(
echo '</div>'; __('Update'),
'',
false,
['icon' => 'wand'],
true
)
);
echo '</form>'; echo '</form>';
?> ?>
<script type="text/javascript"> <script type="text/javascript">

View File

@ -196,29 +196,52 @@ foreach ($nps as $row) {
$filterTable = new stdClass(); $filterTable = new stdClass();
$filterTable->width = '100%'; $filterTable->width = '100%';
$filterTable->class = 'fixed_filter_bar'; $filterTable->class = 'filter-table-adv';
$filterTable->size[0] = '100%';
$filterTable->data = []; $filterTable->data = [];
$filterTable->data[0][0] = __('Module templates');
$filterTable->data[1][0] = html_print_select($select, 'template_id', '', '', '', 0, true, false, true, '', false, 'max-width: 200px !important'); $filterTable->data[0][0] = html_print_label_input_block(
$filterTable->data[1][1] = html_print_div( __('Module templates'),
html_print_select(
$select,
'template_id',
'',
'',
'',
0,
true,
false,
true,
'',
false,
'width: 250px '
)
);
$filterTable->data[1][0] = html_print_submit_button(
__('Assign'),
'crt',
false,
[ [
'class' => 'action-buttons', 'class' => 'float-right',
'content' => html_print_submit_button( 'icon' => 'wand',
__('Assign'), 'mode' => 'mini',
'crt',
false,
[
'icon' => 'wand',
'mode' => 'secondary mini',
],
true
),
], ],
true true
); );
$outputFilterTable = '<form style="border:0" class="fixed_filter_bar" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=template&id_agente='.$id_agente.'">'; $outputFilterTable = '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=template&id_agente='.$id_agente.'">';
$outputFilterTable .= html_print_table($filterTable, true); $outputFilterTable .= ui_toggle(
html_print_table($filterTable, true),
'<span class="subsection_header_title">'.__('Assign').'</span>',
__('Assign'),
'assign',
true,
true,
'',
'white-box-content no_border',
'filter-datatable-main box-flat white_table_graph fixed_filter_bar'
);
$outputFilterTable .= '</form>'; $outputFilterTable .= '</form>';
echo $outputFilterTable; echo $outputFilterTable;

View File

@ -808,7 +808,7 @@ if ($id_agente) {
$pure = (int) get_parameter('pure'); $pure = (int) get_parameter('pure');
if ($pure === 0) { if ($pure === 0) {
ui_print_standard_header( ui_print_standard_header(
__('Agent setup view'), __('Agent setup view').' ( '.strtolower(agents_get_alias($id_agente)).' )',
'images/agent.png', 'images/agent.png',
false, false,
$helper, $helper,

View File

@ -180,14 +180,26 @@ if ($load_inventory_module) {
$form_buttons = ''; $form_buttons = '';
if ($load_inventory_module) { if ($load_inventory_module) {
$form_buttons .= html_print_input_hidden('id_agent_module_inventory', $id_agent_module_inventory, true); $form_buttons .= html_print_input_hidden('id_agent_module_inventory', $id_agent_module_inventory, true);
$form_buttons .= html_print_submit_button(__('Update'), 'update_inventory_module', false, 'class="sub next"', true); $form_buttons .= html_print_submit_button(
__('Update'),
'update_inventory_module',
false,
['icon' => 'wand'],
true
);
} else { } else {
$form_buttons .= html_print_submit_button(__('Add'), 'add_inventory_module', false, 'class="sub next"', true); $form_buttons .= html_print_submit_button(
__('Add'),
'add_inventory_module',
false,
['icon' => 'wand'],
true
);
} }
echo ui_get_inventory_module_add_form( echo ui_get_inventory_module_add_form(
'index.php?sec=estado&sec2=godmode/agentes/configurar_agente&tab=inventory&id_agente='.$id_agente, 'index.php?sec=estado&sec2=godmode/agentes/configurar_agente&tab=inventory&id_agente='.$id_agente,
$form_buttons, html_print_action_buttons($form_buttons, [], true),
$load_inventory_module, $load_inventory_module,
$id_os, $id_os,
$target, $target,
@ -213,10 +225,10 @@ if (db_get_num_rows($sql) == 0) {
} else { } else {
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox info_trable';
$table->data = []; $table->data = [];
$table->head = []; $table->head = [];
$table->styleTable = 'margin-top: 20px;'; $table->styleTable = '';
$table->head[0] = "<span title='".__('Policy')."'>".__('P.').'</span>'; $table->head[0] = "<span title='".__('Policy')."'>".__('P.').'</span>';
$table->head[1] = __('Name'); $table->head[1] = __('Name');
$table->head[2] = __('Description'); $table->head[2] = __('Description');

View File

@ -302,92 +302,122 @@ foreach ($pre_fields as $key => $value) {
// Filter table. // Filter table.
$filterTable = new stdClass(); $filterTable = new stdClass();
$filterTable->class = 'fixed_filter_bar'; $filterTable->class = 'filter-table-adv w100p';
$filterTable->size[0] = '20%';
$filterTable->size[1] = '20%';
$filterTable->size[2] = '20%';
$filterTable->size[3] = '20%';
$filterTable->size[4] = '20%';
$filterTable->data = []; $filterTable->data = [];
$filterTable->cellstyle[0][0] = 'width:0';
$filterTable->cellstyle[0][1] = 'width:0';
$filterTable->cellstyle[0][2] = 'width:0';
$filterTable->cellstyle[0][3] = 'width:0';
$filterTable->data[0][0] = __('Group'); $filterTable->data[0][0] = html_print_label_input_block(
$filterTable->data[1][0] = html_print_select_groups( __('Group'),
false, html_print_select_groups(
'AR', false,
$return_all_group, 'AR',
'ag_group', $return_all_group,
$ag_group, 'ag_group',
'this.form.submit();', $ag_group,
'', 'this.form.submit();',
0, '',
true, 0,
false, true,
true, false,
'', true,
false '',
false
)
); );
$filterTable->data[0][1] = __('Recursion'); $filterTable->data[0][1] = html_print_label_input_block(
$filterTable->data[1][1] = html_print_checkbox_switch( __('Recursion'),
'recursion', '<div class="mrgn_top_10px">'.html_print_checkbox_switch(
1, 'recursion',
$recursion, 1,
true, $recursion,
false, true,
'this.form.submit()' false,
'this.form.submit()'
).'</div>'
); );
$filterTable->data[0][2] = __('Show agents'); $filterTable->data[0][2] = html_print_label_input_block(
$filterTable->data[1][2] = html_print_select( __('Show agents'),
$showAgentFields, html_print_select(
'disabled', $showAgentFields,
$disabled, 'disabled',
'this.form.submit()', $disabled,
'', 'this.form.submit()',
0, '',
true 0,
true,
false,
true,
'w100p',
false,
'width: 100%'
)
); );
$filterTable->data[0][3] = __('Operating System'); $filterTable->data[0][3] = html_print_label_input_block(
$filterTable->data[1][3] = html_print_select( __('Operating System'),
$fields, html_print_select(
'os', $fields,
$os, 'os',
'this.form.submit()', $os,
'All', 'this.form.submit()',
0, 'All',
true 0,
true,
false,
true,
'w100p',
false,
'width: 100%'
)
); );
$filterTable->data[0][4] = __('Free search'); $filterTable->data[0][4] = html_print_label_input_block(
$filterTable->data[0][4] .= ui_print_help_tip( __('Free search').ui_print_help_tip(
__('Search filter by alias, name, description, IP address or custom fields content'), __('Search filter by alias, name, description, IP address or custom fields content'),
true true
); ),
$filterTable->data[1][4] = html_print_input_text( html_print_input_text(
'search', 'search',
$search, $search,
'', '',
12, 12,
255, 255,
true true
)
); );
$filterTable->cellstyle[1][5] = 'vertical-align: bottom'; $filterTable->colspan[1][0] = 5;
$filterTable->data[1][5] = html_print_submit_button( $filterTable->data[1][0] = html_print_submit_button(
__('Filter'), __('Filter'),
'srcbutton', 'srcbutton',
false, false,
[ [
'icon' => 'search', 'icon' => 'search',
'class' => 'float-right', 'class' => 'float-right mrgn_right_10px',
'mode' => 'secondary mini', 'mode' => 'mini',
], ],
true true
); );
// Print filter table. // Print filter table.
echo '<form method=\'post\' action=\'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente\'>'; echo '<form method=\'post\' action=\'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente\'>';
html_print_table($filterTable); ui_toggle(
html_print_table($filterTable, true),
'<span class="subsection_header_title">'.__('Filter').'</span>',
__('Filter'),
'filter',
true,
false,
'',
'white-box-content no_border',
'filter-datatable-main box-flat white_table_graph fixed_filter_bar'
);
echo '</form>'; echo '</form>';
// Data table. // Data table.

View File

@ -675,7 +675,7 @@ foreach ($simple_alerts as $alert) {
$data[2] .= ' <a class="template_details patatas" $data[2] .= ' <a class="template_details patatas"
href="'.ui_get_full_url(false, false, false, false).'ajax.php?page=godmode/alerts/alert_templates&get_template_tooltip=1&id_template='.$alert['id_alert_template'].'">'; href="'.ui_get_full_url(false, false, false, false).'ajax.php?page=godmode/alerts/alert_templates&get_template_tooltip=1&id_template='.$alert['id_alert_template'].'">';
$data[2] .= html_print_image( $data[2] .= html_print_image(
'images/zoom.png', 'images/details.svg',
true, true,
[ [
'id' => 'template-details-'.$alert['id_alert_template'], 'id' => 'template-details-'.$alert['id_alert_template'],
@ -753,7 +753,7 @@ foreach ($simple_alerts as $alert) {
'delete', 'delete',
'images/delete.svg', 'images/delete.svg',
1, 1,
'padding:0px; margin-left:5px; margin-right:5px;', 'padding:0px; margin-left:5px; margin-right:5px; width: 22px;',
true, true,
[ [
'title' => __('Delete action'), 'title' => __('Delete action'),
@ -913,7 +913,7 @@ foreach ($simple_alerts as $alert) {
'enable', 'enable',
'images/lightbulb_off.png', 'images/lightbulb_off.png',
1, 1,
'padding:0px', 'padding:0px; width: 22px; height: 22px;',
true, true,
['class' => 'filter_none main_menu_icon'] ['class' => 'filter_none main_menu_icon']
); );
@ -923,7 +923,7 @@ foreach ($simple_alerts as $alert) {
'disable', 'disable',
'images/lightbulb.png', 'images/lightbulb.png',
1, 1,
'padding:0px;', 'padding:0px; width: 22px; height: 22px;',
true, true,
['class' => 'main_menu_icon'] ['class' => 'main_menu_icon']
); );
@ -941,7 +941,7 @@ foreach ($simple_alerts as $alert) {
'standby_off', 'standby_off',
'images/bell.png', 'images/bell.png',
1, 1,
'padding:0px;', 'padding:0px; width: 22px; height: 22px;',
true, true,
['class' => 'invert_filter main_menu_icon'] ['class' => 'invert_filter main_menu_icon']
); );
@ -951,7 +951,7 @@ foreach ($simple_alerts as $alert) {
'standby_on', 'standby_on',
'images/bell_pause.png', 'images/bell_pause.png',
1, 1,
'padding:0px;', 'padding:0px; width: 22px; height: 22px;',
true, true,
['class' => 'invert_filter main_menu_icon'] ['class' => 'invert_filter main_menu_icon']
); );

View File

@ -484,7 +484,7 @@ if (is_metaconsole() === false) {
$buttons = [ $buttons = [
'list' => [ 'list' => [
'active' => false, 'active' => false,
'text' => '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=list&pure='.$pure.'">'.html_print_image('images/load@svg.svg', true, ['title' => __('List alerts'), 'class' => 'main_menu_icon invert_filter']).'</a>', 'text' => '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=list&pure='.$pure.'">'.html_print_image('images/logs@svg.svg', true, ['title' => __('List alerts'), 'class' => 'main_menu_icon invert_filter']).'</a>',
], ],
'builder' => [ 'builder' => [
'active' => false, 'active' => false,
@ -497,44 +497,46 @@ if (is_metaconsole() === false) {
$buttons = ''; $buttons = '';
} }
if ($tab === 'list') { if ($tab !== 'alert') {
ui_print_standard_header( if ($tab === 'list') {
__('Alerts'), ui_print_standard_header(
'images/gm_alerts.png', __('Alerts'),
false, 'images/gm_alerts.png',
'', false,
true, '',
$buttons, true,
[ $buttons,
[ [
'link' => '', [
'label' => __('Manage alerts'), 'link' => '',
], 'label' => __('Manage alerts'),
],
[
'link' => '',
'label' => __('List'),
],
]
);
} else {
ui_print_standard_header(
__('Alerts'),
'images/gm_alerts.png',
false,
'',
true,
$buttons,
[ [
'link' => '', [
'label' => __('List'), 'link' => '',
], 'label' => __('Manage alerts'),
] ],
); [
} else { 'link' => '',
ui_print_standard_header( 'label' => __('Create'),
__('Alerts'), ],
'images/gm_alerts.png', ]
false, );
'', }
true,
$buttons,
[
[
'link' => '',
'label' => __('Manage alerts'),
],
[
'link' => '',
'label' => __('Create'),
],
]
);
} }
} else { } else {
alerts_meta_print_header(); alerts_meta_print_header();

View File

@ -262,10 +262,7 @@ if ($is_management_allowed === true) {
[ 'icon' => 'next' ], [ 'icon' => 'next' ],
true true
), ),
[ [ 'right_content' => $tablePagination ]
'type' => 'form_action',
'right_content' => $tablePagination,
]
); );
echo '</form>'; echo '</form>';

View File

@ -389,7 +389,7 @@ if (empty($create) === false || empty($view) === false) {
$disabled = ($locked === true) ? 'readonly="readonly"' : ''; $disabled = ($locked === true) ? 'readonly="readonly"' : '';
if (empty($create) === true) { if (empty($create) === true) {
$formAction = 'index.php?sec=gservers&sec2=godmode/servers/plugin&tab=$tab&update_plugin=$plugin_id&pure='.$config['pure']; $formAction = 'index.php?sec=gservers&sec2=godmode/servers/plugin&tab=$tab&update_plugin='.$plugin_id.'&pure='.$config['pure'];
} else { } else {
$formAction = 'index.php?sec=gservers&sec2=godmode/servers/plugin&tab=$tab&create_plugin=1&pure='.$config['pure']; $formAction = 'index.php?sec=gservers&sec2=godmode/servers/plugin&tab=$tab&create_plugin=1&pure='.$config['pure'];
} }
@ -403,69 +403,61 @@ if (empty($create) === false || empty($view) === false) {
$table = new stdClass(); $table = new stdClass();
$table->id = 'table-form'; $table->id = 'table-form';
$table->class = 'floating_form'; $table->class = 'filter-table-adv';
$table->style = []; $table->style = [];
$table->data['plugin_name_captions'] = $data; $table->data['plugin_name_captions'] = $data;
$table->style[0] = 'vertical-align: top'; $table->size[0] = '50%';
$table->style[1] = 'vertical-align: top'; $table->size[1] = '50%';
$table->data = []; $table->data = [];
// General title. // General title.
$generalTitleContent = []; $data[0] = html_print_div([ 'class' => 'section_table_title', 'content' => __('General')], true);
$generalTitleContent[] = html_print_div([ 'style' => 'width: 10px; flex: 0 0 auto; margin-right: 5px;}', 'class' => 'section_table_title_line' ], true);
$generalTitleContent[] = html_print_div([ 'class' => 'section_table_title', 'content' => __('General')], true);
$data[0] = html_print_div(['class' => 'flex-row-center', 'content' => implode('', $generalTitleContent) ], true);
$table->data['general_title'] = $data; $table->data['general_title'] = $data;
$data = []; $data = [];
$data[0] = __('Name'); $data[0] = html_print_label_input_block(
__('Name'),
html_print_input_text('form_name', $form_name, '', 100, 255, true, false, false, '')
);
$table->data['plugin_name_captions'] = $data; $table->data['plugin_name_captions'] = $data;
$data = []; $data = [];
$data[0] = html_print_input_text('form_name', $form_name, '', 100, 255, true, false, false, '', 'w100p');
$table->data['plugin_name_inputs'] = $data;
$table->colspan['plugin_name_inputs'][0] = 3;
$data[0] = html_print_label_input_block(
__('Plugin type'),
html_print_select($formPluginType, 'form_plugin_type', $form_plugin_type, '', '', 0, true, false, true, '', false, 'width: 100%')
);
$data = [];
$data[0] = __('Plugin type');
$data[1] = __('Max. timeout');
$table->data['plugin_type_timeout_captions'] = $data;
// $table->colspan['plugin_type'][1] = 3;
$data = [];
$data[0] = html_print_select($formPluginType, 'form_plugin_type', $form_plugin_type, '', '', 0, true);
$timeoutContent = []; $timeoutContent = [];
$timeoutContent[] = '<div>'.html_print_extended_select_for_time('form_max_timeout', $form_max_timeout, '', '', '0', false, true).'</div>'; $timeoutContent[] = '<div>'.html_print_extended_select_for_time('form_max_timeout', $form_max_timeout, '', '', '0', false, true).'</div>';
$timeoutContent[] = ui_print_input_placeholder(__('This value only will be applied if is minor than the server general configuration plugin timeout').'<br>'.__('If you set a 0 seconds timeout, the server plugin timeout will be used'), true); $timeoutContent[] = ui_print_input_placeholder(__('This value only will be applied if is minor than the server general configuration plugin timeout').'<br>'.__('If you set a 0 seconds timeout, the server plugin timeout will be used'), true);
$data[1] = html_print_div( $data[1] = html_print_label_input_block(
[ __('Max. timeout'),
'class' => 'flex flex_column', html_print_div(
'content' => implode('', $timeoutContent), [
], 'class' => 'flex flex_column',
true 'content' => implode('', $timeoutContent),
],
true
)
); );
$table->data['plugin_type_timeout_inputs'] = $data;
$table->data['plugin_type_timeout'] = $data;
$data = []; $data = [];
$data[0] = __('Description'); $data[0] = html_print_label_input_block(
$table->data['plugin_desc_captions'] = $data; __('Description'),
html_print_textarea('form_description', 4, 50, $form_description, '', true)
);
$data = []; $table->colspan['plugin_desc_inputs'][0] = 2;
$data[0] = html_print_textarea('form_description', 4, 50, $form_description, '', true, 'w100p');
$table->colspan['plugin_desc_inputs'][0] = 3;
$table->data['plugin_desc_inputs'] = $data; $table->data['plugin_desc_inputs'] = $data;
// Command title.
$commandTitleContent = [];
$commandTitleContent[] = html_print_div([ 'style' => 'width: 10px; flex: 0 0 auto; margin-right: 5px;}', 'class' => 'section_table_title_line' ], true);
$commandTitleContent[] = html_print_div([ 'class' => 'section_table_title', 'content' => __('Command')], true);
$data = [];
$data[0] = html_print_div(['class' => 'flex-row-center', 'content' => implode('', $commandTitleContent) ], true);
$table->data['command_title'] = $data;
// Command title.
$data = []; $data = [];
$data[0] = __('Plugin command').ui_print_help_tip(__('Specify interpreter and plugin path. The server needs permissions to run it.'), true); $data[0] = html_print_div([ 'class' => 'section_table_title', 'content' => __('Command')], true);
$table->data['plugin_command_caption'] = $data; $table->data['command_title'] = $data;
$data = []; $data = [];
$formExecuteContent = []; $formExecuteContent = [];
@ -480,45 +472,53 @@ if (empty($create) === false || empty($view) === false) {
true true
); );
$data[0] = html_print_div(['class' => 'flex-row-center', 'content' => implode('', $formExecuteContent)], true); $data[0] = html_print_label_input_block(
__('Plugin command'),
html_print_div(['class' => 'flex-row-center', 'content' => implode('', $formExecuteContent)], true).ui_print_input_placeholder(
__('Specify interpreter and plugin path. The server needs permissions to run it.'),
true
)
);
// $data[0] = html_print_div(['class' => 'flex-row-center', 'content' => implode('', $formExecuteContent)], true);
$table->data['plugin_command_inputs'] = $data; $table->data['plugin_command_inputs'] = $data;
$table->colspan['plugin_command_inputs'][0] = 2; $table->colspan['plugin_command_inputs'][0] = 2;
$data = []; $data = [];
$data[0] = __('Plug-in parameters'); $data[0] = html_print_label_input_block(
$table->data['plugin_parameters_caption'] = $data; __('Plug-in parameters'),
html_print_input_text(
$data = []; 'form_parameters',
$data[0] = html_print_input_text( $parameters,
'form_parameters', '',
$parameters, 100,
'', 255,
100, true,
255, false,
true, false,
false, '',
false, 'command_component command_advanced_conf text_input'
'', )
'command_component command_advanced_conf text_input w100p'
); );
$table->data['plugin_parameters_inputs'] = $data; $table->data['plugin_parameters_inputs'] = $data;
$table->colspan['plugin_parameters_inputs'][0] = 2; $table->colspan['plugin_parameters_inputs'][0] = 2;
$data = []; $data = [];
$data[0] = __('Command preview'); // $data[0] = __('Command preview');
$table->data['plugin_preview_captions'] = $data; // $table->data['plugin_preview_captions'] = $data;
$data = []; // $data = [];
// $data[0] = html_print_div(['id' => 'command_preview', 'class' => 'mono'], true);
$data[0] = html_print_div(['id' => 'command_preview', 'class' => 'mono'], true); $data[0] = html_print_label_input_block(
__('Command preview'),
html_print_div(['id' => 'command_preview', 'class' => 'mono'], true)
);
$table->data['plugin_preview_inputs'] = $data; $table->data['plugin_preview_inputs'] = $data;
$table->colspan['plugin_preview_inputs'][0] = 2; $table->colspan['plugin_preview_inputs'][0] = 2;
// Parameters macros title. // Parameters macros title.
$macrosTitleContent = [];
$macrosTitleContent[] = html_print_div([ 'style' => 'width: 10px; flex: 0 0 auto; margin-right: 5px;}', 'class' => 'section_table_title_line' ], true);
$macrosTitleContent[] = html_print_div([ 'class' => 'section_table_title', 'content' => __('Parameters macros')], true);
$data = []; $data = [];
$data[0] = html_print_div(['class' => 'flex-row-center', 'content' => implode('', $macrosTitleContent) ], true); $data[0] = html_print_div([ 'class' => 'section_table_title', 'content' => __('Parameters macros')], true);
$table->data['parameters_macros_title'] = $data; $table->data['parameters_macros_title'] = $data;
$macros = json_decode($macros, true); $macros = json_decode($macros, true);
@ -563,53 +563,59 @@ if (empty($create) === false || empty($view) === false) {
} }
$datam = []; $datam = [];
$datam[0] = __('Description')."<span class='normal_weight'> ($macro_name)</span>"; $datam[0] = html_print_label_input_block(
__('Description').'<span class="normal_weight">('.$macro_name.')</span>',
html_print_input_text_extended($macro_desc_name, $macro_desc_value, 'text-'.$macro_desc_name, '', 30, 255, false, '', "class='command_macro text_input'", true)
);
$datam[0] .= html_print_input_hidden($macro_name_name, $macro_name, true); $datam[0] .= html_print_input_hidden($macro_name_name, $macro_name, true);
$datam[1] = html_print_input_text_extended($macro_desc_name, $macro_desc_value, 'text-'.$macro_desc_name, '', 30, 255, false, '', "class='command_macro text_input'", true);
$datam[2] = __('Default value')."<span class='normal_weight'> ($macro_name)</span>"; $datam[1] = html_print_label_input_block(
$datam[3] = html_print_input_text_extended($macro_value_name, $macro_value_value, 'text-'.$macro_value_name, '', 30, 255, false, '', "class='command_component command_macro text_input'", true); __('Default value').'<span class="normal_weight">('.$macro_name.')</span>',
html_print_input_text_extended($macro_value_name, $macro_value_value, 'text-'.$macro_value_name, '', 30, 255, false, '', "class='command_component command_macro text_input'", true)
);
$table->data['plugin_'.$next_name_number] = $datam; $table->data['plugin_'.$next_name_number] = $datam;
$next_name_number++; $next_name_number++;
$table->colspan['plugin_'.$next_name_number][1] = 3; $table->colspan['plugin_'.$next_name_number][1] = 2;
$datam = []; $datam = [];
$datam[0] = __('Hide value').ui_print_help_tip( $datam = html_print_label_input_block(
__('This field will show up as dots like a password'), __('Hide value'),
true html_print_checkbox_switch(
); $macro_hide_value_name,
$datam[1] = html_print_checkbox_extended( 1,
$macro_hide_value_name, $macro_hide_value_value,
1, 0,
$macro_hide_value_value, '',
0, ['class' => 'command_macro'],
'', true,
['class' => 'command_macro'], 'checkbox-'.$macro_hide_value_name
true, ).ui_print_input_placeholder(
'checkbox-'.$macro_hide_value_name __('This field will show up as dots like a password'),
true
)
); );
$table->data['plugin_'.$next_name_number] = $datam; $table->data['plugin_'.$next_name_number] = $datam;
$next_name_number++; $next_name_number++;
$table->colspan['plugin_'.$next_name_number][1] = 3; // $table->colspan['plugin_'.$next_name_number][1] = 3;
$datam = []; $datam = [];
$datam[0] = __('Help')."<span class='normal_weight'> ($macro_name)</span><br><br><br>"; $datam[0] = html_print_label_input_block(
$datam[1] = html_print_textarea( __('Help').'<span class="normal_weight"> ('.$macro_name.')</span>',
$macro_help_name, html_print_textarea(
6, $macro_help_name,
100, 6,
$macro_help_value, 100,
'class="command_macro" class="w97p"', $macro_help_value,
true 'class="command_macro" class="w97p"',
true
)
); );
$datam[1] .= '<br><br><br>'; $table->colspan['plugin_'.$next_name_number][0] = 2;
$table->data['plugin_'.$next_name_number] = $datam; $table->data['plugin_'.$next_name_number] = $datam;
$next_name_number++; $next_name_number++;
$i++; $i++;
@ -617,7 +623,7 @@ if (empty($create) === false || empty($view) === false) {
// Add/Delete buttons // Add/Delete buttons
$datam = []; $datam = [];
$buttons = '';
if (!$locked) { if (!$locked) {
$datam[0] = '<a id="add_macro_btn" href="javascript:;">'.'<span class="bolder">'.__('Add macro').'</span>'.'&nbsp;'.html_print_image( $datam[0] = '<a id="add_macro_btn" href="javascript:;">'.'<span class="bolder">'.__('Add macro').'</span>'.'&nbsp;'.html_print_image(
'images/add.png', 'images/add.png',
@ -627,20 +633,55 @@ if (empty($create) === false || empty($view) === false) {
$datam[0] .= '<div id="next_macro" class="invisible">'.$i.'</div>'; $datam[0] .= '<div id="next_macro" class="invisible">'.$i.'</div>';
$datam[0] .= '<div id="next_row" class="invisible">'.$next_name_number.'</div>'; $datam[0] .= '<div id="next_row" class="invisible">'.$next_name_number.'</div>';
$buttons = html_print_anchor(
[
'id' => 'add_macro_btn',
'href' => 'javascript:;',
'content' => html_print_image(
'images/plus@svg.svg',
true,
['class' => 'invert_filter']
),
],
true
);
$buttons .= html_print_div(['id' => 'next_macro', 'class' => 'invisible', 'content' => $i], true);
$buttons .= html_print_div(['id' => 'next_row', 'class' => 'invisible', 'content' => $next_name_number], true);
$delete_macro_style = ''; $delete_macro_style = '';
if ($i <= 2) { if ($i <= 2) {
$delete_macro_style = 'display:none;'; $delete_macro_style = 'display:none;';
} }
$datam[2] = '<div id="delete_macro_button" style="'.$delete_macro_style.'">'.'<a href="javascript:;">'.'<span class="bolder">'.__('Delete macro').'</span>'.'&nbsp;'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']).'</a>'.'</div>'; // $datam[1] = '<div id="delete_macro_button" style="'.$delete_macro_style.'">'.'<a href="javascript:;">'.'<span class="bolder">'.__('Delete macro').'</span>'.'&nbsp;'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']).'</a>'.'</div>';
$buttons .= html_print_anchor(
[
'id' => 'delete_macro_button',
'style' => $delete_macro_style,
'href' => 'javascript:;',
'content' => html_print_image(
'images/delete.svg',
true,
['class' => 'main_menu_icon invert_filter']
),
],
true
);
$datam[0] = html_print_div(
[
'style' => 'flex-direction: row-reverse;justify-content: flex-start;',
'content' => $buttons,
],
true
);
$table->colspan['plugin_action'][0] = 2; $table->colspan['plugin_action'][0] = 2;
$table->colspan['plugin_action'][2] = 2;
} else { } else {
$table->colspan['plugin_action'][0] = 4; // $table->colspan['plugin_action'][0] = 4;
} }
$table->rowstyle['plugin_action'] = 'text-align:center'; // $table->rowstyle['plugin_action'] = 'text-align:center';
$table->data['plugin_action'] = $datam; $table->data['plugin_action'] = $datam;

View File

@ -251,69 +251,69 @@ if (enterprise_installed()) {
switch ($section) { switch ($section) {
case 'general': case 'general':
$buttons['general']['active'] = true; $buttons['general']['active'] = true;
$subpage = ' &raquo '.__('General'); $subpage = __('General');
$help_header = 'setup_general_tab'; $help_header = 'setup_general_tab';
break; break;
case 'auth': case 'auth':
$buttons['auth']['active'] = true; $buttons['auth']['active'] = true;
$subpage = ' &raquo '.__('Authentication'); $subpage = __('Authentication');
break; break;
case 'perf': case 'perf':
$buttons['perf']['active'] = true; $buttons['perf']['active'] = true;
$subpage = ' &raquo '.__('Performance'); $subpage = __('Performance');
$help_header = ''; $help_header = '';
break; break;
case 'vis': case 'vis':
$buttons['vis']['active'] = true; $buttons['vis']['active'] = true;
$subpage = ' &raquo '.__('Visual styles'); $subpage = __('Visual styles');
break; break;
case 'net': case 'net':
$buttons['net']['active'] = true; $buttons['net']['active'] = true;
$subpage = ' &raquo '.__('Netflow'); $subpage = __('Netflow');
$help_header = 'setup_netflow_tab'; $help_header = 'setup_netflow_tab';
break; break;
case 'ehorus': case 'ehorus':
$buttons['ehorus']['active'] = true; $buttons['ehorus']['active'] = true;
$subpage = ' &raquo '.__('eHorus'); $subpage = __('eHorus');
$help_header = 'setup_ehorus_tab'; $help_header = 'setup_ehorus_tab';
break; break;
case 'integria': case 'integria':
$buttons['integria']['active'] = true; $buttons['integria']['active'] = true;
$subpage = ' &raquo '.__('Integria IMS'); $subpage = __('Integria IMS');
$help_header = 'setup_integria_tab'; $help_header = 'setup_integria_tab';
break; break;
case 'module_library': case 'module_library':
$buttons['module_library']['active'] = true; $buttons['module_library']['active'] = true;
$subpage = ' &raquo '.__('Module Library'); $subpage = __('Module Library');
$help_header = 'setup_module_library_tab'; $help_header = 'setup_module_library_tab';
break; break;
case 'gis': case 'gis':
$buttons['gis']['active'] = true; $buttons['gis']['active'] = true;
$subpage = ' &raquo '.__('Map conections GIS'); $subpage = __('Map conections GIS');
break; break;
case 'notifications': case 'notifications':
$buttons['notifications']['active'] = true; $buttons['notifications']['active'] = true;
$subpage = ' &raquo '.__('Notifications'); $subpage = __('Notifications');
break; break;
case 'websocket_engine': case 'websocket_engine':
$buttons['websocket_engine']['active'] = true; $buttons['websocket_engine']['active'] = true;
$subpage = ' &raquo '.__('Pandora Websocket Engine'); $subpage = __('Pandora Websocket Engine');
$help_header = 'quickshell_settings'; $help_header = 'quickshell_settings';
break; break;
case 'external_tools': case 'external_tools':
$buttons['external_tools']['active'] = true; $buttons['external_tools']['active'] = true;
$subpage = ' &raquo '.__('External Tools'); $subpage = __('External Tools');
$help_header = ''; $help_header = '';
break; break;
@ -327,39 +327,49 @@ switch ($section) {
} }
$buttons['welcome_tips']['active'] = true; $buttons['welcome_tips']['active'] = true;
$subpage = ' &raquo '.$title; $subpage = $title;
$help_header = ''; $help_header = '';
break; break;
case 'enterprise': case 'enterprise':
$buttons['enterprise']['active'] = true; $buttons['enterprise']['active'] = true;
$subpage = ' &raquo '.__('Enterprise'); $subpage = __('Enterprise');
$help_header = 'setup_enterprise_tab'; $help_header = 'setup_enterprise_tab';
break; break;
case 'hist_db':
$buttons['hist_db']['active'] = true;
$subpage = __('Historical database');
$help_header = '';
break;
case 'pass':
$buttons['pass']['active'] = true;
$subpage = __('Password policies');
$help_header = '';
break;
default: default:
$subpage = 'seccion: '.$section;
// Default. // Default.
break; break;
} }
// Put header inside div for special sizing.(No right margin).
echo '<div id="header_configuration" style="width: calc(100%);">';
// Header. // Header.
ui_print_page_header( ui_print_standard_header(
__('Configuration').$subpage, $subpage,
'', '',
false, false,
$help_header, $help_header,
true, true,
$buttons, $buttons,
false, [
'', [
GENERIC_SIZE_TEXT, 'link' => '',
'', 'label' => __('Setup'),
'', ],
true ]
); );
echo '</div>';
if (isset($config['error_config_update_config'])) { if (isset($config['error_config_update_config'])) {
if ($config['error_config_update_config']['correct'] == false) { if ($config['error_config_update_config']['correct'] == false) {

View File

@ -873,7 +873,7 @@ class DiscoveryTaskList extends HTML
'100%', '100%',
1.9, 1.9,
// Color. // Color.
'#82b92e', '#ececec',
// Return. // Return.
true, true,
// Text. // Text.
@ -1218,12 +1218,12 @@ class DiscoveryTaskList extends HTML
$result .= progress_circular_bar( $result .= progress_circular_bar(
$task['id_rt'], $task['id_rt'],
($task['status'] < 0) ? 100 : $task['status'], ($task['status'] < 0) ? 100 : $task['status'],
200, 150,
200, 150,
'#7eb641', '#3A3A3A',
'%', '%',
'', '',
'#3A3A3A', '#ececec',
0 0
); );
@ -1288,12 +1288,12 @@ class DiscoveryTaskList extends HTML
$result .= progress_circular_bar( $result .= progress_circular_bar(
$task['id_rt'].'_detail', $task['id_rt'].'_detail',
$task['stats']['c_network_percent'], $task['stats']['c_network_percent'],
200, 150,
200, 150,
'#7eb641', '#3A3A3A',
'%', '%',
'', '',
'#3A3A3A', '#ececec',
0 0
); );
$result .= '</div></div>'; $result .= '</div></div>';

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 27.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 20 20" style="enable-background:new 0 0 20 20;" xml:space="preserve">
<style type="text/css">
.st0{fill:none;}
.st1{fill:#000000;}
</style>
<g id="Dark-/-20-/-delete-v2" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Group" transform="translate(10.000000, 10.000000) rotate(0.000000) translate(-10.000000, -10.000000) translate(4.000000, 4.000000)" fill="#3F3F3F">
<path d="M6,0 C6.51283584,0 6.93550716,0.38604019 6.99327227,0.883378875 L7,1 L7,5 L11,5 C11.5522847,5 12,5.44771525 12,6 C12,6.51283584 11.6139598,6.93550716 11.1166211,6.99327227 L11,7 L7,7 L7,11 C7,11.5522847 6.55228475,12 6,12 C5.48716416,12 5.06449284,11.6139598 5.00672773,11.1166211 L5,11 L5,7 L1,7 C0.44771525,7 0,6.55228475 0,6 C0,5.48716416 0.38604019,5.06449284 0.883378875,5.00672773 L1,5 L5,5 L5,1 C5,0.44771525 5.44771525,0 6,0 Z" id="Path-7"></path>
</g>
<path d="M10,0 C4.4771525,0 0,4.4771525 0,10 C0,15.5228475 4.4771525,20 10,20 C15.5228475,20 20,15.5228475 20,10 C20,4.4771525 15.5228475,0 10,0 Z M10,2 C14.418278,2 18,5.581722 18,10 C18,14.418278 14.418278,18 10,18 C5.581722,18 2,14.418278 2,10 C2,5.581722 5.581722,2 10,2 Z" id="Oval" fill="#3F3F3F"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -25,6 +25,8 @@ if ((bool) is_metaconsole() === true) {
if ($networkmap) { if ($networkmap) {
$networkmap_id = get_parameter('networkmap_id', 0); $networkmap_id = get_parameter('networkmap_id', 0);
$dashboard = get_parameter('dashboard', 0);
$size = get_parameter('size', []);
$x_offset = get_parameter('x_offset', 0); $x_offset = get_parameter('x_offset', 0);
$y_offset = get_parameter('y_offset', 0); $y_offset = get_parameter('y_offset', 0);
$zoom_dash = get_parameter('zoom_dash', 0.5); $zoom_dash = get_parameter('zoom_dash', 0.5);
@ -62,6 +64,15 @@ if ($networkmap) {
global $id_networkmap; global $id_networkmap;
$id_networkmap = $networkmap['id']; $id_networkmap = $networkmap['id'];
$tab = 'radial_dynamic'; $tab = 'radial_dynamic';
if (empty($size) === false) {
if ($size['width'] > $size['height']) {
$width = $size['height'];
$height = ($size['height'] - 10);
} else {
$width = $size['width'];
$height = ($size['width'] + 50);
}
}
include_once 'operation/agentes/networkmap.dinamic.php'; include_once 'operation/agentes/networkmap.dinamic.php';
} else { } else {

View File

@ -1573,7 +1573,7 @@ if (check_login()) {
$value['thresholds'] $value['thresholds']
); );
$resultData = '<span style="color:'.$status['color'].'">'; $resultData = '<span class="widget-module-tabs-data" style="color:'.$status['color'].'">';
if ($vdata !== null && $vdata !== '' && $vdata !== false) { if ($vdata !== null && $vdata !== '' && $vdata !== false) {
if (isset($formatData) === true if (isset($formatData) === true
&& (bool) $formatData === true && (bool) $formatData === true

View File

@ -601,6 +601,7 @@ class AgentWizard extends HTML
'action' => $this->sectionUrl, 'action' => $this->sectionUrl,
'id' => 'form-main-wizard', 'id' => 'form-main-wizard',
'method' => 'POST', 'method' => 'POST',
'class' => 'white_box pdd_20px filter-list-adv',
]; ];
// Inputs. // Inputs.
@ -829,24 +830,22 @@ class AgentWizard extends HTML
]; ];
} }
$inputs[] = [ html_print_action_buttons(
'arguments' => [ html_print_submit_button(
'label' => $this->actionLabel, $this->actionLabel,
'name' => 'sub-protocol', 'sub-protocol',
'type' => 'submit', false,
'attributes' => [ [
'icon' => 'cog', 'icon' => 'cog',
'onclick' => '$(\'#form-main-wizard\').submit();', 'onclick' => '$("#form-main-wizard").submit();',
], ],
'return' => true, true
], )
]; );
// Prints main form. // Prints main form.
html_print_div( html_print_div(
[ [
'class' => 'white_box',
'style' => 'padding: 20px',
'content' => $this->printForm( 'content' => $this->printForm(
[ [
'form' => $form, 'form' => $form,
@ -5980,7 +5979,7 @@ class AgentWizard extends HTML
}); });
// Loading. // Loading.
$('#submit-sub-protocol').click(function() { $('#button-sub-protocol').click(function() {
$('.wizard-result').remove(); $('.wizard-result').remove();
$('#form-create-modules').remove(); $('#form-create-modules').remove();
$('.textodialogo').remove(); $('.textodialogo').remove();

View File

@ -1831,7 +1831,7 @@ class Diagnostics extends Wizard
if ($items[$key]['status'] === 2) { if ($items[$key]['status'] === 2) {
$items[$key]['value'] = html_print_image( $items[$key]['value'] = html_print_image(
'images/icono-warning.png', 'images/alert-yellow@svg.svg',
true, true,
[ [
'title' => __('Warning'), 'title' => __('Warning'),
@ -1840,7 +1840,7 @@ class Diagnostics extends Wizard
); );
} else if ($items[$key]['status'] === 1) { } else if ($items[$key]['status'] === 1) {
$items[$key]['value'] = html_print_image( $items[$key]['value'] = html_print_image(
'images/exito.png', 'images/validate.svg',
true, true,
[ [
'title' => __('Successfully'), 'title' => __('Successfully'),
@ -1849,7 +1849,7 @@ class Diagnostics extends Wizard
); );
} else { } else {
$items[$key]['value'] = html_print_image( $items[$key]['value'] = html_print_image(
'images/error_1.png', 'images/fail@svg.svg',
true, true,
[ [
'title' => __('Error'), 'title' => __('Error'),

View File

@ -181,113 +181,47 @@ class SnmpConsole extends HTML
$default_refr = 300; $default_refr = 300;
if (!isset($config['pure']) || $config['pure'] === false) { $statistics['text'] = '<a href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_statistics&pure='.$config['pure'].'">'.html_print_image(
$statistics['text'] = '<a href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_statistics&pure='.$config['pure'].'">'.html_print_image( 'images/logs@svg.svg',
'images/logs@svg.svg', true,
true, [
[ 'title' => __('Statistics'),
'title' => __('Statistics'), 'class' => 'main_menu_icon invert_filter',
'class' => 'main_menu_icon invert_filter', ]
] ).'</a>';
).'</a>'; $list['text'] = '<a href="index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&pure=0">'.html_print_image(
$list['text'] = '<a href="index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&pure=0">'.html_print_image( 'images/SNMP-network-numeric-data@svg.svg',
'images/SNMP-network-numeric-data@svg.svg', true,
true, [
[ 'title' => __('List'),
'title' => __('List'), 'class' => 'main_menu_icon invert_filter',
'class' => 'main_menu_icon invert_filter', ]
] ).'</a>';
).'</a>'; $list['active'] = true;
$list['active'] = true;
$screen['text'] = '<a href="#" onClick="javascript:fullscreen(1)">'.html_print_image( // Header.
'images/fullscreen@svg.svg', ui_print_standard_header(
true, __('SNMP Console'),
'images/op_snmp.png',
false,
'snmp_console',
false,
[
$screen,
$list,
$statistics,
],
[
[ [
'title' => __('View in full screen'), 'link' => '',
'class' => 'main_menu_icon invert_filter', 'label' => __('Monitoring'),
]
).'</a>';
// Header.
ui_print_standard_header(
__('SNMP Console'),
'images/op_snmp.png',
false,
'snmp_console',
false,
[
$screen,
$list,
$statistics,
], ],
[ [
[ 'link' => '',
'link' => '', 'label' => __('SNMP'),
'label' => __('Monitoring'), ],
], ]
[ );
'link' => '',
'label' => __('SNMP'),
],
]
);
} else {
echo '<div id="dashboard-controls">';
echo '<div id="menu_tab">';
echo '<ul class="mn">';
// Normal view button.
echo '<li class="nomn">';
echo '<a href="#" onClick="javascript:fullscreen(0)">';
echo html_print_image(
'images/exit_fullscreen@svg.svg',
true,
[
'title' => __('Exit fullscreen'),
'class' => 'main_menu_icon invert_filter',
]
);
echo '</a>';
echo '</li>';
// Auto refresh control.
echo '<li class="nomn">';
echo '<div class="dashboard-refr mrgn_top_6px">';
echo '<div class="dashboard-countdown display_in"></div>';
$normal_url = 'index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view';
echo '<form id="refr-form" method="get" action="'.$normal_url.'" >';
echo __('Refresh every').':';
echo html_print_select(get_refresh_time_array(), 'refresh', $this->refr, '', '', 0, true, false, false);
echo '</form>';
echo '</li>';
html_print_input_hidden('sec', 'snmpconsole');
html_print_input_hidden('sec2', 'operation/snmpconsole/snmp_view');
html_print_input_hidden('pure', 1);
html_print_input_hidden('refresh', (($this->refr > 0) ? $this->refr : $default_refr));
// Dashboard name.
echo '<li class="nomn">';
echo '<div class="dashboard-title">'.__('SNMP Traps').'</div>';
echo '</li>';
echo '</ul>';
echo '</div>';
echo '</div>';
ui_require_css_file('pandora_enterprise', ENTERPRISE_DIR.'/include/styles/');
ui_require_css_file('pandora_dashboard', ENTERPRISE_DIR.'/include/styles/');
ui_require_css_file('cluetip', 'include/styles/js/');
ui_require_jquery_file('countdown');
ui_require_javascript_file('pandora_dashboard', ENTERPRISE_DIR.'/include/javascript/');
ui_require_javascript_file('wz_jsgraphics');
ui_require_javascript_file('pandora_visual_console');
}
// Datatables list. // Datatables list.
try { try {

View File

@ -842,7 +842,7 @@ if (is_ajax()) {
$fragmentation_status = ''; $fragmentation_status = '';
if ($db_fragmentation->data->tablesFragmentationStatus->status === 1) { if ($db_fragmentation->data->tablesFragmentationStatus->status === 1) {
$fragmentation_status = html_print_image( $fragmentation_status = html_print_image(
'images/exito.png', 'images/validate.svg',
true, true,
[ [
'title' => __('Successfully'), 'title' => __('Successfully'),
@ -851,7 +851,7 @@ if (is_ajax()) {
); );
} else { } else {
$fragmentation_status = html_print_image( $fragmentation_status = html_print_image(
'images/error_1.png', 'images/fail@svg.svg',
true, true,
[ [
'title' => __('Error'), 'title' => __('Error'),

View File

@ -68,10 +68,10 @@ function network_print_explorer_header(
$cell = '<div class="flex_center">'; $cell = '<div class="flex_center">';
$cell .= $title; $cell .= $title;
$cell .= html_print_link_with_params( $cell .= html_print_link_with_params(
'images/arrow-down-white.png', 'images/arrow@svg.svg',
array_merge($hidden_data, ['order_by' => $order]), array_merge($hidden_data, ['order_by' => $order]),
'image', 'image',
($selected === $order) ? 'opacity: 0.5' : '' 'rotate: 270deg; width: 20px; margin-top: 4px;'.(($selected === $order) ? '' : 'opacity: 0.5')
); );
$cell .= '</div>'; $cell .= '</div>';

View File

@ -3283,12 +3283,19 @@ function reporting_html_alert_report_actions($table, $item, $pdf=0)
function get_alert_table($data) function get_alert_table($data)
{ {
$table = new StdCLass(); $table = new StdCLass();
$table->width = '100%'; $table->width = '99%';
$table->data = []; $table->data = [];
$table->head = []; $table->head = [];
$table->headstyle = []; $table->headstyle = [];
$table->cellstyle = []; $table->cellstyle = [];
$table->headstyle[0] = 'text-align:left;'; $table->headstyle[0] = 'text-align:left;';
$table->size[0] = '25%';
$table->size[1] = '12%';
$table->size[2] = '12%';
$table->size[3] = '12%';
$table->size[4] = '12%';
$table->size[5] = '12%';
$table->size[6] = '12%';
$head = reset($data); $head = reset($data);
foreach (array_reverse(array_keys($head)) as $name) { foreach (array_reverse(array_keys($head)) as $name) {
@ -3527,7 +3534,7 @@ function reporting_html_alert_report($table, $item, $pdf=0)
$table->data['alerts']['cell'] = html_print_table($table1, true); $table->data['alerts']['cell'] = html_print_table($table1, true);
if ($pdf) { if ($pdf) {
$table1->class = 'pdf_alert_table'; $table1->class = 'info_table';
return html_print_table($table1, true); return html_print_table($table1, true);
} }
} }
@ -3691,7 +3698,7 @@ function reporting_html_agent_configuration(
$row = []; $row = [];
$row['name'] = $item['data']['name']; $row['name'] = $item['data']['name'];
$row['group'] = $item['data']['group_icon']; $row['group'] = groups_get_name($item['data']['group'], true);
$row['address'] = $item['data']['os_icon']; $row['address'] = $item['data']['os_icon'];
$row['os'] = $item['data']['address']; $row['os'] = $item['data']['address'];
$row['description'] = $item['data']['description']; $row['description'] = $item['data']['description'];
@ -3732,36 +3739,21 @@ function reporting_html_agent_configuration(
$table1->width = '99%'; $table1->width = '99%';
$table1->head = []; $table1->head = [];
$table1->head['name'] = __('Name'); $table1->head['name'] = __('Name');
$table1->head['type'] = __('Type');
$table1->head['warning_critical'] = __('Warning<br/>Critical');
$table1->head['threshold'] = __('Threshold'); $table1->head['threshold'] = __('Threshold');
$table1->head['group_icon'] = __('Group');
$table1->head['description'] = __('Description'); $table1->head['description'] = __('Description');
$table1->head['interval'] = __('Interval'); $table1->head['interval'] = __('Interval');
$table1->head['unit'] = __('Unit'); $table1->head['unit'] = __('Unit');
$table1->head['status'] = __('Status'); $table1->head['status'] = __('Status');
$table1->head['tags'] = __('Tags'); $table1->head['tags'] = __('Tags');
$table1->align = []; $table1->align = [];
$table1->align['name'] = 'left'; $table1->align[] = 'left';
$table1->align['type'] = 'center';
$table1->align['warning_critical'] = 'right';
$table1->align['threshold'] = 'right';
$table1->align['group_icon'] = 'center';
$table1->align['description'] = 'left';
$table1->align['interval'] = 'right';
$table1->align['unit'] = 'left';
$table1->align['status'] = 'center';
$table1->align['tags'] = 'left';
$table1->data = []; $table1->data = [];
foreach ($item['data']['modules'] as $module) { foreach ($item['data']['modules'] as $module) {
$row = []; $row = [];
$row['name'] = $module['name']; $row['name'] = $module['name'];
$row['type'] = $module['type_icon'];
$row['warning_critical'] = $module['max_warning'].' / '.$module['min_warning'].'<br>'.$module['max_critical'].' / '.$module['min_critical'];
$row['threshold'] = $module['threshold']; $row['threshold'] = $module['threshold'];
$row['group_icon'] = ui_print_group_icon($item['data']['group'], true);
$row['description'] = $module['description']; $row['description'] = $module['description'];
$row['interval'] = $module['interval']; $row['interval'] = $module['interval'];
$row['unit'] = $module['unit']; $row['unit'] = $module['unit'];

View File

@ -727,8 +727,8 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
false, false,
false, false,
'', '',
'white-box-content', 'white-box-content mrgn_top_0 mrgn_btn_0px',
'white_table_flex margin-bottom-10 border-bottom-gray' 'white_table_flex'
); );
if ($config['agentaccess']) { if ($config['agentaccess']) {
@ -747,8 +747,8 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
true, true,
false, false,
'', '',
'white-box-content border-bottom-gray', 'white-box-content mrgn_top_0 mrgn_btn_0px border-bottom-gray',
'white_table_flex margin-top-10 margin-bottom-10' 'white_table_flex'
); );
} }
@ -920,8 +920,8 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
true, true,
false, false,
'', '',
'white-box-content border-bottom-gray', 'white-box-content mrgn_top_0 mrgn_btn_0px border-bottom-gray',
'white_table_flex margin-top-10 margin-bottom-10' 'white_table_flex'
); );
if (empty($server_data) === false && is_metaconsole() === true) { if (empty($server_data) === false && is_metaconsole() === true) {

View File

@ -385,7 +385,12 @@ function ui_print_message($message, $class='', $attributes='', $return=false, $t
$messageCreated = html_print_table($messageTable, true); $messageCreated = html_print_table($messageTable, true);
$autocloseTime = ((int) $config['notification_autoclose_time'] * 1000); $autocloseTime = ((int) $config['notification_autoclose_time'] * 1000);
$classes[] = 'info_box_container'; if (empty($message['div_class']) === false) {
$classes[] = $message['div_class'];
} else {
$classes[] = 'info_box_container';
}
$classes[] = (($autoclose === true) && ($autocloseTime > 0)) ? ' info_box_autoclose' : ''; $classes[] = (($autoclose === true) && ($autocloseTime > 0)) ? ' info_box_autoclose' : '';
// This session var is defined in index. // This session var is defined in index.
@ -3873,6 +3878,29 @@ function ui_print_datatable(array $parameters)
}'; }';
} }
$js .= 'if ($("#'.$table_id.' tr td").length == 1) {
$("div[id^=info_box_]").show();
$("div[id^=info_box_]").removeClass(\'invisible_important\');
$("table#'.$table_id.'").hide();
$("div.dataTables_paginate").hide();
$("div.dataTables_info").hide();
$("div.dataTables_length").hide();
if (dt_'.$table_id.'.page.info().pages > 1) {
$(".dataTables_paginate.paging_simple_numbers").show()
}
} else {
$("div[id^=info_box_]").hide();
$("table#'.$table_id.'").show();
$("div.dataTables_paginate").show();
$("div.dataTables_info").show();
$("div.dataTables_length").show();
if (dt_'.$table_id.'.page.info().pages == 1) {
$(".dataTables_paginate.paging_simple_numbers").hide()
}
}';
if (isset($parameters['drawCallback'])) { if (isset($parameters['drawCallback'])) {
$js .= $parameters['drawCallback']; $js .= $parameters['drawCallback'];
} }
@ -3996,8 +4024,13 @@ function ui_print_datatable(array $parameters)
$js .= '</script>'; $js .= '</script>';
// Order. // Order.
$info_msg_arr = [];
$info_msg_arr['message'] = $emptyTable;
$info_msg_arr['div_class'] = 'info_box_container invisible_important';
$info_msg = '<div>'.ui_print_info_message($info_msg_arr).'</div>';
$err_msg = '<div id="error-'.$table_id.'"></div>'; $err_msg = '<div id="error-'.$table_id.'"></div>';
$output = $err_msg.$filter.$extra.$table.$js; $output = $info_msg.$err_msg.$filter.$extra.$table.$js;
if (is_ajax() === false) { if (is_ajax() === false) {
ui_require_css_file('datatables.min', 'include/styles/js/'); ui_require_css_file('datatables.min', 'include/styles/js/');
ui_require_css_file('tables'); ui_require_css_file('tables');
@ -4327,7 +4360,10 @@ function ui_toggle(
$image_a = html_print_image( $image_a = html_print_image(
$img_a, $img_a,
true, true,
[ 'style' => 'rotate: '.$rotateA ], [
'class' => 'mrgn_right_10px',
'style' => 'rotate: '.$rotateA,
],
true true
); );
} else { } else {
@ -4338,7 +4374,10 @@ function ui_toggle(
$image_b = html_print_image( $image_b = html_print_image(
$img_b, $img_b,
true, true,
[ 'style' => 'rotate: '.$rotateB ], [
'class' => 'mrgn_right_10px',
'style' => 'margin-right:10px; rotate: '.$rotateB,
],
true true
); );
} else { } else {
@ -4401,7 +4440,7 @@ function ui_toggle(
$original, $original,
true, true,
[ [
'class' => 'float-left main_menu_icon', 'class' => 'float-left main_menu_icon mrgn_right_10px',
'style' => 'object-fit: contain; margin-right:10px; rotate:'.$imageRotate, 'style' => 'object-fit: contain; margin-right:10px; rotate:'.$imageRotate,
'title' => $title, 'title' => $title,
'id' => 'image_'.$uniqid, 'id' => 'image_'.$uniqid,
@ -4433,7 +4472,7 @@ function ui_toggle(
$original, $original,
true, true,
[ [
'class' => 'main_menu_icon', 'class' => 'main_menu_icon mrgn_right_10px',
'style' => 'object-fit: contain; float:right; margin-right:10px; rotate:'.$imageRotate, 'style' => 'object-fit: contain; float:right; margin-right:10px; rotate:'.$imageRotate,
'title' => $title, 'title' => $title,
'id' => 'image_'.$uniqid, 'id' => 'image_'.$uniqid,
@ -5044,6 +5083,8 @@ function ui_print_page_header(
$breadcrumbs='', $breadcrumbs='',
$hide_left_small=false $hide_left_small=false
) { ) {
global $config;
$title = io_safe_input_html($title); $title = io_safe_input_html($title);
if (($icon == '') && ($godmode == true)) { if (($icon == '') && ($godmode == true)) {
$icon = 'images/gm_setup.png'; $icon = 'images/gm_setup.png';
@ -5057,13 +5098,18 @@ function ui_print_page_header(
$type = 'view'; $type = 'view';
$type2 = 'menu_tab_frame_view'; $type2 = 'menu_tab_frame_view';
$separator_class = 'separator'; $separator_class = 'separator';
$div_style = '';
} else { } else {
$type = 'view'; $type = 'view';
$type2 = 'menu_tab_frame_view'; $type2 = 'menu_tab_frame_view';
$separator_class = 'separator_view'; $separator_class = 'separator_view';
$div_style = '';
if ($config['pure'] === true) {
$div_style = 'top:0px;';
}
} }
$buffer = '<div id="'.$type2.'" >'; $buffer = '<div id="'.$type2.'" style="'.$div_style.'" >';
if (!empty($breadcrumbs)) { if (!empty($breadcrumbs)) {
$buffer .= '<div class="menu_tab_left_bc">'; $buffer .= '<div class="menu_tab_left_bc">';
@ -7267,22 +7313,22 @@ function ui_get_inventory_module_add_form(
$table = new stdClass(); $table = new stdClass();
$table->id = 'inventory-module-form'; $table->id = 'inventory-module-form';
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox filters filter-table-adv';
$table->style['module-title'] = 'font-weight: bold;'; $table->size['module'] = '50%';
$table->style['interval-title'] = 'font-weight: bold;'; $table->size['interval'] = '50%';
$table->style['target-title'] = 'font-weight: bold;'; $table->size['target'] = '50%';
$table->style['chkbx-custom-fields-title'] = 'font-weight: bold;'; $table->size['chkbx-custom-fields'] = '50%';
$table->style['username-title'] = 'font-weight: bold;'; $table->size['username'] = '50%';
$table->style['password-title'] = 'font-weight: bold;'; $table->size['password'] = '50%';
$table->rowstyle = []; $table->rowstyle = [];
$table->rowstyle['hidden-custom-field-row'] = 'display: none;'; $table->rowstyle['hidden-custom-field-row'] = 'display: none;';
$table->colspan = []; $table->rowstyle['custom-fields-button'] = 'display: none;';
$table->colspan['custom-fields-row'] = []; // $table->colspan = [];
$table->colspan['custom-fields-row']['custom-fields-column'] = 4; // $table->colspan['custom-fields-row'] = [];
// $table->colspan['custom-fields-row']['custom-fields-column'] = 2;
$table->data = []; $table->data = [];
$row = []; $row = [];
$row['module-title'] = __('Module');
if (empty($inventory_module_id)) { if (empty($inventory_module_id)) {
if (empty($os_id)) { if (empty($os_id)) {
$sql = 'SELECT mi.id_module_inventory AS id, mi.name AS name, co.name AS os $sql = 'SELECT mi.id_module_inventory AS id, mi.name AS name, co.name AS os
@ -7314,33 +7360,111 @@ function ui_get_inventory_module_add_form(
} }
} }
$row['module-input'] = html_print_select($inventory_modules, 'id_module_inventory', 0, '', __('Select inventory module'), 0, true, false, false); $row['module'] = html_print_label_input_block(
__('Module'),
html_print_select(
$inventory_modules,
'id_module_inventory',
0,
'',
__('Select inventory module'),
0,
true,
false,
false,
'w100p',
false,
'width: 100%'
)
);
} else { } else {
$row['module-input'] = db_get_sql('SELECT name FROM tmodule_inventory WHERE id_module_inventory = '.$inventory_module_id); $row['module'] = html_print_label_input_block(
__('Module'),
db_get_sql('SELECT name FROM tmodule_inventory WHERE id_module_inventory = '.$inventory_module_id)
);
} }
$row['interval-title'] = __('Interval'); $row['interval'] = html_print_label_input_block(
$row['interval-input'] = html_print_extended_select_for_time('interval', $interval, '', '', '', false, true); __('Interval'),
html_print_extended_select_for_time(
'interval',
$interval,
'',
'',
'',
false,
true,
false,
true,
'w100p'
)
);
$table->data['first-row'] = $row; $table->data['first-row'] = $row;
$row = []; $row = [];
if ($target !== false) { if ($target !== false) {
$row['target-title'] = __('Target'); $row['target'] = html_print_label_input_block(
$row['target-input'] = html_print_input_text('target', $target, '', 25, 40, true); __('Target'),
html_print_input_text(
'target',
$target,
'',
25,
40,
true,
false,
false,
'',
'w100p'
)
);
} }
$row['chkbx-custom-fields-title'] = __('Use custom fields'); $row['chkbx-custom-fields'] = html_print_label_input_block(
$row['chkbx-custom-fields-input'] = html_print_checkbox('custom_fields_enabled', 1, $custom_fields_enabled, true); __('Use custom fields'),
html_print_checkbox(
'custom_fields_enabled',
1,
$custom_fields_enabled,
true
)
);
$table->data['second-row'] = $row; $table->data['second-row'] = $row;
$row = []; $row = [];
$row['username-title'] = __('Username'); $row['username'] = html_print_label_input_block(
$row['username-input'] = html_print_input_text('username', $username, '', 25, 40, true); __('Username'),
$row['password-title'] = __('Password'); html_print_input_text(
$row['password-input'] = html_print_input_password('password', $password, '', 25, 40, true); 'username',
$username,
'',
25,
40,
true,
false,
false,
'',
'w100p'
)
);
$row['password'] = html_print_label_input_block(
__('Password'),
html_print_input_password(
'password',
$password,
'',
25,
40,
true,
false,
false,
'w100p'
)
);
$table->data['userpass-row'] = $row; $table->data['userpass-row'] = $row;
@ -7348,8 +7472,18 @@ function ui_get_inventory_module_add_form(
$row['hidden-title'] = ''; $row['hidden-title'] = '';
$row['hidden-input'] = html_print_input_hidden('hidden-custom-field-name', '', true); $row['hidden-input'] = html_print_input_hidden('hidden-custom-field-name', '', true);
$row['hidden-input'] .= html_print_input_hidden('hidden-custom-field-is-secure', 0, true); $row['hidden-input'] .= html_print_input_hidden('hidden-custom-field-is-secure', 0, true);
$row['hidden-input'] .= html_print_input_text('hidden-custom-field-input', '', '', 25, 40, true); $row['hidden-input'] .= html_print_input_text(
$row['hidden-input'] .= '<span>&nbsp;</span>'; 'hidden-custom-field-input',
'',
'',
25,
40,
true,
false,
false,
'',
'w93p'
);
$row['hidden-input'] .= html_print_image( $row['hidden-input'] .= html_print_image(
'images/delete.svg', 'images/delete.svg',
true, true,
@ -7414,13 +7548,48 @@ function ui_get_inventory_module_add_form(
} }
$row = []; $row = [];
$row['custom-fields-column'] = '<b>'.__('Field name').'</b>'.'&nbsp;&nbsp;'.html_print_input_text('field-name', '', '', 25, 40, true).'&nbsp;&nbsp;&nbsp;'.html_print_checkbox('field-is-password', 1, false, true).__("It's a password").'&nbsp;&nbsp;&nbsp;'.html_print_button(__('Add field'), 'add-field', false, '', 'class="sub add"', true); $row['custom-fields-column'] = html_print_label_input_block(
__('Field name'),
'<div class="flex">'.html_print_input_text(
'field-name',
'',
'',
25,
40,
true,
false,
false,
'',
'w60p mrgn_right_10px'
).html_print_checkbox(
'field-is-password',
1,
false,
true
).'&nbsp;'.__("It's a password").'</div>'
);
$table->data['custom-fields-row'] = $row; $table->data['custom-fields-row'] = $row;
$row = [];
$row['custom-fields-button-title'] = '';
$row['custom-fields-button'] = html_print_button(
__('Add field'),
'add-field',
false,
'',
[
'class' => 'mini float-right',
'icon' => 'plus',
],
true
);
$table->data['custom-fields-button'] = $row;
ob_start(); ob_start();
echo '<form name="modulo" method="post" action="'.$form_action.'">'; echo '<form name="modulo" method="post" action="'.$form_action.'" class="max_floating_element_size">';
echo html_print_table($table); echo html_print_table($table);
echo '<div class="action-buttons w100p">'; echo '<div class="action-buttons w100p">';
echo $form_buttons; echo $form_buttons;

View File

@ -696,7 +696,7 @@ function get_build_setup_charts($type, $options, $data)
$legend->setAlign($legendAlign); $legend->setAlign($legendAlign);
// Defaults fonts legends. // Defaults fonts legends.
$legend->labels()->getFonts()->setFamily((empty($config['fontpath']) === true) ? 'Lato' : $config['fontpath']); $legend->labels()->getFonts()->setFamily((empty($config['fontpath']) === true) ? 'lato' : $config['fontpath']);
$legend->labels()->getFonts()->setStyle('normal'); $legend->labels()->getFonts()->setStyle('normal');
$legend->labels()->getFonts()->setWeight(600); $legend->labels()->getFonts()->setWeight(600);
$legend->labels()->getFonts()->setSize(((int) $config['font_size'] + 2)); $legend->labels()->getFonts()->setSize(((int) $config['font_size'] + 2));
@ -835,7 +835,7 @@ function get_build_setup_charts($type, $options, $data)
$dataLabel->setFormatter($dataLabelFormatter); $dataLabel->setFormatter($dataLabelFormatter);
// Defaults fonts datalabel. // Defaults fonts datalabel.
$dataLabel->getFonts()->setFamily((empty($config['fontpath']) === true) ? 'Lato' : $config['fontpath']); $dataLabel->getFonts()->setFamily((empty($config['fontpath']) === true) ? 'lato' : $config['fontpath']);
$dataLabel->getFonts()->setStyle('normal'); $dataLabel->getFonts()->setStyle('normal');
$dataLabel->getFonts()->setWeight(600); $dataLabel->getFonts()->setWeight(600);
$dataLabel->getFonts()->setSize(((int) $config['font_size'] + 2)); $dataLabel->getFonts()->setSize(((int) $config['font_size'] + 2));
@ -944,14 +944,14 @@ function get_build_setup_charts($type, $options, $data)
// Defaults scalesFont X. // Defaults scalesFont X.
$scalesXFonts = $scales->getX()->ticks()->getFonts(); $scalesXFonts = $scales->getX()->ticks()->getFonts();
$scalesXFonts->setFamily((empty($config['fontpath']) === true) ? 'Lato' : $config['fontpath']); $scalesXFonts->setFamily((empty($config['fontpath']) === true) ? 'lato' : $config['fontpath']);
$scalesXFonts->setStyle('normal'); $scalesXFonts->setStyle('normal');
$scalesXFonts->setWeight(600); $scalesXFonts->setWeight(600);
$scalesXFonts->setSize(((int) $config['font_size'] + 2)); $scalesXFonts->setSize(((int) $config['font_size'] + 2));
// Defaults scalesFont Y. // Defaults scalesFont Y.
$scalesYFonts = $scales->getY()->ticks()->getFonts(); $scalesYFonts = $scales->getY()->ticks()->getFonts();
$scalesYFonts->setFamily((empty($config['fontpath']) === true) ? 'Lato' : $config['fontpath']); $scalesYFonts->setFamily((empty($config['fontpath']) === true) ? 'lato' : $config['fontpath']);
$scalesYFonts->setStyle('normal'); $scalesYFonts->setStyle('normal');
$scalesYFonts->setWeight(600); $scalesYFonts->setWeight(600);
$scalesYFonts->setSize(((int) $config['font_size'] + 2)); $scalesYFonts->setSize(((int) $config['font_size'] + 2));

View File

@ -2167,7 +2167,7 @@ function print_circular_progress_bar(
var numberText = circle var numberText = circle
.append("text") .append("text")
.attr("fill", label_color) .attr("fill", "#333333")
.style("font-weight", "bold") .style("font-weight", "bold")
.style("font-size", numberSize) .style("font-size", numberSize)
.attr("text-anchor", "middle") .attr("text-anchor", "middle")
@ -2175,7 +2175,7 @@ function print_circular_progress_bar(
var percentText = circle var percentText = circle
.append("text") .append("text")
.attr("fill", label_color) .attr("fill", "#333333")
.style("font-weight", "bold") .style("font-weight", "bold")
.style("font-size", unitSize) .style("font-size", unitSize)
.text(unit) .text(unit)

View File

@ -806,7 +806,9 @@ function dashboardLoadNetworkMap(settings) {
auth_hash: settings.auth_hash, auth_hash: settings.auth_hash,
id_user: settings.id_user, id_user: settings.id_user,
ignore_acl: 1, ignore_acl: 1,
node: settings.node node: settings.node,
dashboard: 1,
size: settings.size
}, },
dataType: "html", dataType: "html",
success: function(data) { success: function(data) {

View File

@ -520,7 +520,7 @@ class DataMatrix extends Widget
[ [
'id' => $tableId, 'id' => $tableId,
'class' => 'info_table', 'class' => 'info_table',
'style' => 'width: 100%', 'style' => 'width: 99%',
'columns' => $columns, 'columns' => $columns,
'column_names' => $column_names, 'column_names' => $column_names,
'ajax_url' => 'include/ajax/module', 'ajax_url' => 'include/ajax/module',
@ -539,6 +539,7 @@ class DataMatrix extends Widget
'direction' => 'desc', 'direction' => 'desc',
], ],
'csv' => 0, 'csv' => 0,
'dom_elements' => 'frtilp',
] ]
); );
} catch (\Exception $e) { } catch (\Exception $e) {
@ -643,7 +644,14 @@ class DataMatrix extends Widget
} }
$columns_sort[] = ($key + 1); $columns_sort[] = ($key + 1);
$column_names[] = $name; $column_names[] = \ui_print_truncate_text(
\io_safe_output($name),
'agent_small',
false,
true,
false,
'...'
);
} }
$data = [ $data = [

View File

@ -424,9 +424,9 @@ class AgentModuleWidget extends Widget
array $visualData, array $visualData,
array $allModules array $allModules
):string { ):string {
$style = 'display:flex; width:96%; margin-top: 10px;'; $style = 'display:flex; width:100%; margin-top: 10px;';
$table_data = '<div style="'.$style.'">'; $table_data = '<div style="'.$style.'">';
$table_data .= '<table class="widget_agent_module transparent mrgn_0px" cellpadding="1" cellspacing="0" border="0">'; $table_data .= '<table class="info_table transparent" cellpadding="1" cellspacing="0" border="0">';
if (empty($visualData) === false) { if (empty($visualData) === false) {
$table_data .= '<th>'.__('Agents').' / '.__('Modules').'</th>'; $table_data .= '<th>'.__('Agents').' / '.__('Modules').'</th>';
@ -450,29 +450,24 @@ class AgentModuleWidget extends Widget
switch ($row['agent_status']) { switch ($row['agent_status']) {
case AGENT_STATUS_ALERT_FIRED: case AGENT_STATUS_ALERT_FIRED:
$rowcolor = COL_ALERTFIRED; $rowcolor = COL_ALERTFIRED;
$textcolor = '#000';
break; break;
case AGENT_STATUS_CRITICAL: case AGENT_STATUS_CRITICAL:
$rowcolor = COL_CRITICAL; $rowcolor = COL_CRITICAL;
$textcolor = '#FFF';
break; break;
case AGENT_STATUS_WARNING: case AGENT_STATUS_WARNING:
$rowcolor = COL_WARNING; $rowcolor = COL_WARNING;
$textcolor = '#000';
break; break;
case AGENT_STATUS_NORMAL: case AGENT_STATUS_NORMAL:
$rowcolor = COL_NORMAL; $rowcolor = COL_NORMAL;
$textcolor = '#FFF';
break; break;
case AGENT_STATUS_UNKNOWN: case AGENT_STATUS_UNKNOWN:
case AGENT_STATUS_ALL: case AGENT_STATUS_ALL:
default: default:
$rowcolor = COL_UNKNOWN; $rowcolor = COL_UNKNOWN;
$textcolor = '#FFF';
break; break;
} }
@ -484,8 +479,10 @@ class AgentModuleWidget extends Widget
false, false,
'...' '...'
); );
$table_data .= "<td style='background-color: ".$rowcolor.";'>"; $table_data .= '<td>';
$table_data .= '<div class="flex"><div class="div-state-agent" style="background-color: '.$rowcolor.';"></div>';
$table_data .= $file_name; $table_data .= $file_name;
$table_data .= '</div>';
$table_data .= '</td>'; $table_data .= '</td>';
if ($row['modules'] === null) { if ($row['modules'] === null) {
@ -494,7 +491,7 @@ class AgentModuleWidget extends Widget
foreach ($row['modules'] as $module_name => $module) { foreach ($row['modules'] as $module_name => $module) {
if ($this->values['mTypeShow'] === '1') { if ($this->values['mTypeShow'] === '1') {
$style = 'text-align: center;'; $style = 'text-align: left;';
$style .= ' background-color: transparent;'; $style .= ' background-color: transparent;';
$table_data .= "<td style='".$style."'>"; $table_data .= "<td style='".$style."'>";
$table_data .= $module; $table_data .= $module;
@ -509,7 +506,7 @@ class AgentModuleWidget extends Widget
continue; continue;
} }
} else { } else {
$style = 'text-align: center;'; $style = 'text-align: left;';
$style .= ' background-color: transparent;'; $style .= ' background-color: transparent;';
$table_data .= "<td style='".$style."'>"; $table_data .= "<td style='".$style."'>";
switch ($module) { switch ($module) {

View File

@ -521,7 +521,7 @@ class CustomGraphWidget extends Widget
$params = [ $params = [
'period' => $this->values['period'], 'period' => $this->values['period'],
'width' => ($size['width'] - 10), 'width' => ($size['width']),
'height' => $height, 'height' => $height,
'only_image' => false, 'only_image' => false,
'homeurl' => $config['homeurl'], 'homeurl' => $config['homeurl'],

View File

@ -663,7 +663,7 @@ class EventsListWidget extends Widget
[ [
'id' => $table_id, 'id' => $table_id,
'class' => 'info_table events', 'class' => 'info_table events',
'style' => 'width: 100%;', 'style' => 'width: 99%;',
'ajax_url' => 'operation/events/events', 'ajax_url' => 'operation/events/events',
'ajax_data' => [ 'ajax_data' => [
'get_events' => 1, 'get_events' => 1,
@ -697,6 +697,7 @@ class EventsListWidget extends Widget
'ajax_return_operation_function' => 'process_buffers', 'ajax_return_operation_function' => 'process_buffers',
'return' => true, 'return' => true,
'csv' => 0, 'csv' => 0,
'dom_elements' => 'frtilp',
] ]
); );

View File

@ -492,6 +492,7 @@ class NetworkMapWidget extends Widget
'auth_class' => 'PandoraFMS\Dashboard\Manager', 'auth_class' => 'PandoraFMS\Dashboard\Manager',
'auth_hash' => Manager::generatePublicHash(), 'auth_hash' => Manager::generatePublicHash(),
'node' => $node, 'node' => $node,
'size' => $size,
] ]
); );

View File

@ -367,7 +367,7 @@ class ServiceViewWidget extends Widget
'AR' 'AR'
); );
$output .= '<div class="white_box mgn_btt_20px mrgn_top_20px pddng_50px services_table" >'; $output .= '<div class="services_table" >';
$output .= '<div id="table_services_dashboard">'; $output .= '<div id="table_services_dashboard">';
foreach ($services as $service) { foreach ($services as $service) {
switch ($service['status']) { switch ($service['status']) {
@ -404,40 +404,6 @@ class ServiceViewWidget extends Widget
</div> </div>
</a>'; </a>';
} }
$output .= '</div>';
$output .= '<table cellspacing="0" cellpadding="0">';
$output .= '<tr>';
$output .= '<td>';
$output .= '<div class="service_status" style=" background: '.COL_UNKNOWN.';"></div>';
$output .= '</td>';
$output .= '<td>';
$output .= '<div class="service_status" style="background: '.COL_NORMAL.';"></div>';
$output .= '</td>';
$output .= '<td>';
$output .= '<div class="service_status" style="background: '.COL_WARNING.';"></div>';
$output .= '</td>';
$output .= '<td>';
$output .= '<div class="service_status" style="background: '.COL_CRITICAL.';"></div>';
$output .= '</td>';
$output .= '</tr><tr>';
$output .= '<td>';
$output .= '<div class="pdd_r_15px"><span class="font_12px">Unknown</span></div>';
$output .= '</td>';
$output .= '<td >';
$output .= '<div class="pdd_r_15px"><span class="font_12px">Normal</span></div>';
$output .= '</div>';
$output .= '<td>';
$output .= '<div class="pdd_r_15px"><span class="font_12px">Warning</span></div>';
$output .= '</td>';
$output .= '<td>';
$output .= '<div><span class="font_12px">Critical</span></div>';
$output .= '</td>';
$output .= '</tr>';
$output .= '</table>';
$output .= '</div>';
} }
return $output; return $output;

View File

@ -477,7 +477,7 @@ class SystemGroupStatusWidget extends Widget
$this->values['groupId'] = $selected_groups; $this->values['groupId'] = $selected_groups;
$this->values['status'] = explode(',', $this->values['status'][0]); $this->values['status'] = explode(',', $this->values['status'][0]);
$style = 'font-size: 12px; text-align: center;'; $style = 'font-size: 1.5em; font-weight: bolder;text-align: center;';
$table = new \stdClass(); $table = new \stdClass();
$table->class = 'group_modules_status_box'; $table->class = 'group_modules_status_box';

View File

@ -364,21 +364,6 @@ class WuxWidget extends Widget
} }
$output .= '<div>'; $output .= '<div>';
$output .= '<div>';
$output .= "<p class='font_20px'>";
if ($have_errors === true) {
$output .= __('Global status').': ';
$output .= "<span class='color: #e63c52; font_20px'>";
$output .= __('Failed');
$output .= '</span>';
} else {
$output .= __('Global status').': ';
$output .= "<span class='pandora_green_bg font_20px'>";
$output .= __('Ok');
$output .= '</span>';
}
$output .= '</div>';
$output .= '<div>'; $output .= '<div>';
$output .= \ux_console_phases_donut( $output .= \ux_console_phases_donut(

View File

@ -127,6 +127,8 @@ h1 {
.grid-stack-item .grid-stack-item-content .header-widget div:first-child { .grid-stack-item .grid-stack-item-content .header-widget div:first-child {
flex: 1; flex: 1;
text-align: center; text-align: center;
font-family: "lato-bold";
font-size: 14px;
} }
.grid-stack-item .grid-stack-item-content .header-widget div:not(:first-child) { .grid-stack-item .grid-stack-item-content .header-widget div:not(:first-child) {
@ -791,3 +793,45 @@ form.modal-dashboard
.select2-selection__rendered { .select2-selection__rendered {
max-height: 75px !important; max-height: 75px !important;
} }
.content-widget .info_table {
margin-bottom: 0px;
}
.div-state-agent {
width: 5px;
height: 20px;
border-radius: 3px;
margin-right: 5px;
}
.dataTables_length > label > select {
height: 30px;
min-height: 30px;
margin: 5px;
}
.dataTables_paginate.paging_simple_numbers {
margin-top: 10px;
height: 40px;
}
.info_table.events tr > td {
height: 1em !important;
text-align: initial;
}
.event.flex-row.h100p.nowrap .mini-criticity {
margin-left: 7px;
}
.tree-controller-recipient {
width: -webkit-fill-available !important;
}
.services_table {
padding: 0px;
background-color: #fff;
border: 0px;
width: 90%;
}

View File

@ -3809,7 +3809,7 @@ div.div_groups_status {
background-color: white; background-color: white;
border: 1px solid #ececec; border: 1px solid #ececec;
border-radius: 5px; border-radius: 5px;
margin: 20px; margin: 5px;
float: left; float: left;
} }
@ -5843,6 +5843,7 @@ div.switch_radio_button label {
margin-right: -1px; margin-right: -1px;
border: 1px solid #cbcbcb; border: 1px solid #cbcbcb;
transition: all 0.1s ease-in-out; transition: all 0.1s ease-in-out;
background: transparent;
} }
div.switch_radio_button label:first-of-type { div.switch_radio_button label:first-of-type {
@ -6547,6 +6548,7 @@ table.table_modal_alternate tr td:first-child {
.flot-text .flot-x-axis div { .flot-text .flot-x-axis div {
white-space: normal; white-space: normal;
word-break: break-all; word-break: break-all;
line-height: 1.3;
} }
/*Font header feedback*/ /*Font header feedback*/
@ -10531,6 +10533,11 @@ button div.preview {
-webkit-mask: url(../../images/eye.png) no-repeat center / contain; -webkit-mask: url(../../images/eye.png) no-repeat center / contain;
} }
button div.plus {
mask: url(../../images/plus-black.svg) no-repeat center / contain;
-webkit-mask: url(../../images/plus-black.svg) no-repeat center / contain;
}
button div.cog.rotation { button div.cog.rotation {
animation: rotation 4s infinite linear; animation: rotation 4s infinite linear;
} }
@ -11239,8 +11246,8 @@ input.main_menu_icon[src$=".svg"] {
} }
.header_help_icon { .header_help_icon {
width: 16px; width: 16px !important;
height: 16px; height: 16px !important;
} }
.main_menu_icon.arrow_up { .main_menu_icon.arrow_up {
transform: rotate(90deg); transform: rotate(90deg);
@ -11263,12 +11270,17 @@ span.subsection_header_title {
height: 18px; height: 18px;
} }
.agent_details_header span.subsection_header_title {
font-weight: 700;
color: #000;
}
.subsection_header_title.secondary { .subsection_header_title.secondary {
font-size: 14px; font-size: 14px;
} }
span.subsection_header_title.secondary { span.subsection_header_title.secondary {
height: 14px; height: 14px;
line-height: 14px;
} }
.regular_font { .regular_font {
@ -11634,3 +11646,21 @@ ul.tag-editor {
padding-left: 5px !important; padding-left: 5px !important;
font-size: 20px !important; font-size: 20px !important;
} }
div.ui-dialog-buttonset > button.ui-button.ui-corner-all.ui-widget {
background-color: var(--primary-color);
color: #fff;
border: 1px solid var(--primary-color);
border-radius: 8px;
font-size: 11pt;
}
div.ui-dialog-buttonset > button.ui-button.ui-corner-all.ui-widget:hover {
background-color: #1d7873;
border-color: #1d7873;
}
div.ui-dialog-buttonset > button.ui-button.ui-corner-all.ui-widget:active {
background-color: #0d312f;
border-color: #0d312f;
}

View File

@ -38,7 +38,7 @@ table.header_table tr td {
} }
table thead tr th { table thead tr th {
background-color: #919191; background-color: #e5e5e5;
} }
table thead tr th.title_table_pdf { table thead tr th.title_table_pdf {

View File

@ -1116,6 +1116,7 @@ select,
border: 1px solid #707070; border: 1px solid #707070;
background-color: #222 !important; background-color: #222 !important;
color: #fff !important; color: #fff !important;
border-radius: 0;
} }
.white_table_graph { .white_table_graph {
@ -1248,8 +1249,7 @@ a.pandora_pagination:hover {
background-color: #555 !important; background-color: #555 !important;
} }
.dt-button.buttons-csv.buttons-html5 { .dt-button.buttons-csv.buttons-html5 {
filter: invert(100%); box-shadow: 0px 3px 6px #111;
background-color: transparent;
} }
.info_table.events > tbody > tr > td { .info_table.events > tbody > tr > td {
@ -1480,13 +1480,6 @@ span.select2-dropdown.select2-dropdown--below {
z-index: 1200; z-index: 1200;
} }
div.fixed_filter_bar,
div.white_table_graph_header {
border-radius: 0;
border-left: 0px;
border-right: 0px;
}
div.white_table_graph { div.white_table_graph {
border-radius: 0; border-radius: 0;
} }
@ -1500,10 +1493,25 @@ div.white_box.white_box_opened.no_border {
border-radius: 0px; border-radius: 0px;
} }
table.filter-table-adv td > div label { table.filter-table-adv td > div label:not(.inputFile) {
color: white !important; color: white !important;
} }
#principal_action_buttons { #principal_action_buttons {
background: #111111; background: #111111;
} }
div.fixed-bottom-box,
div.fixed-bottom-box
> div.fixed-bottom-box-head
> div.fixed-bottom-box-head-body {
background-color: #111111 !important;
}
.filter_table,
.white_table_graph_fixed table {
background-color: transparent;
}
span.select2 {
border-radius: 6px;
}

View File

@ -798,3 +798,11 @@ div[id^="auto-os-"] > img {
width: 20px; width: 20px;
height: 20px; height: 20px;
} }
.dataTables_paginate {
margin-right: 10px;
}
.dataTables_paginate.paging_simple_numbers {
margin-right: 0;
}

View File

@ -43,7 +43,7 @@ div.subtitle {
} }
div.subtitle span { div.subtitle span {
font-size: 1.9em; font-size: 1.3em;
} }
div.subtitle div.manage { div.subtitle div.manage {

View File

@ -18,7 +18,7 @@
border-radius: 5px; border-radius: 5px;
} }
.ui-dialog .tips_header.ui-dialog-titlebar { .ui-dialog .tips_header.ui-dialog-titlebar {
display: flex; display: flex !important;
padding: 0px 20px; padding: 0px 20px;
justify-content: space-between; justify-content: space-between;
height: fit-content; height: fit-content;

View File

@ -1491,7 +1491,7 @@ ui_require_javascript_file('connection_check');
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false)); set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
$conn_title = __('Connection with server has been lost'); $conn_title = __('Connection with server has been lost');
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.'); $conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/error_1.png'); ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/fail@svg.svg');
if ($config['pure'] == 0) { if ($config['pure'] == 0) {
echo '</div>'; echo '</div>';

View File

@ -76,9 +76,9 @@ if ($fields === false) {
$data[0] = '<b>'.$field['name'].'</b>'; $data[0] = '<b>'.$field['name'].'</b>';
if ($field['display_on_front']) { if ($field['display_on_front']) {
$data[1] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']); $data[1] = html_print_image('images/validate.svg', true, ['class' => 'invert_filter']);
} else { } else {
$data[1] = html_print_image('images/delete.png', true, ['class' => 'invert_filter']); $data[1] = html_print_image('images/delete.svg', true, ['class' => 'invert_filter']);
} }
$custom_value = db_get_all_rows_sql( $custom_value = db_get_all_rows_sql(

View File

@ -164,8 +164,8 @@ $table_status->width = '100%';
$table_status->cellspacing = 0; $table_status->cellspacing = 0;
$table_status->cellpadding = 0; $table_status->cellpadding = 0;
$table_status->class = 'floating_form'; $table_status->class = 'floating_form';
$table_status->style[0] = 'height: 32px; width: 30%; padding-right: 5px; text-align: end;'; $table_status->style[0] = 'height: 32px; width: 30%; padding-right: 5px; text-align: end; vertical-align: top';
$table_status->style[1] = 'height: 32px; width: 70%; padding-left: 5px; font-weight: lighter'; $table_status->style[1] = 'height: 32px; width: 70%; padding-left: 5px; font-weight: lighter; vertical-align: top';
$agentStatusGraph = html_print_div( $agentStatusGraph = html_print_div(
[ [
@ -386,8 +386,8 @@ $table_contact->width = '100%';
$table_contact->cellspacing = 0; $table_contact->cellspacing = 0;
$table_contact->cellpadding = 0; $table_contact->cellpadding = 0;
$table_contact->class = 'floating_form'; $table_contact->class = 'floating_form';
$table_contact->style[0] = 'height: 32px; width: 30%; padding-right: 5px; text-align: end;'; $table_contact->style[0] = 'height: 32px; width: 30%; padding-right: 5px; text-align: end; vertical-align: top';
$table_contact->style[1] = 'height: 32px; width: 70%; padding-left: 5px; font-weight: lighter'; $table_contact->style[1] = 'height: 32px; width: 70%; padding-left: 5px; font-weight: lighter; vertical-align: top';
$agentContactCaption = html_print_div( $agentContactCaption = html_print_div(
[ [

View File

@ -314,7 +314,7 @@ if ($start_date != $current) {
if ($combined) { if ($combined) {
// Pass the $modules before the ajax call. // Pass the $modules before the ajax call.
echo '<div class="combined-graph-container center w100p"'.'data-period="'.$period.'"'.'data-stacked="'.CUSTOM_GRAPH_LINE.'"'.'data-date="'.$date.'"'.'data-height="'.$height.'"'.'>'.html_print_image('images/spinner.gif', true).'</div>'; echo '<div class="combined-graph-container center w100p white_box"'.'data-period="'.$period.'"'.'data-stacked="'.CUSTOM_GRAPH_LINE.'"'.'data-date="'.$date.'"'.'data-height="'.$height.'"'.'>'.html_print_image('images/spinner.gif', true).'</div>';
} else { } else {
foreach ($modules as $id_module) { foreach ($modules as $id_module) {
$title = modules_get_agentmodule_name($id_module); $title = modules_get_agentmodule_name($id_module);

View File

@ -131,24 +131,18 @@ if ($pure == 1) {
} }
} }
ui_print_page_header( if ($dashboard != 1) {
io_safe_output($networkmap['name']), ui_print_page_header(
'images/bricks.png', io_safe_output($networkmap['name']),
false, 'images/bricks.png',
'network_map_enterprise_list', false,
false, 'network_map_enterprise_list',
$buttons, false,
false, $buttons,
'', false,
$config['item_title_size_text'] '',
); $config['item_title_size_text']
);
global $width;
global $height;
if (_id_ != '_id_') {
$width = [];
$height = [];
} }
if (empty($width)) { if (empty($width)) {

View File

@ -275,7 +275,7 @@ if ($not_found) {
} else { } else {
if ($disabled_source === false) { if ($disabled_source === false) {
echo '<div id="map_loading" style="width: 98%;height: 1000px; background-color: rgba(245, 245, 245, .3);position: absolute;display: flex;justify-content: center;align-items: center;flex-direction: column-reverse;">'; echo '<div id="map_loading" style="width: 98%;height: 1000px; background-color: rgba(245, 245, 245, .3);position: absolute;display: flex;justify-content: center;align-items: center;flex-direction: column-reverse;">';
echo html_print_image('images/spinner.gif', true, 'width: 50px;height: 50px;'); echo html_print_image('images/spinner.gif', true, ['width' => '50px', 'height' => '50px']);
echo '<div>'.__('Creating map...').'</div>'; echo '<div>'.__('Creating map...').'</div>';
echo '</div>'; echo '</div>';
$info1 = __('To create a network map that visually recreates link-level (L2) relationships, you must first discover these relationships with Discovery Server. Network maps only reflect relationships that have already been discovered.'); $info1 = __('To create a network map that visually recreates link-level (L2) relationships, you must first discover these relationships with Discovery Server. Network maps only reflect relationships that have already been discovered.');

View File

@ -97,7 +97,7 @@ ui_print_message_dialog(
$conn_title, $conn_title,
$conn_text, $conn_text,
'connection', 'connection',
'/images/error_1.png' '/images/fail@svg.svg'
); );
?> ?>

View File

@ -1921,7 +1921,7 @@ switch ($tab) {
if ((bool) $config['pure'] === false) { if ((bool) $config['pure'] === false) {
ui_print_standard_header( ui_print_standard_header(
__('Agent main view'), __('Agent main view').' ( '.strtolower(agents_get_alias($id_agente)).' )',
$icon, $icon,
false, false,
($help_header ?? ''), ($help_header ?? ''),

View File

@ -173,7 +173,7 @@ ui_print_message_dialog(
$conn_title, $conn_title,
$conn_text, $conn_text,
'connection', 'connection',
'/images/error_1.png' '/images/fail@svg.svg'
); );
$inputs = []; $inputs = [];

View File

@ -278,7 +278,7 @@ if ($layers != false) {
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.'); $conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
ui_require_javascript_file('connection_check'); ui_require_javascript_file('connection_check');
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false)); set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/error_1.png'); ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/fail@svg.svg');
} }
// Resize GIS map on fullscreen // Resize GIS map on fullscreen

View File

@ -1,21 +1,29 @@
<?php <?php
/** /**
* Network explorer * Netflow Explorer
* *
* @package Operations. * @category Netflow
* @subpackage Netflow explorer view. * @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
* *
* Pandora FMS - http://pandorafms.com * ______ ___ _______ _______ ________
* ================================================== * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas * | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list * Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 * as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* ============================================================================
*/ */
global $config; global $config;

View File

@ -101,7 +101,7 @@ $max_aggregates = (int) get_parameter('max_aggregates', 10);
$update_date = (int) get_parameter('update_date', 0); $update_date = (int) get_parameter('update_date', 0);
$connection_name = get_parameter('connection_name', ''); $connection_name = get_parameter('connection_name', '');
$interval_length = get_parameter('interval_length', NETFLOW_RES_MEDD); $interval_length = get_parameter('interval_length', NETFLOW_RES_MEDD);
$address_resolution = (int) get_parameter('address_resolution', $config['netflow_get_ip_hostname']); $address_resolution = (int) get_parameter('address_resolution', ($config['netflow_get_ip_hostname'] ?? ''));
$filter_selected = (int) get_parameter('filter_selected', 0); $filter_selected = (int) get_parameter('filter_selected', 0);
// Read time values. // Read time values.
@ -127,13 +127,23 @@ $update = get_parameter('update_button', '');
if (is_metaconsole() === false) { if (is_metaconsole() === false) {
// Header. // Header.
ui_print_page_header( ui_print_standard_header(
__('Netflow live view'), __('Netflow live view'),
'images/op_netflow.png', 'images/op_netflow.png',
false, false,
'', '',
false, false,
[] [],
[
[
'link' => '',
'label' => __('Monitoring'),
],
[
'link' => '',
'label' => __('Network'),
],
]
); );
$is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN'; $is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN';
@ -202,22 +212,9 @@ if (isset($config['netflow_disable_custom_lvfilters'])) {
$netflow_disable_custom_lvfilters = $config['netflow_disable_custom_lvfilters']; $netflow_disable_custom_lvfilters = $config['netflow_disable_custom_lvfilters'];
} }
$class = 'databox filters'; // Add nodes list.
if (is_metaconsole() === true) {
echo '<form method="post" action="'.$config['homeurl'].'index.php?sec=netf&sec2=operation/netflow/nf_live_view&pure='.$pure.'">';
echo "<table class='".$class."' width='100%'>";
if (is_metaconsole()) {
echo '<thead>
<tr>
<th align=center colspan=6>
'.__('Draw live filter').'
</th>
</tr>
</thead>';
$list_servers = []; $list_servers = [];
$servers = db_get_all_rows_sql( $servers = db_get_all_rows_sql(
'SELECT * 'SELECT *
FROM tmetaconsole_setup' FROM tmetaconsole_setup'
@ -244,62 +241,245 @@ if (is_metaconsole()) {
metaconsole_restore_db(); metaconsole_restore_db();
} }
echo '<tr>'; $nodeListInput = html_print_label_input_block(
echo '<td><b>'.__('Connection').'</b></td>'; __('Connection'),
echo '<td>'.html_print_select( html_print_select(
$list_servers, $list_servers,
'connection_name', 'connection_name',
$connection_name, $connection_name,
'',
'',
0,
true,
false,
false
)
);
} else {
$nodeListInput = '';
}
$class_not_period = ($is_period === true) ? 'nf_hidden' : 'nf_display';
$class_period = ($is_period === true) ? 'nf_display' : 'nf_hidden';
$max_values = [
'2' => '2',
'5' => '5',
'10' => '10',
'15' => '15',
'20' => '20',
'25' => '25',
'50' => '50',
$max_aggregates => $max_aggregates,
];
$aggregate_list = [];
$aggregate_list = [
'srcip' => __('Src Ip Address'),
'dstip' => __('Dst Ip Address'),
'srcport' => __('Src Port'),
'dstport' => __('Dst Port'),
];
$advanced_toggle = '<table style="width:100%">';
$advanced_toggle .= '<tr>';
if ($netflow_disable_custom_lvfilters) {
$advanced_toggle .= '<td></td>';
$advanced_toggle .= '<td></td>';
} else {
$advanced_toggle .= '<td><b>'.__('Filter').'</b></td>';
$advanced_toggle .= '<td colspan="2">'.__('Normal').' '.html_print_radio_button_extended('filter_type', 0, '', $filter_type, false, 'displayNormalFilter();', 'style="margin-right: 40px;"', true).__('Custom').' '.html_print_radio_button_extended('filter_type', 1, '', $filter_type, false, 'displayAdvancedFilter();', 'style="margin-right: 40px;"', true).'</td>';
}
$advanced_toggle .= '<td><b>'.__('Load filter').'</b></td>';
$user_groups = users_get_groups($config['id_user'], 'AR', $own_info['is_admin'], true);
$user_groups[0] = 0;
// Add all groups.
$sql = 'SELECT *
FROM tnetflow_filter
WHERE id_group IN ('.implode(',', array_keys($user_groups)).')';
$advanced_toggle .= "<td colspan='3'>".html_print_select_from_sql($sql, 'filter_id', $filter_id, '', __('Select a filter'), 0, true);
$advanced_toggle .= html_print_input_hidden('filter_selected', $filter_selected, false);
$advanced_toggle .= '</td>';
$advanced_toggle .= '</tr>';
$advanced_toggle .= "<tr class='filter_normal'>";
if ($netflow_disable_custom_lvfilters) {
$advanced_toggle .= '<td></td>';
$advanced_toggle .= '<td></td>';
} else {
$advanced_toggle .= "<td style='font-weight:bold;'>".__('Dst Ip').ui_print_help_tip(__('Destination IP. A comma separated list of destination ip. If we leave the field blank, will show all ip. Example filter by ip:<br>25.46.157.214,160.253.135.249'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_text('ip_dst', $filter['ip_dst'], false, 40, 80, true).'</td>';
}
if ($netflow_disable_custom_lvfilters) {
$advanced_toggle .= '<td></td>';
$advanced_toggle .= '<td></td>';
} else {
$advanced_toggle .= "<td style='font-weight:bold;'>".__('Src Ip').ui_print_help_tip(__('Source IP. A comma separated list of source ip. If we leave the field blank, will show all ip. Example filter by ip:<br>25.46.157.214,160.253.135.249'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_text('ip_src', $filter['ip_src'], false, 40, 80, true).'</td>';
}
$advanced_toggle .= '</tr>';
$advanced_toggle .= "<tr class='filter_normal'>";
if ($netflow_disable_custom_lvfilters) {
$advanced_toggle .= '<td></td>';
$advanced_toggle .= '<td></td>';
} else {
$advanced_toggle .= "<td style='font-weight:bold;'>".__('Dst Port').ui_print_help_tip(__('Destination port. A comma separated list of destination ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:<br>80,22'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_text('dst_port', $filter['dst_port'], false, 40, 80, true).'</td>';
}
if ($netflow_disable_custom_lvfilters) {
$advanced_toggle .= '<td></td>';
$advanced_toggle .= '<td></td>';
} else {
$advanced_toggle .= "<td style='font-weight:bold;'>".__('Src Port').ui_print_help_tip(__('Source port. A comma separated list of source ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:<br>80,22'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_text('src_port', $filter['src_port'], false, 40, 80, true).'</td>';
}
$advanced_toggle .= '</tr>';
$advanced_toggle .= "<tr class='filter_advance' style='display: none;'>";
if ($netflow_disable_custom_lvfilters) {
$advanced_toggle .= '<td></td>';
$advanced_toggle .= '<td></td>';
} else {
$advanced_toggle .= '<td>'.ui_print_help_icon('pcap_filter', true).'</td>';
$advanced_toggle .= "<td colspan='5'>".html_print_textarea('advanced_filter', 4, 40, $filter['advanced_filter'], "style='min-height: 0px; width: 90%;'", true).'</td>';
}
$advanced_toggle .= '</tr>';
$advanced_toggle .= '<tr>';
$onclick = "if (!confirm('".__('Warning').'. '.__('IP address resolution can take a lot of time')."')) return false;";
$radio_buttons = __('Yes').'&nbsp;&nbsp;'.html_print_radio_button_extended(
'address_resolution',
1,
'',
$address_resolution,
false,
$onclick,
'',
true
).'&nbsp;&nbsp;&nbsp;';
$radio_buttons .= __('No').'&nbsp;&nbsp;'.html_print_radio_button(
'address_resolution',
0,
'',
$address_resolution,
true
);
$advanced_toggle .= '<td><b>'.__('IP address resolution').'</b>'.ui_print_help_tip(__('Resolve the IP addresses to get their hostnames.'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.$radio_buttons.'</td>';
$advanced_toggle .= '<td><b>'.__('Source ip').'</b></td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_text('router_ip', $filter['router_ip'], false, 40, 80, true).'</td>';
$advanced_toggle .= '</tr>';
$advanced_toggle .= '</table>';
// Read filter type.
if (empty($filter['advanced_filter']) === false) {
$filter_type = 1;
} else {
$filter_type = 0;
}
$filterTable = new stdClass();
$filterTable->id = '';
$filterTable->class = 'filter-table-adv';
$filterTable->size = [];
$filterTable->size[0] = '33%';
$filterTable->size[1] = '33%';
$filterTable->size[2] = '33%';
$filterTable->data = [];
if (empty($nodeListInput) === false) {
$filterTable->data[-1][] = $nodeListInput;
}
$filterTable->data[0][0] = html_print_label_input_block(
__('Interval'),
html_print_extended_select_for_time(
'period',
$period,
'', '',
'', '',
0, 0,
true,
false, false,
false true
).'</td>'; ),
echo '</tr>'; [ 'div_id' => 'period_container' ]
} );
echo '<tr>'; $filterTable->data[0][0] .= html_print_label_input_block(
__('Start date'),
$class_not_period = ($is_period) ? 'nf_hidden' : 'nf_display'; html_print_div(
$class_period = ($is_period) ? 'nf_display' : 'nf_hidden';
echo '<td>';
echo '<b class="'.$class_period.'">'.__('Interval').'</b>';
echo '<b class="'.$class_not_period.'">'.__('Start date').'</b>';
echo '</td>';
echo '<td>';
echo html_print_extended_select_for_time('period', $period, '', '', 0, false, true, false, true, $class_period);
echo html_print_input_text('date_lower', $date_lower, false, 13, 10, true, false, false, '', $class_not_period);
echo html_print_image(
'images/calendar_view_day.png',
true,
[ [
'alt' => 'calendar', 'class' => '',
'class' => $class_not_period, 'content' => html_print_input_text(
] 'date_lower',
).html_print_input_text('time_lower', $time_lower, false, 10, 8, true, false, false, '', $class_not_period); $date_lower,
echo html_print_checkbox( false,
'is_period', 13,
1, 10,
($is_period === true) ? 1 : 0, true
true, ).html_print_image(
false, 'images/calendar_view_day.png',
'nf_view_click_period(event)' true,
); [
echo ui_print_help_tip(__('Select this checkbox to write interval instead a date.'), true); 'alt' => 'calendar',
echo '</td>'; 'class' => 'main_menu_icon invert_filter',
]
).html_print_input_text(
'time_lower',
$time_lower,
false,
10,
8,
true
),
],
true
),
[ 'div_id' => 'end_date_container' ]
);
echo '<td><b>'.__('End date').'</b></td>'; $filterTable->data[0][1] = html_print_label_input_block(
echo '<td>'.html_print_input_text('date', $date, false, 13, 10, true).html_print_image( __('End date'),
'images/calendar_view_day.png', html_print_div(
true, [
['alt' => 'calendar'] 'class' => '',
).html_print_input_text('time', $time, false, 10, 8, true); 'content' => html_print_input_text(
echo '</td>'; 'date',
$date,
false,
13,
10,
true
).html_print_image(
'images/calendar_view_day.png',
true,
['alt' => 'calendar']
).html_print_input_text(
'time',
$time,
false,
10,
8,
true
),
],
true
)
);
echo '<td><b>'.__('Resolution').ui_print_help_tip(__('The interval will be divided in chunks the length of the resolution.'), true).'</b></td>'; $filterTable->data[0][2] = html_print_label_input_block(
echo '<td>'.html_print_select( __('Resolution'),
html_print_select(
netflow_resolution_select_params(), netflow_resolution_select_params(),
'interval_length', 'interval_length',
$interval_length, $interval_length,
@ -309,13 +489,27 @@ if (is_metaconsole()) {
true, true,
false, false,
false false
).'</td>'; ).ui_print_input_placeholder(
__('The interval will be divided in chunks the length of the resolution.'),
true
)
);
echo '</tr>'; $filterTable->data[1][] = html_print_label_input_block(
echo '<tr>'; __('Defined period'),
html_print_checkbox_switch(
'is_period',
1,
($is_period === true) ? 1 : 0,
true,
false,
'nf_view_click_period(event)'
)
);
echo '<td><b>'.__('Type').'</b></td>'; $filterTable->data[1][] = html_print_label_input_block(
echo '<td>'.html_print_select( __('Type'),
html_print_select(
netflow_get_chart_types(), netflow_get_chart_types(),
'chart_type', 'chart_type',
$chart_type, $chart_type,
@ -323,224 +517,157 @@ if (is_metaconsole()) {
'', '',
0, 0,
true true
).'</td>'; )
);
echo '<td><b>'.__('Max. values').'</b></td>'; $filterTable->data[1][] = html_print_label_input_block(
$max_values = [ __('Aggregated by'),
'2' => '2', html_print_select(
'5' => '5', $aggregate_list,
'10' => '10', 'aggregate',
'15' => '15', $filter['aggregate'],
'20' => '20',
'25' => '25',
'50' => '50',
$max_aggregates => $max_aggregates,
];
echo '<td>'.html_print_select($max_values, 'max_aggregates', $max_aggregates, '', '', 0, true).'<a id="max_values" href="#" onclick="javascript: edit_max_value();">'.html_print_image('images/edit.svg', true, ['id' => 'pencil', 'class' => 'main_menu_icon invert_filter']).'</a>';
echo '</td>';
echo '<td><b>'.__('Aggregate by').'</b></td>';
$aggregate_list = [];
$aggregate_list = [
'srcip' => __('Src Ip Address'),
'dstip' => __('Dst Ip Address'),
'srcport' => __('Src Port'),
'dstport' => __('Dst Port'),
];
echo '<td>'.html_print_select($aggregate_list, 'aggregate', $filter['aggregate'], '', '', 0, true, false, true, '', false).'</td>';
echo '</tr>';
// Read filter type.
if ($filter['advanced_filter'] != '') {
$filter_type = 1;
} else {
$filter_type = 0;
}
echo "<tr class='filter_save' style='display: none;'>";
echo "<td colspan='6'>".ui_print_error_message('Define a name for the filter and click on Save as new filter again', '', true).'</td>';
echo '</tr>';
echo "<tr class='filter_save' style='display: none;'>";
echo '<td><span id="filter_name_color"><b>'.__('Name').'</b></span></td>';
echo "<td colspan='2'>".html_print_input_text(
'name',
$filter['id_name'],
false,
20,
80,
true
).'</td>';
$own_info = get_user_info($config['id_user']);
echo '<td><span id="filter_group_color"><b>'.__('Group').'</b></span></td>';
echo "<td colspan='2'>".html_print_select_groups($config['id_user'], 'AR', $own_info['is_admin'], 'assign_group', $filter['id_group'], '', '', -1, true, false, false).'</td>';
echo '</tr>';
$advanced_toggle = '<table style="width:100%">';
$advanced_toggle .= '<tr>';
if ($netflow_disable_custom_lvfilters) {
$advanced_toggle .= '<td></td>';
$advanced_toggle .= '<td></td>';
} else {
$advanced_toggle .= '<td><b>'.__('Filter').'</b></td>';
$advanced_toggle .= '<td colspan="2">'.__('Normal').' '.html_print_radio_button_extended('filter_type', 0, '', $filter_type, false, 'displayNormalFilter();', 'style="margin-right: 40px;"', true).__('Custom').' '.html_print_radio_button_extended('filter_type', 1, '', $filter_type, false, 'displayAdvancedFilter();', 'style="margin-right: 40px;"', true).'</td>';
}
$advanced_toggle .= '<td><b>'.__('Load filter').'</b></td>';
$user_groups = users_get_groups($config['id_user'], 'AR', $own_info['is_admin'], true);
$user_groups[0] = 0;
// Add all groups.
$sql = 'SELECT *
FROM tnetflow_filter
WHERE id_group IN ('.implode(',', array_keys($user_groups)).')';
$advanced_toggle .= "<td colspan='3'>".html_print_select_from_sql($sql, 'filter_id', $filter_id, '', __('Select a filter'), 0, true);
$advanced_toggle .= html_print_input_hidden('filter_selected', $filter_selected, false);
$advanced_toggle .= '</td>';
$advanced_toggle .= '</tr>';
$advanced_toggle .= "<tr class='filter_normal'>";
if ($netflow_disable_custom_lvfilters) {
$advanced_toggle .= '<td></td>';
$advanced_toggle .= '<td></td>';
} else {
$advanced_toggle .= "<td style='font-weight:bold;'>".__('Dst Ip').ui_print_help_tip(__('Destination IP. A comma separated list of destination ip. If we leave the field blank, will show all ip. Example filter by ip:<br>25.46.157.214,160.253.135.249'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_text('ip_dst', $filter['ip_dst'], false, 40, 80, true).'</td>';
}
if ($netflow_disable_custom_lvfilters) {
$advanced_toggle .= '<td></td>';
$advanced_toggle .= '<td></td>';
} else {
$advanced_toggle .= "<td style='font-weight:bold;'>".__('Src Ip').ui_print_help_tip(__('Source IP. A comma separated list of source ip. If we leave the field blank, will show all ip. Example filter by ip:<br>25.46.157.214,160.253.135.249'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_text('ip_src', $filter['ip_src'], false, 40, 80, true).'</td>';
}
$advanced_toggle .= '</tr>';
$advanced_toggle .= "<tr class='filter_normal'>";
if ($netflow_disable_custom_lvfilters) {
$advanced_toggle .= '<td></td>';
$advanced_toggle .= '<td></td>';
} else {
$advanced_toggle .= "<td style='font-weight:bold;'>".__('Dst Port').ui_print_help_tip(__('Destination port. A comma separated list of destination ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:<br>80,22'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_text('dst_port', $filter['dst_port'], false, 40, 80, true).'</td>';
}
if ($netflow_disable_custom_lvfilters) {
$advanced_toggle .= '<td></td>';
$advanced_toggle .= '<td></td>';
} else {
$advanced_toggle .= "<td style='font-weight:bold;'>".__('Src Port').ui_print_help_tip(__('Source port. A comma separated list of source ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:<br>80,22'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_text('src_port', $filter['src_port'], false, 40, 80, true).'</td>';
}
$advanced_toggle .= '</tr>';
$advanced_toggle .= "<tr class='filter_advance' style='display: none;'>";
if ($netflow_disable_custom_lvfilters) {
$advanced_toggle .= '<td></td>';
$advanced_toggle .= '<td></td>';
} else {
$advanced_toggle .= '<td>'.ui_print_help_icon('pcap_filter', true).'</td>';
$advanced_toggle .= "<td colspan='5'>".html_print_textarea('advanced_filter', 4, 40, $filter['advanced_filter'], "style='min-height: 0px; width: 90%;'", true).'</td>';
}
$advanced_toggle .= '</tr>';
$advanced_toggle .= '<tr>';
$onclick = "if (!confirm('".__('Warning').'. '.__('IP address resolution can take a lot of time')."')) return false;";
$radio_buttons = __('Yes').'&nbsp;&nbsp;'.html_print_radio_button_extended(
'address_resolution',
1,
'', '',
$address_resolution,
false,
$onclick,
'', '',
true
).'&nbsp;&nbsp;&nbsp;';
$radio_buttons .= __('No').'&nbsp;&nbsp;'.html_print_radio_button(
'address_resolution',
0, 0,
true,
false,
true,
'', '',
$address_resolution, false
)
);
$filterTable->data[2][] = html_print_label_input_block(
__('Max values'),
html_print_div(
[
'class' => '',
'content' => html_print_select(
$max_values,
'max_aggregates',
$max_aggregates,
'',
'',
0,
true
).html_print_anchor(
[
'id' => 'max_values',
'href' => '#',
'onClick' => 'edit_max_value()',
'content' => html_print_image(
'images/edit.svg',
true,
[
'id' => 'pencil',
'class' => 'main_menu_icon invert_filter',
]
),
],
true
),
],
true true
); )
$advanced_toggle .= '<td><b>'.__('IP address resolution').'</b>'.ui_print_help_tip(__('Resolve the IP addresses to get their hostnames.'), true).'</td>'; );
$advanced_toggle .= '<td colspan="2">'.$radio_buttons.'</td>';
$advanced_toggle .= '<td><b>'.__('Source ip').'</b></td>'; $filterTable->colspan[3][0] = 3;
$advanced_toggle .= '<td colspan="2">'.html_print_input_text('router_ip', $filter['router_ip'], false, 40, 80, true).'</td>'; $filterTable->data[3][0] = html_print_label_input_block(
'',
$advanced_toggle .= '</tr>'; ui_toggle(
$advanced_toggle .= '</table>';
echo '<tr><td colspan="6">';
echo ui_toggle(
$advanced_toggle, $advanced_toggle,
__('Advanced'), __('Advanced'),
'', '',
'', '',
true, true,
true, true,
'white_box white_box_opened', '',
'no-border flex-row' 'white-box-content',
); 'box-flat white_table_graph'
echo '</td></tr>'; )
echo '</table>'; );
echo "<table class='' width='100%' style='border: 0px; text-align:right;'><tr><td>"; $buttons = html_print_submit_button(
__('Draw'),
'draw_button',
false,
[
'icon' => 'cog',
'mode' => 'mini',
],
true
);
echo html_print_submit_button(__('Draw'), 'draw_button', false, 'class="sub upd"', true); if (!$netflow_disable_custom_lvfilters) {
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
if (!$netflow_disable_custom_lvfilters) { $buttons .= html_print_submit_button(__('Save as new filter'), 'save_button', false, ['icon' => 'load', 'onClick' => 'return defineFilterName();', 'mode' => 'mini secondary'], true);
if (check_acl($config['id_user'], 0, 'AW')) { $buttons .= html_print_submit_button(__('Update current filter'), 'update_button', false, ['icon' => 'load', 'mode' => 'mini secondary'], true);
html_print_submit_button(__('Save as new filter'), 'save_button', false, 'style="margin-left: 5px;" class="sub upd" onClick="return defineFilterName();"');
html_print_submit_button(__('Update current filter'), 'update_button', false, 'style="margin-left: 5px;" class="sub upd"');
}
} }
}
echo '</td></tr></table>'; $filterInputTable = '<form method="post" action="'.$config['homeurl'].'index.php?sec=netf&sec2=operation/netflow/nf_live_view&pure='.$pure.'">';
$filterInputTable .= html_print_table($filterTable, true);
$filterInputTable .= html_print_div(
[
'class' => 'action-buttons',
'content' => $buttons,
],
true
);
$filterInputTable .= '</form>';
echo '</form>'; ui_toggle(
$filterInputTable,
'<span class="subsection_header_title">'.__('Filter').'</span>',
__('Filter'),
'search',
true,
false,
'',
'white-box-content no_border',
'box-flat white_table_graph fixed_filter_bar'
);
if (empty($draw) === false) { if (empty($draw) === false) {
// Draw. // No filter selected.
echo '<br/>'; if ($netflow_disable_custom_lvfilters && $filter_selected == 0) {
ui_print_error_message(__('No filter selected'));
// No filter selected. } else {
if ($netflow_disable_custom_lvfilters && $filter_selected == 0) { // Hidden input for handle properly the text colors.
ui_print_error_message(__('No filter selected')); html_print_input_hidden(
} else { 'selected_style_theme',
// Hidden input for handle properly the text colors. $config['style']
html_print_input_hidden( );
'selected_style_theme', // Draw the netflow chart.
$config['style'] html_print_div(
); [
// Draw the netflow chart. 'class' => 'white_box',
echo netflow_draw_item( 'content' => netflow_draw_item(
$start_date, $start_date,
$end_date, $end_date,
$interval_length, $interval_length,
$chart_type, $chart_type,
$filter, $filter,
$max_aggregates, $max_aggregates,
$connection_name, $connection_name,
'HTML', 'HTML',
$address_resolution $address_resolution
); ),
} ]
);
} }
} else {
ui_print_info_message(__('No data to show'));
}
ui_include_time_picker(); ui_include_time_picker();
?> ?>
<style>
.parent_graph {
margin: 0 auto !important;
}
</style>
<script type="text/javascript"> <script type="text/javascript">
function edit_max_value () { function edit_max_value () {
@ -722,6 +849,8 @@ if (is_metaconsole()) {
}); });
$(document).ready( function() { $(document).ready( function() {
// Update visibility of controls.
nf_view_click_period();
// Hide update filter button // Hide update filter button
if ($("#filter_id").val() == 0) { if ($("#filter_id").val() == 0) {
$("#submit-update_button").hide(); $("#submit-update_button").hide();
@ -758,13 +887,10 @@ if (is_metaconsole()) {
$.datepicker.regional["<?php echo get_user_language(); ?>"]; $.datepicker.regional["<?php echo get_user_language(); ?>"];
function nf_view_click_period(event) { function nf_view_click_period() {
$(".nf_display").toggle(); var is_period = document.getElementById('checkbox-is_period').checked;
$(".nf_hidden").toggle();
document.getElementById('period_container').style.display = !is_period ? 'none' : 'flex';
document.getElementById('end_date_container').style.display = is_period ? 'none' : 'flex';
} }
</script> </script>
<style type="text/css">
.nf_hidden {
display: none;
}
</style>

View File

@ -1,23 +1,32 @@
<?php <?php
/** /**
* Network explorer * Netflow Report
* *
* @package Operations. * @category Netflow
* @subpackage Network explorer view. * @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
* *
* Pandora FMS - http://pandorafms.com * ______ ___ _______ _______ ________
* ================================================== * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas * | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list * Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 * as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* ============================================================================
*/ */
// Begin.
check_login(); check_login();
// ACL Check. // ACL Check.
@ -257,6 +266,7 @@ unset($table);
$table = new stdClass(); $table = new stdClass();
$table->id = ''; $table->id = '';
$table->width = '100%'; $table->width = '100%';
$table->class = 'info_table';
// Print the header. // Print the header.
$table->head = []; $table->head = [];
$table->head['main'] = __('IP'); $table->head['main'] = __('IP');
@ -385,20 +395,31 @@ if (empty($data)) {
'height' => 230, 'height' => 230,
'legend' => [ 'legend' => [
'display' => true, 'display' => true,
'position' => 'right', 'position' => 'top',
'align' => 'center', 'align' => 'left',
], ],
'labels' => $labels, 'labels' => $labels,
]; ];
// Results table.
$resultsTable = html_print_div(
[
'class' => '',
'style' => 'flex: 75;margin-right: 5px;',
'content' => html_print_table($table, true),
],
true
);
// Pie graph. // Pie graph.
html_print_div( $pieGraph = html_print_div(
[ [
'class' => 'databox netflow-pie-graph-container padding-2 white_box', 'class' => 'databox netflow-pie-graph-container padding-2 white_box',
'style' => 'flex: 25;margin-left: 5px;',
'content' => pie_graph( 'content' => pie_graph(
$chart_data, $chart_data,
$options $options
), ),
] ],
true
); );
// Print the filter remove link. // Print the filter remove link.
if (empty($main_value) === false) { if (empty($main_value) === false) {
@ -418,7 +439,13 @@ if (empty($data)) {
} }
// Print results. // Print results.
html_print_table($table); html_print_div(
[
'style' => 'max-width: -webkit-fill-available; display: flex',
'class' => '',
'content' => $resultsTable.$pieGraph,
]
);
} }
?> ?>

View File

@ -1,24 +1,32 @@
<?php <?php
/** /**
* Netflow functions * Netflow usage map.
* *
* @package Netflow usage map. * @category Netflow
* @subpackage UI. * @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
* *
* Pandora FMS - http://pandorafms.com * ______ ___ _______ _______ ________
* ================================================== * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas * | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list * Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 * as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* ============================================================================
*/ */
// Begin.
require_once $config['homedir'].'/include/functions_network.php'; require_once $config['homedir'].'/include/functions_network.php';
require_once $config['homedir'].'/include/class/NetworkMap.class.php'; require_once $config['homedir'].'/include/class/NetworkMap.class.php';
@ -26,7 +34,25 @@ global $config;
check_login(); check_login();
ui_print_page_header(__('Network usage map')); // Header.
ui_print_standard_header(
__('Network usage map'),
'images/op_netflow.png',
false,
'',
false,
[],
[
[
'link' => '',
'label' => __('Monitoring'),
],
[
'link' => '',
'label' => __('Network'),
],
]
);
// ACL Check. // ACL Check.
if (! check_acl($config['id_user'], 0, 'AR')) { if (! check_acl($config['id_user'], 0, 'AR')) {
@ -58,105 +84,180 @@ if (!$is_period) {
$top = (int) get_parameter('top', 10); $top = (int) get_parameter('top', 10);
$order_by = get_parameter('order_by', 'bytes'); $order_by = get_parameter('order_by', 'bytes');
if (!in_array($order_by, ['bytes', 'pkts', 'flows'])) { if (in_array($order_by, ['bytes', 'pkts', 'flows']) === false) {
$order_by = 'bytes'; $order_by = 'bytes';
} }
$style_end = ($is_period) ? 'display: none;' : '';
$style_period = ($is_period) ? '' : 'display: none;';
// Build the table.
$table = new stdClass();
$table->class = 'databox filters';
$table->styleTable = 'width: 100%';
$table->data['0']['0'] = '<div class="flex">';
$table->data['0']['0'] .= '<div id="end_date_container" style="'.$style_end.'">';
$table->data['0']['0'] .= __('Start date').'&nbsp;&nbsp;';
$table->data['0']['0'] .= html_print_input_text('date_lower', $date_lower, '', 10, 7, true);
$table->data['0']['0'] .= '&nbsp;&nbsp;';
$table->data['0']['0'] .= html_print_input_text('time_lower', $time_lower, '', 7, 8, true);
$table->data['0']['0'] .= '</div>';
$table->data['0']['0'] .= '<div id="period_container" style="'.$style_period.'">';
$table->data['0']['0'] .= __('Time Period').'&nbsp;&nbsp;';
$table->data['0']['0'] .= html_print_extended_select_for_time('period', $period, '', '', 0, false, true);
$table->data['0']['0'] .= '</div>';
$table->data['0']['0'] .= html_print_checkbox(
'is_period',
1,
($is_period === true) ? 1 : 0,
true,
false,
'network_report_click_period(event)'
);
$table->data['0']['0'] .= ui_print_help_tip(
__('Select this checkbox to write interval instead a date.'),
true
);
$table->data['0']['0'] .= '</div>';
$table->data['0']['1'] = __('End date').'&nbsp;&nbsp;';
$table->data['0']['1'] .= html_print_input_text('date_greater', $date_greater, '', 10, 7, true);
$table->data['0']['1'] .= '&nbsp;&nbsp;';
$table->data['0']['1'] .= html_print_input_text('time_greater', $time_greater, '', 7, 8, true);
$table->data['0']['2'] = __('Number of result to show').'&nbsp;&nbsp;';
$table->data['0']['2'] .= html_print_select(
[
'5' => 5,
'10' => 10,
'15' => 15,
'20' => 20,
'25' => 25,
'50' => 50,
'100' => 100,
'250' => 250,
],
'top',
$top,
'',
'',
0,
true
);
$table->data['1']['0'] = __('Data to show').'&nbsp;&nbsp;';
$table->data['1']['0'] .= html_print_select(
network_get_report_actions(),
'action',
$action,
'',
'',
0,
true
);
$table->data['1']['1'] = '';
$netflow_button = '';
if ((bool) $config['activate_netflow'] === true) { if ((bool) $config['activate_netflow'] === true) {
$netflow_button = html_print_submit_button( $netflow_button = html_print_submit_button(
__('Show netflow map'), __('Show netflow map'),
'update_netflow', 'update_netflow',
false, false,
'class="sub upd"', ['icon' => 'update'],
true true
); );
} else {
$netflow_button = '';
} }
$table->data['1']['2'] .= implode(
'&nbsp;&nbsp;', $filterTable = new stdClass();
[$netflow_button] $filterTable->id = '';
$filterTable->class = 'filter-table-adv';
$filterTable->size = [];
$filterTable->size[0] = '33%';
$filterTable->size[1] = '33%';
$filterTable->size[2] = '33%';
$filterTable->data = [];
$filterTable->data[0][0] = html_print_label_input_block(
__('Interval'),
html_print_extended_select_for_time(
'period',
$period,
'',
'',
0,
false,
true
),
[ 'div_id' => 'period_container' ]
); );
echo '<form method="post">'; $filterTable->data[0][0] .= html_print_label_input_block(
html_print_input_hidden('order_by', $order_by); __('Start date'),
html_print_div(
[
'class' => '',
'content' => html_print_input_text(
'date_lower',
$date_lower,
false,
13,
10,
true
).html_print_image(
'images/calendar_view_day.png',
true,
[
'alt' => 'calendar',
'class' => 'main_menu_icon invert_filter',
]
).html_print_input_text(
'time_lower',
$time_lower,
false,
10,
8,
true
),
],
true
),
[ 'div_id' => 'end_date_container' ]
);
html_print_table($table); $filterTable->data[0][1] = html_print_label_input_block(
echo '</form>'; __('End date'),
html_print_div(
[
'content' => html_print_input_text(
'date',
$date_greater,
false,
13,
10,
true
).html_print_image(
'images/calendar_view_day.png',
true,
['alt' => 'calendar']
).html_print_input_text(
'time',
$time_greater,
false,
10,
8,
true
),
],
true
)
);
$filterTable->data[0][2] = html_print_label_input_block(
__('Defined period'),
html_print_checkbox_switch(
'is_period',
1,
($is_period === true) ? 1 : 0,
true,
false,
'nf_view_click_period()'
)
);
$filterTable->data[1][] = html_print_label_input_block(
__('Results to show'),
html_print_select(
[
'5' => 5,
'10' => 10,
'15' => 15,
'20' => 20,
'25' => 25,
'50' => 50,
'100' => 100,
'250' => 250,
],
'top',
$top,
'',
'',
0,
true
)
);
$filterTable->data[1][] = html_print_label_input_block(
__('Data to show'),
html_print_select(
network_get_report_actions(),
'action',
$action,
'',
'',
0,
true
)
);
$filterInputTable = '<form method="POST">';
$filterInputTable .= html_print_input_hidden('order_by', $order_by);
$filterInputTable .= html_print_table($filterTable, true);
$filterInputTable .= html_print_div(
[
'class' => 'action-buttons',
'content' => $netflow_button,
],
true
);
$filterInputTable .= '</form>';
ui_toggle(
$filterInputTable,
'<span class="subsection_header_title">'.__('Filter').'</span>',
__('Filter'),
'search',
true,
false,
'',
'white-box-content no_border',
'box-flat white_table_graph fixed_filter_bar'
);
$has_data = false; $has_data = false;
$first_load = true;
if ((bool) get_parameter('update_netflow') === true) { if ((bool) get_parameter('update_netflow') === true) {
$map_data = netflow_build_map_data( $map_data = netflow_build_map_data(
$utimestamp_lower, $utimestamp_lower,
@ -165,18 +266,27 @@ if ((bool) get_parameter('update_netflow') === true) {
($action === 'talkers') ? 'srcip' : 'dstip' ($action === 'talkers') ? 'srcip' : 'dstip'
); );
$has_data = !empty($map_data['nodes']); $has_data = !empty($map_data['nodes']);
$first_load = false;
} }
if ($has_data === true) { if ($has_data === true) {
$map_manager = new NetworkMap($map_data); $map_manager = new NetworkMap($map_data);
$map_manager->printMap(); $map_manager->printMap();
} else if (!$first_load) { } else {
ui_print_info_message(__('No data retrieved')); ui_print_info_message(__('No data to show'));
} }
?> ?>
<style>
.networkconsole {
min-height: calc(100vh - 280px) !important;
}
</style>
<script> <script>
$(document).ready(function(){
nf_view_click_period();
}
);
// Configure jQuery timepickers. // Configure jQuery timepickers.
$("#text-time_lower, #text-time_greater").timepicker({ $("#text-time_lower, #text-time_greater").timepicker({
showSecond: true, showSecond: true,
@ -193,16 +303,13 @@ $("#text-time_lower, #text-time_greater").timepicker({
$("#text-date_lower, #text-date_greater").datepicker({dateFormat: "<?php echo DATE_FORMAT_JS; ?>"}); $("#text-date_lower, #text-date_greater").datepicker({dateFormat: "<?php echo DATE_FORMAT_JS; ?>"});
$.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]); $.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]);
function network_report_click_period(event) { function nf_view_click_period() {
var is_period = document.getElementById(event.target.id).checked; var is_period = document.getElementById('checkbox-is_period').checked;
document.getElementById('period_container').style.display = !is_period document.getElementById('period_container').style.display = !is_period ? 'none' : 'flex';
? 'none' document.getElementById('end_date_container').style.display = is_period ? 'none' : 'flex';
: 'block';
document.getElementById('end_date_container').style.display = is_period
? 'none'
: 'block';
} }
</script> </script>
<style type="text/css"> <style type="text/css">
tspan { tspan {

View File

@ -57,16 +57,18 @@ if ($config['pure']) {
).'</a>'; ).'</a>';
} }
// List if ($config['pure'] === false) {
$list = []; // List.
$list['text'] = '<a href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_view&pure='.$config['pure'].'&refresh='.$refr.'">'.html_print_image( $list = [];
'images/SNMP-network-numeric-data@svg.svg', $list['text'] = '<a href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_view&pure='.$config['pure'].'&refresh='.$refr.'">'.html_print_image(
true, 'images/SNMP-network-numeric-data@svg.svg',
[ true,
'title' => __('List'), [
'class' => 'main_menu_icon invert_filter', 'title' => __('List'),
] 'class' => 'main_menu_icon invert_filter',
).'</a>'; ]
).'</a>';
}
// Statistics (This file) // Statistics (This file)
$statistics = []; $statistics = [];
@ -165,10 +167,9 @@ $water_mark = [
// By SOURCE // By SOURCE
$table_source = new StdClass(); $table_source = new StdClass();
$table_source->width = '100%'; $table_source->width = '100%';
$table_source->class = 'databox data'; $table_source->class = 'info_table';
$table_source->head[] = __('Traps received by source').' - '.sprintf(__('Top %d'), 25); $table_source->head[] = __('Traps received by source').' - '.sprintf(__('Top %d'), 25);
$table_source->head_colspan[] = 2; $table_source->head_colspan[] = 2;
$table_source->headstyle[] = 'background-color: #82b92e';
$table_source->size = []; $table_source->size = [];
$table_source->size['table'] = '50%'; $table_source->size['table'] = '50%';
$table_source->size['graph'] = '50%'; $table_source->size['graph'] = '50%';
@ -182,6 +183,7 @@ $table_source_data->head = [];
$table_source_data->head['source'] = __('Source IP'); $table_source_data->head['source'] = __('Source IP');
$table_source_data->head['num'] = __('Number'); $table_source_data->head['num'] = __('Number');
$table_source_data->data = []; $table_source_data->data = [];
$table_source_data->class = 'info_table';
$table_source_graph_data = []; $table_source_graph_data = [];
$labels = []; $labels = [];
@ -239,9 +241,9 @@ unset($table_source);
// By OID // By OID
$table_oid = new StdClass(); $table_oid = new StdClass();
$table_oid->width = '100%'; $table_oid->width = '100%';
$table_oid->class = 'info_table';
$table_oid->head[] = __('Traps received by Enterprise String').' - '.sprintf(__('Top %d'), 25); $table_oid->head[] = __('Traps received by Enterprise String').' - '.sprintf(__('Top %d'), 25);
$table_oid->head_colspan[] = 2; $table_oid->head_colspan[] = 2;
$table_oid->headstyle[] = 'background-color: #82b92e';
$table_oid->size = []; $table_oid->size = [];
$table_oid->size['table'] = '50%'; $table_oid->size['table'] = '50%';
$table_oid->size['graph'] = '50%'; $table_oid->size['graph'] = '50%';
@ -255,6 +257,7 @@ $table_oid_data->head = [];
$table_oid_data->head['oid'] = __('Trap Enterprise String'); $table_oid_data->head['oid'] = __('Trap Enterprise String');
$table_oid_data->head['num'] = __('Number'); $table_oid_data->head['num'] = __('Number');
$table_oid_data->data = []; $table_oid_data->data = [];
$table_oid_data->class = 'info_table';
$table_oid_graph_data = []; $table_oid_graph_data = [];
$labels = []; $labels = [];

View File

@ -56,7 +56,7 @@ ui_require_javascript_file('connection_check', 'include/javascript/', true);
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false)); set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
$conn_title = __('Connection with server has been lost'); $conn_title = __('Connection with server has been lost');
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.'); $conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/error_1.png'); ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/fail@svg.svg');
require_once 'include/functions_visual_map.php'; require_once 'include/functions_visual_map.php';

View File

@ -37,7 +37,7 @@ ui_require_javascript_file('connection_check', 'include/javascript/', true);
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false)); set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
$conn_title = __('Connection with server has been lost'); $conn_title = __('Connection with server has been lost');
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.'); $conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/error_1.png'); ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/fail@svg.svg');
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n"; echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";
echo '<html xmlns="http://www.w3.org/1999/xhtml">'."\n"; echo '<html xmlns="http://www.w3.org/1999/xhtml">'."\n";

View File

@ -286,6 +286,9 @@ class FontVariables
"unbatang" => [/* Korean */ "unbatang" => [/* Korean */
'R' => "UnBatang_0613.ttf", 'R' => "UnBatang_0613.ttf",
], ],
"lato" => [/* lato */
'R' => 'Lato-Regular.ttf',
],
], ],
// Add fonts to this array if they contain characters in the SIP or SMP Unicode planes // Add fonts to this array if they contain characters in the SIP or SMP Unicode planes
@ -296,6 +299,7 @@ class FontVariables
"dejavuserifcondensed", "dejavuserifcondensed",
"dejavuserif", "dejavuserif",
"dejavusansmono", "dejavusansmono",
"lato",
], ],
// These next 3 arrays do two things: // These next 3 arrays do two things:
@ -321,6 +325,8 @@ class FontVariables
'mono_fonts' => ['dejavusansmono', 'mono', 'monospace', 'freemono', 'liberationmono', 'courier', 'ocrb', 'ocr-b', 'lucidaconsole', 'mono_fonts' => ['dejavusansmono', 'mono', 'monospace', 'freemono', 'liberationmono', 'courier', 'ocrb', 'ocr-b', 'lucidaconsole',
'couriernew', 'monotypecorsiva' 'couriernew', 'monotypecorsiva'
], ],
'lato' => ['lato'],
]; ];
} }

View File

@ -468,6 +468,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
var $serif_fonts; var $serif_fonts;
var $mono_fonts; var $mono_fonts;
var $defaultSubsFont; var $defaultSubsFont;
var $lato;
// List of ALL available CJK fonts (incl. styles) (Adobe add-ons) hw removed // List of ALL available CJK fonts (incl. styles) (Adobe add-ons) hw removed
var $available_CJK_fonts; var $available_CJK_fonts;
@ -1478,15 +1479,31 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
$default_font = $this->defaultCSS['BODY']['FONT-FAMILY']; $default_font = $this->defaultCSS['BODY']['FONT-FAMILY'];
} }
} }
if ($default_font) {
$this->SetDefaultFont($default_font);
}
if (!$default_font_size) { if (!$default_font_size) {
$mmsize = $this->sizeConverter->convert($this->defaultCSS['BODY']['FONT-SIZE']); $mmsize = $this->sizeConverter->convert($this->defaultCSS['BODY']['FONT-SIZE']);
$default_font_size = $mmsize * (Mpdf::SCALE); $default_font_size = $mmsize * (Mpdf::SCALE);
} }
if ($default_font) { if ($_SESSION['font_size_report']) {
$this->SetDefaultFont($default_font); // DefaultCss.
} $this->defaultCSS['BODY']['FONT-SIZE'] = $_SESSION['font_size_report'].'px';
if ($default_font_size) { $this->defaultCSS['TABLE']['FONT-SIZE'] = $_SESSION['font_size_report'].'pt';
$this->defaultCSS['THEAD']['FONT-SIZE'] = $_SESSION['font_size_report'].'pt';
$this->defaultCSS['TH']['FONT-SIZE'] = $_SESSION['font_size_report'].'pt';
$this->defaultCSS['TD']['FONT-SIZE'] = $_SESSION['font_size_report'].'pt';
// CssManager.
$this->cssManager->CSS['BODY']['FONT-SIZE'] = $_SESSION['font_size_report'].'px';
$this->cssManager->CSS['TABLE']['FONT-SIZE'] = $_SESSION['font_size_report'].'pt';
$this->cssManager->CSS['THEAD']['FONT-SIZE'] = $_SESSION['font_size_report'].'pt';
$this->cssManager->CSS['TH']['FONT-SIZE'] = $_SESSION['font_size_report'].'pt';
$this->cssManager->CSS['TD']['FONT-SIZE'] = $_SESSION['font_size_report'].'pt';
} elseif ($default_font_size) {
$this->SetDefaultFontSize($default_font_size); $this->SetDefaultFontSize($default_font_size);
} }

View File

@ -92,7 +92,7 @@ if (empty($dashboards) === true) {
$table->style['full_screen'] = 'text-align: center;'; $table->style['full_screen'] = 'text-align: center;';
$table->size = []; $table->size = [];
$table->size['name'] = '75%'; $table->size['name'] = '40%';
$table->size['full_screen'] = '30px'; $table->size['full_screen'] = '30px';
$table->head = []; $table->head = [];