Merge branch 'develop' into ent-10185-filtros-personalizados-para-el-visor-de-datos-de-logs
|
@ -2018,7 +2018,7 @@ sub pandora_agent_run () {
|
|||
$Xml = $xml_header . $Xml . "</agent_data>";
|
||||
|
||||
# Save XML data file
|
||||
my $temp_file = $Conf{'temporal'} . '/' . $Conf{'agent_name'} . '.' . time () . '.data';
|
||||
my $temp_file = $Conf{'temporal'} . '/' . md5($Conf{'agent_name'}) . '.' . time () . '.data';
|
||||
if (-l $temp_file && !unlink($temp_file)) {
|
||||
error ("File '$temp_file' already exists as a symlink and could not be removed: $!");
|
||||
return 1;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.770-230420
|
||||
Version: 7.0NG.770-230428
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.770-230420"
|
||||
pandora_version="7.0NG.770-230428"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -1023,7 +1023,7 @@ my $Sem = undef;
|
|||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.770';
|
||||
use constant AGENT_BUILD => '230420';
|
||||
use constant AGENT_BUILD => '230428';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
@ -4377,7 +4377,7 @@ while (1) {
|
|||
$Xml = $xml_header . $Xml . "</agent_data>";
|
||||
|
||||
# Save XML data file
|
||||
my $temp_file = $Conf{'temporal'} . '/' . $Conf{'agent_name'} . '.' . time () . '.data';
|
||||
my $temp_file = $Conf{'temporal'} . '/' . md5($Conf{'agent_name'}) . '.' . time () . '.data';
|
||||
error ("File '$temp_file' already exists as a symlink and could not be removed: $!") if (-l $temp_file && !unlink($temp_file));
|
||||
open (TEMP_FILE, "> $temp_file") || error ("Could not write XML data file: $!");
|
||||
print TEMP_FILE $Xml;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.770
|
||||
%define release 230420
|
||||
%define release 230428
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.770
|
||||
%define release 230420
|
||||
%define release 230428
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.770"
|
||||
PI_BUILD="230420"
|
||||
PI_BUILD="230428"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{230420}
|
||||
{230428}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.770 Build 230420")
|
||||
#define PANDORA_VERSION ("7.0NG.770 Build 230428")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.770(Build 230420))"
|
||||
VALUE "ProductVersion", "(7.0NG.770(Build 230428))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.770-230420
|
||||
Version: 7.0NG.770-230428
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.770-230420"
|
||||
pandora_version="7.0NG.770-230428"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -9,14 +9,14 @@
|
|||
],
|
||||
"config": {
|
||||
"platform": {
|
||||
"php": "8.0.0"
|
||||
"php": "8.0.2"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"mpdf/mpdf": "^8.0.15",
|
||||
"swiftmailer/swiftmailer": "^6.0",
|
||||
"amphp/parallel-functions": "^1.0",
|
||||
"chrome-php/chrome": "^1.7.1",
|
||||
"chrome-php/chrome": "^1.8.1",
|
||||
"artica/phpchartjs": "^1.0",
|
||||
"tinymce/tinymce": "^6.4"
|
||||
},
|
||||
|
|
|
@ -1,5 +1,16 @@
|
|||
START TRANSACTION;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `tsesion_filter` (
|
||||
`id_filter` INT NOT NULL AUTO_INCREMENT,
|
||||
`id_name` TEXT NULL,
|
||||
`text` TEXT NULL,
|
||||
`period` TEXT NULL,
|
||||
`ip` TEXT NULL,
|
||||
`type` TEXT NULL,
|
||||
`user` TEXT NULL,
|
||||
PRIMARY KEY (`id_filter`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `tsesion_filter_log_viewer` (
|
||||
`id_filter` INT NOT NULL AUTO_INCREMENT,
|
||||
`id_name` TEXT NULL,
|
||||
|
|
|
@ -1519,7 +1519,7 @@ if ($update_module === true || $create_module === true) {
|
|||
$critical_instructions = (string) get_parameter('critical_instructions');
|
||||
$warning_instructions = (string) get_parameter('warning_instructions');
|
||||
$unknown_instructions = (string) get_parameter('unknown_instructions');
|
||||
// Warning thresholds
|
||||
// Warning thresholds.
|
||||
$warning_threshold_check_type = get_parameter('warning_thresholds_checks');
|
||||
if ($warning_threshold_check_type === 'normal_warning') {
|
||||
$percentage_warning = 0;
|
||||
|
@ -1532,7 +1532,7 @@ if ($update_module === true || $create_module === true) {
|
|||
$warning_inverse = 0;
|
||||
}
|
||||
|
||||
// Critical thresholds
|
||||
// Critical thresholds.
|
||||
$critical_threshold_check_type = get_parameter('critical_thresholds_checks');
|
||||
if ($critical_threshold_check_type === 'normal_critical') {
|
||||
$percentage_critical = 0;
|
||||
|
@ -1545,6 +1545,25 @@ if ($update_module === true || $create_module === true) {
|
|||
$critical_inverse = 0;
|
||||
}
|
||||
|
||||
// Inverse string checkbox.
|
||||
if ($id_module_type === MODULE_TYPE_GENERIC_DATA_STRING || $id_module_type === MODULE_TYPE_ASYNC_STRING) {
|
||||
// Warning inverse string checkbox.
|
||||
$warning_string_checkbox = get_parameter('warning_inverse_string');
|
||||
if (!empty($warning_string_checkbox) && $warning_string_checkbox === 'warning_inverse_string') {
|
||||
$warning_inverse = (int) get_parameter('warning_inverse_string_sent');
|
||||
} else {
|
||||
$warning_inverse = 0;
|
||||
}
|
||||
|
||||
// Critial inverse string checkbox.
|
||||
$critical_string_checkbox = get_parameter('critical_inverse_string');
|
||||
if (!empty($critical_string_checkbox) && $critical_string_checkbox === 'critical_inverse_string') {
|
||||
$critical_inverse = (int) get_parameter('critical_inverse_string_sent');
|
||||
} else {
|
||||
$critical_inverse = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$id_category = (int) get_parameter('id_category');
|
||||
|
||||
$hour_from = get_parameter('hour_from');
|
||||
|
|
|
@ -46,7 +46,7 @@ $custom_fields = array_map(
|
|||
function ($field) {
|
||||
$field['secure'] = (bool) $field['secure'];
|
||||
if ($field['secure']) {
|
||||
$field['value'] = io_input_password($field['value']);
|
||||
$field['value'] = io_input_password(io_safe_output($field['value']));
|
||||
}
|
||||
|
||||
return $field;
|
||||
|
@ -75,7 +75,7 @@ if ($add_inventory_module) {
|
|||
'interval' => $interval,
|
||||
'username' => $username,
|
||||
'password' => $password,
|
||||
'custom_fields' => $custom_fields_enabled && !empty($custom_fields) ? base64_encode(json_encode($custom_fields)) : '',
|
||||
'custom_fields' => $custom_fields_enabled && !empty($custom_fields) ? base64_encode(json_encode(io_safe_output($custom_fields), JSON_UNESCAPED_UNICODE)) : '',
|
||||
];
|
||||
|
||||
$result = db_process_sql_insert('tagent_module_inventory', $values);
|
||||
|
@ -119,7 +119,7 @@ if ($add_inventory_module) {
|
|||
'interval' => $interval,
|
||||
'username' => $username,
|
||||
'password' => $password,
|
||||
'custom_fields' => $custom_fields_enabled && !empty($custom_fields) ? base64_encode(json_encode($custom_fields)) : '',
|
||||
'custom_fields' => $custom_fields_enabled && !empty($custom_fields) ? base64_encode(json_encode(io_safe_output($custom_fields, true), JSON_UNESCAPED_UNICODE)) : '',
|
||||
];
|
||||
|
||||
$result = db_process_sql_update('tagent_module_inventory', $values, ['id_agent_module_inventory' => $id_agent_module_inventory, 'id_agente' => $id_agente]);
|
||||
|
|
|
@ -485,7 +485,7 @@ $basicThresholdsIntervalWarning = [];
|
|||
$basicThresholdsIntervalWarning[] = '<span>'.__('Inverse interval').'</span>';
|
||||
$basicThresholdsIntervalWarning[] = html_print_checkbox_switch(
|
||||
'warning_inverse_string',
|
||||
1,
|
||||
'warning_inverse_string',
|
||||
$warning_inverse,
|
||||
true,
|
||||
$disabledBecauseInPolicy
|
||||
|
@ -569,7 +569,7 @@ $basicThresholdsIntervalCritical = [];
|
|||
$basicThresholdsIntervalCritical[] = '<span>'.__('Inverse interval').'</span>';
|
||||
$basicThresholdsIntervalCritical[] = html_print_checkbox_switch(
|
||||
'critical_inverse_string',
|
||||
1,
|
||||
'critical_inverse_string',
|
||||
$critical_inverse,
|
||||
true,
|
||||
$disabledBecauseInPolicy
|
||||
|
@ -694,6 +694,8 @@ if (isset($module['id_policy_module']) === true) {
|
|||
}
|
||||
|
||||
$cps_array[-1] = __('Disabled');
|
||||
$cps_array[0] = __('Enabled');
|
||||
|
||||
if ($cps_module > 0) {
|
||||
$cps_array[$cps_module] = __('Enabled');
|
||||
} else {
|
||||
|
@ -705,7 +707,9 @@ if ($cps_module > 0) {
|
|||
}
|
||||
}
|
||||
|
||||
$cps_array[$cps_inc] = __('Enabled');
|
||||
if ($cps_inc > -1) {
|
||||
$cps_array[$cps_inc] = __('Enabled');
|
||||
}
|
||||
}
|
||||
|
||||
// JS Scripts for ff thresholds.
|
||||
|
|
|
@ -348,8 +348,8 @@ push_table_simple($data, 'tcp_send_receive');
|
|||
|
||||
if ($id_module_type < 8 || $id_module_type > 11) {
|
||||
// NOT TCP.
|
||||
$table_simple->rowstyle['tcp_send'] = 'display: none;';
|
||||
$table_simple->rowstyle['tcp_receive'] = 'display: none;';
|
||||
$table_simple->rowstyle['caption_tcp_send_receive'] = 'display: none;';
|
||||
$table_simple->rowstyle['tcp_send_receive'] = 'display: none;';
|
||||
}
|
||||
|
||||
if ($id_module_type < 15 || $id_module_type > 18) {
|
||||
|
|
|
@ -808,7 +808,7 @@ $table->data['edit1'][1] = '<table width="100%">';
|
|||
1
|
||||
);
|
||||
|
||||
$table->data['edit3'][2] = __('SMNP community');
|
||||
$table->data['edit3'][2] = __('SNMP community');
|
||||
$table->data['edit3'][3] = html_print_input_text(
|
||||
'snmp_community',
|
||||
'',
|
||||
|
|
|
@ -704,7 +704,7 @@ $table->data[$i][] = html_print_label_input_block(
|
|||
)
|
||||
);
|
||||
|
||||
$table->data[$i][] = html_print_label_input_block(
|
||||
$table->data[$i++][] = html_print_label_input_block(
|
||||
__('Check conexion interval'),
|
||||
html_print_input_number(
|
||||
[
|
||||
|
@ -715,6 +715,21 @@ $table->data[$i][] = html_print_label_input_block(
|
|||
)
|
||||
);
|
||||
|
||||
$help_tip = ui_print_help_tip(
|
||||
__('If there are any "In process" events with a specific Extra ID and a New event with that Extra ID is received, it will be created as "In process" instead.'),
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[$i][] = html_print_label_input_block(
|
||||
__('Keep In process status for new events with extra ID').$help_tip,
|
||||
html_print_checkbox_switch(
|
||||
'keep_in_process_status_extra_id',
|
||||
1,
|
||||
$config['keep_in_process_status_extra_id'],
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
echo '<form class="max_floating_element_size" id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&section=general&pure='.$config['pure'].'">';
|
||||
|
||||
echo '<fieldset class="margin-bottom-10">';
|
||||
|
|
|
@ -1421,6 +1421,17 @@ $table_vc->data[$row][] = html_print_label_input_block(
|
|||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table_vc->data[$row][] = html_print_label_input_block(
|
||||
__('Display item frame on alert triggered'),
|
||||
html_print_checkbox_switch(
|
||||
'display_item_frame',
|
||||
1,
|
||||
(bool) $config['display_item_frame'],
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$row++;
|
||||
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ ui_print_standard_header(
|
|||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('SMNP'),
|
||||
'label' => __('SNMP'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
|
|
@ -48,7 +48,7 @@ ui_print_standard_header(
|
|||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('SMNP'),
|
||||
'label' => __('SNMP'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>96007EC9-FBFB-4CDC-A8D3-39F8126F7269</title>
|
||||
<g id="Consola-mobile" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="0a-Menu" transform="translate(-35.000000, -391.974583)" fill="#3F3F3F">
|
||||
<g id="Conmutador" transform="translate(20.000000, 122.000000)">
|
||||
<g id="Elemento" transform="translate(0.000000, 269.974583)">
|
||||
<g id="Mobile-agents" transform="translate(15.000000, 0.000000)">
|
||||
<path d="M15,0 C23.1075582,0 30,2.39269081 30,8.09172156 L30,21.9082784 C30,27.6073092 23.1075582,30 15,30 C6.89244177,30 0,27.6073092 0,21.9082784 L0,8.09172156 C0,2.39269081 6.89244177,0 15,0 Z M20,5 L11.9967103,5 L11.8651969,5.00868163 C11.6483839,5.03744118 11.4456127,5.13675554 11.2893127,5.29318417 L7.29260239,9.29318417 L7.20945254,9.38742572 C6.90458906,9.77984238 6.93255194,10.347062 7.29318417,10.7073976 L7.38742572,10.7905475 C7.77984238,11.0954109 8.34706198,11.0674481 8.70739761,10.7068158 L12.411,6.999 L19.584,6.999 L22.999,10.414 L22.999,19.585 L19.585,22.999 L12.409,22.999 L8.70541325,19.3135693 L8.61100719,19.2306063 C8.21798744,18.9265207 7.65082434,18.9556071 7.29120374,19.3169523 C6.90161476,19.7084097 6.90312938,20.3415729 7.29458675,20.7311618 L11.291297,24.7087963 L11.390258,24.7951247 C11.5635358,24.9272908 11.7763873,25 11.9967103,25 L20,25 L20.131444,24.9913276 C20.3481451,24.9625983 20.5508265,24.8633871 20.7071068,24.7071068 L24.7071068,20.7071068 L24.7939194,20.6080295 C24.9268355,20.434484 25,20.2210137 25,20 L25,10 L24.9913276,9.86855602 C24.9625983,9.65185492 24.8633871,9.44917353 24.7071068,9.29289322 L20.7071068,5.29289322 L20.6080295,5.20608063 C20.434484,5.07316447 20.2210137,5 20,5 Z M14,12 L6,12 C5.44771525,12 5,12.4477153 5,13 L5,17 C5,17.5522847 5.44771525,18 6,18 L14,18 C14.5522847,18 15,17.5522847 15,17 L15,13 C15,12.4477153 14.5522847,12 14,12 Z" id="Mask"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.2 KiB |
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="10px" height="6px" viewBox="0 0 10 6" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: sketchtool 61.2 (101010) - https://sketch.com -->
|
||||
<title>E5134209-ED99-4D42-AFFC-E210CA7C75CA@svg</title>
|
||||
<desc>Created with sketchtool.</desc>
|
||||
<g id="Consola-mobile" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
|
||||
<g id="1a-Tactical-view---default" transform="translate(-37.000000, -671.000000)" stroke="#95A3BF" stroke-width="2">
|
||||
<g id="Conmutador" transform="translate(20.000000, 653.000000)">
|
||||
<g id="Title" transform="translate(10.000000, 9.000000)">
|
||||
<g id="Dropdown-down" transform="translate(8.000000, 10.000000)">
|
||||
<polyline id="Path-8" points="0 0 4 4 8 0"></polyline>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.0 KiB |
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="10px" height="6px" viewBox="0 0 10 6" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: sketchtool 61.2 (101010) - https://sketch.com -->
|
||||
<title>468CE642-FF47-4D9D-8D01-9137E4A42791@svg</title>
|
||||
<desc>Created with sketchtool.</desc>
|
||||
<g id="Consola-mobile" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
|
||||
<g id="1b-Tactical-view---activity-list" transform="translate(-37.000000, -671.000000)" stroke="#95A3BF" stroke-width="2">
|
||||
<g id="Conmutador" transform="translate(20.000000, 653.000000)">
|
||||
<g id="Title" transform="translate(10.000000, 9.000000)">
|
||||
<g id="Dropdown-up" transform="translate(8.000000, 10.000000)">
|
||||
<polyline id="Path-8" transform="translate(4.000000, 2.000000) scale(1, -1) translate(-4.000000, -2.000000) " points="0 0 4 4 8 0"></polyline>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.1 KiB |
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>788260CF-3DE6-4D64-8B30-B9B35413937B</title>
|
||||
<g id="Consola-mobile" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="0a-Menu" transform="translate(-35.000000, -443.949166)" fill="#3F3F3F">
|
||||
<g id="Conmutador" transform="translate(20.000000, 122.000000)">
|
||||
<g id="Elemento" transform="translate(0.000000, 321.949166)">
|
||||
<g id="Mobile-modules" transform="translate(15.000000, 0.000000)">
|
||||
<path d="M15,0 C23.1075582,0 30,2.39269081 30,8.09172156 L30,21.9082784 C30,27.6073092 23.1075582,30 15,30 C6.89244177,30 0,27.6073092 0,21.9082784 L0,16.168 L8.72848758,16.1682636 L8.94543532,16.157208 L9.14227765,16.1277192 C9.65858418,16.028234 10.1028383,15.7637314 10.3982027,15.376652 L11.389,14.076 L14.4909605,20.4094649 L14.5913089,20.5871661 L14.683733,20.7158766 C15.5543921,21.8298347 17.4465108,21.7445543 18.1504724,20.5042927 L20.648,16.101 L22.4708713,16.1014498 L22.6743746,16.0918256 C23.7090033,15.9874588 24.5,15.2164353 24.5,14.2651742 C24.5,13.2349122 23.5776613,12.4288985 22.4708713,12.4288985 L19.409919,12.4288985 L19.1910819,12.4401369 L19.0210633,12.4648524 C18.4062088,12.5770255 17.8894481,12.923802 17.6052051,13.4245902 L16.48,15.405 L13.6321609,9.59066736 L13.5274502,9.40648929 C12.7565937,8.2511657 10.9446993,8.19475986 10.1076384,9.29174039 L7.662,12.495 L0,12.495 L0,8.09172156 C0,2.47775097 6.68823265,0.0721601488 14.6378059,0.00160207373 L15,0 Z" id="Mask"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.7 KiB |
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Icons/Dark/20/checkbox-on@svg</title>
|
||||
<g id="Icons/Dark/20/checkbox-on" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<rect id="Rectangle-2" stroke="#14524F" stroke-width="2" x="1" y="1" width="18" height="18" rx="4"></rect>
|
||||
<path d="M14.3713994,6.22237132 C14.8008905,5.87515972 15.4305323,5.94186038 15.7777439,6.37135141 C16.098247,6.76780467 16.0660673,7.33480068 15.7214138,7.69277628 L15.6287639,7.77769594 L8.20693177,13.7776959 C7.78987666,14.114854 7.18888164,14.0598005 6.83812914,13.672688 L6.76182606,13.5774872 L4.18365814,9.93238606 C3.86473931,9.48148781 3.97172977,8.85742777 4.42262802,8.53850895 C4.83884178,8.24412234 5.40260169,8.31264068 5.73770948,8.67956758 L5.81650513,8.77747883 L7.77861597,11.5510307 L14.3713994,6.22237132 Z" id="Path-10" fill="#14524F" fill-rule="nonzero"></path>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.0 KiB |
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="12px" height="12px" viewBox="0 0 12 12" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: sketchtool 61.2 (101010) - https://sketch.com -->
|
||||
<title>43B3919E-8FE7-441D-8427-E2652997A80E@svg</title>
|
||||
<desc>Created with sketchtool.</desc>
|
||||
<g id="Consola-mobile" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="2e-Events---dropdown-selector" transform="translate(-285.000000, -35.000000)">
|
||||
<g id="Group" transform="translate(1.000000, 16.000000)">
|
||||
<g id="Title" transform="translate(15.000000, 15.000000)">
|
||||
<g id="Icons/Dark/20/close-off" transform="translate(265.000000, 0.000000)">
|
||||
<rect id="Rectangle" x="0" y="0" width="20" height="20"></rect>
|
||||
<path d="M4.35059047,4.35059047 C4.81804444,3.88313651 5.57593706,3.88313651 6.04339103,4.35059047 L6.04339103,4.35059047 L10,8.307 L13.956609,4.35059047 C14.4240629,3.88313651 15.1819556,3.88313651 15.6494095,4.35059047 C16.0876476,4.78882857 16.1150375,5.48233501 15.7315792,5.95248165 L15.6494095,6.04339103 L11.693,10 L15.6494095,13.956609 L15.7315792,14.0475184 C16.1150375,14.517665 16.0876476,15.2111714 15.6494095,15.6494095 C15.1819556,16.1168635 14.4240629,16.1168635 13.956609,15.6494095 L13.956609,15.6494095 L10,11.693 L6.04339103,15.6494095 C5.57593706,16.1168635 4.81804444,16.1168635 4.35059047,15.6494095 C3.91235238,15.2111714 3.8849625,14.517665 4.26842083,14.0475184 L4.35059047,13.956609 L8.307,10 L4.35059047,6.04339103 L4.26842083,5.95248165 C3.8849625,5.48233501 3.91235238,4.78882857 4.35059047,4.35059047 Z" id="Path-6" fill="#95A3BF"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.8 KiB |
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: sketchtool 61.2 (101010) - https://sketch.com -->
|
||||
<title>27D252CA-B4D5-442E-ACDD-238B8E51751E@svg</title>
|
||||
<desc>Created with sketchtool.</desc>
|
||||
<g id="Consola-mobile" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="1a-Tactical-view---default" transform="translate(-20.000000, -17.000000)" fill="#95A3BF">
|
||||
<g id="Elements-/-mobile-/-header">
|
||||
<g id="Go-back" transform="translate(10.000000, 8.000000)">
|
||||
<g id="Group-2" transform="translate(10.000000, 7.000000)">
|
||||
<g id="Back" transform="translate(0.000000, 2.000000)">
|
||||
<path d="M6.22681586,7.18499617 C6.84825397,7.80421394 6.88096124,8.78791523 6.32493766,9.44549969 L6.22681586,9.55195908 C5.60537774,10.1711769 4.61814918,10.2037673 3.95820681,9.64973031 L3.85136569,9.55195908 L0.491971839,6.20456803 L0.471159559,6.18346253 C0.448283024,6.15985237 0.426096906,6.13557366 0.40463361,6.11065869 L0.491971839,6.20456803 C0.449187281,6.16193634 0.409193308,6.117577 0.371989918,6.07171537 C0.350999584,6.04570421 0.330242064,6.0184516 0.310321073,5.99056447 C0.271139022,5.93594655 0.236003122,5.87988377 0.204505607,5.82236871 L0.145733976,5.70401417 C0.124045538,5.65571966 0.104586732,5.60621384 0.0874880109,5.55562669 C0.0818617556,5.53867941 0.0764412566,5.52170989 0.0712989205,5.50467482 C0.0612197632,5.4717683 0.0521679177,5.43808328 0.0441615727,5.40399735 C0.0412764855,5.39105693 0.0384611977,5.37839495 0.0357948693,5.3657081 C0.0291097206,5.33463116 0.0233875846,5.30289036 0.0185767243,5.27085268 C0.0153029314,5.24828532 0.0124012695,5.22594088 0.00995178558,5.20355663 C0.00704369824,5.17765032 0.0047944618,5.15126248 0.00316664333,5.12470734 C0.0016973396,5.10038272 0.000722849869,5.07603294 0.000278799038,5.05167534 C9.04155519e-05,5.04133651 0,5.03122206 0,5.02108658 L0.000563610919,4.9775969 C0.0011706852,4.95417944 0.00226817651,4.93077224 0.00385608484,4.90739193 L0,5.02108658 C0,4.9551527 0.00382623005,4.89010929 0.0112695117,4.82616478 C0.0138053602,4.80529002 0.0166252188,4.78456697 0.0198345397,4.76389234 C0.0327849945,4.67929154 0.0523273944,4.59644178 0.0777734739,4.5162055 C0.0820792159,4.50294578 0.0864580021,4.48969214 0.0910073506,4.47648392 C0.122846114,4.3839691 0.162775714,4.29494223 0.20983783,4.21040281 C0.221199302,4.18987953 0.22970104,4.17526039 0.238443166,4.16074485 C0.254731128,4.13399708 0.271515085,4.10783107 0.288995392,4.08217425 C0.298790066,4.06755699 0.308765074,4.05340543 0.31898569,4.03937632 C0.338027371,4.01341654 0.358006427,3.98757415 0.378709998,3.96234508 C0.384045417,3.95574022 0.388924626,3.94988957 0.393850031,3.94406451 L0.424411969,3.90896446 C0.438242587,3.89347594 0.452357566,3.87824509 0.466748745,3.86328007 L0.491971839,3.83760512 L3.85136569,0.49021407 C4.50732814,-0.16340469 5.5708534,-0.16340469 6.22681586,0.49021407 C6.84825397,1.10943184 6.88096124,2.09313313 6.32493766,2.75071759 L6.22681586,2.85717698 L5.734,3.347 L9.65101119,3.34739105 C13.1574609,3.34739105 16,6.17977404 16,9.67369553 C16,13.0991087 13.2678401,15.8886718 9.85649076,15.9967495 L9.65101119,16 L6.69543864,16 C5.76776764,16 5.01574171,15.250661 5.01574171,14.3263045 C5.01574171,13.4439642 5.70095542,12.7210923 6.57008089,12.6571997 L6.69543864,12.6526089 L9.65101119,12.6526089 C11.3021189,12.6526089 12.6406062,11.318904 12.6406062,9.67369553 C12.6406062,8.08155831 11.3870801,6.78115173 9.80978545,6.69891128 L9.65101119,6.6947821 L5.734,6.694 L6.22681586,7.18499617 Z" id="Path-73"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 3.8 KiB |
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>B6EE5BBF-2CE4-4EFF-9E46-50036986C7F3</title>
|
||||
<g id="Consola-mobile" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="0a-Menu" transform="translate(-35.000000, -236.000000)" fill="#3F3F3F">
|
||||
<g id="Conmutador" transform="translate(20.000000, 122.000000)">
|
||||
<g id="Elemento" transform="translate(0.000000, 114.000000)">
|
||||
<g id="Mobile-groups" transform="translate(15.000000, 0.000000)">
|
||||
<path d="M15,0 C23.1075582,0 30,2.39269081 30,8.09172156 L30,16 C30,14.8954305 29.1045695,14 28,14 L24,14 L24,22.25 C24,23.2164983 23.2164983,24 22.25,24 L14,24 L14,28 C14,29.044389 14.8005167,29.9018074 15.821432,29.992137 C15.5493714,29.9972395 15.2753866,30 15,30 C6.89244177,30 0,27.6073092 0,21.9082784 L0,8.09172156 C0,2.39269081 6.89244177,0 15,0 Z M19.375,8 L9.625,8 C8.72753728,8 8,8.72753728 8,9.625 L8,19.375 C8,20.2724627 8.72753728,21 9.625,21 L19.375,21 C20.2724627,21 21,20.2724627 21,19.375 L21,9.625 C21,8.72753728 20.2724627,8 19.375,8 Z" id="Mask"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.3 KiB |
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: sketchtool 61.2 (101010) - https://sketch.com -->
|
||||
<title>13ED062F-1DD5-4B18-B16F-64D609ACA6F7@svg</title>
|
||||
<desc>Created with sketchtool.</desc>
|
||||
<g id="Consola-mobile" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="1a-Tactical-view---default" transform="translate(-292.000000, -17.000000)" fill="#FFFFFF">
|
||||
<g id="Elements-/-mobile-/-header">
|
||||
<g id="Home" transform="translate(282.000000, 8.000000)">
|
||||
<g id="Group-3" transform="translate(10.000000, 7.000000)">
|
||||
<g id="Home" transform="translate(0.000000, 2.000000)">
|
||||
<path d="M15.7621654,6.04845511 L8.82364649,0.254535942 C8.35663079,-0.0848453139 7.68946552,-0.0848453139 7.1557333,0.254535942 L0.283930943,5.61675978 C-0.249801279,6.02401729 0.0170648321,7.20235138 0.684230109,7.20235138 L1.62318192,7.20235138 L1.62318192,13.3528262 C1.62318192,14.7782275 2.55229288,16 4.02005649,16 L5.35438705,16 C5.75468621,16 6.02155232,15.728495 6.02155232,15.3212375 L6.02155232,11.9953012 C6.02155232,11.2486624 6.62200107,10.4 7.35588288,10.4 L8.69021343,10.4 C9.42409524,10.4 10.024544,11.2486624 10.024544,11.9953012 L10.024544,15.3212375 C10.024544,15.6606187 10.2914101,16 10.6917093,16 L12.0260398,16 C13.4938034,16 14.4,14.7782275 14.4,13.3528262 L14.4,7.20235138 L15.3618662,7.20235138 C15.962315,7.20235138 16.2291811,6.45571262 15.7621654,6.04845511 Z" id="home"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.8 KiB |
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>C79B9248-AD28-44E6-97FA-8E8BEC5C229D</title>
|
||||
<g id="Consola-mobile" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="0a-Menu" transform="translate(-20.000000, -17.000000)" fill="#ED474A">
|
||||
<g id="Go-back" transform="translate(20.000000, 15.000000)">
|
||||
<g id="Icons-/-Dark-/-20-/-Sign-out" transform="translate(8.000000, 10.000000) scale(-1, 1) translate(-8.000000, -10.000000) translate(0.000000, 2.000000)">
|
||||
<path d="M4,0 C6.209139,-4.05812251e-16 8,1.790861 8,4 L8,12 C8,14.209139 6.209139,16 4,16 C1.790861,16 2.705415e-16,14.209139 0,12 L0,4 C-2.705415e-16,1.790861 1.790861,4.05812251e-16 4,0 Z M4.8,8.8 C4.3581722,8.8 4,8.4418278 4,8 C4,7.5581722 4.3581722,7.2 4.8,7.2 L8,7.2 L13.269,7.2 L10.6343146,4.56568542 C10.3459274,4.27729826 10.3237438,3.82351341 10.5677637,3.50968045 L10.6343146,3.43431458 C10.9227017,3.14592741 11.3764866,3.12374378 11.6903196,3.36776369 L11.7656854,3.43431458 L15.7656854,7.43431458 C16.0540726,7.72270174 16.0762562,8.17648659 15.8322363,8.49031955 L15.7656854,8.56568542 L11.7656854,12.5656854 C11.453266,12.8781049 10.946734,12.8781049 10.6343146,12.5656854 C10.3459274,12.2772983 10.3237438,11.8235134 10.5677637,11.5096804 L10.6343146,11.4343146 L13.269,8.8 L8,8.8 L4.8,8.8 Z" id="Rectangle-2"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.5 KiB |
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="30px" height="29.9745831px" viewBox="0 0 30 29.9745831" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>1823C61D-1174-471F-8BAD-A0B8CB687967</title>
|
||||
<g id="Consola-mobile" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="0a-Menu" transform="translate(-35.000000, -340.000000)" fill="#3F3F3F">
|
||||
<g id="Conmutador" transform="translate(20.000000, 122.000000)">
|
||||
<g id="Elemento" transform="translate(0.000000, 218.000000)">
|
||||
<g id="Mobile-alerts" transform="translate(15.000000, 0.000000)">
|
||||
<path d="M30,8.06630471 L30,21.8828616 C30,27.5818923 23.1075582,29.9745831 15,29.9745831 C6.89244177,29.9745831 0,27.5818923 0,21.8828616 L0,8.06630471 C0,2.70512527 6.09946568,0.269891039 13.5720913,-5.84185478e-14 L13.5723301,2.21012161 C10.2928858,2.85573699 7.86075776,5.48727545 7.86075776,8.77458315 C7.86075776,12.6347599 6.57700299,14.1031078 5.68751656,14.9986099 L5.45596532,15.2300015 C5.43160371,15.2544373 5.40774422,15.2784989 5.38443355,15.302237 C5.11657804,15.5751216 4.99782876,15.9013139 4.99997078,16.220737 C5.00497158,16.9145831 5.57952165,17.5745831 6.43308788,17.5745831 L23.5669121,17.5745831 C24.4204784,17.5745831 24.9954749,16.9145831 25.0000292,16.220737 C25.0021712,15.9013139 24.883422,15.5746985 24.6155664,15.302237 L24.5440347,15.2300015 L24.3124834,14.9986099 C23.422997,14.1031078 22.1392422,12.6347599 22.1392422,8.77458315 C22.1392422,5.48727545 19.7071142,2.85573699 16.4276699,2.21012161 L16.4279087,-5.84185478e-14 C23.9005343,0.269891039 30,2.70512527 30,8.06630471 Z M17.8557862,18.6745831 L12.1442138,18.6745831 C12.1442138,20.4973175 13.4232239,21.9745831 15,21.9745831 C16.5767761,21.9745831 17.8557862,20.4973175 17.8557862,18.6745831 Z" id="Mask"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.9 KiB |
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="30px" height="29.853037px" viewBox="0 0 30 29.853037" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>DD299FDE-0DC6-4356-92DC-926BFF90D985</title>
|
||||
<g id="Consola-mobile" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="0a-Menu" transform="translate(-35.000000, -184.146963)" fill="#3F3F3F">
|
||||
<g id="Conmutador" transform="translate(20.000000, 122.000000)">
|
||||
<g id="Elemento" transform="translate(0.000000, 62.000000)">
|
||||
<g id="Content" transform="translate(15.000000, 0.000000)">
|
||||
<g id="Mobile-events" transform="translate(0.000000, 0.146963)">
|
||||
<path d="M30,7.94475857 L30,21.7613154 C30,27.4603462 23.1075582,29.853037 15,29.853037 C6.89244177,29.853037 0,27.4603462 0,21.7613154 L0,7.94475857 C0,3.76611131 3.70546339,1.364994 8.8784529,0.381256498 L7.01052877,12.078037 C6.91552985,12.753037 7.47552349,13.353037 8.20051525,13.353037 L14.1354478,13.353037 L11.830474,22.4702245 C11.650476,23.1827245 12.2304694,23.853037 12.9954608,23.853037 C13.415456,23.853037 13.8154514,23.646787 14.0354489,23.290537 L22.8353489,9.04053701 C23.3003436,8.29522451 22.7253502,7.35303701 21.8003607,7.35303701 L16.0304263,7.35303701 L18.3597639,-1.98591144e-13 C24.9238182,0.598158755 30,3.05392333 30,7.94475857 Z" id="Mask"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.5 KiB |
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>2CF74761-33EB-44F4-9088-CC2767F8DD95</title>
|
||||
<g id="Consola-mobile" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="0a-Menu" transform="translate(-35.000000, -132.000000)" fill="#3F3F3F">
|
||||
<g id="Conmutador" transform="translate(20.000000, 122.000000)">
|
||||
<g id="Elemento" transform="translate(0.000000, 10.000000)">
|
||||
<g id="Mobile-tactical-view" transform="translate(15.000000, 0.000000)">
|
||||
<path d="M0,21.9082784 L0,8.09172156 C0,2.39269081 6.89244177,0 15,0 C23.1075582,0 30,2.39269081 30,8.09172156 L30,21.9082784 C30,27.6073092 23.1075582,30 15,30 C6.89244177,30 0,27.6073092 0,21.9082784 Z M13.9998991,5 L14.0002435,11.0765696 C12.2748927,11.5205277 11,13.0866876 11,14.9506147 C11,17.1597537 12.790861,18.9506147 15,18.9506147 C16.8638701,18.9506147 18.4299912,17.6758 18.8740044,15.9505296 L24.9506147,15.9507157 C24.4488436,21.00399 20.1853136,24.9506147 15,24.9506147 C9.4771525,24.9506147 5,20.4734622 5,14.9506147 C5,9.76530116 8.94662476,5.50177118 13.9998991,5 Z M16.0010997,5.00009923 C20.7249658,5.46963832 24.481539,9.22651135 24.9506147,13.9505138 L18.8737865,13.9498534 C18.51187,12.5448616 17.4057531,11.4387448 16.0007613,11.0768283 Z" id="Mask"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.5 KiB |
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>B4F9F258-05E7-4180-8981-655BFA2BA77E@svg</title>
|
||||
<g id="Consola-mobile" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="0a-Menu" transform="translate(-30.000000, -76.000000)">
|
||||
<g id="Input" transform="translate(20.000000, 65.000000)">
|
||||
<g id="Group" transform="translate(10.000000, 11.000000)">
|
||||
<rect id="Rectangle" x="0" y="0" width="20" height="20"></rect>
|
||||
<path d="M10.5857864,10.5857864 C11.3257272,9.84584567 12.5012114,9.80690142 13.2869988,10.4689537 L13.4142136,10.5857864 L19.4142136,16.5857864 C20.1952621,17.366835 20.1952621,18.633165 19.4142136,19.4142136 C18.6742728,20.1541543 17.4987886,20.1930986 16.7130012,19.5310463 L16.5857864,19.4142136 L10.5857864,13.4142136 C9.80473785,12.633165 9.80473785,11.366835 10.5857864,10.5857864 Z" id="Path-9" fill="#95A3BF" fill-rule="nonzero"></path>
|
||||
<path d="M7,0 C3.13400675,0 0,3.13400675 0,7 C0,10.8659932 3.13400675,14 7,14 C10.8659932,14 14,10.8659932 14,7 C14,3.13400675 10.8659932,0 7,0 Z M7,2 C9.76142375,2 12,4.23857625 12,7 C12,9.76142375 9.76142375,12 7,12 C4.23857625,12 2,9.76142375 2,7 C2,4.23857625 4.23857625,2 7,2 Z" id="Oval" fill="#95A3BF" fill-rule="nonzero"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.5 KiB |
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="30px" height="29px" viewBox="0 0 30 29" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>5DF60C72-9560-434D-8EEE-2966DF14C3C5</title>
|
||||
<g id="Consola-mobile" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="0a-Menu" transform="translate(-35.000000, -495.923749)" fill="#3F3F3F">
|
||||
<g id="Conmutador" transform="translate(20.000000, 122.000000)">
|
||||
<g id="Elemento" transform="translate(0.000000, 373.923749)">
|
||||
<g id="Mobile-server-status" transform="translate(15.000000, 0.000000)">
|
||||
<path d="M8,27 C8.55228475,27 9,27.4477153 9,28 C9,28.5522847 8.55228475,29 8,29 C7.44771525,29 7,28.5522847 7,28 C7,27.4477153 7.44771525,27 8,27 Z M11,27 C11.5522847,27 12,27.4477153 12,28 C12,28.5522847 11.5522847,29 11,29 C10.4477153,29 10,28.5522847 10,28 C10,27.4477153 10.4477153,27 11,27 Z M15,0 C23.1075582,0 30,2.39269081 30,8.09172156 L30,21.9082784 C30,24.9407566 28.0485094,27.0370946 25.0008585,28.3349403 L25,27 C25,26.4477153 24.5522847,26 24,26 L6,26 C5.44771525,26 5,26.4477153 5,27 L5.00014724,28.3353686 C1.95191991,27.0375557 0,24.9410901 0,21.9082784 L0,8.09172156 C0,2.39269081 6.89244177,0 15,0 Z M24,17 L6,17 C5.44771525,17 5,17.4477153 5,18 L5,23 C5,23.5522847 5.44771525,24 6,24 L24,24 C24.5522847,24 25,23.5522847 25,23 L25,18 C25,17.4477153 24.5522847,17 24,17 Z M15,8 C11.6666667,8 8.33333333,8.38888889 5,9.16666667 L5,14 C5,14.5522847 5.44771525,15 6,15 L24,15 C24.5522847,15 25,14.5522847 25,14 L25,9.16666667 C21.6666667,8.38888889 18.3333333,8 15,8 Z M11,10 C11.5522847,10 12,10.4477153 12,11 C12,11.5522847 11.5522847,12 11,12 L8,12 C7.44771525,12 7,11.5522847 7,11 C7,10.4477153 7.44771525,10 8,10 Z" id="Mask"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.9 KiB |
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="30.0011092px" height="30px" viewBox="0 0 30.0011092 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>7A93DEF5-4FEF-40B6-99B7-F2F36D7D47A0</title>
|
||||
<g id="Consola-mobile" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="0a-Menu" transform="translate(-35.000000, -547.898333)" fill="#3F3F3F">
|
||||
<g id="Conmutador" transform="translate(20.000000, 122.000000)">
|
||||
<g id="Mobile-services" transform="translate(15.000000, 425.898333)">
|
||||
<path d="M15,0 C23.1075582,0 30,2.39269081 30,8.09172156 L30.0011092,21.5357707 C29.4125119,21.1950335 28.7290322,21 28,21 C27.2685186,21 26.5828964,21.1963461 25.9929619,21.5392097 L23.1145512,18.1809622 C23.6708634,17.432156 24,16.504515 24,15.5 C24,14.3906757 23.5985973,13.3751041 22.9331138,12.590607 L24.9263454,9.93387288 C25.1105489,9.977122 25.3026027,10 25.5,10 C26.8807119,10 28,8.88071187 28,7.5 C28,6.11928813 26.8807119,5 25.5,5 C24.1192881,5 23,6.11928813 23,7.5 C23,7.94894056 23.1183351,8.37024248 23.3255151,8.73441568 L21.3340363,11.3894793 C20.7738858,11.1391713 20.1531955,11 19.5,11 C18.300645,11 17.2108778,11.4692008 16.4042415,12.2340592 L13.9415885,10.5920657 C13.9799014,10.400661 14,10.2026776 14,10 C14,8.34314575 12.6568542,7 11,7 C9.34314575,7 8,8.34314575 8,10 C8,11.6568542 9.34314575,13 11,13 C11.7271223,13 12.3938258,12.741316 12.9131003,12.3109582 L15.2935368,13.8979357 C15.1038711,14.3956458 15,14.9356927 15,15.5 C15,16.1810495 15.1512936,16.8267624 15.4221048,17.4053628 L11.695466,20.3038146 C11.340333,20.1100926 10.9330233,20 10.5,20 C9.11928813,20 8,21.1192881 8,22.5 C8,23.8807119 9.11928813,25 10.5,25 C11.8807119,25 13,23.8807119 13,22.5 C13,22.286925 12.9733436,22.0800759 12.9231838,21.8826056 L16.6499007,18.9825485 C17.4259628,19.6184248 18.4184206,20 19.5,20 C20.2570179,20 20.9703763,19.8130715 21.5964354,19.4828542 L24.5657994,22.947893 C24.2065164,23.5478609 24,24.2498132 24,25 C24,26.2589117 24.5815758,27.3819891 25.4907148,28.1152196 C22.7594493,29.4088759 19.0298244,30 15,30 C6.89244177,30 0,27.6073092 0,21.9082784 L0,8.09172156 C0,2.39269081 6.89244177,0 15,0 Z" id="Mask"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.3 KiB |
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="11px" height="10px" viewBox="0 0 11 10" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: sketchtool 61.2 (101010) - https://sketch.com -->
|
||||
<title>8FDB48E7-691D-43C7-B7AD-DC381E7FA74C@svg</title>
|
||||
<desc>Created with sketchtool.</desc>
|
||||
<g id="Consola-mobile" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="2b-Events---open-groups" transform="translate(-323.000000, -268.000000)" fill="#3F3F3F">
|
||||
<g id="List" transform="translate(20.000000, 138.000000)">
|
||||
<g id="Conmutador" transform="translate(0.000000, 26.000000)">
|
||||
<g id="Group" transform="translate(10.000000, 48.000000)">
|
||||
<g id="Elements-/-mobile-/-Event-card">
|
||||
<g id="Event">
|
||||
<g id="Secondary" transform="translate(10.000000, 55.000000)">
|
||||
<g id="Label-star" transform="translate(282.000000, 0.000000)">
|
||||
<path d="M6.5,9.75 L4.47286801,10.8157264 C3.98402343,11.0727272 3.37939627,10.8847806 3.12239546,10.3959361 C3.02005639,10.2012756 2.98474172,9.9783075 3.02191856,9.76154987 L3.40906632,7.50430523 L3.40906632,7.50430523 L1.7690821,5.9057157 C1.37359852,5.52021449 1.36550621,4.88710123 1.75100742,4.49161765 C1.90451603,4.33413401 2.10565844,4.23164683 2.32329547,4.20002232 L4.58969793,3.87069477 L4.58969793,3.87069477 L5.60326392,1.81698575 C5.84768622,1.32173209 6.44731205,1.11839309 6.94256571,1.36281539 C7.13977832,1.46014562 7.29940584,1.61977315 7.39673608,1.81698575 L8.41030207,3.87069477 L8.41030207,3.87069477 L10.6767045,4.20002232 C11.2232494,4.27943994 11.6019308,4.78688279 11.5225132,5.33342765 C11.4908887,5.55106469 11.3884015,5.7522071 11.2309179,5.9057157 L9.59093368,7.50430523 L9.59093368,7.50430523 L9.97808144,9.76154987 C10.0714424,10.3058863 9.70585462,10.8228422 9.16151817,10.9162033 C8.94476055,10.9533801 8.72179247,10.9180654 8.52713199,10.8157264 L6.5,9.75 L6.5,9.75 Z" id="Star"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.3 KiB |
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="30px" height="29.3024689px" viewBox="0 0 30 29.3024689" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>51F33933-7E26-4D16-9D45-F3415926FFF6</title>
|
||||
<g id="Consola-mobile" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="0a-Menu" transform="translate(-35.000000, -288.000000)" fill="#3F3F3F">
|
||||
<g id="Conmutador" transform="translate(20.000000, 122.000000)">
|
||||
<g id="Elemento" transform="translate(0.000000, 166.000000)">
|
||||
<g id="Mobile-visual-consoles" transform="translate(15.000000, 0.000000)">
|
||||
<path d="M15,0 C23.1075582,0 30,2.39269081 30,8.09172156 L30,21.9082784 C30,25.8641319 26.679133,28.2269482 21.9361208,29.3022878 C21.9771584,29.207048 22,29.1054294 22,29 L21.992772,28.8977558 C21.921078,28.3934997 21.3248737,28 20.6,28 L17,28 L17,24 L23,24 C24.1045695,24 25,23.1045695 25,22 L25,10 C25,8.8954305 24.1045695,8 23,8 L7,8 C5.8954305,8 5,8.8954305 5,10 L5,22 C5,23.1045695 5.8954305,24 7,24 L13,24 L13,28 L9.4,28 C8.62680135,28 8,28.4477153 8,29 C8,29.1054294 8.02284162,29.207048 8.0651829,29.3024689 C3.32086702,28.2269482 0,25.8641319 0,21.9082784 L0,8.09172156 C0,2.39269081 6.89244177,0 15,0 Z" id="Mask"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 5.5 KiB |
|
@ -2406,7 +2406,7 @@ if ($drawConsoleSound === true) {
|
|||
'Star_Trek_emergency_simulation.wav' => 'StarTrek emergency simulation',
|
||||
];
|
||||
|
||||
$eventsounds = mysql_db_get_all_rows_sql('SELECT * FROM tevent_sound WHERE active = 1');
|
||||
$eventsounds = db_get_all_rows_sql('SELECT * FROM tevent_sound WHERE active = 1');
|
||||
foreach ($eventsounds as $key => $row) {
|
||||
$sounds[$row['sound']] = $row['name'];
|
||||
}
|
||||
|
|
|
@ -583,7 +583,7 @@ if (check_login()) {
|
|||
}
|
||||
|
||||
if (empty($table->data)) {
|
||||
ui_print_error_message(__('No available data to showaaaa'));
|
||||
ui_print_error_message(__('No available data to show'));
|
||||
} else {
|
||||
ui_pagination(
|
||||
count($count),
|
||||
|
|
|
@ -402,8 +402,8 @@ function process_user_login_remote($login, $pass, $api=false)
|
|||
$config['auth_error'] = __('User not found in database or incorrect password');
|
||||
return false;
|
||||
} else {
|
||||
$user_info['fullname'] = db_escape_string_sql($sr['cn'][0]);
|
||||
$user_info['email'] = $sr['mail'][0];
|
||||
$user_info['fullname'] = db_escape_string_sql(io_safe_input($sr['cn'][0]));
|
||||
$user_info['email'] = io_safe_input($sr['mail'][0]);
|
||||
|
||||
// Create the user.
|
||||
$create_user = create_user_and_permisions_ldap(
|
||||
|
|
|
@ -1723,6 +1723,12 @@ class NetworkMap
|
|||
$item['image_width'] = 0;
|
||||
$item['image_height'] = 0;
|
||||
if (empty($node['style']['image']) === false) {
|
||||
if (strpos($node['style']['image'], '.svg') === false) {
|
||||
$node['style']['image'] = os_transform_url_icon(
|
||||
$node['style']['image']
|
||||
);
|
||||
}
|
||||
|
||||
$item['image_url'] = ui_get_full_url(
|
||||
$node['style']['image'],
|
||||
false,
|
||||
|
|
|
@ -719,6 +719,7 @@ class SnmpConsole extends HTML
|
|||
}
|
||||
|
||||
$sql = sprintf($sql, $whereSubquery, $start, $length);
|
||||
|
||||
$sql_count = 'SELECT COUNT(id_trap) FROM ttrap
|
||||
WHERE (
|
||||
source IN ('.implode(',', $address_by_user_groups).") OR
|
||||
|
@ -908,7 +909,7 @@ class SnmpConsole extends HTML
|
|||
).'</a>';
|
||||
|
||||
if ($config['enterprise_installed']) {
|
||||
$tmp->action .= '<a href="index.php?sec=snmpconsole&sec2=enterprise/godmode/snmpconsole/snmp_trap_editor_form&oid='.$tmp->oid.'&custom_oid='.urlencode($tmp->oid_custom).'&severity='.$tmp->severity.'&text='.io_safe_input($tmp->text).'&description='.io_safe_input($tmp->description, ENT_QUOTES).'" title="'.io_safe_input($tmp->description, ENT_QUOTES).'">';
|
||||
$tmp->action .= '<a href="index.php?sec=snmpconsole&sec2=enterprise/godmode/snmpconsole/snmp_trap_editor_form&id='.$tmp->id_trap.'&oid='.$tmp->oid.'&custom_oid='.urlencode($tmp->oid_custom).'&severity='.$tmp->severity.'&text='.io_safe_input($tmp->text).'&description='.io_safe_input($tmp->description, ENT_QUOTES).'" title="'.io_safe_input($tmp->description, ENT_QUOTES).'">';
|
||||
$tmp->action .= html_print_image(
|
||||
'images/edit.svg',
|
||||
true,
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC230420';
|
||||
$build_version = 'PC230428';
|
||||
$pandora_version = 'v7.0NG.770';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
|
|
@ -813,6 +813,7 @@ define('AUDIT_LOG_SERVICE_MANAGEMENT', 'Service management');
|
|||
define('AUDIT_LOG_INCIDENT_MANAGEMENT', 'Incident management');
|
||||
define('AUDIT_LOG_UMC', 'Warp Manager');
|
||||
define('AUDIT_LOG_NMS_VIOLATION', 'NMS Violation');
|
||||
define('AUDIT_LOG_ENTERPRISE_VIOLATION', 'Enterprise Violation');
|
||||
|
||||
// MIMEs.
|
||||
define(
|
||||
|
|
|
@ -4066,28 +4066,28 @@ function series_type_graph_array($data, $show_elements_graph)
|
|||
$value['max'] = 0;
|
||||
}
|
||||
|
||||
$data_return['legend'][$key] .= '<span style="font-size: 9px;">'.__('Min').'</span><span style="font-weight: 600;">'.remove_right_zeros(
|
||||
$data_return['legend'][$key] .= '<span class="legend-font-small">'.__('Min').' </span><span class="bolder">'.remove_right_zeros(
|
||||
number_format(
|
||||
$value['min'],
|
||||
$config['graph_precision'],
|
||||
$config['csv_decimal_separator'],
|
||||
$config['csv_decimal_separator'] == ',' ? '.' : ','
|
||||
)
|
||||
).'</span> <span style="font-size: 9px;">'.__('Max').'</span><span style="font-weight: 600;">'.remove_right_zeros(
|
||||
).' '.$value['unit'].'</span> <span class="legend-font-small">'.__('Max').' </span><span class="bolder">'.remove_right_zeros(
|
||||
number_format(
|
||||
$value['max'],
|
||||
$config['graph_precision'],
|
||||
$config['csv_decimal_separator'],
|
||||
$config['csv_decimal_separator'] == ',' ? '.' : ','
|
||||
)
|
||||
).'</span> <span style="font-size: 9px;">'._('Avg').'</span><span style="font-weight: 600;">'.remove_right_zeros(
|
||||
).' '.$value['unit'].'</span> <span class="legend-font-small">'._('Avg.').' </span><span class="bolder">'.remove_right_zeros(
|
||||
number_format(
|
||||
$value['avg'],
|
||||
$config['graph_precision'],
|
||||
$config['csv_decimal_separator'],
|
||||
$config['csv_decimal_separator'] == ',' ? '.' : ','
|
||||
)
|
||||
).'</span> '.$str;
|
||||
).' '.$value['unit'].'</span> '.$str;
|
||||
|
||||
if ($show_elements_graph['compare'] == 'overlapped'
|
||||
&& $key == 'sum2'
|
||||
|
@ -4129,9 +4129,9 @@ function series_type_graph_array($data, $show_elements_graph)
|
|||
$name_legend .= $value['module_name'].': ';
|
||||
}
|
||||
|
||||
$data_return['legend'][$key] = $name_legend;
|
||||
$data_return['legend'][$key] = '<span style="font-size: 9pt; font-weight: bolder;">'.$name_legend.'</span>';
|
||||
if ($show_elements_graph['type_mode_graph']) {
|
||||
$data_return['legend'][$key] .= __('Min:');
|
||||
$data_return['legend'][$key] .= '<span class="legend-font-small">'.__('Min:').' </span><span class="bolder">';
|
||||
$data_return['legend'][$key] .= remove_right_zeros(
|
||||
number_format(
|
||||
$value['min'],
|
||||
|
@ -4139,8 +4139,8 @@ function series_type_graph_array($data, $show_elements_graph)
|
|||
$config['decimal_separator'],
|
||||
$config['thousand_separator']
|
||||
)
|
||||
);
|
||||
$data_return['legend'][$key] .= ' '.__('Max:');
|
||||
).' '.$value['unit'];
|
||||
$data_return['legend'][$key] .= '</span> <span class="legend-font-small">'.__('Max:').' </span><span class="bolder">';
|
||||
$data_return['legend'][$key] .= remove_right_zeros(
|
||||
number_format(
|
||||
$value['max'],
|
||||
|
@ -4148,8 +4148,8 @@ function series_type_graph_array($data, $show_elements_graph)
|
|||
$config['decimal_separator'],
|
||||
$config['thousand_separator']
|
||||
)
|
||||
);
|
||||
$data_return['legend'][$key] .= ' '._('Avg:');
|
||||
).' '.$value['unit'];
|
||||
$data_return['legend'][$key] .= '</span> <span class="legend-font-small">'._('Avg:').' </span><span class="bolder">';
|
||||
$data_return['legend'][$key] .= remove_right_zeros(
|
||||
number_format(
|
||||
$value['avg'],
|
||||
|
@ -4157,7 +4157,7 @@ function series_type_graph_array($data, $show_elements_graph)
|
|||
$config['decimal_separator'],
|
||||
$config['thousand_separator']
|
||||
)
|
||||
).' '.$str;
|
||||
).' '.$value['unit'].' </span> '.$str;
|
||||
}
|
||||
|
||||
if ($show_elements_graph['compare'] == 'overlapped'
|
||||
|
@ -4171,21 +4171,21 @@ function series_type_graph_array($data, $show_elements_graph)
|
|||
} else if (strpos($key, 'event') !== false) {
|
||||
$data_return['series_type'][$key] = 'points';
|
||||
if ($show_elements_graph['show_events']) {
|
||||
$data_return['legend'][$key] = __('Events').' '.$str;
|
||||
$data_return['legend'][$key] = '<span style="font-size: 9pt; font-weight: bolder;">'.__('Events').'</span>'.$str;
|
||||
}
|
||||
|
||||
$data_return['color'][$key] = $color_series['event'];
|
||||
} else if (strpos($key, 'alert') !== false) {
|
||||
$data_return['series_type'][$key] = 'points';
|
||||
if ($show_elements_graph['show_alerts']) {
|
||||
$data_return['legend'][$key] = __('Alert').' '.$str;
|
||||
$data_return['legend'][$key] = '<span style="font-size: 9pt; font-weight: bolder;">'.__('Alert').'</span>'.$str;
|
||||
}
|
||||
|
||||
$data_return['color'][$key] = $color_series['alert'];
|
||||
} else if (strpos($key, 'unknown') !== false) {
|
||||
$data_return['series_type'][$key] = 'unknown';
|
||||
if ($show_elements_graph['show_unknown']) {
|
||||
$data_return['legend'][$key] = __('Unknown').' '.$str;
|
||||
$data_return['legend'][$key] = '<span style="font-size: 9pt; font-weight: bolder;">'.__('Unknown').'</span>'.$str;
|
||||
}
|
||||
|
||||
$data_return['color'][$key] = $color_series['unknown'];
|
||||
|
@ -4193,7 +4193,7 @@ function series_type_graph_array($data, $show_elements_graph)
|
|||
$data_return['series_type'][$key] = 'percentil';
|
||||
if ($show_elements_graph['percentil']) {
|
||||
if ($show_elements_graph['unit']) {
|
||||
$name_legend = __('Percentil').' ';
|
||||
$name_legend = '<span style="font-size: 9pt; font-weight: bolder;">'.__('Percentil').'</span>';
|
||||
$name_legend .= $config['percentil'].'º ';
|
||||
$name_legend .= __('of module').' ';
|
||||
$name_legend .= $value['agent_alias'].' / ';
|
||||
|
|
|
@ -13090,10 +13090,18 @@ function api_set_create_event($id, $trash1, $other, $returnType)
|
|||
|
||||
if ($other['data'][18] != '') {
|
||||
$values['id_extra'] = $other['data'][18];
|
||||
$sql_validation = 'SELECT id_evento FROM tevento where estado IN (0,2) and id_extra ="'.$other['data'][18].'";';
|
||||
$sql_validation = 'SELECT id_evento,estado FROM tevento where estado IN (0,2) and id_extra ="'.$other['data'][18].'";';
|
||||
$validation = db_get_all_rows_sql($sql_validation);
|
||||
|
||||
if ($validation) {
|
||||
foreach ($validation as $val) {
|
||||
if ((bool) $config['keep_in_process_status_extra_id'] === true
|
||||
&& (int) $val['estado'] === EVENT_STATUS_INPROCESS
|
||||
&& (int) $values['status'] === 0
|
||||
) {
|
||||
$values['status'] = 2;
|
||||
}
|
||||
|
||||
api_set_validate_event_by_id($val['id_evento']);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -370,6 +370,10 @@ function config_update_config()
|
|||
$error_update[] = __('alias_as_name');
|
||||
}
|
||||
|
||||
if (config_update_value('keep_in_process_status_extra_id', get_parameter('keep_in_process_status_extra_id'), true) === false) {
|
||||
$error_update[] = __('keep_in_process_status_extra_id');
|
||||
}
|
||||
|
||||
if (config_update_value('console_log_enabled', get_parameter('console_log_enabled'), true) === false) {
|
||||
$error_update[] = __('Console log enabled');
|
||||
}
|
||||
|
@ -1222,6 +1226,10 @@ function config_update_config()
|
|||
$error_update[] = __('Mobile view not allow visual console orientation');
|
||||
}
|
||||
|
||||
if (config_update_value('display_item_frame', (int) get_parameter('display_item_frame'), true) === false) {
|
||||
$error_update[] = __('Display item frame on alert triggered');
|
||||
}
|
||||
|
||||
if (config_update_value('ser_menu_items', (int) get_parameter('ser_menu_items', 10), true) === false) {
|
||||
$error_update[] = __('Default line menu items for the Services');
|
||||
}
|
||||
|
@ -2343,6 +2351,10 @@ function config_process_config()
|
|||
config_update_value('alias_as_name', 0);
|
||||
}
|
||||
|
||||
if (!isset($config['keep_in_process_status_extra_id'])) {
|
||||
config_update_value('keep_in_process_status_extra_id', 0);
|
||||
}
|
||||
|
||||
if (!isset($config['console_log_enabled'])) {
|
||||
config_update_value('console_log_enabled', 0);
|
||||
}
|
||||
|
@ -3417,6 +3429,10 @@ function config_process_config()
|
|||
config_update_value('mobile_view_orientation_vc', 0);
|
||||
}
|
||||
|
||||
if (isset($config['display_item_frame']) === false) {
|
||||
config_update_value('display_item_frame', 1);
|
||||
}
|
||||
|
||||
if (!isset($config['agent_size_text_small'])) {
|
||||
config_update_value('agent_size_text_small', 18);
|
||||
}
|
||||
|
|
|
@ -251,6 +251,22 @@ function groups_check_used($idGroup)
|
|||
$return['tables'][] = __('Network maps');
|
||||
}
|
||||
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
case 'postgresql':
|
||||
$numRows = db_get_num_rows('SELECT * FROM talert_snmp WHERE id_group = '.$idGroup.';');
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$numRows = db_get_num_rows('SELECT * FROM talert_snmp WHERE id_group = '.$idGroup);
|
||||
break;
|
||||
}
|
||||
|
||||
if ($numRows > 0) {
|
||||
$return['return'] = true;
|
||||
$return['tables'][] = __('SNMP alerts');
|
||||
}
|
||||
|
||||
$hookEnterprise = enterprise_include_once('include/functions_groups.php');
|
||||
if ($hookEnterprise !== ENTERPRISE_NOT_HOOK) {
|
||||
$returnEnterprise = enterprise_hook('groups_check_used_group_enterprise', [$idGroup]);
|
||||
|
|
|
@ -77,7 +77,7 @@ function html_debug_print($var, $file='', $oneline=false)
|
|||
fprintf($f, '%s', $output);
|
||||
fclose($f);
|
||||
} else {
|
||||
echo '<pre class="bg_white pdd_1em zindex10000">'.date('Y/m/d H:i:s').' ('.gettype($var).') '.$more_info."\n";
|
||||
echo '<pre class="bg_white pdd_1em zindex10000 relative-mobile">'.date('Y/m/d H:i:s').' ('.gettype($var).') '.$more_info."\n";
|
||||
print_r($var);
|
||||
echo '</pre>';
|
||||
}
|
||||
|
@ -2884,6 +2884,7 @@ function html_print_input_password(
|
|||
$class='',
|
||||
$autocomplete='off',
|
||||
$hide_div_eye=false,
|
||||
$div_class=''
|
||||
) {
|
||||
if ($maxlength == 0) {
|
||||
$maxlength = 255;
|
||||
|
@ -2914,7 +2915,7 @@ function html_print_input_password(
|
|||
}
|
||||
}
|
||||
|
||||
return '<div class="relative container-div-input-password">'.html_print_input_text_extended($name, $value, 'password-'.$name, $alt, $size, $maxlength, $disabled, '', $attr, $return, true, '', $autocomplete, false, $hide_div_eye).'</div>';
|
||||
return '<div class="relative container-div-input-password '.$div_class.'">'.html_print_input_text_extended($name, $value, 'password-'.$name, $alt, $size, $maxlength, $disabled, '', $attr, $return, true, '', $autocomplete, false, $hide_div_eye).'</div>';
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -570,7 +570,7 @@ function network_components_get_name($id_network_component)
|
|||
return false;
|
||||
}
|
||||
|
||||
return @db_get_value('name', 'tnetwork_component', 'id', $id_network_component);
|
||||
return @db_get_value('name', 'tnetwork_component', 'id_nc', $id_network_component);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -232,3 +232,97 @@ function os_get_icon($id_os)
|
|||
{
|
||||
return db_get_value('icon_name', 'tconfig_os', 'id_os', (int) $id_os);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Transform the old icon url.
|
||||
*
|
||||
* @param string $url_icon Icon url .
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function os_transform_url_icon($url_icon)
|
||||
{
|
||||
$return = substr($url_icon, 0, strpos($url_icon, basename($url_icon)));
|
||||
switch (basename($url_icon)) {
|
||||
case 'android.png':
|
||||
$return .= 'android@os.svg';
|
||||
break;
|
||||
|
||||
case 'so_mac.png':
|
||||
$return .= 'apple@os.svg';
|
||||
break;
|
||||
|
||||
case 'so_cisco.png':
|
||||
$return .= 'cisco@os.svg';
|
||||
break;
|
||||
|
||||
case 'so_aix.png':
|
||||
$return .= 'aix@os.svg';
|
||||
break;
|
||||
|
||||
case 'so_win.png':
|
||||
$return .= 'windows@os.svg';
|
||||
break;
|
||||
|
||||
case 'so_vmware.png':
|
||||
$return .= 'vmware@os.svg';
|
||||
break;
|
||||
|
||||
case 'so_solaris.png':
|
||||
$return .= 'solaris@os.svg';
|
||||
break;
|
||||
|
||||
case 'so_linux.png':
|
||||
$return .= 'linux@os.svg';
|
||||
break;
|
||||
|
||||
case 'so_bsd.png':
|
||||
$return .= 'freebsd@os.svg';
|
||||
break;
|
||||
|
||||
case 'so_cluster.png':
|
||||
$return .= 'cluster@os.svg';
|
||||
break;
|
||||
|
||||
case 'so_other.png':
|
||||
$return .= 'other-OS@os.svg';
|
||||
break;
|
||||
|
||||
case 'so_switch.png':
|
||||
$return .= 'switch@os.svg';
|
||||
break;
|
||||
|
||||
case 'so_mainframe.png':
|
||||
$return .= 'mainframe@os.svg';
|
||||
break;
|
||||
|
||||
case 'so_hpux.png':
|
||||
case 'server_hpux.png':
|
||||
$return .= 'HP@os.svg';
|
||||
break;
|
||||
|
||||
case 'so_router.png':
|
||||
case 'router.png':
|
||||
$return .= 'routers@os.svg';
|
||||
break;
|
||||
|
||||
case 'embedded.png':
|
||||
$return .= 'embedded@os.svg';
|
||||
break;
|
||||
|
||||
case 'network.png':
|
||||
$return .= 'network-server@os.svg';
|
||||
break;
|
||||
|
||||
case 'satellite.png':
|
||||
$return .= 'satellite@os.svg';
|
||||
break;
|
||||
|
||||
default:
|
||||
$return = $url_icon;
|
||||
break;
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
|
|
@ -12130,6 +12130,70 @@ function reporting_get_stats_indicators($data, $width=280, $height=20, $html=tru
|
|||
}
|
||||
|
||||
|
||||
function reporting_get_stats_indicators_mobile($data, $width=280, $height=20, $html=true)
|
||||
{
|
||||
$table_ind = html_get_predefined_table();
|
||||
|
||||
$servers = [];
|
||||
$servers['all'] = (int) db_get_value('COUNT(id_server)', 'tserver');
|
||||
$servers['up'] = (int) servers_check_status();
|
||||
$servers['down'] = ($servers['all'] - $servers['up']);
|
||||
if ($servers['all'] == 0) {
|
||||
$servers['health'] = 0;
|
||||
} else {
|
||||
$servers['health'] = ($servers['up'] / ($servers['all'] / 100));
|
||||
}
|
||||
|
||||
$return = [];
|
||||
|
||||
$color = get_color_progress_mobile($servers['health']);
|
||||
$return['server_health'] = [
|
||||
'title' => __('Server health'),
|
||||
'graph' => ui_progress($servers['health'], '90%', '.8', $color, true, ' ', false),
|
||||
];
|
||||
|
||||
$color = get_color_progress_mobile($data['monitor_health']);
|
||||
$return['monitor_health'] = [
|
||||
'title' => __('Monitor health'),
|
||||
'graph' => ui_progress($data['monitor_health'], '90%', '.8', $color, true, ' ', false),
|
||||
];
|
||||
|
||||
$color = get_color_progress_mobile($data['module_sanity']);
|
||||
$return['module_sanity'] = [
|
||||
'title' => __('Module sanity'),
|
||||
'graph' => ui_progress($data['module_sanity'], '90%', '.8', $color, true, ' ', false),
|
||||
];
|
||||
|
||||
$color = get_color_progress_mobile($data['alert_level']);
|
||||
$return['alert_level'] = [
|
||||
'title' => __('Alert level'),
|
||||
'graph' => ui_progress($data['alert_level'], '90%', '.8', $color, true, ' ', false),
|
||||
];
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
function get_color_progress_mobile($value)
|
||||
{
|
||||
$color = '';
|
||||
|
||||
if ((int) $value > 66) {
|
||||
$color = '#82B92E';
|
||||
}
|
||||
|
||||
if ((int) $value < 66) {
|
||||
$color = '#FCAB10';
|
||||
}
|
||||
|
||||
if ((int) $value < 33) {
|
||||
$color = '#ED474A';
|
||||
}
|
||||
|
||||
return $color;
|
||||
}
|
||||
|
||||
|
||||
function reporting_get_stats_alerts($data, $links=false)
|
||||
{
|
||||
global $config;
|
||||
|
|
|
@ -522,7 +522,7 @@ function servers_get_rate($avg_interval, $num_modules)
|
|||
*
|
||||
* @return mixed False in case the server doesn't exist or an array with info.
|
||||
*/
|
||||
function servers_get_info($id_server=-1)
|
||||
function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
{
|
||||
global $config;
|
||||
|
||||
|
@ -538,6 +538,14 @@ function servers_get_info($id_server=-1)
|
|||
SELECT *
|
||||
FROM tserver '.$select_id.'
|
||||
ORDER BY server_type';
|
||||
|
||||
if ($sql_limit !== -1) {
|
||||
$sql = '
|
||||
SELECT *
|
||||
FROM tserver '.$select_id.'
|
||||
ORDER BY server_type'.$sql_limit;
|
||||
}
|
||||
|
||||
$result = db_get_all_rows_sql($sql);
|
||||
$time = get_system_time();
|
||||
|
||||
|
|
|
@ -1302,9 +1302,10 @@ function snmp_browser_create_modules_snmp(
|
|||
$snmp3_auth_pass = $snmp_values['snmp3_browser_auth_pass'];
|
||||
}
|
||||
|
||||
if (isset($snmp_values['snmp3_privacy_method']) === true) {
|
||||
$snmp3_privacy_method = $snmp_values['snmp3_privacy_method'];
|
||||
if (isset($snmp_values['snmp3_browser_privacy_method']) === true) {
|
||||
$snmp3_privacy_method = $snmp_values['snmp3_browser_privacy_method'];
|
||||
};
|
||||
|
||||
if (isset($snmp_values['snmp3_browser_privacy_pass']) === true) {
|
||||
$snmp3_privacy_pass = $snmp_values['snmp3_browser_privacy_pass'];
|
||||
}
|
||||
|
@ -1376,9 +1377,9 @@ function snmp_browser_create_modules_snmp(
|
|||
'id_module_group' => 3,
|
||||
'id_modulo' => 2,
|
||||
'id_plugin' => 0,
|
||||
'plugin_user' => '',
|
||||
'plugin_pass' => '',
|
||||
'plugin_parameter' => '',
|
||||
'plugin_user' => $snmp3_auth_user,
|
||||
'plugin_pass' => $snmp3_auth_pass,
|
||||
'plugin_parameter' => $snmp3_auth_method,
|
||||
'macros' => '',
|
||||
'max_timeout' => 0,
|
||||
'max_retries' => 0,
|
||||
|
@ -1394,9 +1395,9 @@ function snmp_browser_create_modules_snmp(
|
|||
'max_critical' => 0,
|
||||
'str_critical' => '',
|
||||
'min_ff_event' => 0,
|
||||
'custom_string_1' => '',
|
||||
'custom_string_2' => '',
|
||||
'custom_string_3' => '',
|
||||
'custom_string_1' => $snmp3_privacy_method,
|
||||
'custom_string_2' => $snmp3_privacy_pass,
|
||||
'custom_string_3' => $snmp3_security_level,
|
||||
'post_process' => 0,
|
||||
'unit' => '',
|
||||
'wizard_level' => 'nowizard',
|
||||
|
@ -1435,9 +1436,9 @@ function snmp_browser_create_modules_snmp(
|
|||
'id_module_group' => 3,
|
||||
'id_modulo' => 2,
|
||||
'id_plugin' => 0,
|
||||
'plugin_user' => '',
|
||||
'plugin_pass' => '',
|
||||
'plugin_parameter' => '',
|
||||
'plugin_user' => $snmp3_auth_user,
|
||||
'plugin_pass' => $snmp3_auth_pass,
|
||||
'plugin_parameter' => $snmp3_auth_method,
|
||||
'macros' => '',
|
||||
'max_timeout' => 0,
|
||||
'max_retries' => 0,
|
||||
|
@ -1453,9 +1454,9 @@ function snmp_browser_create_modules_snmp(
|
|||
'max_critical' => 0,
|
||||
'str_critical' => '',
|
||||
'min_ff_event' => 0,
|
||||
'custom_string_1' => '',
|
||||
'custom_string_2' => '',
|
||||
'custom_string_3' => '',
|
||||
'custom_string_1' => $snmp3_privacy_method,
|
||||
'custom_string_2' => $snmp3_privacy_pass,
|
||||
'custom_string_3' => $snmp3_security_level,
|
||||
'post_process' => 0,
|
||||
'unit' => '',
|
||||
'wizard_level' => 'nowizard',
|
||||
|
@ -1496,9 +1497,9 @@ function snmp_browser_create_modules_snmp(
|
|||
'snmp_community' => $community,
|
||||
'id_module_group' => 3,
|
||||
'id_plugin' => 0,
|
||||
'plugin_user' => '',
|
||||
'plugin_pass' => '',
|
||||
'plugin_parameter' => '',
|
||||
'plugin_user' => $snmp3_auth_user,
|
||||
'plugin_pass' => $snmp3_auth_pass,
|
||||
'plugin_parameter' => $snmp3_auth_method,
|
||||
'macros' => '',
|
||||
'max_timeout' => 0,
|
||||
'max_retries' => 0,
|
||||
|
@ -1514,9 +1515,9 @@ function snmp_browser_create_modules_snmp(
|
|||
'max_critical' => 0,
|
||||
'str_critical' => '',
|
||||
'min_ff_event' => 0,
|
||||
'custom_string_1' => '',
|
||||
'custom_string_2' => '',
|
||||
'custom_string_3' => '',
|
||||
'custom_string_1' => $snmp3_privacy_method,
|
||||
'custom_string_2' => $snmp3_privacy_pass,
|
||||
'custom_string_3' => $snmp3_security_level,
|
||||
'post_process' => 0,
|
||||
'unit' => '',
|
||||
'macros' => '',
|
||||
|
|
|
@ -1770,7 +1770,7 @@ function ui_require_javascript_file($name, $path='include/javascript/', $echo_ta
|
|||
|
||||
if (is_metaconsole()
|
||||
&& (isset($config['requirements_use_base_url']) === false
|
||||
|| $config['requirements_use_base_url'] === false)
|
||||
|| $config['requirements_use_base_url'] === false) && $filename !== 'include/javascript/select2.min.js'
|
||||
) {
|
||||
$config['js'][$name] = '../../'.$filename;
|
||||
} else {
|
||||
|
@ -7459,13 +7459,20 @@ function ui_get_inventory_module_add_form(
|
|||
0,
|
||||
'',
|
||||
__('Select inventory module'),
|
||||
0,
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'w100p',
|
||||
false,
|
||||
'width: 100%'
|
||||
'width: 100%',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
true
|
||||
)
|
||||
);
|
||||
} else {
|
||||
|
@ -7560,81 +7567,95 @@ function ui_get_inventory_module_add_form(
|
|||
$table->data['userpass-row'] = $row;
|
||||
|
||||
$row = [];
|
||||
$row['hidden-title'] = '';
|
||||
$row['hidden-input'] = html_print_input_hidden('hidden-custom-field-name', '', true);
|
||||
$row['hidden-input'] .= html_print_input_hidden('hidden-custom-field-is-secure', 0, true);
|
||||
$row['hidden-input'] .= html_print_input_text(
|
||||
'hidden-custom-field-input',
|
||||
'',
|
||||
'',
|
||||
25,
|
||||
40,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w93p'
|
||||
);
|
||||
$row['hidden-input'] .= html_print_image(
|
||||
'images/delete.svg',
|
||||
true,
|
||||
[
|
||||
'border' => '0',
|
||||
'title' => __('Remove'),
|
||||
'style' => 'cursor: pointer;',
|
||||
'class' => 'remove-custom-field invert_filter',
|
||||
]
|
||||
);
|
||||
|
||||
$table->data['hidden-custom-field-row'] = $row;
|
||||
$table->data['hidden-custom-field-row'] = html_print_label_input_block(
|
||||
'',
|
||||
'<div class="agent_details_agent_data">'.html_print_input_hidden(
|
||||
'hidden-custom-field-name',
|
||||
'',
|
||||
true
|
||||
).html_print_input_hidden(
|
||||
'hidden-custom-field-is-secure',
|
||||
0,
|
||||
true
|
||||
).html_print_input_text(
|
||||
'hidden-custom-field-input',
|
||||
'',
|
||||
'',
|
||||
25,
|
||||
40,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w100p'
|
||||
).html_print_image(
|
||||
'images/delete.svg',
|
||||
true,
|
||||
[
|
||||
'border' => '0',
|
||||
'title' => __('Remove'),
|
||||
'style' => 'cursor: pointer;',
|
||||
'class' => 'remove-custom-field invert_filter main_menu_icon',
|
||||
]
|
||||
).'</div>'
|
||||
);
|
||||
$table->colspan['hidden-custom-field-row'][0] = 2;
|
||||
|
||||
if ($custom_fields_enabled) {
|
||||
foreach ($custom_fields as $i => $field) {
|
||||
$row = [];
|
||||
$row['title'] = '<b>'.$field['name'].'</b>';
|
||||
$row['input'] = html_print_input_hidden(
|
||||
'custom_fields['.$i.'][name]',
|
||||
$field['name'],
|
||||
true
|
||||
);
|
||||
$row['input'] .= html_print_input_hidden(
|
||||
'custom_fields['.$i.'][secure]',
|
||||
$field['secure'],
|
||||
true
|
||||
);
|
||||
if ($field['secure']) {
|
||||
$row['input'] .= html_print_input_password(
|
||||
$secure = html_print_input_password(
|
||||
'custom_fields['.$i.'][value]',
|
||||
$field['value'],
|
||||
io_safe_input($field['value']),
|
||||
'',
|
||||
25,
|
||||
false,
|
||||
40,
|
||||
true
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'off',
|
||||
false,
|
||||
'w100p'
|
||||
);
|
||||
} else {
|
||||
$row['input'] .= html_print_input_text(
|
||||
$secure = html_print_input_text(
|
||||
'custom_fields['.$i.'][value]',
|
||||
$field['value'],
|
||||
io_safe_input($field['value']),
|
||||
'',
|
||||
25,
|
||||
false,
|
||||
40,
|
||||
true
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w100p'
|
||||
);
|
||||
}
|
||||
|
||||
$row['input'] .= '<span> </span>';
|
||||
$row['input'] .= html_print_image(
|
||||
'images/delete.svg',
|
||||
true,
|
||||
[
|
||||
'border' => '0',
|
||||
'title' => __('Remove'),
|
||||
'style' => 'cursor: pointer;',
|
||||
'class' => 'remove-custom-field invert_filter',
|
||||
]
|
||||
$table->colspan['custom-field-row-'.$i][0] = 2;
|
||||
$table->data['custom-field-row-'.$i] = html_print_label_input_block(
|
||||
$field['name'],
|
||||
'<div class="agent_details_agent_data">'.html_print_input_hidden(
|
||||
'custom_fields['.$i.'][name]',
|
||||
$field['name'],
|
||||
true
|
||||
).html_print_input_hidden(
|
||||
'custom_fields['.$i.'][secure]',
|
||||
$field['secure'],
|
||||
true
|
||||
).$secure.html_print_image(
|
||||
'images/delete.svg',
|
||||
true,
|
||||
[
|
||||
'border' => '0',
|
||||
'title' => __('Remove'),
|
||||
'style' => 'cursor: pointer;',
|
||||
'class' => 'remove-custom-field invert_filter main_menu_icon',
|
||||
]
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
$table->data['custom-field-row-'.$i] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7693,46 +7714,50 @@ function ui_get_inventory_module_add_form(
|
|||
$("#inventory-module-form-userpass-row").hide();
|
||||
$("#inventory-module-form-custom-fields-row").show();
|
||||
$("tr[id^=inventory-module-form-custom-field-row-]").show();
|
||||
$('#inventory-module-form-custom-fields-button').show();
|
||||
} else {
|
||||
$("#inventory-module-form-userpass-row").show();
|
||||
$("#inventory-module-form-custom-fields-row").hide();
|
||||
$("tr[id^=inventory-module-form-custom-field-row-]").hide();
|
||||
$('#inventory-module-form-custom-fields-button').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function add_row_for_custom_field (fieldName, isSecure) {
|
||||
var custom_fields_num = $("tr[id^=inventory-module-form-custom-field-row-]").length;
|
||||
$("#inventory-module-form-hidden-custom-field-row")
|
||||
.clone()
|
||||
.prop("id", "inventory-module-form-custom-field-row-" + custom_fields_num)
|
||||
.children("#inventory-module-form-hidden-custom-field-row-hidden-title")
|
||||
.prop("id", "inventory-module-form-custom-field-row-title-" + custom_fields_num)
|
||||
.html("<b>" + fieldName + "</b>")
|
||||
.parent()
|
||||
.children("#inventory-module-form-hidden-custom-field-row-hidden-input")
|
||||
.prop("id", "inventory-module-form-custom-field-row-input-" + custom_fields_num)
|
||||
.prop("colspan", 2)
|
||||
.children("input[name=hidden-custom-field-name]")
|
||||
.clone()
|
||||
.prop("id", "inventory-module-form-custom-field-row-" + custom_fields_num)
|
||||
.children("[id^='inventory-module-form-hidden-custom-field-row']") // go to TD
|
||||
.prop("id", "inventory-module-form-hidden-custom-field-row-"+ custom_fields_num)
|
||||
.children() // go to DIV
|
||||
.find('label')
|
||||
.html(fieldName)
|
||||
.parent() // up to DIV padre
|
||||
.find('div') //go to DIV no label
|
||||
.children("[id^=hidden-hidden-custom-field-name]")
|
||||
.prop("id", "custom-field-name-" + custom_fields_num)
|
||||
.prop("name", "custom_fields[" + custom_fields_num + "][name]")
|
||||
.val(fieldName)
|
||||
.prop("value", fieldName)
|
||||
.parent()
|
||||
.children("input[name=hidden-custom-field-is-secure]")
|
||||
.prop("id", "custom-field-is-secure-" + custom_fields_num)
|
||||
.prop("name", "custom_fields[" + custom_fields_num + "][secure]")
|
||||
.val(isSecure ? 1 : 0)
|
||||
.parent()
|
||||
.children("input[name=hidden-custom-field-input]")
|
||||
.prop("id", "custom-field-input-" + custom_fields_num)
|
||||
.prop("type", isSecure ? "password" : "text")
|
||||
.prop("name", "custom_fields[" + custom_fields_num + "][value]")
|
||||
.parent()
|
||||
.children("img.remove-custom-field")
|
||||
.click(remove_custom_field)
|
||||
.parent()
|
||||
.parent()
|
||||
.insertBefore($("#inventory-module-form-custom-fields-row"))
|
||||
.show();
|
||||
.children("input[name=hidden-custom-field-is-secure]")
|
||||
.prop("id", "custom-field-is-secure-" + custom_fields_num)
|
||||
.prop("name", "custom_fields[" + custom_fields_num + "][secure]")
|
||||
.val(isSecure ? 1 : 0)
|
||||
.parent()
|
||||
.children("input[name=hidden-custom-field-input]")
|
||||
.prop("id", "custom-field-input-" + custom_fields_num)
|
||||
.prop("type", isSecure ? "password" : "text")
|
||||
.prop("name", "custom_fields[" + custom_fields_num + "][value]")
|
||||
.parent()
|
||||
.children("img.remove-custom-field")
|
||||
.click(remove_custom_field)
|
||||
.parent()
|
||||
.parent()
|
||||
.parent() // up to TD
|
||||
.parent() // up to TR
|
||||
.insertBefore($("#inventory-module-form-custom-fields-row"))
|
||||
.show();
|
||||
}
|
||||
|
||||
function add_custom_field () {
|
||||
|
|
|
@ -2062,7 +2062,8 @@ function pandoraFlotArea(
|
|||
yaxes: [
|
||||
{
|
||||
tickFormatter: yFormatter,
|
||||
position: "left"
|
||||
position: "left",
|
||||
minTickSize: 0.5
|
||||
}
|
||||
],
|
||||
legend: {
|
||||
|
@ -2462,12 +2463,13 @@ function pandoraFlotArea(
|
|||
$.each(update_legend, function(index, value) {
|
||||
if (typeof value[x - 1] !== "undefined") {
|
||||
data_legend[index] =
|
||||
" Min: " +
|
||||
"<span class='legend-font-small'> Min: </span><span class='bolder'>" +
|
||||
number_format(value[x - 1].min, 0, unit, short_data, divisor) +
|
||||
" Max: " +
|
||||
"</span><span class='legend-font-small'> Max: </span><span class='bolder'>" +
|
||||
number_format(value[x - 1].max, 0, unit, short_data, divisor) +
|
||||
" Avg: " +
|
||||
number_format(value[x - 1].avg, 0, unit, short_data, divisor);
|
||||
"</span><span class='legend-font-small'> Avg: </span><span class='bolder'>" +
|
||||
number_format(value[x - 1].avg, 0, unit, short_data, divisor) +
|
||||
"</span>";
|
||||
} else {
|
||||
data_legend[index] = " Min: " + 0 + " Max: " + 0 + " Avg: " + 0;
|
||||
}
|
||||
|
@ -2475,9 +2477,9 @@ function pandoraFlotArea(
|
|||
|
||||
if (typeof data_legend[series.label] !== "undefined") {
|
||||
label_aux =
|
||||
legend[series.label].split(": Min")[0] +
|
||||
": " +
|
||||
data_legend[series.label];
|
||||
legend[series.label].split(
|
||||
'<span class="legend-font-small">'
|
||||
)[0] + data_legend[series.label];
|
||||
$("#legend_" + graph_id + " .legendLabel")
|
||||
.eq(i)
|
||||
.html(label_aux);
|
||||
|
|
|
@ -3887,7 +3887,8 @@ function draw_elements_graph() {
|
|||
return d.id + networkmap_id;
|
||||
})
|
||||
.attr("style", function(d) {
|
||||
return d.id === 0 ? "filter: invert(0%)" : "";
|
||||
const extension = d.image_url.split(".").pop();
|
||||
return extension !== "svg" || d.id === 0 ? "filter: invert(0%)" : "";
|
||||
})
|
||||
.attr("id", "image2995")
|
||||
.classed("dragable_node", true) //own dragable
|
||||
|
|
|
@ -944,8 +944,28 @@ function process_buffers(buffers) {
|
|||
}
|
||||
|
||||
function openSoundEventModal(settings) {
|
||||
settings = JSON.parse(atob(settings));
|
||||
if ($("#hidden-metaconsole_activated").val() === "1") {
|
||||
var win = open(
|
||||
"../../operation/events/sound_events.php",
|
||||
"day_123",
|
||||
"width=600,height=500"
|
||||
);
|
||||
} else {
|
||||
var win = open(
|
||||
"operation/events/sound_events.php",
|
||||
"day_123",
|
||||
"width=600,height=500"
|
||||
);
|
||||
}
|
||||
if (win) {
|
||||
//Browser has allowed it to be opened
|
||||
win.focus();
|
||||
} else {
|
||||
//Browser has blocked it
|
||||
alert("Please allow popups for this website");
|
||||
}
|
||||
|
||||
settings = JSON.parse(atob(settings));
|
||||
// Check modal exists and is open.
|
||||
if (
|
||||
$("#modal-sound").hasClass("ui-dialog-content") &&
|
||||
|
@ -953,102 +973,6 @@ function openSoundEventModal(settings) {
|
|||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Initialize modal.
|
||||
$("#modal-sound")
|
||||
.empty()
|
||||
.dialog({
|
||||
title: settings.title,
|
||||
resizable: false,
|
||||
modal: true,
|
||||
position: { my: "right top", at: "right bottom", of: window },
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
},
|
||||
width: 600,
|
||||
height: 600,
|
||||
open: function() {
|
||||
$(".ui-widget-overlay")
|
||||
.css("background", "black")
|
||||
.css("opacity", 0.5);
|
||||
$.ajax({
|
||||
method: "post",
|
||||
url: settings.url,
|
||||
data: {
|
||||
page: settings.page,
|
||||
drawConsoleSound: 1
|
||||
},
|
||||
dataType: "html",
|
||||
success: function(data) {
|
||||
$("#modal-sound").append(data);
|
||||
$("#tabs-sound-modal").tabs({
|
||||
disabled: [1]
|
||||
});
|
||||
|
||||
// Test sound.
|
||||
$("#button-melody_sound").click(function() {
|
||||
var sound = false;
|
||||
if ($("#id_sound_event").length == 0) {
|
||||
sound = true;
|
||||
}
|
||||
|
||||
test_sound_button(sound, settings.urlSound);
|
||||
});
|
||||
|
||||
// Play Stop.
|
||||
$("#button-start-search").click(function() {
|
||||
var mode = $("#hidden-mode_alert").val();
|
||||
var action = false;
|
||||
if (mode == 0) {
|
||||
action = true;
|
||||
}
|
||||
|
||||
action_events_sound(action, settings);
|
||||
});
|
||||
|
||||
// Silence Alert.
|
||||
$("#button-no-alerts").click(function() {
|
||||
if ($("#button-no-alerts").hasClass("silence-alerts") === true) {
|
||||
// Remove audio.
|
||||
remove_audio();
|
||||
|
||||
// Clean events.
|
||||
$("#tabs-sound-modal .elements-discovered-alerts ul").empty();
|
||||
$("#tabs-sound-modal .empty-discovered-alerts").removeClass(
|
||||
"invisible_important"
|
||||
);
|
||||
|
||||
// Clean progress.
|
||||
$("#progressbar_time").empty();
|
||||
|
||||
// Change img button.
|
||||
$("#button-no-alerts")
|
||||
.removeClass("silence-alerts")
|
||||
.addClass("alerts");
|
||||
// Change value button.
|
||||
$("#button-no-alerts").val(settings.noAlert);
|
||||
$("#button-no-alerts > span").text(settings.noAlert);
|
||||
|
||||
// Background button.
|
||||
$(".container-button-alert").removeClass("fired");
|
||||
|
||||
// New progress.
|
||||
listen_event_sound(settings);
|
||||
}
|
||||
});
|
||||
},
|
||||
error: function(error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
},
|
||||
close: function() {
|
||||
remove_audio();
|
||||
$(this).dialog("destroy");
|
||||
}
|
||||
})
|
||||
.show();
|
||||
}
|
||||
|
||||
function test_sound_button(test_sound, urlSound) {
|
||||
|
|
|
@ -194,6 +194,8 @@ class Item extends CachedModel
|
|||
*/
|
||||
protected function decode(array $data): array
|
||||
{
|
||||
global $config;
|
||||
|
||||
$decodedData = [
|
||||
'id' => (int) $data['id'],
|
||||
'colorStatus' => (string) COL_UNKNOWN,
|
||||
|
@ -209,9 +211,12 @@ class Item extends CachedModel
|
|||
'x' => static::extractX($data),
|
||||
'y' => static::extractY($data),
|
||||
'cacheExpiration' => static::extractCacheExpiration($data),
|
||||
'alertOutline' => static::checkLayoutAlertsRecursive($data),
|
||||
];
|
||||
|
||||
if ((bool) $config['display_item_frame'] === true) {
|
||||
$decodedData['alertOutline'] = static::checkLayoutAlertsRecursive($data);
|
||||
}
|
||||
|
||||
if (static::$useLinkedModule === true) {
|
||||
$decodedData = array_merge(
|
||||
$decodedData,
|
||||
|
|
|
@ -6584,6 +6584,17 @@ table.table_modal_alternate tr td:first-child {
|
|||
line-height: 1.3;
|
||||
}
|
||||
|
||||
table#agent_interface_info .flot-text .flot-x-axis div {
|
||||
word-break: unset;
|
||||
}
|
||||
|
||||
table#agent_interface_info
|
||||
.flot-text
|
||||
.flot-x-axis
|
||||
div.flot-tick-label.tickLabel {
|
||||
max-width: 50px !important;
|
||||
}
|
||||
|
||||
/*Font header feedback*/
|
||||
form#modal_form_feedback {
|
||||
padding: 10px;
|
||||
|
@ -9148,6 +9159,10 @@ div.steps_vsmap {
|
|||
top: 0px;
|
||||
}
|
||||
|
||||
.top_0px_important {
|
||||
top: 0px !important;
|
||||
}
|
||||
|
||||
.top_10px {
|
||||
top: 10px;
|
||||
}
|
||||
|
@ -11940,3 +11955,11 @@ div.parent_graph > p.legend_background > table > tbody > tr {
|
|||
.break-word {
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.legend-font-small {
|
||||
font-size: 7px !important;
|
||||
}
|
||||
|
||||
.toggle-traffic-graph {
|
||||
margin: 0px !important;
|
||||
}
|
||||
|
|
|
@ -231,10 +231,6 @@ div.container-button-play > button#button-start-search {
|
|||
border: 0;
|
||||
}
|
||||
|
||||
button#button-start-search:hover {
|
||||
background-position: 82px 14px !important;
|
||||
}
|
||||
|
||||
.actions-sound-modal .buttons-sound-modal button.alerts,
|
||||
.actions-sound-modal .buttons-sound-modal input[type="button"].alerts {
|
||||
width: 154px;
|
||||
|
|
|
@ -131,7 +131,7 @@
|
|||
<div style='padding-bottom: 50px'>
|
||||
<?php
|
||||
$version = '7.0NG.770';
|
||||
$build = '230420';
|
||||
$build = '230428';
|
||||
$banner = "v$version Build $build";
|
||||
error_reporting(0);
|
||||
|
||||
|
|
|
@ -13338,7 +13338,7 @@ $.widget( "mobile.textinput", {
|
|||
},
|
||||
|
||||
_handleBlur: function() {
|
||||
this._removeClass( this._outer, null, "ui-focus" );
|
||||
// this._removeClass( this._outer, null, "ui-focus" );
|
||||
if ( this.options.preventFocusZoom ) {
|
||||
$.mobile.zoom.enable( true );
|
||||
}
|
||||
|
@ -13351,7 +13351,7 @@ $.widget( "mobile.textinput", {
|
|||
if ( this.options.preventFocusZoom ) {
|
||||
$.mobile.zoom.disable( true );
|
||||
}
|
||||
this._addClass( this._outer, null, "ui-focus" );
|
||||
// this._addClass( this._outer, null, "ui-focus" );
|
||||
},
|
||||
|
||||
_setOptions: function( options ) {
|
||||
|
@ -15410,10 +15410,10 @@ var selectmenu = $.widget( "mobile.selectmenu", [ {
|
|||
that.button.addClass( "ui-button-active" );
|
||||
} )
|
||||
.bind( "focus", function() {
|
||||
that.button.addClass( "ui-focus" );
|
||||
// that.button.addClass( "ui-focus" );
|
||||
} )
|
||||
.bind( "blur", function() {
|
||||
that.button.removeClass( "ui-focus" );
|
||||
// that.button.removeClass( "ui-focus" );
|
||||
} )
|
||||
.bind( "focus vmouseover", function() {
|
||||
that.button.trigger( "vmouseover" );
|
||||
|
|
|
@ -918,27 +918,8 @@ html .ui-body-a .ui-accordion-content {
|
|||
html .ui-bar-a a,
|
||||
html .ui-body-a a,
|
||||
html body .ui-group-theme-a a {
|
||||
color: #38c;
|
||||
font-weight: 700;
|
||||
}
|
||||
.ui-page-theme-a a:visited,
|
||||
html .ui-bar-a a:visited,
|
||||
html .ui-body-a a:visited,
|
||||
html body .ui-group-theme-a a:visited {
|
||||
color: #38c;
|
||||
}
|
||||
.ui-page-theme-a a:hover,
|
||||
html .ui-bar-a a:hover,
|
||||
html .ui-body-a a:hover,
|
||||
html body .ui-group-theme-a a:hover {
|
||||
color: #059;
|
||||
}
|
||||
.ui-page-theme-a a:active,
|
||||
html .ui-bar-a a:active,
|
||||
html .ui-body-a a:active,
|
||||
html body .ui-group-theme-a a:active {
|
||||
color: #059;
|
||||
}
|
||||
.ui-page-theme-a .ui-button,
|
||||
html .ui-bar-a .ui-button,
|
||||
html .ui-body-a .ui-button,
|
||||
|
@ -1015,25 +996,7 @@ html body div.ui-slider-track.ui-body-a .ui-button-active,
|
|||
.ui-page-theme-a .ui-accordion-header.ui-state-active,
|
||||
html .ui-body-a .ui-accordion-header-active,
|
||||
html .ui-body-a .ui-accordion-header.ui-state-active {
|
||||
background-color: #38c;
|
||||
border-color: #38c;
|
||||
color: #fff;
|
||||
text-shadow: 0 1px 0 #059;
|
||||
}
|
||||
.ui-page-theme-a .ui-button:focus,
|
||||
html .ui-bar-a .ui-button:focus,
|
||||
html .ui-body-a .ui-button:focus,
|
||||
html body .ui-group-theme-a .ui-button:focus,
|
||||
html head + body .ui-button.ui-button-a:focus,
|
||||
.ui-page-theme-a .ui-focus,
|
||||
html .ui-bar-a .ui-focus,
|
||||
html .ui-body-a .ui-focus,
|
||||
html body .ui-group-theme-a .ui-focus,
|
||||
html head + body .ui-button-a.ui-focus,
|
||||
html head + body .ui-body-a.ui-focus {
|
||||
-webkit-box-shadow: 0 0 12px #38c;
|
||||
-moz-box-shadow: 0 0 12px #38c;
|
||||
box-shadow: 0 0 12px #38c;
|
||||
}
|
||||
.ui-bar-b,
|
||||
.ui-page-theme-b .ui-bar-inherit,
|
||||
|
@ -1078,27 +1041,8 @@ html .ui-body-b .ui-accordion-content {
|
|||
html .ui-bar-b a,
|
||||
html .ui-body-b a,
|
||||
html body .ui-group-theme-b a {
|
||||
color: #2ad;
|
||||
font-weight: 700;
|
||||
}
|
||||
.ui-page-theme-b a:visited,
|
||||
html .ui-bar-b a:visited,
|
||||
html .ui-body-b a:visited,
|
||||
html body .ui-group-theme-b a:visited {
|
||||
color: #2ad;
|
||||
}
|
||||
.ui-page-theme-b a:hover,
|
||||
html .ui-bar-b a:hover,
|
||||
html .ui-body-b a:hover,
|
||||
html body .ui-group-theme-b a:hover {
|
||||
color: #08b;
|
||||
}
|
||||
.ui-page-theme-b a:active,
|
||||
html .ui-bar-b a:active,
|
||||
html .ui-body-b a:active,
|
||||
html body .ui-group-theme-b a:active {
|
||||
color: #08b;
|
||||
}
|
||||
.ui-page-theme-b .ui-button,
|
||||
html .ui-bar-b .ui-button,
|
||||
html .ui-body-b .ui-button,
|
||||
|
@ -1175,25 +1119,7 @@ html body div.ui-slider-track.ui-body-b .ui-button-active,
|
|||
.ui-page-theme-b .ui-accordion-header.ui-state-active,
|
||||
html .ui-body-b .ui-accordion-header-active,
|
||||
html .ui-body-b .ui-accordion-header.ui-state-active {
|
||||
background-color: #2ad;
|
||||
border-color: #2ad;
|
||||
color: #fff;
|
||||
text-shadow: 0 1px 0 #08b;
|
||||
}
|
||||
.ui-page-theme-b .ui-button:focus,
|
||||
html .ui-bar-b .ui-button:focus,
|
||||
html .ui-body-b .ui-button:focus,
|
||||
html body .ui-group-theme-b .ui-button:focus,
|
||||
html head + body .ui-button.ui-button-b:focus,
|
||||
.ui-page-theme-b .ui-focus,
|
||||
html .ui-bar-b .ui-focus,
|
||||
html .ui-body-b .ui-focus,
|
||||
html body .ui-group-theme-b .ui-focus,
|
||||
html head + body .ui-button-b.ui-focus,
|
||||
html head + body .ui-body-b.ui-focus {
|
||||
-webkit-box-shadow: 0 0 12px #2ad;
|
||||
-moz-box-shadow: 0 0 12px #2ad;
|
||||
box-shadow: 0 0 12px #2ad;
|
||||
}
|
||||
.ui-disabled,
|
||||
.ui-state-disabled,
|
||||
|
@ -2770,7 +2696,7 @@ li.ui-block-e {
|
|||
width: 100%;
|
||||
float: none;
|
||||
}
|
||||
@media (max-width: 35em) {
|
||||
@media (max-width: 480px) {
|
||||
.ui-responsive > .ui-block-a,
|
||||
.ui-responsive > .ui-block-b,
|
||||
.ui-responsive > .ui-block-c,
|
||||
|
@ -4461,7 +4387,7 @@ html .ui-popup .ui-field-contain > label + .ui-flipswitch {
|
|||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 35em), print {
|
||||
@media screen and (min-width: 480px), print {
|
||||
.ui-table-reflow.ui-responsive td,
|
||||
.ui-table-reflow.ui-responsive th,
|
||||
.ui-table-reflow.ui-responsive tbody th,
|
||||
|
@ -4475,7 +4401,7 @@ html .ui-popup .ui-field-contain > label + .ui-flipswitch {
|
|||
display: none;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 35em) {
|
||||
@media screen and (max-width: 480px) {
|
||||
.ui-table-reflow.ui-responsive td,
|
||||
.ui-table-reflow.ui-responsive th {
|
||||
width: 100%;
|
||||
|
|
|
@ -151,10 +151,35 @@ class System
|
|||
}
|
||||
|
||||
|
||||
public function checkEnterprise($page='')
|
||||
{
|
||||
if ((int) $this->getConfig('enterprise_installed', false) === 1) {
|
||||
return true;
|
||||
} else {
|
||||
if (empty($this->getRequest('page', false)) === false && $page === '') {
|
||||
$page = $this->getRequest('page', false);
|
||||
}
|
||||
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ENTERPRISE_VIOLATION,
|
||||
'Trying to access to Mobile Page: '.$page
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static function getDefaultACLFailText()
|
||||
{
|
||||
return __('Access to this page is restricted to authorized users only, please contact your system administrator if you should need help.').'<br><br>'.__('Please remember that any attempts to access this page will be recorded on the %s System Database.', get_product_name());
|
||||
}
|
||||
|
||||
|
||||
public static function getDefaultLicenseFailText()
|
||||
{
|
||||
return __('Invalid license, please contact your system administrator if you should need help.').'<br><br>'.__('Please remember that any attempts to access this page will be recorded on the %s System Database.', get_product_name());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -220,11 +220,11 @@ class Ui
|
|||
if ($left_button === false) {
|
||||
$left_button = $this->createHeaderButton(
|
||||
[
|
||||
'icon' => 'ui-icon-back',
|
||||
'icon' => 'ui-icon-logout',
|
||||
'pos' => 'left',
|
||||
'text' => __('Logout'),
|
||||
'href' => 'index.php?action=logout',
|
||||
'class' => 'header-button-left',
|
||||
'class' => 'header-button-left logout-text',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -413,12 +413,13 @@ class Ui
|
|||
}
|
||||
|
||||
|
||||
public function contentBeginCollapsible($title=' ')
|
||||
public function contentBeginCollapsible($title=' ', $class='')
|
||||
{
|
||||
$this->endCollapsible = false;
|
||||
$this->collapsible = [];
|
||||
$this->collapsible['items'] = [];
|
||||
$this->collapsible['title'] = $title;
|
||||
$this->collapsible['class'] = $class;
|
||||
}
|
||||
|
||||
|
||||
|
@ -432,7 +433,7 @@ class Ui
|
|||
{
|
||||
$this->endCollapsible = true;
|
||||
|
||||
$html = "<div data-role='collapsible' "." data-collapsed-icon='arrow-d' "." data-expanded-icon='arrow-u' data-mini='true' "." data-theme='a' data-content-theme='c'>\n";
|
||||
$html = "<div class='".$this->collapsible['class']."' data-role='collapsible' "." data-collapsed-icon='arrow-d' "." data-expanded-icon='arrow-u' data-mini='true' "." data-theme='a' data-content-theme='c'>\n";
|
||||
$html .= '<h4>'.$this->collapsible['title']."</h4>\n";
|
||||
|
||||
$html .= "<ul data-role='listview' data-theme='c'>\n";
|
||||
|
@ -511,9 +512,14 @@ class Ui
|
|||
$html .= "<label for='".$options['id']."'>".$options['label']."</label>\n";
|
||||
}
|
||||
|
||||
// Erase other options and only for the input
|
||||
// Erase other options and only for the input.
|
||||
unset($options['label']);
|
||||
|
||||
if ($options['type'] === 'password') {
|
||||
$html .= '<div class="relative container-div-input-password">';
|
||||
$options['style'] .= 'background-image: url("'.ui_get_full_url('/').'/images/enable.svg");';
|
||||
}
|
||||
|
||||
$html .= '<input ';
|
||||
foreach ($options as $option => $value) {
|
||||
$html .= ' '.$option."='".$value."' ";
|
||||
|
@ -521,6 +527,26 @@ class Ui
|
|||
|
||||
$html .= ">\n";
|
||||
|
||||
if ($options['type'] === 'password') {
|
||||
$html .= '<div class="show-hide-pass" onclick="show_hide_password(event, \''.ui_get_full_url('/').'\')"></div>';
|
||||
$html .= '</div>';
|
||||
$html .= '
|
||||
<script>
|
||||
function show_hide_password(e, url) {
|
||||
let inputPass = e.target.previousElementSibling.firstChild;
|
||||
console.log(inputPass);
|
||||
|
||||
if (inputPass.type === "password") {
|
||||
inputPass.type = "text";
|
||||
inputPass.style.backgroundImage = "url(" + url + "/images/disable.svg)";
|
||||
} else {
|
||||
inputPass.type = "password";
|
||||
inputPass.style.backgroundImage = "url(" + url + "/images/enable.svg)";
|
||||
}
|
||||
}
|
||||
</script>';
|
||||
}
|
||||
|
||||
$html .= "</fieldset>\n";
|
||||
$html .= "</div>\n";
|
||||
|
||||
|
@ -757,6 +783,10 @@ class Ui
|
|||
$dialogHtml .= "</div>\n";
|
||||
$dialogHtml .= "</div>\n";
|
||||
|
||||
if ($options['return_html_dialog'] === true) {
|
||||
return $dialogHtml;
|
||||
}
|
||||
|
||||
$this->dialogs[$type][] = $dialogHtml;
|
||||
}
|
||||
|
||||
|
|
|
@ -366,6 +366,60 @@ class User
|
|||
$ui->showFooter(false);
|
||||
$ui->beginContent();
|
||||
|
||||
$ui->contentAddHtml(
|
||||
'
|
||||
<style>
|
||||
div.ui-content {
|
||||
animation: container_login 2s ease;
|
||||
}
|
||||
|
||||
@keyframes container_login {
|
||||
0% {
|
||||
transform: scale(.93);
|
||||
opacity: 0.1;
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: scale(1);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.ui-page-active {
|
||||
padding-top: 0px !important;
|
||||
}
|
||||
|
||||
.ui-page-theme-a {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.ui-mobile {
|
||||
height: 100% !important;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$(".ui-header.ui-bar-inherit.ui-header-fixed.slidedown").remove();
|
||||
$("div#main_page").css({
|
||||
"display": "flex",
|
||||
"flex-direction": "column",
|
||||
"justify-content": "center"
|
||||
});
|
||||
$(".ui-overlay-a").addClass("login-background");
|
||||
$(".ui-overlay-a").removeClass("ui-overlay-a");
|
||||
$(".ui-page-theme-a").css({"background-color":"transparent !important"});
|
||||
|
||||
$("#text-login_btn").click(function (e) {
|
||||
$("#user-container").hide();
|
||||
$("#password-container").hide();
|
||||
$("#text-login_btn").hide();
|
||||
$("#spinner-login").show();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
'
|
||||
);
|
||||
|
||||
$logo_image = html_print_image(
|
||||
ui_get_mobile_login_icon(),
|
||||
true,
|
||||
|
@ -389,17 +443,29 @@ class User
|
|||
'name' => 'user',
|
||||
'value' => $this->user,
|
||||
'placeholder' => __('user'),
|
||||
'label' => __('User'),
|
||||
// 'autofocus' => 'autofocus',
|
||||
// 'label' => __('User'),
|
||||
];
|
||||
$ui->formAddInputText($options);
|
||||
$options = [
|
||||
'name' => 'password',
|
||||
'value' => '',
|
||||
'placeholder' => __('password'),
|
||||
'label' => __('Password'),
|
||||
// 'label' => __('Password'),
|
||||
'required' => 'required',
|
||||
];
|
||||
$ui->formAddInputPassword($options);
|
||||
|
||||
$spinner = '
|
||||
<div class="spinner invisible" id="spinner-login">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</div>
|
||||
';
|
||||
$ui->formAddHtml($spinner);
|
||||
|
||||
$options = [
|
||||
'value' => __('Login'),
|
||||
'icon' => 'arrow-r',
|
||||
|
@ -431,6 +497,7 @@ class User
|
|||
}
|
||||
|
||||
$ui->contentAddHtml('</div>');
|
||||
$ui->contentAddHtml('<div class="center" id="ver_num">'.$pandora_version.'</div>');
|
||||
$ui->endContent();
|
||||
$ui->showPage();
|
||||
|
||||
|
@ -465,43 +532,79 @@ class User
|
|||
$ui->createHeader('', $left_button);
|
||||
$ui->showFooter(false);
|
||||
$ui->beginContent();
|
||||
$ui->contentAddHtml(
|
||||
'<div class="login_logo center">'.html_print_image(
|
||||
ui_get_mobile_login_icon(),
|
||||
true,
|
||||
[
|
||||
'alt' => 'logo',
|
||||
'border' => 0,
|
||||
],
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true
|
||||
).'</div>'
|
||||
);
|
||||
$ui->contentAddHtml('<div id="login_container">');
|
||||
$ui->beginForm();
|
||||
$ui->formAddHtml(html_print_input_hidden('action', 'double_auth', true));
|
||||
$options = [
|
||||
'name' => 'auth_code',
|
||||
'value' => '',
|
||||
'placeholder' => __('Authenticator code'),
|
||||
'label' => __('Authenticator code'),
|
||||
];
|
||||
$ui->formAddInputPassword($options);
|
||||
$options = [
|
||||
'value' => __('Check code'),
|
||||
'icon' => 'arrow-r',
|
||||
'icon_pos' => 'right',
|
||||
'name' => 'auth_code_btn',
|
||||
];
|
||||
$ui->formAddSubmitButton($options);
|
||||
$ui->endForm();
|
||||
$ui->contentAddHtml('</div>');
|
||||
$ui->endContent();
|
||||
$ui->showPage();
|
||||
|
||||
$this->errorDoubleAuth = false;
|
||||
$ui->contentAddHtml(
|
||||
'
|
||||
<style>
|
||||
.ui-page-active {
|
||||
padding-top: 0px !important;
|
||||
}
|
||||
|
||||
.ui-page-theme-a {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.ui-mobile {
|
||||
height: 100% !important;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
// $(".ui-header.ui-bar-inherit.ui-header-fixed.slidedown").remove();
|
||||
$(".ui-header.ui-bar-inherit.ui-header-fixed.slidedown").css({"background-color":"transparent"});
|
||||
$("div#main_page").css({
|
||||
"display": "flex",
|
||||
"flex-direction": "column",
|
||||
"justify-content": "center"
|
||||
});
|
||||
$(".ui-overlay-a").addClass("login-background");
|
||||
$(".ui-overlay-a").removeClass("ui-overlay-a");
|
||||
$(".ui-page-theme-a").css({"background-color":"transparent !important"});
|
||||
$("div.ui-page.ui-page-theme-a.ui-page-active#main_page").css({"background-color":"transparent !important"});
|
||||
});
|
||||
</script>
|
||||
'
|
||||
);
|
||||
|
||||
$ui->contentAddHtml(
|
||||
'<div class="login_logo center">'.html_print_image(
|
||||
ui_get_mobile_login_icon(),
|
||||
true,
|
||||
[
|
||||
'alt' => 'logo',
|
||||
'border' => 0,
|
||||
],
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true
|
||||
).'</div>'
|
||||
);
|
||||
$ui->contentAddHtml('<div id="login_container">');
|
||||
$ui->beginForm();
|
||||
$ui->formAddHtml(html_print_input_hidden('action', 'double_auth', true));
|
||||
$options = [
|
||||
'name' => 'auth_code',
|
||||
'value' => '',
|
||||
'placeholder' => __('Authenticator code'),
|
||||
'autofocus' => 'autofocus',
|
||||
// 'label' => __('Authenticator code'),
|
||||
];
|
||||
$ui->formAddInputPassword($options);
|
||||
$options = [
|
||||
'value' => __('Check code'),
|
||||
'icon' => 'arrow-r',
|
||||
'icon_pos' => 'right',
|
||||
'name' => 'auth_code_btn',
|
||||
];
|
||||
$ui->formAddSubmitButton($options);
|
||||
$ui->endForm();
|
||||
$ui->contentAddHtml('</div>');
|
||||
$ui->contentAddHtml('<div class="center" id="ver_num">'.$pandora_version.'</div>');
|
||||
$ui->endContent();
|
||||
$ui->showPage();
|
||||
|
||||
$this->errorDoubleAuth = false;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -43,6 +43,9 @@ require_once 'operation/module_graph.php';
|
|||
require_once 'operation/agent.php';
|
||||
require_once 'operation/visualmaps.php';
|
||||
require_once 'operation/visualmap.php';
|
||||
require_once 'operation/server_status.php';
|
||||
require_once 'operation/services.php';
|
||||
require_once 'operation/module_data.php';
|
||||
$enterpriseHook = enterprise_include('mobile/include/enterprise.class.php');
|
||||
$enterpriseHook = enterprise_include('mobile/operation/home.php');
|
||||
|
||||
|
@ -177,6 +180,21 @@ switch ($action) {
|
|||
$tactical->ajax($parameter2);
|
||||
break;
|
||||
|
||||
case 'server_status':
|
||||
$server_status = new ServerStatus();
|
||||
$server_status->ajax($parameter2);
|
||||
break;
|
||||
|
||||
case 'services':
|
||||
$services = new Services();
|
||||
$services->ajax($parameter2);
|
||||
break;
|
||||
|
||||
case 'module_data':
|
||||
$module_data = new ModuleData();
|
||||
$module_data->ajax($parameter2);
|
||||
break;
|
||||
|
||||
default:
|
||||
if (class_exists('Enterprise')) {
|
||||
$enterprise->enterpriseAjax($parameter1, $parameter2);
|
||||
|
@ -407,6 +425,21 @@ switch ($action) {
|
|||
$vc = new Visualmap();
|
||||
$vc->show();
|
||||
break;
|
||||
|
||||
case 'server_status':
|
||||
$server_status = new ServerStatus();
|
||||
$server_status->show();
|
||||
break;
|
||||
|
||||
case 'services':
|
||||
$services = new Services();
|
||||
$services->show();
|
||||
break;
|
||||
|
||||
case 'module_data':
|
||||
$module_data = new ModuleData();
|
||||
$module_data->show();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
* ============================================================================
|
||||
*/
|
||||
|
||||
use PandoraFMS\Event;
|
||||
|
||||
// Begin.
|
||||
require_once '../include/functions_users.php';
|
||||
|
||||
|
@ -130,9 +132,13 @@ class Agent
|
|||
{
|
||||
$ui = Ui::getInstance();
|
||||
$system = System::getInstance();
|
||||
$eventObj = new Events;
|
||||
|
||||
$ui->createPage();
|
||||
|
||||
$options = $eventObj->getEventDialogOptions();
|
||||
$ui->addDialog($options);
|
||||
|
||||
if ($this->id != 0) {
|
||||
$agent_alias = (string) $this->agent['alias'];
|
||||
|
||||
|
@ -159,7 +165,7 @@ class Agent
|
|||
$ui->beginContent();
|
||||
if (empty($this->agent)) {
|
||||
$ui->contentAddHtml(
|
||||
'<span class="red">'.__('No agent found').'</span>'
|
||||
'<span class="no-data">'.__('No agent found').'</span>'
|
||||
);
|
||||
} else {
|
||||
$ui->contentBeginGrid();
|
||||
|
@ -191,10 +197,7 @@ class Agent
|
|||
$address = $this->agent['direccion'];
|
||||
$ip .= (empty($address) === true) ? '<em>'.__('N/A').'</em>' : $address;
|
||||
$last_contact = '<b>'.__('Last contact').'</b>: ';
|
||||
$last_contact .= ui_print_timestamp(
|
||||
$this->agent['ultimo_contacto'],
|
||||
true
|
||||
);
|
||||
$last_contact .= human_time_comparation($this->agent['ultimo_contacto'], 'tiny');
|
||||
|
||||
if (empty($agent['comentarios']) === true) {
|
||||
$description .= '<i>'.__('N/A').'</i>';
|
||||
|
@ -213,7 +216,7 @@ class Agent
|
|||
false,
|
||||
false,
|
||||
false,
|
||||
['class' => 'invert_filter os-big-icon'],
|
||||
['class' => 'invert_filter main_menu_icon'],
|
||||
false
|
||||
).'</div>';
|
||||
$html .= '<div class="agent_list_ips">';
|
||||
|
@ -366,7 +369,7 @@ class Agent
|
|||
$ui->contentAddHtml("<a id='detail_event_dialog_hook' href='#detail_event_dialog' class='invisible'>detail_event_hook</a>");
|
||||
$ui->contentAddHtml("<a id='detail_event_dialog_error_hook' href='#detail_event_dialog_error' class='invisible'>detail_event_dialog_error_hook</a>");
|
||||
|
||||
$ui->contentBeginCollapsible(sprintf(__('Last %s Events'), $system->getPageSize()));
|
||||
$ui->contentBeginCollapsible(sprintf(__('Last %s Events'), $system->getPageSize()), 'agent-last-events');
|
||||
$tabledata = $events->listEventsHtml(0, true, 'last_agent_events');
|
||||
$ui->contentCollapsibleAddItem($tabledata['table']);
|
||||
$ui->contentCollapsibleAddItem($events->putEventsTableJS($this->id));
|
||||
|
@ -438,7 +441,7 @@ class Agent
|
|||
$.mobile.loading('hide');
|
||||
var className = $('#list_agent_Modules').attr('class');
|
||||
if (document.getElementById('list_agent_Modules') == null) {
|
||||
$($('p.empty_advice')[0]).parent().html(r);
|
||||
$($('p.no-data')[0]).parent().html(r);
|
||||
className = 'ui-responsive table-stroke ui-table ui-table-reflow';
|
||||
} else {
|
||||
$('#list_agent_Modules').parent().html(r);
|
||||
|
|
|
@ -97,6 +97,7 @@ class Agents
|
|||
$agent[6] = '<b class="ui-table-cell-label">'.__('Status').'</b>'.$agent[6];
|
||||
$agent[7] = '<b class="ui-table-cell-label">'.__('Alerts').'</b>'.$agent[7];
|
||||
$agent[8] = '<b class="ui-table-cell-label">'.__('Last contact').'</b>'.$agent[8];
|
||||
$agent[9] = '<b class="ui-table-cell-label">'.__('Last status change').'</b>'.$agent[9];
|
||||
|
||||
$agents[$key] = $agent;
|
||||
}
|
||||
|
@ -218,7 +219,7 @@ class Agents
|
|||
__('Filter Agents by %s'),
|
||||
$this->filterEventsGetString()
|
||||
);
|
||||
$ui->contentBeginCollapsible($filter_title);
|
||||
$ui->contentBeginCollapsible($filter_title, 'filter-collapsible');
|
||||
$ui->beginForm('index.php?page=agents');
|
||||
$system = System::getInstance();
|
||||
$groups = users_get_groups_for_select(
|
||||
|
@ -400,18 +401,18 @@ class Agents
|
|||
|
||||
$serialized_filters_q_param = empty($this->serializedFilters) ? '' : '&agents_filter='.$this->serializedFilters;
|
||||
|
||||
$row[0] = $row[__('Agent')] = '<span class="tiny mrgn_right_5px">'.$img_status.'</span>'.'<a class="ui-link" data-ajax="false" href="index.php?page=agent&id='.$agent['id_agente'].$serialized_filters_q_param.'">'.ui_print_truncate_text($agent['alias'], 30, false).'</a>';
|
||||
$row[0] = $row[__('Agent')] = '<span class="tiny agent-status">'.$img_status.'</span>'.'<a class="ui-link" data-ajax="false" href="index.php?page=agent&id='.$agent['id_agente'].$serialized_filters_q_param.'">'.ui_print_truncate_text($agent['alias'], 30, false).'</a>';
|
||||
$row[2] = $row[__('OS')] = ui_print_os_icon($agent['id_os'], false, true);
|
||||
$row[3] = $row[__('Group')] = ui_print_group_icon($agent['id_grupo'], true, 'groups_small', '', false);
|
||||
$row[5] = $row[__('Status')] = '<span class="show_collapside align-none-10p">'.__('S.').' </span>'.$img_status;
|
||||
$row[6] = $row[__('Alerts')] = '<span class="show_collapside align-none-10p"> '.__('A.').' </span>'.$img_alert;
|
||||
|
||||
$row[7] = $row[__('Modules')] = '<span class="show_collapside align-none-0p">'.__('Modules').' </span>'.'<span class="agents_tiny_stats">'.reporting_tiny_stats($agent, true, 'agent', ' ').' </span>';
|
||||
$row[7] = $row[__('Modules')] = '<span class="agents_tiny_stats">'.reporting_tiny_stats($agent, true, 'agent', ':').' </span>';
|
||||
|
||||
$last_time = time_w_fixed_tz($agent['ultimo_contacto']);
|
||||
$now = get_system_time();
|
||||
$diferencia = ($now - $last_time);
|
||||
$time = ui_print_timestamp($last_time, true, ['style' => 'font-size: 12px; margin-left: 20px;', 'units' => 'tiny']);
|
||||
$time = human_time_comparation($agent['ultimo_contacto'], 'tiny');
|
||||
$style = '';
|
||||
if ($diferencia > ($agent['intervalo'] * 2)) {
|
||||
$row[8] = $row[__('Last contact')] = '<b><span class="color_ff0">'.$time.'</span></b>';
|
||||
|
@ -419,7 +420,10 @@ class Agents
|
|||
$row[8] = $row[__('Last contact')] = $time;
|
||||
}
|
||||
|
||||
$row[8] = $row[__('Last contact')] = '<span class="show_collapside align-none-0p">'.__('Last contact').' </span>'.'<span class="agents_last_contact">'.$row[__('Last contact')].'</span>';
|
||||
$row[8] = $row[__('Last contact')] = '<span class="agents_last_contact">'.$row[__('Last contact')].'</span>';
|
||||
|
||||
$last_status_change = human_time_comparation(agents_get_last_status_change($agent['id_agente']), 'tiny');
|
||||
$row[9] = $row[__('Last status change')] = '<span class="agents_last_contact">'.$last_status_change.'</span>';
|
||||
|
||||
if (!$ajax) {
|
||||
unset($row[0]);
|
||||
|
@ -431,6 +435,7 @@ class Agents
|
|||
unset($row[6]);
|
||||
unset($row[7]);
|
||||
unset($row[8]);
|
||||
unset($row[9]);
|
||||
}
|
||||
|
||||
$agents[$agent['id_agente']] = $row;
|
||||
|
@ -451,20 +456,25 @@ class Agents
|
|||
$listAgents = $this->getListAgents($page);
|
||||
|
||||
if ($listAgents['total'] == 0) {
|
||||
$ui->contentAddHtml('<p class="color_ff0">'.__('No agents').'</p>');
|
||||
$ui->contentAddHtml('<p class="no-data">'.__('No agents').'</p>');
|
||||
} else {
|
||||
$table = new Table();
|
||||
$table->id = 'list_agents';
|
||||
$table->importFromHash($listAgents['agents']);
|
||||
|
||||
$ui->contentAddHtml('<div class="hr-full"></div>');
|
||||
$ui->contentAddHtml('<div class="white-card p-lr-0px">');
|
||||
$ui->contentAddHtml($table->getHTML());
|
||||
|
||||
if ($system->getPageSize() < $listAgents['total']) {
|
||||
$ui->contentAddHtml(
|
||||
'<div id="loading_rows">'.html_print_image('images/spinner.gif', true, false, false, false, false, true).' '.__('Loading...').'</div>'
|
||||
'<br><div id="loading_rows">'.html_print_image('images/spinner.gif', true, false, false, false, false, true).' '.__('Loading...').'</div>'
|
||||
);
|
||||
|
||||
$this->addJavascriptAddBottom();
|
||||
}
|
||||
|
||||
$ui->contentAddHtml('</div>');
|
||||
}
|
||||
|
||||
$ui->contentAddLinkListener('list_agents');
|
||||
|
@ -513,6 +523,7 @@ class Agents
|
|||
\"<td class='cell_4'>\" + agent[6] + \"</td>\" +
|
||||
\"<td class='cell_5'>\" + agent[7] + \"</td>\" +
|
||||
\"<td class='cell_6'>\" + agent[8] + \"</td>\" +
|
||||
\"<td class='cell_7'>\" + agent[9] + \"</td>\" +
|
||||
\"</tr>\");
|
||||
});
|
||||
|
||||
|
@ -522,7 +533,7 @@ class Agents
|
|||
},
|
||||
\"json\");
|
||||
// Clean
|
||||
$('#loading_rows').remove();
|
||||
// $('#loading_rows').remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -208,7 +208,7 @@ class Alerts
|
|||
__('Filter Alerts by %s'),
|
||||
$this->filterAlertsGetString()
|
||||
);
|
||||
$ui->contentBeginCollapsible($filter_title);
|
||||
$ui->contentBeginCollapsible($filter_title, 'filter-collapsible');
|
||||
$ui->beginForm();
|
||||
$options = [
|
||||
'name' => 'page',
|
||||
|
@ -331,30 +331,36 @@ class Alerts
|
|||
}
|
||||
|
||||
$row = [];
|
||||
if (isset($this->columns['agent']) && $this->columns['agent']) {
|
||||
$row[__('Agent')] = sprintf($disabled_style, io_safe_output($alert['agent_alias']));
|
||||
}
|
||||
$row[__('Status')] = ui_print_status_image($status, $title, true);
|
||||
|
||||
$row[__('Module')] = sprintf(
|
||||
$row[__('Module/Agent')] = '<div class="flex flex-column"><span>';
|
||||
$row[__('Module/Agent')] .= sprintf(
|
||||
$disabled_style,
|
||||
io_safe_output($alert['module_name'])
|
||||
);
|
||||
|
||||
$row[__('Module/Agent')] .= '</span><span class="muted">';
|
||||
if (isset($this->columns['agent']) && $this->columns['agent']) {
|
||||
$row[__('Module/Agent')] .= sprintf($disabled_style, io_safe_output($alert['agent_alias']));
|
||||
}
|
||||
|
||||
$row[__('Module/Agent')] .= '</span></div>';
|
||||
|
||||
$row[__('Template')] = sprintf(
|
||||
$disabled_style,
|
||||
io_safe_output($alert['template_name'])
|
||||
);
|
||||
$row[__('Last Fired')] = sprintf(
|
||||
$disabled_style,
|
||||
ui_print_timestamp($alert['last_fired'], true)
|
||||
human_time_comparation($alert['last_fired'], 'tiny')
|
||||
);
|
||||
$row[__('Status')] = ui_print_status_image($status, $title, true);
|
||||
|
||||
$table[] = $row;
|
||||
}
|
||||
|
||||
$ui = UI::getInstance();
|
||||
if (empty($table)) {
|
||||
$html = '<p class="empty_advice">'.__('No alerts').'</p>';
|
||||
$html = '<p class="no-data">'.__('No alerts').'</p>';
|
||||
if (!$return) {
|
||||
$ui->contentAddHtml($html);
|
||||
} else {
|
||||
|
@ -365,7 +371,10 @@ class Alerts
|
|||
$tableHTML->id = 'list_alerts';
|
||||
$tableHTML->importFromHash($table);
|
||||
if (!$return) {
|
||||
$ui->contentAddHtml('<div class="hr-full"></div>');
|
||||
$ui->contentAddHtml('<div class="white-card p-lr-0px">');
|
||||
$ui->contentAddHtml($tableHTML->getHTML());
|
||||
$ui->contentAddHtml('</div>');
|
||||
} else {
|
||||
return $tableHTML->getHTML();
|
||||
}
|
||||
|
|
|
@ -195,15 +195,15 @@ class Events
|
|||
|
||||
switch ($event['estado']) {
|
||||
case 0:
|
||||
$img_st = 'images/star_white.png';
|
||||
$img_st = 'images/star-dark.svg';
|
||||
break;
|
||||
|
||||
case 1:
|
||||
$img_st = 'images/tick_white.png';
|
||||
$img_st = 'images/validate.svg';
|
||||
break;
|
||||
|
||||
case 2:
|
||||
$img_st = 'images/hourglass_white.png';
|
||||
$img_st = 'images/clock.svg';
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -221,7 +221,7 @@ class Events
|
|||
$status_icon = html_print_image(
|
||||
$img_st,
|
||||
true,
|
||||
false,
|
||||
['class' => 'main_menu_icon'],
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
|
@ -264,11 +264,7 @@ class Events
|
|||
|
||||
$row_1 = '<span class="events_agent">'.$agent_name.'</span>';
|
||||
$row_1 .= '<span class="events_timestamp">';
|
||||
$row_1 .= ui_print_timestamp(
|
||||
$event['timestamp_last'],
|
||||
true,
|
||||
['units' => 'tiny']
|
||||
);
|
||||
$row_1 .= human_time_comparation($event['timestamp_last'], 'tiny');
|
||||
$row_1 .= $status_icon;
|
||||
$row_1 .= '</span>';
|
||||
|
||||
|
@ -326,10 +322,7 @@ class Events
|
|||
$event['clean_tags'] = events_clean_tags(
|
||||
$event['tags']
|
||||
);
|
||||
$event['timestamp'] = date(
|
||||
$system->getConfig('date_format'),
|
||||
$event['utimestamp']
|
||||
);
|
||||
$event['timestamp'] = human_time_comparation($event['utimestamp'], 'tiny');
|
||||
if (empty($event['owner_user']) === true) {
|
||||
$event['owner_user'] = '<i>'.__('N/A').'</i>';
|
||||
} else {
|
||||
|
@ -380,30 +373,30 @@ class Events
|
|||
switch ($event['criticity']) {
|
||||
default:
|
||||
case 0:
|
||||
$img_sev = 'images/status_sets/default/severity_maintenance.png';
|
||||
$img_sev = 'images/status_sets/default/severity_maintenance_rounded.png';
|
||||
break;
|
||||
case 1:
|
||||
$img_sev = 'images/status_sets/default/severity_informational.png';
|
||||
$img_sev = 'images/status_sets/default/severity_informational_rounded.png';
|
||||
break;
|
||||
|
||||
case 2:
|
||||
$img_sev = 'images/status_sets/default/severity_normal.png';
|
||||
$img_sev = 'images/status_sets/default/severity_normal_rounded.png';
|
||||
break;
|
||||
|
||||
case 3:
|
||||
$img_sev = 'images/status_sets/default/severity_warning.png';
|
||||
$img_sev = 'images/status_sets/default/severity_warning_rounded.png';
|
||||
break;
|
||||
|
||||
case 4:
|
||||
$img_sev = 'images/status_sets/default/severity_critical.png';
|
||||
$img_sev = 'images/status_sets/default/severity_critical_rounded.png';
|
||||
break;
|
||||
|
||||
case 5:
|
||||
$img_sev = 'images/status_sets/default/severity_minor.png';
|
||||
$img_sev = 'images/status_sets/default/severity_minor_rounded.png';
|
||||
break;
|
||||
|
||||
case 6:
|
||||
$img_sev = 'images/status_sets/default/severity_major.png';
|
||||
$img_sev = 'images/status_sets/default/severity_major_rounded.png';
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -412,9 +405,8 @@ class Events
|
|||
$img_sev,
|
||||
true,
|
||||
[
|
||||
'class' => 'image_status',
|
||||
'width' => 12,
|
||||
'height' => 12,
|
||||
'width' => 30,
|
||||
'height' => 15,
|
||||
'title' => $event_criticity,
|
||||
],
|
||||
false,
|
||||
|
@ -446,17 +438,17 @@ class Events
|
|||
// Get Status.
|
||||
switch ($event['estado']) {
|
||||
case 0:
|
||||
$img_st = 'images/star_dark.png';
|
||||
$img_st = 'images/star-dark.svg';
|
||||
$title_st = __('New event');
|
||||
break;
|
||||
|
||||
case 1:
|
||||
$img_st = 'images/tick.png';
|
||||
$img_st = 'images/validate.svg';
|
||||
$title_st = __('Event validated');
|
||||
break;
|
||||
|
||||
case 2:
|
||||
$img_st = 'images/hourglass.png';
|
||||
$img_st = 'images/clock.svg';
|
||||
$title_st = __('Event in process');
|
||||
break;
|
||||
|
||||
|
@ -592,6 +584,43 @@ class Events
|
|||
}
|
||||
break;
|
||||
|
||||
case 'process_event':
|
||||
$system = System::getInstance();
|
||||
|
||||
$id_event = $system->getRequest('id_event', 0);
|
||||
$server_id = $system->getRequest('server_id', 0);
|
||||
|
||||
try {
|
||||
if (is_metaconsole() === true
|
||||
&& $server_id > 0
|
||||
) {
|
||||
$node = new Node($server_id);
|
||||
$node->connect();
|
||||
}
|
||||
|
||||
if (events_change_status($id_event, EVENT_PROCESS) === true) {
|
||||
echo json_encode(['correct' => 1]);
|
||||
} else {
|
||||
echo json_encode(['correct' => 0]);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
// Unexistent agent.
|
||||
if (is_metaconsole() === true
|
||||
&& $server_id > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
|
||||
echo json_encode(['correct' => 0]);
|
||||
} finally {
|
||||
if (is_metaconsole() === true
|
||||
&& $server_id > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// Not possible.
|
||||
break;
|
||||
|
@ -791,7 +820,7 @@ class Events
|
|||
// Content.
|
||||
ob_start();
|
||||
?>
|
||||
<table class="pandora_responsive alternate event_details">
|
||||
<table class="pandora_responsive event_details">
|
||||
<tbody>
|
||||
<tr class="event_name">
|
||||
<td class="cell_event_name" colspan="2"></td>
|
||||
|
@ -860,6 +889,14 @@ class Events
|
|||
'href' => 'javascript: validateEvent();',
|
||||
];
|
||||
$options['content_text'] .= $ui->createButton($options_button);
|
||||
|
||||
$options_button = [
|
||||
'text' => __('In process'),
|
||||
'id' => 'process_button',
|
||||
'href' => 'javascript: processEvent();',
|
||||
];
|
||||
$options['content_text'] .= $ui->createButton($options_button);
|
||||
|
||||
$options_hidden = [
|
||||
'id' => 'event_id',
|
||||
'value' => 0,
|
||||
|
@ -879,7 +916,14 @@ class Events
|
|||
$options['content_text'] .= '<div id="validate_button_fail" class="invisible center">
|
||||
<h3 class="color_ff0">'.__('Fail validate').'</h3></div>';
|
||||
|
||||
$options['button_close'] = false;
|
||||
$options['content_text'] .= '<div id="process_button_loading" class="invisible center">
|
||||
<img src="images/ajax-loader.gif" /></div>';
|
||||
$options['content_text'] .= '<div id="process_button_correct" class="invisible center">
|
||||
<h3>'.__('Sucessful in process').'</h3></div>';
|
||||
$options['content_text'] .= '<div id="process_button_fail" class="invisible center">
|
||||
<h3 class="color_ff0">'.__('Fail in process').'</h3></div>';
|
||||
|
||||
$options['button_close'] = true;
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
@ -922,7 +966,7 @@ class Events
|
|||
$ui->contentAddHtml("<a id='detail_event_dialog_error_hook' href='#detail_event_dialog_error' class='invisible'>detail_event_dialog_error_hook</a>");
|
||||
|
||||
$filter_title = sprintf(__('Filter Events by %s'), $this->filterEventsGetString());
|
||||
$ui->contentBeginCollapsible($filter_title);
|
||||
$ui->contentBeginCollapsible($filter_title, 'filter-collapsible');
|
||||
$ui->beginForm('index.php?page=events');
|
||||
$items = db_get_all_rows_in_table('tevent_filter');
|
||||
$items[] = [
|
||||
|
@ -1012,7 +1056,10 @@ class Events
|
|||
$html = $ui->getEndForm();
|
||||
$ui->contentCollapsibleAddItem($html);
|
||||
$ui->contentEndCollapsible();
|
||||
$ui->contentAddHtml('<div class="hr-full"></div>');
|
||||
$ui->contentAddHtml('<div class="white-card">');
|
||||
$this->listEventsHtml();
|
||||
$ui->contentAddHtml('</div>');
|
||||
$ui->endContent();
|
||||
$ui->showPage();
|
||||
}
|
||||
|
@ -1141,7 +1188,7 @@ class Events
|
|||
$table = new Table();
|
||||
$table->id = $id_table;
|
||||
|
||||
$no_events = '<p id="empty_advice_events" class="empty_advice invisible" class="invisible">'.__('No events').'</p>';
|
||||
$no_events = '<p id="empty_advice_events" class="no-data invisible" class="invisible">'.__('No events').'</p>';
|
||||
|
||||
if (!$return) {
|
||||
$ui->contentAddHtml($table->getHTML());
|
||||
|
@ -1206,12 +1253,10 @@ class Events
|
|||
data: postvars,
|
||||
success:
|
||||
function (data) {
|
||||
if (data.correct) {
|
||||
event = data.event;
|
||||
if (data.correct) {
|
||||
event = data.event;
|
||||
//Fill the dialog
|
||||
$("#detail_event_dialog h1.dialog_title")
|
||||
.html(event["evento"]);
|
||||
$("#detail_event_dialog .cell_event_name")
|
||||
$("#detail_event_dialog h1.dialog_title")
|
||||
.html(event["evento"]);
|
||||
$("#detail_event_dialog .cell_event_id")
|
||||
.html(id_event);
|
||||
|
@ -1227,6 +1272,8 @@ class Events
|
|||
.html(event["criticity"]);
|
||||
$("#detail_event_dialog .cell_event_status")
|
||||
.html(event["status"]);
|
||||
$("#detail_event_dialog .cell_event_status img")
|
||||
.addClass("main_menu_icon");
|
||||
$("#detail_event_dialog .cell_event_acknowledged_by")
|
||||
.html(event["acknowledged_by"]);
|
||||
$("#detail_event_dialog .cell_event_group")
|
||||
|
@ -1251,11 +1298,21 @@ class Events
|
|||
//The event is validated.
|
||||
$("#validate_button").hide();
|
||||
}
|
||||
|
||||
if (event["status"].indexOf("clock") >= 0) {
|
||||
$("#process_button").hide();
|
||||
}
|
||||
|
||||
$("#validate_button_loading").hide();
|
||||
$("#validate_button_fail").hide();
|
||||
$("#validate_button_correct").hide();
|
||||
$.mobile.loading( "hide" );
|
||||
$("#detail_event_dialog_hook").click();
|
||||
|
||||
$("#detail_event_dialog-button_close").html("");
|
||||
$("#detail_event_dialog-button_close").addClass("close-button-dialog");
|
||||
$(".dialog_title").parent().addClass("flex align-items-center space-between");
|
||||
$(".dialog_title").parent().append($("#detail_event_dialog-button_close"));
|
||||
}
|
||||
else {
|
||||
$.mobile.loading( "hide" );
|
||||
|
@ -1316,6 +1373,53 @@ class Events
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
function processEvent() {
|
||||
id_event = $("#event_id").val();
|
||||
server_id = $("#server_id").val();
|
||||
|
||||
$("#process_button").hide();
|
||||
$("#process_button_loading").show();
|
||||
|
||||
//Hide the button to close
|
||||
$("#detail_event_dialog div.ui-header a.ui-btn-right")
|
||||
.hide();
|
||||
|
||||
postvars = {};
|
||||
postvars["action"] = "ajax";
|
||||
postvars["parameter1"] = "events";
|
||||
postvars["parameter2"] = "process_event";
|
||||
postvars["id_event"] = id_event;
|
||||
postvars["server_id"] = server_id;
|
||||
|
||||
$.ajax ({
|
||||
type: "POST",
|
||||
url: "index.php",
|
||||
dataType: "json",
|
||||
data: postvars,
|
||||
success:
|
||||
function (data) {
|
||||
$("#process_button_loading").hide();
|
||||
|
||||
if (data.correct) {
|
||||
$("#process_button_correct").show();
|
||||
}
|
||||
else {
|
||||
$("#process_button_fail").show();
|
||||
}
|
||||
|
||||
$("#detail_event_dialog div.ui-header a.ui-btn-right")
|
||||
.show();
|
||||
},
|
||||
error:
|
||||
function (jqXHR, textStatus, errorThrown) {
|
||||
$("#process_button_loading").hide();
|
||||
$("#process_button_fail").show();
|
||||
$("#detail_event_dialog div.ui-header a.ui-btn-right")
|
||||
.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>'
|
||||
);
|
||||
}
|
||||
|
@ -1351,14 +1455,14 @@ class Events
|
|||
|
||||
$(\"table#\"+table_id+\" tbody\").append(new_rows);
|
||||
|
||||
load_more_rows = 0;
|
||||
// load_more_rows = 0;
|
||||
refresh_link_listener_list_events();
|
||||
}
|
||||
}
|
||||
|
||||
function ajax_load_rows() {
|
||||
if (load_more_rows) {
|
||||
load_more_rows = 0;
|
||||
if (load_more_rows) {
|
||||
// load_more_rows = 0;
|
||||
postvars = {};
|
||||
postvars[\"action\"] = \"ajax\";
|
||||
postvars[\"parameter1\"] = \"events\";
|
||||
|
@ -1383,7 +1487,7 @@ class Events
|
|||
//Check if the end of the event list tables is in the client limits
|
||||
var table_end = $('#list_events').offset().top + $('#list_events').height();
|
||||
if (table_end < document.documentElement.clientHeight) {
|
||||
ajax_load_rows();
|
||||
// ajax_load_rows();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1411,26 +1515,47 @@ class Events
|
|||
if (data.events.length == 0) {
|
||||
$('#last_agent_events').css('visibility', 'hidden');
|
||||
$('#empty_advice_events').show();
|
||||
}
|
||||
} else {
|
||||
$('#empty_advice_events').hide();
|
||||
}
|
||||
},
|
||||
\"json\");
|
||||
}
|
||||
|
||||
let intervalId;
|
||||
let count = 0;
|
||||
function getFreeSpace() {
|
||||
let headerHeight = $('div[data-role=\"header\"].ui-header').outerHeight();
|
||||
let contentHeight = $('div[data-role=\"content\"].ui-content').outerHeight();
|
||||
let windowHeight = $(window).height();
|
||||
|
||||
let freeSpace = windowHeight - (headerHeight + contentHeight);
|
||||
|
||||
if (freeSpace > 0 && count < 50) {
|
||||
custom_scroll();
|
||||
} else {
|
||||
clearInterval(intervalId);
|
||||
}
|
||||
|
||||
count++;
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
ajax_load_rows();
|
||||
$(window).bind(\"scroll\", function () {
|
||||
custom_scroll();
|
||||
});
|
||||
$(window).on(\"touchmove\", function(event) {
|
||||
custom_scroll();
|
||||
});
|
||||
intervalId = setInterval(getFreeSpace, 500);
|
||||
ajax_load_rows();
|
||||
$(window).bind(\"scroll\", function () {
|
||||
custom_scroll();
|
||||
});
|
||||
$(window).on(\"touchmove\", function(event) {
|
||||
custom_scroll();
|
||||
});
|
||||
});
|
||||
|
||||
function custom_scroll() {
|
||||
if ($(this).scrollTop() + $(this).height()
|
||||
>= ($(document).height() - 100)) {
|
||||
ajax_load_rows();
|
||||
}
|
||||
>= ($(document).height() - 100)) {
|
||||
ajax_load_rows();
|
||||
}
|
||||
}
|
||||
</script>"
|
||||
);
|
||||
|
|
|
@ -121,6 +121,45 @@ class Groups
|
|||
$status_image = ui_print_status_image('agent_no_data_ball.png', '', true);
|
||||
}
|
||||
|
||||
// Show agent counter by states.
|
||||
$agents_counter = '['.$group['_total_agents_'];
|
||||
|
||||
if ($group['_monitors_alerts_fired_'] > 0) {
|
||||
$agents_counter .= ':';
|
||||
$agents_counter .= '<span class="color-orange">'.$group['_monitors_alerts_fired_'].'</span>';
|
||||
}
|
||||
|
||||
if ($group['_monitors_critical_'] > 0) {
|
||||
$agents_counter .= ':';
|
||||
$agents_counter .= '<span class="color-red">'.$group['_monitors_critical_'].'</span>';
|
||||
}
|
||||
|
||||
if ($group['_agents_warning_'] > 0) {
|
||||
$agents_counter .= ':';
|
||||
$agents_counter .= '<span class="color-yellow">'.$group['_agents_warning_'].'</span>';
|
||||
}
|
||||
|
||||
if ($group['_agents_unknown_'] > 0) {
|
||||
$agents_counter .= ':';
|
||||
$agents_counter .= '<span class="color-grey">'.$group['_agents_unknown_'].'</span>';
|
||||
}
|
||||
|
||||
if ($group['_agents_not_init_'] > 0) {
|
||||
$agents_counter .= ':';
|
||||
$agents_counter .= '<span class="color-blue">'.$group['_agents_not_init_'].'</span>';
|
||||
}
|
||||
|
||||
if ($group['_agents_ok_'] > 0) {
|
||||
$agents_counter .= ':';
|
||||
$agents_counter .= '<span class="color-green">'.$group['_agents_ok_'].'</span>';
|
||||
}
|
||||
|
||||
$agents_counter .= ']';
|
||||
|
||||
if ($group['_iconImg_'] !== null) {
|
||||
$img_group = html_print_image('images/'.$group['_iconImg_'], true, false, false, false, false, true);
|
||||
}
|
||||
|
||||
$group['_iconImg_'] = ($group['_iconImg_'] == '') ? 'world.png' : $group['_iconImg_'];
|
||||
$ui->contentAddHtml(
|
||||
'
|
||||
|
@ -138,45 +177,45 @@ class Groups
|
|||
'
|
||||
);
|
||||
$ui->contentAddHtml(
|
||||
'<div data-collapsed-icon="group_'.$count.'" '.'data-expanded-icon="group_'.$count.'" '.'data-iconpos="right" data-role="collapsible" '.'data-collapsed="true" data-theme="'.$color_class.'" data-content-theme="d">'
|
||||
'<div data-collapsed-icon="group_'.$count.'" '.'data-expanded-icon="group_'.$count.'" data-iconpos="right" data-role="collapsible" data-collapsed="true" data-theme="'.$color_class.'" data-content-theme="d">'
|
||||
);
|
||||
$ui->contentAddHtml('<h4>'.$group['_name_'].'</h4>');
|
||||
$ui->contentAddHtml('<h4>'.$img_group.' '.$group['_name_'].'<span class="agents-counter">'.$agents_counter.'</span></h4>');
|
||||
$ui->contentAddHtml('<ul data-role="listview" class="groups_sublist">');
|
||||
|
||||
$ui->contentAddHtml(
|
||||
'<li data-icon="false"><a href="'.sprintf($url_agent, $group['_id_'], AGENT_STATUS_ALL).'">'.'<span class="name_count">'.html_print_image('images/agent.png', true, ['class' => 'invert_filter'], false, false, false, true).__('Total agents').'</span>'.'<span class="number_count">'.$group['_total_agents_'].'</span>'.'</a></li>'
|
||||
'<li data-icon="false"><a href="'.sprintf($url_agent, $group['_id_'], AGENT_STATUS_ALL).'"><span class="name_count">'.html_print_image('images/agent.png', true, ['class' => 'invert_filter'], false, false, false, true).__('Total agents').'</span><span class="number_count">'.$group['_total_agents_'].'</span></a></li>'
|
||||
);
|
||||
$ui->contentAddHtml(
|
||||
'<li data-icon="false"><a href="'.sprintf($url_agent, $group['_id_'], AGENT_STATUS_NOT_INIT).'">'.'<span class="name_count">'.html_print_image('images/agent_notinit.png', true, false, false, false, false, true).__('Agents not init').'</span>'.'<span class="number_count">'.$group['_agents_not_init_'].'</span>'.'</a></li>'
|
||||
'<li data-icon="false"><a href="'.sprintf($url_agent, $group['_id_'], AGENT_STATUS_NOT_INIT).'"><span class="name_count">'.html_print_image('images/agent_notinit.png', true, false, false, false, false, true).__('Agents not init').'</span><span class="number_count">'.$group['_agents_not_init_'].'</span></a></li>'
|
||||
);
|
||||
$ui->contentAddHtml(
|
||||
'<li data-icon="false"><a href="'.sprintf($url_agent, $group['_id_'], AGENT_STATUS_CRITICAL).'">'.'<span class="name_count">'.html_print_image('images/agent_critical.png', true, false, false, false, false, true).__('Agents critical').'</span>'.'<span class="number_count">'.$group['_agents_critical_'].'</span>'.'</a></li>'
|
||||
);
|
||||
$ui->contentAddHtml(
|
||||
'<li data-icon="false"><a href="'.sprintf($url_agent, $group['_id_'], AGENT_STATUS_UNKNOWN).'">'.'<span class="name_count">'.html_print_image('images/agent_unknown.png', true, false, false, false, false, true).__('Agents unknown').'</span>'.'<span class="number_count">'.$group['_agents_unknown_'].'</span>'.'</a></li>'
|
||||
);
|
||||
$ui->contentAddHtml(
|
||||
'<li data-icon="false"><a href="'.sprintf($url_modules, $group['_id_'], AGENT_MODULE_STATUS_UNKNOWN).'">'.'<span class="name_count">'.html_print_image('images/module_unknown.png', true, false, false, false, false, true).__('Unknown modules').'</span>'.'<span class="number_count">'.$group['_monitors_unknown_'].'</span>'.'</a></li>'
|
||||
);
|
||||
$ui->contentAddHtml(
|
||||
'<li data-icon="false"><a href="'.sprintf($url_modules, $group['_id_'], AGENT_MODULE_STATUS_NOT_INIT).'">'.'<span class="name_count">'.html_print_image('images/module_notinit.png', true, false, false, false, false, true).__('Not init modules').'</span>'.'<span class="number_count">'.$group['_monitors_not_init_'].'</span>'.'</a></li>'
|
||||
);
|
||||
$ui->contentAddHtml(
|
||||
'<li data-icon="false"><a href="'.sprintf($url_modules, $group['_id_'], AGENT_MODULE_STATUS_NORMAL).'">'.'<span class="name_count">'.html_print_image('images/module_ok.png', true, false, false, false, false, true).__('Normal modules').'</span>'.'<span class="number_count">'.$group['_monitors_ok_'].'</span>'.'</a></li>'
|
||||
);
|
||||
$ui->contentAddHtml(
|
||||
'<li data-icon="false"><a href="'.sprintf($url_modules, $group['_id_'], AGENT_MODULE_STATUS_WARNING).'">'.'<span class="name_count">'.html_print_image('images/module_warning.png', true, false, false, false, false, true).__('Warning modules').'</span>'.'<span class="number_count">'.$group['_monitors_warning_'].'</span>'.'</a></li>'
|
||||
);
|
||||
$ui->contentAddHtml(
|
||||
'<li data-icon="false"><a href="'.sprintf($url_modules, $group['_id_'], AGENT_MODULE_STATUS_CRITICAL_BAD).'">'.'<span class="name_count">'.html_print_image('images/module_critical.png', true, false, false, false, false, true).__('Critical modules').'</span>'.'<span class="number_count">'.$group['_monitors_critical_'].'</span>'.'</a></li>'
|
||||
);
|
||||
$ui->contentAddHtml(
|
||||
'<li data-icon="false"><a href="">'.'<span class="name_count">'.html_print_image('images/bell_error.png', true, false, false, false, false, true).__('Alerts fired').'</span>'.'<span class="number_count">'.$group['_monitors_alerts_fired_'].'</span>'.'</a></li>'
|
||||
);
|
||||
$ui->contentAddHtml('</ul>');
|
||||
$ui->contentAddHtml('</div>');
|
||||
$ui->contentAddHtml(
|
||||
'<li data-icon="false"><a href="'.sprintf($url_agent, $group['_id_'], AGENT_STATUS_CRITICAL).'"><span class="name_count">'.html_print_image('images/agent_critical.png', true, false, false, false, false, true).__('Agents critical').'</span><span class="number_count">'.$group['_agents_critical_'].'</span></a></li>'
|
||||
);
|
||||
$ui->contentAddHtml(
|
||||
'<li data-icon="false"><a href="'.sprintf($url_agent, $group['_id_'], AGENT_STATUS_UNKNOWN).'"><span class="name_count">'.html_print_image('images/agent_unknown.png', true, false, false, false, false, true).__('Agents unknown').'</span><span class="number_count">'.$group['_agents_unknown_'].'</span></a></li>'
|
||||
);
|
||||
$ui->contentAddHtml(
|
||||
'<li data-icon="false"><a href="'.sprintf($url_modules, $group['_id_'], AGENT_MODULE_STATUS_UNKNOWN).'"><span class="name_count">'.html_print_image('images/module_unknown.png', true, false, false, false, false, true).__('Unknown modules').'</span><span class="number_count">'.$group['_monitors_unknown_'].'</span></a></li>'
|
||||
);
|
||||
$ui->contentAddHtml(
|
||||
'<li data-icon="false"><a href="'.sprintf($url_modules, $group['_id_'], AGENT_MODULE_STATUS_NOT_INIT).'"><span class="name_count">'.html_print_image('images/module_notinit.png', true, false, false, false, false, true).__('Not init modules').'</span><span class="number_count">'.$group['_monitors_not_init_'].'</span></a></li>'
|
||||
);
|
||||
$ui->contentAddHtml(
|
||||
'<li data-icon="false"><a href="'.sprintf($url_modules, $group['_id_'], AGENT_MODULE_STATUS_NORMAL).'"><span class="name_count">'.html_print_image('images/module_ok.png', true, false, false, false, false, true).__('Normal modules').'</span><span class="number_count">'.$group['_monitors_ok_'].'</span></a></li>'
|
||||
);
|
||||
$ui->contentAddHtml(
|
||||
'<li data-icon="false"><a href="'.sprintf($url_modules, $group['_id_'], AGENT_MODULE_STATUS_WARNING).'"><span class="name_count">'.html_print_image('images/module_warning.png', true, false, false, false, false, true).__('Warning modules').'</span><span class="number_count">'.$group['_monitors_warning_'].'</span></a></li>'
|
||||
);
|
||||
$ui->contentAddHtml(
|
||||
'<li data-icon="false"><a href="'.sprintf($url_modules, $group['_id_'], AGENT_MODULE_STATUS_CRITICAL_BAD).'"><span class="name_count">'.html_print_image('images/module_critical.png', true, false, false, false, false, true).__('Critical modules').'</span><span class="number_count">'.$group['_monitors_critical_'].'</span></a></li>'
|
||||
);
|
||||
$ui->contentAddHtml(
|
||||
'<li data-icon="false"><a href=""><span class="name_count">'.html_print_image('images/bell_error.png', true, false, false, false, false, true).__('Alerts fired').'</span><span class="number_count">'.$group['_monitors_alerts_fired_'].'</span></a></li>'
|
||||
);
|
||||
$ui->contentAddHtml('</ul>');
|
||||
$ui->contentAddHtml('</div>');
|
||||
|
||||
$count++;
|
||||
$count++;
|
||||
}
|
||||
|
||||
$ui->contentAddHtml('</div>');
|
||||
|
|
|
@ -40,24 +40,24 @@ class Home
|
|||
|
||||
$items = [];
|
||||
|
||||
// In home
|
||||
// In home.
|
||||
$items['tactical'] = [
|
||||
'name' => __('Tactical view'),
|
||||
'filename' => 'tactical.php',
|
||||
'menu_item' => true,
|
||||
'icon' => 'ui-icon-tactical_view ui-widget-icon-floatbeginning',
|
||||
'icon' => 'ui-icon-menu-op_monitoring ui-widget-icon-floatbeginning ui-icon-menu-square',
|
||||
];
|
||||
$items['events'] = [
|
||||
'name' => __('Events'),
|
||||
'filename' => 'events.php',
|
||||
'menu_item' => true,
|
||||
'icon' => 'ui-icon-events ui-widget-icon-floatbeginning',
|
||||
'icon' => 'ui-icon-menu-op_events ui-widget-icon-floatbeginning ui-icon-menu-square',
|
||||
];
|
||||
$items['groups'] = [
|
||||
'name' => __('Groups'),
|
||||
'filename' => 'groups.php',
|
||||
'menu_item' => true,
|
||||
'icon' => 'ui-icon-groups ui-widget-icon-floatbeginning',
|
||||
'icon' => 'ui-icon-menu-group ui-widget-icon-floatbeginning ui-icon-menu-square',
|
||||
];
|
||||
|
||||
if ((bool) $system->getConfig('legacy_vc', false) === false) {
|
||||
|
@ -66,7 +66,7 @@ class Home
|
|||
'name' => __('Visual consoles'),
|
||||
'filename' => 'visualmaps.php',
|
||||
'menu_item' => true,
|
||||
'icon' => 'ui-icon-visual_console ui-widget-icon-floatbeginning',
|
||||
'icon' => 'ui-icon-menu-visual_console ui-widget-icon-floatbeginning ui-icon-menu-square',
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -74,23 +74,39 @@ class Home
|
|||
'name' => __('Alerts'),
|
||||
'filename' => 'alerts.php',
|
||||
'menu_item' => true,
|
||||
'icon' => 'ui-icon-alerts ui-widget-icon-floatbeginning',
|
||||
'icon' => 'ui-icon-menu-op_alerts ui-widget-icon-floatbeginning ui-icon-menu-square',
|
||||
];
|
||||
|
||||
$items['agents'] = [
|
||||
'name' => __('Agents'),
|
||||
'filename' => 'agents.php',
|
||||
'menu_item' => true,
|
||||
'icon' => 'ui-icon-agents ui-widget-icon-floatbeginning',
|
||||
'icon' => 'ui-icon-menu-agent_ms ui-widget-icon-floatbeginning ui-icon-menu-square',
|
||||
];
|
||||
|
||||
$items['modules'] = [
|
||||
'name' => __('Modules'),
|
||||
'filename' => 'modules.php',
|
||||
'menu_item' => true,
|
||||
'icon' => 'ui-icon-modules ui-widget-icon-floatbeginning',
|
||||
'icon' => 'ui-icon-menu-brick ui-widget-icon-floatbeginning ui-icon-menu-square',
|
||||
];
|
||||
|
||||
$items['server_status'] = [
|
||||
'name' => __('Server status'),
|
||||
'filename' => 'server_status.php',
|
||||
'menu_item' => true,
|
||||
'icon' => 'ui-icon-menu-server-status ui-widget-icon-floatbeginning ui-icon-menu-square',
|
||||
];
|
||||
|
||||
if ((int) $system->getConfig('enterprise_installed', false) === 1) {
|
||||
$items['services'] = [
|
||||
'name' => __('Services'),
|
||||
'filename' => 'services.php',
|
||||
'menu_item' => true,
|
||||
'icon' => 'ui-icon-menu-services ui-widget-icon-floatbeginning ui-icon-menu-square',
|
||||
];
|
||||
}
|
||||
|
||||
// Not in home.
|
||||
$items['agent'] = [
|
||||
'name' => __('Agent'),
|
||||
|
@ -115,6 +131,7 @@ class Home
|
|||
$this->loadPagesItems();
|
||||
}
|
||||
|
||||
$ui->contentAddHtml('<div class="menu-buttons">');
|
||||
foreach ($this->pagesItems as $page => $data) {
|
||||
if ($data['menu_item']) {
|
||||
$options = [
|
||||
|
@ -127,6 +144,8 @@ class Home
|
|||
$ui->contentAddHtml($ui->createButton($options));
|
||||
}
|
||||
}
|
||||
|
||||
$ui->contentAddHtml('</div>');
|
||||
}
|
||||
|
||||
|
||||
|
@ -143,11 +162,11 @@ class Home
|
|||
} else {
|
||||
$left_button = $ui->createHeaderButton(
|
||||
[
|
||||
'icon' => 'ui-icon-back',
|
||||
'icon' => 'ui-icon-logout',
|
||||
'pos' => 'left',
|
||||
'text' => __('Logout'),
|
||||
'href' => 'index.php?action=logout',
|
||||
'class' => 'header-button-left',
|
||||
'class' => 'header-button-left logout-text',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -161,6 +180,7 @@ class Home
|
|||
$ui->createHeader(__('Home'), $left_button, $user_logged);
|
||||
$ui->showFooter(false);
|
||||
$ui->beginContent();
|
||||
$ui->contentAddHtml('<div class="search-home">');
|
||||
$ui->beginForm('index.php?page=agents');
|
||||
$options = [
|
||||
'name' => 'free_search',
|
||||
|
@ -169,11 +189,13 @@ class Home
|
|||
];
|
||||
$ui->formAddInputSearch($options);
|
||||
$ui->endForm();
|
||||
$ui->contentAddHtml('</div>');
|
||||
|
||||
// List of buttons
|
||||
$this->loadButtons($ui);
|
||||
|
||||
if (!empty($error)) {
|
||||
$error['dialog_id'] = 'error-dialog';
|
||||
$ui->addDialog($error);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,354 @@
|
|||
<?php
|
||||
// phpcs:disable Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
|
||||
/**
|
||||
* Modules list view for mobile
|
||||
*
|
||||
* @category Mobile
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Begin.
|
||||
class ModuleData
|
||||
{
|
||||
|
||||
private $correct_acl = false;
|
||||
|
||||
private $acl = 'AR';
|
||||
|
||||
private $default = true;
|
||||
|
||||
private $default_filters = [];
|
||||
|
||||
private $moduleId = null;
|
||||
|
||||
private $agentAlias = null;
|
||||
|
||||
private $moduleName = null;
|
||||
|
||||
private $columns = null;
|
||||
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$system = System::getInstance();
|
||||
|
||||
if ($system->checkACL($this->acl)) {
|
||||
$this->correct_acl = true;
|
||||
} else {
|
||||
$this->correct_acl = false;
|
||||
}
|
||||
|
||||
$this->moduleId = $system->getRequest('module_id');
|
||||
}
|
||||
|
||||
|
||||
public function ajax($parameter2=false)
|
||||
{
|
||||
$system = System::getInstance();
|
||||
|
||||
if (!$this->correct_acl) {
|
||||
return;
|
||||
} else {
|
||||
switch ($parameter2) {
|
||||
case 'get_module_data':
|
||||
$this->getFilters();
|
||||
$page = $system->getRequest('page', 0);
|
||||
$module_id = $system->getRequest('module_id');
|
||||
$servers = [];
|
||||
$end = 1;
|
||||
|
||||
$listData = $this->getListData($page, true);
|
||||
|
||||
if (!empty($listData['data'])) {
|
||||
$end = 0;
|
||||
$servers = $listData['data'];
|
||||
}
|
||||
|
||||
echo json_encode(['end' => $end, 'servers' => $servers]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function show()
|
||||
{
|
||||
if (!$this->correct_acl) {
|
||||
$this->show_fail_acl();
|
||||
} else {
|
||||
$this->show_module_data();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function show_fail_acl()
|
||||
{
|
||||
$error['type'] = 'onStart';
|
||||
$error['title_text'] = __('You don\'t have access to this page');
|
||||
$error['content_text'] = System::getDefaultACLFailText();
|
||||
if (class_exists('HomeEnterprise')) {
|
||||
$home = new HomeEnterprise();
|
||||
} else {
|
||||
$home = new Home();
|
||||
}
|
||||
|
||||
$home->show($error);
|
||||
}
|
||||
|
||||
|
||||
private function show_module_data()
|
||||
{
|
||||
$ui = Ui::getInstance();
|
||||
|
||||
$ui->createPage();
|
||||
$ui->createDefaultHeader(
|
||||
__('Module data'),
|
||||
$ui->createHeaderButton(
|
||||
[
|
||||
'icon' => 'ui-icon-back',
|
||||
'pos' => 'left',
|
||||
'text' => __('Back'),
|
||||
'href' => 'index.php?page=modules',
|
||||
'class' => 'header-button-left',
|
||||
]
|
||||
)
|
||||
);
|
||||
$ui->showFooter(false);
|
||||
$ui->beginContent();
|
||||
$this->listDataHtml();
|
||||
$ui->endContent();
|
||||
$ui->showPage();
|
||||
}
|
||||
|
||||
|
||||
private function getListData($page=0, $ajax=false)
|
||||
{
|
||||
global $config;
|
||||
$system = System::getInstance();
|
||||
|
||||
$total = 0;
|
||||
$data = [];
|
||||
|
||||
$module_data = modules_get_agentmodule_data(
|
||||
$this->moduleId,
|
||||
604800,
|
||||
0,
|
||||
false,
|
||||
false,
|
||||
'DESC'
|
||||
);
|
||||
|
||||
$total = (int) count($module_data);
|
||||
|
||||
foreach ($module_data as $module) {
|
||||
$row[__('Data')] = '<span class="data">'.$module['data'].'</span>';
|
||||
$row[__('Timestamp')] = '<span class="data">'.human_time_comparation($module['utimestamp'], 'tiny').'</span>';
|
||||
|
||||
array_push($data, $row);
|
||||
}
|
||||
|
||||
return [
|
||||
'data' => $data,
|
||||
'total' => $total,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function listDataHtml($page=0, $return=false)
|
||||
{
|
||||
$system = System::getInstance();
|
||||
$ui = Ui::getInstance();
|
||||
|
||||
$listData = $this->getListData($page);
|
||||
if ($listData['total'] == 0) {
|
||||
$html = '<p class="no-data">'.__('No data').'</p>';
|
||||
if (!$return) {
|
||||
$ui->contentAddHtml($html);
|
||||
} else {
|
||||
return $html;
|
||||
}
|
||||
} else {
|
||||
if (!$return) {
|
||||
$table = new Table();
|
||||
$table->id = 'list_module_data';
|
||||
$table->importFromHash($listData['data']);
|
||||
|
||||
$ui->contentAddHtml('<div class="white-card">');
|
||||
|
||||
$agent_id = agents_get_agent_id_by_module_id($this->moduleId);
|
||||
$agent_name = agents_get_name($agent_id);
|
||||
$module_name = modules_get_agentmodule_name($this->moduleId);
|
||||
$ui->contentAddHtml('<h1 class="center font-10pt">'.$module_name.'</h1>');
|
||||
$ui->contentAddHtml('<p class="center truncate muted">'.$agent_name.'</p>');
|
||||
|
||||
$ui->contentAddHtml($table->getHTML());
|
||||
|
||||
$ui->contentAddHtml('</div>');
|
||||
} else {
|
||||
$table = new Table();
|
||||
$table->id = 'list_module_data';
|
||||
|
||||
$table->importFromHash($listData['data']);
|
||||
|
||||
$html = $table->getHTML();
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
// if ($system->getPageSize() < $listData['total']) {
|
||||
// $ui->contentAddHtml(
|
||||
// '<div id="loading_rows">'.html_print_image('images/spinner.gif', true, false, false, false, false, true).' '.__('Loading...').'</div>'
|
||||
// );
|
||||
// $this->addJavascriptAddBottom();
|
||||
// }
|
||||
}
|
||||
|
||||
$ui->contentAddLinkListener('list_servers');
|
||||
}
|
||||
|
||||
|
||||
private function addJavascriptAddBottom()
|
||||
{
|
||||
$ui = Ui::getInstance();
|
||||
|
||||
$ui->contentAddHtml(
|
||||
"<script type=\"text/javascript\">
|
||||
var load_more_rows = 1;
|
||||
var page = 1;
|
||||
|
||||
function custom_scroll() {
|
||||
if (load_more_rows) {
|
||||
if ($(this).scrollTop() + $(this).height()
|
||||
>= ($(document).height() - 100)) {
|
||||
load_more_rows = 0;
|
||||
|
||||
postvars = {};
|
||||
postvars[\"action\"] = \"ajax\";
|
||||
postvars[\"parameter1\"] = \"module_data\";
|
||||
postvars[\"parameter2\"] = \"get_module_data\";
|
||||
postvars[\"page\"] = page;
|
||||
page++;
|
||||
|
||||
$.post(
|
||||
\"index.php\",
|
||||
postvars,
|
||||
function (data) {
|
||||
if (data.end) {
|
||||
$(\"#loading_rows\").hide();
|
||||
}
|
||||
else {
|
||||
$.each(data.servers, function(key, server) {;
|
||||
$(\"table#list_servers tbody\").append(\"<tr>\" +
|
||||
\"<td class='cell_0'><b class='ui-table-cell-label'>".__('Status')."</b>\" + server['Status'] + \"</td>\" +
|
||||
\"<td class='cell_1'><b class='ui-table-cell-label'>".__('Image')."</b>\" + server['Image'] + \"</td>\" +
|
||||
\"<td class='cell_2'><b class='ui-table-cell-label'>".__('Name')."</b>\" + server['Name'] + \"</td>\" +
|
||||
\"</tr>\");
|
||||
});
|
||||
|
||||
load_more_rows = 1;
|
||||
refresh_link_listener_list_servers()
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
\"json\");
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$(window).bind(\"scroll\", function () {
|
||||
custom_scroll();
|
||||
});
|
||||
|
||||
$(window).on(\"touchmove\", function(event) {
|
||||
custom_scroll();
|
||||
});
|
||||
});
|
||||
</script>"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
private function filterServersGetString()
|
||||
{
|
||||
if ($this->default) {
|
||||
return __('(Default)');
|
||||
} else {
|
||||
$filters_to_serialize = [];
|
||||
|
||||
if (!$this->default_filters['group']) {
|
||||
$filters_to_serialize[] = sprintf(
|
||||
__('Group: %s'),
|
||||
groups_get_name($this->group, true)
|
||||
);
|
||||
}
|
||||
|
||||
if (!$this->default_filters['module_group']) {
|
||||
$module_group = db_get_value(
|
||||
'name',
|
||||
'tmodule_group',
|
||||
'id_mg',
|
||||
$this->module_group
|
||||
);
|
||||
$module_group = io_safe_output($module_group);
|
||||
|
||||
$filters_to_serialize[] = sprintf(
|
||||
__('Module group: %s'),
|
||||
$module_group
|
||||
);
|
||||
}
|
||||
|
||||
if (!$this->default_filters['status']) {
|
||||
$filters_to_serialize[] = sprintf(
|
||||
__('Status: %s'),
|
||||
$this->list_status[$this->status]
|
||||
);
|
||||
}
|
||||
|
||||
if (!$this->default_filters['free_search']) {
|
||||
$filters_to_serialize[] = sprintf(
|
||||
__('Free Search: %s'),
|
||||
$this->free_search
|
||||
);
|
||||
}
|
||||
|
||||
if (!$this->default_filters['tag']) {
|
||||
$tag_name = tags_get_name($this->tag);
|
||||
$filters_to_serialize[] = sprintf(
|
||||
__('Tag: %s'),
|
||||
$tag_name
|
||||
);
|
||||
}
|
||||
|
||||
$string = '('.implode(' - ', $filters_to_serialize).')';
|
||||
|
||||
return $string;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -404,7 +404,7 @@ class ModuleGraph
|
|||
)
|
||||
);
|
||||
$title = sprintf(__('Options for %s : %s'), $agent_alias, $this->module['nombre']);
|
||||
$ui->contentBeginCollapsible($title);
|
||||
$ui->contentBeginCollapsible($title, 'filter-collapsible');
|
||||
$ui->beginForm('index.php?page=module_graph&id='.$this->id.'&server_id='.$this->server_id);
|
||||
$options = [
|
||||
'name' => 'draw_alerts',
|
||||
|
|
|
@ -250,7 +250,7 @@ class Modules
|
|||
__('Filter Modules by %s'),
|
||||
$this->filterEventsGetString()
|
||||
);
|
||||
$ui->contentBeginCollapsible($filter_title);
|
||||
$ui->contentBeginCollapsible($filter_title, 'filter-collapsible');
|
||||
$ui->beginForm('index.php?page=modules');
|
||||
$system = System::getInstance();
|
||||
$groups = users_get_groups_for_select(
|
||||
|
@ -591,7 +591,18 @@ class Modules
|
|||
}
|
||||
}
|
||||
|
||||
$row[0] = $row[__('Module name')] = '<span class="tiny mrgn_right_5px">'.$image_status.'</span>'.'<span class="data module_name">'.ui_print_truncate_text($module['module_name'], 30, false).'</span>';
|
||||
$script = '';
|
||||
if ($system->getConfig('metaconsole')) {
|
||||
$script = 'onclick="openDialog('.$module['id_agente_modulo'].', '.$this->id_agent.' ,'.$module['server_id'].');"';
|
||||
} else {
|
||||
$script = 'onclick="openDialog('.$module['id_agente_modulo'].', '.$this->id_agent.', \'node\');"';
|
||||
}
|
||||
|
||||
if ($system->getRequest('page') === 'modules') {
|
||||
$row[0] = $row[__('Module name')] = '<span '.$script.'><span class="tiny module-status">'.$image_status.'</span>'.'<span class="data module_name">'.ui_print_truncate_text($module['module_name'], 30, false).'</span></span>';
|
||||
} else {
|
||||
$row[0] = $row[__('Module name')] = '<span class="tiny module-status">'.$image_status.'</span>'.'<span '.$script.' class="data module_name">'.ui_print_truncate_text($module['module_name'], 30, false).'</span>';
|
||||
}
|
||||
|
||||
if ($this->columns['agent']) {
|
||||
$row[1] = $row[__('Agent name')] = '<span class="data"><span class="show_collapside bolder invisible">'.__('Agent').' </span>'.ui_print_truncate_text($module['agent_alias'], 50, false).'</span>';
|
||||
|
@ -658,7 +669,7 @@ class Modules
|
|||
|
||||
$row[4] = $row[__('Interval')] = '<span class="data"><span class="show_collapside bolder invisible">'.__('Interval.').' </span>'.$row[__('Interval')].'</span>';
|
||||
|
||||
$row[6] = $row[__('Timestamp')] = '<span class="data"><span class="show_collapside bolder invisible">'.__('Last update.').' </span>'.ui_print_timestamp($module['utimestamp'], true, ['units' => 'tiny']).'</span>';
|
||||
$row[6] = $row[__('Timestamp')] = '<span class="data"><span class="show_collapside bolder invisible">'.__('Last update.').' </span>'.human_time_comparation($module['utimestamp'], 'tiny').'</span>';
|
||||
if (is_numeric($module['datos'])) {
|
||||
$output = format_numeric($module['datos']);
|
||||
|
||||
|
@ -712,29 +723,50 @@ class Modules
|
|||
);
|
||||
|
||||
// Row 7.
|
||||
$row[__('Data')] = ui_get_snapshot_image($link, $is_snapshot).' ';
|
||||
$row[7] = $row[__('Data')] = ui_get_snapshot_image($link, $is_snapshot).' ';
|
||||
} else {
|
||||
if ($system->getConfig('metaconsole')) {
|
||||
$row[__('Data')] = '<span class="nowrap">';
|
||||
$row[__('Data')] .= '<span class="show_collapside invisible">';
|
||||
$row[__('Data')] .= $row[__('Status')].' </span>';
|
||||
$row[__('Data')] .= '<a data-ajax="false" class="ui-link" ';
|
||||
$row[__('Data')] .= 'href="index.php?page=module_graph&id='.$module['id_agente_modulo'];
|
||||
$row[__('Data')] .= '&server_id='.$module['server_id'];
|
||||
$row[__('Data')] .= '&id_agent='.$this->id_agent.'">';
|
||||
$row[__('Data')] .= $output.'</a></span>';
|
||||
// Row 7.
|
||||
$row[__('Data')];
|
||||
if ($system->getRequest('page') === 'modules') {
|
||||
if ($system->getConfig('metaconsole')) {
|
||||
$row[7] = $row[__('Data')] = '<span class="nowrap">';
|
||||
$row[7] = $row[__('Data')] .= '<span class="show_collapside invisible">';
|
||||
$row[7] = $row[__('Data')] .= $row[__('Status')].' </span>';
|
||||
$row[7] = $row[__('Data')] .= '<span data-ajax="false" class="ui-link" ';
|
||||
$row[7] = $row[__('Data')] .= 'href="#">';
|
||||
$row[7] = $row[__('Data')] .= $output.'</span></span>';
|
||||
// Row 7.
|
||||
$row[7] = $row[__('Data')];
|
||||
} else {
|
||||
// Row 7.
|
||||
$row[7] = $row[__('Data')] = '<span class="nowrap">';
|
||||
$row[7] = $row[__('Data')] .= '<span class="show_collapside invisible">';
|
||||
$row[7] = $row[__('Data')] .= $row[__('Status')].' </span>';
|
||||
$row[7] = $row[__('Data')] .= '<span data-ajax="false" class="ui-link" ';
|
||||
$row[7] = $row[__('Data')] .= 'href="#">';
|
||||
$row[7] = $row[__('Data')] .= $output.'</span></span>';
|
||||
}
|
||||
} else {
|
||||
// Row 7.
|
||||
$row[__('Data')] = '<span class="nowrap">';
|
||||
$row[__('Data')] .= '<span class="show_collapside invisible">';
|
||||
$row[__('Data')] .= $row[__('Status')].' </span>';
|
||||
$row[__('Data')] .= '<a data-ajax="false" class="ui-link" ';
|
||||
$row[__('Data')] .= 'href="index.php?page=module_graph&id=';
|
||||
$row[__('Data')] .= $module['id_agente_modulo'];
|
||||
$row[__('Data')] .= '&id_agent='.$this->id_agent.'">';
|
||||
$row[__('Data')] .= $output.'</a></span>';
|
||||
if ($system->getConfig('metaconsole')) {
|
||||
$row[__('Data')] = '<span class="nowrap">';
|
||||
$row[__('Data')] .= '<span class="show_collapside invisible">';
|
||||
$row[__('Data')] .= $row[__('Status')].' </span>';
|
||||
$row[__('Data')] .= '<a data-ajax="false" class="ui-link" ';
|
||||
$row[__('Data')] .= 'href="index.php?page=module_graph&id='.$module['id_agente_modulo'];
|
||||
$row[__('Data')] .= '&server_id='.$module['server_id'];
|
||||
$row[__('Data')] .= '&id_agent='.$this->id_agent.'">';
|
||||
$row[__('Data')] .= $output.'</a></span>';
|
||||
// Row 7.
|
||||
$row[__('Data')];
|
||||
} else {
|
||||
// Row 7.
|
||||
$row[__('Data')] = '<span class="nowrap">';
|
||||
$row[__('Data')] .= '<span class="show_collapside invisible">';
|
||||
$row[__('Data')] .= $row[__('Status')].' </span>';
|
||||
$row[__('Data')] .= '<a data-ajax="false" class="ui-link" ';
|
||||
$row[__('Data')] .= 'href="index.php?page=module_graph&id=';
|
||||
$row[__('Data')] .= $module['id_agente_modulo'];
|
||||
$row[__('Data')] .= '&id_agent='.$this->id_agent.'">';
|
||||
$row[__('Data')] .= $output.'</a></span>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -769,7 +801,7 @@ class Modules
|
|||
|
||||
$listModules = $this->getListModules($page);
|
||||
if ($listModules['total'] == 0) {
|
||||
$html = '<p class="empty_advice">'.__('No modules').'</p>';
|
||||
$html = '<p class="no-data">'.__('No modules').'</p>';
|
||||
if (!$return) {
|
||||
$ui->contentAddHtml($html);
|
||||
} else {
|
||||
|
@ -781,7 +813,21 @@ class Modules
|
|||
$table->id = 'list_Modules';
|
||||
$table->importFromHash($listModules['modules']);
|
||||
|
||||
$ui->contentAddHtml('<div class="hr-full"></div>');
|
||||
$ui->contentAddHtml('<div class="white-card p-lr-0px">');
|
||||
$ui->contentAddHtml($table->getHTML());
|
||||
|
||||
if (!$this->all_modules) {
|
||||
if ($system->getPageSize() < $listModules['total']) {
|
||||
$ui->contentAddHtml(
|
||||
'<br><div id="loading_rows">'.html_print_image('images/spinner.gif', true, false, false, false, false, true).' '.__('Loading...').'</div>'
|
||||
);
|
||||
|
||||
$this->addJavascriptAddBottom();
|
||||
}
|
||||
}
|
||||
|
||||
$ui->contentAddHtml('</div>');
|
||||
} else {
|
||||
$table = new Table();
|
||||
$table->id = 'list_agent_Modules';
|
||||
|
@ -792,18 +838,31 @@ class Modules
|
|||
|
||||
return $html;
|
||||
}
|
||||
|
||||
if (!$this->all_modules) {
|
||||
if ($system->getPageSize() < $listModules['total']) {
|
||||
$ui->contentAddHtml(
|
||||
'<div id="loading_rows">'.html_print_image('images/spinner.gif', true, false, false, false, false, true).' '.__('Loading...').'</div>'
|
||||
);
|
||||
|
||||
$this->addJavascriptAddBottom();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$ui->contentAddHtml(
|
||||
'<a id="module-dialog-button" href="#module-dialog" data-rel="popup" data-position-to="window"
|
||||
data-transition="pop" class="ui-btn ui-corner-all ui-btn-inline ui-icon-delete ui-btn-icon-left ui-btn-b">
|
||||
</a>
|
||||
|
||||
<div data-role="popup" id="module-dialog" data-overlay-theme="b" data-dismissible="false">
|
||||
<div data-role="header" data-theme="a" class="flex align-items-center space-between">
|
||||
<h1 style="margin-left: 10px;" class="font-10pt"> '.__('Choose option').'</h1>
|
||||
<a href="#" id="close-dialog-btn" data-role="button" class="ui-corner-all close-button-dialog" data-rel="back"></a>
|
||||
</div>
|
||||
|
||||
<div role="main" class="ui-content">
|
||||
<a data-role="button" id="graph-option" href="#" class="ui-btn ui-corner-all ui-btn-inline ui-btn-b">
|
||||
'.__('Graph').'
|
||||
</a>
|
||||
|
||||
<a data-role="button" id="historical-option" href="#" class="ui-btn ui-corner-all ui-btn-inline ui-btn-b">
|
||||
'.__('Historical data').'
|
||||
</a>
|
||||
</div>
|
||||
</div>'
|
||||
);
|
||||
|
||||
$ui->contentAddLinkListener('list_Modules');
|
||||
}
|
||||
|
||||
|
@ -850,8 +909,8 @@ class Modules
|
|||
\"<td class='cell_2'><b class='ui-table-cell-label'>".__('Status')."</b>\" + module[5] + \"</td>\" +
|
||||
\"<td class='cell_3'><b class='ui-table-cell-label'>".__('Interval')."</b>\" + module[4] + \"</td>\" +
|
||||
\"<td class='cell_4'><b class='ui-table-cell-label'>".__('Timestamp')."</b>\" + module[6] + \"</td>\" +
|
||||
\"<td class='cell_5'><b class='ui-table-cell-label'>".__('Data').'</b>" + module[7] + "</td>" +
|
||||
"</tr>");
|
||||
\"<td class='cell_5'><b class='ui-table-cell-label'>".__('Data')."</b>\" + module[7] + \"</td>\" +
|
||||
\"</tr>\");
|
||||
});
|
||||
|
||||
load_more_rows = 1;
|
||||
|
@ -860,21 +919,58 @@ class Modules
|
|||
|
||||
|
||||
},
|
||||
"json");
|
||||
\"json\");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function openDialog(moduleId, agentId, serverId) {
|
||||
var graph = '';
|
||||
var historical = '';
|
||||
if (serverId === 'node') {
|
||||
graph = 'index.php?page=module_graph&id='+moduleId+'&id_agent='+agentId;
|
||||
historical = 'index.php?page=module_data&module_id='+moduleId;
|
||||
} else {
|
||||
graph = 'index.php?page=module_graph&id='+moduleId+'&id_agent='+agentId+'&server_id='+serverId;
|
||||
historical = 'index.php?page=module_data&module_id='+moduleId;
|
||||
}
|
||||
|
||||
$('#graph-option').attr('href', graph);
|
||||
$('#historical-option').attr('href', historical);
|
||||
|
||||
$('#module-dialog-button').click();
|
||||
}
|
||||
|
||||
let intervalId;
|
||||
let count = 0;
|
||||
function getFreeSpace() {
|
||||
let headerHeight = $('div[data-role=\"header\"].ui-header').outerHeight();
|
||||
let contentHeight = $('div[data-role=\"content\"].ui-content').outerHeight();
|
||||
let windowHeight = $(window).height();
|
||||
|
||||
let freeSpace = windowHeight - (headerHeight + contentHeight);
|
||||
|
||||
if (freeSpace > 0 && count < 50) {
|
||||
custom_scroll();
|
||||
} else {
|
||||
clearInterval(intervalId);
|
||||
}
|
||||
|
||||
count++;
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$(window).bind("scroll", function () {
|
||||
intervalId = setInterval(getFreeSpace, 500);
|
||||
|
||||
$(window).bind(\"scroll\", function () {
|
||||
custom_scroll();
|
||||
});
|
||||
|
||||
$(window).on("touchmove", function(event) {
|
||||
$(window).on(\"touchmove\", function(event) {
|
||||
custom_scroll();
|
||||
});
|
||||
});
|
||||
</script>'
|
||||
});
|
||||
</script>"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,556 @@
|
|||
<?php
|
||||
// phpcs:disable Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
|
||||
/**
|
||||
* Modules list view for mobile
|
||||
*
|
||||
* @category Mobile
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Begin.
|
||||
class ServerStatus
|
||||
{
|
||||
|
||||
private $correct_acl = false;
|
||||
|
||||
private $acl = 'AR';
|
||||
|
||||
private $default = true;
|
||||
|
||||
private $default_filters = [];
|
||||
|
||||
private $group = 0;
|
||||
|
||||
private $status = AGENT_MODULE_STATUS_NOT_NORMAL;
|
||||
|
||||
private $free_search = '';
|
||||
|
||||
private $name = '';
|
||||
|
||||
private $module_group = -1;
|
||||
|
||||
private $tag = '';
|
||||
|
||||
private $id_agent = 0;
|
||||
|
||||
private $all_servers = false;
|
||||
|
||||
private $list_status = null;
|
||||
|
||||
private $columns = null;
|
||||
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$system = System::getInstance();
|
||||
|
||||
if ($system->checkACL($this->acl)) {
|
||||
$this->correct_acl = true;
|
||||
} else {
|
||||
$this->correct_acl = false;
|
||||
}
|
||||
|
||||
if ($system->getConfig('metaconsole') === 0) {
|
||||
$this->all_servers = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function ajax($parameter2=false)
|
||||
{
|
||||
$system = System::getInstance();
|
||||
|
||||
if (!$this->correct_acl) {
|
||||
return;
|
||||
} else {
|
||||
switch ($parameter2) {
|
||||
case 'get_server_status':
|
||||
$this->getFilters();
|
||||
$page = $system->getRequest('page', 0);
|
||||
$servers = [];
|
||||
$end = 1;
|
||||
|
||||
$listServers = $this->getListServers($page, true);
|
||||
|
||||
if (!empty($listServers['servers'])) {
|
||||
$end = 0;
|
||||
$servers = $listServers['servers'];
|
||||
}
|
||||
|
||||
echo json_encode(['end' => $end, 'servers' => $servers]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function setFilters($filters)
|
||||
{
|
||||
if (isset($filters['id_agent'])) {
|
||||
$this->id_agent = $filters['id_agent'];
|
||||
}
|
||||
|
||||
if (isset($filters['all_servers'])) {
|
||||
$this->all_servers = $filters['all_servers'];
|
||||
}
|
||||
|
||||
if (isset($filters['status'])) {
|
||||
$this->status = (int) $filters['status'];
|
||||
}
|
||||
|
||||
if (isset($filters['name'])) {
|
||||
$this->name = $filters['name'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function disabledColumns($columns=null)
|
||||
{
|
||||
if (!empty($columns)) {
|
||||
foreach ($columns as $column) {
|
||||
$this->columns[$column] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function getFilters()
|
||||
{
|
||||
$system = System::getInstance();
|
||||
$user = User::getInstance();
|
||||
|
||||
$this->default_filters['module_group'] = true;
|
||||
$this->default_filters['group'] = true;
|
||||
$this->default_filters['status'] = true;
|
||||
$this->default_filters['free_search'] = true;
|
||||
$this->default_filters['tag'] = true;
|
||||
|
||||
$this->free_search = $system->getRequest('free_search', '');
|
||||
if ($this->free_search != '') {
|
||||
$this->default = false;
|
||||
$this->default_filters['free_search'] = false;
|
||||
}
|
||||
|
||||
$this->status = $system->getRequest('status', __('Status'));
|
||||
if (($this->status === __('Status')) || ((int) $this->status === AGENT_MODULE_STATUS_ALL)) {
|
||||
$this->status = AGENT_MODULE_STATUS_ALL;
|
||||
} else {
|
||||
$this->default = false;
|
||||
$this->default_filters['status'] = false;
|
||||
}
|
||||
|
||||
$this->group = (int) $system->getRequest('group', __('Group'));
|
||||
if (!$user->isInGroup($this->acl, $this->group)) {
|
||||
$this->group = 0;
|
||||
}
|
||||
|
||||
if (($this->group === __('Group')) || ($this->group == 0)) {
|
||||
$this->group = 0;
|
||||
} else {
|
||||
$this->default = false;
|
||||
$this->default_filters['group'] = false;
|
||||
}
|
||||
|
||||
$this->module_group = (int) $system->getRequest('module_group', __('Module group'));
|
||||
if (($this->module_group === __('Module group')) || ($this->module_group === -1)
|
||||
|| ($this->module_group == 0)
|
||||
) {
|
||||
$this->module_group = -1;
|
||||
} else {
|
||||
$this->default = false;
|
||||
$this->module_group = (int) $this->module_group;
|
||||
$this->default_filters['module_group'] = false;
|
||||
}
|
||||
|
||||
$this->tag = (int) $system->getRequest('tag', __('Tag'));
|
||||
if (($this->tag === __('Tag')) || ($this->tag == 0)) {
|
||||
$this->tag = 0;
|
||||
} else {
|
||||
$this->default = false;
|
||||
$this->default_filters['tag'] = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function show()
|
||||
{
|
||||
if (!$this->correct_acl) {
|
||||
$this->show_fail_acl();
|
||||
} else {
|
||||
$this->getFilters();
|
||||
$this->show_servers();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function show_fail_acl()
|
||||
{
|
||||
$error['type'] = 'onStart';
|
||||
$error['title_text'] = __('You don\'t have access to this page');
|
||||
$error['content_text'] = System::getDefaultACLFailText();
|
||||
if (class_exists('HomeEnterprise')) {
|
||||
$home = new HomeEnterprise();
|
||||
} else {
|
||||
$home = new Home();
|
||||
}
|
||||
|
||||
$home->show($error);
|
||||
}
|
||||
|
||||
|
||||
private function show_servers()
|
||||
{
|
||||
$ui = Ui::getInstance();
|
||||
|
||||
$ui->createPage();
|
||||
$ui->createDefaultHeader(
|
||||
__('Server status'),
|
||||
$ui->createHeaderButton(
|
||||
[
|
||||
'icon' => 'ui-icon-back',
|
||||
'pos' => 'left',
|
||||
'text' => __('Back'),
|
||||
'href' => 'index.php?page=home',
|
||||
'class' => 'header-button-left',
|
||||
]
|
||||
)
|
||||
);
|
||||
$ui->showFooter(false);
|
||||
$ui->beginContent();
|
||||
$this->listServersHtml();
|
||||
$ui->endContent();
|
||||
$ui->showPage();
|
||||
}
|
||||
|
||||
|
||||
private function getListServers($page=0, $ajax=false)
|
||||
{
|
||||
global $config;
|
||||
$system = System::getInstance();
|
||||
$user = User::getInstance();
|
||||
|
||||
$total = 0;
|
||||
$servers = [];
|
||||
$servers_db = [];
|
||||
|
||||
if ($this->all_servers === true) {
|
||||
$sql_limit = ' LIMIT '.(int) ($page * $system->getPageSize()).','.(int) $system->getPageSize();
|
||||
}
|
||||
|
||||
if ($system->getConfig('metaconsole')) {
|
||||
$servers_info = servers_get_info();
|
||||
$total = (int) count(servers_get_info());
|
||||
|
||||
foreach ($servers_info as $server_value) {
|
||||
$image_status = ui_print_status_image(STATUS_SERVER_OK, '', true);
|
||||
if ($server_value['status'] == -1) {
|
||||
$image_status = ui_print_status_image(
|
||||
STATUS_SERVER_CRASH,
|
||||
__('Server has crashed.'),
|
||||
true
|
||||
);
|
||||
} else if ($server_value['status'] == 0) {
|
||||
$image_status = ui_print_status_image(
|
||||
STATUS_SERVER_DOWN,
|
||||
__('Server is stopped.'),
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
// $row[__('Status')] = '<span class="data">'.$server_value['status'].'</span>';
|
||||
$row[__('Status')] = '<span class="data">'.$image_status.'</span>';
|
||||
$row[__('Image')] = '<span class="data">'.$server_value['img'].'</span>';
|
||||
$row[__('Name')] = '<span class="data">'.$server_value['name'].'</span>';
|
||||
|
||||
$servers[$server_value['id_server'].'-'.$server_value['name']] = $row;
|
||||
}
|
||||
|
||||
$meta_servers = metaconsole_get_servers();
|
||||
|
||||
if ($meta_servers === false) {
|
||||
$meta_servers = [];
|
||||
}
|
||||
|
||||
foreach ($meta_servers as $server) {
|
||||
if (metaconsole_connect($server) != NOERR) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$servers_info = servers_get_info();
|
||||
$total += (int) count(servers_get_info());
|
||||
|
||||
foreach ($servers_info as $server_value) {
|
||||
$image_status = ui_print_status_image(STATUS_SERVER_OK, '', true);
|
||||
if ($server_value['status'] == -1) {
|
||||
$image_status = ui_print_status_image(
|
||||
STATUS_SERVER_CRASH,
|
||||
__('Server has crashed.'),
|
||||
true
|
||||
);
|
||||
} else if ($server_value['status'] == 0) {
|
||||
$image_status = ui_print_status_image(
|
||||
STATUS_SERVER_DOWN,
|
||||
__('Server is stopped.'),
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
// $row[__('Status')] = '<span class="data">'.$server_value['status'].'</span>';
|
||||
$row[__('Status')] = '<span class="data">'.$image_status.'</span>';
|
||||
$row[__('Image')] = '<span class="data">'.$server_value['img'].'</span>';
|
||||
$row[__('Name')] = '<span class="data">'.$server_value['name'].'</span>';
|
||||
|
||||
$servers[$server_value['id_server']] = $row;
|
||||
}
|
||||
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
} else {
|
||||
$servers_info = servers_get_info(-1, $sql_limit);
|
||||
$total = count(servers_get_info());
|
||||
|
||||
foreach ($servers_info as $server_value) {
|
||||
$image_status = ui_print_status_image(STATUS_SERVER_OK, '', true);
|
||||
if ($server_value['status'] == -1) {
|
||||
$image_status = ui_print_status_image(
|
||||
STATUS_SERVER_CRASH,
|
||||
__('Server has crashed.'),
|
||||
true
|
||||
);
|
||||
} else if ($server_value['status'] == 0) {
|
||||
$image_status = ui_print_status_image(
|
||||
STATUS_SERVER_DOWN,
|
||||
__('Server is stopped.'),
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
// $row[__('Status')] = '<span class="data">'.$server_value['status'].'</span>';
|
||||
$row[__('Status')] = '<span class="data">'.$image_status.'</span>';
|
||||
$row[__('Image')] = '<span class="data">'.$server_value['img'].'</span>';
|
||||
$row[__('Name')] = '<span class="data">'.$server_value['name'].'</span>';
|
||||
|
||||
$servers[$server_value['id_server']] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
'servers' => $servers,
|
||||
'total' => $total,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function listServersHtml($page=0, $return=false)
|
||||
{
|
||||
$system = System::getInstance();
|
||||
$ui = Ui::getInstance();
|
||||
|
||||
$listServers = $this->getListServers($page);
|
||||
if ($listServers['total'] == 0) {
|
||||
$html = '<p class="no-data">'.__('No servers').'</p>';
|
||||
if (!$return) {
|
||||
$ui->contentAddHtml($html);
|
||||
} else {
|
||||
return $html;
|
||||
}
|
||||
} else {
|
||||
if (!$return) {
|
||||
$table = new Table();
|
||||
$table->id = 'list_servers';
|
||||
$table->importFromHash($listServers['servers']);
|
||||
|
||||
$ui->contentAddHtml('<div class="white-card">');
|
||||
$ui->contentAddHtml($table->getHTML());
|
||||
|
||||
if ($this->all_servers === true) {
|
||||
if ($system->getPageSize() < $listServers['total']) {
|
||||
$ui->contentAddHtml(
|
||||
'<br><div id="loading_rows">'.html_print_image('images/spinner.gif', true, false, false, false, false, true).' '.__('Loading...').'</div>'
|
||||
);
|
||||
|
||||
$this->addJavascriptAddBottom();
|
||||
}
|
||||
}
|
||||
|
||||
$ui->contentAddHtml('</div>');
|
||||
} else {
|
||||
$table = new Table();
|
||||
$table->id = 'list_servers_status';
|
||||
|
||||
$table->importFromHash($listServers['servers']);
|
||||
|
||||
$html = $table->getHTML();
|
||||
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
|
||||
$ui->contentAddLinkListener('list_servers');
|
||||
}
|
||||
|
||||
|
||||
private function addJavascriptAddBottom()
|
||||
{
|
||||
$ui = Ui::getInstance();
|
||||
|
||||
$ui->contentAddHtml(
|
||||
"<script type=\"text/javascript\">
|
||||
var load_more_rows = 1;
|
||||
var page = 1;
|
||||
|
||||
function custom_scroll() {
|
||||
if (load_more_rows) {
|
||||
if ($(this).scrollTop() + $(this).height()
|
||||
>= ($(document).height() - 100)) {
|
||||
load_more_rows = 0;
|
||||
|
||||
postvars = {};
|
||||
postvars[\"action\"] = \"ajax\";
|
||||
postvars[\"parameter1\"] = \"server_status\";
|
||||
postvars[\"parameter2\"] = \"get_server_status\";
|
||||
postvars[\"page\"] = page;
|
||||
page++;
|
||||
|
||||
$.post(
|
||||
\"index.php\",
|
||||
postvars,
|
||||
function (data) {
|
||||
if (data.end) {
|
||||
$(\"#loading_rows\").hide();
|
||||
}
|
||||
else {
|
||||
$.each(data.servers, function(key, server) {;
|
||||
$(\"table#list_servers tbody\").append(\"<tr>\" +
|
||||
\"<td class='cell_0'><b class='ui-table-cell-label'>".__('Status')."</b>\" + server['Status'] + \"</td>\" +
|
||||
\"<td class='cell_1'><b class='ui-table-cell-label'>".__('Image')."</b>\" + server['Image'] + \"</td>\" +
|
||||
\"<td class='cell_2'><b class='ui-table-cell-label'>".__('Name')."</b>\" + server['Name'] + \"</td>\" +
|
||||
\"</tr>\");
|
||||
});
|
||||
|
||||
load_more_rows = 1;
|
||||
refresh_link_listener_list_servers()
|
||||
}
|
||||
},
|
||||
\"json\");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let intervalId;
|
||||
let count = 0;
|
||||
function getFreeSpace() {
|
||||
let headerHeight = $('div[data-role=\"header\"].ui-header').outerHeight();
|
||||
let contentHeight = $('div[data-role=\"content\"].ui-content').outerHeight();
|
||||
let windowHeight = $(window).height();
|
||||
|
||||
let freeSpace = windowHeight - (headerHeight + contentHeight);
|
||||
|
||||
if (freeSpace > 0 && count < 50) {
|
||||
custom_scroll();
|
||||
} else {
|
||||
clearInterval(intervalId);
|
||||
}
|
||||
|
||||
count++;
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
intervalId = setInterval(getFreeSpace, 500);
|
||||
|
||||
$(window).bind(\"scroll\", function () {
|
||||
custom_scroll();
|
||||
});
|
||||
|
||||
$(window).on(\"touchmove\", function(event) {
|
||||
custom_scroll();
|
||||
});
|
||||
|
||||
window.addEventListener('DOMContentLoaded', (event) => {
|
||||
document.querySelector('table#list_servers span.data a').href = '#';
|
||||
});
|
||||
});
|
||||
</script>"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
private function filterServersGetString()
|
||||
{
|
||||
if ($this->default) {
|
||||
return __('(Default)');
|
||||
} else {
|
||||
$filters_to_serialize = [];
|
||||
|
||||
if (!$this->default_filters['group']) {
|
||||
$filters_to_serialize[] = sprintf(
|
||||
__('Group: %s'),
|
||||
groups_get_name($this->group, true)
|
||||
);
|
||||
}
|
||||
|
||||
if (!$this->default_filters['module_group']) {
|
||||
$module_group = db_get_value(
|
||||
'name',
|
||||
'tmodule_group',
|
||||
'id_mg',
|
||||
$this->module_group
|
||||
);
|
||||
$module_group = io_safe_output($module_group);
|
||||
|
||||
$filters_to_serialize[] = sprintf(
|
||||
__('Module group: %s'),
|
||||
$module_group
|
||||
);
|
||||
}
|
||||
|
||||
if (!$this->default_filters['status']) {
|
||||
$filters_to_serialize[] = sprintf(
|
||||
__('Status: %s'),
|
||||
$this->list_status[$this->status]
|
||||
);
|
||||
}
|
||||
|
||||
if (!$this->default_filters['free_search']) {
|
||||
$filters_to_serialize[] = sprintf(
|
||||
__('Free Search: %s'),
|
||||
$this->free_search
|
||||
);
|
||||
}
|
||||
|
||||
if (!$this->default_filters['tag']) {
|
||||
$tag_name = tags_get_name($this->tag);
|
||||
$filters_to_serialize[] = sprintf(
|
||||
__('Tag: %s'),
|
||||
$tag_name
|
||||
);
|
||||
}
|
||||
|
||||
$string = '('.implode(' - ', $filters_to_serialize).')';
|
||||
|
||||
return $string;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,541 @@
|
|||
<?php
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation for version 2.
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
use PandoraFMS\Enterprise\Service;
|
||||
|
||||
require_once '../include/functions_users.php';
|
||||
enterprise_include_once('meta/include/functions_ui_meta.php');
|
||||
require_once '../include/functions_groupview.php';
|
||||
|
||||
class Services
|
||||
{
|
||||
|
||||
private $correct_acl = false;
|
||||
|
||||
private $enterprise = false;
|
||||
|
||||
private $acl = 'AR';
|
||||
|
||||
private $services = [];
|
||||
|
||||
private $idTable = '';
|
||||
|
||||
private $serviceId = '';
|
||||
|
||||
private $rows = [];
|
||||
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$system = System::getInstance();
|
||||
|
||||
if ($system->checkACL($this->acl)) {
|
||||
$this->correct_acl = true;
|
||||
|
||||
$this->services = enterprise_hook('services_get_services');
|
||||
} else {
|
||||
$this->correct_acl = false;
|
||||
}
|
||||
|
||||
if ($system->checkEnterprise() === false) {
|
||||
$this->show_fail_enterprise();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function show()
|
||||
{
|
||||
if (!$this->correct_acl) {
|
||||
$this->show_fail_acl();
|
||||
} else {
|
||||
$this->show_services();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function show_fail_acl()
|
||||
{
|
||||
$error['type'] = 'onStart';
|
||||
$error['title_text'] = __('You don\'t have access to this page');
|
||||
$error['content_text'] = System::getDefaultACLFailText();
|
||||
if (class_exists('HomeEnterprise')) {
|
||||
$home = new HomeEnterprise();
|
||||
} else {
|
||||
$home = new Home();
|
||||
}
|
||||
|
||||
$home->show($error);
|
||||
}
|
||||
|
||||
|
||||
private function show_fail_enterprise()
|
||||
{
|
||||
$error['type'] = 'onStart';
|
||||
$error['title_text'] = __('You don\'t have access to this page');
|
||||
$error['content_text'] = System::getDefaultLicenseFailText();
|
||||
if (class_exists('HomeEnterprise')) {
|
||||
$home = new HomeEnterprise();
|
||||
} else {
|
||||
$home = new Home();
|
||||
}
|
||||
|
||||
$home->show($error);
|
||||
}
|
||||
|
||||
|
||||
public function ajax($parameter2=false)
|
||||
{
|
||||
$system = System::getInstance();
|
||||
|
||||
if (!$this->correct_acl) {
|
||||
return;
|
||||
} else {
|
||||
switch ($parameter2) {
|
||||
case 'get_services':
|
||||
$this->serviceId = $system->getRequest('service_id', 0);
|
||||
$rows = $this->getListServices();
|
||||
|
||||
$this->rows = $rows;
|
||||
$table = $this->getTable();
|
||||
|
||||
echo $table;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function show_services()
|
||||
{
|
||||
$ui = Ui::getInstance();
|
||||
|
||||
$ui->createPage();
|
||||
$ui->createDefaultHeader(
|
||||
__('Services'),
|
||||
$ui->createHeaderButton(
|
||||
[
|
||||
'icon' => 'ui-icon-back',
|
||||
'pos' => 'left',
|
||||
'text' => __('Back'),
|
||||
'href' => 'index.php?page=home',
|
||||
'class' => 'header-button-left',
|
||||
]
|
||||
)
|
||||
);
|
||||
$ui->showFooter(false);
|
||||
$ui->beginContent();
|
||||
|
||||
if (empty($this->services)) {
|
||||
$ui->contentAddHtml(
|
||||
'<span class="no-data">'.__('No services found').'</span>'
|
||||
);
|
||||
}
|
||||
|
||||
$ui->contentAddHtml('<div class="list_services" data-role="collapsible-set" data-theme="a" data-content-theme="d">');
|
||||
$count = 0;
|
||||
$url_agent = 'index.php?page=agents&group=%s&status=%s';
|
||||
$url_modules = 'index.php?page=modules&group=%s&status=%s';
|
||||
|
||||
foreach ($this->services as $service) {
|
||||
switch ($service['status']) {
|
||||
case SERVICE_STATUS_NORMAL:
|
||||
$color = COL_NORMAL;
|
||||
break;
|
||||
|
||||
case SERVICE_STATUS_CRITICAL:
|
||||
$color = COL_CRITICAL;
|
||||
break;
|
||||
|
||||
case SERVICE_STATUS_WARNING:
|
||||
$color = COL_WARNING;
|
||||
break;
|
||||
|
||||
case SERVICE_STATUS_UNKNOWN:
|
||||
default:
|
||||
$color = COL_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
|
||||
$group_icon = ui_print_group_icon($service['id_group'], true, '../images/groups_small_white', '', false);
|
||||
|
||||
$ui->contentAddHtml(
|
||||
'
|
||||
<style type="text/css">
|
||||
.ui-icon-group_'.$count.' {
|
||||
background-color: '.$color.' !important;
|
||||
}
|
||||
</style>
|
||||
'
|
||||
);
|
||||
$ui->contentAddHtml('<div class="border-collapsible" data-collapsed-icon="group_'.$count.'" data-expanded-icon="group_'.$count.'" data-iconpos="right" data-role="collapsible" data-collapsed="true" data-content-theme="d">');
|
||||
$arrow = '<span class="ui-icon ui-icon-arrow-d"></span>';
|
||||
$ui->contentAddHtml('<h4 id="service-'.$service['id'].'" onclick="loadTable(\''.$service['id'].'\')">'.$arrow.$group_icon.' '.$service['name'].'</h4>');
|
||||
|
||||
$spinner = '
|
||||
<div class="spinner mt15px" id="spinner-'.$service['id'].'">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</div>
|
||||
';
|
||||
|
||||
$ui->contentAddHtml($spinner);
|
||||
$ui->contentAddHtml('</div>');
|
||||
|
||||
$count++;
|
||||
}
|
||||
|
||||
$ui->contentAddHtml('</div>');
|
||||
$this->addJavascriptAddBottom();
|
||||
|
||||
$ui->endContent();
|
||||
$ui->showPage();
|
||||
}
|
||||
|
||||
|
||||
public function getListServices()
|
||||
{
|
||||
$ui = Ui::getInstance();
|
||||
$this->idTable = 'service-table-'.$this->serviceId;
|
||||
$rows = [];
|
||||
|
||||
$elements_list = new Service($this->serviceId);
|
||||
$elements = $elements_list->getElements(true);
|
||||
|
||||
if (empty($elements) === false) {
|
||||
foreach ($elements as $item) {
|
||||
$name = '';
|
||||
// Icon.
|
||||
switch ($item->type()) {
|
||||
case SERVICE_ELEMENT_AGENT:
|
||||
$element_icon = html_print_image(
|
||||
'images/agents@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Agent'),
|
||||
'class' => 'main_menu_icon',
|
||||
]
|
||||
);
|
||||
|
||||
if ($item->exists() !== true) {
|
||||
$name .= '<strong class="no-data">'.__('Nonexistent. This element should be deleted').'</strong>';
|
||||
} else {
|
||||
$url = ui_get_full_url('mobile/index.php?page=agent&id='.$item->agent()->id_agente());
|
||||
$name = '<a href="'.$url.'">';
|
||||
if (((bool) $item->agent()->disabled()) === true) {
|
||||
$disabled_element = true;
|
||||
if (is_metaconsole() === true) {
|
||||
$name .= '<em class="grey_disabled">';
|
||||
} else {
|
||||
$name .= '<em class="disabled_module">';
|
||||
}
|
||||
}
|
||||
|
||||
if (is_metaconsole()
|
||||
&& ((int) $item->id_server_meta()) !== 0
|
||||
) {
|
||||
$name .= $item->nodeName().' » ';
|
||||
}
|
||||
|
||||
$name .= $item->agent()->alias();
|
||||
$name .= '</a>';
|
||||
|
||||
if (((bool) $item->agent()->disabled()) === true) {
|
||||
$name .= ui_print_help_tip(
|
||||
__('This element does not affect service weigth because is disabled.'),
|
||||
true
|
||||
).'</em>';
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case SERVICE_ELEMENT_SERVICE:
|
||||
$element_icon = html_print_image(
|
||||
'images/item-service.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Service'),
|
||||
'class' => 'main_menu_icon',
|
||||
]
|
||||
);
|
||||
if ($item->exists() !== true) {
|
||||
$name .= '<strong class="no-data">'.__('Nonexistent. This element should be deleted').'</strong>';
|
||||
} else {
|
||||
if (is_metaconsole()
|
||||
&& (((int) $item->id_server_meta()) !== 0 )
|
||||
) {
|
||||
$server = db_get_row(
|
||||
'tmetaconsole_setup',
|
||||
'id',
|
||||
$item->id_server_meta()
|
||||
);
|
||||
|
||||
$url = ui_meta_get_url_console_child(
|
||||
$server,
|
||||
'estado',
|
||||
'enterprise/operation/services/services',
|
||||
[
|
||||
'tab' => 'service',
|
||||
'action' => 'view',
|
||||
'id_service' => $item->id_service_child(),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$url = ui_get_full_url(
|
||||
'index.php?sec=network&sec2=enterprise/operation/services/services&tab=service&action=view&id_service='.$item->id_service_child()
|
||||
);
|
||||
}
|
||||
|
||||
// $name = '<a target="_blank" href="'.$url.'">';
|
||||
$name = '';
|
||||
if (((bool) $item->service()->disabled()) === true) {
|
||||
$disabled_element = true;
|
||||
if (is_metaconsole() === true) {
|
||||
$name .= '<em class="grey_disabled">';
|
||||
} else {
|
||||
$name .= '<em class="disabled_module">';
|
||||
}
|
||||
}
|
||||
|
||||
if (is_metaconsole()
|
||||
&& ((int) $item->id_server_meta()) !== 0
|
||||
) {
|
||||
$name .= $item->nodeName().' » ';
|
||||
}
|
||||
|
||||
$name .= $item->service()->name();
|
||||
// $name .= '</a>';
|
||||
if (((bool) $item->service()->disabled()) === true) {
|
||||
$name .= ui_print_help_tip(
|
||||
__('This element does not affect service weigth because is disabled.'),
|
||||
true
|
||||
).'</em>';
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case SERVICE_ELEMENT_MODULE:
|
||||
$element_icon = html_print_image(
|
||||
'images/modules@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Module'),
|
||||
'class' => 'main_menu_icon',
|
||||
]
|
||||
);
|
||||
|
||||
if ($item->exists() !== true) {
|
||||
$name .= '<strong class="no-data">'.__('Nonexistent. This element should be deleted').'</strong>';
|
||||
} else {
|
||||
$url = ui_get_full_url('mobile/index.php?page=agent&id='.$item->agent()->id_agente());
|
||||
$name = '<a href="'.$url.'">';
|
||||
|
||||
if (((bool) $item->module()->disabled()) === true) {
|
||||
$disabled_element = true;
|
||||
if (is_metaconsole()) {
|
||||
$name .= '<em class="grey_disabled">';
|
||||
} else {
|
||||
$name .= '<em class="disabled_module">';
|
||||
}
|
||||
}
|
||||
|
||||
if (is_metaconsole()
|
||||
&& ((int) $item->id_server_meta()) !== 0
|
||||
) {
|
||||
$name .= $item->nodeName().' » ';
|
||||
}
|
||||
|
||||
$name .= $item->module()->agent()->alias();
|
||||
$name .= ' » '.$item->module()->nombre();
|
||||
|
||||
if (((bool) $item->module()->disabled()) === true) {
|
||||
$name .= ui_print_help_tip(
|
||||
__('This element does not affect service weigth because is disabled.'),
|
||||
true
|
||||
).'</em>';
|
||||
}
|
||||
|
||||
$name .= '</a>';
|
||||
}
|
||||
break;
|
||||
|
||||
case SERVICE_ELEMENT_DYNAMIC:
|
||||
$element_icon = html_print_image(
|
||||
'images/modules-group@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Dynamic element'),
|
||||
'class' => 'main_menu_icon',
|
||||
]
|
||||
);
|
||||
|
||||
try {
|
||||
if (empty($item->getMatches(true)) === true) {
|
||||
ui_print_warning_message(
|
||||
__(
|
||||
'Dynamic element (%d) \'%s\' does not match any target',
|
||||
$item->id(),
|
||||
$item->description()
|
||||
)
|
||||
);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
ui_print_warning_message(
|
||||
__(
|
||||
'Dynamic element (%d) \'%s\' causes an error: %s',
|
||||
$item->id(),
|
||||
$item->description(),
|
||||
$e->getMessage()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ($item->rules()->dynamic_type === 'agent') {
|
||||
$name = '<i>'.__(
|
||||
'agents like "%s"',
|
||||
$item->rules()->agent_name
|
||||
).'</i>';
|
||||
} else if ($item->rules()->dynamic_type === 'module') {
|
||||
$name = '<i>'.__(
|
||||
'modules like "%s"',
|
||||
$item->rules()->module_name
|
||||
).'</i>';
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
$element_icon = '';
|
||||
break;
|
||||
}
|
||||
|
||||
// Status.
|
||||
switch ($item->lastStatus(true)) {
|
||||
case SERVICE_STATUS_NORMAL:
|
||||
case AGENT_STATUS_NORMAL:
|
||||
case AGENT_MODULE_STATUS_NORMAL:
|
||||
$status_element = STATUS_MODULE_OK;
|
||||
$title_element = __('NORMAL');
|
||||
break;
|
||||
|
||||
case SERVICE_STATUS_CRITICAL:
|
||||
case AGENT_MODULE_STATUS_CRITICAL_ALERT:
|
||||
case AGENT_MODULE_STATUS_CRITICAL_BAD:
|
||||
case AGENT_STATUS_CRITICAL:
|
||||
$status_element = STATUS_MODULE_CRITICAL;
|
||||
$title_element = __('CRITICAL');
|
||||
break;
|
||||
|
||||
case SERVICE_STATUS_WARNING:
|
||||
case AGENT_MODULE_STATUS_WARNING:
|
||||
case AGENT_MODULE_STATUS_WARNING_ALERT:
|
||||
case AGENT_STATUS_WARNING:
|
||||
$status_element = STATUS_MODULE_WARNING;
|
||||
$title_element = __('WARNING');
|
||||
break;
|
||||
|
||||
case SERVICE_STATUS_ALERT:
|
||||
case AGENT_MODULE_STATUS_NOT_INIT:
|
||||
case AGENT_STATUS_NOT_INIT:
|
||||
$status_element = STATUS_MODULE_NO_DATA;
|
||||
$title_element = __('NOT INITIALIZED');
|
||||
break;
|
||||
|
||||
case AGENT_MODULE_STATUS_UNKNOWN:
|
||||
case SERVICE_STATUS_UNKNOWN:
|
||||
case AGENT_STATUS_UNKNOWN:
|
||||
default:
|
||||
$status_element = STATUS_MODULE_UNKNOWN;
|
||||
$title_element = __('UNKNOWN');
|
||||
break;
|
||||
}
|
||||
|
||||
$row = [];
|
||||
$row[0] = $element_icon;
|
||||
$row[1] = $name;
|
||||
$row[2] = ui_print_status_image($status_element, $title_element, true);
|
||||
|
||||
array_push($rows, $row);
|
||||
}
|
||||
}
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
|
||||
public function getTable()
|
||||
{
|
||||
$html = '';
|
||||
|
||||
$html = "<table data-role='table' id=service-table-".$this->serviceId."' data-mode='reflow' class='ui-responsive table-stroke'>";
|
||||
|
||||
// $html .= '<thead>';
|
||||
// $html .= '<tr>';
|
||||
// $html .= '<th class="head_horizontal">'.__('Type').'</th>';
|
||||
// $html .= '<th class="head_horizontal">'.__('Name').'</th>';
|
||||
// $html .= '<th class="head_horizontal">'.__('Status').'</th>';
|
||||
// $html .= '</tr>';
|
||||
// $html .= '</thead>';
|
||||
$html .= '<tbody>';
|
||||
foreach ($this->rows as $key => $row) {
|
||||
$html .= "<tr class=''>";
|
||||
|
||||
foreach ($row as $key_cell => $cell) {
|
||||
$html .= "<td class='cell_".$key_cell."'>".$cell.'</td>';
|
||||
}
|
||||
|
||||
$html .= '</tr>';
|
||||
}
|
||||
|
||||
$html .= '</tbody>';
|
||||
$html .= '</table>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
||||
private function addJavascriptAddBottom()
|
||||
{
|
||||
$ui = Ui::getInstance();
|
||||
|
||||
$ui->contentAddHtml(
|
||||
"<script type=\"text/javascript\">
|
||||
function loadTable(id) {
|
||||
|
||||
postvars = {};
|
||||
postvars[\"action\"] = \"ajax\";
|
||||
postvars[\"parameter1\"] = \"services\";
|
||||
postvars[\"parameter2\"] = \"get_services\";
|
||||
postvars[\"service_id\"] = id;
|
||||
|
||||
$.post(
|
||||
\"index.php\",
|
||||
postvars,
|
||||
function (data) {
|
||||
$('h4#service-'+id+' + div.ui-collapsible-content').html(data);
|
||||
},
|
||||
\"html\");
|
||||
|
||||
var arrow = document.querySelector('h4#service-'+id+' > a > span.ui-icon.ui-icon-arrow-d');
|
||||
|
||||
if (arrow.style.transform == 'rotate(180deg)') {
|
||||
arrow.style.transform = '';
|
||||
} else {
|
||||
arrow.style.transform = 'rotate(180deg)';
|
||||
}
|
||||
}
|
||||
</script>"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -164,8 +164,8 @@ class Tactical
|
|||
|
||||
$data['mobile'] = true;
|
||||
|
||||
$formatted_data = reporting_get_stats_indicators($data, 100, 10, false);
|
||||
$formatted_data_untiny = reporting_get_stats_indicators($data, 140, 15, false);
|
||||
$formatted_data = reporting_get_stats_indicators_mobile($data, 100, 10, false);
|
||||
$formatted_data_untiny = reporting_get_stats_indicators_mobile($data, 140, 15, false);
|
||||
|
||||
$overview = '<table class="tactical_bars">
|
||||
<tr>
|
||||
|
@ -193,8 +193,8 @@ class Tactical
|
|||
$agents_monitors = reporting_get_stats_agents_monitors($data);
|
||||
$alerts_stats = reporting_get_stats_alerts($data);
|
||||
|
||||
$overview .= "<br />\n".$agents_monitors;
|
||||
$overview .= "<br />\n".$alerts_stats;
|
||||
$overview .= "<div class='hr'></div>\n".$agents_monitors;
|
||||
$overview .= "<div class='hr'></div>\n".$alerts_stats;
|
||||
|
||||
$ui->contentGridAddCell($overview, 'tactical1');
|
||||
|
||||
|
@ -216,6 +216,7 @@ class Tactical
|
|||
$ui->contentBeginCollapsible(__('Last activity'));
|
||||
|
||||
$table = new Table();
|
||||
$table->id = 'last-activity';
|
||||
$table->importFromHash($this->getLastActivity());
|
||||
$ui->contentCollapsibleAddItem($table->getHTML());
|
||||
$ui->contentEndCollapsible();
|
||||
|
@ -236,7 +237,7 @@ class Tactical
|
|||
}
|
||||
|
||||
function ajax_load_status_pie() {
|
||||
$('#status_pie').html('<div class=\"center\"> ".__('Loading...')."<br /><img src=\"images/ajax-loader.gif\" /></div>');
|
||||
$('#status_pie').html('<div class=\"center\"> ".__('Loading...')."<br><img src=\"images/ajax-loader.gif\" /></div>');
|
||||
|
||||
var pie_width = $('#tactical2').width() * 0.9;
|
||||
|
||||
|
@ -346,10 +347,9 @@ class Tactical
|
|||
}
|
||||
|
||||
$data[__('Action')] = ui_print_session_action_icon($session['accion'], true);
|
||||
$data[__('User')] = $session_id_usuario;
|
||||
$data[__('Date')] = human_time_comparation($session['utimestamp'], 'tiny');
|
||||
$data[__('Source IP')] = $session_ip_origen;
|
||||
$data[__('Description')] = io_safe_output($session['descripcion']);
|
||||
$data[__('User')] = $session_id_usuario.' - '.ui_print_truncate_text(io_safe_output($session['descripcion']), 40, false);
|
||||
$data[__('Date')] = '<span class="muted">'.human_time_comparation($session['utimestamp'], 'tiny').'</span>';
|
||||
$data[__('Source IP')] = '<span class="muted">'.$session_ip_origen.'</span>';
|
||||
|
||||
$return[] = $data;
|
||||
}
|
||||
|
|
|
@ -241,7 +241,7 @@ class Visualmaps
|
|||
'pos' => 'right',
|
||||
'text' => __('All visual consoles'),
|
||||
'href' => 'index.php?page=visualmaps&favourite=0',
|
||||
'class' => '',
|
||||
'class' => 'visual-console-button',
|
||||
]
|
||||
)
|
||||
);
|
||||
|
@ -253,14 +253,16 @@ class Visualmaps
|
|||
'pos' => 'right',
|
||||
'text' => __('Favourite visual consoles'),
|
||||
'href' => 'index.php?page=visualmaps&favourite=1',
|
||||
'class' => '',
|
||||
'class' => 'visual-console-button',
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$ui->contentAddHtml('<div class="hr-full"></div>');
|
||||
|
||||
if (empty($visualmaps) === true) {
|
||||
$ui->contentAddHtml('<p style="color: #ff0000;">'.__('No maps defined').'</p>');
|
||||
$ui->contentAddHtml('<p class="no-data">'.__('There are no favorite maps to show').'</p>');
|
||||
} else {
|
||||
$table = new Table();
|
||||
// Without header jquery.mobile crashes.
|
||||
|
@ -282,7 +284,9 @@ class Visualmaps
|
|||
$table->addRow([ $map['id'].' flex-center' => $row]);
|
||||
}
|
||||
|
||||
$ui->contentAddHtml('<div class="white-card p-tb-0px p-lr-0px">');
|
||||
$ui->contentAddHtml($table->getHTML());
|
||||
$ui->contentAddHtml('</div>');
|
||||
$ui->contentAddLinkListener('list_visualmaps');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -752,18 +752,7 @@ if (empty($network_interfaces) === false) {
|
|||
$table_interface->class = 'info_table';
|
||||
$table_interface->width = '100%';
|
||||
$table_interface->style = [];
|
||||
$table_interface->style['interface_status'] = 'width: 30px;padding-top:0px;padding-bottom:0px;';
|
||||
$table_interface->style['interface_graph'] = 'width: 20px;padding-top:0px;padding-bottom:0px;';
|
||||
$table_interface->style['interface_event_graph'] = 'width: 35%;padding-top:0px;padding-bottom:0px;';
|
||||
$table_interface->align['interface_event_graph'] = 'right';
|
||||
$table_interface->style['interface_event_graph'] = 'width: 3%;padding-top:0px;padding-bottom:0px;';
|
||||
$table_interface->style['interface_name'] = 'width: 30%;padding-top:0px;padding-bottom:0px;';
|
||||
$table_interface->align['interface_name'] = 'left';
|
||||
$table_interface->align['interface_ip'] = 'left';
|
||||
$table_interface->align['last_contact'] = 'left';
|
||||
$table_interface->style['last_contact'] = 'width: 20%;padding-top:0px;padding-bottom:0px;';
|
||||
$table_interface->style['interface_ip'] = 'width: 8%;padding-top:0px;padding-bottom:0px;';
|
||||
$table_interface->style['interface_mac'] = 'width: 12%;padding-top:0px;padding-bottom:0px;';
|
||||
$table_interface->style['interface_event_graph'] = 'width: 35%;';
|
||||
|
||||
$table_interface->head = [];
|
||||
$options = [
|
||||
|
@ -805,58 +794,22 @@ if (empty($network_interfaces) === false) {
|
|||
$graph_link = '';
|
||||
}
|
||||
|
||||
$events_limit = 5000;
|
||||
$user_groups = users_get_groups($config['id_user'], 'ER');
|
||||
$user_groups_ids = array_keys($user_groups);
|
||||
if (empty($user_groups) === true) {
|
||||
$groups_condition = ' 1 = 0 ';
|
||||
} else {
|
||||
$groups_condition = ' id_grupo IN ('.implode(',', $user_groups_ids).') ';
|
||||
}
|
||||
$content = [
|
||||
'id_agent_module' => $interface['status_module_id'],
|
||||
'id_group' => $id_group,
|
||||
'period' => SECONDS_1DAY,
|
||||
'time_from' => '00:00:00',
|
||||
'time_to' => '00:00:00',
|
||||
'sizeForTicks' => 250,
|
||||
'height_graph' => 40,
|
||||
[
|
||||
['id_agent_module' => $interface['status_module_id']],
|
||||
]
|
||||
];
|
||||
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === false) {
|
||||
$groups_condition .= ' AND id_grupo != 0';
|
||||
}
|
||||
|
||||
$status_condition = ' AND (estado = 0 OR estado = 1) ';
|
||||
$unixtime = (get_system_time() - SECONDS_1DAY);
|
||||
// Last hour.
|
||||
$time_condition = 'AND (utimestamp > '.$unixtime.')';
|
||||
// Tags ACLs.
|
||||
if ($id_group > 0 && in_array(0, $user_groups_ids)) {
|
||||
$group_array = (array) $id_group;
|
||||
} else {
|
||||
$group_array = $user_groups_ids;
|
||||
}
|
||||
|
||||
$acl_tags = tags_get_acl_tags(
|
||||
$config['id_user'],
|
||||
$group_array,
|
||||
'ER',
|
||||
'event_condition',
|
||||
'AND',
|
||||
'',
|
||||
true,
|
||||
[],
|
||||
true
|
||||
);
|
||||
|
||||
$id_modules_array = [];
|
||||
$id_modules_array[] = $interface['status_module_id'];
|
||||
|
||||
$unixtime = (get_system_time() - SECONDS_1DAY);
|
||||
// Last hour.
|
||||
$time_condition = 'WHERE (te.utimestamp > '.$unixtime.')';
|
||||
|
||||
$sqlEvents = sprintf(
|
||||
'SELECT *
|
||||
FROM tevento te
|
||||
INNER JOIN tagente_estado tae
|
||||
ON te.id_agentmodule = tae.id_agente_modulo
|
||||
AND tae.id_agente_modulo IN (%s)
|
||||
%s',
|
||||
implode(',', $id_modules_array),
|
||||
$time_condition
|
||||
$e_graph = \reporting_module_histogram_graph(
|
||||
['datetime' => time()],
|
||||
$content
|
||||
);
|
||||
|
||||
$sqlLast_contact = sprintf(
|
||||
|
@ -870,21 +823,6 @@ if (empty($network_interfaces) === false) {
|
|||
$last_contact = array_shift($last_contact);
|
||||
$last_contact = array_shift($last_contact);
|
||||
|
||||
$events = db_get_all_rows_sql($sqlEvents);
|
||||
$text_event_header = __('Events info (24hr.)');
|
||||
if (!$events) {
|
||||
$no_events = ['color' => ['criticity' => 2]];
|
||||
$e_graph = reporting_get_event_histogram(
|
||||
$no_events,
|
||||
$text_event_header
|
||||
);
|
||||
} else {
|
||||
$e_graph = reporting_get_event_histogram(
|
||||
$events,
|
||||
$text_event_header
|
||||
);
|
||||
}
|
||||
|
||||
$data = [];
|
||||
$data['interface_name'] = '<strong>'.$interface_name.'</strong>';
|
||||
$data['interface_status'] = $interface['status_image'];
|
||||
|
@ -892,7 +830,7 @@ if (empty($network_interfaces) === false) {
|
|||
$data['interface_ip'] = $interface['ip'];
|
||||
$data['interface_mac'] = $interface['mac'];
|
||||
$data['last_contact'] = __('Last contact: ').$last_contact;
|
||||
$data['interface_event_graph'] = $e_graph;
|
||||
$data['interface_event_graph'] = $e_graph['chart'];
|
||||
|
||||
$table_interface->data[] = $data;
|
||||
}
|
||||
|
|
|
@ -310,34 +310,24 @@ if (empty($server_id) === false) {
|
|||
$menu_form .= html_print_input_hidden('server', $server_id, true);
|
||||
}
|
||||
|
||||
$menu_form .= '<div class="module_graph_menu_dropdown mrgn_top_20px">';
|
||||
$menu_form .= '<div id="module_graph_menu_header" class="module_graph_menu_header">';
|
||||
$menu_form .= html_print_image(
|
||||
'images/arrow_down_green.png',
|
||||
true,
|
||||
[
|
||||
'class' => 'module_graph_menu_arrow',
|
||||
'float' => 'left',
|
||||
],
|
||||
false,
|
||||
false,
|
||||
true
|
||||
);
|
||||
$menu_form .= '<span style="flex: 2; justify-content:center;" class="flex-row">';
|
||||
$menu_form .= '<b>'.__('Graph configuration menu').'</b>';
|
||||
$menu_form .= ui_print_help_tip(
|
||||
__('In Pandora FMS, data is stored compressed. The data visualization in database, charts or CSV exported data won\'t match, because is interpreted at runtime. Please check \'Pandora FMS Engineering\' chapter from documentation.'),
|
||||
true
|
||||
);
|
||||
$menu_form .= '</span>';
|
||||
$menu_form .= '</div>';
|
||||
$menu_form .= '<div class="module_graph_menu_content module_graph_menu_content_closed" style="display:none;">';
|
||||
$menu_form .= $form_table;
|
||||
$menu_form .= '</div>';
|
||||
$menu_form .= '</div>';
|
||||
$menu_form .= '</form>';
|
||||
|
||||
echo $menu_form;
|
||||
ui_toggle(
|
||||
$menu_form,
|
||||
'<span class="subsection_header_title">'.__('Graph configuration menu').ui_print_help_tip(
|
||||
__('In Pandora FMS, data is stored compressed. The data visualization in database, charts or CSV exported data won\'t match, because is interpreted at runtime. Please check \'Pandora FMS Engineering\' chapter from documentation.'),
|
||||
true
|
||||
).'</span>',
|
||||
__('Graph configuration menu'),
|
||||
'update',
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
'white-box-content no_border',
|
||||
'filter-datatable-main box-flat white_table_graph fixed_filter_bar top_0px_important toggle-traffic-graph'
|
||||
);
|
||||
|
||||
|
||||
// Hidden div to forced title.
|
||||
html_print_div(
|
||||
|
|
|
@ -3047,6 +3047,11 @@ $(document).ready( function() {
|
|||
|
||||
});
|
||||
|
||||
var show_event_dialog = "<?php echo get_parameter('show_event_dialog', ''); ?>";
|
||||
if (show_event_dialog !== ''){
|
||||
show_event_dialo(show_event_dialog);
|
||||
}
|
||||
|
||||
/* Multi select handler */
|
||||
$('#checkbox-all_validate_box').on('change', function() {
|
||||
if($('#checkbox-all_validate_box').is(":checked")) {
|
||||
|
@ -3291,4 +3296,105 @@ $(document).ready(function () {
|
|||
|
||||
$('.white_table_graph_header').first().append($('.filter_summary'));
|
||||
});
|
||||
|
||||
// Show the modal window of an event
|
||||
function show_event_dialo(event, dialog_page) {
|
||||
var ajax_file = getUrlAjax();
|
||||
|
||||
var view = ``;
|
||||
|
||||
if ($("#event_details_window").length) {
|
||||
view = "#event_details_window";
|
||||
} else if ($("#sound_event_details_window").length) {
|
||||
view = "#sound_event_details_window";
|
||||
}
|
||||
|
||||
if (dialog_page == undefined) {
|
||||
dialog_page = "general";
|
||||
}
|
||||
|
||||
try {
|
||||
event = event.replaceAll(" ", "+");
|
||||
event = JSON.parse(atob(event), true);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
return;
|
||||
}
|
||||
|
||||
var inputs = $("#events_form :input");
|
||||
var values = {};
|
||||
inputs.each(function() {
|
||||
values[this.name] = $(this).val();
|
||||
});
|
||||
|
||||
// Metaconsole mode flag
|
||||
var meta = $("#hidden-meta").val();
|
||||
|
||||
// History mode flag
|
||||
var history = $("#hidden-history").val();
|
||||
|
||||
jQuery.post(
|
||||
ajax_file,
|
||||
{
|
||||
page: "include/ajax/events",
|
||||
get_extended_event: 1,
|
||||
dialog_page: dialog_page,
|
||||
event: event,
|
||||
meta: meta,
|
||||
history: history,
|
||||
filter: values
|
||||
},
|
||||
function(data) {
|
||||
$(view)
|
||||
.hide()
|
||||
.empty()
|
||||
.append(data)
|
||||
.dialog({
|
||||
title: event.evento,
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
minWidth: 875,
|
||||
minHeight: 600,
|
||||
close: function() {
|
||||
$("#refrcounter").countdown("resume");
|
||||
$("div.vc-countdown").countdown("resume");
|
||||
},
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
},
|
||||
width: 710,
|
||||
height: 650,
|
||||
autoOpen: true,
|
||||
open: function() {
|
||||
if (
|
||||
$.ui &&
|
||||
$.ui.dialog &&
|
||||
$.ui.dialog.prototype._allowInteraction
|
||||
) {
|
||||
var ui_dialog_interaction =
|
||||
$.ui.dialog.prototype._allowInteraction;
|
||||
$.ui.dialog.prototype._allowInteraction = function(e) {
|
||||
if ($(e.target).closest(".select2-dropdown").length)
|
||||
return true;
|
||||
return ui_dialog_interaction.apply(this, arguments);
|
||||
};
|
||||
}
|
||||
},
|
||||
_allowInteraction: function(event) {
|
||||
return !!$(event.target).is(".select2-input") || this._super(event);
|
||||
}
|
||||
})
|
||||
.show();
|
||||
|
||||
$("#refrcounter").countdown("pause");
|
||||
$("div.vc-countdown").countdown("pause");
|
||||
|
||||
forced_title_callback();
|
||||
},
|
||||
"html"
|
||||
);
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -160,315 +160,475 @@ if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
|
|||
}
|
||||
|
||||
echo '</head>';
|
||||
echo "<body class='sound_events'>";
|
||||
echo "<h1 class='modalheaderh1'>".__('Accoustic console').'</h1>';
|
||||
echo '<body style="overflow: hidden;">';
|
||||
echo ui_require_css_file('wizard', 'include/styles/', true);
|
||||
echo ui_require_css_file('discovery', 'include/styles/', true);
|
||||
echo ui_require_css_file('sound_events', 'include/styles/', true);
|
||||
$output = '<div id="tabs-sound-modal">';
|
||||
// Header tabs.
|
||||
$output .= '<ul class="tabs-sound-modal-options">';
|
||||
$output .= '<li>';
|
||||
$output .= '<a href="#tabs-sound-modal-1">';
|
||||
$output .= html_print_image(
|
||||
'images/gear.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Options'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
);
|
||||
$output .= '</a>';
|
||||
$output .= '</li>';
|
||||
$output .= '<li>';
|
||||
$output .= '<a href="#tabs-sound-modal-2">';
|
||||
$output .= html_print_image(
|
||||
'images/list.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Events list'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
);
|
||||
$output .= '</a>';
|
||||
$output .= '</li>';
|
||||
$output .= '</ul>';
|
||||
|
||||
// Connection lost alert.
|
||||
ui_require_css_file('register', 'include/styles/', true);
|
||||
$conn_title = __('Connection with server has been lost');
|
||||
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
|
||||
ui_require_javascript_file('connection_check');
|
||||
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
|
||||
ui_print_message_dialog(
|
||||
$conn_title,
|
||||
$conn_text,
|
||||
'connection',
|
||||
'/images/fail@svg.svg'
|
||||
);
|
||||
// Content tabs.
|
||||
$output .= '<div id="tabs-sound-modal-1">';
|
||||
$output .= '<h3 class="console-configuration">';
|
||||
$output .= __('Console configuration');
|
||||
$output .= '</h3>';
|
||||
$inputs = [];
|
||||
|
||||
$inputs = [];
|
||||
|
||||
// Load filter.
|
||||
$fields = \events_get_event_filter_select();
|
||||
$inputs[] = [
|
||||
'label' => \__('Load filter'),
|
||||
'class' => 'flex-row',
|
||||
'arguments' => [
|
||||
'type' => 'select',
|
||||
'fields' => $fields,
|
||||
'name' => 'filter_id',
|
||||
'selected' => 0,
|
||||
'return' => true,
|
||||
'nothing' => \__('All new events'),
|
||||
'nothing_value' => 0,
|
||||
'class' => 'fullwidth',
|
||||
],
|
||||
];
|
||||
|
||||
$times_interval = [
|
||||
10 => '10 '.__('seconds'),
|
||||
15 => '15 '.__('seconds'),
|
||||
30 => '30 '.__('seconds'),
|
||||
60 => '60 '.__('seconds'),
|
||||
];
|
||||
|
||||
$times_sound = [
|
||||
2 => '2 '.__('seconds'),
|
||||
5 => '5 '.__('seconds'),
|
||||
10 => '10 '.__('seconds'),
|
||||
15 => '15 '.__('seconds'),
|
||||
30 => '30 '.__('seconds'),
|
||||
60 => '60 '.__('seconds'),
|
||||
];
|
||||
|
||||
$inputs[] = [
|
||||
'class' => 'flex-row flex-row-center',
|
||||
'direct' => 1,
|
||||
'block_content' => [
|
||||
[
|
||||
'label' => __('Interval'),
|
||||
// Load filter.
|
||||
$fields = \events_get_event_filter_select();
|
||||
$inputs[] = [
|
||||
'label' => \__('Set condition'),
|
||||
'arguments' => [
|
||||
'type' => 'select',
|
||||
'fields' => $times_interval,
|
||||
'name' => 'interval',
|
||||
'selected' => 10,
|
||||
'return' => true,
|
||||
'type' => 'select',
|
||||
'fields' => $fields,
|
||||
'name' => 'filter_id',
|
||||
'selected' => 0,
|
||||
'return' => true,
|
||||
'nothing' => \__('All new events'),
|
||||
'nothing_value' => 0,
|
||||
'class' => 'fullwidth',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => __('Time Sound'),
|
||||
'arguments' => [
|
||||
'type' => 'select',
|
||||
'fields' => $times_sound,
|
||||
'name' => 'time_sound',
|
||||
'selected' => 10,
|
||||
'return' => true,
|
||||
];
|
||||
|
||||
$times_interval = [
|
||||
10 => '10 '.__('seconds'),
|
||||
15 => '15 '.__('seconds'),
|
||||
30 => '30 '.__('seconds'),
|
||||
60 => '60 '.__('seconds'),
|
||||
];
|
||||
|
||||
$times_sound = [
|
||||
2 => '2 '.__('seconds'),
|
||||
5 => '5 '.__('seconds'),
|
||||
10 => '10 '.__('seconds'),
|
||||
15 => '15 '.__('seconds'),
|
||||
30 => '30 '.__('seconds'),
|
||||
60 => '60 '.__('seconds'),
|
||||
];
|
||||
|
||||
$inputs[] = [
|
||||
'class' => 'interval-sounds',
|
||||
'direct' => 1,
|
||||
'block_content' => [
|
||||
[
|
||||
'label' => __('Interval'),
|
||||
'arguments' => [
|
||||
'type' => 'select',
|
||||
'fields' => $times_interval,
|
||||
'name' => 'interval',
|
||||
'selected' => 10,
|
||||
'return' => true,
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => __('Sound duration'),
|
||||
'arguments' => [
|
||||
'type' => 'select',
|
||||
'fields' => $times_sound,
|
||||
'name' => 'time_sound',
|
||||
'selected' => 10,
|
||||
'return' => true,
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
];
|
||||
|
||||
$sounds = [
|
||||
'aircraftalarm.wav' => 'Air craft alarm',
|
||||
'air_shock_alarm.wav' => 'Air shock alarm',
|
||||
'alien_alarm.wav' => 'Alien alarm',
|
||||
'alien_beacon.wav' => 'Alien beacon',
|
||||
'bell_school_ringing.wav' => 'Bell school ringing',
|
||||
'Door_Alarm.wav' => 'Door alarm',
|
||||
'EAS_beep.wav' => 'EAS beep',
|
||||
'Firewarner.wav' => 'Fire warner',
|
||||
'HardPCMAlarm.wav' => 'Hard PCM Alarm',
|
||||
'negativebeep.wav' => 'Negative beep',
|
||||
'Star_Trek_emergency_simulation.wav' => 'StarTrek emergency simulation',
|
||||
];
|
||||
$sounds = [
|
||||
'aircraftalarm.wav' => 'Air craft alarm',
|
||||
'air_shock_alarm.wav' => 'Air shock alarm',
|
||||
'alien_alarm.wav' => 'Alien alarm',
|
||||
'alien_beacon.wav' => 'Alien beacon',
|
||||
'bell_school_ringing.wav' => 'Bell school ringing',
|
||||
'Door_Alarm.wav' => 'Door alarm',
|
||||
'EAS_beep.wav' => 'EAS beep',
|
||||
'Firewarner.wav' => 'Fire warner',
|
||||
'HardPCMAlarm.wav' => 'Hard PCM Alarm',
|
||||
'negativebeep.wav' => 'Negative beep',
|
||||
'Star_Trek_emergency_simulation.wav' => 'StarTrek emergency simulation',
|
||||
];
|
||||
|
||||
$eventsounds = mysql_db_get_row_sql('SELECT * FROM tevent_sound WHERE active = 1');
|
||||
foreach ($eventsounds as $key => $row) {
|
||||
$sounds[$row['sound']] = $row['name'];
|
||||
}
|
||||
$eventsounds = db_get_all_rows_sql('SELECT * FROM tevent_sound WHERE active = 1');
|
||||
foreach ($eventsounds as $key => $row) {
|
||||
$sounds[$row['sound']] = $row['name'];
|
||||
}
|
||||
|
||||
$inputs[] = [
|
||||
'label' => \__('Sounds'),
|
||||
'class' => 'flex-row',
|
||||
'arguments' => [
|
||||
'type' => 'select',
|
||||
'fields' => $sounds,
|
||||
'name' => 'sound_id',
|
||||
'selected' => 'Star_Trek_emergency_simulation.wav',
|
||||
'return' => true,
|
||||
'class' => 'fullwidth',
|
||||
],
|
||||
];
|
||||
$inputs[] = [
|
||||
'class' => 'test-sounds',
|
||||
'direct' => 1,
|
||||
'block_content' => [
|
||||
[
|
||||
'label' => \__('Sound melody'),
|
||||
'arguments' => [
|
||||
'type' => 'select',
|
||||
'fields' => $sounds,
|
||||
'name' => 'sound_id',
|
||||
'selected' => 'Star_Trek_emergency_simulation.wav',
|
||||
'return' => true,
|
||||
'class' => 'fullwidth',
|
||||
],
|
||||
],
|
||||
[
|
||||
'arguments' => [
|
||||
'type' => 'button',
|
||||
'name' => 'melody_sound',
|
||||
'label' => __('Test sound'),
|
||||
'attributes' => ['icon' => 'sound'],
|
||||
'return' => true,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
// Print form.
|
||||
HTML::printForm(
|
||||
[
|
||||
'form' => [
|
||||
'action' => '',
|
||||
'method' => 'POST',
|
||||
],
|
||||
'inputs' => $inputs,
|
||||
],
|
||||
false,
|
||||
true
|
||||
);
|
||||
// Print form.
|
||||
$output .= HTML::printForm(
|
||||
[
|
||||
'form' => [
|
||||
'action' => '',
|
||||
'method' => 'POST',
|
||||
],
|
||||
'inputs' => $inputs,
|
||||
],
|
||||
true,
|
||||
false
|
||||
);
|
||||
$output .= '</div>';
|
||||
|
||||
$result = '<div><ul class="events_fired">';
|
||||
$result .= '<li class="events_fired_li_empty">';
|
||||
$result .= ui_print_info_message(__('Events not found'), '', true);
|
||||
$result .= '</li>';
|
||||
$result .= '</ul></div>';
|
||||
$output .= '<div id="tabs-sound-modal-2">';
|
||||
$output .= '<h3 class="title-discovered-alerts">';
|
||||
$output .= __('Discovered alerts');
|
||||
$output .= '</h3>';
|
||||
$output .= '<div class="empty-discovered-alerts">';
|
||||
$output .= html_print_image(
|
||||
'images/no-alerts-discovered.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('No alerts discovered'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
);
|
||||
$output .= '<span class="text-discovered-alerts">';
|
||||
$output .= __('Congrats! there’s nothing to show');
|
||||
$output .= '</span>';
|
||||
$output .= '</div>';
|
||||
$output .= '<div class="elements-discovered-alerts"><ul></ul></div>';
|
||||
$output .= html_print_input_hidden(
|
||||
'ajax_file_sound_console',
|
||||
ui_get_full_url('ajax.php', false, false, false),
|
||||
true
|
||||
);
|
||||
$output .= html_print_input_hidden(
|
||||
'meta',
|
||||
is_metaconsole(),
|
||||
true
|
||||
);
|
||||
$output .= '<div id="sound_event_details_window"></div>';
|
||||
$output .= '<div id="sound_event_response_window"></div>';
|
||||
$output .= '</div>';
|
||||
$output .= '</div>';
|
||||
|
||||
$result .= '<div id="progressbar_time"></div>';
|
||||
$output .= '<div class="actions-sound-modal">';
|
||||
$output .= '<div id="progressbar_time"></div>';
|
||||
$output .= '<div class="buttons-sound-modal mrgn_top_10px">';
|
||||
$output .= html_print_button(
|
||||
__('Start'),
|
||||
'start-search',
|
||||
false,
|
||||
'',
|
||||
[
|
||||
'icon' => 'cog',
|
||||
'class' => 'mrgn_lft_20px',
|
||||
],
|
||||
true
|
||||
);
|
||||
// $output .= html_print_submit_button(
|
||||
// [
|
||||
// 'label' => __('Start'),
|
||||
// 'type' => 'button',
|
||||
// 'name' => 'start-search',
|
||||
// 'attributes' => [ 'class' => 'play' ],
|
||||
// 'return' => true,
|
||||
// ],
|
||||
// 'div',
|
||||
// true
|
||||
// );
|
||||
$output .= '<div class="container-button-alert mrgn_right_20px">';
|
||||
$output .= html_print_input(
|
||||
[
|
||||
'type' => 'button',
|
||||
'name' => 'no-alerts',
|
||||
'label' => __('No alerts'),
|
||||
'attributes' => ['class' => 'secondary alerts'],
|
||||
'return' => true,
|
||||
],
|
||||
'div',
|
||||
true
|
||||
);
|
||||
$output .= '</div>';
|
||||
|
||||
echo $result;
|
||||
|
||||
$table = new StdClass;
|
||||
$table->width = '100%';
|
||||
$table->class = 'sound_div_background text_center';
|
||||
|
||||
$table->data[0][0] = '<a href="javascript: toggleButton();">';
|
||||
$table->data[0][0] .= html_print_image(
|
||||
'images/play.button.png',
|
||||
true,
|
||||
['id' => 'button']
|
||||
);
|
||||
$table->data[0][0] .= '</a>';
|
||||
|
||||
$table->data[0][1] = '<a href="javascript: ok();">';
|
||||
$table->data[0][1] .= html_print_image(
|
||||
'images/ok.button.png',
|
||||
true,
|
||||
['style' => 'margin-left: 15px;']
|
||||
);
|
||||
$table->data[0][1] .= '</a>';
|
||||
|
||||
$table->data[0][2] = '<a href="javascript: test_sound_button();">';
|
||||
$table->data[0][2] .= html_print_image(
|
||||
'images/icono_test.png',
|
||||
true,
|
||||
[
|
||||
'id' => 'button_try',
|
||||
'style' => 'margin-left: 15px;',
|
||||
]
|
||||
);
|
||||
$table->data[0][2] .= '</a>';
|
||||
|
||||
$table->data[0][3] = html_print_image(
|
||||
'images/tick_sound_events.png',
|
||||
true,
|
||||
[
|
||||
'id' => 'button_status',
|
||||
'style' => 'margin-left: 15px;',
|
||||
]
|
||||
);
|
||||
|
||||
html_print_table($table);
|
||||
?>
|
||||
$output .= html_print_input(
|
||||
[
|
||||
'type' => 'hidden',
|
||||
'name' => 'mode_alert',
|
||||
'value' => 0,
|
||||
'return' => true,
|
||||
],
|
||||
'div',
|
||||
true
|
||||
);
|
||||
$output .= '</div>';
|
||||
$output .= '</div>';
|
||||
echo $output;
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
var control = false;
|
||||
|
||||
var running = false;
|
||||
var id_row = 0;
|
||||
var button_play_status = "play";
|
||||
var test_sound = false;
|
||||
|
||||
function test_sound_button() {
|
||||
if (!test_sound) {
|
||||
$("#button_try").attr('src', '../../images/icono_test.png');
|
||||
var sound = '../../include/sounds/' + $('#sound_id').val();
|
||||
$('body').append("<audio src='"+sound+"' autoplay='true' hidden='true' loop='false'>");
|
||||
test_sound = true;
|
||||
function test_sound_button(test_sound, urlSound) {
|
||||
if (test_sound === true) {
|
||||
$("#button-melody_sound").addClass("blink-image");
|
||||
add_audio(urlSound);
|
||||
} else {
|
||||
$("#button_try").attr('src', '../../images/icono_test.png');
|
||||
$('body audio').remove();
|
||||
test_sound = false;
|
||||
$("#button-melody_sound").removeClass("blink-image");
|
||||
remove_audio();
|
||||
}
|
||||
}
|
||||
|
||||
function toggleButton() {
|
||||
if (button_play_status == 'pause') {
|
||||
$("#button").attr('src', '../../images/play.button.png');
|
||||
stopSound();
|
||||
control.paused();
|
||||
function action_events_sound(mode) {
|
||||
if (mode === true) {
|
||||
// Enable tabs.
|
||||
$("#tabs-sound-modal").tabs("option", "disabled", [0]);
|
||||
// Active tabs.
|
||||
$("#tabs-sound-modal").tabs("option", "active", 1);
|
||||
// Change mode.
|
||||
$("#hidden-mode_alert").val(1);
|
||||
// Change img button.
|
||||
$("#button-start-search")
|
||||
.removeClass("play")
|
||||
.addClass("stop");
|
||||
// Change value button.
|
||||
$("#button-start-search").val("Stop");
|
||||
$("#button-start-search > span").text("Stop");
|
||||
// Add Progress bar.
|
||||
listen_event_sound();
|
||||
} else {
|
||||
// Enable tabs.
|
||||
$("#tabs-sound-modal").tabs("option", "disabled", [1]);
|
||||
// Active tabs.
|
||||
$("#tabs-sound-modal").tabs("option", "active", 0);
|
||||
// Change mode.
|
||||
$("#hidden-mode_alert").val(0);
|
||||
// Change img button.
|
||||
$("#button-start-search")
|
||||
.removeClass("stop")
|
||||
.addClass("play");
|
||||
// Change value button.
|
||||
$("#button-start-search").val("Start");
|
||||
$("#button-start-search > span").text("Start");
|
||||
// Remove progress bar.
|
||||
$("#progressbar_time").empty();
|
||||
// Remove audio.
|
||||
remove_audio();
|
||||
// Clean events.
|
||||
$("#tabs-sound-modal .elements-discovered-alerts ul").empty();
|
||||
$("#tabs-sound-modal .empty-discovered-alerts").removeClass(
|
||||
"invisible_important"
|
||||
);
|
||||
// Change img button.
|
||||
$("#button-no-alerts")
|
||||
.removeClass("silence-alerts")
|
||||
.addClass("alerts");
|
||||
// Change value button.
|
||||
$("#button-no-alerts").val("No alert");
|
||||
$("#button-no-alerts > span").text("No alert");
|
||||
|
||||
button_play_status = 'play';
|
||||
}
|
||||
else {
|
||||
$("#button").attr('src', '../../images/pause.button.png');
|
||||
forgetPreviousEvents();
|
||||
startSound();
|
||||
|
||||
button_play_status = 'pause';
|
||||
// Background button.
|
||||
$(".container-button-alert").removeClass("fired");
|
||||
}
|
||||
}
|
||||
|
||||
function ok() {
|
||||
$('#button_status').attr('src','../../images/tick_sound_events.png');
|
||||
$('audio').remove();
|
||||
$('.events_fired').empty();
|
||||
function add_audio(urlSound) {
|
||||
var sound = urlSound;
|
||||
$(".actions-sound-modal").append(
|
||||
"<audio id='id_sound_event' src='" +
|
||||
sound +
|
||||
"' autoplay='true' hidden='true' loop='false'>"
|
||||
);
|
||||
}
|
||||
|
||||
function stopSound() {
|
||||
$('audio').remove();
|
||||
$('body').css('background', '#494949');
|
||||
running = false;
|
||||
function remove_audio() {
|
||||
$(".actions-sound-modal audio").remove();
|
||||
}
|
||||
|
||||
function startSound() {
|
||||
running = true;
|
||||
function listen_event_sound() {
|
||||
progressTimeBar(
|
||||
"progressbar_time",
|
||||
$("#interval").val(),
|
||||
"infinite",
|
||||
function() {
|
||||
// Search events.
|
||||
check_event_sound();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function forgetPreviousEvents() {
|
||||
if(control === false) {
|
||||
running = true;
|
||||
control = progressTimeBar(
|
||||
"progressbar_time",
|
||||
$("#interval").val(),
|
||||
'infinite',
|
||||
function() {
|
||||
check_event();
|
||||
function check_event_sound() {
|
||||
jQuery.post(
|
||||
$('#hidden-ajax_file_sound_console').val(),
|
||||
{
|
||||
page: "include/ajax/events",
|
||||
get_events_fired: 1,
|
||||
filter_id: $("#tabs-sound-modal #filter_id").val(),
|
||||
interval: $("#tabs-sound-modal #interval").val(),
|
||||
time_sound: $("#tabs-sound-modal #time_sound").val()
|
||||
},
|
||||
function(data) {
|
||||
if (data != false) {
|
||||
// Hide empty.
|
||||
$("#tabs-sound-modal .empty-discovered-alerts").addClass(
|
||||
"invisible_important"
|
||||
);
|
||||
|
||||
// Change img button.
|
||||
$("#button-no-alerts")
|
||||
.removeClass("alerts")
|
||||
.addClass("silence-alerts");
|
||||
// Change value button.
|
||||
$("#button-no-alerts").val("Silence alarm");
|
||||
$("#button-no-alerts > span").text("Silence alarm");
|
||||
|
||||
// Background button.
|
||||
$(".container-button-alert").addClass("fired");
|
||||
|
||||
// Remove audio.
|
||||
remove_audio();
|
||||
var urlSound = '../../include/sounds/'+$('#sound_id :selected').val();
|
||||
// Apend audio.
|
||||
add_audio(urlSound);
|
||||
|
||||
// Add elements.
|
||||
data.forEach(function(element) {
|
||||
var li = document.createElement("li");
|
||||
var b64 = btoa(JSON.stringify(element));
|
||||
li.insertAdjacentHTML(
|
||||
"beforeend",
|
||||
'<div class="li-priority">' + element.priority + "</div>"
|
||||
);
|
||||
li.insertAdjacentHTML(
|
||||
"beforeend",
|
||||
'<div class="li-type">' + element.type + "</div>"
|
||||
);
|
||||
li.insertAdjacentHTML(
|
||||
"beforeend",
|
||||
`<div class="li-title"><a href="javascript:" onclick="open_window_dialog('`+b64+`')">${element.message}</a></div>`
|
||||
);
|
||||
li.insertAdjacentHTML(
|
||||
"beforeend",
|
||||
'<div class="li-time">' + element.timestamp + "</div>"
|
||||
);
|
||||
$("#tabs-sound-modal .elements-discovered-alerts ul").append(li);
|
||||
});
|
||||
|
||||
// -100 delay sound.
|
||||
setTimeout(
|
||||
remove_audio,
|
||||
parseInt($("#tabs-sound-modal #time_sound").val()) * 1000 - 100
|
||||
);
|
||||
}
|
||||
);
|
||||
} else {
|
||||
control.start();
|
||||
}
|
||||
},
|
||||
"json"
|
||||
);
|
||||
}
|
||||
|
||||
function check_event() {
|
||||
if (running) {
|
||||
var sound = '../../include/sounds/' + $('#sound_id').val();
|
||||
jQuery.post ("../../ajax.php",
|
||||
{
|
||||
"page" : "include/ajax/events",
|
||||
"get_events_fired": 1,
|
||||
"filter_id": $('#filter_id').val(),
|
||||
"interval": $('#interval').val(),
|
||||
"time_sound": $('#time_sound').val(),
|
||||
},
|
||||
function (data) {
|
||||
if(data != false) {
|
||||
$('.events_fired_li_empty').remove();
|
||||
|
||||
$('#button_status')
|
||||
.attr(
|
||||
'src','../../images/sound_events_console_alert.gif'
|
||||
);
|
||||
$('audio').remove();
|
||||
|
||||
$('body')
|
||||
.append(
|
||||
"<audio id='audio-boom' src='" + sound + "' autoplay='true' hidden='true' loop='true' >"
|
||||
);
|
||||
|
||||
data.forEach(function (element) {
|
||||
var li = document.createElement('li');
|
||||
li.insertAdjacentHTML(
|
||||
'beforeend',
|
||||
'<div class="flex0">'+element.priority+'</div>'
|
||||
);
|
||||
li.insertAdjacentHTML(
|
||||
'beforeend',
|
||||
'<div class="flex0">'+element.type+'</div>'
|
||||
);
|
||||
li.insertAdjacentHTML(
|
||||
'beforeend',
|
||||
'<div class="mess">'+element.message+'</div>'
|
||||
);
|
||||
li.insertAdjacentHTML(
|
||||
'beforeend',
|
||||
'<div class="flex-time">'+element.timestamp+'</div>'
|
||||
);
|
||||
$('.events_fired').append(li);
|
||||
});
|
||||
|
||||
function removeAudio() {
|
||||
$('audio').remove();
|
||||
}
|
||||
|
||||
// -100 delay sound.
|
||||
setTimeout(
|
||||
removeAudio,
|
||||
(parseInt($('#time_sound').val()) * 1000) - 100
|
||||
);
|
||||
}
|
||||
},
|
||||
"json"
|
||||
);
|
||||
}
|
||||
function open_window_dialog(data) {
|
||||
window.open(window.location.origin+'/pandora_console/index.php?sec=eventos&sec2=operation/events/events&show_event_dialog='+data);
|
||||
//show_event_dialog(data);
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
$("#tabs-sound-modal").tabs({
|
||||
disabled: [1]
|
||||
});
|
||||
|
||||
// Test sound.
|
||||
$("#button-melody_sound").click(function() {
|
||||
var sound = false;
|
||||
if ($("#id_sound_event").length == 0) {
|
||||
sound = true;
|
||||
}
|
||||
var urlSound = '../../include/sounds/'+$('#sound_id :selected').val();
|
||||
|
||||
test_sound_button(sound, urlSound);
|
||||
});
|
||||
|
||||
// Play Stop.
|
||||
$("#button-start-search").click(function() {
|
||||
var mode = $("#hidden-mode_alert").val();
|
||||
var action = false;
|
||||
if (mode == 0) {
|
||||
action = true;
|
||||
}
|
||||
|
||||
action_events_sound(action);
|
||||
});
|
||||
|
||||
// Silence Alert.
|
||||
$("#button-no-alerts").click(function() {
|
||||
if ($("#button-no-alerts").hasClass("silence-alerts") === true) {
|
||||
// Remove audio.
|
||||
remove_audio();
|
||||
|
||||
// Clean events.
|
||||
$("#tabs-sound-modal .elements-discovered-alerts ul").empty();
|
||||
$("#tabs-sound-modal .empty-discovered-alerts").removeClass(
|
||||
"invisible_important"
|
||||
);
|
||||
|
||||
// Clean progress.
|
||||
$("#progressbar_time").empty();
|
||||
|
||||
// Change img button.
|
||||
$("#button-no-alerts")
|
||||
.removeClass("silence-alerts")
|
||||
.addClass("alerts");
|
||||
// Change value button.
|
||||
$("#button-no-alerts").val("No alert");
|
||||
$("#button-no-alerts > span").text("No alert");
|
||||
|
||||
// Background button.
|
||||
$(".container-button-alert").removeClass("fired");
|
||||
|
||||
// New progress.
|
||||
listen_event_sound();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
|
|
@ -87,7 +87,7 @@ ui_print_standard_header(
|
|||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('SMNP'),
|
||||
'label' => __('SNMP'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
|
|
@ -57,7 +57,7 @@ ui_print_standard_header(
|
|||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('SMNP'),
|
||||
'label' => __('SNMP'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.770
|
||||
%define release 230420
|
||||
%define release 230428
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.770
|
||||
%define release 230420
|
||||
%define release 230428
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.770
|
||||
%define release 230420
|
||||
%define release 230428
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
|
|
@ -0,0 +1,92 @@
|
|||
name: Continuous Integration
|
||||
|
||||
on:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- operating-system: 'ubuntu-latest'
|
||||
php-version: '7.4'
|
||||
|
||||
- operating-system: 'ubuntu-latest'
|
||||
php-version: '8.0'
|
||||
|
||||
- operating-system: 'ubuntu-latest'
|
||||
php-version: '8.1'
|
||||
|
||||
- operating-system: 'windows-latest'
|
||||
php-version: '8.1'
|
||||
job-description: 'on Windows'
|
||||
|
||||
- operating-system: 'macos-latest'
|
||||
php-version: '8.1'
|
||||
job-description: 'on macOS'
|
||||
|
||||
name: PHP ${{ matrix.php-version }} ${{ matrix.job-description }}
|
||||
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
|
||||
steps:
|
||||
- name: Set git to use LF
|
||||
run: |
|
||||
git config --global core.autocrlf false
|
||||
git config --global core.eol lf
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-version }}
|
||||
extensions: fiber-amphp/ext-fiber@master
|
||||
|
||||
- name: Get Composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-dir)"
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}-${{ matrix.composer-flags }}
|
||||
restore-keys: |
|
||||
composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}-
|
||||
composer-${{ runner.os }}-${{ matrix.php-version }}-
|
||||
composer-${{ runner.os }}-
|
||||
composer-
|
||||
|
||||
- name: Install dependencies
|
||||
uses: nick-invision/retry@v2
|
||||
with:
|
||||
timeout_minutes: 5
|
||||
max_attempts: 5
|
||||
retry_wait_seconds: 30
|
||||
command: |
|
||||
composer update --optimize-autoloader --no-interaction --no-progress ${{ matrix.composer-flags }}
|
||||
composer info -D
|
||||
|
||||
- name: Run tests
|
||||
run: vendor/bin/phpunit ${{ matrix.phpunit-flags }}
|
||||
|
||||
- name: Run examples
|
||||
run: (for f in examples/*.php; do echo $f && if ! php $f; then echo '!! failed !!' && exit 1; fi && echo "-------"; done)
|
||||
if: runner.os != 'Windows'
|
||||
|
||||
- name: Run style fixer
|
||||
env:
|
||||
PHP_CS_FIXER_IGNORE_ENV: 1
|
||||
run: vendor/bin/php-cs-fixer --diff --dry-run -v fix
|
||||
if: runner.os != 'Windows'
|
||||
|
||||
- name: Install composer-require-checker
|
||||
run: php -r 'file_put_contents("composer-require-checker.phar", file_get_contents("https://github.com/maglnet/ComposerRequireChecker/releases/download/3.7.0/composer-require-checker.phar"));'
|
||||
if: runner.os != 'Windows' && matrix.composer-require-checker-version != 'none'
|
||||
|
||||
- name: Run composer-require-checker
|
||||
run: php composer-require-checker.phar check composer.json --config-file $PWD/composer-require-check.json
|
||||
if: runner.os != 'Windows' && matrix.composer-require-checker-version != 'none'
|