Merge branch 'ent-9662-Restyling-fuentes-colores-botones' of brutus.artica.es:artica/pandorafms into ent-9662-Restyling-fuentes-colores-botones

This commit is contained in:
Jose Gonzalez 2023-02-28 09:36:21 +01:00
commit ce5ccbec5d
59 changed files with 2988 additions and 490 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.769-230227
Version: 7.0NG.769-230228
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.769-230227"
pandora_version="7.0NG.769-230228"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -1023,7 +1023,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.769';
use constant AGENT_BUILD => '230227';
use constant AGENT_BUILD => '230228';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.769
%define release 230227
%define release 230228
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.769
%define release 230227
%define release 230228
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.769"
PI_BUILD="230227"
PI_BUILD="230228"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{230227}
{230228}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.769 Build 230227")
#define PANDORA_VERSION ("7.0NG.769 Build 230228")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.769(Build 230227))"
VALUE "ProductVersion", "(7.0NG.769(Build 230228))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.769-230227
Version: 7.0NG.769-230228
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.769-230227"
pandora_version="7.0NG.769-230228"
package_pear=0
package_pandora=1

View File

@ -230,7 +230,7 @@ function dbmgr_extension_main()
'dbport' => $node->dbport(),
'dbname' => $node->dbname(),
'dbuser' => $node->dbuser(),
'dbpass' => $node->dbpass(),
'dbpass' => io_output_password($node->dbpass()),
]
);
$error = '';

View File

