';
- echo "".__('Agents').' / '.__('Modules').' | ';
+ echo "".__('Agents').' / '.__('Modules').' | ';
if ($hor_offset > 0) {
$new_hor_offset = ($hor_offset - $block);
@@ -804,7 +887,20 @@ function mainAgentsModules()
// Prepare pagination.
$url = 'index.php?extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&save_serialize=1&hor_offset='.$hor_offset.'&selection_a_m='.$selection_a_m;
- ui_pagination($total_pagination, $url);
+ $tablePagination = ui_pagination(
+ $total_pagination,
+ $url,
+ 0,
+ 0,
+ true,
+ 'offset',
+ false
+ );
+
+ html_print_action_buttons(
+ '',
+ [ 'right_content' => $tablePagination ]
+ );
foreach ($agents as $agent) {
// Get stats for this group.
diff --git a/pandora_console/extensions/api_checker.php b/pandora_console/extensions/api_checker.php
index 6b4dcf4d72..2ffc5ef6c8 100755
--- a/pandora_console/extensions/api_checker.php
+++ b/pandora_console/extensions/api_checker.php
@@ -301,10 +301,21 @@ function extension_api_checker()
html_print_table($table3);
echo '';
- echo "";
html_print_input_hidden('api_execute', 1);
- html_print_submit_button(__('Call'), 'submit', false, 'class="sub next"');
- echo '
';
+
+ html_print_div(
+ [
+ 'class' => 'action-buttons',
+ 'content' => html_print_submit_button(
+ __('Call'),
+ 'submit',
+ false,
+ [ 'icon' => 'next' ],
+ true
+ ),
+ ]
+ );
+
echo '';
if ($api_execute === true) {
diff --git a/pandora_console/extensions/db_status.php b/pandora_console/extensions/db_status.php
index 638d795b31..98b95783be 100755
--- a/pandora_console/extensions/db_status.php
+++ b/pandora_console/extensions/db_status.php
@@ -67,11 +67,20 @@ function extension_db_status()
html_print_table($table);
echo '';
- echo "";
- html_print_input_hidden('db_status_execute', 1);
- html_print_submit_button(__('Execute Test'), 'submit', false, 'class="sub next"');
- echo '
';
+ html_print_div(
+ [
+ 'class' => 'action-buttons',
+ 'content' => html_print_submit_button(
+ __('Execute Test'),
+ 'submit',
+ false,
+ [ 'icon' => 'cog' ],
+ true
+ ),
+ ]
+ );
+ html_print_input_hidden('db_status_execute', 1);
echo '';
if ($db_status_execute) {
diff --git a/pandora_console/extensions/dbmanager.php b/pandora_console/extensions/dbmanager.php
index 3f36935e5c..ffcc2fdb72 100644
--- a/pandora_console/extensions/dbmanager.php
+++ b/pandora_console/extensions/dbmanager.php
@@ -76,10 +76,6 @@ function dbmgr_extension_main()
global $config;
- if (is_metaconsole() === true) {
- open_meta_frame();
- }
-
if (!is_user_admin($config['id_user'])) {
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
@@ -92,7 +88,21 @@ function dbmgr_extension_main()
$sql = (string) get_parameter('sql');
$node_id = (int) get_parameter('node_id', -1);
- ui_print_page_header(__('Database interface'), 'images/gm_db.png', false, false, true);
+ // Header.
+ ui_print_standard_header(
+ __('Database interface'),
+ 'images/gm_db.png',
+ false,
+ '',
+ true,
+ [],
+ [
+ [
+ 'link' => '',
+ 'label' => __('Extensions'),
+ ],
+ ]
+ );
if (is_metaconsole() === true) {
$img = '../../images/warning_modern.png';
@@ -195,15 +205,18 @@ function dbmgr_extension_main()
);
}
- $data[4][2] = '';
- $data[4][2] .= html_print_submit_button(
- __('Execute SQL'),
- '',
- false,
- 'class="sub next"',
- true
+ $data[4][2] = html_print_div(
+ [
+ 'class' => 'action-buttons',
+ 'content' => html_print_submit_button(
+ __('Execute SQL'),
+ '',
+ false,
+ [ 'icon' => 'cog' ],
+ true
+ ),
+ ]
);
- $data[4][2] .= '
';
$table->data = $data;
html_print_table($table);
@@ -282,10 +295,6 @@ function dbmgr_extension_main()
html_print_table($table);
echo '';
- if (is_metaconsole()) {
- close_meta_frame();
- }
-
}
diff --git a/pandora_console/extensions/files_repo/files_repo_list.php b/pandora_console/extensions/files_repo/files_repo_list.php
index 783e155dc4..6c75218d18 100644
--- a/pandora_console/extensions/files_repo/files_repo_list.php
+++ b/pandora_console/extensions/files_repo/files_repo_list.php
@@ -98,7 +98,7 @@ if (!empty($files)) {
// Last modification
// Public URL
$data[4] = '';
- $table->cellclass[][4] = 'action_buttons';
+ $table->cellclass[][4] = 'table_action_buttons';
if (!empty($file['hash'])) {
$public_url = ui_get_full_url(
EXTENSIONS_DIR.'/files_repo/files_repo_get_file.php?file='.$file['hash']
diff --git a/pandora_console/extensions/insert_data.php b/pandora_console/extensions/insert_data.php
index 54306ac5d7..3ccf1af688 100644
--- a/pandora_console/extensions/insert_data.php
+++ b/pandora_console/extensions/insert_data.php
@@ -1,16 +1,32 @@
'',
+ 'label' => __('Resources'),
+ ],
+ [
+ 'link' => '',
+ 'label' => __('Insert Data'),
+ ],
+ ]
+ );
if (! check_acl($config['id_user'], 0, 'AW') && ! is_user_admin($config['id_user'])) {
db_pandora_audit(
@@ -84,6 +117,13 @@ function mainInsertData()
$csv = false;
}
+ ui_print_warning_message(
+ sprintf(
+ __('Please check that the directory "%s" is writeable by the apache user.
The CSV file format is date;value<newline>date;value<newline>... The date in CSV is in format Y/m/d H:i:s.'),
+ $config['remote_config']
+ )
+ );
+
if ($save) {
if (!check_acl($config['id_user'], agents_get_agent_group($agent_id), 'AW')) {
ui_print_error_message(__('You haven\'t privileges for insert data in the agent.'));
@@ -140,27 +180,25 @@ function mainInsertData()
}
}
- echo '';
- echo sprintf(
- __('Please check that the directory "%s" is writeable by the apache user.
The CSV file format is date;value<newline>date;value<newline>... The date in CSV is in format Y/m/d H:i:s.'),
- $config['remote_config']
- );
- echo '
';
+ $modules = [];
+ if ($agent_id > 0) {
+ $modules = agents_get_modules($agent_id, false, ['delete_pending' => 0]);
+ }
$table = new stdClass();
- $table->width = '100%';
- $table->class = 'databox filters';
+ $table->class = 'databox filter-table-adv';
$table->style = [];
- $table->style[0] = 'font-weight: bolder;';
-
+ $table->cellstyle[0][0] = 'width: 0';
+ $table->cellstyle[0][1] = 'width: 0';
$table->data = [];
-
- $table->data[0][0] = __('Agent');
+ $table->data[0][0] = '';
+ $table->data[0][1] = '';
+ $table->data[0][2] = '';
$params = [];
$params['return'] = true;
$params['show_helptip'] = true;
$params['input_name'] = 'agent_name';
- $params['value'] = $agent_name;
+ $params['value'] = ($save === true) ? '' : $agent_name;
$params['javascript_is_function_select'] = true;
$params['javascript_name_function_select'] = 'custom_select_function';
$params['javascript_code_function_select'] = '';
@@ -170,18 +208,12 @@ function mainInsertData()
$params['hidden_input_idagent_name'] = 'agent_id';
$params['hidden_input_idagent_value'] = $agent_id;
- $table->data[0][1] = ui_print_agent_autocomplete_input($params);
-
- $table->data[1][0] = __('Module');
- $modules = [];
- if ($agent_id) {
- $modules = agents_get_modules($agent_id, false, ['delete_pending' => 0]);
- }
+ $table->data[1][0] = html_print_div(['class' => 'flex flex-items-center', 'content' => ui_print_agent_autocomplete_input($params)], true);
$table->data[1][1] = html_print_select(
$modules,
'id_agent_module',
- $id_agent_module,
+ ($save === true) ? '' : $id_agent_module,
true,
__('Select'),
0,
@@ -191,22 +223,45 @@ function mainInsertData()
'',
empty($agent_id)
);
- $table->data[2][0] = __('Data');
- $table->data[2][1] = html_print_input_text('data', $data, __('Data'), 40, 60, true);
- $table->data[3][0] = __('Date');
- $table->data[3][1] = html_print_input_text('date', $date, '', 11, 11, true).' ';
- $table->data[3][1] .= html_print_input_text('time', $time, '', 7, 7, true);
- $table->data[4][0] = __('CSV');
- $table->data[4][1] = html_print_input_file('csv', true);
+ $table->data[1][2] = html_print_input_text('data', ($save === true) ? date(DATE_FORMAT) : $data, __('Data'), 10, 60, true);
+ $table->data[1][2] .= ' ';
+ $table->data[1][2] .= html_print_input_text('time', ($save === true) ? date(TIME_FORMAT) : $time, '', 10, 7, true);
+
+ $table->data[2][0] = '';
+ $table->data[2][1] = '';
+ $table->data[3][0] = html_print_input_text(
+ 'data',
+ $data,
+ __('Data'),
+ 40,
+ 60,
+ true
+ );
+ $table->data[3][1] = html_print_div(
+ [
+ 'class' => '',
+ 'content' => html_print_input_file('csv', true),
+ ],
+ true
+ );
echo "';
@@ -257,8 +312,8 @@ function mainInsertData()
$('#id_agent_module').enable();
$('#id_agent_module').fadeIn ('normal');
- $('#submit-submit').enable();
- $('#submit-submit').fadeIn ('normal');
+ $('button [name="submit"]').removeClass('disabled_action_button');
+ $('button [name="submit"]').fadeIn ('normal');
}
});
}
diff --git a/pandora_console/extensions/module_groups.php b/pandora_console/extensions/module_groups.php
index a04e6a08dc..e554b34b51 100644
--- a/pandora_console/extensions/module_groups.php
+++ b/pandora_console/extensions/module_groups.php
@@ -266,24 +266,68 @@ function mainModuleGroups()
]
);
- echo "';
+ $output .= html_print_div(
+ [
+ 'class' => 'action-buttons',
+ 'content' => html_print_submit_button(
+ __('Filter'),
+ 'srcbutton',
+ false,
+ [
+ 'icon' => 'search',
+ 'mode' => 'mini',
+ ],
+ true
+ ),
+ ],
+ true
+ );
+
+ $output .= '';
+
+ ui_toggle(
+ $output,
+ '',
+ 'filter_form',
+ '',
+ true,
+ false,
+ '',
+ 'white-box-content',
+ 'box-flat white_table_graph fixed_filter_bar'
+ );
$cell_style = '
min-width: 60px;
@@ -299,26 +343,35 @@ function mainModuleGroups()
if ($info && $array_module_group) {
$table = new StdClass();
- $table->style[0] = 'color: #ffffff; background-color: #373737; font-weight: bolder; min-width: 230px;';
+ $table->class = 'info_table';
+ $table->style[0] = 'font-weight: bolder; min-width: 230px;';
$table->width = '100%';
- if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
- $background_color = '#333';
- } else {
- $background_color = '#fff';
- }
-
$head[0] = __('Groups');
$headstyle[0] = 'width: 20%; font-weight: bolder;';
foreach ($array_module_group as $key => $value) {
- $headstyle[] = 'min-width: 60px;max-width: 5%;text-align:center; color: #ffffff; background-color: #373737; font-weight: bolder;';
- $head[] = ui_print_truncate_text($value, GENERIC_SIZE_TEXT, true, true, true, '…', 'color:#FFF');
+ $headstyle[] = 'min-width: 60px;max-width: 5%;text-align:center; font-weight: bolder;';
+ $head[] = ui_print_truncate_text(
+ $value,
+ GENERIC_SIZE_TEXT,
+ true,
+ true,
+ true,
+ '…'
+ );
}
$i = 0;
foreach ($array_for_defect as $key => $value) {
$deep = groups_get_group_deep($key);
- $data[$i][0] = $deep.ui_print_truncate_text($value['data']['name'], GENERIC_SIZE_TEXT, true, true, true, '…', 'color:#FFF');
+ $data[$i][0] = $deep.ui_print_truncate_text(
+ $value['data']['name'],
+ GENERIC_SIZE_TEXT,
+ true,
+ true,
+ true,
+ '…'
+ );
$j = 1;
if (isset($array_data[$key])) {
foreach ($value['gm'] as $k => $v) {
@@ -378,25 +431,37 @@ function mainModuleGroups()
$table->headstyle = $headstyle;
$table->data = $data;
- ui_pagination($counter);
-
echo "";
html_print_table($table);
echo '
';
- ui_pagination($counter);
+ $tablePagination = ui_pagination(
+ $counter,
+ false,
+ 0,
+ 0,
+ true,
+ 'offset',
+ false
+ );
- echo "";
- echo '
';
- echo "".__('Legend').' |
';
- echo " | ".__('Orange cell when the module group and agent have at least one alarm fired.').' |
';
- echo " | ".__('Red cell when the module group and agent have at least one module in critical status and the others in any status').' |
';
- echo " | ".__('Yellow cell when the module group and agent have at least one in warning status and the others in grey or green status').' |
';
- echo " | ".__('Grey cell when the module group and agent have at least one in unknown status and the others in green status').' |
';
- echo " | ".__('Green cell when the module group and agent have all modules in OK status').' |
';
- echo " | ".__('Blue cell when the module group and agent have all modules in not init status.').' |
';
- echo '
';
- echo '
';
+ html_print_action_buttons(
+ '',
+ [ 'right_content' => $tablePagination ]
+ );
+
+ $show_legend = '';
+ $show_legend .= '
';
+ $show_legend .= " | ".__('Orange cell when the module group and agent have at least one alarm fired.').' |
';
+ $show_legend .= " | ".__('Red cell when the module group and agent have at least one module in critical status and the others in any status').' |
';
+ $show_legend .= " | ".__('Yellow cell when the module group and agent have at least one in warning status and the others in grey or green status').' |
';
+ $show_legend .= " | ".__('Grey cell when the module group and agent have at least one in unknown status and the others in green status').' |
';
+ $show_legend .= " | ".__('Green cell when the module group and agent have all modules in OK status').' |
';
+ $show_legend .= " | ".__('Blue cell when the module group and agent have all modules in not init status.').' |
';
+ $show_legend .= '
';
+ $show_legend .= '
';
+
+ ui_toggle($show_legend, __('Legend'));
} else {
ui_print_info_message(['no_close' => true, 'message' => __('This table shows in columns the modules group and in rows agents group. The cell shows all modules') ]);
ui_print_info_message(['no_close' => true, 'message' => __('There are no defined groups or module groups') ]);
diff --git a/pandora_console/extensions/quick_shell.php b/pandora_console/extensions/quick_shell.php
index 7cbb5607e1..9182380a95 100644
--- a/pandora_console/extensions/quick_shell.php
+++ b/pandora_console/extensions/quick_shell.php
@@ -151,7 +151,7 @@ function quickShell()
'name' => 'submit',
'label' => __('Retry'),
'type' => 'submit',
- 'attributes' => 'class="sub next"',
+ 'attributes' => ['icon' => 'next'],
'return' => true,
],
],
@@ -202,7 +202,7 @@ function quickShell()
'arguments' => [
'type' => 'submit',
'label' => __('Connect'),
- 'attributes' => 'class="sub next"',
+ 'attributes' => ['icon' => 'cog'],
],
],
],
@@ -544,7 +544,7 @@ if (empty($agent_id) === false
// TabName.
__('QuickShell'),
// TabIcon.
- 'images/ehorus/terminal.png',
+ 'images/quick-shell@svg.svg',
// TabFunction.
'quickShell',
// Version.
diff --git a/pandora_console/extensions/realtime_graphs.php b/pandora_console/extensions/realtime_graphs.php
index 8f978f0fac..133af5b3f8 100644
--- a/pandora_console/extensions/realtime_graphs.php
+++ b/pandora_console/extensions/realtime_graphs.php
@@ -74,61 +74,11 @@ function pandora_realtime_graphs()
);
}
- $chart[time()]['graph'] = '0';
- $interactive_graph = true;
- $color = [];
- $legend = '';
- $long_index = [];
- $no_data_image = '';
-
- $canvas = '';
- $canvas .= '
';
-
- $width = 800;
- $height = 300;
-
- $data_array['realtime']['data'][0][0] = (time() - 10);
- $data_array['realtime']['data'][0][1] = 0;
- $data_array['realtime']['data'][1][0] = time();
- $data_array['realtime']['data'][1][1] = 0;
- $data_array['realtime']['color'] = 'green';
-
- $params = [
- 'agent_module_id' => false,
- 'period' => 300,
- 'width' => $width,
- 'height' => $height,
- 'unit' => $unit,
- 'only_image' => $only_image,
- 'homeurl' => $homeurl,
- 'type_graph' => 'area',
- 'font' => $config['fontpath'],
- 'font-size' => $config['font_size'],
- 'array_data_create' => $data_array,
- 'show_legend' => false,
- 'show_menu' => false,
- ];
-
- $canvas .= grafico_modulo_sparse($params);
-
- $canvas .= '
';
- echo $canvas;
-
$table = new stdClass();
$table->width = '100%';
$table->id = 'table-form';
- $table->class = 'databox filters';
+ $table->class = 'filter-table-adv';
$table->style = [];
- $table->cellpadding = '0';
- $table->cellspacing = '0';
- $table->style['graph'] = 'font-weight: bold;';
- $table->style['refresh'] = 'font-weight: bold;';
- $table->style['incremental'] = 'font-weight: bold;';
- $table->style['reset'] = 'font-weight: bold;';
- $table->style['snmp_address'] = 'font-weight: bold;';
- $table->style['snmp_community'] = 'font-weight: bold;';
- $table->style['snmp_oid'] = 'font-weight: bold;';
- $table->style['snmp_oid'] = 'font-weight: bold;';
$table->data = [];
$graph_fields['cpu_load'] = __('%s Server CPU', get_product_name());
@@ -158,15 +108,22 @@ function pandora_realtime_graphs()
$refresh = get_parameter('refresh', '1000');
if ($graph != 'snmp_module') {
- $data['graph'] = __('Graph').' ';
- $data['graph'] .= html_print_select(
- $graph_fields,
- 'graph',
- $graph,
- '',
- '',
- 0,
- true
+ $data['graph'] = html_print_label_input_block(
+ __('Graph'),
+ html_print_select(
+ $graph_fields,
+ 'graph',
+ $graph,
+ '',
+ '',
+ 0,
+ true,
+ false,
+ true,
+ '',
+ false,
+ 'width: 100%'
+ )
);
}
@@ -179,18 +136,35 @@ function pandora_realtime_graphs()
$agent_alias = io_safe_output(get_parameter('agent_alias', ''));
$module_name = io_safe_output(get_parameter('module_name', ''));
$module_incremental = get_parameter('incremental', 0);
- $data['module_info'] = $agent_alias.': '.$module_name.'';
-
- // Append all the hidden in this cell.
- $data['module_info'] .= html_print_input_hidden(
- 'incremental',
- $module_incremental,
- true
+ $data['module_info'] = html_print_label_input_block(
+ $agent_alias.': '.$module_name,
+ html_print_input_hidden(
+ 'incremental',
+ $module_incremental,
+ true
+ ).html_print_select(
+ ['snmp_module' => '-'],
+ 'graph',
+ 'snmp_module',
+ '',
+ '',
+ 0,
+ true,
+ false,
+ true,
+ '',
+ false,
+ 'width: 100%; display: none;'
+ )
);
- $data['module_info'] .= html_print_select(
- ['snmp_module' => '-'],
- 'graph',
- 'snmp_module',
+ }
+
+ $data['refresh'] = html_print_label_input_block(
+ __('Refresh interval'),
+ html_print_select(
+ $refresh_fields,
+ 'refresh',
+ $refresh,
'',
'',
0,
@@ -199,33 +173,17 @@ function pandora_realtime_graphs()
true,
'',
false,
- 'display: none;'
+ 'width: 100%'
+ )
+ );
+
+ if ($graph != 'snmp_module') {
+ $data['incremental'] = html_print_label_input_block(
+ __('Incremental'),
+ html_print_checkbox_switch('incremental', 1, 0, true)
);
}
- $data['refresh'] = __('Refresh interval').' ';
- $data['refresh'] .= html_print_select(
- $refresh_fields,
- 'refresh',
- $refresh,
- '',
- '',
- 0,
- true
- );
- if ($graph != 'snmp_module') {
- $data['incremental'] = __('Incremental').' ';
- $data['incremental'] .= html_print_checkbox('incremental', 1, 0, true);
- }
-
- $data['reset'] = html_print_button(
- __('Clear graph'),
- 'reset',
- false,
- 'javascript:realtimeGraphs.clearGraph();',
- 'class="sub delete mgn_tp_0" ',
- true
- );
$table->data[] = $data;
if ($graph == 'snmp_interface' || $graph == 'snmp_module') {
@@ -236,10 +194,79 @@ function pandora_realtime_graphs()
html_print_input_hidden('rel_path', get_parameter('rel_path', ''));
// Print the form.
- echo '';
+ $searchForm = '';
+ ui_toggle(
+ $searchForm,
+ '',
+ 'filter_form',
+ '',
+ true,
+ false,
+ '',
+ 'white-box-content',
+ 'box-flat white_table_graph fixed_filter_bar'
+ );
+
+ $chart[time()]['graph'] = '0';
+ $canvas = '';
+ $canvas .= '
';
+
+ $width = 800;
+ $height = 300;
+
+ $data_array['realtime']['data'][0][0] = (time() - 10);
+ $data_array['realtime']['data'][0][1] = 0;
+ $data_array['realtime']['data'][1][0] = time();
+ $data_array['realtime']['data'][1][1] = 0;
+ $data_array['realtime']['color'] = 'green';
+
+ $params = [
+ 'agent_module_id' => false,
+ 'period' => 300,
+ 'width' => $width,
+ 'height' => $height,
+ 'only_image' => false,
+ 'type_graph' => 'area',
+ 'font' => $config['fontpath'],
+ 'font-size' => $config['font_size'],
+ 'array_data_create' => $data_array,
+ 'show_legend' => false,
+ 'show_menu' => false,
+ 'backgroundColor' => 'transparent',
+ ];
+
+ $canvas .= grafico_modulo_sparse($params);
+
+ $canvas .= '
';
+
+ html_print_div(
+ [
+ 'class' => 'white_box',
+ 'content' => $canvas,
+ ]
+ );
+
+ // echo $canvas;
// Define a custom action to save
// the OID selected in the SNMP browser to the form.
html_print_input_hidden(
diff --git a/pandora_console/extensions/realtime_graphs/realtime_graphs.css b/pandora_console/extensions/realtime_graphs/realtime_graphs.css
index a5dfa19975..a839ad6ab0 100644
--- a/pandora_console/extensions/realtime_graphs/realtime_graphs.css
+++ b/pandora_console/extensions/realtime_graphs/realtime_graphs.css
@@ -12,6 +12,5 @@
#graph_container {
width: 800px;
margin: 20px auto;
- background-color: white;
border-radius: 3px;
}
diff --git a/pandora_console/extensions/resource_exportation.php b/pandora_console/extensions/resource_exportation.php
index b6e594c744..905b389eee 100755
--- a/pandora_console/extensions/resource_exportation.php
+++ b/pandora_console/extensions/resource_exportation.php
@@ -1,16 +1,32 @@
\n";
break;
@@ -224,18 +209,6 @@ function output_xml_report($id)
echo '\n";
break;
- case 'event_report_module':
- break;
-
- case 'alert_report_module':
- break;
-
- case 'alert_report_agent':
- break;
-
- case 'alert_report_group':
- break;
-
case 'url':
echo '';
break;
@@ -245,6 +218,29 @@ function output_xml_report($id)
echo '';
echo '';
break;
+
+ case 1:
+ case 'simple_graph':
+ case 'simple_baseline_graph':
+ case 6:
+ case 'monitor_report':
+ case 7:
+ case 'avg_value':
+ case 8:
+ case 'max_value':
+ case 9:
+ case 'min_value':
+ case 10:
+ case 'sumatory':
+ case 'agent_detailed_event':
+ case 'event_report_agent':
+ case 'event_report_module':
+ case 'alert_report_module':
+ case 'alert_report_agent':
+ case 'alert_report_group':
+ default:
+ // Do nothing.
+ break;
}
echo "\n";
@@ -417,25 +413,59 @@ function resource_exportation_extension_main()
$hook_enterprise = enterprise_include('extensions/resource_exportation/functions.php');
- ui_print_page_header(__('Resource exportation'), 'images/extensions.png', false, '', true, '');
+ ui_print_standard_header(
+ __('Resource exportation'),
+ 'images/extensions.png',
+ false,
+ '',
+ true,
+ [],
+ [
+ [
+ 'link' => '',
+ 'label' => __('Resources'),
+ ],
+ [
+ 'link' => '',
+ 'label' => __('Resource exporting'),
+ ],
+ ]
+ );
- echo '';
- echo __('This extension makes exportation of resource template more easy.').' '.__('You can export resource templates in .ptr format.');
- echo '
';
-
- echo '
';
+ ui_print_warning_message(
+ __('This extension makes exportation of resource template more easy.').'
'.__('You can export resource templates in .ptr format.')
+ );
$table = new stdClass();
- $table->width = '100%';
- $table->style[0] = 'width: 30%;';
- $table->style[1] = 'width: 10%;';
- $table->class = 'databox filters';
- $table->data[0][0] = __('Report');
- $table->data[0][1] = html_print_select_from_sql('SELECT id_report, name FROM treport', 'report', '', '', '', 0, true);
- $table->data[0][2] = html_print_button(__('Export'), '', false, 'export_to_ptr(\'report\');', 'class="sub config"', true);
- $table->data[1][0] = __('Visual console');
- $table->data[1][1] = html_print_select_from_sql('SELECT id, name FROM tlayout', 'visual_console', '', '', '', 0, true);
- $table->data[1][2] = html_print_button(__('Export'), '', false, 'export_to_ptr(\'visual_console\');', 'class="sub config"', true);
+ $table->class = 'databox filter-table-adv';
+ $table->id = 'resource_exportation_table';
+ $table->style = [];
+ $table->style[0] = 'width: 30%';
+ $table->style[1] = 'vertical-align: bottom;';
+ $table->data = [];
+ $table->data[0][] = html_print_label_input_block(
+ __('Report'),
+ html_print_div(
+ [
+ 'class' => 'flex-content-left',
+ 'content' => html_print_select_from_sql('SELECT id_report, name FROM treport', 'report', '', '', '', 0, true),
+ ],
+ true
+ )
+ );
+ $table->data[0][] = html_print_button(__('Export'), '', false, 'export_to_ptr(\'report\');', ['mode' => 'link'], true);
+
+ $table->data[1][] = html_print_label_input_block(
+ __('Visual console'),
+ html_print_div(
+ [
+ 'class' => 'flex-content-left',
+ 'content' => html_print_select_from_sql('SELECT id, name FROM tlayout', 'visual_console', '', '', '', 0, true),
+ ],
+ true
+ )
+ );
+ $table->data[1][] = html_print_button(__('Export'), '', false, 'export_to_ptr(\'visual_console\');', ['mode' => 'link'], true);
if ($hook_enterprise === true) {
add_rows_for_enterprise($table->data);
diff --git a/pandora_console/extensions/resource_registration.php b/pandora_console/extensions/resource_registration.php
index 732c0151ea..d76814e886 100755
--- a/pandora_console/extensions/resource_registration.php
+++ b/pandora_console/extensions/resource_registration.php
@@ -1,4 +1,5 @@
group));
break;
- case 'event_report_module':
- break;
-
- case 'alert_report_module':
- break;
-
- case 'alert_report_agent':
- break;
-
- case 'alert_report_group':
- break;
-
case 'url':
$values['external_source'] = io_safe_input($item['url']);
break;
@@ -426,9 +384,32 @@ function process_upload_xml_report($xml, $group_filter=0)
$values['line_separator'] = io_safe_input($item['line_separator']);
$values['column_separator'] = io_safe_input($item['column_separator']);
break;
+
+ case 1:
+ case 'simple_graph':
+ case 'simple_baseline_graph':
+ case 6:
+ case 'monitor_report':
+ case 7:
+ case 'avg_value':
+ case 8:
+ case 'max_value':
+ case 9:
+ case 'min_value':
+ case 10:
+ case 'sumatory':
+ case 'event_report_module':
+ case 'alert_report_module':
+ case 'alert_report_agent':
+ case 'alert_report_group':
+ case 'agent_detailed_event':
+ case 'event_report_agent':
+ default:
+ // Do nothing.
+ break;
}
- if (empty($agents_item)) {
+ if (empty($agents_item) === true) {
$id_content = db_process_sql_insert('treport_content', $values);
ui_print_result_message(
$id_content,
@@ -782,7 +763,7 @@ function process_upload_xml_visualmap($xml, $filter_group=0)
function process_upload_xml_component($xml)
{
- // Extract components
+ // Extract components.
$components = [];
foreach ($xml->xpath('/component') as $componentElement) {
$name = io_safe_input((string) $componentElement->name);
@@ -838,7 +819,7 @@ function process_upload_xml_component($xml)
$idComponent = false;
switch ((int) $componentElement->module_source) {
case 1:
- // Local component
+ // Local component.
$values = [
'description' => $description,
'id_network_component_group' => $group,
@@ -854,12 +835,12 @@ function process_upload_xml_component($xml)
// Network component
// for modules
// 15 = remote_snmp, 16 = remote_snmp_inc,
- // 17 = remote_snmp_string, 18 = remote_snmp_proc
+ // 17 = remote_snmp_string, 18 = remote_snmp_proc.
$custom_string_1 = '';
$custom_string_2 = '';
$custom_string_3 = '';
if ($type >= 15 && $type <= 18) {
- // New support for snmp v3
+ // New support for snmp v3.
$tcp_send = $snmp_version;
$plugin_user = $auth_user;
$plugin_pass = $auth_password;
@@ -909,13 +890,13 @@ function process_upload_xml_component($xml)
'post_process' => $post_process,
]
);
- if ((bool) $idComponent) {
+ if ((bool) $idComponent === true) {
$components[] = $idComponent;
}
break;
case 4:
- // Plugin component
+ // Plugin component.
$idComponent = network_components_create_network_component(
$name,
$type,
@@ -956,17 +937,13 @@ function process_upload_xml_component($xml)
'post_process' => $post_process,
]
);
- if ((bool) $idComponent) {
+ if ((bool) $idComponent === true) {
$components[] = $idComponent;
}
break;
- case 5:
- // Prediction component
- break;
-
case 6:
- // WMI component
+ // WMI component.
$idComponent = network_components_create_network_component(
$name,
$type,
@@ -1013,13 +990,17 @@ function process_upload_xml_component($xml)
'post_process' => $post_process,
]
);
- if ((bool) $idComponent) {
+ if ((bool) $idComponent === true) {
$components[] = $idComponent;
}
break;
+ case 5:
+ // Prediction component.
case 7:
- // Web component
+ // Web component.
+ default:
+ // Do nothing.
break;
}
@@ -1030,9 +1011,9 @@ function process_upload_xml_component($xml)
);
}
- // Extract the template
+ // Extract the template.
$templateElement = $xml->xpath('//template');
- if (!empty($templateElement)) {
+ if (empty($templateElement) === false) {
$templateElement = $templateElement[0];
$templateName = (string) $templateElement->name;
@@ -1092,9 +1073,26 @@ function resource_registration_extension_main()
include_once $config['homedir'].'/include/functions_db.php';
enterprise_include_once('include/functions_local_components.php');
- ui_print_page_header(__('Resource registration'), 'images/extensions.png', false, '', true, '');
+ ui_print_standard_header(
+ __('Resource registration'),
+ 'images/extensions.png',
+ false,
+ '',
+ true,
+ [],
+ [
+ [
+ 'link' => '',
+ 'label' => __('Resources'),
+ ],
+ [
+ 'link' => '',
+ 'label' => __('Resource registration'),
+ ],
+ ]
+ );
- if (!extension_loaded('libxml')) {
+ if (extension_loaded('libxml') === false) {
ui_print_error_message(_('Error, please install the PHP libXML in the system.'));
return;
@@ -1119,15 +1117,42 @@ function resource_registration_extension_main()
return;
}
- echo '';
- echo __('This extension makes registering resource templates easier.').' '.__('Here you can upload a resource template in .ptr format.').' '.__('Please refer to our documentation for more information on how to obtain and use %s resources.', get_product_name()).' '.'
'.__('You can get more resurces in our
Public Resource Library');
- echo '
';
+ ui_print_warning_message(
+ __('This extension makes registering resource templates easier.').'
'.__('Here you can upload a resource template in .ptr format.').'
'.__('Please refer to our documentation for more information on how to obtain and use %s resources.', get_product_name()).' '.'
'.__('You can get more resurces in our Public Resource Library')
+ );
- echo '
';
+ $table = new stdClass();
+ $table->class = 'databox filter-table-adv';
+ $table->id = 'resource_registration_table';
+
+ $table->data = [];
+
+ $table->data[0][] = html_print_label_input_block(
+ __('File to upload'),
+ html_print_input_file('resource_upload', true)
+ );
+
+ $table->data[0][] = html_print_label_input_block(
+ __('Group filter'),
+ html_print_select_groups(false, 'AW', true, 'group', '', '', __('All'), 0, true)
+ );
// Upload form.
- echo "