Merge branch 'ent-9662-second-round' of brutus.artica.es:artica/pandorafms into ent-9662-second-round

This commit is contained in:
Jose Gonzalez 2023-03-15 16:37:33 +01:00
commit e9526bf886
34 changed files with 535 additions and 356 deletions

View File

@ -487,21 +487,18 @@ if (isset($groups[$grupo]) === true || $new_agent === true) {
$tableAgent->data['primary_group'][0] .= html_print_input_hidden('grupo', $grupo, true);
}
$tableAgent->data['primary_group'][0] .= html_print_div(
[
'content' => ui_print_group_icon(
$grupo,
true,
'',
($id_agente === 0) ? 'display: none;' : '',
true,
false,
false,
'after_input_icon'
),
],
true
$tableAgent->data['primary_group'][0] .= '<span id="group_preview">';
$tableAgent->data['primary_group'][0] .= ui_print_group_icon(
$grupo,
true,
'',
($id_agente === 0) ? 'display: none;' : '',
true,
false,
false,
'after_input_icon'
);
$tableAgent->data['primary_group'][0] .= '</span>';
$tableAgent->data['caption_interval'][0] = __('Interval');
// $tableAgent->rowstyle['interval'] = 'width: 260px';

View File

@ -827,12 +827,6 @@ if ($id_agente) {
'link' => '',
'label' => $tab_name,
],
],
[
'id_element' => $id_agente,
'url' => 'godmode/agentes/configurar_agente&tab=main&id_agente='.$id_agente,
'label' => agents_get_alias($id_agente),
'section' => 'Agents',
]
);
}

View File