@ -89,8 +89,7 @@ $password_fields = [];
// If there are $macros, we create the form fields
if (!empty($macros)) {
$macros = json_decode($macros, true);
$macros = json_decode(io_safe_output($macros), true);
foreach ($macros as $k => $m) {
$data = [];
$data[0] = $m['desc'];

View File

@ -391,7 +391,7 @@ foreach ($actions as $action) {
$data = [];
$data[0] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_action&id='.$action['id'].'&pure='.$pure.'">'.$action['name'].'</a>';
$data[0] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_action&id='.$action['id'].'&pure='.$pure.'&offset='.$offset.'">'.$action['name'].'</a>';
if ($action['id_group'] == 0 && $can_edit_all == false) {
$data[0] .= ui_print_help_tip(__('You cannot edit this action, You don\'t have the permission to edit All group.'), true);
}
@ -467,7 +467,7 @@ if (isset($data)) {
if (is_management_allowed() === true) {
echo '<div class="action-buttons" style="width: '.$table->width.'">';
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_action&pure='.$pure.'">';
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_action&pure='.$pure.'&offset='.$offset.'">';
html_print_submit_button(__('Create'), 'create', false, 'class="sub next"');
html_print_input_hidden('create_alert', 1);
echo '</form>';

View File

@ -795,15 +795,16 @@ foreach ($commands as $command) {
);
$data['action'] = '';
$table->cellclass[]['action'] = 'table_action_buttons';
$offset_delete = ($offset >= ($total_commands - 1)) ? ($offset - $limit) : $offset;
// (IMPORTANT, DO NOT CHANGE!) only users with permissions over "All" group have access to edition of commands belonging to "All" group.
if ($is_management_allowed === true && !$command['internal'] && check_acl_restricted_all($config['id_user'], $command['id_group'], 'LM')) {
if (is_user_admin($config['id_user']) === true) {
$data['action'] = '<span class="inline_flex">';
$data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&amp;copy_command=1&id='.$command['id'].'&pure='.$pure.'"
$data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&amp;copy_command=1&id='.$command['id'].'&pure='.$pure.'&offset='.$offset.'"
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/copy.png', true, ['class' => 'invert_filter']).'</a>';
$data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&delete_command=1&id='.$command['id'].'&pure='.$pure.'"
$data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&delete_command=1&id='.$command['id'].'&pure='.$pure.'&offset='.$offset_delete.'"
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).'</a>';
$data['action'] .= '</span>';
}

View File

@ -352,7 +352,8 @@ if ($search_string) {
$filter[] = "(name LIKE '%".$search_string."%' OR description LIKE '%".$search_string."%' OR value LIKE '%".$search_string."%')";
}
$filter['offset'] = (int) get_parameter('offset');
$offset = (int) get_parameter('offset');
$filter['offset'] = $offset;
$filter['limit'] = (int) $config['block_size'];
if (!is_user_admin($config['id_user'])) {
$filter['id_group'] = array_keys(users_get_groups(false, 'LM'));
@ -420,7 +421,7 @@ foreach ($templates as $template) {
&& check_acl($config['id_user'], $template['id_group'], 'LM')
) {
$table->cellclass[][4] = 'table_action_buttons';
$data[4] = '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'" class="float-left inline_line">';
$data[4] = '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'&offset='.$offset.'" class="float-left inline_line">';
$data[4] .= html_print_input_hidden('duplicate_template', 1, true);
$data[4] .= html_print_input_hidden('source_id', $template['id'], true);
$data[4] .= html_print_input_image(

View File

@ -372,8 +372,9 @@ for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
);
}
$offset = (int) get_parameter('offset', 0);
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions&pure='.$pure.'">';
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions&pure='.$pure.'&offset='.$offset.'">';
$table_html = html_print_table($table, true);
echo $table_html;

View File

@ -1147,9 +1147,10 @@ if ($step == 2) {
echo ui_get_using_system_timezone_warning();
}
$offset = (int) get_parameter('offset');
// If it's the last step it will redirect to template lists.
if ($step >= LAST_STEP) {
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_templates&pure='.$pure.'">';
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_templates&pure='.$pure.'&offset='.$offset.'">';
} else {
echo '<form method="post">';
}

View File

@ -57,6 +57,7 @@ $custom_id = '';
$create_group = (bool) get_parameter('create_group');
$id_group = (int) get_parameter('id_group');
$offset = (int) get_parameter('offset', 0);
if ($id_group) {
$group = db_get_row('tmodule_group', 'id_mg', $id_group);
@ -86,9 +87,9 @@ $table->data[1][0] = html_print_input_text('name', $name, '', 35, 100, true);
echo '</span>';
if (is_metaconsole() === true) {
$formUrl = 'index.php?sec=advanced&sec2=advanced/component_management&tab=module_group';
$formUrl = 'index.php?sec=advanced&sec2=advanced/component_management&tab=module_group&offset='.$offset;
} else {
$formUrl = 'index.php?sec=gmodules&sec2=godmode/groups/modu_group_list';
$formUrl = 'index.php?sec=gmodules&sec2=godmode/groups/modu_group_list&offset='.$offset;
}
echo '<form name="grupo" method="POST" action="'.$formUrl.'">';

View File

@ -273,18 +273,18 @@ if (empty($groups) === false) {
}
$table->data = [];
$offset_delete = ($offset >= $total_groups - 1) ? ($offset - $config['block_size']) : $offset;
foreach ($groups as $id_group) {
$data = [];
$data[0] = $id_group['id_mg'];
if ($is_management_allowed === true) {
$data[1] = '<strong><a href="index.php?sec=gmodules&sec2=godmode/groups/configure_modu_group&id_group='.$id_group['id_mg'].'">'.ui_print_truncate_text($id_group['name'], GENERIC_SIZE_TEXT).'</a></strong>';
$data[1] = '<strong><a href="index.php?sec=gmodules&sec2=godmode/groups/configure_modu_group&id_group='.$id_group['id_mg'].'&offset='.$offset.'">'.ui_print_truncate_text($id_group['name'], GENERIC_SIZE_TEXT).'</a></strong>';
if (is_metaconsole() === true) {
$data[2] = '<a href="index.php?sec=advanced&sec2=advanced/component_management&tab=module_group&id_group='.$id_group['id_mg'].'&delete_group=1" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']).'</a>';
$data[2] = '<a href="index.php?sec=advanced&sec2=advanced/component_management&tab=module_group&id_group='.$id_group['id_mg'].'&delete_group=1&offset='.$offset_delete.'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']).'</a>';
} else {
$table->cellclass[][2] = 'table_action_buttons';
$data[2] = '<a href="index.php?sec=gmodules&sec2=godmode/groups/modu_group_list&id_group='.$id_group['id_mg'].'&delete_group=1" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']).'</a>';
$data[2] = '<a href="index.php?sec=gmodules&sec2=godmode/groups/modu_group_list&id_group='.$id_group['id_mg'].'&delete_group=1&offset='.$offset_delete.'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']).'</a>';
}
} else {
$data[1] = '<strong>';

View File

@ -2094,46 +2094,21 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
switch ($field) {
case 'id_plugin':
if ($value != 0) {
$value_field_1 = get_parameter('_field1_', '');
$value_field_1_desc = get_parameter('desc_field1_', '');
$value_field_2 = get_parameter('_field2_', '');
$value_field_2_desc = get_parameter('desc_field2_', '');
$value_field_3 = get_parameter('_field3_', '');
$value_field_3_desc = get_parameter('desc_field3_', '');
$value_field_4 = get_parameter('_field4_', '');
$value_field_4_desc = get_parameter('desc_field4_', '');
$value_field_5 = get_parameter('_field5_', '');
$value_field_5_desc = get_parameter('desc_field5_', '');
$values['macros'] = '{"1":{"macro":"_field1_","desc":"'.io_safe_input($value_field_1_desc).'","help":"'.io_safe_input($value_field_1_desc).'","value":"'.$value_field_1.'"}';
if ($value_field_2_desc != '') {
$values['macros'] .= ',"2":{"macro":"_field2_","desc":"'.io_safe_input($value_field_2_desc).'","help":"'.io_safe_input($value_field_2_desc).'","value":"'.$value_field_2.'"}';
if ($value_field_3_desc != '') {
$values['macros'] .= ',"3":{"macro":"_field3_","desc":"'.io_safe_input($value_field_3_desc).'","help":"'.io_safe_input($value_field_3_desc).'","value":"'.$value_field_3.'"}';
if ($value_field_4_desc != '') {
$values['macros'] .= ',"4":{"macro":"_field4_","desc":"'.io_safe_input($value_field_4_desc).'","help":"'.io_safe_input($value_field_4_desc).'","value":"'.$value_field_4.'"}';
if ($value_field_5_desc != '') {
$values['macros'] .= ',"5":{"macro":"_field5_","desc":"'.io_safe_input($value_field_5_desc).'","help":"'.io_safe_input($value_field_5_desc).'","value":"'.$value_field_5.'"}';
} else {
$values['macros'] .= '}';
}
} else {
$values['macros'] .= '}';
}
} else {
$values['macros'] .= '}';
for ($i = 0; $i <= 15; $i++) {
$value_field = get_parameter('_field'.$i.'_', '');
$value_field_desc = get_parameter('desc_field'.$i.'_', '');
if ($value_field_desc != '') {
$values['macros'][$i] = [
'macro' => '_field'.$i.'_',
'desc' => io_safe_input($value_field_desc),
'help' => io_safe_input($value_field_desc),
'value' => $value_field,
];
}
} else {
$values['macros'] .= '}';
}
$values['macros'] = json_encode($values['macros']);
$values[$field] = $value;
}
break;
@ -2260,7 +2235,7 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
// Apply at All agents (within valid groups).
$modules = db_get_all_rows_sql(
sprintf(
'SELECT tam.id_agente_modulo, tam.id_tipo_modulo
'SELECT tam.id_agente_modulo, tam.id_tipo_modulo,tam.macros, tam.id_plugin
FROM tagente_modulo tam INNER JOIN tagente ta
ON ta.id_agente = tam.id_agente
WHERE ta.id_grupo IN (%s) %s;',
@ -2277,6 +2252,8 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
[
'id_agente_modulo',
'id_tipo_modulo',
'macros',
'id_plugin',
]
);
} else {
@ -2289,6 +2266,8 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
[
'id_agente_modulo',
'id_tipo_modulo',
'macros',
'id_plugin',
]
);
}
@ -2346,6 +2325,23 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
}
}
if ($module['macros'] && $module['id_plugin'] == $values['id_plugin']) {
$module_macros = json_decode($module['macros'], true);
$values_macros = json_decode($values['macros'], true);
foreach ($values_macros as $k => $value_macro) {
foreach ($module_macros as $s => $module_macro) {
if ($value_macro['macro'] == $module_macro['macro'] && $value_macro['value'] !== '') {
$module_macros[$s]['value'] = $value_macro['value'];
$module_macros[$s]['desc'] = $value_macro['desc'];
$module_macros[$s]['help'] = $value_macro['help'];
}
}
}
$values['macros'] = json_encode($module_macros);
}
$result = modules_update_agent_module(
$module['id_agente_modulo'],
$values,

View File

@ -606,9 +606,10 @@ if ((bool) $id !== false || $new_component
$search_id_group = (int) get_parameter('search_id_group');
$search_string = (string) get_parameter('search_string');
$offset = (int) get_parameter('offset');
$url = ui_get_url_refresh(
[
'offset' => false,
'offset' => $offset,
'search_string' => $search_string,
'search_id_group' => $search_id_group,
'id' => $id,
@ -616,7 +617,7 @@ $url = ui_get_url_refresh(
true,
false
);
$name_url = 'index.php?sec=templates&sec2=godmode/modules/manage_network_components';
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
@ -721,6 +722,8 @@ $total_components = network_components_get_network_components(
'COUNT(*) AS total'
);
$total_components = $total_components[0]['total'];
$offset_delete = ($offset >= ($total_components - 1)) ? ($offset - $config['block_size']) : $offset;
ui_pagination($total_components, $name_url);
$filter['offset'] = (int) get_parameter('offset');
$filter['limit'] = (int) $config['block_size'];
$components = network_components_get_network_components(
@ -799,7 +802,7 @@ foreach ($components as $component) {
true
);
$data[0] = '<a href="index.php?sec='.$sec.'&sec2=godmode/modules/manage_network_components&id='.$component['id_nc'].'&pure='.$pure.'">';
$data[0] = '<a href="index.php?sec='.$sec.'&sec2=godmode/modules/manage_network_components&id='.$component['id_nc'].'&pure='.$pure.'&offset='.$offset.'">';
$data[0] .= io_safe_output($component['name']);
$data[0] .= '</a>';
} else {
@ -818,7 +821,7 @@ foreach ($components as $component) {
$data[6] = html_print_anchor(
[
'href' => $url.'&search_id_group='.$search_id_group.'search_string='.$search_string.'&duplicate_network_component=1&source_id='.$component['id_nc'],
'href' => $url.'&search_id_group='.$search_id_group.'search_string='.$search_string.'&duplicate_network_component=1&source_id='.$component['id_nc'].'&offset='.$offset,
'content' => html_print_image(
'images/copy.svg',
true,
@ -833,7 +836,7 @@ foreach ($components as $component) {
$data[6] .= html_print_anchor(
[
'href' => $url.'&delete_component=1&id='.$component['id_nc'].'&search_id_group='.$search_id_group.'search_string='.$search_string,
'href' => $url.'&delete_component=1&id='.$component['id_nc'].'&search_id_group='.$search_id_group.'search_string='.$search_string.'&offset='.$offset_delete,
'onClick' => 'if (! confirm (\''.__('Are you sure?').'\')) return false',
'content' => html_print_image(
'images/delete.svg',
@ -866,8 +869,6 @@ html_print_table($table);
html_print_input_hidden('multiple_delete', 1);
echo '</form>';
$actionButtons = [];
if (isset($data) === false) {
ui_print_info_message(
[
@ -877,6 +878,7 @@ if (isset($data) === false) {
);
}
$actionButtons = [];
if ($is_management_allowed === true) {
$actionButtons[] = html_print_submit_button(
__('Create'),

View File

@ -151,6 +151,9 @@ if ($update_config == 1 && $config['history_db_enabled'] == 1) {
}
}
$total_agents = db_get_value('count(*)', 'tagente');
$disable_agentaccess = ($total_agents >= 200 && $config['agentaccess'] == 0) ? true : false;
$table_status = new StdClass();
$table_status->width = '100%';
$table_status->class = 'databox filters';
@ -590,7 +593,7 @@ $table_other->data[$i++][1] = html_print_input_text(
);
$table_other->data[$i][0] = __('Use agent access graph');
$table_other->data[$i++][1] = html_print_checkbox_switch('agentaccess', 1, $config['agentaccess'], true);
$table_other->data[$i++][1] = html_print_checkbox_switch('agentaccess', 1, $config['agentaccess'], true, $disable_agentaccess);
$table_other->data[$i][0] = __('Max. recommended number of files in attachment directory');
$table_other->data[$i++][1] = html_print_input_text(

View File

@ -314,37 +314,41 @@ if ($edit_filter > -2) {
$table->size[2] = '65px';
$table->align[2] = 'center';
foreach ($aglomerate_result as $ind => $row) {
if ($ind == 0) {
foreach ($row as $r) {
$data = [];
$data[0] = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$r['id_snmp_filter'].'">'.$r['description'].'</a>';
$data[1] = $r['filter'];
$data[2] = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$r['id_snmp_filter'].'">'.html_print_image('images/support@svg.svg', true, ['border' => '0', 'alt' => __('Update'), 'class' => 'invert_filter main_menu_icon']).'</a>'.'&nbsp;&nbsp;<a onclick="if (confirm(\''.__('Are you sure?').'\')) return true; else return false;" href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&delete_filter='.$r['id_snmp_filter'].'">'.html_print_image('images/delete.svg', true, ['border' => '0', 'alt' => __('Delete'), 'class' => 'invert_filter main_menu_icon']).'</a>';
array_push($table->data, $data);
}
} else {
$ind2 = 0;
$compose_filter = [];
$compose_id = '';
$compose_action = '';
foreach ($row as $i => $r) {
if ($ind2 == 0) {
$compose_id = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$r['id_snmp_filter'].'">'.$r['description'].'</a>';
$compose_action = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$r['id_snmp_filter'].'">'.html_print_image('images/support@svg.svg', true, ['border' => '0', 'alt' => __('Update'), 'class' => 'invert_filter main_menu_icon']).'</a>'.'&nbsp;&nbsp;<a onclick="if (confirm(\''.__('Are you sure?').'\')) return true; else return false;" href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&delete_filter='.$r['id_snmp_filter'].'">'.html_print_image('images/delete.svg', true, ['border' => '0', 'alt' => __('Delete'), 'class' => 'invert_filter main_menu_icon']).'</a>';
$ind2++;
if (empty($aglomerate_result) === false) {
foreach ($aglomerate_result as $ind => $row) {
if ($ind == 0) {
foreach ($row as $r) {
$data = [];
$data[0] = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$r['id_snmp_filter'].'">'.$r['description'].'</a>';
$data[1] = $r['filter'];
$data[2] = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$r['id_snmp_filter'].'">'.html_print_image('images/support@svg.svg', true, ['border' => '0', 'alt' => __('Update'), 'class' => 'invert_filter main_menu_icon']).'</a>'.'&nbsp;&nbsp;<a onclick="if (confirm(\''.__('Are you sure?').'\')) return true; else return false;" href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&delete_filter='.$r['id_snmp_filter'].'">'.html_print_image('images/delete.svg', true, ['border' => '0', 'alt' => __('Delete'), 'class' => 'invert_filter main_menu_icon']).'</a>';
array_push($table->data, $data);
}
} else {
$ind2 = 0;
$compose_filter = [];
$compose_id = '';
$compose_action = '';
foreach ($row as $i => $r) {
if ($ind2 == 0) {
$compose_id = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$r['id_snmp_filter'].'">'.$r['description'].'</a>';
$compose_action = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$r['id_snmp_filter'].'">'.html_print_image('images/support@svg.svg', true, ['border' => '0', 'alt' => __('Update'), 'class' => 'invert_filter main_menu_icon']).'</a>'.'&nbsp;&nbsp;<a onclick="if (confirm(\''.__('Are you sure?').'\')) return true; else return false;" href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&delete_filter='.$r['id_snmp_filter'].'">'.html_print_image('images/delete.svg', true, ['border' => '0', 'alt' => __('Delete'), 'class' => 'invert_filter main_menu_icon']).'</a>';
$ind2++;
}
$compose_filter[] = $r['filter'];
}
$compose_filter[] = $r['filter'];
$data = [];
$data[0] = $compose_id;
$data[1] = implode(' AND ', $compose_filter);
$data[2] = $compose_action;
$table->cellclass[][2] = 'table_action_buttons';
array_push($table->data, $data);
}
$data = [];
$data[0] = $compose_id;
$data[1] = implode(' AND ', $compose_filter);
$data[2] = $compose_action;
$table->cellclass[][2] = 'table_action_buttons';
array_push($table->data, $data);
}
} else {
ui_print_info_message(['no_close' => true, 'message' => __('There are no SNMP Filters defined yet.') ]);
}
if (!empty($table->data)) {

View File

@ -207,14 +207,14 @@ if (empty($tag_name) === false) {
// If the user has filtered the view.
$filter_performed = !empty($filter);
$filter['offset'] = (int) get_parameter('offset');
$offset = (int) get_parameter('offset');
$filter['offset'] = $offset;
$filter['limit'] = (int) $config['block_size'];
// Statements for pagination.
$url = ui_get_url_refresh();
$url = 'index.php?sec=gusuarios&sec2=godmode/tag/tag';
$total_tags = tags_get_tag_count($filter);
$offset_delete = ($offset >= ($total_tags - 1)) ? ($offset - $config['block_size']) : $offset;
$result = tags_search_tag(false, $filter);
// Filter form.
@ -392,7 +392,7 @@ if (empty($result) === false) {
]
);
$data[6] .= '</a>';
$data[6] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/tag/tag&delete_tag='.$tag['id_tag'].'"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">'.html_print_image(
$data[6] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/tag/tag&delete_tag='.$tag['id_tag'].'&offset='.$offset_delete.'"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">'.html_print_image(
'images/cross.png',
true,
[

View File

@ -855,7 +855,7 @@ foreach ($info as $user_id => $user_info) {
true
);
/*
$data[6] = '<form method="POST" action="index.php?sec='.$sec.'&amp;sec2=godmode/users/user_list&amp;pure='.$pure.'" class="inline">';
$data[6] = '<form method="POST" action="index.php?sec='.$sec.'&amp;sec2=godmode/users/user_list&amp;pure='.$pure.'&offset='.$offset.'" class="inline">';
$data[6] .= html_print_input_hidden(
'id',
$user_info['id_user'],
@ -932,7 +932,8 @@ foreach ($info as $user_id => $user_info) {
&& isset($user_info['not_delete']) === false
) {
/*
$data[6] .= '<form method="POST" action="index.php?sec='.$sec.'&amp;sec2=godmode/users/user_list&amp;pure='.$pure.'" class="inline">';
$offset_delete = ($offset >= count($info) - 1) ? ($offset - $config['block_size']) : $offset;
$data[6] .= '<form method="POST" action="index.php?sec='.$sec.'&amp;sec2=godmode/users/user_list&amp;pure='.$pure.'&offset='.$offset_delete.'" class="inline">';
$data[6] .= html_print_input_hidden(
'delete_user',
$user_info['id_user'],

View File

@ -254,8 +254,8 @@ class AgentsAlerts extends HTML
$table->head[2] = __('Actions');
$table->style[0] = 'width: 25%;';
$table->style[1] = 'width: 33%;';
$table->style[2] = 'width: 33%;';
$table->style[1] = 'width: 70%;';
$table->style[2] = 'width: 5%;';
foreach ($agent_modules as $agent_module) {
// Let's build the table.
@ -268,7 +268,11 @@ class AgentsAlerts extends HTML
'javascript:show_add_alerts(\'%s\')',
$uniqid
),
'content' => html_print_image('images/add_mc.png', true),
'content' => html_print_image(
'images/add_mc.png',
true,
['class' => 'main_menu_icon invert_filter']
),
],
true
);
@ -276,14 +280,14 @@ class AgentsAlerts extends HTML
array_push($table->data, $data);
$table2 = new stdClass();
$table2->width = '100%';
$table2->id = 'table_add_alert';
$table2->class = 'databox filters';
$table2->class = 'filter-table-adv';
$table2->size = [];
$table2->size[0] = '50%';
$table2->size[1] = '50%';
$table2->data = [];
$table2->data[0][0] = __('Actions');
$groups_user = users_get_groups($this->idUser);
if (!empty($groups_user)) {
@ -296,7 +300,7 @@ class AgentsAlerts extends HTML
$actions = db_get_all_rows_sql($sql);
}
$table2->data[0][1] = html_print_select(
$input_actions = html_print_select(
index_array($actions, 'id', 'name'),
'action_select',
'',
@ -308,24 +312,30 @@ class AgentsAlerts extends HTML
true,
'',
false,
'width: 250px;'
'width: 100%;'
);
$table2->data[0][1] .= '<span id="advanced_action" class="advanced_actions invisible"><br>';
$table2->data[0][1] .= __('Number of alerts match from').' ';
$table2->data[0][1] .= html_print_input_text('fires_min', '', '', 4, 10, true);
$table2->data[0][1] .= ' '.__('to').' ';
$table2->data[0][1] .= html_print_input_text('fires_max', '', '', 4, 10, true);
$table2->data[0][1] .= ui_print_help_icon(
$input_actions .= '<span id="advanced_action" class="advanced_actions invisible"><br>';
$input_actions .= __('Number of alerts match from').' ';
$input_actions .= html_print_input_text('fires_min', '', '', 4, 10, true);
$input_actions .= ' '.__('to').' ';
$input_actions .= html_print_input_text('fires_max', '', '', 4, 10, true);
$input_actions .= ui_print_help_icon(
'alert-matches',
true,
ui_get_full_url(false, false, false, false)
);
$table2->data[0][1] .= '</span>';
$input_actions .= '</span>';
$table2->data[0][0] = html_print_label_input_block(
__('Actions'),
$input_actions
);
// Check ACLs for LM users.
if (check_acl($this->idUser, 0, 'LM')) {
$table2->data[0][1] .= html_print_anchor(
$table2->data[0][1] = html_print_anchor(
[
'href' => 'index.php?sec=galertas&sec2=godmode/alerts/configure_alert_action&pure='.$this->pure,
'class' => 'mrgn_lft_5px',
@ -335,7 +345,6 @@ class AgentsAlerts extends HTML
);
}
$table2->data[1][0] = __('Template');
$own_info = get_user_info($this->idUser);
if ($own_info['is_admin'] || check_acl($this->idUser, 0, 'PM')) {
$templates = alerts_get_alert_templates(false, ['id', 'name']);
@ -346,22 +355,25 @@ class AgentsAlerts extends HTML
$templates = alerts_get_alert_templates(['id_group IN ('.$filter_groups.')'], ['id', 'name']);
}
$table2->data[1][1] = html_print_select(
index_array($templates, 'id', 'name'),
'template',
'',
'',
__('Select'),
0,
true,
false,
true,
'',
false,
'width: 250px;'
$table2->data[1][0] = html_print_label_input_block(
__('Template'),
html_print_select(
index_array($templates, 'id', 'name'),
'template',
'',
'',
__('Select'),
0,
true,
false,
true,
'',
false,
'width: 100%;'
)
);
$table2->data[1][1] .= html_print_anchor(
$table2->data[1][1] = html_print_anchor(
[
'href' => '#',
'class' => 'template_details invisible',
@ -372,7 +384,7 @@ class AgentsAlerts extends HTML
// Check ACLs for LM users.
if (check_acl($this->idUser, 0, 'LM')) {
$table2->data[1][1] .= html_print_anchor(
$table2->data[1][1] = html_print_anchor(
[
'href' => 'index.php?sec=galertas&sec2=godmode/alerts/configure_alert_template&pure='.$this->pure,
'style' => 'margin-left:5px;',
@ -382,18 +394,26 @@ class AgentsAlerts extends HTML
);
}
$table2->data[2][0] = __('Threshold');
$table2->data[2][1] = html_print_input_text('module_action_threshold', '0', '', 5, 7, true);
$table2->data[2][1] .= ' '.__('seconds');
$table2->data[2][0] = html_print_label_input_block(
__('Threshold'),
html_print_input_text('module_action_threshold', '0', '', 5, 7, true)
);
$content2 = '<form class="add_alert_form" method="post">';
$content2 .= html_print_table($table2, true);
$content2 .= html_print_div(
[
'class' => 'action-buttons',
'style' => 'width: '.$table2->width,
'content' => html_print_submit_button(__('Add alert'), 'add', false, 'class="sub wand"', true).html_print_input_hidden('create_alert', $uniqid, true),
'content' => html_print_submit_button(
__('Add alert'),
'add',
false,
[
'icon' => 'add',
'mode' => 'mini',
],
true
).html_print_input_hidden('create_alert', $uniqid, true),
],
true
);
@ -1041,8 +1061,8 @@ class AgentsAlerts extends HTML
resizable: true,
draggable: true,
modal: true,
height: 270,
width: 600,
height: 370,
width: 450,
overlay: {
opacity: 0.5,
background: "black"

View File

@ -258,14 +258,21 @@ class ConsoleSupervisor
$this->checkSyncQueueStatus();
}
/*
* Checkc agent missing libraries.
* NOTIF.AGENT.LIBRARY
*/
/*
* Check number of agents is equals and more than 200.
* NOTIF.ACCESSSTASTICS.PERFORMANCE
*/
$this->checkAccessStatisticsPerformance();
/*
* Checkc agent missing libraries.
* NOTIF.AGENT.LIBRARY
*/
if ((bool) enterprise_installed() === true) {
$this->checkLibaryError();
}
}
@ -527,13 +534,22 @@ class ConsoleSupervisor
$this->checkSyncQueueStatus();
}
/*
* Check number of agents is equals and more than 200.
* NOTIF.ACCESSSTASTICS.PERFORMANCE
*/
$this->checkAccessStatisticsPerformance();
/*
* Checkc agent missing libraries.
* NOTIF.AGENT.LIBRARY
*/
if ((bool) enterprise_installed() === true) {
$this->checkLibaryError();
}
}
@ -548,6 +564,34 @@ class ConsoleSupervisor
}
/**
* Check number of agents and disable agentaccess token if number
* is equals and more than 200.
*
* @return void
*/
public function checkAccessStatisticsPerformance()
{
$total_agents = db_get_value('count(*)', 'tagente');
if ($total_agents >= 200) {
db_process_sql_update('tconfig', ['value' => 0], ['token' => 'agentaccess']);
$this->notify(
[
'type' => 'NOTIF.ACCESSSTASTICS.PERFORMANCE',
'title' => __('Access statistics performance'),
'message' => __(
'Usage of agent access statistics IS NOT RECOMMENDED on systems with more than 200 agents due performance penalty'
),
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup&section=perf',
]
);
} else {
$this->cleanNotifications('NOTIF.ACCESSSTASTICS.PERFORMANCE');
}
}
/**
* Update targets for given notification using object targets.
*

View File

@ -20,7 +20,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC230227';
$build_version = 'PC230228';
$pandora_version = 'v7.0NG.769';
// Do not overwrite default timezone set if defined.

View File

@ -11071,20 +11071,55 @@ function api_set_event_validate_filter($trash1, $trash2, $other, $trash3)
function api_set_validate_events($id_event, $trash1, $other, $return_type, $user_in_db)
{
$text = $other['data'];
$node_int = 0;
if ($other['type'] == 'string') {
returnError('Parameter error.');
return;
} else if ($other['type'] == 'array') {
$text = $other['data'][0];
if (is_metaconsole() === true) {
if (isset($other['data'][1]) === true
&& empty($other['data'][1]) === false
) {
$node_int = $other['data'][1];
}
}
}
// Set off the standby mode when close an event
$event = events_get_event($id_event);
alerts_agent_module_standby($event['id_alert_am'], 0);
try {
if (is_metaconsole() === true
&& (int) $node_int > 0
) {
$node = new Node($node_int);
$node->connect();
}
$result = events_change_status($id_event, EVENT_VALIDATE);
// Set off the standby mode when close an event
$event = events_get_event($id_event);
alerts_agent_module_standby($event['id_alert_am'], 0);
$result = events_change_status($id_event, EVENT_VALIDATE);
if ($result) {
if (!empty($text)) {
// Set the comment for the validation
events_comment($id_event, $text);
}
} catch (\Exception $e) {
if (is_metaconsole() === true
&& $node_int > 0
) {
$node->disconnect();
}
$result = false;
} finally {
if (is_metaconsole() === true
&& $node_int > 0
) {
$node->disconnect();
}
}
if ($result) {
returnData(
'string',
[

View File

@ -687,6 +687,140 @@ function inventory_get_data(
}
function inventory_get_datatable(
$agents_ids,
$inventory_module_name,
$utimestamp,
$inventory_search_string='',
$export_csv=false,
$return_mode=false,
$order_by_agent=false
) {
global $config;
$offset = (int) get_parameter('offset');
$where = [];
array_push(
$where,
'tmodule_inventory.id_module_inventory = tagent_module_inventory.id_module_inventory'
);
// Discart empty first position.
if (isset($agents_ids[0]) === true && empty($agents_ids[0]) === true) {
unset($agents_ids[0]);
}
// If there are no agents selected.
if (empty($agents_ids) === true) {
return ERR_NODATA;
}
if (array_search(-1, $agents_ids) === false) {
array_push($where, 'id_agente IN ('.implode(',', $agents_ids).')');
}
if ($inventory_module_name[0] !== '0'
&& $inventory_module_name !== ''
&& $inventory_module_name !== 'all'
) {
array_push($where, "tmodule_inventory.name IN ('".implode("','", (array) $inventory_module_name)."')");
}
if ($inventory_search_string != '') {
array_push($where, "tagent_module_inventory.data LIKE '%".$inventory_search_string."%'");
}
$sql = 'SELECT *
FROM tmodule_inventory, tagent_module_inventory
WHERE
'.implode(' AND ', $where).'
ORDER BY tmodule_inventory.id_module_inventory LIMIT '.$offset.', '.$config['block_size'];
$sql_count = 'SELECT COUNT(*)
FROM tmodule_inventory, tagent_module_inventory
WHERE '.implode(' AND ', $where);
$rows = db_get_all_rows_sql($sql);
$count = db_get_sql($sql_count);
if ($order_by_agent === false) {
$modules = [];
$module_rows = [];
foreach ($rows as $row) {
array_push($modules, $row['name']);
}
foreach ($modules as $module) {
$rows_tmp = [];
foreach ($rows as $row) {
if ($row['name'] === $module) {
$agent_name = db_get_value_sql(
'SELECT alias
FROM tagente
WHERE id_agente = '.$row['id_agente']
);
$row['name_agent'] = $agent_name;
array_push($rows_tmp, $row);
$module_rows[$module] = $rows_tmp;
}
}
}
return $module_rows;
} else {
$agents_rows = [];
$agent_data = [];
$rows_tmp = [];
foreach ($rows as $row) {
$agent_name = db_get_value_sql(
'SELECT alias
FROM tagente
WHERE id_agente = '.$row['id_agente']
);
$row['name_agent'] = $agent_name;
$agent_data[$row['id_agente']][] = $row;
}
foreach ($agent_data as $id_agent => $rows) {
$agent_name = db_get_value_sql(
'SELECT alias
FROM tagente
WHERE id_agente = '.$id_agent
);
$rows_tmp['agent'] = $agent_name;
foreach ($rows as $row) {
if ($utimestamp > 0) {
$data_row = db_get_row_sql(
"SELECT data, timestamp
FROM tagente_datos_inventory
WHERE utimestamp <= '".$utimestamp."'
AND id_agent_module_inventory = ".$row['id_agent_module_inventory'].' ORDER BY utimestamp DESC'
);
if ($data_row !== false) {
$row['data'] = $data_row['data'];
$row['timestamp'] = $data_row['timestamp'];
} else {
continue;
}
}
}
$rows_tmp['row'] = $rows;
array_push($agents_rows, $rows_tmp);
}
return $agents_rows;
}
}
function inventory_get_dates($module_inventory_name, $inventory_agent, $inventory_id_group)
{
$sql = 'SELECT tagente_datos_inventory.utimestamp,

View File

@ -159,6 +159,7 @@ function notifications_get_subtypes(?string $source=null)
'NOTIF.SERVER.STATUS',
'NOTIF.SERVER.QUEUE',
'NOTIF.SERVER.MASTER',
'NOTIF.ACCESSSTASTICS.PERFORMANCE',
],
];

View File

@ -3438,8 +3438,8 @@ function ui_print_datatable(array $parameters)
throw new Exception('[ui_print_datatable]: Columns and columns names must have same length');
}
if (!isset($parameters['ajax_url'])) {
throw new Exception('[ui_print_datatable]: Parameter ajax_url is required');
if (!isset($parameters['ajax_url']) && !isset($parameters['data_element'])) {
throw new Exception('[ui_print_datatable]: Parameter ajax_url or data_element is required');
}
if (!isset($parameters['default_pagination'])) {
@ -3703,18 +3703,6 @@ function ui_print_datatable(array $parameters)
$pagination_class = $parameters['pagination_class'];
}
// Javascript controller.
$js = '<script type="text/javascript">
$(document).ready(function(){
$.fn.dataTable.ext.errMode = "none";
$.fn.dataTable.ext.classes.sPageButton = "'.$pagination_class.'";
var settings_datatable = {
drawCallback: function(settings) {';
if (isset($parameters['drawCallback'])) {
$js .= $parameters['drawCallback'];
}
$columns = '';
for ($i = 1; $i <= (count($parameters['columns']) - 3); $i++) {
if ($i != (count($parameters['columns']) - 3)) {
@ -3731,24 +3719,162 @@ function ui_print_datatable(array $parameters)
$export_columns = ',columns: \'th:not(:last-child)\'';
}
$js .= '
if (dt_'.$table_id.'.page.info().pages > 1) {
if (isset($parameters['ajax_url'])) {
$type_data = 'ajax: {
url: "'.ui_get_full_url('ajax.php', false, false, false).'",
type: "POST",
dataSrc: function (json) {
if($("#'.$form_id.'_search_bt") != undefined) {
$("#'.$form_id.'_loading").remove();
}
// Move elements to table_action_buttons bar.
$(".action_buttons_right_content").append($("#'.$table_id.'_wrapper > .dataTables_paginate.paging_simple_numbers"));
$(".action_buttons_right_content").append($("#'.$table_id.'_wrapper > .dataTables_length"));
$(".action_buttons_right_content").append($("#'.$table_id.'_wrapper > .dt-buttons"));
if (json.error) {
console.error(json.error);
$("#error-'.$table_id.'").html(json.error);
$("#error-'.$table_id.'").dialog({
title: "Filter failed",
width: 630,
resizable: true,
draggable: true,
modal: false,
closeOnEscape: true,
buttons: {
"Ok" : function () {
$(this).dialog("close");
}
}
}).parent().addClass("ui-state-error");
} else {';
if (isset($parameters['ajax_return_operation']) === true
&& empty($parameters['ajax_return_operation']) === false
&& isset($parameters['ajax_return_operation_function']) === true
&& empty($parameters['ajax_return_operation_function']) === false
) {
$type_data .= '
if (json.'.$parameters['ajax_return_operation'].' !== undefined) {
'.$parameters['ajax_return_operation_function'].'(json.'.$parameters['ajax_return_operation'].');
}
';
}
if (isset($parameters['ajax_postprocess'])) {
$type_data .= '
if (json.data) {
json.data.forEach(function(item) {
'.$parameters['ajax_postprocess'].'
});
} else {
json.data = {};
}';
}
$type_data .= '
return json.data;
}
},
data: function (data) {
if($("#button-'.$form_id.'_search_bt") != undefined) {
var loading = \''.html_print_image(
'images/spinner.gif',
true,
[
'id' => $form_id.'_loading',
'class' => 'loading-search-datatables-button',
]
).'\';
$("#button-'.$form_id.'_search_bt").parent().append(loading);
}
inputs = $("#'.$form_id.' :input");
values = {};
inputs.each(function() {
values[this.name] = $(this).val();
})
$.extend(data, {
filter: values,'."\n";
if (is_array($parameters['ajax_data'])) {
foreach ($parameters['ajax_data'] as $k => $v) {
$type_data .= $k.':'.json_encode($v).",\n";
}
}
$type_data .= 'page: "'.$parameters['ajax_url'].'"
});
return data;
}
},';
} else {
$type_data = 'data: '.json_encode($parameters['data_element']).',';
}
$serverside = 'true';
if (isset($parameters['data_element'])) {
$serverside = 'false';
}
// Javascript controller.
$js = '<script type="text/javascript">
$(document).ready(function(){
$.fn.dataTable.ext.errMode = "none";
$.fn.dataTable.ext.classes.sPageButton = "'.$pagination_class.'";
var settings_datatable = {
drawCallback: function(settings) {';
if (!isset($parameters['data_element'])) {
$js .= 'if (dt_'.$table_id.'.page.info().pages > 1) {
$("#'.$table_id.'_wrapper > .dataTables_paginate.paging_simple_numbers").show()
} else {
$("#'.$table_id.'_wrapper > .dataTables_paginate.paging_simple_numbers").hide()
}
},
}';
}
if (isset($parameters['drawCallback'])) {
$js .= $parameters['drawCallback'];
}
$dom_elements = '"plfrtiB"';
if (isset($parameters['dom_elements'])) {
$dom_elements = '"'.$parameters['dom_elements'].'"';
}
$searching = 'false';
if (isset($parameters['searching']) && $parameters['searching'] === true) {
$searching = 'true';
}
$ordering = 'true';
if (isset($parameters['ordering']) && $parameters['ordering'] === false) {
$ordering = 'false';
}
$js .= '},';
$languaje = substr(get_user_language(), 0, 2);
$js .= '
processing: true,
serverSide: true,
serverSide: '.$serverside.',
paging: '.$parameters['paging'].',
pageLength: '.$parameters['default_pagination'].',
searching: false,
searching: '.$searching.',
responsive: true,
dom: "frtBpl",
dom: '.$dom_elements.',
language: {
url: "/pandora_console/include/javascript/i18n/dataTables.'.$languaje.'.json",
processing:"'.$processing.'",
zeroRecords:"'.$zeroRecords.'",
emptyYable:"'.$emptyTable.'",
emptyTable:"'.$emptyTable.'",
},
buttons: '.$parameters['csv'].'== 1 ? [
{
@ -3773,102 +3899,11 @@ function ui_print_datatable(array $parameters)
}
] : [],
lengthMenu: '.json_encode($pagination_options).',
ajax: {
url: "'.ui_get_full_url('ajax.php', false, false, false).'",
type: "POST",
dataSrc: function (json) {
if($("#button-'.$form_id.'_search_bt") != undefined) {
$("#'.$form_id.'_loading").remove();
}
// Move elements to table_action_buttons bar.
$(".action_buttons_right_content").append($("#'.$table_id.'_wrapper > .dataTables_paginate.paging_simple_numbers"));
$(".action_buttons_right_content").append($("#'.$table_id.'_wrapper > .dataTables_length"));
$(".action_buttons_right_content").append($("#'.$table_id.'_wrapper > .dt-buttons"));
if (json.error) {
console.error(json.error);
$("#error-'.$table_id.'").html(json.error);
$("#error-'.$table_id.'").dialog({
title: "Filter failed",
width: 630,
resizable: true,
draggable: true,
modal: false,
closeOnEscape: true,
buttons: {
"Ok" : function () {
$(this).dialog("close");
}
}
}).parent().addClass("ui-state-error");
} else {';
if (isset($parameters['ajax_return_operation']) === true
&& empty($parameters['ajax_return_operation']) === false
&& isset($parameters['ajax_return_operation_function']) === true
&& empty($parameters['ajax_return_operation_function']) === false
) {
$js .= '
if (json.'.$parameters['ajax_return_operation'].' !== undefined) {
'.$parameters['ajax_return_operation_function'].'(json.'.$parameters['ajax_return_operation'].');
}
';
}
if (isset($parameters['ajax_postprocess'])) {
$js .= '
if (json.data) {
json.data.forEach(function(item) {
'.$parameters['ajax_postprocess'].'
});
} else {
json.data = {};
}';
}
$js .= '
return json.data;
}
},
data: function (data) {
if($("#button-'.$form_id.'_search_bt") != undefined) {
var loading = \''.html_print_image(
'images/spinner.gif',
true,
[
'id' => $form_id.'_loading',
'class' => 'loading-search-datatables-button',
]
).'\';
$("#button-'.$form_id.'_search_bt").parent().append(loading);
}
inputs = $("#'.$form_id.' :input");
values = {};
inputs.each(function() {
values[this.name] = $(this).val();
})
$.extend(data, {
filter: values,'."\n";
if (is_array($parameters['ajax_data'])) {
foreach ($parameters['ajax_data'] as $k => $v) {
$js .= $k.':'.json_encode($v).",\n";
}
}
$js .= 'page: "'.$parameters['ajax_url'].'"
});
return data;
}
},
"columnDefs": [
columnDefs: [
{ className: "no-class", targets: "_all" },
{ bSortable: false, targets: '.$no_sortable_columns.' }
],
ordering: '.$ordering.',
columns: [';
foreach ($parameters['datacolumns'] as $data) {
@ -3881,7 +3916,9 @@ function ui_print_datatable(array $parameters)
$js .= '
],
order: [[ '.$order.' ]]
order: [[ '.$order.' ]],';
$js .= $type_data;
$js .= '
};
dt_'.$table_id.' = $("#'.$table_id.'").DataTable(settings_datatable);
@ -4211,6 +4248,7 @@ function ui_print_event_priority(
* @param boolean|null $switch_on Switch enabled disabled or depending on hidden_Default.
* @param string|null $switch_name Use custom switch input name or generate one.
* @param boolean|null $disableToggle If True, the toggle is disabled.
* @param string $id_table ID of the table to apply w100p class.
*
* @return string HTML.
*/
@ -4233,7 +4271,8 @@ function ui_toggle(
$toggl_attr='',
$switch_on=null,
$switch_name=null,
$disableToggle=false
$disableToggle=false,
$id_table=false
) {
// Generate unique Id.
$uniqid = uniqid('');
@ -4366,6 +4405,11 @@ function ui_toggle(
$output .= '</div>';
$output .= '</div>';
$class_table = '';
if ($id_table !== false) {
$class_table = ' $("#'.$id_table.'_wrapper").addClass("w100p");'."\n";
}
if ($disableToggle === false) {
// JQuery Toggle.
$output .= '<script type="text/javascript">'."\n";
@ -4373,7 +4417,6 @@ function ui_toggle(
$output .= ' var is_metaconsole = '.(int) is_metaconsole().";\n";
$output .= ' /* <![CDATA[ */'."\n";
$output .= " $(document).ready (function () {\n";
$output .= " $('#image_".$uniqid."').addClass('main_menu_icon');\n";
$output .= " $('#checkbox-".$switch_name."').click(function() {\n";
$output .= ' if (is_metaconsole == 0) {';
$output .= ' if (hide_tgl_ctrl_'.$uniqid.") {\n";
@ -4394,25 +4437,23 @@ function ui_toggle(
$output .= " $('#tgl_div_".$uniqid."').css('height', 'auto');\n";
$output .= " $('#tgl_div_".$uniqid."').css('position', 'relative');\n";
$output .= " $('#image_".$uniqid."').attr({src: '".$image_a."'});\n";
$output .= " $('#image_".$uniqid."').css('rotate','90deg');\n";
$output .= " $('#checkbox-".$switch_name."').prop('checked', true);\n";
$output .= $class_table;
$output .= " }\n";
$output .= " else {\n";
$output .= ' hide_tgl_ctrl_'.$uniqid." = 1;\n";
$output .= " $('#tgl_div_".$uniqid."').css('height', 0);\n";
$output .= " $('#tgl_div_".$uniqid."').css('position', 'absolute');\n";
$output .= " $('#image_".$uniqid."').attr({src: '".$image_b."'});\n";
$output .= " $('#image_".$uniqid."').css('rotate','180deg');\n";
$output .= " $('#checkbox-".$switch_name."').prop('checked', false);\n";
$output .= " }\n";
$output .= " });\n";
$output .= " });\n";
$output .= '/* ]]> */';
$output .= '</script>';
$output .= '</div>';
}
$output .= '</div>';
if (!$return) {
echo $output;
} else {

View File

@ -0,0 +1,244 @@
{
"processing": "Processant...",
"lengthMenu": "Mostra _MENU_ registres",
"zeroRecords": "No s'han trobat registres",
"info": "Mostrant del _START_ al _END_ d'un total de _TOTAL_ registres",
"infoEmpty": "No hi ha registres disponibles",
"infoFiltered": "(filtrat de _MAX_ registres)",
"search": "Cerca:",
"infoThousands": ".",
"decimal": ",",
"loadingRecords": "Carregant...",
"paginate": {
"first": "Primer",
"previous": "Anterior",
"next": "Següent",
"last": "Darrer"
},
"aria": {
"sortAscending": ": Activa per ordenar la columna de manera ascendent",
"sortDescending": ": Activa per ordenar la columna de manera descendent"
},
"buttons": {
"print": "Imprimeix",
"copy": "Copia",
"colvis": "Columnes",
"copyTitle": "Copia al portapapers",
"copySuccess": {
"_": "%d files copiades",
"1": "1 fila copiada"
},
"pageLength": {
"-1": "Mostra totes les files",
"_": "Mostra %d files"
},
"pdf": "PDF",
"collection": "Col·lecció",
"colvisRestore": "Restaurar visibilitat",
"copyKeys": "Pressiona ctrl o poma + C per copiar les dades de la tabla al teu portapaper",
"csv": "CSV",
"excel": "Excel",
"createState": "Crear Estat",
"removeAllStates": "Borrar tots els Estats",
"removeState": "Borra",
"renameState": "Canviar nom",
"savedStates": "Estats gravats",
"stateRestore": "Restaura",
"updateState": "Actualitza"
},
"select": {
"rows": {
"_": "%d files seleccionades",
"1": "1 fila seleccionada"
},
"cells": {
"1": "1 fila seleccionada",
"_": "%d files seleccionades"
},
"columns": {
"1": "1 columna seleccionada",
"_": "%d columnes seleccionades"
}
},
"autoFill": {
"cancel": "Cancel·lar",
"fillHorizontal": "Omple les cel·les horitzontalment",
"fillVertical": "Omple les cel·les verticalment",
"fill": "Omple totes les cel·les amb <i>%d<\/i>"
},
"thousands": ".",
"datetime": {
"hours": "Hora",
"seconds": "Segons",
"unknown": "Desconegut",
"amPm": [
"am",
"pm"
],
"previous": "Anterior",
"next": "Següent",
"months": {
"11": "Desembre",
"10": "Novembre",
"9": "Octubre",
"7": "Agost",
"5": "Juny",
"4": "Maig",
"3": "Abril",
"2": "Març",
"1": "Febrer",
"0": "Gener",
"6": "Juliol",
"8": "Setembre"
},
"weekdays": {
"0": "Dg",
"2": "Dt",
"3": "Dc",
"4": "Dj",
"5": "Dv",
"6": "Ds",
"1": "Dl"
},
"minutes": "Minuts"
},
"editor": {
"close": "Tancar",
"create": {
"button": "Nou",
"title": "Crear nova entrada",
"submit": "Crear"
},
"edit": {
"button": "Editar",
"title": "Editar entrada",
"submit": "Actualitzar"
},
"remove": {
"button": "Eliminar",
"title": "Eliminar",
"submit": "Eliminar",
"confirm": {
"_": "Està segur de voler eliminar %d files?",
"1": "Està segur de voler elmiminar 1 fila?"
}
},
"error": {
"system": "Ha ocurregut un error de sistema (Més informació)"
},
"multi": {
"title": "Múltiples valors",
"restore": "Desfés el canvi",
"info": "El ítems seleccionats contenen diferents valors per aquesta entrada. Per editar i configurar tots els ítems per a aquesta entrada al mateix valor, prem o clica tabular aquí, sino, mantindran els seus valors individuals",
"noMulti": "Aquest camp pot ser editat individualment; però no com a part d'un grup"
}
},
"searchBuilder": {
"add": "Afegir condició",
"clearAll": "Eliminar tot",
"condition": "Condició",
"conditions": {
"date": {
"after": "Després",
"before": "Abans",
"between": "Entre",
"empty": "Buit",
"equals": "Iguals",
"not": "No",
"notBetween": "No entre",
"notEmpty": "No buit"
},
"number": {
"between": "Entre",
"empty": "Buit",
"equals": "Iguals",
"gt": "Major que",
"gte": "Mejor o igual a",
"lt": "Menor que",
"lte": "Menor o igual a",
"not": "No",
"notBetween": "No entre",
"notEmpty": "No buit"
},
"string": {
"contains": "Conté",
"empty": "Buit",
"endsWith": "Finalitza amb",
"equals": "Iguals",
"not": "No",
"notEmpty": "No buit",
"startsWith": "Comença amb",
"notEndsWith": "No acaba amb",
"notStartsWith": "No comença amb",
"notContains": "No inclou"
},
"array": {
"equals": "Iguals",
"empty": "Buit",
"contains": "Conté",
"not": "No",
"notEmpty": "No buit",
"without": "Sense"
}
},
"data": "Data",
"deleteTitle": "Esborrar regla de filtrat",
"leftTitle": "Criteri de desindentació",
"logicAnd": "I",
"logicOr": "O",
"rightTitle": "Criteri d'indentació",
"value": "Valor",
"title": {
"_": "Constructor de cerca (%d)",
"0": "Constructor de cerca"
},
"button": {
"_": "Constructor de cerca (%d)",
"0": "Constructor de cerca"
}
},
"searchPanes": {
"collapse": {
"0": "Panells de cerca",
"_": "Panells de cerca (%d)"
},
"count": "{total}",
"countFiltered": "{monstrat} ({total})",
"loadMessage": "Carregant panells de cerca",
"collapseMessage": "Colapsar Tot",
"clearMessage": "Esborrar tot",
"emptyPanes": "No hi ha panells de cerca",
"showMessage": "Mostrar-ho tot",
"title": "Filtres actius - %d"
},
"stateRestore": {
"removeSubmit": "Eliminar",
"removeJoiner": "i",
"removeError": "Error eliminant el registre",
"removeConfirm": "¿Segur que vol eliminar aquest %s?",
"emptyError": "El nom no pot estar buit",
"creationModal": {
"button": "Crear",
"columns": {
"search": "Cerca per columnes",
"visible": "Visibilitat de columnes"
},
"name": "Nom",
"order": "Ordenar",
"toggleLabel": "Inclou:",
"paging": "Paginació",
"scroller": "Posició Scroll",
"search": "Bñusqueda",
"searchBuilder": "Generador Búsquedes",
"title": "Crear nou Estat",
"select": "Sel·lecció"
},
"renameLabel": "Nou nom per %s",
"duplicateError": "Ja existeix un estat amb aquest nom",
"emptyStates": "No hi ha estats gravats",
"removeTitle": "Borrar Estat",
"renameButton": "Canviar nom",
"renameTitle": "Canviar nom"
},
"emptyTable": "No hi ha registres disponibles en aquesta taula"
}

View File

@ -0,0 +1,239 @@
{
"emptyTable": "No data available in table",
"info": "Showing _START_ to _END_ of _TOTAL_ entries",
"infoEmpty": "Showing 0 to 0 of 0 entries",
"infoFiltered": "(filtered from _MAX_ total entries)",
"infoThousands": ",",
"lengthMenu": "Show _MENU_ entries",
"loadingRecords": "Loading...",
"processing": "Processing...",
"search": "Search:",
"zeroRecords": "No matching records found",
"thousands": ",",
"paginate": {
"first": "First",
"last": "Last",
"next": "Next",
"previous": "Previous"
},
"aria": {
"sortAscending": ": activate to sort column ascending",
"sortDescending": ": activate to sort column descending"
},
"autoFill": {
"cancel": "Cancel",
"fill": "Fill all cells with <i>%d<\/i>",
"fillHorizontal": "Fill cells horizontally",
"fillVertical": "Fill cells vertically"
},
"buttons": {
"collection": "Collection <span class='ui-button-icon-primary ui-icon ui-icon-triangle-1-s'\/>",
"colvis": "Column Visibility",
"colvisRestore": "Restore visibility",
"copy": "Copy",
"copyKeys": "Press ctrl or u2318 + C to copy the table data to your system clipboard.<br><br>To cancel, click this message or press escape.",
"copySuccess": {
"1": "Copied 1 row to clipboard",
"_": "Copied %d rows to clipboard"
},
"copyTitle": "Copy to Clipboard",
"csv": "CSV",
"excel": "Excel",
"pageLength": {
"-1": "Show all rows",
"_": "Show %d rows"
},
"pdf": "PDF",
"print": "Print",
"updateState": "Update",
"stateRestore": "State %d",
"savedStates": "Saved States",
"renameState": "Rename",
"removeState": "Remove",
"removeAllStates": "Remove All States",
"createState": "Create State"
},
"searchBuilder": {
"add": "Add Condition",
"button": {
"0": "Search Builder",
"_": "Search Builder (%d)"
},
"clearAll": "Clear All",
"condition": "Condition",
"conditions": {
"date": {
"after": "After",
"before": "Before",
"between": "Between",
"empty": "Empty",
"equals": "Equals",
"not": "Not",
"notBetween": "Not Between",
"notEmpty": "Not Empty"
},
"number": {
"between": "Between",
"empty": "Empty",
"equals": "Equals",
"gt": "Greater Than",
"gte": "Greater Than Equal To",
"lt": "Less Than",
"lte": "Less Than Equal To",
"not": "Not",
"notBetween": "Not Between",
"notEmpty": "Not Empty"
},
"string": {
"contains": "Contains",
"empty": "Empty",
"endsWith": "Ends With",
"equals": "Equals",
"not": "Not",
"notEmpty": "Not Empty",
"startsWith": "Starts With",
"notContains": "Does Not Contain",
"notStartsWith": "Does Not Start With",
"notEndsWith": "Does Not End With"
},
"array": {
"without": "Without",
"notEmpty": "Not Empty",
"not": "Not",
"contains": "Contains",
"empty": "Empty",
"equals": "Equals"
}
},
"data": "Data",
"deleteTitle": "Delete filtering rule",
"leftTitle": "Outdent Criteria",
"logicAnd": "And",
"logicOr": "Or",
"rightTitle": "Indent Criteria",
"title": {
"0": "Search Builder",
"_": "Search Builder (%d)"
},
"value": "Value"
},
"searchPanes": {
"clearMessage": "Clear All",
"collapse": {
"0": "SearchPanes",
"_": "SearchPanes (%d)"
},
"count": "{total}",
"countFiltered": "{shown} ({total})",
"emptyPanes": "No SearchPanes",
"loadMessage": "Loading SearchPanes",
"title": "Filters Active - %d",
"showMessage": "Show All",
"collapseMessage": "Collapse All"
},
"select": {
"cells": {
"1": "1 cell selected",
"_": "%d cells selected"
},
"columns": {
"1": "1 column selected",
"_": "%d columns selected"
}
},
"datetime": {
"previous": "Previous",
"next": "Next",
"hours": "Hour",
"minutes": "Minute",
"seconds": "Second",
"unknown": "-",
"amPm": [
"am",
"pm"
],
"weekdays": [
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat"
],
"months": [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
]
},
"editor": {
"close": "Close",
"create": {
"button": "New",
"title": "Create new entry",
"submit": "Create"
},
"edit": {
"button": "Edit",
"title": "Edit Entry",
"submit": "Update"
},
"remove": {
"button": "Delete",
"title": "Delete",
"submit": "Delete",
"confirm": {
"_": "Are you sure you wish to delete %d rows?",
"1": "Are you sure you wish to delete 1 row?"
}
},
"error": {
"system": "A system error has occurred (<a target=\"\\\" rel=\"nofollow\" href=\"\\\">More information<\/a>)."
},
"multi": {
"title": "Multiple Values",
"info": "The selected items contain different values for this input. To edit and set all items for this input to the same value, click or tap here, otherwise they will retain their individual values.",
"restore": "Undo Changes",
"noMulti": "This input can be edited individually, but not part of a group. "
}
},
"stateRestore": {
"renameTitle": "Rename State",
"renameLabel": "New Name for %s:",
"renameButton": "Rename",
"removeTitle": "Remove State",
"removeSubmit": "Remove",
"removeJoiner": " and ",
"removeError": "Failed to remove state.",
"removeConfirm": "Are you sure you want to remove %s?",
"emptyStates": "No saved states",
"emptyError": "Name cannot be empty.",
"duplicateError": "A state with this name already exists.",
"creationModal": {
"toggleLabel": "Includes:",
"title": "Create New State",
"select": "Select",
"searchBuilder": "SearchBuilder",
"search": "Search",
"scroller": "Scroll Position",
"paging": "Paging",
"order": "Sorting",
"name": "Name:",
"columns": {
"visible": "Column Visibility",
"search": "Column Search"
},
"button": "Create"
}
}
}

View File

@ -0,0 +1,242 @@
{
"processing": "Procesando...",
"lengthMenu": "Mostrar _MENU_ registros",
"zeroRecords": "No se encontraron resultados",
"emptyTable": "Ningún dato disponible en esta tabla",
"infoEmpty": "Mostrando registros del 0 al 0 de un total de 0 registros",
"infoFiltered": "(filtrado de un total de _MAX_ registros)",
"search": "Buscar:",
"infoThousands": ",",
"loadingRecords": "Cargando...",
"paginate": {
"first": "Primero",
"last": "Último",
"next": "Siguiente",
"previous": "Anterior"
},
"aria": {
"sortAscending": ": Activar para ordenar la columna de manera ascendente",
"sortDescending": ": Activar para ordenar la columna de manera descendente"
},
"buttons": {
"copy": "Copiar",
"colvis": "Visibilidad",
"collection": "Colección",
"colvisRestore": "Restaurar visibilidad",
"copyKeys": "Presione ctrl o u2318 + C para copiar los datos de la tabla al portapapeles del sistema. <br \/> <br \/> Para cancelar, haga clic en este mensaje o presione escape.",
"copySuccess": {
"1": "Copiada 1 fila al portapapeles",
"_": "Copiadas %ds fila al portapapeles"
},
"copyTitle": "Copiar al portapapeles",
"csv": "CSV",
"excel": "Excel",
"pageLength": {
"-1": "Mostrar todas las filas",
"_": "Mostrar %d filas"
},
"pdf": "PDF",
"print": "Imprimir",
"renameState": "Cambiar nombre",
"updateState": "Actualizar",
"createState": "Crear Estado",
"removeAllStates": "Remover Estados",
"removeState": "Remover",
"savedStates": "Estados Guardados",
"stateRestore": "Estado %d"
},
"autoFill": {
"cancel": "Cancelar",
"fill": "Rellene todas las celdas con <i>%d<\/i>",
"fillHorizontal": "Rellenar celdas horizontalmente",
"fillVertical": "Rellenar celdas verticalmentemente"
},
"decimal": ",",
"searchBuilder": {
"add": "Añadir condición",
"button": {
"0": "Constructor de búsqueda",
"_": "Constructor de búsqueda (%d)"
},
"clearAll": "Borrar todo",
"condition": "Condición",
"conditions": {
"date": {
"after": "Despues",
"before": "Antes",
"between": "Entre",
"empty": "Vacío",
"equals": "Igual a",
"notBetween": "No entre",
"notEmpty": "No Vacio",
"not": "Diferente de"
},
"number": {
"between": "Entre",
"empty": "Vacio",
"equals": "Igual a",
"gt": "Mayor a",
"gte": "Mayor o igual a",
"lt": "Menor que",
"lte": "Menor o igual que",
"notBetween": "No entre",
"notEmpty": "No vacío",
"not": "Diferente de"
},
"string": {
"contains": "Contiene",
"empty": "Vacío",
"endsWith": "Termina en",
"equals": "Igual a",
"notEmpty": "No Vacio",
"startsWith": "Empieza con",
"not": "Diferente de",
"notContains": "No Contiene",
"notStartsWith": "No empieza con",
"notEndsWith": "No termina con"
},
"array": {
"not": "Diferente de",
"equals": "Igual",
"empty": "Vacío",
"contains": "Contiene",
"notEmpty": "No Vacío",
"without": "Sin"
}
},
"data": "Data",
"deleteTitle": "Eliminar regla de filtrado",
"leftTitle": "Criterios anulados",
"logicAnd": "Y",
"logicOr": "O",
"rightTitle": "Criterios de sangría",
"title": {
"0": "Constructor de búsqueda",
"_": "Constructor de búsqueda (%d)"
},
"value": "Valor"
},
"searchPanes": {
"clearMessage": "Borrar todo",
"collapse": {
"0": "Paneles de búsqueda",
"_": "Paneles de búsqueda (%d)"
},
"count": "{total}",
"countFiltered": "{shown} ({total})",
"emptyPanes": "Sin paneles de búsqueda",
"loadMessage": "Cargando paneles de búsqueda",
"title": "Filtros Activos - %d",
"showMessage": "Mostrar Todo",
"collapseMessage": "Colapsar Todo"
},
"select": {
"cells": {
"1": "1 celda seleccionada",
"_": "%d celdas seleccionadas"
},
"columns": {
"1": "1 columna seleccionada",
"_": "%d columnas seleccionadas"
},
"rows": {
"1": "1 fila seleccionada",
"_": "%d filas seleccionadas"
}
},
"thousands": ".",
"datetime": {
"previous": "Anterior",
"next": "Proximo",
"hours": "Horas",
"minutes": "Minutos",
"seconds": "Segundos",
"unknown": "-",
"amPm": [
"AM",
"PM"
],
"months": {
"0": "Enero",
"1": "Febrero",
"10": "Noviembre",
"11": "Diciembre",
"2": "Marzo",
"3": "Abril",
"4": "Mayo",
"5": "Junio",
"6": "Julio",
"7": "Agosto",
"8": "Septiembre",
"9": "Octubre"
},
"weekdays": [
"Dom",
"Lun",
"Mar",
"Mie",
"Jue",
"Vie",
"Sab"
]
},
"editor": {
"close": "Cerrar",
"create": {
"button": "Nuevo",
"title": "Crear Nuevo Registro",
"submit": "Crear"
},
"edit": {
"button": "Editar",
"title": "Editar Registro",
"submit": "Actualizar"
},
"remove": {
"button": "Eliminar",
"title": "Eliminar Registro",
"submit": "Eliminar",
"confirm": {
"_": "¿Está seguro que desea eliminar %d filas?",
"1": "¿Está seguro que desea eliminar 1 fila?"
}
},
"error": {
"system": "Ha ocurrido un error en el sistema (<a target=\"\\\" rel=\"\\ nofollow\" href=\"\\\">Más información&lt;\\\/a&gt;).<\/a>"
},
"multi": {
"title": "Múltiples Valores",
"info": "Los elementos seleccionados contienen diferentes valores para este registro. Para editar y establecer todos los elementos de este registro con el mismo valor, hacer click o tap aquí, de lo contrario conservarán sus valores individuales.",
"restore": "Deshacer Cambios",
"noMulti": "Este registro puede ser editado individualmente, pero no como parte de un grupo."
}
},
"info": "Mostrando _START_ a _END_ de _TOTAL_ registros",
"stateRestore": {
"creationModal": {
"button": "Crear",
"name": "Nombre:",
"order": "Clasificación",
"paging": "Paginación",
"search": "Busqueda",
"select": "Seleccionar",
"columns": {
"search": "Búsqueda de Columna",
"visible": "Visibilidad de Columna"
},
"title": "Crear Nuevo Estado",
"toggleLabel": "Incluir:"
},
"emptyError": "El nombre no puede estar vacio",
"removeConfirm": "¿Seguro que quiere eliminar este %s?",
"removeError": "Error al eliminar el registro",
"removeJoiner": "y",
"removeSubmit": "Eliminar",
"renameButton": "Cambiar Nombre",
"renameLabel": "Nuevo nombre para %s",
"duplicateError": "Ya existe un Estado con este nombre.",
"emptyStates": "No hay Estados guardados",
"removeTitle": "Remover Estado",
"renameTitle": "Cambiar Nombre Estado"
}
}

View File

@ -0,0 +1,245 @@
{
"emptyTable": "Aucune donnée disponible dans le tableau",
"loadingRecords": "Chargement...",
"processing": "Traitement...",
"select": {
"rows": {
"_": "%d lignes sélectionnées",
"1": "1 ligne sélectionnée"
},
"cells": {
"1": "1 cellule sélectionnée",
"_": "%d cellules sélectionnées"
},
"columns": {
"1": "1 colonne sélectionnée",
"_": "%d colonnes sélectionnées"
}
},
"autoFill": {
"cancel": "Annuler",
"fill": "Remplir toutes les cellules avec <i>%d<\/i>",
"fillHorizontal": "Remplir les cellules horizontalement",
"fillVertical": "Remplir les cellules verticalement"
},
"searchBuilder": {
"conditions": {
"date": {
"after": "Après le",
"before": "Avant le",
"between": "Entre",
"empty": "Vide",
"not": "Différent de",
"notBetween": "Pas entre",
"notEmpty": "Non vide",
"equals": "Égal à"
},
"number": {
"between": "Entre",
"empty": "Vide",
"gt": "Supérieur à",
"gte": "Supérieur ou égal à",
"lt": "Inférieur à",
"lte": "Inférieur ou égal à",
"not": "Différent de",
"notBetween": "Pas entre",
"notEmpty": "Non vide",
"equals": "Égal à"
},
"string": {
"contains": "Contient",
"empty": "Vide",
"endsWith": "Se termine par",
"not": "Différent de",
"notEmpty": "Non vide",
"startsWith": "Commence par",
"equals": "Égal à",
"notContains": "Ne contient pas",
"notEndsWith": "Ne termine pas par",
"notStartsWith": "Ne commence pas par"
},
"array": {
"empty": "Vide",
"contains": "Contient",
"not": "Différent de",
"notEmpty": "Non vide",
"without": "Sans",
"equals": "Égal à"
}
},
"add": "Ajouter une condition",
"button": {
"0": "Recherche avancée",
"_": "Recherche avancée (%d)"
},
"clearAll": "Effacer tout",
"condition": "Condition",
"data": "Donnée",
"deleteTitle": "Supprimer la règle de filtrage",
"logicAnd": "Et",
"logicOr": "Ou",
"title": {
"0": "Recherche avancée",
"_": "Recherche avancée (%d)"
},
"value": "Valeur",
"leftTitle": "Désindenter le critère",
"rightTitle": "Indenter le critère"
},
"searchPanes": {
"clearMessage": "Effacer tout",
"count": "{total}",
"title": "Filtres actifs - %d",
"collapse": {
"0": "Volet de recherche",
"_": "Volet de recherche (%d)"
},
"countFiltered": "{shown} ({total})",
"emptyPanes": "Pas de volet de recherche",
"loadMessage": "Chargement du volet de recherche...",
"collapseMessage": "Réduire tout",
"showMessage": "Montrer tout"
},
"buttons": {
"collection": "Collection",
"colvis": "Visibilité colonnes",
"colvisRestore": "Rétablir visibilité",
"copy": "Copier",
"copySuccess": {
"1": "1 ligne copiée dans le presse-papier",
"_": "%d lignes copiées dans le presse-papier"
},
"copyTitle": "Copier dans le presse-papier",
"csv": "CSV",
"excel": "Excel",
"pageLength": {
"-1": "Afficher toutes les lignes",
"_": "Afficher %d lignes",
"1": "Afficher 1 ligne"
},
"pdf": "PDF",
"print": "Imprimer",
"copyKeys": "Appuyez sur ctrl ou u2318 + C pour copier les données du tableau dans votre presse-papier.",
"createState": "Créer un état",
"removeAllStates": "Supprimer tous les états",
"removeState": "Supprimer",
"renameState": "Renommer",
"savedStates": "États sauvegardés",
"stateRestore": "État %d",
"updateState": "Mettre à jour"
},
"decimal": ",",
"datetime": {
"previous": "Précédent",
"next": "Suivant",
"hours": "Heures",
"minutes": "Minutes",
"seconds": "Secondes",
"unknown": "-",
"amPm": [
"am",
"pm"
],
"months": {
"0": "Janvier",
"2": "Mars",
"3": "Avril",
"4": "Mai",
"5": "Juin",
"6": "Juillet",
"8": "Septembre",
"9": "Octobre",
"10": "Novembre",
"1": "Février",
"11": "Décembre",
"7": "Août"
},
"weekdays": [
"Dim",
"Lun",
"Mar",
"Mer",
"Jeu",
"Ven",
"Sam"
]
},
"editor": {
"close": "Fermer",
"create": {
"title": "Créer une nouvelle entrée",
"button": "Nouveau",
"submit": "Créer"
},
"edit": {
"button": "Editer",
"title": "Editer Entrée",
"submit": "Mettre à jour"
},
"remove": {
"button": "Supprimer",
"title": "Supprimer",
"submit": "Supprimer",
"confirm": {
"_": "Êtes-vous sûr de vouloir supprimer %d lignes ?",
"1": "Êtes-vous sûr de vouloir supprimer 1 ligne ?"
}
},
"multi": {
"title": "Valeurs multiples",
"info": "Les éléments sélectionnés contiennent différentes valeurs pour cette entrée. Pour modifier et définir tous les éléments de cette entrée à la même valeur, cliquez ou tapez ici, sinon ils conserveront leurs valeurs individuelles.",
"restore": "Annuler les modifications",
"noMulti": "Ce champ peut être modifié individuellement, mais ne fait pas partie d'un groupe. "
},
"error": {
"system": "Une erreur système s'est produite (<a target=\"\\\" rel=\"nofollow\" href=\"\\\">Plus d'information<\/a>)."
}
},
"stateRestore": {
"removeSubmit": "Supprimer",
"creationModal": {
"button": "Créer",
"order": "Tri",
"paging": "Pagination",
"scroller": "Position du défilement",
"search": "Recherche",
"select": "Sélection",
"columns": {
"search": "Recherche par colonne",
"visible": "Visibilité des colonnes"
},
"name": "Nom :",
"searchBuilder": "Recherche avancée",
"title": "Créer un nouvel état",
"toggleLabel": "Inclus :"
},
"renameButton": "Renommer",
"duplicateError": "Il existe déjà un état avec ce nom.",
"emptyError": "Le nom ne peut pas être vide.",
"emptyStates": "Aucun état sauvegardé",
"removeConfirm": "Voulez vous vraiment supprimer %s ?",
"removeError": "Échec de la suppression de l'état.",
"removeJoiner": "et",
"removeTitle": "Supprimer l'état",
"renameLabel": "Nouveau nom pour %s :",
"renameTitle": "Renommer l'état"
},
"info": "Affichage de _START_ à _END_ sur _TOTAL_ entrées",
"infoEmpty": "Affichage de 0 à 0 sur 0 entrées",
"infoFiltered": "(filtrées depuis un total de _MAX_ entrées)",
"lengthMenu": "Afficher _MENU_ entrées",
"paginate": {
"first": "Première",
"last": "Dernière",
"next": "Suivante",
"previous": "Précédente"
},
"zeroRecords": "Aucune entrée correspondante trouvée",
"aria": {
"sortAscending": " : activer pour trier la colonne par ordre croissant",
"sortDescending": " : activer pour trier la colonne par ordre décroissant"
},
"infoThousands": " ",
"search": "Rechercher :",
"thousands": " "
}

View File

@ -0,0 +1,78 @@
{
"emptyTable": "テーブルにデータがありません",
"info": " _TOTAL_ 件中 _START_ から _END_ まで表示",
"infoEmpty": " 0 件中 0 から 0 まで表示",
"infoFiltered": "(全 _MAX_ 件より抽出)",
"infoThousands": ",",
"lengthMenu": "_MENU_ 件表示",
"loadingRecords": "読み込み中...",
"processing": "処理中...",
"search": "検索:",
"zeroRecords": "一致するレコードがありません",
"paginate": {
"first": "先頭",
"last": "最終",
"next": "次",
"previous": "前"
},
"aria": {
"sortAscending": ": 列を昇順に並べ替えるにはアクティブにする",
"sortDescending": ": 列を降順に並べ替えるにはアクティブにする"
},
"thousands": ",",
"buttons": {
"colvis": "項目の表示\/非表示",
"csv": "CSVをダウンロード"
},
"searchBuilder": {
"add": "条件を追加",
"button": {
"0": "カスタムサーチ",
"_": "カスタムサーチ (%d)"
},
"clearAll": "すべての条件をクリア",
"condition": "条件",
"conditions": {
"date": {
"after": "次の日付以降",
"before": "次の日付以前",
"between": "次の期間に含まれる",
"empty": "空白",
"equals": "次の日付と等しい",
"not": "次の日付と等しくない",
"notBetween": "次の期間に含まれない",
"notEmpty": "空白ではない"
},
"number": {
"between": "次の値の間に含まれる",
"empty": "空白",
"equals": "次の値と等しい",
"gt": "次の値よりも大きい",
"gte": "次の値以上",
"lt": "次の値未満",
"lte": "次の値以下",
"not": "次の値と等しくない",
"notBetween": "次の値の間に含まれない",
"notEmpty": "空白ではない"
},
"string": {
"contains": "次の文字を含む",
"empty": "空白",
"endsWith": "次の文字で終わる",
"equals": "次の文字と等しい",
"not": "次の文字と等しくない",
"notEmpty": "空白ではない",
"startsWith": "次の文字から始まる",
"notContains": "次の文字を含まない",
"notStartsWith": "次の文字で始まらない",
"notEndsWith": "次の文字で終わらない"
}
},
"data": "項目",
"title": {
"0": "カスタムサーチ",
"_": "カスタムサーチ (%d)"
},
"value": "値"
}
}

View File

@ -0,0 +1,247 @@
{
"processing": "Подождите...",
"search": "Поиск:",
"lengthMenu": "Показать _MENU_ записей",
"info": "Записи с _START_ до _END_ из _TOTAL_ записей",
"infoEmpty": "Записи с 0 до 0 из 0 записей",
"infoFiltered": "(отфильтровано из _MAX_ записей)",
"loadingRecords": "Загрузка записей...",
"zeroRecords": "Записи отсутствуют.",
"emptyTable": "В таблице отсутствуют данные",
"paginate": {
"first": "Первая",
"previous": "Предыдущая",
"next": "Следующая",
"last": "Последняя"
},
"aria": {
"sortAscending": ": активировать для сортировки столбца по возрастанию",
"sortDescending": ": активировать для сортировки столбца по убыванию"
},
"select": {
"rows": {
"_": "Выбрано записей: %d",
"1": "Выбрана одна запись"
},
"cells": {
"_": "Выбрано %d ячеек",
"1": "Выбрана 1 ячейка "
},
"columns": {
"1": "Выбран 1 столбец ",
"_": "Выбрано %d столбцов "
}
},
"searchBuilder": {
"conditions": {
"string": {
"startsWith": "Начинается с",
"contains": "Содержит",
"empty": "Пусто",
"endsWith": "Заканчивается на",
"equals": "Равно",
"not": "Не",
"notEmpty": "Не пусто",
"notContains": "Не содержит",
"notStartsWith": "Не начинается на",
"notEndsWith": "Не заканчивается на"
},
"date": {
"after": "После",
"before": "До",
"between": "Между",
"empty": "Пусто",
"equals": "Равно",
"not": "Не",
"notBetween": "Не между",
"notEmpty": "Не пусто"
},
"number": {
"empty": "Пусто",
"equals": "Равно",
"gt": "Больше чем",
"gte": "Больше, чем равно",
"lt": "Меньше чем",
"lte": "Меньше, чем равно",
"not": "Не",
"notEmpty": "Не пусто",
"between": "Между",
"notBetween": "Не между ними"
},
"array": {
"equals": "Равно",
"empty": "Пусто",
"contains": "Содержит",
"not": "Не равно",
"notEmpty": "Не пусто",
"without": "Без"
}
},
"data": "Данные",
"deleteTitle": "Удалить условие фильтрации",
"logicAnd": "И",
"logicOr": "Или",
"title": {
"0": "Конструктор поиска",
"_": "Конструктор поиска (%d)"
},
"value": "Значение",
"add": "Добавить условие",
"button": {
"0": "Конструктор поиска",
"_": "Конструктор поиска (%d)"
},
"clearAll": "Очистить всё",
"condition": "Условие",
"leftTitle": "Превосходные критерии",
"rightTitle": "Критерии отступа"
},
"searchPanes": {
"clearMessage": "Очистить всё",
"collapse": {
"0": "Панели поиска",
"_": "Панели поиска (%d)"
},
"count": "{total}",
"countFiltered": "{shown} ({total})",
"emptyPanes": "Нет панелей поиска",
"loadMessage": "Загрузка панелей поиска",
"title": "Фильтры активны - %d",
"showMessage": "Показать все",
"collapseMessage": "Скрыть все"
},
"buttons": {
"pdf": "PDF",
"print": "Печать",
"collection": "Коллекция <span class=\"ui-button-icon-primary ui-icon ui-icon-triangle-1-s\"><\/span>",
"colvis": "Видимость столбцов",
"colvisRestore": "Восстановить видимость",
"copy": "Копировать",
"copyKeys": "Нажмите ctrl or u2318 + C, чтобы скопировать данные таблицы в буфер обмена. Для отмены, щелкните по сообщению или нажмите escape.",
"copyTitle": "Скопировать в буфер обмена",
"csv": "CSV",
"excel": "Excel",
"pageLength": {
"-1": "Показать все строки",
"_": "Показать %d строк",
"1": "Показать 1 строку"
},
"removeState": "Удалить",
"renameState": "Переименовать",
"copySuccess": {
"1": "Строка скопирована в буфер обмена",
"_": "Скопировано %d строк в буфер обмена"
},
"createState": "Создать состояние",
"removeAllStates": "Удалить все состояния",
"savedStates": "Сохраненные состояния",
"stateRestore": "Состояние %d",
"updateState": "Обновить"
},
"decimal": ".",
"infoThousands": ",",
"autoFill": {
"cancel": "Отменить",
"fill": "Заполнить все ячейки <i>%d<i><\/i><\/i>",
"fillHorizontal": "Заполнить ячейки по горизонтали",
"fillVertical": "Заполнить ячейки по вертикали",
"info": "Информация"
},
"datetime": {
"previous": "Предыдущий",
"next": "Следующий",
"hours": "Часы",
"minutes": "Минуты",
"seconds": "Секунды",
"unknown": "Неизвестный",
"amPm": [
"AM",
"PM"
],
"months": {
"0": "Январь",
"1": "Февраль",
"10": "Ноябрь",
"11": "Декабрь",
"2": "Март",
"3": "Апрель",
"4": "Май",
"5": "Июнь",
"6": "Июль",
"7": "Август",
"8": "Сентябрь",
"9": "Октябрь"
},
"weekdays": [
"Вс",
"Пн",
"Вт",
"Ср",
"Чт",
"Пт",
"Сб"
]
},
"editor": {
"close": "Закрыть",
"create": {
"button": "Новый",
"title": "Создать новую запись",
"submit": "Создать"
},
"edit": {
"button": "Изменить",
"title": "Изменить запись",
"submit": "Изменить"
},
"remove": {
"button": "Удалить",
"title": "Удалить",
"submit": "Удалить",
"confirm": {
"_": "Вы точно хотите удалить %d строк?",
"1": "Вы точно хотите удалить 1 строку?"
}
},
"multi": {
"restore": "Отменить изменения",
"title": "Несколько значений",
"noMulti": "Это поле должно редактироватся отдельно, а не как часть групы",
"info": "Выбранные элементы содержат разные значения для этого входа. Чтобы отредактировать и установить для всех элементов этого ввода одинаковое значение, нажмите или коснитесь здесь, в противном случае они сохранят свои индивидуальные значения."
},
"error": {
"system": "Возникла системная ошибка (<a target=\"\\\" rel=\"nofollow\" href=\"\\\">Подробнее<\/a>)."
}
},
"searchPlaceholder": "Что ищете?",
"stateRestore": {
"creationModal": {
"button": "Создать",
"search": "Поиск",
"columns": {
"search": "Поиск по столбцам",
"visible": "Видимость столбцов"
},
"name": "Имя:",
"order": "Сортировка",
"paging": "Страницы",
"scroller": "Позиция прокрутки",
"searchBuilder": "Редактор поиска",
"select": "Выделение",
"title": "Создать новое состояние",
"toggleLabel": "Включает:"
},
"removeJoiner": "и",
"removeSubmit": "Удалить",
"renameButton": "Переименовать",
"duplicateError": "Состояние с таким именем уже существует.",
"emptyError": "Имя не может быть пустым.",
"emptyStates": "Нет сохраненных состояний",
"removeConfirm": "Вы уверены, что хотите удалить %s?",
"removeError": "Не удалось удалить состояние.",
"removeTitle": "Удалить состояние",
"renameLabel": "Новое имя для %s:",
"renameTitle": "Переименовать состояние"
},
"thousands": " "
}

View File

@ -0,0 +1,244 @@
{
"search": "搜索:",
"paginate": {
"first": "首页",
"previous": "上页",
"next": "下页",
"last": "末页"
},
"autoFill": {
"cancel": "取消",
"fill": "用 <i>%d<\/i> 填充所有单元格",
"fillHorizontal": "水平填充单元格",
"fillVertical": "垂直填充单元格"
},
"buttons": {
"colvis": "列可见性",
"copy": "复制",
"copyTitle": "复制到剪贴板",
"csv": "CSV",
"excel": "Excel",
"pdf": "PDF",
"pageLength": {
"-1": "显示所有行",
"_": "显示 %d 行"
},
"print": "打印",
"collection": "集合 <span class=\"ui-button-icon-primary ui-icon ui-icon-triangle-1-s\"><\/span>",
"colvisRestore": "还原可见性",
"copyKeys": "按 Ctrl 或 u2318 + C 键将表中数据复制到系统剪贴板。<br \/><br \/>要取消,请单击此消息或按 Escape 键。",
"copySuccess": {
"1": "已复制 1 行到剪贴板",
"_": "已复制 %d 行到剪贴板"
},
"createState": "创建状态",
"removeAllStates": "删除所有状态",
"removeState": "删除",
"renameState": "重命名",
"savedStates": "保存的状态",
"stateRestore": "状态 %d",
"updateState": "更新"
},
"searchBuilder": {
"button": {
"0": "搜索生成器",
"_": "搜索生成器 (%d)"
},
"clearAll": "全部清除",
"condition": "条件",
"data": "数据",
"title": {
"0": "搜索生成器",
"_": "搜索生成器 (%d)"
},
"value": "值",
"conditions": {
"date": {
"equals": "等于",
"after": "早于",
"before": "晚于",
"between": "介于",
"empty": "为空",
"not": "非",
"notBetween": "不介于",
"notEmpty": "非空"
},
"number": {
"between": "介于",
"empty": "为空",
"equals": "等于",
"gt": "大于",
"gte": "大于等于",
"lt": "小于",
"lte": "小于等于",
"not": "非",
"notBetween": "不介于",
"notEmpty": "非空"
},
"string": {
"contains": "含有",
"empty": "为空",
"endsWith": "结尾为",
"equals": "等于",
"not": "非",
"notEmpty": "非空",
"startsWith": "开头为",
"notContains": "不含有",
"notStartsWith": "开头不为",
"notEndsWith": "结尾不为"
},
"array": {
"equals": "等于",
"empty": "为空",
"contains": "含有",
"not": "非",
"notEmpty": "非空",
"without": "无"
}
},
"add": "添加条件",
"deleteTitle": "删除筛选规则",
"leftTitle": "组合条件",
"logicAnd": "与",
"logicOr": "或",
"rightTitle": "取消组合"
},
"searchPanes": {
"clearMessage": "全部清除",
"collapse": {
"0": "搜索面板",
"_": "搜索面板 (%d)"
},
"count": "{total}",
"countFiltered": "{shown} ({total})",
"emptyPanes": "没有搜索面板",
"loadMessage": "正在加载搜索面板...",
"title": "激活的筛选条件 - %d",
"showMessage": "全部显示",
"collapseMessage": "全部折叠"
},
"infoThousands": ",",
"thousands": ",",
"datetime": {
"amPm": [
"上午",
"下午"
],
"minutes": "分",
"months": {
"0": "1月",
"1": "2月",
"10": "11月",
"11": "12月",
"2": "3月",
"3": "4月",
"4": "5月",
"5": "6月",
"6": "7月",
"7": "8月",
"8": "9月",
"9": "10月"
},
"seconds": "秒",
"previous": "上月",
"next": "下月",
"hours": "时",
"unknown": "-",
"weekdays": [
"日",
"一",
"二",
"三",
"四",
"五",
"六"
]
},
"editor": {
"close": "关闭",
"create": {
"button": "新建",
"submit": "创建",
"title": "创建新记录"
},
"edit": {
"button": "编辑",
"submit": "更新",
"title": "编辑记录"
},
"multi": {
"restore": "撤销更改",
"title": "多个值",
"info": "选择的多个记录的此字段含有不同的值。要编辑并将所有记录的此字段设为相同的值,请单击或点按这里,否则它们会保留各自的值。",
"noMulti": "此字段可以单独编辑,不可以组合编辑。"
},
"remove": {
"button": "删除",
"submit": "删除",
"title": "删除",
"confirm": {
"_": "确定要删除 %d 行?",
"1": "确定要删除 1 行?"
}
},
"error": {
"system": "出现了系统错误 (<a target=\"\\\" rel=\"\\ nofollow\" href=\"\\\">更多信息&lt;\\\/a&gt;)。<\/a>"
}
},
"infoEmpty": "正在显示第 0 至 0 项数据,共 0 项",
"infoFiltered": "(筛选自全部_MAX_项数据)",
"lengthMenu": "显示 _MENU_ 项数据",
"loadingRecords": "正在加载...",
"processing": "正在处理...",
"aria": {
"sortAscending": ": 激活以升序排序此列",
"sortDescending": ": 激活以降序排序此列"
},
"decimal": ".",
"emptyTable": "表中没有数据",
"info": "正在显示第 _START_ 至 _END_ 项数据,共 _TOTAL_ 项",
"select": {
"cells": {
"1": "已选择 1 个单元格",
"_": "已选择 %d 个单元格"
},
"columns": {
"1": "已选择 1 列",
"_": "已选择 %d 列"
},
"rows": {
"1": "已选择 1 行",
"_": "已选择 %d 行"
}
},
"zeroRecords": "没有找到匹配的记录",
"stateRestore": {
"creationModal": {
"button": "创建",
"columns": {
"search": "列搜索",
"visible": "列可见性"
},
"name": "名称:",
"order": "排序",
"paging": "分页",
"scroller": "滚动位置",
"search": "搜索",
"searchBuilder": "搜索生成器",
"select": "选择",
"title": "创建新状态",
"toggleLabel": "包括:"
},
"duplicateError": "已存在使用此名称的状态。",
"emptyError": "名称不能为空。",
"emptyStates": "没有保存的状态",
"removeConfirm": "确定要删除 %s",
"removeError": "删除状态失败。",
"removeJoiner": "和",
"removeSubmit": "删除",
"removeTitle": "删除状态",
"renameButton": "重命名",
"renameLabel": "%s 的新名称:",
"renameTitle": "重命名状态"
}
}

View File

@ -1239,7 +1239,16 @@ input[type="image"] {
font-family: source-code, mono, monospace;
}
* table about dialog */ .table-about {
.title-blue {
text-transform: none !important;
font-size: 1em !important;
margin: 0px !important;
padding: 0px !important;
color: #95a3bf;
}
/* Table about dialog */
.table-about {
background-color: #222 !important;
width: 100%;
border-collapse: collapse;

View File

@ -131,7 +131,7 @@
<div style='padding-bottom: 50px'>
<?php
$version = '7.0NG.769';
$build = '230227';
$build = '230228';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -716,18 +716,21 @@ function print_table(
$graph_link .= $params_encoded."','";
$graph_link .= $win_handle."', 800, 480)\">";
$graph_link .= html_print_image(
'images/chart.png',
'images/graph@svg.svg',
true,
[
'title' => __('Interface traffic'),
'class' => 'invert_filter',
'class' => 'invert_filter main_menu_icon',
]
).'</a>';
} else {
$graph_link = html_print_image(
'images/chart_curve.disabled.png',
'images/graph@svg.svg',
true,
['title' => __('inOctets and outOctets must be enabled.')]
[
'title' => __('inOctets and outOctets must be enabled.'),
'class' => 'invert_filter main_menu_icon alpha50',
]
);
}
} else {

View File

@ -2179,12 +2179,13 @@ if (empty($result) === false) {
$table->cellclass[][2] = 'action_buttons';
$data[12] .= '<a href="'.$url_edit_module.'">'.html_print_image(
'images/config.png',
'images/edit.svg',
true,
[
'alt' => '0',
'border' => '',
'title' => __('Edit'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
@ -2194,12 +2195,13 @@ if (empty($result) === false) {
$onclick = 'onclick="javascript: if (!confirm(\''.__('Are you sure to delete?').'\')) return false;';
$data[12] .= '<a href="'.$url_delete_module.'" '.$onclick.'" target="_blank">'.html_print_image(
'images/delete.png',
'images/delete.svg',
true,
[
'alt' => '0',
'border' => '',
'title' => __('Delete'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
}

View File

@ -196,10 +196,12 @@ if ($is_metaconsole === true) {
}
if ($is_metaconsole === true) {
$nodo_image_url = $config['homeurl'].'/images/node.png';
if ($id_server > 0) {
$connection = metaconsole_get_connection_by_id($id_server);
$agents_node = metaconsole_get_agents_servers($connection['server_name'], $inventory_id_group);
$node = metaconsole_get_servers($id_server);
$nodos = [];
if (metaconsole_connect($connection) !== NOERR) {
ui_print_error_message(
@ -216,7 +218,8 @@ if ($is_metaconsole === true) {
$result_module = db_get_all_rows_sql($sql);
if ($submit_filter === true) {
$inventory_data .= inventory_get_data(
// Get the data.
$rows_meta = inventory_get_datatable(
array_keys($agents_node),
$inventory_module,
$utimestamp,
@ -224,15 +227,26 @@ if ($is_metaconsole === true) {
$export,
false,
$order_by_agent,
$node,
$server,
$pagination_url_parameters
);
$data_tmp['server_name'] = $connection['server_name'];
$data_tmp['dbhost'] = $connection['dbhost'];
$data_tmp['server_uid'] = $connection['server_uid'];
$data_tmp['data'] = $rows_meta;
$nodos[$connection['id']] = $data_tmp;
if ($result_data !== ERR_NODATA) {
$inventory_data .= $result_data;
}
}
// Restore db connection.
metaconsole_restore_db();
} else {
$result_module = [];
$nodos = [];
foreach ($nodes_connection as $key => $server) {
$agents_node = metaconsole_get_agents_servers($server['server_name'], $inventory_id_group);
$connection = metaconsole_get_connection($server['server_name']);
@ -253,7 +267,7 @@ if ($is_metaconsole === true) {
$result_module = array_merge($result_module, $result);
if ($submit_filter === true) {
// Get the data.
$result_data = inventory_get_data(
$rows_meta = inventory_get_datatable(
array_keys($agents_node),
$inventory_module,
$utimestamp,
@ -264,6 +278,13 @@ if ($is_metaconsole === true) {
$server,
$pagination_url_parameters
);
$data_tmp['server_name'] = $server['server_name'];
$data_tmp['dbhost'] = $server['dbhost'];
$data_tmp['server_uid'] = $server['server_uid'];
$data_tmp['data'] = $rows_meta;
$nodos[$server['id']] = $data_tmp;
if ($result_data !== ERR_NODATA) {
$inventory_data .= $result_data;
}
@ -360,7 +381,8 @@ $table->data[0][1] .= '</div>';
$table->data[0][2] = '<strong>'.__('Module').'</strong>';
if ($is_metaconsole === true) {
$table->data[0][3] = html_print_select($fields, 'module_inventory_general_view', $inventory_module, $filteringFunction, __('All'), 0, true, false, true, '', false, 'min-width: 194px; max-width: 200px;');
array_unshift($fields, __('All'));
$table->data[0][3] = html_print_select($fields, 'module_inventory_general_view', $inventory_module, $filteringFunction, __('Basic info'), 'basic', true, false, true, '', false, 'min-width: 194px; max-width: 200px;');
} else {
$sql = 'SELECT name as indexname, name
FROM tmodule_inventory, tagent_module_inventory
@ -369,7 +391,20 @@ if ($is_metaconsole === true) {
$sql .= ' AND id_agente = '.$inventory_id_agent;
}
$table->data[0][3] = html_print_select_from_sql($sql, 'module_inventory_general_view', $inventory_module, '', __('All'), 'all', true, false, false);
$fields = [];
$result = db_get_all_rows_sql($sql);
if ($result === false) {
$result = [];
}
foreach ($result as $row) {
$id = array_shift($row);
$value = array_shift($row);
$fields[$id] = $value;
}
array_unshift($fields, __('All'));
$table->data[0][3] = html_print_select($fields, 'module_inventory_general_view', $inventory_module, '', __('Basic info'), 'basic', true, false, false);
}
@ -446,13 +481,6 @@ html_print_table($table);
echo '</form>';
// No agent selected or no search performed.
if ($inventory_id_agent < 0 || $submit_filter === false) {
echo '&nbsp;</td></tr><tr><td>';
return;
}
if ($is_metaconsole === false) {
// Single agent selected.
if ($inventory_id_agent > 0 && isset($agents[$inventory_id_agent]) === true) {
@ -461,20 +489,18 @@ if ($is_metaconsole === false) {
$agents_ids = array_keys($agents);
if (count($agents_ids) > 0) {
$inventory_data = inventory_get_data(
$rows = inventory_get_datatable(
$agents_ids,
$inventory_module,
$utimestamp,
$inventory_search_string,
$export,
false,
$order_by_agent,
'',
$pagination_url_parameters
$order_by_agent
);
}
if (count($agents_ids) === 0 || (int) $inventory_data === ERR_NODATA) {
if (count($agents_ids) === 0 || (int) $rows === ERR_NODATA) {
ui_print_info_message(['no_close' => true, 'message' => __('No data found.') ]);
echo '&nbsp;</td></tr><tr><td>';
@ -515,12 +541,736 @@ if ($is_metaconsole === false) {
}
</script>
<?php
echo $inventory_data;
} else {
if (empty($inventory_data) === true) {
ui_print_info_message(['no_close' => true, 'message' => __('No data found.') ]);
if ($inventory_module !== 'basic') {
if ($order_by_agent === true) {
foreach ($rows as $agent_rows) {
foreach ($agent_rows['row'] as $row) {
$data = [];
$columns = explode(';', io_safe_output($row['data_format']));
array_push($columns, 'Timestamp');
$data_rows = explode(PHP_EOL, $row['data']);
foreach ($data_rows as $data_row) {
// Exclude results don't match filter.
if ($inventory_search_string && preg_match('/'.io_safe_output($inventory_search_string).'/', ($data_row)) == 0) {
continue;
}
$column_data = explode(';', io_safe_output($data_row));
if ($column_data[0] !== '') {
$row_tmp = [];
foreach ($column_data as $key => $value) {
$row_tmp[$columns[$key]] = $value;
}
$row_tmp['Timestamp'] = $row['timestamp'];
array_push($data, (object) $row_tmp);
}
}
$id_table = 'id_'.$row['id_module_inventory'];
$table = ui_print_datatable(
[
'id' => $id_table,
'class' => 'info_table w100p',
'style' => 'width: 99%',
'columns' => $columns,
'column_names' => $columns,
'no_sortable_columns' => [],
'data_element' => $data,
'searching' => true,
'dom_elements' => 'lftip',
'order' => [
'field' => $columns[0],
'direction' => 'asc',
],
'zeroRecords' => __('No inventory found'),
'emptyTable' => __('No inventory found'),
'return' => true,
'default_pagination' => 10,
'no_sortable_columns' => [-1],
]
);
$modules .= ui_toggle(
$table,
'<span class="title-blue">'.$row['name'].'</span>',
'',
'',
true,
true,
'',
'white-box-content w100p',
'box-shadow white_table_graph w100p',
'images/arrow_down_green.png',
'images/arrow_right_green.png',
false,
false,
false,
'',
'',
null,
null,
false,
$id_table
);
}
ui_toggle(
$modules,
$agent_rows['agent'],
'',
'',
false,
false
);
}
} else {
foreach ($rows as $module_rows) {
$agent = '';
foreach ($module_rows as $row) {
$columns = explode(';', io_safe_output($row['data_format']));
array_push($columns, 'Timestamp');
$data = [];
$data_explode = explode(PHP_EOL, $row['data']);
foreach ($data_explode as $values) {
// Exclude results don't match filter.
if ($inventory_search_string && preg_match('/'.io_safe_output($inventory_search_string).'/', ($values)) == 0) {
continue;
}
$data_tmp = [];
if ($values !== '') {
$values_explode = explode(';', io_safe_output($values));
foreach ($values_explode as $key => $value) {
$data_tmp[$columns[$key]] = $value;
}
$data_tmp['Timestamp'] = $row['timestamp'];
array_push($data, $data_tmp);
}
}
$id_table = 'id_'.$row['id_module_inventory'];
$table = ui_print_datatable(
[
'id' => $id_table,
'class' => 'info_table w100p',
'style' => 'width: 99%',
'columns' => $columns,
'column_names' => $columns,
'no_sortable_columns' => [],
'data_element' => $data,
'searching' => true,
'dom_elements' => 'lftip',
'order' => [
'field' => $columns[0],
'direction' => 'asc',
],
'zeroRecords' => __('No inventory found'),
'emptyTable' => __('No inventory found'),
'return' => true,
'default_pagination' => 10,
'no_sortable_columns' => [-1],
]
);
$agent .= ui_toggle(
$table,
'<span class="title-blue">'.$row['name_agent'].'</span>',
'',
'',
true,
true,
'',
'white-box-content w100p',
'box-shadow white_table_graph w100p',
'images/arrow_down_green.png',
'images/arrow_right_green.png',
false,
false,
false,
'',
'',
null,
null,
false,
$id_table
);
}
ui_toggle(
$agent,
$module_rows[0]['name'],
'',
'',
false,
false
);
}
}
} else {
echo $inventory_data;
$id_agente = $inventory_id_agent;
$agentes = [];
$data = [];
$class = 'info_table w100p';
$style = 'width: 100%';
$ordering = false;
$searching = false;
$dom = 't';
$columns = [
__('Alias'),
__('IP'),
__("IP's Secondary"),
__('Group'),
__('Secondary groups'),
__('Description'),
__('OS'),
__('Interval'),
__('Last contact'),
__('Last status change'),
__('Custom fields'),
__('Values Custom Fields'),
];
if ((int) $id_agente === 0) {
$class = 'databox info_table w100p';
$style = 'width: 99%';
$ordering = true;
$searching = true;
$dom = 'lftipB';
$agentes = db_get_all_rows_sql('SELECT id_agente FROM tagente');
} else {
array_push($agentes, $id_agente);
}
foreach ($agentes as $id) {
if ((int) $id_agente === 0) {
$id = $id['id_agente'];
}
$agent = db_get_row('tagente', 'id_agente', $id);
$ip = '<em>'.__('N/A').'</em>';
if (empty($agent['direccion']) === false) {
$ip = $agent['direccion'];
}
$secondary_ips = '';
foreach (agents_get_addresses($id) as $ip) {
if ($ip !== $agent['direccion']) {
$secondary_ips .= '<span class="left" style="height: 1.3em !important">'.$ip.'</span>';
}
}
$group = groups_get_name($agent['id_grupo']);
$secondary_groups = enterprise_hook('agents_get_secondary_groups', [$id]);
if (empty($secondary_groups['for_select']) === true) {
$sec_group_data = '<em>'.__('N/A').'</em>';
} else {
$sec_group = [];
foreach ($secondary_groups['for_select'] as $name) {
$sec_group[] = $name;
}
$sec_group_data = implode(', ', $sec_group);
}
$os = ui_print_os_icon($agent['id_os'], false, true).' ';
$os .= io_safe_output(get_os_name($agent['id_os'])).' '.io_safe_output($agent['os_version']);
$interval = human_time_description_raw($agent['intervalo'], false, 'large');
$last_contact = ui_print_timestamp($agent['ultimo_contacto'], true);
// $last_contact .= ' / '.date_w_fixed_tz($agent['ultimo_contacto_remoto']);
$last_status_change_agent = agents_get_last_status_change($agent['id_agente']);
$time_elapsed = !empty($last_status_change_agent) ? human_time_comparation($last_status_change_agent) : '<em>'.__('N/A').'</em>';
$sql_fields = 'SELECT tcf.name, tcd.description, tcf.is_password_type
FROM tagent_custom_fields tcf
INNER JOIN tagent_custom_data tcd ON tcd.id_field=tcf.id_field
WHERE tcd.id_agent='.$id.' AND tcd.description!=""';
$field_result = db_get_all_rows_sql($sql_fields);
$custom_fields_names = '';
$custom_fields_values = '';
foreach ($field_result as $field) {
$field_name = str_replace(' ', '&nbsp;', io_safe_output($field['name']));
$custom_fields_names .= '<span class="right" style="height: 1.3em !important">'.$field_name.'</span>';
$description = $field['description'];
$password_length = strlen(io_safe_output($field['description']));
$asterisks = '';
if ((int) $field['is_password_type'] === 1) {
for ($i = 0; $i < $password_length; $i++) {
$asterisks .= '&#9679;';
}
$description = $asterisks;
}
$custom_fields_values .= '<span class="left" style="height: 1.3em !important">'.$description.'</span>';
}
$data_tmp = [
__('Alias') => $agent['alias'],
__('IP') => $ip,
__("IP's Secondary") => $secondary_ips,
__('Group') => $group,
__('Secondary groups') => $sec_group_data,
__('Description') => $agent['comentarios'],
__('OS') => $os,
__('Interval') => $interval,
__('Last contact') => $last_contact,
__('Last status change') => $time_elapsed,
__('Custom fields') => $custom_fields_names,
__('Values Custom Fields') => $custom_fields_values,
];
array_push($data, $data_tmp);
}
$table = ui_print_datatable(
[
'id' => 'basic_info',
'class' => $class,
'style' => $style,
'columns' => $columns,
'column_names' => $columns,
'ordering' => $ordering,
'data_element' => $data,
'searching' => $searching,
'dom_elements' => $dom,
'order' => [
'field' => $columns[0],
'direction' => 'asc',
],
'zeroRecords' => __('Agent info not found'),
'emptyTable' => __('Agent info not found'),
'default_pagination' => 10,
'return' => true,
]
);
if ((int) $id_agente === 0) {
echo $table;
} else {
echo '<div class="databox">'.$table.'</div>';
}
}
// Metaconsole.
} else {
if ($inventory_module !== 'basic') {
if ($order_by_agent === true) {
$count_nodos_tmp = [];
foreach ($nodos as $count_value) {
array_push($count_nodos_tmp, $count_value['server_name']);
}
$count = array_count_values($count_nodos_tmp);
foreach ($nodos as $nodo) {
$agents = '';
foreach ($nodo['data'] as $agent_rows) {
$modules = '';
foreach ($agent_rows['row'] as $row) {
$data = [];
$columns = explode(';', io_safe_output($row['data_format']));
array_push($columns, 'Timestamp');
$data_rows = explode(PHP_EOL, $row['data']);
foreach ($data_rows as $data_row) {
// Exclude results don't match filter.
if ($inventory_search_string && preg_match('/'.io_safe_output($inventory_search_string).'/', ($data_row)) == 0) {
continue;
}
$column_data = explode(';', io_safe_output($data_row));
if ($column_data[0] !== '') {
$row_tmp = [];
foreach ($column_data as $key => $value) {
$row_tmp[$columns[$key]] = $value;
}
$row_tmp['Timestamp'] = $row['timestamp'];
array_push($data, (object) $row_tmp);
}
}
$id_table = 'id_'.$row['id_module_inventory'].'_'.$nodo['server_uid'];
$table = ui_print_datatable(
[
'id' => $id_table,
'class' => 'info_table w100p',
'style' => 'width: 100%',
'columns' => $columns,
'column_names' => $columns,
'no_sortable_columns' => [],
'data_element' => $data,
'searching' => true,
'dom_elements' => 'lftipB',
'order' => [
'field' => $columns[0],
'direction' => 'asc',
],
'zeroRecords' => __('No inventory found'),
'emptyTable' => __('No inventory found'),
'return' => true,
'default_pagination' => 10,
'no_sortable_columns' => [-1],
]
);
$modules .= ui_toggle(
$table,
'<span class="title-blue">'.$row['name'].'</span>',
'',
'',
true,
true,
'',
'white-box-content w100p',
'box-shadow white_table_graph w100p',
'images/arrow_down_green.png',
'images/arrow_right_green.png',
false,
false,
false,
'',
'',
null,
null,
false,
$id_table
);
}
$agents .= ui_toggle(
$modules,
$agent_rows['agent'],
'',
'',
true,
true
);
}
$node_name = $nodo['server_name'];
if ($count[$nodo['server_name']] > 1) {
$node_name .= ' ('.$nodo['dbhost'].')';
}
ui_toggle(
$agents,
'<span class="toggle-inventory-nodo">'.$node_name.'</span>',
'',
'',
false,
false
);
}
} else {
$count_nodos_tmp = [];
foreach ($nodos as $count_value) {
array_push($count_nodos_tmp, $count_value['server_name']);
}
$count = array_count_values($count_nodos_tmp);
foreach ($nodos as $nodo_key => $nodo) {
$agents = '';
foreach ($nodo['data'] as $module_rows) {
$agent = '';
foreach ($module_rows as $row) {
$columns = explode(';', io_safe_output($row['data_format']));
array_push($columns, 'Timestamp');
$data = [];
$data_explode = explode(PHP_EOL, $row['data']);
foreach ($data_explode as $values) {
// Exclude results don't match filter.
if ($inventory_search_string && preg_match('/'.io_safe_output($inventory_search_string).'/', ($values)) == 0) {
continue;
}
$data_tmp = [];
if ($values !== '') {
$values_explode = explode(';', io_safe_output($values));
foreach ($values_explode as $key => $value) {
$data_tmp[$columns[$key]] = $value;
}
$data_tmp['Timestamp'] = $row['timestamp'];
array_push($data, $data_tmp);
}
}
$id_table = 'id_'.$row['id_module_inventory'].'_'.$nodo['server_uid'];
$table = ui_print_datatable(
[
'id' => $id_table,
'class' => 'info_table w100p',
'style' => 'width: 100%',
'columns' => $columns,
'column_names' => $columns,
'no_sortable_columns' => [],
'data_element' => $data,
'searching' => true,
'dom_elements' => 'lftipB',
'order' => [
'field' => $columns[0],
'direction' => 'asc',
],
'zeroRecords' => __('No inventory found'),
'emptyTable' => __('No inventory found'),
'return' => true,
'default_pagination' => 10,
'no_sortable_columns' => [-1],
]
);
$agent .= ui_toggle(
$table,
'<span class="title-blue">'.$row['name_agent'].'</span>',
'',
'',
true,
true,
'',
'white-box-content w100p',
'box-shadow white_table_graph w100p',
'images/arrow_down_green.png',
'images/arrow_right_green.png',
false,
false,
false,
'',
'',
null,
null,
false,
$id_table
);
}
$agents .= ui_toggle(
$agent,
$module_rows[0]['name'],
'',
'',
true,
true
);
}
$node_name = $nodo['server_name'];
if ($count[$nodo['server_name']] > 1) {
$node_name .= ' ('.$nodo['dbhost'].')';
}
ui_toggle(
$agents,
'<span class="toggle-inventory-nodo">'.$node_name.'</span>',
'',
'',
false,
false
);
}
}
} else {
$id_agente = $inventory_id_agent;
$agentes = [];
$data = [];
$class = 'info_table w100p';
$style = 'width: 100%';
$ordering = false;
$searching = false;
$dom = 't';
$columns = [
__('Alias'),
__('IP'),
__("IP's Secondary"),
__('Group'),
__('Secondary groups'),
__('Description'),
__('OS'),
__('Interval'),
__('Last contact'),
__('Last status change'),
__('Custom fields'),
__('Values Custom Fields'),
];
if ($id_server === 0) {
$servers_ids = array_column(metaconsole_get_servers(), 'id');
} else {
$servers_ids = [$id_server];
}
foreach ($servers_ids as $server_id) {
if (is_metaconsole()) {
$server = metaconsole_get_connection_by_id($server_id);
if ((int) $es_agent_server_filter !== 0
&& (int) $es_agent_server_filter !== (int) $server_id
) {
continue;
}
metaconsole_connect($server);
}
if ((int) $id_agente === 0) {
$class = 'databox info_table w100p';
$style = 'width: 99%';
$ordering = true;
$searching = true;
$dom = 'lftipB';
$sql_agentes = 'SELECT t.id_agente
FROM tagente t
LEFT JOIN tgrupo tg ON tg.id_grupo = t.id_grupo
WHERE (t.alias LIKE "%'.$inventory_search_string.'%")
OR (t.comentarios LIKE "%'.$inventory_search_string.'%")
OR (t.direccion LIKE "%'.$inventory_search_string.'%")
OR (t.os_version LIKE "%'.$inventory_search_string.'%")
OR (tg.nombre LIKE "%'.$inventory_search_string.'%")';
$agentes = db_get_all_rows_sql($sql_agentes);
} else {
array_push($agentes, $id_agente);
}
foreach ($agentes as $id) {
if ((int) $id_agente === 0) {
$id = $id['id_agente'];
}
$agent = db_get_row('tagente', 'id_agente', $id);
$ip = '<em>'.__('N/A').'</em>';
if (empty($agent['direccion']) === false) {
$ip = $agent['direccion'];
}
$secondary_ips = '';
foreach (agents_get_addresses($id) as $ip) {
if ($ip !== $agent['direccion']) {
$secondary_ips .= '<span class="left" style="height: 1.3em !important">'.$ip.'</span>';
}
}
$group = groups_get_name($agent['id_grupo']);
$secondary_groups = enterprise_hook('agents_get_secondary_groups', [$id]);
if (empty($secondary_groups['for_select']) === true) {
$sec_group_data = '<em>'.__('N/A').'</em>';
} else {
$sec_group = [];
foreach ($secondary_groups['for_select'] as $name) {
$sec_group[] = $name;
}
$sec_group_data = implode(', ', $sec_group);
}
$os = ui_print_os_icon($agent['id_os'], false, true).' ';
$os .= io_safe_output(get_os_name($agent['id_os'])).' '.io_safe_output($agent['os_version']);
$interval = human_time_description_raw($agent['intervalo'], false, 'large');
$last_contact = ui_print_timestamp($agent['ultimo_contacto'], true);
// $last_contact .= ' / '.date_w_fixed_tz($agent['ultimo_contacto_remoto']);
$last_status_change_agent = agents_get_last_status_change($agent['id_agente']);
$time_elapsed = !empty($last_status_change_agent) ? human_time_comparation($last_status_change_agent) : '<em>'.__('N/A').'</em>';
$sql_fields = 'SELECT tcf.name, tcd.description, tcf.is_password_type
FROM tagent_custom_fields tcf
INNER JOIN tagent_custom_data tcd ON tcd.id_field=tcf.id_field
WHERE tcd.id_agent='.$id.' AND tcd.description!=""';
$field_result = db_get_all_rows_sql($sql_fields);
$custom_fields_names = '';
$custom_fields_values = '';
foreach ($field_result as $field) {
$field_name = str_replace(' ', '&nbsp;', io_safe_output($field['name']));
$custom_fields_names .= '<span class="right" style="height: 1.3em !important">'.$field_name.'</span>';
$description = $field['description'];
$password_length = strlen(io_safe_output($field['description']));
$asterisks = '';
if ((int) $field['is_password_type'] === 1) {
for ($i = 0; $i < $password_length; $i++) {
$asterisks .= '&#9679;';
}
$description = $asterisks;
}
$custom_fields_values .= '<span class="left" style="height: 1.3em !important">'.$description.'</span>';
}
$data_tmp = [
__('Alias') => $agent['alias'],
__('IP') => $ip,
__("IP's Secondary") => $secondary_ips,
__('Group') => $group,
__('Secondary groups') => $sec_group_data,
__('Description') => $agent['comentarios'],
__('OS') => $os,
__('Interval') => $interval,
__('Last contact') => $last_contact,
__('Last status change') => $time_elapsed,
__('Custom fields') => $custom_fields_names,
__('Values Custom Fields') => $custom_fields_values,
];
array_push($data, $data_tmp);
}
if (is_metaconsole()) {
metaconsole_restore_db();
}
}
$table = ui_print_datatable(
[
'id' => 'basic_info',
'class' => $class,
'style' => $style,
'columns' => $columns,
'column_names' => $columns,
'ordering' => $ordering,
'data_element' => $data,
'searching' => $searching,
'dom_elements' => $dom,
'order' => [
'field' => $columns[0],
'direction' => 'asc',
],
'zeroRecords' => __('Agent info not found'),
'emptyTable' => __('Agent info not found'),
'default_pagination' => 10,
'return' => true,
]
);
if ((int) $id_agente === 0) {
echo $table;
} else {
echo '<div class="databox">'.$table.'</div>';
}
}
close_meta_frame();
@ -546,6 +1296,27 @@ ui_require_jquery_file('bgiframe');
$("#id_group").blur (function () {
$(this).css ("width", "180px");
});
// Reduce margins between table and pagination.
$('.dataTables_paginate.paging_simple_numbers').css('margin-top', 10);
$('.dataTables_paginate.paging_simple_numbers').css('margin-bottom', 10);
// Change chevron for node icon.
let toggle = document.querySelectorAll('.toggle-inventory-nodo');
let src = '<?php echo $nodo_image_url; ?>';
toggle.forEach(img => {
img.parentElement.parentElement.style = 'cursor: pointer; border: 0';
img.parentElement.previousElementSibling.src = src;
});
toggle.forEach(divParent => {
let div = divParent.parentElement.parentElement;
$(div).click(function (e) {
div.style = 'cursor: pointer; border: 0';
div.firstChild.src = src;
});
});
});
/* ]]> */
</script>

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.769
%define release 230227
%define release 230228
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.769
%define release 230227
%define release 230228
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.769
%define release 230227
%define release 230228
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -1,7 +1,13 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import gspread
import argparse
import argparse,json,sys
from oauth2client.service_account import ServiceAccountCredentials
from pprint import pprint
from os import remove
import base64
__author__ = "Alejandro Sánchez Carrion"
__copyright__ = "Copyright 2022, PandoraFMS"
@ -15,33 +21,61 @@ Version = {__version__}
Manual execution
python3 pandora_googlesheets.py --cred <file credentials> --row <number-row> --column <number-column>
python3 pandora_googlesheets.py --creds_json/creds_base64 <file credentials> --name <name document> --sheet <name-sheet> --cell <Number cell> --row <number-row> --column <number-column>
"""
parser = argparse.ArgumentParser(description= info, formatter_class=argparse.RawTextHelpFormatter)
parser.add_argument('--cred', help='')
parser.add_argument('--name', help='')
parser.add_argument('--row', help='',type=int)
parser.add_argument('--column', help='',type=int)
parser.add_argument('--creds_json', help='To authenticate with a json file.')
parser.add_argument('--creds_base64', help='To authenticate with a file that includes the credentials for base64 authentication.')
parser.add_argument('--name', help='Name of the google sheets document.')
parser.add_argument('--cell', help='To collect the value of a cell.')
parser.add_argument('--row', help='To collect the value of a row.',type=int)
parser.add_argument('--column', help='To collect the value of a column.',type=int)
parser.add_argument('--sheet', help='To indicate the name of the document sheet, put it in quotation marks and count spaces and capital letters.',type=str)
args = parser.parse_args()
scope = ["https://spreadsheets.google.com/feeds",'https://www.googleapis.com/auth/spreadsheets',"https://www.googleapis.com/auth/drive.file","https://www.googleapis.com/auth/drive"]
creds = ServiceAccountCredentials.from_json_keyfile_name(args.cred, scope)
## authenticate with file json input
if args.creds_json is not None and args.creds_base64 == None:
creds = ServiceAccountCredentials.from_json_keyfile_name(args.creds_json, scope)
## authenticate with base64 input
elif args.creds_base64 is not None and args.creds_json== None:
## base64 to json
text=base64.b64decode(args.creds_base64).decode('utf-8')
with open("cred.json", "w") as outfile:
outfile.write(text)
creds = ServiceAccountCredentials.from_json_keyfile_name("cred.json", scope)
remove("cred.json")
else:
print("You need to use the --creds_json or creds_base 64 parameter to authenticate. You can only select one.")
sys.exit()
client = gspread.authorize(creds)
sheet = client.open(args.name).sheet1 # Open the spreadhseet
sheet = client.open(args.name) # Open the spreadhseet
worksheet = sheet.worksheet(args.sheet) # Open worksheet
data = sheet.get_all_records() # Get a list of all records
if args.cell is not None and args.row==None and args.column==None :
if args.row is not None and args.column==None:
row = sheet.row_values(args.row) # Get a specific row
print(row)
elif args.row ==None and args.column is not None:
col = sheet.col_values(args.column) # Get a specific column
print(col)
elif args.row is not None and args.column is not None:
cell = sheet.cell(args.row,args.column).value # Get the value of a specific cell
print(cell)
val = worksheet.acell(args.cell).value
elif args.row is not None and args.column==None and args.cell == None:
val = worksheet.row_values(args.row) # Get a specific row
elif args.column is not None and args.row== None and args.cell == None:
val = worksheet.col_values(args.column) # Get a specific column
else:
print("To search for data in a cell use the --cell parameter, for data in a column --column and in a row --row, only one of these parameters can be used at a time.")
sys.exit()
print(val)

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.769-230227
Version: 7.0NG.769-230228
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.769-230227"
pandora_version="7.0NG.769-230228"
package_cpan=0
package_pandora=1

View File

@ -42,9 +42,6 @@ use PandoraFMS::PredictionServer;
use PandoraFMS::WebServer;
use PandoraFMS::InventoryServer;
# Constants for Win32 services.
use constant WIN32_SERVICE_STOPPED => 0x01;
use constant WIN32_SERVICE_RUNNING => 0x04;
# Global vars
my %Config :shared;
@ -255,7 +252,6 @@ sub pandora_crash () {
print_message (\%Config, " Error description:\n", 0);
print_message (\%Config, $full_error, 0);
callback_stop() if ($^O eq 'MSWin32' && defined($Config{'win32_service'}));
}
########################################################################################
@ -510,135 +506,6 @@ sub pandora_server_tasks ($) {
db_disconnect($dbh);
}
################################################################################
## Install the Windows service.
################################################################################
sub win32_install_service() {
# Load Win32::Daemon.
eval "use Win32::Daemon";
die($@) if ($@);
# Configure and install the service.
my $service_path = $0;
my $service_params = "-S run \"" . $Config{'pandora_path'} ."\"";
my %service_hash = (
machine => '',
name => 'PANDORAFMSSRV',
display => 'Pandora FMS Server',
path => $service_path,
user => '',
pwd => '',
description => 'Pandora FMS Server http://pandorafms.com/',
parameters => $service_params
);
if (Win32::Daemon::CreateService(\%service_hash)) {
print "Successfully added.\n";
exit 0;
} else {
print "Failed to add service: " . Win32::FormatMessage(Win32::Daemon::GetLastError()) . "\n";
exit 1;
}
}
################################################################################
## Install the Windows service.
################################################################################
sub win32_uninstall_service() {
# Load Win32::Daemon.
eval "use Win32::Daemon";
die($@) if ($@);
# Uninstall the service.
if (Win32::Daemon::DeleteService('', 'PANDORAFMSSRV')) {
print "Successfully deleted.\n";
exit 0;
} else {
print "Failed to delete service: " . Win32::FormatMessage(Win32::Daemon::GetLastError()) . "\n";
exit 1;
}
}
################################################################################
## Windows service callback function for the running event.
################################################################################
sub callback_running {
if (Win32::Daemon::State() == WIN32_SERVICE_RUNNING) {
}
}
################################################################################
## Windows service callback function for the start event.
################################################################################
sub callback_start {
no strict;
# Accept_connections ();
my $thr = threads->create(\&main);
if (!defined($thr)) {
Win32::Daemon::State(WIN32_SERVICE_STOPPED);
Win32::Daemon::StopService();
return;
}
$thr->detach();
Win32::Daemon::State(WIN32_SERVICE_RUNNING);
}
################################################################################
## Windows service callback function for the stop event.
################################################################################
sub callback_stop {
$RUN = 0;
Win32::Daemon::State(WIN32_SERVICE_STOPPED);
Win32::Daemon::StopService();
}
################################################################################
# Run as a Windows service.
################################################################################
sub win32_service_run() {
# Load Win32::Daemon.
eval "use Win32::Daemon";
die($@) if ($@);
# Run the Pandora FMS Server as a Windows service.
Win32::Daemon::RegisterCallbacks({
start => \&callback_start,
running => \&callback_running,
stop => \&callback_stop,
});
Win32::Daemon::StartService();
}
################################################################################
## Parse command line options.
################################################################################
sub parse_service_options ($) {
my $config = shift;
# Sanity checks.
return unless defined($config->{'win32_service'});
die ("[ERROR] Windows services are only available on Win32.\n\n") if ($^O ne 'MSWin32');
# Win32 service management.
eval "use Win32::Daemon";
die($@) if ($@);
if ($config->{'win32_service'} eq 'install') {
win32_install_service();
} elsif ($config->{'win32_service'} eq 'uninstall') {
win32_uninstall_service();
} elsif ($config->{'win32_service'} eq 'run') {
} else {
die("[ERROR] Unknown action: " . $config->{'win32_service'});
}
}
################################################################
################################################################
## Main.
@ -967,17 +834,9 @@ $SIG{'ALRM'} = 'IGNORE';
pandora_init(\%Config, pandora_get_initial_product_name() . ' Server');
pandora_load_config (\%Config);
# Parse command line options.
parse_service_options(\%Config);
# Run as a regular process.
if (!defined($Config{'win32_service'})) {
main();
}
# Run as a Windows service.
else {
win32_service_run();
}
main();
################################################################################
# Kill any scripts started by the Pandora FMS Server that are still running.

View File

@ -46,7 +46,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.769";
my $pandora_build = "230227";
my $pandora_build = "230228";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash
@ -64,7 +64,6 @@ sub help_screen {
print " -d : Debug mode activated. Writes extensive information in the logfile \n";
print " -D : Daemon mode (runs in background)\n";
print " -P <file> : Store PID to file.\n";
print " -S <install|uninstall|run>: Manage the win32 service.\n";
print " -h : This screen. Shows a little help screen \n";
print " \n";
exit;
@ -111,9 +110,6 @@ sub pandora_init {
elsif ($parametro =~ m/-D\z/) {
$pa_config->{"daemon"}=1;
}
elsif ($parametro =~ m/^-S\z/i) {
$pa_config->{'win32_service'}= clean_blank($ARGV[$ax+1]);
}
else {
($pa_config->{"pandora_path"} = $parametro);
}

View File

@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.769";
my $pandora_build = "230227";
my $pandora_build = "230228";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.769
%define release 230227
%define release 230228
Summary: Pandora FMS Server
Name: %{name}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.769
%define release 230227
%define release 230228
Summary: Pandora FMS Server
Name: %{name}

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.769"
PI_BUILD="230227"
PI_BUILD="230228"
MODE=$1
if [ $# -gt 1 ]; then

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.769 Build 230227";
my $version = "7.0NG.769 Build 230228";
# Pandora server configuration
my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "7.0NG.769 Build 230227";
my $version = "7.0NG.769 Build 230228";
# save program name for logging
my $progname = basename($0);