@ -718,7 +718,7 @@ if ($is_management_allowed === true
'tfavmenu_user',
[
'id_element' => $id_group,
'section' => 'Tactic_group',
'section' => 'Groups',
'id_user' => $config['id_user'],
]
);
@ -906,7 +906,6 @@ if ($tab == 'tree') {
foreach ($groups as $key => $group) {
$url_edit = 'index.php?sec=gagente&sec2=godmode/groups/configure_group&id_group='.$group['id_grupo'];
$url_tactical = 'index.php?sec=gagente&sec2=godmode/groups/tactical&id_group='.$group['id_grupo'];
if (is_metaconsole()) {
$url_delete = 'index.php?sec=gagente&sec2=godmode/groups/group_list&delete_group=1&id_group='.$group['id_grupo'].'&tab=groups';
} else {
@ -915,7 +914,7 @@ if ($tab == 'tree') {
$table->data[$key][0] = $group['id_grupo'];
if ($is_management_allowed === true) {
$table->data[$key][1] = '<a href="'.$url_tactical.'">'.$group['nombre'].'</a>';
$table->data[$key][1] = '<a href="'.$url_edit.'">'.$group['nombre'].'</a>';
} else {
$table->data[$key][1] = $group['nombre'];
}

View File

@ -72,14 +72,14 @@ if (is_metaconsole() === false) {
],
[
'link' => '',
'label' => __('Tactic group'),
'label' => __('Tactical group view'),
],
],
[
'id_element' => $id_group,
'url' => 'gagent&sec2=godmode/groups/tactical&id_group='.$id_group,
'label' => groups_get_name($id_group),
'section' => 'Tactic_group',
'section' => 'Groups',
]
);
}
@ -187,7 +187,7 @@ try {
[
'id' => 'list_agents_tactical',
'class' => 'info_table',
'style' => 'width: 100%',
'style' => 'width: 99%',
'columns' => $columns,
'column_names' => $columnNames,
'return' => true,
@ -196,6 +196,7 @@ try {
'method' => 'getAgentsByGroup',
'id_group' => $id_group,
],
'dom_elements' => 'lpfti',
'no_sortable_columns' => [-1],
'order' => [
'field' => 'alias',

View File

@ -1750,7 +1750,9 @@ if (check_login()) {
INNER JOIN tagente
ON tagente_modulo.id_agente = tagente.id_agente
INNER JOIN tagente_estado
ON tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo'
ON tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
WHERE %s',
$where
);
$recordsTotal = db_get_value_sql($sql_count);
@ -1795,6 +1797,32 @@ if (check_login()) {
}
}
if (in_array(0, $servers_ids) === true) {
$sql = sprintf(
'SELECT
tagente_modulo.nombre,
tagente.alias,
tagente.id_agente,
tagente_estado.last_status_change,
tagente_estado.estado
FROM tagente_modulo
INNER JOIN tagente
ON tagente_modulo.id_agente = tagente.id_agente
INNER JOIN tagente_estado
ON tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
WHERE %s',
$where
);
$res_sql = db_get_all_rows_sql($sql);
foreach ($res_sql as $row_sql) {
$row_sql['server_name'] = __('Metaconsole');
$row_sql['server_url'] = $config['homeurl'];
array_push($data, $row_sql);
}
}
// Drop temporary table if exist.
db_process_sql('DROP TEMPORARY TABLE IF EXISTS temp_modules_status;');
@ -1852,7 +1880,9 @@ if (check_login()) {
$sql_count = sprintf(
'SELECT COUNT(*) AS "total"
FROM temp_modules_status'
FROM temp_modules_status
WHERE %s',
$where
);
$recordsTotal = db_get_value_sql($sql_count);

View File

@ -528,77 +528,103 @@ class ExternalTools extends HTML
// Form table.
$table = new StdClass();
$table->class = 'fixed_filter_bar';
$table->class = 'fixed_filter_bar filter-table-adv pdd_15px';
$table->id = 'externalToolTable';
$table->cellstyle['captions'][0] = 'width: 0';
$table->cellstyle['captions'][1] = 'width: 0';
$table->cellstyle['captions'][2] = 'width: 0';
$table->size[0] = '25%';
$table->size[1] = '25%';
$table->size[2] = '25%';
$table->size[3] = '25%';
$table->colspan = [];
$table->colspan[1][0] = 4;
// $table->cellclass[0][2] = 'snmpcolumn';
// $table->cellclass[0][2] = 'snmpcolumn';
// $table->cellclass[0][3] = 'snmpcolumn';
// $table->cellclass[0][3] = 'snmpcolumn';
$table->data = [];
$table->data['captions'][0] = __('Operation');
$table->data['inputs'][0] = html_print_select(
$commandList,
'operation',
$this->operation,
'mostrarColumns(this.value)',
__('Please select'),
0,
true
$table->data[0][0] = html_print_label_input_block(
__('Operation'),
html_print_select(
$commandList,
'operation',
$this->operation,
'mostrarColumns(this.value)',
__('Please select'),
0,
true,
false,
true,
'w100p',
false,
'width: 100%;'
)
);
$table->data['captions'][1] = __('IP Adress');
$table->data['inputs'][1] = html_print_select(
$ipsSelect,
'select_ips',
$principal_ip,
'',
'',
0,
true
$table->data[0][1] = html_print_label_input_block(
__('IP Adress'),
html_print_select(
$ipsSelect,
'select_ips',
$principal_ip,
'',
'',
0,
true,
false,
true,
'w100p',
false,
'width: 100%;'
)
);
$table->cellclass['captions'][2] = 'snmpcolumn';
$table->cellclass['inputs'][2] = 'snmpcolumn';
$table->data['captions'][2] = __('SNMP Version');
$table->data['inputs'][2] = html_print_select(
$table->data[0][2] = html_print_label_input_block(
__('SNMP Version'),
html_print_select(
[
'1' => 'v1',
'2c' => 'v2c',
],
'select_version',
$this->snmp_version,
'',
'',
0,
true,
false,
true,
'w100p',
false,
'width: 100%;'
),
['div_class' => 'snmpcolumn']
);
$table->data[0][3] = html_print_label_input_block(
__('SNMP Community'),
html_print_input_text(
'community',
$this->community,
'',
50,
255,
true,
false,
false,
'',
'w100p'
),
['div_class' => 'snmpcolumn']
);
$table->data[1][0] = html_print_submit_button(
__('Execute'),
'submit',
false,
[
'1' => 'v1',
'2c' => 'v2c',
],
'select_version',
$this->snmp_version,
'',
'',
0,
true
);
$table->cellclass['captions'][3] = 'snmpcolumn';
$table->cellclass['inputs'][3] = 'snmpcolumn';
$table->data['captions'][3] = __('SNMP Community');
$table->data['inputs'][3] = html_print_input_text(
'community',
$this->community,
'',
50,
255,
true
);
$table->data['inputs'][4] = html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Execute'),
'submit',
false,
[
'icon' => 'cog',
'mode' => 'mini',
],
true
),
'icon' => 'cog',
'mode' => 'mini',
'class' => 'float-right mrgn_right_10px',
],
true
);
@ -716,7 +742,7 @@ class ExternalTools extends HTML
*/
private function performExecution(string $command='', string $caption='')
{
$output = '';
$output = '<div class="white_box max_floating_element_size no_border">';
try {
// If caption is not added, don't show anything.
@ -736,7 +762,7 @@ class ExternalTools extends HTML
$output .= __('Command not response');
}
$output .= '</pre>';
$output .= '</pre></div>';
if ($resultCode !== 0) {
throw new Exception(
@ -774,6 +800,8 @@ class ExternalTools extends HTML
{
$output = '';
echo '<div class="white_box max_floating_element_size no_border pdd_15px">';
if (validate_address($ip) === false) {
$output .= ui_print_error_message(
__('The ip or dns name entered cannot be resolved'),
@ -938,6 +966,7 @@ class ExternalTools extends HTML
}
}
echo '</div>';
return $output;
}

View File

@ -259,7 +259,10 @@ class SnmpConsole extends HTML
'class' => 'snmp-td',
],
'alert',
'action',
[
'text' => 'action',
'class' => 'table_action_buttons w120px',
],
[
'text' => 'm',
'class' => 'mw60px pdd_0px',

View File

@ -157,11 +157,12 @@ class TipsWindow
View::render(
'dashboard/tipsWindow',
[
'title' => $initialTip['title'],
'text' => $initialTip['text'],
'url' => $initialTip['url'],
'files' => $initialTip['files'],
'id' => $initialTip['id'],
'title' => $initialTip['title'],
'text' => $initialTip['text'],
'url' => $initialTip['url'],
'files' => $initialTip['files'],
'id' => $initialTip['id'],
'totalTips' => $this->getTotalTipsShowUser(),
]
);
}

View File

@ -723,7 +723,23 @@ function ui_print_group_icon($id_group, $return=false, $path='', $style='', $lin
$output .= '<span title="'.groups_get_name($id_group, true).'">'.groups_get_name($id_group, true).'&nbsp;</span>';
} else {
if (empty($icon) === true) {
$output .= '<span title="'.groups_get_name($id_group, true).'">&nbsp;&nbsp;</span>';
$output .= '<span title="'.groups_get_name($id_group, true).'">';
$output .= '</span>';
$output .= html_print_image(
'images/unknown@groups.svg',
true,
[
'style' => $style,
'class' => 'main_menu_icon '.$class,
'alt' => groups_get_name($id_group, true),
'title' => groups_get_name($id_group, true),
],
false,
false,
false,
true
);
$output .= '</span>';
} else {
if (empty($class) === true) {
$class = 'bot';
@ -3879,8 +3895,8 @@ 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\');
$(".datatable-msg-info-'.$table_id.'").show();
$(".datatable-msg-info-'.$table_id.'").removeClass(\'invisible_important\');
$("table#'.$table_id.'").hide();
$("div.dataTables_paginate").hide();
$("div.dataTables_info").hide();
@ -3891,7 +3907,7 @@ function ui_print_datatable(array $parameters)
$(".dataTables_paginate.paging_simple_numbers").show()
}
} else {
$("div[id^=info_box_]").hide();
$(".datatable-msg-info-'.$table_id.'").hide();
$("table#'.$table_id.'").show();
$("div.dataTables_paginate").show();
$("div.dataTables_info").show();
@ -4028,7 +4044,7 @@ function ui_print_datatable(array $parameters)
// Order.
$info_msg_arr = [];
$info_msg_arr['message'] = $emptyTable;
$info_msg_arr['div_class'] = 'info_box_container invisible_important';
$info_msg_arr['div_class'] = 'info_box_container invisible_important datatable-msg-info-'.$table_id;
$info_msg = '<div>'.ui_print_info_message($info_msg_arr).'</div>';
$err_msg = '<div id="error-'.$table_id.'"></div>';

View File

@ -296,7 +296,7 @@
$.extend({
pandoraSelectGroupIcon: new (function() {
this.defaults = {
alertSelect: "select#id_group",
alertSelect: "select#grupo",
spanPreview: "#group_preview",
debug: false
};
@ -315,25 +315,26 @@
$(this).change(function() {
var id_group = this.value;
let href = $("a", config.spanPreview).attr("href");
let hrefPosition = href.search("group_id=");
let hrefNew = href.slice(0, hrefPosition) + "group_id=" + id_group;
$(config.spanPreview).fadeOut("fast", function() {
$("img", config.spanPreview).remove();
jQuery.post(
"ajax.php",
{
page: "godmode/groups/group_list",
get_group_json: 1,
id_group: id_group
},
function(data) {
var img = $("<img />").attr("src", "images/" + data["icon"]);
$(config.spanPreview)
.append(img)
.fadeIn("fast");
},
"json"
);
});
jQuery.post(
"ajax.php",
{
page: "godmode/groups/group_list",
get_group_json: 1,
id_group: id_group
},
function(data) {
$("img", config.spanPreview).attr(
"src",
"images/" + data["icon"]
);
$("a", config.spanPreview).attr("href", hrefNew);
},
"json"
);
});
});
};

View File

@ -1250,7 +1250,10 @@ class ClusterWizard extends \HTML
'name' => 'next',
'label' => $str,
'type' => 'submit',
'attributes' => 'class="sub next"',
'attributes' => [
'icon' => 'wand',
'mode' => 'primary',
],
'return' => true,
],
];

View File

@ -316,8 +316,8 @@ class AvgSumMaxMinModule extends Widget
$values['unit'] = $decoder['unit'];
}
if (isset($decoder['layout']) === true) {
$values['layout'] = $decoder['layout'];
if (isset($decoder['horizontal']) === true) {
$values['horizontal'] = $decoder['horizontal'];
}
return $values;
@ -505,14 +505,14 @@ class AvgSumMaxMinModule extends Widget
],
];
// Layout.
// Horizontal.
$inputs[] = [
'label' => __('Layout').ui_print_help_tip(__('Off: vertical. On: horizontal'), true),
'label' => __('Horizontal').ui_print_help_tip(__('If not, layout is vertical'), true),
'arguments' => [
'wrapper' => 'div',
'name' => 'layout',
'name' => 'horizontal',
'type' => 'switch',
'value' => $values['layout'],
'value' => $values['horizontal'],
'return' => true,
],
];
@ -541,7 +541,7 @@ class AvgSumMaxMinModule extends Widget
$values['sizeLabel'] = \get_parameter_switch('sizeLabel');
$values['text_color'] = \get_parameter('text_color', 0);
$values['unit'] = \get_parameter_switch('unit');
$values['layout'] = \get_parameter_switch('layout');
$values['horizontal'] = \get_parameter_switch('horizontal');
return $values;
}
@ -643,8 +643,8 @@ class AvgSumMaxMinModule extends Widget
$output .= '<div class="container-center" id="container-'.$uuid.'">';
$orientation = '';
if ((int) $this->values['layout'] === 1) {
$orientation = 'flex';
if ((int) $this->values['horizontal'] === 1) {
$orientation = 'flex aligni_center';
} else {
$orientation = 'grid';
}
@ -653,7 +653,7 @@ class AvgSumMaxMinModule extends Widget
$output .= '<div class="'.$orientation.'" id="general-'.$uuid.'">';
// Div value.
$output .= '<div class="pdd_l_15px pdd_r_15px mrgn_btn_20px" style="font-size:'.$sizeValue.'px;'.$text_color.'">';
$output .= '<div class="pdd_l_15px pdd_r_15px mrgn_btn_20px" style="line-height: '.$sizeValue.'px; font-size:'.$sizeValue.'px;'.$text_color.'">';
if (is_numeric($data) === true) {
$dataDatos = remove_right_zeros(
@ -679,7 +679,7 @@ class AvgSumMaxMinModule extends Widget
if (empty($label) === false) {
// Div Label.
$output .= '<div class="pdd_l_15px pdd_r_15px" style="font-size:'.$sizeLabel.'px;'.$text_color.'">'.$label.'</div>';
$output .= '<div class="pdd_l_15px pdd_r_15px" style="line-height: '.$sizeLabel.'px; font-size:'.$sizeLabel.'px;'.$text_color.'">'.$label.'</div>';
}
$output .= '</div>';

View File

@ -179,7 +179,7 @@ class ModulesByStatus extends Widget
// This forces at least a first configuration.
// This forces at least a first configuration.
$this->configurationRequired = false;
if (empty($this->values['status']) === true) {
if (empty($this->values['status']) === true && $this->values['status'] !== '0') {
$this->configurationRequired = true;
}
@ -311,6 +311,8 @@ class ModulesByStatus extends Widget
$nodes_fields[$server['id']] = $server['server_name'];
}
$nodes_fields[0] = __('Metaconsola');
$nodes_selected = explode(',', $values['nodes']);
(isset($values['nodes']) === false) ? $nodes_selected = $servers_ids : '';
@ -369,6 +371,8 @@ class ModulesByStatus extends Widget
{
$this->size = parent::getSize();
global $config;
$output = '';
if (is_metaconsole() === true) {
@ -413,7 +417,7 @@ class ModulesByStatus extends Widget
[
'id' => $tableId,
'class' => 'info_table align-left-important',
'style' => 'width: 100%',
'style' => 'width: 99%',
'columns' => $columns,
'column_names' => $column_names,
'ajax_url' => 'include/ajax/module',
@ -430,6 +434,26 @@ class ModulesByStatus extends Widget
'direction' => 'desc',
],
'csv' => 0,
'pagination_options' => [
[
5,
10,
25,
100,
200,
500,
1000,
],
[
5,
10,
25,
100,
200,
500,
1000,
],
],
]
);
} catch (\Exception $e) {

View File

@ -284,11 +284,16 @@ class AlertsFiredWidget extends Widget
if (isset($groups) === true && is_array($groups) === true) {
$table = new \StdClass();
$table->class = 'databox data';
$table->class = 'databox data centered';
$table->cellspacing = '0';
$table->width = '90%';
$table->width = '100%';
$table->data = [];
$table->size = [];
$table->style = [];
$table->style[0] = 'text-align: left;';
$table->style[1] = 'text-align: left;';
$table->style[2] = 'text-align: left;';
$table->style[3] = 'text-align: left;';
$url = $config['homeurl'];
$url .= 'index.php?sec=estado&sec2=operation/agentes/alerts_status';
@ -335,7 +340,7 @@ class AlertsFiredWidget extends Widget
if ($flag === true) {
$height = (count($table->data) * 30);
$style = 'min-width:300px; min-height:'.$height.'px;';
$output .= '<div class="container-center" style="'.$style.'">';
$output .= '<div class="" style="'.$style.'">';
$output .= html_print_table($table, true);
$output .= '</div>';
} else {

View File

@ -305,8 +305,8 @@ class ModuleIconWidget extends Widget
$values['imageSrc'] = $decoder['imageSrc'];
}
if (isset($decoder['layout']) === true) {
$values['layout'] = $decoder['layout'];
if (isset($decoder['horizontal']) === true) {
$values['horizontal'] = $decoder['horizontal'];
}
return $values;
@ -486,14 +486,14 @@ class ModuleIconWidget extends Widget
],
];
// Layout.
// Horizontal.
$inputs[] = [
'label' => __('Layout').ui_print_help_tip(__('Off: vertical. On: horizontal'), true),
'label' => __('Horizontal').ui_print_help_tip(__('If not, layout is vertical'), true),
'arguments' => [
'wrapper' => 'div',
'name' => 'layout',
'name' => 'horizontal',
'type' => 'switch',
'value' => $values['layout'],
'value' => $values['horizontal'],
'return' => true,
],
];
@ -520,7 +520,7 @@ class ModuleIconWidget extends Widget
$values['sizeValue'] = \get_parameter('sizeValue', 0);
$values['sizeLabel'] = \get_parameter_switch('sizeLabel');
$values['sizeIcon'] = \get_parameter_switch('sizeIcon');
$values['layout'] = \get_parameter_switch('layout');
$values['horizontal'] = \get_parameter_switch('horizontal');
return $values;
}
@ -563,7 +563,7 @@ class ModuleIconWidget extends Widget
$output .= '<div class="container-center" id="container-'.$uuid.'">';
$orientation = '';
if ((int) $this->values['layout'] === 1) {
if ((int) $this->values['horizontal'] === 1) {
$orientation = 'flex aligni_center';
} else {
$orientation = 'grid';
@ -596,7 +596,7 @@ class ModuleIconWidget extends Widget
// Div image.
$style_icon = 'flex: 0 1 '.$sizeIcon.'px;';
$output .= '<div class="pdd_l_15px pdd_r_15px" style="flex: 0 1 '.$sizeIcon.'px;">';
$output .= '<div class="pdd_l_15px pdd_r_15px mrgn_btn_25px" style="flex: 0 1 '.$sizeIcon.'px; height: '.$sizeIcon.'px;">';
$output .= html_print_image(
'images/console/icons/'.$icon.$color_icon.'.png',
true,
@ -604,7 +604,7 @@ class ModuleIconWidget extends Widget
);
$output .= '</div>';
// Div value.
$output .= '<div class="mrgn_btn_15px" style="flex: 0 1 10px; font-size:'.$sizeValue.'px;">';
$output .= '<div class="mrgn_btn_15px" style="flex: 0 1 10px; line-height: '.$sizeValue.'px; font-size:'.$sizeValue.'px;">';
$output .= remove_right_zeros(
number_format($data_module, $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator'])
).$unit;
@ -612,7 +612,7 @@ class ModuleIconWidget extends Widget
if (empty($label) === false) {
// Div Label.
$output .= '<div class="pdd_l_15px pdd_r_15px" style="flex: 1; font-size:'.$sizeLabel.'px;">'.$label.'</div>';
$output .= '<div class="pdd_l_15px pdd_r_15px" style="flex: 1; line-height: '.$sizeLabel.'px; font-size:'.$sizeLabel.'px;">'.$label.'</div>';
}
$output .= '</div>';

View File

@ -300,8 +300,8 @@ class ModuleStatusWidget extends Widget
$values['imageSrc'] = $decoder['imageSrc'];
}
if (isset($decoder['layout']) === true) {
$values['layout'] = $decoder['layout'];
if (isset($decoder['horizontal']) === true) {
$values['horizontal'] = $decoder['horizontal'];
}
return $values;
@ -465,14 +465,14 @@ class ModuleStatusWidget extends Widget
],
];
// Layout.
// Horizontal.
$inputs[] = [
'label' => __('Layout').ui_print_help_tip(__('Off: vertical. On: horizontal'), true),
'label' => __('Horizontal').ui_print_help_tip(__('If not, layout is vertical'), true),
'arguments' => [
'wrapper' => 'div',
'name' => 'layout',
'name' => 'horizontal',
'type' => 'switch',
'value' => $values['layout'],
'value' => $values['horizontal'],
'return' => true,
],
];
@ -499,7 +499,7 @@ class ModuleStatusWidget extends Widget
$values['sizeValue'] = \get_parameter('sizeValue', 0);
$values['sizeLabel'] = \get_parameter_switch('sizeLabel');
$values['sizeIcon'] = \get_parameter_switch('sizeIcon');
$values['layout'] = \get_parameter_switch('layout');
$values['horizontal'] = \get_parameter_switch('horizontal');
return $values;
}
@ -560,7 +560,7 @@ class ModuleStatusWidget extends Widget
$output .= '<div class="container-center" id="container-'.$uuid.'">';
$orientation = '';
if ((int) $this->values['layout'] === 1) {
if ((int) $this->values['horizontal'] === 1) {
$orientation = 'flex aligni_center';
} else {
$orientation = 'grid';
@ -570,7 +570,7 @@ class ModuleStatusWidget extends Widget
$output .= '<div class="'.$orientation.'" id="general-'.$uuid.'">';
// Div image.
$output .= '<div class="pdd_l_15px pdd_r_15px" style="flex: 0 1 '.$sizeIcon.'px;">';
$output .= '<div class="pdd_l_15px pdd_r_15px mrgn_btn_25px" style="flex: 0 1 '.$sizeIcon.'px; height: '.$sizeIcon.'px;">';
$output .= html_print_image(
'images/console/icons/'.$icon,
true,
@ -580,7 +580,7 @@ class ModuleStatusWidget extends Widget
if (empty($label) === false) {
// Div Label.
$output .= '<div class="pdd_l_15px pdd_r_15px" style="flex: 1 1 '.$sizeLabel.'px; font-size:'.$sizeLabel.'px;">'.$label.'</div>';
$output .= '<div class="pdd_l_15px pdd_r_15px" style="flex: 1 1 '.$sizeLabel.'px; line-height: '.$sizeLabel.'px; font-size:'.$sizeLabel.'px;">'.$label.'</div>';
}
$output .= '</div>';

View File

@ -284,8 +284,8 @@ class ModuleValueWidget extends Widget
$values['sizeLabel'] = $decoder['sizeLabel'];
}
if (isset($decoder['layout']) === true) {
$values['layout'] = $decoder['layout'];
if (isset($decoder['horizontal']) === true) {
$values['horizontal'] = $decoder['horizontal'];
}
return $values;
@ -389,14 +389,14 @@ class ModuleValueWidget extends Widget
],
];
// Layout.
// Horizontal.
$inputs[] = [
'label' => __('Layout').ui_print_help_tip(__('Off: vertical. On: horizontal'), true),
'label' => __('Horizontal').ui_print_help_tip(__('If not, layout is vertical'), true),
'arguments' => [
'wrapper' => 'div',
'name' => 'layout',
'name' => 'horizontal',
'type' => 'switch',
'value' => $values['layout'],
'value' => $values['horizontal'],
'return' => true,
],
];
@ -421,7 +421,7 @@ class ModuleValueWidget extends Widget
$values['moduleId'] = \get_parameter('moduleId', 0);
$values['sizeValue'] = \get_parameter('sizeValue', 0);
$values['sizeLabel'] = \get_parameter_switch('sizeLabel');
$values['layout'] = \get_parameter_switch('layout');
$values['horizontal'] = \get_parameter_switch('horizontal');
return $values;
}
@ -471,8 +471,8 @@ class ModuleValueWidget extends Widget
$output .= '<div class="container-center" id="container-'.$uuid.'">';
$orientation = '';
if ((int) $this->values['layout'] === 1) {
$orientation = 'flex';
if ((int) $this->values['horizontal'] === 1) {
$orientation = 'flex aligni_center';
} else {
$orientation = 'grid';
}
@ -481,7 +481,7 @@ class ModuleValueWidget extends Widget
$output .= '<div class="'.$orientation.'" id="general-'.$uuid.'">';
// Div value.
$output .= '<div class="pdd_l_15px pdd_r_15px mrgn_btn_20px" style="flex: 0 1 '.$sizeValue.'px; font-size:'.$sizeValue.'px; color: '.$color.'">';
$output .= '<div class="pdd_l_15px pdd_r_15px mrgn_btn_20px" style="flex: 0 1 '.$sizeValue.'px; line-height: '.$sizeValue.'px; font-size:'.$sizeValue.'px; color: '.$color.'">';
if (is_numeric($data_module) === true) {
$dataDatos = remove_right_zeros(
@ -502,7 +502,7 @@ class ModuleValueWidget extends Widget
if (empty($label) === false) {
// Div Label.
$output .= '<div class="pdd_l_15px pdd_r_15px" style="flex: 1 1 '.$sizeLabel.'px; font-size:'.$sizeLabel.'px;">'.$label.'</div>';
$output .= '<div class="pdd_l_15px pdd_r_15px" style="flex: 1 1 '.$sizeLabel.'px; line-height: '.$sizeLabel.'px; font-size:'.$sizeLabel.'px;">'.$label.'</div>';
}
$output .= '</div>';

View File

@ -300,18 +300,20 @@ class OsQuickReportWidget extends Widget
$table->style[1] = 'background-color: '.$values['background'].';';
$table->style[2] = 'background-color: '.$values['background'].'; font-size: 1.5em; font-weight: bolder;';
$table->style[3] = 'background-color: '.$values['background'].'; font-size: 1.5em; font-weight: bolder;';
$table->style[4] = 'background-color: '.$values['background'].'; font-size: 1.5em; font-weight: bolder;';
$table->style[5] = 'background-color: '.$values['background'].'; font-size: 1.5em; font-weight: bolder;';
$table->style[4] = 'background-color: '.$values['background'].';';
$table->style[5] = 'background-color: '.$values['background'].';';
foreach ($result as $id => $os) {
$data = [];
($os['critical'] > 0) ? $color_critical = 'color: '.COL_CRITICAL.';' : $color_critical = '';
($os['unknown'] > 0) ? $color_unknown = 'color: '.COL_UNKNOWN.';' : $color_unknown = '';
$data[0] = ui_print_os_icon($id, false, true);
$data[1] = $os['name'];
$data[2] = $os['total'];
$data[3] = $os['normal'];
$data[4] = $os['critical'];
$data[5] = $os['unknown'];
$data[4] = '<span class="widget-module-tabs-data" style="'.$color_critical.'">'.$os['critical'].'</span>';
$data[5] = '<span class="widget-module-tabs-data" style="'.$color_unknown.'">'.$os['unknown'].'</span>';
$table->data[] = $data;
}

View File

@ -289,8 +289,8 @@ class SLAPercentWidget extends Widget
$values['period'] = $decoder['period'];
}
if (isset($decoder['layout']) === true) {
$values['layout'] = $decoder['layout'];
if (isset($decoder['horizontal']) === true) {
$values['horizontal'] = $decoder['horizontal'];
}
return $values;
@ -408,14 +408,14 @@ class SLAPercentWidget extends Widget
],
];
// Layout.
// Horizontal.
$inputs[] = [
'label' => __('Layout').ui_print_help_tip(__('Off: vertical. On: horizontal'), true),
'label' => __('Horizontal').ui_print_help_tip(__('If not, layout is vertical'), true),
'arguments' => [
'wrapper' => 'div',
'name' => 'layout',
'name' => 'horizontal',
'type' => 'switch',
'value' => $values['layout'],
'value' => $values['horizontal'],
'return' => true,
],
];
@ -441,7 +441,7 @@ class SLAPercentWidget extends Widget
$values['period'] = \get_parameter('period', 0);
$values['sizeValue'] = \get_parameter('sizeValue', '');
$values['sizeLabel'] = \get_parameter('sizeLabel', '');
$values['layout'] = \get_parameter_switch('layout');
$values['horizontal'] = \get_parameter_switch('horizontal');
return $values;
}
@ -516,8 +516,8 @@ class SLAPercentWidget extends Widget
$output .= '<div class="container-center" id="container-'.$uuid.'">';
$orientation = '';
if ((int) $this->values['layout'] === 1) {
$orientation = 'flex';
if ((int) $this->values['horizontal'] === 1) {
$orientation = 'flex aligni_center';
} else {
$orientation = 'grid';
}
@ -525,13 +525,13 @@ class SLAPercentWidget extends Widget
// General div.
$output .= '<div class="'.$orientation.'" id="general-'.$uuid.'">';
// Div value.
$output .= '<div class="pdd_l_15px pdd_r_15px mrgn_btn_20px" style="flex: 0 1 '.$sizeValue.'px; font-size:'.$sizeValue.'px;">';
$output .= '<div class="pdd_l_15px pdd_r_15px mrgn_btn_20px" style="flex: 0 1 '.$sizeValue.'px; line-height: '.$sizeValue.'px; font-size:'.$sizeValue.'px;">';
$output .= $sla_array['sla_fixed'].'%';
$output .= '</div>';
if (empty($label) === false) {
// Div Label.
$output .= '<div class="pdd_l_15px pdd_r_15px" style="flex: 1 1; font-size:'.$sizeLabel.'px; text-align: left;">'.$label.'</div>';
$output .= '<div class="pdd_l_15px pdd_r_15px" style="flex: 1 1; line-height: '.$sizeLabel.'px; font-size:'.$sizeLabel.'px; text-align: left;">'.$label.'</div>';
}
$output .= '</div>';

View File

@ -843,3 +843,11 @@ div.widget-mrgn-0px > div.parent_graph {
div.widget-mrgn-0px > div.parent_graph > div[id^="graph_"] {
width: calc(100% + 14px) !important;
}
div.content-widget
> div.container-center
> div.centered.w90p
> div#container_show_stats
> canvas {
height: 310px;
}

View File

@ -8144,7 +8144,7 @@ div.graph div.legend table {
overflow: hidden;
background-color: var(--secondary-color);
min-height: calc(100vh - 200px);
border: 1px solid #cacaca;
/* border: 1px solid #cacaca; */
}
/*

View File

@ -28,6 +28,10 @@
* ============================================================================
*/
body {
background-color: white !important;
}
table.header_table {
width: 100%;
}
@ -211,3 +215,7 @@ table tbody td.cellBorder1 {
table tbody td.cellBig {
font-size: 18px;
}
table.info_table > tbody > tr:nth-child(even) {
background-color: #e5e9ed !important;
}

View File

@ -810,3 +810,7 @@ div[id^="auto-os-"] > img {
.dataTables_paginate.paging_simple_numbers {
margin-right: 0;
}
.w22px {
width: 22px;
}

View File

@ -29,3 +29,6 @@ rect {
.graph-distribution-so {
margin-top: 55px;
}
#list_agents_tactical_wrapper .dataTables_length {
margin-bottom: 10px;
}

View File

@ -12,7 +12,7 @@
padding: 0px;
}
.window {
background-image: linear-gradient(180deg, #fffce8 0%, #ffffff 100%);
background-image: white;
width: 640px;
width: 100%;
border-radius: 5px;
@ -145,9 +145,6 @@
color: #14524f;
font-weight: 600;
}
#url_tip .arrow_tips {
font-size: 20px;
}
span.count-round-tip {
width: 6px !important;
height: 6px !important;
@ -211,3 +208,7 @@ span.disable {
.buttons_actions input {
width: 32px;
}
.hide-button {
opacity: 0;
pointer-events: none;
}

View File

@ -187,7 +187,7 @@ html_print_div(
'class' => 'agent_details_line',
'content' => ui_toggle(
$html_toggle,
'<span class="subsection_header_title">'.__('List of modules').'</span>'.$help_not_init.ui_print_help_tip(
__('List of modules').' '.$help_not_init.ui_print_help_tip(
__('To see the list of modules paginated, enable this option in the Styles Configuration.'),
true
).reporting_tiny_stats(
@ -201,9 +201,9 @@ html_print_div(
false,
false,
true,
'box-flat agent_details_col',
'',
'white-box-content',
'width_available'
'box-flat white_table_graph w100p'
),
],
);
@ -543,58 +543,83 @@ function print_form_filter_monitors(
$form_text = '';
$table = new stdClass();
$table->class = 'filter-table-adv';
$table->id = 'module_filter_agent_view';
$table->styleTable = 'border-radius: 0;padding: 0;margin: 0 0 10px;';
// $table->id = 'module_filter_agent_view';
// $table->styleTable = 'border-radius: 0;padding: 0;margin: 0 0 10px;';
$table->width = '100%';
$table->cellstyle[0][0] = 'width: 0';
$table->cellstyle[0][1] = 'width: 0';
$table->cellstyle[0][2] = 'width: 0';
$table->size[0] = '25%';
$table->size[1] = '25%';
$table->size[2] = '25%';
$table->size[3] = '25%';
// Captions.
$table->data[0][0] = html_print_input_hidden('filter_monitors', 1, true);
$table->data[0][0] .= html_print_input_hidden('monitors_change_filter', 1, true);
$table->data[0][0] .= __('Status:');
$table->data[0][1] = __('Free text for search (*):').ui_print_help_tip(
__('Search by module name, list matches.'),
true
$table->data[0][0] = html_print_label_input_block(
html_print_input_hidden('filter_monitors', 1, true).html_print_input_hidden(
'monitors_change_filter',
1,
true
).__('Status:'),
html_print_select(
$status_list,
'status_filter_monitor',
$status_filter_monitor,
'',
'',
0,
true,
false,
true,
'w100p',
false,
'width:100%'
)
);
$table->data[0][2] = __('Module group');
$table->data[0][3] = __('Show in hierachy mode');
// Inputs.
$table->data[1][0] = html_print_select(
$status_list,
'status_filter_monitor',
$status_filter_monitor,
'',
'',
0,
true
$table->data[0][1] = html_print_label_input_block(
__('Free text for search (*):').ui_print_help_tip(
__('Search by module name, list matches.'),
true
),
html_print_input_text(
'status_text_monitor',
$status_text_monitor,
'',
'',
100,
true
)
);
$table->data[1][1] = html_print_input_text(
'status_text_monitor',
$status_text_monitor,
'',
'',
100,
true
$table->data[0][2] = html_print_label_input_block(
__('Module group'),
html_print_select(
$rows_select,
'status_module_group',
$status_module_group,
'',
'',
0,
true,
false,
true,
'w100p',
false,
'width:100%'
)
);
$table->data[1][2] = html_print_select(
$rows_select,
'status_module_group',
$status_module_group,
'',
'',
0,
true
);
$table->data[1][3] = html_print_switch(
[
'name' => 'status_hierachy_mode',
'value' => $all_events_24h,
'onchange' => 'change_module_filter()',
'id' => 'checkbox-status_hierachy_mode',
]
$table->data[0][3] = html_print_label_input_block(
__('Show in hierachy mode'),
html_print_switch(
[
'name' => 'status_hierachy_mode',
'value' => $all_events_24h,
'onchange' => 'change_module_filter()',
'id' => 'checkbox-status_hierachy_mode',
]
)
);
$form_text = html_print_table($table, true);
$filtersButtons = [];
$filtersButtons[] = html_print_button(
@ -603,8 +628,9 @@ function print_form_filter_monitors(
false,
'filter_modules();',
[
'icon' => 'search',
'mode' => 'secondary mini',
'icon' => 'search',
'mode' => 'secondary mini',
'style' => 'margin-left: 15px',
],
true
);
@ -621,16 +647,6 @@ function print_form_filter_monitors(
true
);
$table->data[1][4] = html_print_div(
[
'class' => 'action-buttons',
'content' => implode('', $filtersButtons),
],
true
);
$form_text .= html_print_table($table, true);
// TODO. Unused code.
if ($status_filter_monitor === -1 && empty($status_text_monitor) === true && $status_module_group === -1) {
$filter_hidden = true;
@ -639,4 +655,10 @@ function print_form_filter_monitors(
}
echo $form_text;
html_print_div(
[
'class' => 'action-buttons-right-forced',
'content' => implode('', $filtersButtons),
]
);
}

View File

@ -321,7 +321,7 @@ if (empty($result_groups) === false) {
$link = "<a href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_']."'>";
} else {
$deep = groups_get_group_deep($data['_id_']);
$link = "<a href='index.php?sec=view&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."'>";
$link = "<a href='index.php?sec=view&sec2=godmode/groups/tactical&id_group=".$data['_id_']."'>";
}
$group_name = '<b><span>'.ui_print_truncate_text($data['_name_'], 50).'</span></b>';

View File

@ -146,35 +146,35 @@ function print_filters($sec)
$filters .= '</form>';
} else {
$table->style[0] = 'font-weight: bold;';
$table->data[0][0] = '<b>'.__('Interfaces').'</b>';
$table->data[0][1] = html_print_select(
[],
'selected_interfaces[]',
'',
'',
'',
0,
true,
true,
true,
'',
false,
'min-width: 180px; max-width: 200px;'
$table->data[0][0] = html_print_label_input_block(
__('Interfaces'),
html_print_select(
[],
'selected_interfaces[]',
'',
'',
'',
0,
true,
true,
true,
'',
false,
'min-width: 200px; max-width: 250px; min-height: 70px;'
)
);
$filters = '<form method="post" action="'.ui_get_url_refresh().'">';
$filters .= html_print_table($table, true);
$filters .= "<div class='height_100p right'>".html_print_submit_button(
$filters .= html_print_submit_button(
__('Show'),
'uptbutton',
false,
'class="sub search mgn_tp_0"',
['class' => 'float-right mini'],
true
).'</div>';
);
$filters .= '</form>';
}

View File

@ -94,6 +94,19 @@ if (!empty($table->data)) {
echo '<div id="log_sources_status" class="w100p">';
html_print_table($table);
echo '</div>';
$html_content = ob_get_clean();
// Create controlled toggle content.
ui_toggle(
$html_content,
__('Log sources status'),
'log_sources_status',
!$log_sources_defined,
false,
'',
'white_table_graph_content no-padding-imp',
'white-box-content',
'box-flat white_thable_graph mrgn_top_30px'
);
} else {
ui_print_info_message(['no_close' => true, 'message' => __('No log sources found') ]);
$log_sources_defined = false;
@ -109,18 +122,6 @@ html_print_input_hidden('redirect_search', 1, false);
echo '</form>';
$html_content = ob_get_clean();
// Create controlled toggle content.
ui_toggle(
$html_content,
__('Log sources status'),
'log_sources_status',
!$log_sources_defined,
false,
'',
'white_table_graph_content no-padding-imp'
);
?>

View File

@ -1940,6 +1940,12 @@ if ((bool) $config['pure'] === false) {
'link' => '',
'label' => $tab_name,
],
],
[
'id_element' => $id_agente,
'url' => 'operation/agentes/ver_agente&id_agente='.$id_agente,
'label' => agents_get_alias($id_agente),
'section' => 'Agents',
]
);
}

View File

@ -127,3 +127,33 @@ if (empty($form) === false) {
// Print always go back button.
HTML::printForm($wizard->getGoBackForm(), false);
html_print_action_buttons(
'',
[]
);
?>
<script type="text/javascript">
$(document).ready(function() {
var buttonnext = $('#button-next').parent().html();
$('#button-next').hide();
var buttonnext = buttonnext.replace('button-next','button-next_copy');
var buttonback = $('#button-submit').parent().html();
$('#button-submit').hide();
var buttonback = buttonback.replace('button-submit','button-submit_copy');
$('.action_buttons_right_content').parent().html(buttonnext+buttonback);
var style = $('#principal_action_buttons').attr('style');
$('#principal_action_buttons').attr('style',style+' justify-content: unset;');
// Button next/finish on action buttons.
$('#button-next_copy').click(function(){
$('#button-next').trigger('click');
});
// Button back on action buttons.
$('#button-submit_copy').click(function(){
$('#button-submit').trigger('click');
});
});
</script>

View File

@ -50,7 +50,7 @@ try {
'known_status',
[
'text' => 'options',
'class' => 'action_buttons',
'class' => 'table_action_buttons',
],
];
@ -102,6 +102,7 @@ try {
],
],
],
'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar',
]
);
} catch (Exception $e) {
@ -109,24 +110,20 @@ try {
}
if (check_acl($config['id_user'], 0, 'AW')) {
HTML::printForm(
$buttons[] = html_print_submit_button(
__('New cluster'),
'submit',
false,
[
'form' => [
'method' => 'POST',
'action' => ui_get_full_url($model->url.'&op=new'),
],
'inputs' => [
[
'class' => 'w100p',
'arguments' => [
'name' => 'submit',
'label' => __('New cluster'),
'type' => 'submit',
'attributes' => 'class="sub next"',
'return' => true,
],
],
],
]
'class' => 'sub ok',
'icon' => 'next',
],
true
);
echo '<form action="'.ui_get_full_url($model->url.'&op=new').'" method="POST">';
html_print_action_buttons(
implode('', $buttons),
['type' => 'form_action']
);
echo '</form>';
}

View File

@ -358,17 +358,13 @@ $map_manager = new NetworkMap(
*
*/
$table_events = '<div class="white_table_graph" id="table_events">';
$table_events .= '<div class="white_table_graph_header">';
$table_events .= html_print_image(
'images/arrow_down_green.png',
true
);
$table_events .= '<span>';
$table_events = '<div class="white_table_graph" id="table_events" style="width:100%">';
$table_events .= '<div class="agent_details_header">';
$table_events .= '<b><span style="font-size: medium;font-weight:bold">';
$table_events .= __('Events (Last 24h)');
$table_events .= '</span>';
$table_events .= '</span></b>';
$table_events .= '</div>';
$table_events .= '<div class="white_table_graph_content white-table-graph-content">';
$table_events .= '<div class="white-table-graph-content">';
$table_events .= graph_graphic_agentevents(
$cluster->agent()->id_agente(),
95,
@ -384,29 +380,34 @@ $table_events .= '</div>';
?>
<div id="agent_details_first_row" class="w100p cluster-agent-data">
<div class="box-flat agent_details_col agent_details_col_left">
<div class="agent_details_header">
<?php echo $table_agent_header; ?>
</div>
<div class="agent_details_content">
<div class="agent_details_graph">
<?php echo $table_agent_graph; ?>
<div class="agent_details_bullets">
<?php echo $table_agent_count_modules; ?>
<div class="flex">
<div class="box-flat agent_details_col agent_details_col_left" style="width:50%">
<div class="agent_details_header">
<?php echo $table_agent_header; ?>
</div>
<div class="agent_details_content">
<div class="agent_details_graph">
<?php echo $table_agent_graph; ?>
<div class="agent_details_bullets">
<?php echo $table_agent_count_modules; ?>
</div>
</div>
<div class="agent_details_info">
<?php
echo $alive_animation;
echo $table_agent_os;
echo $table_agent_ip;
echo $table_agent_version;
echo $table_agent_description;
?>
</div>
</div>
<div class="agent_details_info">
<?php
echo $alive_animation;
echo $table_agent_os;
echo $table_agent_ip;
echo $table_agent_version;
echo $table_agent_description;
?>
</div>
</div>
<div class="box-flat agent_details_col" style="width:50%">
<?php echo $table_events; ?>
</div>
</div>
<div class="box-flat agent_details_col agent_details_col_right">
<div class="cluster-map">
<?php $map_manager->printMap(); ?>
@ -414,10 +415,6 @@ $table_events .= '</div>';
</div>
</div>
<div class="w100p cluster-events-graph">
<?php echo $table_events; ?>
</div>
<div id='cluster-modules' class="w100p modules">
<?php
$id_agente = $cluster->agent()->id_agente();
@ -427,28 +424,22 @@ require_once $config['homedir'].'/operation/agentes/estado_monitores.php';
<?php
HTML::printForm(
$buttons[] = html_print_submit_button(
__('Reload'),
'submit',
false,
[
'form' => [
'action' => $model->url.'&op=view&id='.$cluster->id(),
'method' => 'POST',
],
'inputs' => [
[
'arguments' => [
'name' => 'submit',
'label' => __('Reload'),
'type' => 'submit',
'attributes' => 'class="sub cancel"',
'return' => true,
],
],
],
'class' => 'sub ok',
'icon' => 'next',
],
false
true
);
echo '<br/>';
echo '<form action="'.$model->url.'&op=view&id='.$cluster->id().'" method="POST">';
html_print_action_buttons(
implode('', $buttons),
['type' => 'form_action']
);
echo '</form>';
// Print always go back button.
HTML::printForm($model->getGoBackForm(), false);

View File

@ -73,10 +73,13 @@ $output .= '<p id="text_tip">';
$output .= $text;
$output .= '</p>';
$link_class = 'invisible';
if (empty($url) === false && $url !== '') {
$output .= '<a href="'.$url.'" target="_blank" id="url_tip">'.__('See more info').'<span class="arrow_tips">→</span></a>';
$link_class = '';
}
$output .= '<a href="'.$url.'" class="'.$link_class.'" target="_blank" id="url_tip">'.__('See more info').'</a>';
$output .= '</div>';
$output .= '<div class="ui-dialog-buttonset">';
@ -116,7 +119,7 @@ if ($preview === true) {
'',
[
'onclick' => 'next_tip()',
'class' => 'mini',
'class' => ($totalTips === '1') ? 'mini hide-button' : 'mini',
],
true
);