Merge remote-tracking branch 'origin/develop' into ent-3630-7648-7712-campo-label-no-se-muestra-en-informes-de-graficas
Conflicts: pandora_console/include/functions_graph.php Former-commit-id: 8436d51b142d4f3d528b3f1c4d459f5194f6a234
This commit is contained in:
commit
ae11ea18c9
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.734-190509
|
||||
Version: 7.0NG.734-190514
|
||||
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.734-190509"
|
||||
pandora_version="7.0NG.734-190514"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -42,7 +42,7 @@ my $Sem = undef;
|
|||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.734';
|
||||
use constant AGENT_BUILD => '190509';
|
||||
use constant AGENT_BUILD => '190514';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.734
|
||||
%define release 190509
|
||||
%define release 190514
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.734
|
||||
%define release 190509
|
||||
%define release 190514
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.734"
|
||||
PI_BUILD="190509"
|
||||
PI_BUILD="190514"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{190509}
|
||||
{190514}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.734(Build 190509)")
|
||||
#define PANDORA_VERSION ("7.0NG.734(Build 190514)")
|
||||
|
||||
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.734(Build 190509))"
|
||||
VALUE "ProductVersion", "(7.0NG.734(Build 190514))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.734-190509
|
||||
Version: 7.0NG.734-190514
|
||||
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.734-190509"
|
||||
pandora_version="7.0NG.734-190514"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
START TRANSACTION;
|
||||
|
||||
ALTER TABLE `talert_commands` ADD COLUMN `fields_hidden` text;
|
||||
|
||||
ALTER TABLE `talert_templates` MODIFY COLUMN `type` ENUM('regex','max_min','max','min','equal','not_equal','warning','critical','onchange','unknown','always','not_normal');
|
||||
|
||||
DELETE FROM `tevent_response` WHERE `name` LIKE 'Create Integria IMS incident from event';
|
||||
|
||||
COMMIT;
|
|
@ -1197,6 +1197,7 @@ ALTER TABLE talert_actions ADD COLUMN `field15_recovery` TEXT NOT NULL DEFAULT "
|
|||
UPDATE `talert_commands` SET `fields_descriptions` = '[\"Integria IMS API path\",\"Integria IMS API pass\",\"Integria IMS user\",\"Integria IMS user pass\",\"Ticket title\",\"Ticket group ID\",\"Ticket priority\",\"Email copy\",\"Ticket owner\",\"Ticket description\"]', `fields_values` = '[\"\",\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very Serious\",\"\",\"\",\"\"]' WHERE `id` = 11 AND `name` = 'Integria IMS Ticket';
|
||||
UPDATE `talert_commands` SET `description` = 'This alert send an email using internal Pandora FMS Server SMTP capabilities (defined in each server, using:
_field1_ as destination email address, and
_field2_ as subject for message. 
_field3_ as text of message. 
_field4_ as content type (text/plain or html/text).', `fields_descriptions` = '[\"Destination address\",\"Subject\",\"Text\",\"Content Type\",\"\",\"\",\"\",\"\",\"\",\"\"]', `fields_values` = '[\"\",\"\",\"_html_editor_\",\"_content_type_\",\"\",\"\",\"\",\"\",\"\",\"\"]' WHERE id=1;
|
||||
ALTER TABLE `talert_commands` ADD COLUMN `id_group` mediumint(8) unsigned NULL default 0;
|
||||
ALTER TABLE `talert_commands` ADD COLUMN `fields_hidden` text;
|
||||
|
||||
UPDATE `talert_actions` SET `field4` = 'text/html', `field4_recovery` = 'text/html' WHERE id = 1;
|
||||
|
||||
|
@ -1216,13 +1217,13 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned;
|
|||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 27);
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 28);
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png');
|
||||
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
|
||||
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '734');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '735');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -2103,3 +2104,9 @@ ALTER TABLE `tnetflow_filter` DROP COLUMN `output`;
|
|||
-- Update table `tuser_task`
|
||||
-- ----------------------------------------------------------------------
|
||||
UPDATE tuser_task set parameters = 'a:5:{i:0;a:6:{s:11:\"description\";s:28:\"Report pending to be created\";s:5:\"table\";s:7:\"treport\";s:8:\"field_id\";s:9:\"id_report\";s:10:\"field_name\";s:4:\"name\";s:4:\"type\";s:3:\"int\";s:9:\"acl_group\";s:8:\"id_group\";}i:1;a:2:{s:11:\"description\";s:46:\"Send to email addresses (separated by a comma)\";s:4:\"type\";s:4:\"text\";}i:2;a:2:{s:11:\"description\";s:7:\"Subject\";s:8:\"optional\";i:1;}i:3;a:3:{s:11:\"description\";s:7:\"Message\";s:4:\"type\";s:4:\"text\";s:8:\"optional\";i:1;}i:4;a:2:{s:11:\"description\";s:11:\"Report Type\";s:4:\"type\";s:11:\"report_type\";}}' where function_name = "cron_task_generate_report";
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Alter table `talert_templates`
|
||||
-- ----------------------------------------------------------------------
|
||||
|
||||
ALTER TABLE `talert_templates` MODIFY COLUMN `type` ENUM('regex','max_min','max','min','equal','not_equal','warning','critical','onchange','unknown','always','not_normal');
|
||||
|
|
|
@ -167,27 +167,18 @@ if ($disk_conf_delete) {
|
|||
|
||||
echo '<form name="conf_agent" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente">';
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
|
||||
$table->head = [];
|
||||
$table->style = [];
|
||||
$table->style[0] = 'font-weight: bold; width: 150px;';
|
||||
$table->data = [];
|
||||
|
||||
$table->align[2] = 'center';
|
||||
|
||||
if (!$new_agent && $alias != '') {
|
||||
$table->data[0][0] = __('Agent name').ui_print_help_tip(__("The agent's name must be the same as the one defined at the console"), true);
|
||||
$table->data[0][1] = html_print_input_text('agente', $nombre_agente, '', 50, 100, true);
|
||||
$table_agent_name = '<div class="label_select"><p class="input_label">'.__('Agent name').': '.ui_print_help_tip(__("The agent's name must be the same as the one defined at the console"), true).'</p>';
|
||||
$table_agent_name .= '<div class="label_select_parent">';
|
||||
$table_agent_name .= '<div class="label_select_child_left">'.html_print_input_text('agente', $nombre_agente, '', 50, 100, true).'</div>';
|
||||
$table_agent_name .= '<div class="label_select_child_right agent_options_agent_name">';
|
||||
|
||||
$table->data[0][2] = __('QR Code Agent view');
|
||||
$table_qr_code = '<div class="agent_qr white_box"><p class="input_label">'.__('QR Code Agent view').': </p>';
|
||||
|
||||
if ($id_agente) {
|
||||
$table->data[0][1] .= ' <b>'.__('ID')."</b> $id_agente ";
|
||||
$table->data[0][1] .= ' <a href="index.php?sec=gagente&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'">';
|
||||
$table->data[0][1] .= html_print_image(
|
||||
$table_agent_name .= '<span>'.__('ID').' '.$id_agente.'</span>';
|
||||
$table_agent_name .= '<a href="index.php?sec=gagente&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'">';
|
||||
$table_agent_name .= html_print_image(
|
||||
'images/zoom.png',
|
||||
true,
|
||||
[
|
||||
|
@ -195,20 +186,23 @@ if (!$new_agent && $alias != '') {
|
|||
'title' => __('Agent detail'),
|
||||
]
|
||||
);
|
||||
$table->data[0][1] .= '</a>';
|
||||
$table_agent_name .= '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
// Remote configuration available
|
||||
if (!$new_agent) {
|
||||
$agent_options_update = 'agent_options_update';
|
||||
|
||||
// Delete link from here.
|
||||
$table_agent_name .= "<a onClick=\"if (!confirm('".__('Are you sure?')."')) return false;\" href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&borrar_agente=$id_agente&search=&offset=0&sort_field=&sort=none'>".html_print_image('images/cross.png', true, ['title' => __('Delete agent')]).'</a>';
|
||||
|
||||
// Remote configuration available.
|
||||
if (isset($filename)) {
|
||||
if (file_exists($filename['md5'])) {
|
||||
$agent_name = agents_get_name($id_agente);
|
||||
$agent_name = io_safe_output($agent_name);
|
||||
$agent_md5 = md5($agent_name, false);
|
||||
|
||||
$table->data[0][1] .= ' '.'<a href="index.php?'.'sec=gagente&'.'sec2=godmode/agentes/configurar_agente&'.'tab=remote_configuration&'.'id_agente='.$id_agente.'&'.'disk_conf='.$agent_md5.'">';
|
||||
$table->data[0][1] .= html_print_image(
|
||||
$table_agent_name .= '<a href="index.php?'.'sec=gagente&'.'sec2=godmode/agentes/configurar_agente&'.'tab=remote_configuration&'.'id_agente='.$id_agente.'&'.'disk_conf='.$agent_md5.'">';
|
||||
$table_agent_name .= html_print_image(
|
||||
'images/application_edit.png',
|
||||
true,
|
||||
[
|
||||
|
@ -216,35 +210,44 @@ if (!$new_agent) {
|
|||
'title' => __('This agent can be remotely configured'),
|
||||
]
|
||||
);
|
||||
$table->data[0][1] .= '</a>'.ui_print_help_tip(
|
||||
$table_agent_name .= '</a>'.ui_print_help_tip(
|
||||
__('You can remotely edit this agent configuration'),
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$table_agent_name .= '</div></div></div>';
|
||||
}
|
||||
|
||||
// Delete link from here
|
||||
if (!$new_agent) {
|
||||
$table->data[0][1] .= " <span align='right'><a onClick=\"if (!confirm('".__('Are you sure?')."')) return false;\" href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&borrar_agente=$id_agente&search=&offset=0&sort_field=&sort=none'>".html_print_image('images/cross.png', true, ['title' => __('Delete agent')]).'</a>';
|
||||
}
|
||||
|
||||
$table->data[1][0] = __('Alias').ui_print_help_tip(__('Characters /,\,|,%,#,&,$ will be ignored'), true).'</span>';
|
||||
$table->data[1][1] = html_print_input_text('alias', $alias, '', 50, 100, true);
|
||||
if ($new_agent) {
|
||||
$table->data[1][1] .= html_print_checkbox('alias_as_name', 1, $config['alias_as_name'], true).__('Use alias as name');
|
||||
$label_select_child_left = 'label_select_child_left';
|
||||
$label_select_parent = 'label_select_parent';
|
||||
}
|
||||
|
||||
$table->data[2][0] = __('IP Address');
|
||||
$table->data[2][1] = html_print_input_text('direccion', $direccion_agente, '', 16, 100, true).html_print_checkbox('unique_ip', 1, $config['unique_ip'], true).__('Unique IP').ui_print_help_tip(__('Set the primary IP address as the unique IP, preventing the same primary IP address from being used in more than one agent'), true);
|
||||
$table_alias = '<div class="label_select"><p class="input_label">'.__('Alias').': '.ui_print_help_tip(__('Characters /,\,|,%,#,&,$ will be ignored'), true).'</p>';
|
||||
$table_alias .= '<div class='.$label_select_parent.'>';
|
||||
$table_alias .= '<div class='.$label_select_child_left.'>'.html_print_input_text('alias', $alias, '', 50, 100, true).'</div>';
|
||||
if ($new_agent) {
|
||||
$table_alias .= '<div class="label_select_child_right">'.html_print_checkbox_switch('alias_as_name', 1, $config['alias_as_name'], true).__('Use alias as name').'</div>';
|
||||
}
|
||||
|
||||
$table_alias .= '</div></div>';
|
||||
|
||||
$table_ip = '<div class="label_select"><p class="input_label">'.__('IP Address').': </p>';
|
||||
$table_ip .= '<div class="label_select_parent">';
|
||||
$table_ip .= '<div class="label_select_child_left">'.html_print_input_text('direccion', $direccion_agente, '', 16, 100, true).'</div>';
|
||||
$table_ip .= '<div class="label_select_child_right">'.html_print_checkbox_switch('unique_ip', 1, $config['unique_ip'], true).__('Unique IP').ui_print_help_tip(__('Set the primary IP address as the unique IP, preventing the same primary IP address from being used in more than one agent'), true).'</div>';
|
||||
$table_ip .= '</div></div>';
|
||||
|
||||
if ($id_agente) {
|
||||
$table->data[2][1] .= ' ';
|
||||
|
||||
$ip_all = agents_get_addresses($id_agente);
|
||||
|
||||
$table->data[2][1] .= html_print_select($ip_all, 'address_list', $direccion_agente, '', '', 0, true);
|
||||
$table->data[2][1] .= ' '.html_print_checkbox('delete_ip', 1, false, true).__('Delete selected');
|
||||
$table_ip .= '<div class="label_select">';
|
||||
$table_ip .= '<div class="label_select_parent">';
|
||||
$table_ip .= '<div class="label_select_child_left">'.html_print_select($ip_all, 'address_list', $direccion_agente, '', '', 0, true).'</div>';
|
||||
$table_ip .= '<div class="label_select_child_right">'.html_print_checkbox_switch('delete_ip', 1, false, true).__('Delete selected').'</div>';
|
||||
$table_ip .= '</div></div>';
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -254,13 +257,12 @@ if ($id_agente) {
|
|||
}
|
||||
</style>
|
||||
<?php
|
||||
if (!$new_agent) {
|
||||
$table->rowspan[2][2] = 3;
|
||||
if (!$new_agent && $alias != '') {
|
||||
if ($id_agente) {
|
||||
$table->data[2][2] = "<a id='qr_code_agent_view' href='javascript: show_dialog_qrcode(null, \"".ui_get_full_url('mobile/index.php?page=agent&id='.$id_agente)."\" );'></a>";
|
||||
} else {
|
||||
$table->data[2][2] = __('Only it is show when<br />the agent is saved.');
|
||||
$table_qr_code .= "<a id='qr_code_agent_view' href='javascript: show_dialog_qrcode(null, \"".ui_get_full_url('mobile/index.php?page=agent&id='.$id_agente)."\" );'></a>";
|
||||
}
|
||||
|
||||
$table_qr_code .= '</div>';
|
||||
}
|
||||
|
||||
$groups = users_get_groups($config['id_user'], 'AR', false);
|
||||
|
@ -277,28 +279,32 @@ if (is_array($modules)) {
|
|||
}
|
||||
}
|
||||
|
||||
$table->data[4][0] = __('Primary group');
|
||||
// Cannot change primary group if user have not permission for that group
|
||||
$table_primary_group = '<div class="label_select"><p class="input_label">'.__('Primary group').': </p>';
|
||||
$table_primary_group .= '<div class="label_select_parent">';
|
||||
// Cannot change primary group if user have not permission for that group.
|
||||
if (isset($groups[$grupo]) || $new_agent) {
|
||||
$table->data[4][1] = html_print_select_groups(false, 'AR', false, 'grupo', $grupo, '', '', 0, true);
|
||||
$table_primary_group .= html_print_select_groups(false, 'AR', false, 'grupo', $grupo, '', '', 0, true);
|
||||
} else {
|
||||
$table->data[4][1] = groups_get_name($grupo);
|
||||
$table->data[4][1] .= html_print_input_hidden('grupo', $grupo, true);
|
||||
$table_primary_group .= groups_get_name($grupo);
|
||||
$table_primary_group .= html_print_input_hidden('grupo', $grupo, true);
|
||||
}
|
||||
|
||||
$table->data[4][1] .= ' <span id="group_preview">';
|
||||
$table->data[4][1] .= ui_print_group_icon($grupo, true);
|
||||
$table->data[4][1] .= '</span>';
|
||||
$table_primary_group .= '<div class="label_select_child_icons"><span id="group_preview">';
|
||||
$table_primary_group .= ui_print_group_icon($grupo, true);
|
||||
$table_primary_group .= '</span></div></div></div>';
|
||||
|
||||
$table->data[5][0] = __('Interval');
|
||||
|
||||
$table->data[5][1] = html_print_extended_select_for_time('intervalo', $intervalo, '', '', '0', 10, true);
|
||||
$table_interval = '<div class="label_select"><p class="input_label">'.__('Interval').': </p>';
|
||||
$table_interval .= '<div class="label_select_parent">';
|
||||
$table_interval .= html_print_extended_select_for_time('intervalo', $intervalo, '', '', '0', 10, true);
|
||||
if ($intervalo < SECONDS_5MINUTES) {
|
||||
$table->data[5][1] .= clippy_context_help('interval_agent_min');
|
||||
$table_interval .= clippy_context_help('interval_agent_min');
|
||||
}
|
||||
|
||||
$table->data[6][0] = __('OS');
|
||||
$table->data[6][1] = html_print_select_from_sql(
|
||||
$table_interval .= '</div></div>';
|
||||
|
||||
$table_os = '<div class="label_select"><p class="input_label">'.__('OS').': </p>';
|
||||
$table_os .= '<div class="label_select_parent">';
|
||||
$table_os .= html_print_select_from_sql(
|
||||
'SELECT id_os, name FROM tconfig_os',
|
||||
'id_os',
|
||||
$id_os,
|
||||
|
@ -307,18 +313,19 @@ $table->data[6][1] = html_print_select_from_sql(
|
|||
'0',
|
||||
true
|
||||
);
|
||||
$table->data[6][1] .= ' <span id="os_preview">';
|
||||
$table->data[6][1] .= ui_print_os_icon($id_os, false, true);
|
||||
$table->data[6][1] .= '</span>';
|
||||
$table_os .= '<div class="label_select_child_icons"> <span id="os_preview">';
|
||||
$table_os .= ui_print_os_icon($id_os, false, true);
|
||||
$table_os .= '</span></div></div></div>';
|
||||
|
||||
// Network server
|
||||
// Network server.
|
||||
$servers = servers_get_names();
|
||||
if (!array_key_exists($server_name, $servers)) {
|
||||
$server_Name = 0;
|
||||
// Set the agent have not server.
|
||||
}
|
||||
|
||||
$table->data[7][0] = __('Server');
|
||||
$table_server = '<div class="label_select"><p class="input_label">'.__('Server').': </p>';
|
||||
$table_server .= '<div class="label_select_parent">';
|
||||
if ($new_agent) {
|
||||
// Set first server by default.
|
||||
$servers_get_names = servers_get_names();
|
||||
|
@ -326,7 +333,7 @@ if ($new_agent) {
|
|||
$server_name = reset($array_keys_servers_get_names);
|
||||
}
|
||||
|
||||
$table->data[7][1] = html_print_select(
|
||||
$table_server .= html_print_select(
|
||||
servers_get_names(),
|
||||
'server_name',
|
||||
$server_name,
|
||||
|
@ -334,36 +341,35 @@ $table->data[7][1] = html_print_select(
|
|||
__('None'),
|
||||
0,
|
||||
true
|
||||
).' '.ui_print_help_icon('agent_server', true);
|
||||
).'<div class="label_select_child_icons">'.ui_print_help_icon('agent_server', true).'</div></div></div>';
|
||||
|
||||
// Description
|
||||
$table->data[8][0] = __('Description');
|
||||
$table->data[8][1] = html_print_input_text(
|
||||
// Description.
|
||||
$table_description = '<div class="label_select"><p class="input_label">'.__('Description').': </p>';
|
||||
$table_description .= html_print_input_text(
|
||||
'comentarios',
|
||||
$comentarios,
|
||||
'',
|
||||
45,
|
||||
200,
|
||||
true
|
||||
);
|
||||
).'</div>';
|
||||
|
||||
html_print_table($table);
|
||||
unset($table);
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
echo '<div class="first_row">
|
||||
<div class="agent_options '.$agent_options_update.' white_box">
|
||||
<div class="agent_options_column_left">'.$table_agent_name.$table_alias.$table_ip.$table_primary_group.'</div>
|
||||
<div class="agent_options_column_right">'.$table_interval.$table_os.$table_server.$table_description.'</div>
|
||||
</div>';
|
||||
if (!$new_agent && $alias != '') {
|
||||
echo $table_qr_code;
|
||||
}
|
||||
|
||||
$table->head = [];
|
||||
$table->style = [];
|
||||
$table->style[0] = 'font-weight: bold; ';
|
||||
$table->style[4] = 'font-weight: bold;';
|
||||
$table->data = [];
|
||||
echo '</div>';
|
||||
|
||||
if (enterprise_installed()) {
|
||||
$secondary_groups_selected = enterprise_hook('agents_get_secondary_groups', [$id_agente]);
|
||||
$table->data['secondary_groups'][0] = __('Secondary groups').ui_print_help_icon('secondary_groups', true);
|
||||
$table->data['secondary_groups'][1] = html_print_select_groups(
|
||||
$table_adv_secondary_groups = '<div class="label_select"><p class="input_label">'.__('Secondary groups').': '.ui_print_help_icon('secondary_groups', true).'</p></div>';
|
||||
$table_adv_secondary_groups_left = html_print_select_groups(
|
||||
false,
|
||||
// Use the current user to select the groups
|
||||
'AR',
|
||||
|
@ -390,7 +396,7 @@ if (enterprise_installed()) {
|
|||
// CSS classnames (default)
|
||||
false,
|
||||
// Not disabled (default)
|
||||
false,
|
||||
'width:50%; min-width:170px; text-align:center',
|
||||
// Inline styles (default)
|
||||
false,
|
||||
// Option style select (default)
|
||||
|
@ -404,29 +410,31 @@ if (enterprise_installed()) {
|
|||
// Do not show the primary group in this selection
|
||||
);
|
||||
|
||||
$table->data['secondary_groups'][2] = html_print_input_image(
|
||||
$table_adv_secondary_groups_arrows = html_print_input_image(
|
||||
'add_secondary',
|
||||
'images/darrowright.png',
|
||||
'images/darrowright_green.png',
|
||||
1,
|
||||
'',
|
||||
true,
|
||||
[
|
||||
'id' => 'right_autorefreshlist',
|
||||
'title' => __('Add secondary groups'),
|
||||
'onclick' => 'agent_manager_add_secondary_groups(event, '.$id_agente.');',
|
||||
]
|
||||
).'<br /><br /><br /><br />'.html_print_input_image(
|
||||
).html_print_input_image(
|
||||
'remove_secondary',
|
||||
'images/darrowleft.png',
|
||||
'images/darrowleft_green.png',
|
||||
1,
|
||||
'',
|
||||
true,
|
||||
[
|
||||
'id' => 'left_autorefreshlist',
|
||||
'title' => __('Remove secondary groups'),
|
||||
'onclick' => 'agent_manager_remove_secondary_groups(event, '.$id_agente.');',
|
||||
]
|
||||
);
|
||||
|
||||
$table->data['secondary_groups'][3] = html_print_select(
|
||||
$table_adv_secondary_groups_right .= html_print_select(
|
||||
$secondary_groups_selected['for_select'],
|
||||
// Values
|
||||
'secondary_groups_selected',
|
||||
|
@ -441,8 +449,16 @@ if (enterprise_installed()) {
|
|||
// Nothing selected
|
||||
true,
|
||||
// Return HTML (not echo)
|
||||
true
|
||||
true,
|
||||
// Multiple selection
|
||||
true,
|
||||
// Sort
|
||||
'',
|
||||
// Class
|
||||
false,
|
||||
// Disabled
|
||||
'width:50%; min-width:170px; text-align:center'
|
||||
// Style
|
||||
);
|
||||
|
||||
// safe operation mode
|
||||
|
@ -457,47 +473,42 @@ if (enterprise_installed()) {
|
|||
$safe_mode_modules[$m['id_module']] = $m['name'];
|
||||
}
|
||||
|
||||
$table->data[2][0] = __('Safe operation mode').ui_print_help_tip(
|
||||
$table_adv_safe = '<div class="label_select_simple label_simple_items"><p class="input_label input_label_simple">'.__('Safe operation mode').': '.ui_print_help_tip(
|
||||
__(
|
||||
'This mode allow %s to disable all modules
|
||||
of this agent while the selected module is on CRITICAL status',
|
||||
get_product_name()
|
||||
),
|
||||
true
|
||||
);
|
||||
$table->data[2][1] = html_print_checkbox('safe_mode', 1, $safe_mode, true);
|
||||
$table->data[2][1] .= ' '.__('Module').' '.html_print_select($safe_mode_modules, 'safe_mode_module', $safe_mode_module, '', '', 0, true);
|
||||
).'</p>';
|
||||
$table_adv_safe .= html_print_checkbox_switch('safe_mode', 1, $safe_mode, true);
|
||||
$table_adv_safe .= __('Module').' '.html_print_select($safe_mode_modules, 'safe_mode_module', $safe_mode_module, '', '', 0, true).'</div>';
|
||||
}
|
||||
|
||||
// Remote configuration
|
||||
$table->data[5][0] = __('Remote configuration');
|
||||
$table_adv_remote = '<div class="label_select"><p class="input_label">'.__('Remote configuration').': </p>';
|
||||
|
||||
if (!$new_agent) {
|
||||
$table->data[5][1] = '<em>'.__('Not available').'</em>';
|
||||
if (isset($filename)) {
|
||||
if (file_exists($filename['md5'])) {
|
||||
$table->data[5][1] = date('F d Y H:i:s', fileatime($filename['md5']));
|
||||
// Delete remote configuration
|
||||
$table->data[5][1] .= '<a href="index.php?'.'sec=gagente&'.'sec2=godmode/agentes/configurar_agente&'.'tab=main&'.'disk_conf_delete=1&'.'id_agente='.$id_agente.'">';
|
||||
$table->data[5][1] .= html_print_image(
|
||||
'images/cross.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Delete remote configuration file'),
|
||||
'style' => 'vertical-align: middle;',
|
||||
]
|
||||
).'</a>';
|
||||
$table->data[5][1] .= '</a>'.ui_print_help_tip(
|
||||
__('Delete this conf file implies that for restore you must reactive remote config in the local agent.'),
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
if (!$new_agent && isset($filename) && file_exists($filename['md5'])) {
|
||||
$table_adv_remote .= date('F d Y H:i:s', fileatime($filename['md5']));
|
||||
// Delete remote configuration
|
||||
$table_adv_remote .= '<a href="index.php?'.'sec=gagente&'.'sec2=godmode/agentes/configurar_agente&'.'tab=main&'.'disk_conf_delete=1&'.'id_agente='.$id_agente.'">';
|
||||
$table_adv_remote .= html_print_image(
|
||||
'images/cross.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Delete remote configuration file'),
|
||||
'style' => 'vertical-align: middle;',
|
||||
]
|
||||
).'</a>';
|
||||
$table_adv_remote .= '</a>'.ui_print_help_tip(
|
||||
__('Delete this conf file implies that for restore you must reactive remote config in the local agent.'),
|
||||
true
|
||||
);
|
||||
} else {
|
||||
$table->data[5][1] = '<em>'.__('Not available').'</em>';
|
||||
$table_adv_remote .= '<em>'.__('Not available').'</em>';
|
||||
}
|
||||
|
||||
|
||||
$table_adv_remote .= '</div>';
|
||||
|
||||
$cps_array[-1] = __('Disabled');
|
||||
if ($cps > 0) {
|
||||
|
@ -511,16 +522,16 @@ if (enterprise_installed()) {
|
|||
$cps_array[$cps_inc] = __('Enabled');
|
||||
}
|
||||
|
||||
$table->data[6][0] = __('Cascade protection services');
|
||||
$table->data[6][0] .= ui_print_help_tip(__('Disable the alerts and events of the elements that belong to this service'), true);
|
||||
$table->data[6][1] = html_print_select($cps_array, 'cps', $cps, '', '', 0, true);
|
||||
$table_adv_cascade = '<div class="label_select"><p class="input_label">'.__('Cascade protection services').': ';
|
||||
$table_adv_cascade .= ui_print_help_tip(__('Disable the alerts and events of the elements that belong to this service'), true).'</p>';
|
||||
$table_adv_cascade .= html_print_select($cps_array, 'cps', $cps, '', '', 0, true).'</div>';
|
||||
}
|
||||
|
||||
// Custom ID
|
||||
$table->data[0][0] = __('Custom ID');
|
||||
$table->data[0][1] = html_print_input_text('custom_id', $custom_id, '', 16, 255, true);
|
||||
$table_adv_custom_id = '<div class="label_select"><p class="input_label">'.__('Custom ID').': </p>';
|
||||
$table_adv_custom_id .= html_print_input_text('custom_id', $custom_id, '', 16, 255, true).'</div>';
|
||||
|
||||
$table->data[1][0] = __('Parent');
|
||||
$table_adv_parent = '<div class="label_select"><p class="input_label">'.__('Parent').': </p>';
|
||||
$params = [];
|
||||
$params['return'] = true;
|
||||
$params['show_helptip'] = true;
|
||||
|
@ -532,75 +543,79 @@ $params['value'] = db_get_value('alias', 'tagente', 'id_agente', $id_parent);
|
|||
$params['selectbox_id'] = 'cascade_protection_module';
|
||||
$params['javascript_is_function_select'] = true;
|
||||
$params['cascade_protection'] = true;
|
||||
|
||||
$table->data[1][1] = ui_print_agent_autocomplete_input($params);
|
||||
$table_adv_parent .= '<div class="label_simple_items">';
|
||||
$table_adv_parent .= ui_print_agent_autocomplete_input($params);
|
||||
if (enterprise_installed()) {
|
||||
$table->data[1][1] .= html_print_checkbox('cascade_protection', 1, $cascade_protection, true).__('Cascade protection').' '.ui_print_help_icon('cascade_protection', true);
|
||||
$table_adv_parent .= html_print_checkbox_switch('cascade_protection', 1, $cascade_protection, true).__('Cascade protection').' '.ui_print_help_icon('cascade_protection', true);
|
||||
}
|
||||
|
||||
$table->data[1][1] .= ' '.__('Module').' '.html_print_select($modules_values, 'cascade_protection_module', $cascade_protection_module, '', '', 0, true);
|
||||
$table_adv_parent .= __('Module').' '.html_print_select($modules_values, 'cascade_protection_module', $cascade_protection_module, '', '', 0, true).'</div></div>';
|
||||
|
||||
// Learn mode / Normal mode
|
||||
$table->data[3][0] = __('Module definition').ui_print_help_icon('module_definition', true);
|
||||
$table->data[3][1] = __('Learning mode').' '.html_print_radio_button_extended(
|
||||
$table_adv_module_mode = '<div class="label_select"><p class="input_label">'.__('Module definition').': '.ui_print_help_icon('module_definition', true).'</p>';
|
||||
$table_adv_module_mode .= '<div class="switch_radio_button">';
|
||||
$table_adv_module_mode .= html_print_radio_button_extended(
|
||||
'modo',
|
||||
1,
|
||||
'',
|
||||
__('Learning mode'),
|
||||
$modo,
|
||||
false,
|
||||
'show_modules_not_learning_mode_context_help();',
|
||||
'style="margin-right: 40px;"',
|
||||
'',
|
||||
true
|
||||
);
|
||||
$table->data[3][1] .= __('Normal mode').' '.html_print_radio_button_extended(
|
||||
$table_adv_module_mode .= html_print_radio_button_extended(
|
||||
'modo',
|
||||
0,
|
||||
'',
|
||||
__('Normal mode'),
|
||||
$modo,
|
||||
false,
|
||||
'show_modules_not_learning_mode_context_help();',
|
||||
'style="margin-right: 40px;"',
|
||||
'',
|
||||
true
|
||||
);
|
||||
$table->data[3][1] .= __('Autodisable mode').' '.html_print_radio_button_extended(
|
||||
$table_adv_module_mode .= html_print_radio_button_extended(
|
||||
'modo',
|
||||
2,
|
||||
'',
|
||||
__('Autodisable mode'),
|
||||
$modo,
|
||||
false,
|
||||
'show_modules_not_learning_mode_context_help();',
|
||||
'style="margin-right: 40px;"',
|
||||
'',
|
||||
true
|
||||
);
|
||||
$table_adv_module_mode .= '</div></div>';
|
||||
|
||||
// Status (Disabled / Enabled)
|
||||
$table->data[4][0] = __('Status');
|
||||
$table->data[4][1] = __('Disabled').' '.ui_print_help_tip(__('If the remote configuration is enabled, it will also go into standby mode when disabling it.'), true).' '.html_print_radio_button_extended('disabled', 1, '', $disabled, false, '', 'style="margin-right: 40px;"', true);
|
||||
$table->data[4][1] .= __('Enabled').' '.html_print_radio_button_extended('disabled', 0, '', $disabled, false, '', 'style="margin-right: 40px;"', true);
|
||||
$table_adv_status = '<div class="label_select_simple label_simple_one_item"><p class="input_label input_label_simple">'.__('Disabled').': '.ui_print_help_tip(__('If the remote configuration is enabled, it will also go into standby mode when disabling it.'), true).'</p>';
|
||||
$table_adv_status .= html_print_checkbox_switch('disabled', 1, $disabled, true).'</div>';
|
||||
|
||||
// Url address.
|
||||
if (enterprise_installed()) {
|
||||
$table->data[4][2] = __('Url address').ui_print_help_tip(__('URL address must be complete, for example: https://pandorafms.com/'), true);
|
||||
$table->data[4][3] = html_print_input_text(
|
||||
$table_adv_url = '<div class="label_select"><p class="input_label">'.__('Url address').': '.ui_print_help_tip(__('URL address must be complete, for example: https://pandorafms.com/'), true).'</p>';
|
||||
$table_adv_url .= html_print_input_text(
|
||||
'url_description',
|
||||
$url_description,
|
||||
'',
|
||||
45,
|
||||
255,
|
||||
true
|
||||
);
|
||||
).'</div>';
|
||||
} else {
|
||||
$table->data[5][0] = __('Url address');
|
||||
$table->data[5][1] = html_print_input_text(
|
||||
$table_adv_url = '<div class="label_select"><p class="input_label">'.__('Url address').': </p></div>';
|
||||
$table_adv_url .= html_print_input_text(
|
||||
'url_description',
|
||||
$url_description,
|
||||
'',
|
||||
45,
|
||||
255,
|
||||
true
|
||||
);
|
||||
).'</div>';
|
||||
}
|
||||
|
||||
$table->data[5][2] = __('Quiet');
|
||||
$table->data[5][3] .= ui_print_help_tip(__('The agent still runs but the alerts and events will be stop'), true);
|
||||
$table->data[5][3] = html_print_checkbox('quiet', 1, $quiet, true);
|
||||
$table_adv_quiet = '<div class="label_select_simple label_simple_one_item"><p class="input_label input_label_simple">'.__('Quiet').': ';
|
||||
$table_adv_quiet .= ui_print_help_tip(__('The agent still runs but the alerts and events will be stop'), true).'</p>';
|
||||
$table_adv_quiet .= html_print_checkbox_switch('quiet', 1, $quiet, true).'</div>';
|
||||
|
||||
$listIcons = gis_get_array_list_icons();
|
||||
|
||||
|
@ -611,7 +626,7 @@ foreach ($listIcons as $index => $value) {
|
|||
|
||||
$path = 'images/gis_map/icons/';
|
||||
// TODO set better method the path
|
||||
$table->data[0][2] = __('Agent icon').ui_print_help_tip(__('Agent icon for GIS Maps.'), true);
|
||||
$table_adv_agent_icon = '<div class="label_select"><p class="input_label">'.__('Agent icon').': '.ui_print_help_tip(__('Agent icon for GIS Maps.'), true).'</p>';
|
||||
if ($icon_path == '') {
|
||||
$display_icons = 'none';
|
||||
// Hack to show no icon. Use any given image to fix not found image errors
|
||||
|
@ -629,7 +644,7 @@ if ($icon_path == '') {
|
|||
$path_warning = $path.$icon_path.'.warning.png';
|
||||
}
|
||||
|
||||
$table->data[0][3] = html_print_select(
|
||||
$table_adv_agent_icon .= html_print_select(
|
||||
$arraySelectIcon,
|
||||
'icon_path',
|
||||
$icon_path,
|
||||
|
@ -637,63 +652,68 @@ $table->data[0][3] = html_print_select(
|
|||
__('None'),
|
||||
'',
|
||||
true
|
||||
).' '.html_print_image(
|
||||
).html_print_image(
|
||||
$path_ok,
|
||||
true,
|
||||
[
|
||||
'id' => 'icon_ok',
|
||||
'style' => 'display:'.$display_icons.';',
|
||||
]
|
||||
).' '.html_print_image(
|
||||
).html_print_image(
|
||||
$path_bad,
|
||||
true,
|
||||
[
|
||||
'id' => 'icon_bad',
|
||||
'style' => 'display:'.$display_icons.';',
|
||||
]
|
||||
).' '.html_print_image(
|
||||
).html_print_image(
|
||||
$path_warning,
|
||||
true,
|
||||
[
|
||||
'id' => 'icon_warning',
|
||||
'style' => 'display:'.$display_icons.';',
|
||||
]
|
||||
);
|
||||
).'</div>';
|
||||
|
||||
if ($config['activate_gis']) {
|
||||
$table->data[3][2] = __('Ignore new GIS data:');
|
||||
$table->data[3][3] = __('Yes').' '.html_print_radio_button_extended(
|
||||
'update_gis_data',
|
||||
0,
|
||||
'',
|
||||
$update_gis_data,
|
||||
false,
|
||||
'',
|
||||
'style="margin-right: 40px;"',
|
||||
true
|
||||
);
|
||||
$table->data[3][3] .= __('No').' '.html_print_radio_button_extended(
|
||||
'update_gis_data',
|
||||
1,
|
||||
'',
|
||||
$update_gis_data,
|
||||
false,
|
||||
'',
|
||||
'style="margin-right: 40px;"',
|
||||
true
|
||||
);
|
||||
$table_adv_gis = '<div class="label_select_simple label_simple_one_item"><p class="input_label input_label_simple">'.__('Ignore new GIS data:').'</p>';
|
||||
if ($new_agent) {
|
||||
$update_gis_data = true;
|
||||
}
|
||||
|
||||
$table_adv_gis .= html_print_checkbox_switch('update_gis_data', 1, $update_gis_data, true).'No / Yes</div>';
|
||||
}
|
||||
|
||||
ui_toggle(html_print_table($table, true), __('Advanced options'));
|
||||
unset($table);
|
||||
|
||||
|
||||
$table_adv_options = $table_adv_secondary_groups.'<div class="secondary_groups_select" style="margin-bottom:30px;">
|
||||
<div class="secondary_groups_list_left">
|
||||
'.$table_adv_secondary_groups_left.'
|
||||
</div>
|
||||
<div class="secondary_groups_select_arrows">
|
||||
'.$table_adv_secondary_groups_arrows.'
|
||||
</div>
|
||||
<div class="secondary_groups_list_right">
|
||||
'.$table_adv_secondary_groups_right.'
|
||||
</div>
|
||||
</div>
|
||||
<div class="agent_options agent_options_adv">
|
||||
<div class="agent_options_column_left" >'.$table_adv_parent.$table_adv_custom_id.$table_adv_module_mode.$table_adv_cascade.$table_adv_gis.'</div>
|
||||
<div class="agent_options_column_right" >'.$table_adv_agent_icon.$table_adv_url.$table_adv_quiet.$table_adv_status.$table_adv_remote.$table_adv_safe.'</div>
|
||||
</div>';
|
||||
|
||||
echo '<div class="ui_toggle">';
|
||||
ui_toggle($table_adv_options, __('Advanced options'), '', true, false, 'white_box white_box_opened');
|
||||
echo '</div>';
|
||||
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
$table->class = 'custom_fields_table';
|
||||
|
||||
$table->head = [];
|
||||
$table->style = [];
|
||||
$table->style[0] = 'font-weight: bold; width: 100px;';
|
||||
$table->style[0] = 'font-weight: bold;';
|
||||
$table->data = [];
|
||||
|
||||
$fields = db_get_all_fields_in_table('tagent_custom_fields');
|
||||
|
@ -703,11 +723,15 @@ if ($fields === false) {
|
|||
}
|
||||
|
||||
foreach ($fields as $field) {
|
||||
$data[0] = '<b>'.$field['name'].'</b>';
|
||||
$id_custom_field = $field['id_field'];
|
||||
|
||||
$data[0] = '<div class="field_title" onclick="show_custom_field_row('.$id_custom_field.')">';
|
||||
$data[0] .= '<b>'.$field['name'].'</b>';
|
||||
$data[0] .= ui_print_help_tip(
|
||||
__('This field allows url insertion using the BBCode\'s url tag').'.<br />'.__('The format is: [url=\'url to navigate\']\'text to show\'[/url]').'.<br /><br />'.__('e.g.: [url=google.com]Google web search[/url]'),
|
||||
true
|
||||
);
|
||||
$data[0] .= '</div>';
|
||||
$combo = [];
|
||||
$combo = $field['combo_values'];
|
||||
$combo = explode(',', $combo);
|
||||
|
@ -730,7 +754,7 @@ foreach ($fields as $field) {
|
|||
}
|
||||
|
||||
if ($field['is_password_type']) {
|
||||
$data[1] = html_print_input_text_extended(
|
||||
$data_field[1] = html_print_input_text_extended(
|
||||
'customvalue_'.$field['id_field'],
|
||||
$custom_value,
|
||||
'customvalue_'.$field['id_field'],
|
||||
|
@ -744,18 +768,18 @@ foreach ($fields as $field) {
|
|||
true
|
||||
);
|
||||
} else {
|
||||
$data[1] = html_print_textarea(
|
||||
$data_field[1] = html_print_textarea(
|
||||
'customvalue_'.$field['id_field'],
|
||||
2,
|
||||
65,
|
||||
$custom_value,
|
||||
'style="min-height: 30px; width:96%;"',
|
||||
'style="min-height: 30px;"',
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if ($field['combo_values'] !== '') {
|
||||
$data[1] = html_print_select(
|
||||
$data_field[1] = html_print_select(
|
||||
$combo_values,
|
||||
'customvalue_'.$field['id_field'],
|
||||
$custom_value,
|
||||
|
@ -776,19 +800,25 @@ foreach ($fields as $field) {
|
|||
);
|
||||
};
|
||||
|
||||
$table->rowid[] = 'name_field-'.$id_custom_field;
|
||||
array_push($table->data, $data);
|
||||
|
||||
$table->rowid[] = 'field-'.$id_custom_field;
|
||||
array_push($table->data, $data_field);
|
||||
}
|
||||
|
||||
if (!empty($fields)) {
|
||||
ui_toggle(html_print_table($table, true), __('Custom fields'));
|
||||
echo '<div class="ui_toggle">';
|
||||
ui_toggle(html_print_table($table, true), __('Custom fields'), '', true, false, 'white_box white_box_opened');
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
echo '<div class="action-buttons" style="display: flex; justify-content: flex-end; align-items: center; width: '.$table->width.'">';
|
||||
|
||||
|
||||
// The context help about the learning mode.
|
||||
if ($modo == 0) {
|
||||
echo "<span id='modules_not_learning_mode_context_help' style=''>";
|
||||
echo "<span id='modules_not_learning_mode_context_help' style='padding-right:8px;'>";
|
||||
} else {
|
||||
echo "<span id='modules_not_learning_mode_context_help' style='display: none;'>";
|
||||
}
|
||||
|
@ -798,7 +828,7 @@ echo '</span>';
|
|||
|
||||
|
||||
if ($id_agente) {
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
echo '<div class="action-buttons">';
|
||||
html_print_submit_button(
|
||||
__('Update'),
|
||||
'updbutton',
|
||||
|
@ -825,6 +855,19 @@ ui_require_jquery_file('bgiframe');
|
|||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
// Show/Hide custom field row.
|
||||
function show_custom_field_row(id){
|
||||
if( $('#field-'+id).css('display') == 'none'){
|
||||
$('#field-'+id).css('display','table-row');
|
||||
$('#name_field-'+id).addClass('custom_field_row_opened');
|
||||
}
|
||||
else{
|
||||
$('#field-'+id).css('display','none');
|
||||
$('#name_field-'+id).removeClass('custom_field_row_opened');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Use this function for change 3 icons when change the selectbox
|
||||
function changeIcons() {
|
||||
var icon = $("#icon_path :selected").val();
|
||||
|
@ -863,7 +906,7 @@ ui_require_jquery_file('bgiframe');
|
|||
|
||||
function show_modules_not_learning_mode_context_help() {
|
||||
if ($("input[name='modo'][value=0]").is(':checked')) {
|
||||
$("#modules_not_learning_mode_context_help").show();
|
||||
$("#modules_not_learning_mode_context_help").show().css('padding-right','8px');
|
||||
}
|
||||
else {
|
||||
$("#modules_not_learning_mode_context_help").hide();
|
||||
|
|
|
@ -1170,6 +1170,7 @@ html_print_input_hidden('module_relations_count', $relations_count);
|
|||
|
||||
ui_require_jquery_file('json');
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
@ -1363,7 +1364,7 @@ function disabled_two_tailed (disabledBecauseInPolicy) {
|
|||
function advanced_option_dynamic() {
|
||||
if($('.hide_dinamic').is(":visible")){
|
||||
$('.hide_dinamic').hide();
|
||||
|
||||
|
||||
} else {
|
||||
$('.hide_dinamic').show();
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
// 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.
|
||||
// Load global vars
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
require_once $config['homedir'].'/include/functions_alerts.php';
|
||||
|
@ -46,7 +46,7 @@ if (is_ajax()) {
|
|||
$id = (int) get_parameter('id', 0);
|
||||
$get_recovery_fields = (int) get_parameter('get_recovery_fields', 1);
|
||||
|
||||
// If command ID is not provided, check for action id
|
||||
// If command ID is not provided, check for action id.
|
||||
if ($id == 0) {
|
||||
$id_action = (int) get_parameter('id_action');
|
||||
$id = alerts_get_alert_action_alert_command_id($id_action);
|
||||
|
@ -59,10 +59,12 @@ if (is_ajax()) {
|
|||
$command['description'] = io_safe_input(str_replace("\r\n", '<br>', io_safe_output($command['description'])));
|
||||
}
|
||||
|
||||
// Descriptions are stored in json
|
||||
// Descriptions are stored in json.
|
||||
$fields_descriptions = empty($command['fields_descriptions']) ? '' : json_decode(io_safe_output($command['fields_descriptions']), true);
|
||||
// Fields values are stored in json
|
||||
// Fields values are stored in json.
|
||||
$fields_values = empty($command['fields_values']) ? '' : io_safe_output(json_decode($command['fields_values'], true));
|
||||
// Fields hidden conditions are stored in json.
|
||||
$fields_hidden_checked = empty($command['fields_hidden']) ? '' : io_safe_output(json_decode($command['fields_hidden'], true));
|
||||
|
||||
$fields_rows = [];
|
||||
for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
|
||||
|
@ -72,18 +74,20 @@ if (is_ajax()) {
|
|||
|
||||
$field_description = $fields_descriptions[($i - 1)];
|
||||
$field_value = $fields_values[($i - 1)];
|
||||
$field_hidden = $fields_hidden_checked[($i - 1)];
|
||||
|
||||
|
||||
if (!empty($field_description)) {
|
||||
// If the value is 5, this because severity in snmp alerts is not permit to show
|
||||
// If the value is 5, this because severity in snmp alerts is not permit to show.
|
||||
if (($i > 5) && ($command['id'] == 3)) {
|
||||
$fdesc = $field_description.' <br><span style="font-size:xx-small; font-weight:normal;">'.sprintf(__('Field %s'), ($i - 1)).'</span>';
|
||||
} else {
|
||||
$fdesc = $field_description.' <br><span style="font-size:xx-small; font-weight:normal;">'.sprintf(__('Field %s'), $i).'</span>';
|
||||
}
|
||||
|
||||
// If the field is the number one, print the help message
|
||||
// If the field is the number one, print the help message.
|
||||
if ($i == 1) {
|
||||
// If our context is snmpconsole, show snmp_alert helps
|
||||
// If our context is snmpconsole, show snmp_alert helps.
|
||||
if ((isset($_SERVER['HTTP_REFERER'])) && ( preg_match('/snmp_alert/', $_SERVER['HTTP_REFERER']) > 0 )) {
|
||||
$fdesc .= ui_print_help_icon('snmp_alert_field1', true);
|
||||
} else {
|
||||
|
@ -91,7 +95,7 @@ if (is_ajax()) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
// If the macro hasn't description and doesnt appear in command, set with empty description to dont show it
|
||||
// If the macro hasn't description and doesnt appear in command, set with empty description to dont show it.
|
||||
if (($i > 5) && ($command['id'] == 3)) {
|
||||
if (substr_count($command['command'], '_field'.($i - 1).'_') > 0) {
|
||||
$fdesc = sprintf(__('Field %s'), ($i - 1));
|
||||
|
@ -107,9 +111,11 @@ if (is_ajax()) {
|
|||
}
|
||||
}
|
||||
|
||||
$style = ((int) $field_hidden === 1) ? '-webkit-text-security: disc;' : '';
|
||||
|
||||
if (!empty($field_value)) {
|
||||
$field_value = io_safe_output($field_value);
|
||||
// HTML type
|
||||
// HTML type.
|
||||
if (preg_match('/^_html_editor_$/i', $field_value)) {
|
||||
$editor_type_chkbx = '<div style="padding: 4px 0px;"><b><small>';
|
||||
$editor_type_chkbx .= __('Basic').ui_print_help_tip(__('For sending emails, text must be HTML format, if you want to use plain text, type it between the following labels: <pre></pre>'), true);
|
||||
|
@ -148,7 +154,7 @@ if (is_ajax()) {
|
|||
$editor_type_chkbx .= html_print_radio_button_extended('field'.$i.'_recovery_value', 'text/html', '', 'text/html', false, '', '', true);
|
||||
$editor_type_chkbx .= '</small></b></div>';
|
||||
$rfield = $editor_type_chkbx;
|
||||
// Select type
|
||||
// Select type.
|
||||
} else {
|
||||
$fields_value_select = [];
|
||||
$fv = explode(';', $field_value);
|
||||
|
@ -200,7 +206,7 @@ if (is_ajax()) {
|
|||
1,
|
||||
1,
|
||||
$fv[0],
|
||||
'style="min-height:40px" class="fields"',
|
||||
'style="min-height:40px; '.$style.'" class="fields"',
|
||||
true
|
||||
);
|
||||
$rfield = html_print_textarea(
|
||||
|
@ -208,7 +214,7 @@ if (is_ajax()) {
|
|||
1,
|
||||
1,
|
||||
$fv[0],
|
||||
'style="min-height:40px" class="fields_recovery"',
|
||||
'style="min-height:40px; '.$style.'" class="fields_recovery',
|
||||
true
|
||||
);
|
||||
}
|
||||
|
@ -219,7 +225,7 @@ if (is_ajax()) {
|
|||
1,
|
||||
1,
|
||||
'',
|
||||
'style="min-height:40px" class="fields"',
|
||||
'style="min-height:40px; '.$style.'" class="fields"',
|
||||
true
|
||||
);
|
||||
$rfield = html_print_textarea(
|
||||
|
@ -227,13 +233,13 @@ if (is_ajax()) {
|
|||
1,
|
||||
1,
|
||||
'',
|
||||
'style="min-height:40px" class="fields_recovery"',
|
||||
'style="min-height:40px; '.$style.'" class="fields_recovery"',
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// The empty descriptions will be ignored
|
||||
// The empty descriptions will be ignored.
|
||||
if ($fdesc == '') {
|
||||
$fields_rows[$i] = '';
|
||||
} else {
|
||||
|
@ -248,7 +254,7 @@ if (is_ajax()) {
|
|||
}
|
||||
}
|
||||
|
||||
// If command is PandoraFMS event, field 5 must be empty because "severity" must be set by the alert
|
||||
// If command is PandoraFMS event, field 5 must be empty because "severity" must be set by the alert.
|
||||
if ($command['id'] == 3) {
|
||||
$fields_rows[5] = '';
|
||||
}
|
||||
|
@ -268,7 +274,7 @@ if ($update_command) {
|
|||
return;
|
||||
}
|
||||
|
||||
// Header
|
||||
// Header.
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header();
|
||||
} else {
|
||||
|
@ -283,16 +289,19 @@ if ($create_command) {
|
|||
|
||||
$fields_descriptions = [];
|
||||
$fields_values = [];
|
||||
$fields_hidden = [];
|
||||
$info_fields = '';
|
||||
$values = [];
|
||||
for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
|
||||
$fields_descriptions[] = (string) get_parameter('field'.$i.'_description');
|
||||
$fields_values[] = (string) get_parameter('field'.$i.'_values');
|
||||
$fields_hidden[] = get_parameter('field'.$i.'_hide');
|
||||
$info_fields .= ' Field'.$i.': '.$fields_values[($i - 1)];
|
||||
}
|
||||
|
||||
$values['fields_values'] = io_json_mb_encode($fields_values);
|
||||
$values['fields_descriptions'] = io_json_mb_encode($fields_descriptions);
|
||||
$values['fields_hidden'] = io_json_mb_encode($fields_hidden);
|
||||
$values['description'] = $description;
|
||||
$values['id_group'] = $id_group;
|
||||
|
||||
|
@ -316,7 +325,7 @@ if ($create_command) {
|
|||
db_pandora_audit('Command management', 'Fail try to create alert command', false, false);
|
||||
}
|
||||
|
||||
// Show errors
|
||||
// Show errors.
|
||||
if (!isset($messageAction)) {
|
||||
$messageAction = __('Could not be created');
|
||||
}
|
||||
|
@ -340,7 +349,7 @@ if ($create_command) {
|
|||
if ($delete_command) {
|
||||
$id = (int) get_parameter('id');
|
||||
|
||||
// Internal commands cannot be deleted
|
||||
// Internal commands cannot be deleted.
|
||||
if (alerts_get_alert_command_internal($id)) {
|
||||
db_pandora_audit(
|
||||
'ACL Violation',
|
||||
|
@ -368,17 +377,17 @@ if ($delete_command) {
|
|||
if ($copy_command) {
|
||||
$id = (int) get_parameter('id');
|
||||
|
||||
// Get the info from the source command
|
||||
// Get the info from the source command.
|
||||
$command_to_copy = db_get_row('talert_commands', 'id', $id);
|
||||
if ($command_to_copy === false) {
|
||||
ui_print_error_message(__("Command with id $id does not found."));
|
||||
} else {
|
||||
// Prepare to insert the copy with same values
|
||||
// Prepare to insert the copy with same values.
|
||||
unset($command_to_copy['id']);
|
||||
$command_to_copy['name'] .= __(' (copy)');
|
||||
$result = db_process_sql_insert('talert_commands', $command_to_copy);
|
||||
|
||||
// Print the result
|
||||
// Print the result.
|
||||
ui_print_result_message(
|
||||
$result,
|
||||
__('Successfully copied'),
|
||||
|
|
|
@ -186,6 +186,10 @@ switch ($template['type']) {
|
|||
$condition = __('The alert would fire when the module is in critical status');
|
||||
break;
|
||||
|
||||
case 'not_normal':
|
||||
$condition = __('The alert would fire when the module is in not normal status');
|
||||
break;
|
||||
|
||||
case 'unknown':
|
||||
$condition = __('The alert would fire when the module is in unknown status');
|
||||
break;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
// 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.
|
||||
// Load global vars
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
require_once $config['homedir'].'/include/functions_alerts.php';
|
||||
|
@ -35,7 +35,7 @@ $id = (int) get_parameter('id');
|
|||
$pure = get_parameter('pure', 0);
|
||||
$alert = [];
|
||||
|
||||
// Header
|
||||
// Header.
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header();
|
||||
} else {
|
||||
|
@ -65,16 +65,19 @@ if ($update_command) {
|
|||
|
||||
$fields_descriptions = [];
|
||||
$fields_values = [];
|
||||
$fields_hidden = [];
|
||||
$info_fields = '';
|
||||
$values = [];
|
||||
for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
|
||||
$fields_descriptions[] = (string) get_parameter('field'.$i.'_description');
|
||||
$fields_values[] = (string) get_parameter('field'.$i.'_values');
|
||||
$fields_hidden[] = get_parameter('field'.$i.'_hide');
|
||||
$info_fields .= ' Field'.$i.': '.$fields_values[($i - 1)];
|
||||
}
|
||||
|
||||
$values['fields_values'] = io_json_mb_encode($fields_values);
|
||||
$values['fields_descriptions'] = io_json_mb_encode($fields_descriptions);
|
||||
$values['fields_hidden'] = io_json_mb_encode($fields_hidden);
|
||||
|
||||
$values['name'] = $name;
|
||||
$values['command'] = $command;
|
||||
|
@ -129,6 +132,7 @@ if ($id) {
|
|||
$id_group = $alert['id_group'];
|
||||
$fields_descriptions = $alert['fields_descriptions'];
|
||||
$fields_values = $alert['fields_values'];
|
||||
$fields_hidden = $alert['fields_hidden'];
|
||||
}
|
||||
|
||||
if (!empty($fields_descriptions)) {
|
||||
|
@ -139,6 +143,10 @@ if (!empty($fields_values)) {
|
|||
$fields_values = json_decode($fields_values, true);
|
||||
}
|
||||
|
||||
if (!empty($fields_hidden)) {
|
||||
$fields_hidden = json_decode($fields_hidden, true);
|
||||
}
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
|
@ -153,6 +161,7 @@ $table->style = [];
|
|||
if (!defined('METACONSOLE')) {
|
||||
$table->style[0] = 'font-weight: bold';
|
||||
$table->style[2] = 'font-weight: bold';
|
||||
$table->style[4] = 'font-weight: bold';
|
||||
}
|
||||
|
||||
$table->size = [];
|
||||
|
@ -190,7 +199,7 @@ $table->data['description'][1] = html_print_textarea('description', 10, 30, $des
|
|||
for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
|
||||
$table->data['field'.$i][0] = sprintf(__('Field %s description'), $i);
|
||||
|
||||
// Only show help on first row
|
||||
// Only show help on first row.
|
||||
if ($i == 1) {
|
||||
$table->data['field'.$i][0] .= ui_print_help_icon('alert_fields_description', true);
|
||||
}
|
||||
|
@ -201,11 +210,11 @@ for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
|
|||
$field_description = '';
|
||||
}
|
||||
|
||||
$table->data['field'.$i][1] = html_print_input_text('field'.$i.'_description', $field_description, '', 35, 255, true);
|
||||
$table->data['field'.$i][1] = html_print_input_text('field'.$i.'_description', $field_description, '', 30, 255, true);
|
||||
|
||||
$table->data['field'.$i][2] = sprintf(__('Field %s values'), $i);
|
||||
|
||||
// Only show help on first row
|
||||
// Only show help on first row.
|
||||
if ($i == 1) {
|
||||
$table->data['field'.$i][2] .= ui_print_help_icon('alert_fields_values', true);
|
||||
}
|
||||
|
@ -216,7 +225,17 @@ for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
|
|||
$field_values = '';
|
||||
}
|
||||
|
||||
$table->data['field'.$i][3] = html_print_input_text('field'.$i.'_values', $field_values, '', 65, 255, true);
|
||||
if (!empty($fields_hidden)) {
|
||||
$selected = (bool) $fields_hidden[($i - 1)];
|
||||
} else {
|
||||
$selected = false;
|
||||
}
|
||||
|
||||
$table->data['field'.$i][3] = html_print_input_text('field'.$i.'_values', $field_values, '', 55, 255, true, false, false, '', 'field_value');
|
||||
|
||||
$table->data['field'.$i][4] = __('Hide');
|
||||
|
||||
$table->data['field'.$i][5] = html_print_checkbox_extended('field'.$i.'_hide', 1, $selected, false, 'cursor: \'pointer\'', 'class="hide_inputs"', true);
|
||||
}
|
||||
|
||||
echo '<form method="post" action="index.php?sec=galertas&sec2=godmode/alerts/alert_commands&pure='.$pure.'">';
|
||||
|
@ -236,3 +255,27 @@ echo '</div>';
|
|||
echo '</form>';
|
||||
|
||||
enterprise_hook('close_meta_frame');
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready (function () {
|
||||
|
||||
$(".hide_inputs").each(function(index) {
|
||||
var $input_in_row = $(this).closest('tr').find('.field_value');
|
||||
if($(this).is(':checked')) {
|
||||
$input_in_row.prop('style', '-webkit-text-security: disc;');
|
||||
} else {
|
||||
$input_in_row.prop('style', '');
|
||||
}
|
||||
});
|
||||
|
||||
$(".hide_inputs").click(function() {
|
||||
var $input_in_row = $(this).closest('tr').find('.field_value');
|
||||
if($(this).is(':checked')) {
|
||||
$input_in_row.prop('style', '-webkit-text-security: disc;');
|
||||
} else {
|
||||
$input_in_row.prop('style', '');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -679,7 +679,7 @@ if ($step == 2) {
|
|||
'type',
|
||||
$type,
|
||||
'',
|
||||
__('Select'),
|
||||
__('None'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
|
@ -1018,6 +1018,7 @@ var onchange_msg = <?php echo '"'.__('The alert would fire when the module value
|
|||
var onchange_not = <?php echo '"'.__('The alert would fire when the module value does not change').'"'; ?>;
|
||||
var unknown = <?php echo "'".__('The alert would fire when the module is in unknown status')."'"; ?>;
|
||||
var error_message_min_max_zero = <?php echo "'".__('The alert template cannot have the same value for min and max thresholds.')."'"; ?>;
|
||||
var not_normal = <?php echo "'".__('The alert would fire when the module is in not normal status')."'"; ?>;
|
||||
|
||||
function check_fields_step2() {
|
||||
var correct = true;
|
||||
|
@ -1174,6 +1175,13 @@ if ($step == 2) {
|
|||
/* Show example */
|
||||
$("span#example").empty ().append (critical);
|
||||
break;
|
||||
case "not_normal":
|
||||
$("#template-value, #template-max, span#matches_value, #template-min").hide ();
|
||||
$("#template-example").show ();
|
||||
|
||||
/* Show example */
|
||||
$("span#example").empty ().append (not_normal);
|
||||
break;
|
||||
case "onchange":
|
||||
$("#template-value, #template-max, #template-min").hide ();
|
||||
$("#template-example, span#matches_value").show ();
|
||||
|
|
|
@ -742,7 +742,7 @@ class HostDevices extends Wizard
|
|||
|
||||
echo '<div class="white_box">
|
||||
<div class="edit_discovery_info" style="margin-bottom: 15px;">
|
||||
<div style="width: 25%; padding: 9px;">'.'<div style="height: 50%; margin-bottom: 35px;">'.html_print_image('images/wizard/netscan_green.png', true, ['title' => __('Close'), 'style' => 'width: 60%;'], false).'</div>'.'<div class="edit_discovery_input"><div style="display: flex;">'.$interval_input_label.'<div style="margin-left: 15 px; width: 50%;">'.$interval_input.'</div></div>'.$interval_input_extra.'</div>'.'</div>
|
||||
<div style="width: 25%; padding: 9px;">'.'<div style="height: 50%; margin-bottom: 35px;">'.html_print_image('images/wizard/netscan_green.png', true, ['title' => __('Close')], false).'</div>'.'<div class="edit_discovery_input"><div style="display: flex;">'.$interval_input_label.'<div style="margin-left: 15 px; width: 50%;">'.$interval_input.'</div></div>'.$interval_input_extra.'</div>'.'</div>
|
||||
|
||||
<div style="width: 40%; padding-left: 5%; padding-right: 12%;">
|
||||
<div class="edit_discovery_input">'.$taskname_input_label.'<div class="discovery_text_input">'.$taskname_input.'</div></div>'.'<div class="edit_discovery_input discovery_select_input">'.$discovery_server_select_label.$discovery_server_select.'<div class="discovery_hint"></div></div>'.'<div class="edit_discovery_input">'.$network_input_label.'<div class="discovery_text_input">'.$network_input.'</div></div>'.'</div>'.'<div style="width: 35%;">'.$group_select.'</div>'.'</div>'.'<div class="edit_discovery_info">
|
||||
|
|
|
@ -1120,11 +1120,11 @@ if (check_login()) {
|
|||
$draw_events = 0;
|
||||
}
|
||||
|
||||
$link = "winopeng('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&'.'id='.$module['id_agente_modulo'].'&'.'label='.rawurlencode(
|
||||
$link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&'.'id='.$module['id_agente_modulo'].'&'.'label='.rawurlencode(
|
||||
urlencode(
|
||||
base64_encode($module['nombre'])
|
||||
)
|
||||
).'&'.'refresh='.SECONDS_10MINUTES.'&'."draw_events=$draw_events', 'day_".$win_handle."')";
|
||||
).'&'.'refresh='.SECONDS_10MINUTES.'&'."draw_events=$draw_events', 'day_".$win_handle."', 1000, 650)";
|
||||
if (!is_snapshot_data($module['datos'])) {
|
||||
$data[8] .= '<a href="javascript:'.$link.'">'.html_print_image('images/chart_curve.png', true, ['border' => '0', 'alt' => '']).'</a> ';
|
||||
}
|
||||
|
|
|
@ -443,7 +443,7 @@ class CustomNetScan extends Wizard
|
|||
'name' => 'taskname',
|
||||
'value' => $this->task['name'],
|
||||
'type' => 'text',
|
||||
'size' => 25,
|
||||
'size' => 50,
|
||||
],
|
||||
];
|
||||
|
||||
|
@ -465,7 +465,7 @@ class CustomNetScan extends Wizard
|
|||
'name' => 'comment',
|
||||
'value' => $this->task['description'],
|
||||
'type' => 'text',
|
||||
'size' => 25,
|
||||
'size' => 50,
|
||||
],
|
||||
];
|
||||
|
||||
|
@ -652,7 +652,7 @@ class CustomNetScan extends Wizard
|
|||
'value' => $explanation,
|
||||
'return' => true,
|
||||
'attributes' => 'style="width: 388px;"',
|
||||
'class' => 'discovery_textarea_input'
|
||||
'class' => 'discovery_textarea_input',
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC190509';
|
||||
$build_version = 'PC190514';
|
||||
$pandora_version = 'v7.0NG.734';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
|
|
@ -1762,16 +1762,22 @@ function array_key_to_offset($array, $key)
|
|||
/**
|
||||
* Make a snmpwalk and return it.
|
||||
*
|
||||
* @param string $ip_target The target address.
|
||||
* @param string $snmp_version Version of the snmp: 1,2,2c or 3.
|
||||
* @param string $snmp_community.
|
||||
* @param string $snmp3_auth_user.
|
||||
* @param string $snmp3_security_level.
|
||||
* @param string $snmp3_auth_method.
|
||||
* @param string $snmp3_auth_pass.
|
||||
* @param string $snmp3_privacy_method.
|
||||
* @param string $snmp3_privacy_pass.
|
||||
* @param integer $quick_print 0 for all details, 1 for only value.
|
||||
* @param string $ip_target The target address.
|
||||
* @param string $snmp_version Version of the snmp: 1,2,2c or 3.
|
||||
* @param string $snmp_community Snmp_community.
|
||||
* @param string $snmp3_auth_user Snmp3_auth_user.
|
||||
* @param string $snmp3_security_level Snmp3_security_level.
|
||||
* @param string $snmp3_auth_method Snmp3_auth_method.
|
||||
* @param string $snmp3_auth_pass Snmp3_auth_pass.
|
||||
* @param string $snmp3_privacy_method Snmp3_privacy_method.
|
||||
* @param string $snmp3_privacy_pass Snmp3_privacy_pass.
|
||||
* @param integer $quick_print To get all details 0, 1: only value.
|
||||
* @param string $base_oid Base_oid.
|
||||
* @param string $snmp_port Snmp_port.
|
||||
* @param integer $server_to_exec Server_to_exec.
|
||||
* @param string $extra_arguments Extra_arguments.
|
||||
* @param string $format Format to apply, for instance, to
|
||||
* retrieve hex-dumps: --hexOutputLength.
|
||||
*
|
||||
* @return array SNMP result.
|
||||
*/
|
||||
|
@ -1789,7 +1795,8 @@ function get_snmpwalk(
|
|||
$base_oid='',
|
||||
$snmp_port='',
|
||||
$server_to_exec=0,
|
||||
$extra_arguments=''
|
||||
$extra_arguments='',
|
||||
$format='-Oa'
|
||||
) {
|
||||
global $config;
|
||||
|
||||
|
@ -1840,15 +1847,15 @@ function get_snmpwalk(
|
|||
case '3':
|
||||
switch ($snmp3_security_level) {
|
||||
case 'authNoPriv':
|
||||
$command_str = $snmpwalk_bin.' -m ALL -Oa '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
|
||||
$command_str = $snmpwalk_bin.' -m ALL '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
|
||||
break;
|
||||
|
||||
case 'noAuthNoPriv':
|
||||
$command_str = $snmpwalk_bin.' -m ALL -Oa '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
|
||||
$command_str = $snmpwalk_bin.' -m ALL '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
|
||||
break;
|
||||
|
||||
default:
|
||||
$command_str = $snmpwalk_bin.' -m ALL -Oa '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
|
||||
$command_str = $snmpwalk_bin.' -m ALL '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -1857,7 +1864,7 @@ function get_snmpwalk(
|
|||
case '2c':
|
||||
case '1':
|
||||
default:
|
||||
$command_str = $snmpwalk_bin.' -m ALL '.$extra_arguments.' -Oa -v '.escapeshellarg($snmp_version).' -c '.escapeshellarg(io_safe_output($snmp_community)).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
|
||||
$command_str = $snmpwalk_bin.' -m ALL '.$extra_arguments.' '.$format.' -v '.escapeshellarg($snmp_version).' -c '.escapeshellarg(io_safe_output($snmp_community)).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -3545,7 +3552,13 @@ function series_type_graph_array($data, $show_elements_graph)
|
|||
&& is_array($show_elements_graph['labels'])
|
||||
&& (count($show_elements_graph['labels']) > 0)
|
||||
) {
|
||||
$name_legend = $data_return['legend'][$key] = $show_elements_graph['labels'][$value['agent_module_id']].' ';
|
||||
if ($show_elements_graph['unit']) {
|
||||
$name_legend = $show_elements_graph['labels'][$value['agent_module_id']].' / '.__('Unit ').' '.$show_elements_graph['unit'].': ';
|
||||
$data_return['legend'][$key] = $show_elements_graph['labels'][$value['agent_module_id']].' / '.__('Unit ').' '.$show_elements_graph['unit'].': ';
|
||||
} else {
|
||||
$name_legend = $show_elements_graph['labels'][$value['agent_module_id']].': ';
|
||||
$data_return['legend'][$key] = $show_elements_graph['labels'][$value['agent_module_id']].': ';
|
||||
}
|
||||
} else {
|
||||
if (strpos($key, 'baseline') !== false) {
|
||||
if ($value['unit']) {
|
||||
|
|
|
@ -664,6 +664,7 @@ function alerts_get_alert_templates_types()
|
|||
$types['unknown'] = __('Unknown status');
|
||||
$types['onchange'] = __('On Change');
|
||||
$types['always'] = __('Always');
|
||||
$types['not_normal'] = __('Not normal status');
|
||||
|
||||
return $types;
|
||||
}
|
||||
|
@ -680,7 +681,7 @@ function alerts_get_alert_templates_type_name($type)
|
|||
{
|
||||
$types = alerts_get_alert_templates_types();
|
||||
|
||||
if (! isset($type[$type])) {
|
||||
if (!isset($types[$type])) {
|
||||
return __('Unknown');
|
||||
}
|
||||
|
||||
|
|
|
@ -1646,7 +1646,7 @@ function events_get_agent(
|
|||
$sql_where,
|
||||
0,
|
||||
1000,
|
||||
is_metaconsole(),
|
||||
(is_metaconsole() && $id_server) ? true : false,
|
||||
false,
|
||||
false,
|
||||
$history
|
||||
|
|
|
@ -1436,9 +1436,11 @@ function graphic_combined_module(
|
|||
// Convert to array graph and weight.
|
||||
foreach ($array_data_module as $key => $value) {
|
||||
$array_data[$key] = $value;
|
||||
if ($params_combined['weight_list'][$i] > 1) {
|
||||
if ($params_combined['weight_list'][$i] != 1) {
|
||||
foreach ($value['data'] as $k => $v) {
|
||||
$array_data[$key]['data'][$k][1] = ($v[1] * $params_combined['weight_list'][$i]);
|
||||
if ($v[1] != false) {
|
||||
$array_data[$key]['data'][$k][1] = ($v[1] * $params_combined['weight_list'][$i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2437,7 +2437,7 @@ function ui_print_status_image($type, $title='', $return=false, $options=false,
|
|||
*/
|
||||
|
||||
|
||||
function ui_toggle($code, $name, $title='', $hidden_default=true, $return=false)
|
||||
function ui_toggle($code, $name, $title='', $hidden_default=true, $return=false, $toggle_class='')
|
||||
{
|
||||
// Generate unique Id
|
||||
$uniqid = uniqid('');
|
||||
|
@ -2458,12 +2458,11 @@ function ui_toggle($code, $name, $title='', $hidden_default=true, $return=false)
|
|||
// Link to toggle
|
||||
$output = '';
|
||||
$output .= '<a href="javascript:" id="tgl_ctrl_'.$uniqid.'">'.html_print_image($original, true, ['title' => $title, 'id' => 'image_'.$uniqid]).' <b>'.$name.'</b></a>';
|
||||
$output .= '<br />';
|
||||
|
||||
// $output .= '<br />';
|
||||
// if (!defined("METACONSOLE"))
|
||||
// $output .= '<br />';
|
||||
// Code into a div
|
||||
$output .= "<div id='tgl_div_".$uniqid."' style='".$style."'>\n";
|
||||
$output .= "<div id='tgl_div_".$uniqid."' style='".$style."' class='".$toggle_class."'>\n";
|
||||
$output .= $code;
|
||||
$output .= '</div>';
|
||||
|
||||
|
|
|
@ -19,8 +19,14 @@ function parse_alert_command(command, classs) {
|
|||
|
||||
var regex = new RegExp(field, "gi");
|
||||
|
||||
command = command.replace(regex, $(this).val());
|
||||
if ($(this).css("-webkit-text-security") == "disc") {
|
||||
var hidden_character = "*";
|
||||
var hidden_string = hidden_character.repeat($(this).val().length);
|
||||
|
||||
command = command.replace(regex, hidden_string);
|
||||
} else {
|
||||
command = command.replace(regex, $(this).val());
|
||||
}
|
||||
nfield++;
|
||||
});
|
||||
|
||||
|
|
|
@ -747,9 +747,11 @@ var TreeController = {
|
|||
}
|
||||
} else {
|
||||
try {
|
||||
winopeng(
|
||||
winopeng_var(
|
||||
element.moduleGraph.url,
|
||||
element.moduleGraph.handle
|
||||
element.moduleGraph.handle,
|
||||
1000,
|
||||
650
|
||||
);
|
||||
} catch (error) {
|
||||
// console.log(error);
|
||||
|
|
|
@ -125,4 +125,35 @@ final class EventsHistory extends Item
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generate a link to something related with the item.
|
||||
*
|
||||
* @param array $data Visual Console Item's data structure.
|
||||
*
|
||||
* @return mixed The link or a null value.
|
||||
*
|
||||
* @override Item::buildLink.
|
||||
*/
|
||||
protected static function buildLink(array $data)
|
||||
{
|
||||
// Get the linked agent and module Ids.
|
||||
$linkedModule = static::extractLinkedModule($data);
|
||||
$agentId = static::parseIntOr($linkedModule['agentId'], null);
|
||||
$moduleId = static::parseIntOr($linkedModule['moduleId'], null);
|
||||
|
||||
$baseUrl = \ui_get_full_url('index.php');
|
||||
|
||||
return $baseUrl.'?'.http_build_query(
|
||||
[
|
||||
'sec' => 'eventos',
|
||||
'sec2' => 'operation/events/events',
|
||||
'id_agent' => $agentId,
|
||||
'module_search_hidden' => $moduleId,
|
||||
'event_view_hr' => (static::extractMaxTime($data) / 3600),
|
||||
'status' => -1,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -383,22 +383,22 @@ final class Group extends Item
|
|||
|
||||
// Critical.
|
||||
$html .= '<div style="'.$valueStyle.'background-color: #FC4444;">';
|
||||
$html .= \number_format($agentStats['critical']).'%';
|
||||
$html .= \number_format($agentStats['critical'], 2).'%';
|
||||
$html .= '</div>';
|
||||
$html .= '<div style="'.$nameStyle.'">'.__('Critical').'</div>';
|
||||
// Warning.
|
||||
$html .= '<div style="'.$valueStyle.'background-color: #f8db3f;">';
|
||||
$html .= \number_format($agentStats['warning']).'%';
|
||||
$html .= \number_format($agentStats['warning'], 2).'%';
|
||||
$html .= '</div>';
|
||||
$html .= '<div style="'.$nameStyle.'">'.__('Warning').'</div>';
|
||||
// Normal.
|
||||
$html .= '<div style="'.$valueStyle.'background-color: #84b83c;">';
|
||||
$html .= \number_format($agentStats['normal']).'%';
|
||||
$html .= \number_format($agentStats['normal'], 2).'%';
|
||||
$html .= '</div>';
|
||||
$html .= '<div style="'.$nameStyle.'">'.__('Normal').'</div>';
|
||||
// Unknown.
|
||||
$html .= '<div style="'.$valueStyle.'background-color: #9d9ea0;">';
|
||||
$html .= \number_format($agentStats['unknown']).'%';
|
||||
$html .= \number_format($agentStats['unknown'], 2).'%';
|
||||
$html .= '</div>';
|
||||
$html .= '<div style="'.$nameStyle.'">'.__('Unknown').'</div>';
|
||||
|
||||
|
|
|
@ -226,12 +226,8 @@ final class Percentile extends Item
|
|||
);
|
||||
}
|
||||
|
||||
// Cast to float.
|
||||
$moduleValue = (float) $moduleValue;
|
||||
|
||||
// Store the module value.
|
||||
$data['value'] = $moduleValue;
|
||||
|
||||
$data['value'] = (float) \number_format((float) $moduleValue, (int) $config['graph_precision'], '.', '');
|
||||
$unit = \modules_get_unit($moduleId);
|
||||
if (empty($unit) === false) {
|
||||
$data['unit'] = \io_safe_output($unit);
|
||||
|
|
|
@ -230,8 +230,8 @@ final class StaticGraph extends Item
|
|||
if (!$isBooleanModule
|
||||
|| ($isBooleanModule && $showLastValueTooltip !== 'default')
|
||||
) {
|
||||
if (is_numeric($value)) {
|
||||
$imgTitle .= __('Last value: ').\remove_right_zeros($value);
|
||||
if (\is_numeric($value)) {
|
||||
$imgTitle .= __('Last value: ').\remove_right_zeros(\number_format((float) $value, (int) $config['graph_precision']));
|
||||
} else {
|
||||
$imgTitle .= __('Last value: ').$value;
|
||||
}
|
||||
|
|
|
@ -162,7 +162,7 @@ span.breadcrumb_link {
|
|||
|
||||
.edit_discovery_info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
align-items: flex-start;
|
||||
padding-top: 25px;
|
||||
}
|
||||
|
||||
|
@ -181,63 +181,41 @@ span.breadcrumb_link {
|
|||
|
||||
label {
|
||||
color: #343434 !important;
|
||||
font-size: 1.5em;
|
||||
font-family: "lato-bolder", "Open Sans", sans-serif !important;
|
||||
font-weight: bold;
|
||||
margin: 0px 0px 5px 0px;
|
||||
}
|
||||
|
||||
.discovery_full_width_input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
select {
|
||||
font-family: "lato-bolder", "Open Sans", sans-serif !important;
|
||||
font-size: 1.6em !important;
|
||||
color: #686868;
|
||||
li > input[type="text"],
|
||||
li > input[type="password"],
|
||||
.discovery_text_input > input[type="password"],
|
||||
.discovery_text_input > input[type="text"],
|
||||
#interval_manual > input[type="text"] {
|
||||
background-color: transparent !important;
|
||||
border: none;
|
||||
border-radius: 0 !important;
|
||||
border-bottom: 1px solid #343434;
|
||||
padding: 0px 0px 2px 0px;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
select > option {
|
||||
font-family: "lato-bolder", "Open Sans", sans-serif !important;
|
||||
font-size: 1em !important;
|
||||
}
|
||||
|
||||
li > input[type=text], li > input[type=password], .discovery_text_input > input[type=password], .discovery_text_input > input[type=text], #interval_manual > input[type=text] {
|
||||
background-color: transparent !important;
|
||||
border: none;
|
||||
border-radius: 0 !important;
|
||||
border-bottom: 1px solid #343434;
|
||||
padding: 0px 0px 2px 0px;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 4px;
|
||||
font-family: "lato-bolder", "Open Sans", sans-serif !important;
|
||||
font-size: 1.6em;
|
||||
}
|
||||
|
||||
li > input[type=text]:focus, li > input[type=password]:focus, .discovery_text_input > input[type=password]:focus, .discovery_text_input > input[type=text]:focus, #interval_manual > input[type=text]:focus {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#interval_manual > input[type=text] {
|
||||
#interval_manual > input[type="text"] {
|
||||
width: 50px;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.discovery_list_input {
|
||||
font-family: "lato-bolder", "Open Sans", sans-serif !important;
|
||||
font-size: 1.6em !important;
|
||||
color: #686868;
|
||||
width: 100%;
|
||||
height: 240px;
|
||||
border: 1px solid #CBCBCB;
|
||||
border: 1px solid #cbcbcb;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.discovery_list_input option {
|
||||
font-family: "lato-bolder", "Open Sans", sans-serif !important;
|
||||
font-size: 1.1em !important;
|
||||
padding-left: 30%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.discovery_list_input option:checked {
|
||||
|
@ -253,11 +231,9 @@ li > input[type=text]:focus, li > input[type=password]:focus, .discovery_text_in
|
|||
max-height: 100px;
|
||||
max-width: 100%;
|
||||
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
|
||||
-moz-box-sizing: border-box; /* Firefox, other Gecko */
|
||||
-moz-box-sizing: border-box; /* Firefox, other Gecko */
|
||||
box-sizing: border-box;
|
||||
resize: none;
|
||||
font-family: "lato-bolder", "Open Sans", sans-serif !important;
|
||||
font-size: 1.4em !important;
|
||||
}
|
||||
|
||||
a.tip {
|
||||
|
@ -270,4 +246,4 @@ a.tip {
|
|||
|
||||
.discovery_interval_select_width {
|
||||
width: 90%;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -266,6 +266,38 @@ th {
|
|||
letter-spacing: 0.3pt;
|
||||
}
|
||||
|
||||
/* Remove background when autocomplete */
|
||||
input:-webkit-autofill,
|
||||
input:-webkit-autofill:hover,
|
||||
input:-webkit-autofill:focus textarea:-webkit-autofill,
|
||||
textarea:-webkit-autofill:hover textarea:-webkit-autofill:focus,
|
||||
select:-webkit-autofill,
|
||||
select:-webkit-autofill:hover,
|
||||
select:-webkit-autofill:focus {
|
||||
-webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
|
||||
}
|
||||
|
||||
/* All select type multiple */
|
||||
select[multiple] option:checked,
|
||||
select[multiple] option:checked {
|
||||
background: #82b92e linear-gradient(0deg, #82b92e 0%, #82b92e 100%);
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
select option:checked,
|
||||
select option:checked {
|
||||
background-color: #82b92e;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
select > option:hover {
|
||||
background-color: #cbcbcb;
|
||||
}
|
||||
|
||||
select:-internal-list-box {
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* --- Font ttf --- */
|
||||
@font-face {
|
||||
font-family: "DejaVuSerif-BoldFont";
|
||||
|
@ -5011,28 +5043,6 @@ input:checked + .p-slider:before {
|
|||
text-align: center;
|
||||
}
|
||||
|
||||
select#autorefresh_list_out[multiple] option:checked,
|
||||
select#autorefresh_list[multiple] option:checked {
|
||||
background: #82b92e linear-gradient(0deg, #82b92e 0%, #82b92e 100%);
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
select#autorefresh_list_out option:checked,
|
||||
select#autorefresh_list option:checked {
|
||||
background-color: #82b92e;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
select#autorefresh_list_out > option:hover,
|
||||
select#autorefresh_list > option:hover {
|
||||
background-color: #cbcbcb;
|
||||
}
|
||||
|
||||
select#autorefresh_list_out:-internal-list-box,
|
||||
select#autorefresh_list:-internal-list-box {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.autorefresh_select .autorefresh_select_list_out,
|
||||
.autorefresh_select .autorefresh_select_list {
|
||||
width: 45%;
|
||||
|
@ -5510,3 +5520,339 @@ table.info_table.policy_sub_table {
|
|||
margin-top: 0px;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
/*
|
||||
* ---------------------------------------------------------------------
|
||||
* - Layout for the new forms
|
||||
* ---------------------------------------------------------------------
|
||||
*/
|
||||
.first_row {
|
||||
margin-bottom: 20px;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.label_simple_one_item {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
.label_simple_items {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.label_simple_items > * {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.input_label {
|
||||
color: #343434 !important;
|
||||
font-weight: bold;
|
||||
padding-right: 10px;
|
||||
margin: 0px 0px 5px 0px;
|
||||
}
|
||||
|
||||
.input_label_simple {
|
||||
margin-bottom: 0;
|
||||
margin-top: 0;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.label_select_parent {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.label_select_child_left {
|
||||
width: 80%;
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
.label_select_child_right {
|
||||
width: 20%;
|
||||
min-width: 140px;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.label_select_child_icons {
|
||||
text-align: right;
|
||||
width: 5%;
|
||||
min-width: 30px;
|
||||
}
|
||||
|
||||
/* Inputs type text shown as a black line */
|
||||
.agent_options input[type="text"] {
|
||||
background-color: transparent !important;
|
||||
border: none;
|
||||
border-radius: 0 !important;
|
||||
border-bottom: 1px solid #343434;
|
||||
padding: 2px 5px;
|
||||
box-sizing: border-box;
|
||||
background-repeat: no-repeat;
|
||||
background-position: left bottom 2px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
/*
|
||||
* ---------------------------------------------------------------------
|
||||
* - Create/Update Agent - agent_manager.php
|
||||
* ---------------------------------------------------------------------
|
||||
*/
|
||||
.agent_options {
|
||||
width: 100%;
|
||||
margin-right: 0px;
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.agent_options_update {
|
||||
width: 85%;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.agent_options_column_left,
|
||||
.agent_options_column_right {
|
||||
width: 50%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.agent_options_column_left {
|
||||
padding-right: 50px;
|
||||
}
|
||||
|
||||
.agent_qr {
|
||||
width: 15%;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
padding: 20px 0px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
min-width: 150px;
|
||||
}
|
||||
|
||||
a#qr_code_agent_view {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.first_row .agent_options_column_right select,
|
||||
.first_row .agent_options_column_right input,
|
||||
.first_row .agent_options_column_left select#grupo {
|
||||
width: 95%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.first_row .agent_options_column_left .p-switch {
|
||||
margin-right: 5px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.agent_options_column_left input#text-direccion,
|
||||
.agent_options_column_left select#address_list,
|
||||
.agent_options_column_left input#text-agente,
|
||||
.agent_options_column_left input#text-alias {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.agent_options_agent_name > * {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.custom_fields_table {
|
||||
border-spacing: 0px;
|
||||
}
|
||||
|
||||
.custom_fields_table tr.datos {
|
||||
background-color: #f7f7f7;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.custom_fields_table tr.datos2 {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.custom_fields_table tr td {
|
||||
border: 1px solid #e0e0e0;
|
||||
}
|
||||
|
||||
.custom_fields_table tr.datos2 td div.field_title {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.custom_fields_table tr.datos2 td {
|
||||
border-radius: 4px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.custom_fields_table tr.datos td {
|
||||
padding: 15px 10px;
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
.custom_fields_table .custom_field_row_opened td {
|
||||
border-bottom-left-radius: 0px !important;
|
||||
border-bottom-right-radius: 0px !important;
|
||||
}
|
||||
|
||||
.secondary_groups_select {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.secondary_groups_select .secondary_groups_select_arrows input {
|
||||
display: grid;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.secondary_groups_select .secondary_groups_list_left {
|
||||
text-align: right;
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.secondary_groups_select .secondary_groups_list_right {
|
||||
text-align: left;
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.secondary_groups_select .secondary_groups_select_arrows {
|
||||
padding: 0 50px;
|
||||
}
|
||||
|
||||
.secondary_groups_select_arrows a {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.agent_options_adv .agent_options_column_right .label_select select,
|
||||
.agent_options_adv .agent_options_column_right .label_select input[type="text"],
|
||||
.agent_options_adv #text-custom_id,
|
||||
.agent_options_adv #cps {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.agent_options_adv .label_select_simple.label_simple_one_item .p-switch {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
/*
|
||||
* ---------------------------------------------------------------------
|
||||
* - CLASSES FOR THE NEW TOGGLES -
|
||||
* ---------------------------------------------------------------------
|
||||
*/
|
||||
.ui_toggle {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.ui_toggle > a:first-child {
|
||||
background-color: #fff;
|
||||
border: 1px solid #f3f3f3;
|
||||
border-top-left-radius: 4px;
|
||||
border-top-right-radius: 4px;
|
||||
padding: 5px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.white_box_opened {
|
||||
border-top-left-radius: 0px;
|
||||
border-top-right-radius: 0px;
|
||||
}
|
||||
|
||||
/*
|
||||
* ---------------------------------------------------------------------
|
||||
* - SWITCH RADIO BUTTONS -
|
||||
* ---------------------------------------------------------------------
|
||||
*/
|
||||
.switch_radio_button {
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.switch_radio_button input {
|
||||
position: absolute !important;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
height: 1px;
|
||||
width: 1px;
|
||||
border: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.switch_radio_button label {
|
||||
background-color: #fff;
|
||||
color: rgba(0, 0, 0, 0.6);
|
||||
line-height: 1;
|
||||
text-align: center;
|
||||
padding: 7px 14px;
|
||||
margin-right: -1px;
|
||||
border: 1px solid #cbcbcb;
|
||||
border-radius: 4px;
|
||||
transition: all 0.1s ease-in-out;
|
||||
}
|
||||
|
||||
.switch_radio_button label:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.switch_radio_button input:checked + label {
|
||||
background-color: #82b92e;
|
||||
box-shadow: none;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.switch_radio_button label:last-child {
|
||||
margin-right: 0px;
|
||||
}
|
||||
|
||||
/*
|
||||
* ---------------------------------------------------------------------
|
||||
* - MODULE GRAPHS
|
||||
* ---------------------------------------------------------------------
|
||||
*/
|
||||
.module_graph_menu_dropdown {
|
||||
padding-top: 20px;
|
||||
padding-bottom: 20px;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
width: 100%;
|
||||
z-index: 1001;
|
||||
}
|
||||
|
||||
.module_graph_menu_content,
|
||||
.module_graph_menu_header {
|
||||
width: 92%;
|
||||
border: 1px solid #e2e2e2;
|
||||
margin: 0 auto;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.module_graph_menu_header {
|
||||
border-top-left-radius: 4px;
|
||||
border-top-right-radius: 4px;
|
||||
padding: 6px 10px;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.module_graph_menu_header span > img {
|
||||
vertical-align: middle;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.module_graph_menu_content {
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
padding: 15px;
|
||||
border-top: none;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,8 @@ ul.wizard {
|
|||
}
|
||||
|
||||
ul.wizard li {
|
||||
padding: 10px;
|
||||
padding-bottom: 10px;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
ul.wizard li > label:not(.p-switch) {
|
||||
|
|
|
@ -72,6 +72,10 @@
|
|||
|
||||
/* Analog clock */
|
||||
|
||||
.visual-console-item .analogic-clock {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.visual-console-item .analogic-clock .hour-hand {
|
||||
-webkit-animation: rotate-hour 43200s infinite linear;
|
||||
animation: rotate-hour 43200s infinite linear;
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"sources":["webpack:///main.css","webpack:///styles.css"],"names":[],"mappings":"AAAA;EACE,gBAAgB;EAChB,kBAAkB;EAClB,4BAA4B;EAC5B,0BAA0B;EAC1B,2BAA2B;AAC7B;;AAEA;EACE,kBAAkB;EAClB,oBAAa;EAAb,oBAAa;EAAb,aAAa;EACb,2BAAuB;EAAvB,8BAAuB;MAAvB,2BAAuB;UAAvB,uBAAuB;EACvB,qBAAqB;EACrB,yBAAmB;MAAnB,sBAAmB;UAAnB,mBAAmB;EACnB,yBAAiB;KAAjB,sBAAiB;MAAjB,qBAAiB;UAAjB,iBAAiB;AACnB;;ACfA;EACE,wBAAwB;EACxB,0BAA2B;AAC7B;;AAEA,kBAAkB;;AAElB;EACE,oBAAa;EAAb,oBAAa;EAAb,aAAa;EACb,4BAAsB;EAAtB,6BAAsB;MAAtB,0BAAsB;UAAtB,sBAAsB;EACtB,wBAAuB;MAAvB,qBAAuB;UAAvB,uBAAuB;EACvB,qBAAqB;EACrB,0BAAqB;MAArB,qBAAqB;EACrB,yBAAmB;MAAnB,sBAAmB;UAAnB,mBAAmB;AACrB;;AAEA;EACE,6DAA6D;EAC7D,eAAe;;EAEf,0BAA0B;EAC1B,mCAAmC;EACnC,kCAAkC;EAClC,kCAAkC;EAClC,wCAAwC;AAC1C;;AAEA;EACE,eAAe;AACjB;;AAEA;EACE,eAAe;AACjB;;AAEA,iBAAiB;;AAEjB;EACE,qDAA6C;UAA7C,6CAA6C;AAC/C;;AAEA;EACE,sDAA8C;UAA9C,8CAA8C;AAChD;;AAEA;EACE,oDAA4C;UAA5C,4CAA4C;AAC9C","file":"vc.main.css","sourcesContent":["#visual-console-container {\n margin: 0px auto;\n position: relative;\n background-repeat: no-repeat;\n background-size: 100% 100%;\n background-position: center;\n}\n\n.visual-console-item {\n position: absolute;\n display: flex;\n flex-direction: initial;\n justify-items: center;\n align-items: center;\n user-select: text;\n}\n","@font-face {\n font-family: Alarm Clock;\n src: url(./alarm-clock.ttf);\n}\n\n/* Digital clock */\n\n.visual-console-item .digital-clock {\n display: flex;\n flex-direction: column;\n justify-content: center;\n justify-items: center;\n align-content: center;\n align-items: center;\n}\n\n.visual-console-item .digital-clock > span {\n font-family: \"Alarm Clock\", \"Courier New\", Courier, monospace;\n font-size: 50px;\n\n /* To improve legibility */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n text-shadow: rgba(0, 0, 0, 0.01) 0 0 1px;\n}\n\n.visual-console-item .digital-clock > span.date {\n font-size: 25px;\n}\n\n.visual-console-item .digital-clock > span.timezone {\n font-size: 25px;\n}\n\n/* Analog clock */\n\n.visual-console-item .analogic-clock .hour-hand {\n animation: rotate-hour 43200s infinite linear;\n}\n\n.visual-console-item .analogic-clock .minute-hand {\n animation: rotate-minute 3600s infinite linear;\n}\n\n.visual-console-item .analogic-clock .second-hand {\n animation: rotate-second 60s infinite linear;\n}\n"],"sourceRoot":""}
|
||||
{"version":3,"sources":["webpack:///main.css","webpack:///styles.css"],"names":[],"mappings":"AAAA;EACE,gBAAgB;EAChB,kBAAkB;EAClB,4BAA4B;EAC5B,wBAAwB;AAC1B;;AAEA;EACE,kBAAkB;EAClB,oBAAa;EAAb,oBAAa;EAAb,aAAa;EACb,2BAAuB;EAAvB,8BAAuB;MAAvB,2BAAuB;UAAvB,uBAAuB;EACvB,qBAAqB;EACrB,yBAAmB;MAAnB,sBAAmB;UAAnB,mBAAmB;EACnB,yBAAiB;KAAjB,sBAAiB;MAAjB,qBAAiB;UAAjB,iBAAiB;AACnB;;ACdA;EACE,wBAAwB;EACxB,0BAA2B;AAC7B;;AAEA,kBAAkB;;AAElB;EACE,oBAAa;EAAb,oBAAa;EAAb,aAAa;EACb,4BAAsB;EAAtB,6BAAsB;MAAtB,0BAAsB;UAAtB,sBAAsB;EACtB,wBAAuB;MAAvB,qBAAuB;UAAvB,uBAAuB;EACvB,qBAAqB;EACrB,0BAAqB;MAArB,qBAAqB;EACrB,yBAAmB;MAAnB,sBAAmB;UAAnB,mBAAmB;AACrB;;AAEA;EACE,6DAA6D;EAC7D,eAAe;;EAEf,0BAA0B;EAC1B,mCAAmC;EACnC,kCAAkC;EAClC,kCAAkC;EAClC,wCAAwC;AAC1C;;AAEA;EACE,eAAe;AACjB;;AAEA;EACE,eAAe;AACjB;;AAEA,iBAAiB;;AAEjB;EACE,kBAAkB;AACpB;;AAEA;EACE,qDAA6C;UAA7C,6CAA6C;AAC/C;;AAEA;EACE,sDAA8C;UAA9C,8CAA8C;AAChD;;AAEA;EACE,oDAA4C;UAA5C,4CAA4C;AAC9C","file":"vc.main.css","sourcesContent":["#visual-console-container {\n margin: 0px auto;\n position: relative;\n background-repeat: no-repeat;\n background-size: contain;\n}\n\n.visual-console-item {\n position: absolute;\n display: flex;\n flex-direction: initial;\n justify-items: center;\n align-items: center;\n user-select: text;\n}\n","@font-face {\n font-family: Alarm Clock;\n src: url(./alarm-clock.ttf);\n}\n\n/* Digital clock */\n\n.visual-console-item .digital-clock {\n display: flex;\n flex-direction: column;\n justify-content: center;\n justify-items: center;\n align-content: center;\n align-items: center;\n}\n\n.visual-console-item .digital-clock > span {\n font-family: \"Alarm Clock\", \"Courier New\", Courier, monospace;\n font-size: 50px;\n\n /* To improve legibility */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n text-shadow: rgba(0, 0, 0, 0.01) 0 0 1px;\n}\n\n.visual-console-item .digital-clock > span.date {\n font-size: 25px;\n}\n\n.visual-console-item .digital-clock > span.timezone {\n font-size: 25px;\n}\n\n/* Analog clock */\n\n.visual-console-item .analogic-clock {\n text-align: center;\n}\n\n.visual-console-item .analogic-clock .hour-hand {\n animation: rotate-hour 43200s infinite linear;\n}\n\n.visual-console-item .analogic-clock .minute-hand {\n animation: rotate-minute 3600s infinite linear;\n}\n\n.visual-console-item .analogic-clock .second-hand {\n animation: rotate-second 60s infinite linear;\n}\n"],"sourceRoot":""}
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -129,7 +129,7 @@
|
|||
<div style='height: 10px'>
|
||||
<?php
|
||||
$version = '7.0NG.734';
|
||||
$build = '190509';
|
||||
$build = '190514';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
|
|
@ -96,7 +96,7 @@ if ($refresh > 0) {
|
|||
-->
|
||||
</script>
|
||||
</head>
|
||||
<body bgcolor="#ffffff" style='background:#ffffff;'>
|
||||
<body style='background:#ffffff;'>
|
||||
<?php
|
||||
// ACL
|
||||
$all_groups = agents_get_all_groups_agent($agent_id);
|
||||
|
@ -136,7 +136,8 @@ if ($date > $now) {
|
|||
|
||||
$urlImage = ui_get_full_url(false);
|
||||
|
||||
echo '<div style="margin-left: 70px; padding-top: 10px;">';
|
||||
// Graph.
|
||||
echo '<div style="padding-top:80px;">';
|
||||
|
||||
$height = 400;
|
||||
$width = '90%';
|
||||
|
@ -177,27 +178,14 @@ if ($date > $now) {
|
|||
|
||||
echo '</div>';
|
||||
|
||||
//
|
||||
// SIDE MENU
|
||||
//
|
||||
$side_layer_params = [];
|
||||
// TOP TEXT
|
||||
$side_layer_params['top_text'] = "<div style='color: white; width: 100%; text-align: center; font-weight: bold; vertical-align: top;'>".html_print_image('/images/config.disabled.png', true, ['width' => '16px'], false, false, false, true).' '.__('Graph configuration menu').'</div>';
|
||||
$side_layer_params['body_text'] = "<div class='menu_sidebar_outer'>";
|
||||
$side_layer_params['body_text'] .= __('Please, make your changes and apply with the <i>Reload</i> button');
|
||||
|
||||
// MENU
|
||||
$side_layer_params['body_text'] .= '<form method="get" action="interface_traffic_graph_win.php">';
|
||||
$side_layer_params['body_text'] .= html_print_input_hidden('params', base64_encode($params_json), true);
|
||||
|
||||
// FORM TABLE
|
||||
$table = html_get_predefined_table('transparent', 2);
|
||||
$table->width = '98%';
|
||||
$table->width = '100%';
|
||||
$table->id = 'stat_win_form_div';
|
||||
$table->style[0] = 'text-align:left; padding: 7px;';
|
||||
$table->style[0] = 'text-align:left;';
|
||||
$table->style[1] = 'text-align:left;';
|
||||
$table->styleTable = 'border-spacing: 4px;';
|
||||
$table->class = 'alternate';
|
||||
$table->styleTable = 'margin-bottom: 20px;';
|
||||
$table->class = 'events_show_more_table';
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Refresh time');
|
||||
|
@ -255,40 +243,32 @@ if ($date > $now) {
|
|||
$table->rowclass[] = '';
|
||||
|
||||
$form_table = html_print_table($table, true);
|
||||
$form_table .= '<div style="width:100%; text-align:right;">'.html_print_submit_button(
|
||||
__('Reload'),
|
||||
'submit',
|
||||
false,
|
||||
'class="sub upd"',
|
||||
true
|
||||
).'</div>';
|
||||
|
||||
unset($table);
|
||||
|
||||
$table->id = 'stat_win_form';
|
||||
$table->width = '100%';
|
||||
$table->cellspacing = 2;
|
||||
$table->cellpadding = 2;
|
||||
$table->class = 'databox';
|
||||
// Menu.
|
||||
$menu_form = "<form method='get' action='interface_traffic_graph_win.php'>".html_print_input_hidden('params', base64_encode($params_json), true);
|
||||
|
||||
$data = [];
|
||||
$data[0] = html_print_div(['content' => $form_table, 'style' => 'overflow: auto; height: 220px'], true);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
if (!empty($server_id)) {
|
||||
$menu_form .= html_print_input_hidden('server', $server_id, true);
|
||||
}
|
||||
|
||||
$data = [];
|
||||
$data[0] = '<div style="width:100%; text-align:right;">'.html_print_submit_button(__('Reload'), 'submit', false, 'class="sub upd"', true).'</div>';
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
$side_layer_params['body_text'] .= html_print_table($table, true);
|
||||
$side_layer_params['body_text'] .= '</form>';
|
||||
$side_layer_params['body_text'] .= '</div>';
|
||||
// outer
|
||||
// ICONS
|
||||
$side_layer_params['icon_closed'] = '/images/graphmenu_arrow_hide.png';
|
||||
$side_layer_params['icon_open'] = '/images/graphmenu_arrow.png';
|
||||
|
||||
// SIZE
|
||||
$side_layer_params['width'] = 500;
|
||||
|
||||
// POSITION
|
||||
$side_layer_params['position'] = 'left';
|
||||
|
||||
html_print_side_layer($side_layer_params);
|
||||
echo $menu_form;
|
||||
echo '<div class="module_graph_menu_dropdown">
|
||||
<div id="module_graph_menu_header" class="module_graph_menu_header">
|
||||
'.html_print_image('images/arrow_down_green.png', true, ['class' => 'module_graph_menu_arrow', 'float' => 'left'], false, false, true).'
|
||||
<span>'.__('Graph configuration menu').ui_print_help_icon('graphs', true, $config['homeurl'], 'images/help_g.png', true).'</span>
|
||||
'.html_print_image('images/config.png', true, ['float' => 'right'], false, false, true).'
|
||||
</div>
|
||||
<div class="module_graph_menu_content module_graph_menu_content_closed" style="display:none;">'.$form_table.'</div>
|
||||
</div>';
|
||||
echo '</form>';
|
||||
|
||||
// Hidden div to forced title
|
||||
html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', 'hidden' => true]);
|
||||
|
@ -341,4 +321,22 @@ ui_include_time_picker(true);
|
|||
$.datepicker.setDefaults($.datepicker.regional["<?php echo $custom_user_language; ?>"]);
|
||||
|
||||
forced_title_callback();
|
||||
|
||||
// Menu.
|
||||
$('#module_graph_menu_header').on('click', function(){
|
||||
var arrow = $('#module_graph_menu_header .module_graph_menu_arrow');
|
||||
var arrow_up = 'arrow_up_green';
|
||||
var arrow_down = 'arrow_down_green';
|
||||
if( $('.module_graph_menu_content').hasClass('module_graph_menu_content_closed')){
|
||||
$('.module_graph_menu_content').show();
|
||||
$('.module_graph_menu_content').removeClass('module_graph_menu_content_closed');
|
||||
arrow.attr('src',arrow.attr('src').replace(arrow_down, arrow_up));
|
||||
}
|
||||
else{
|
||||
$('.module_graph_menu_content').hide();
|
||||
$('.module_graph_menu_content').addClass('module_graph_menu_content_closed');
|
||||
arrow.attr('src',arrow.attr('src').replace(arrow_up, arrow_down));
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
|
@ -89,7 +89,7 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent);
|
|||
};
|
||||
</script>
|
||||
</head>
|
||||
<body bgcolor="#ffffff" style='background:#ffffff;'>
|
||||
<body style='background:#ffffff;'>
|
||||
|
||||
<?php
|
||||
echo "<div id='dialog' title='".__('CSV Export Information')."' style='visibility:hidden;'>";
|
||||
|
@ -175,8 +175,9 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent);
|
|||
|
||||
$unit = db_get_value('unit', 'tagente_modulo', 'id_agente_modulo', $id);
|
||||
|
||||
echo '<div style="margin-left: 65px; padding-top: 10px;">';
|
||||
|
||||
// Graph.
|
||||
echo '<div style="padding-top: 60px;">';
|
||||
$width = '90%';
|
||||
$height = '450';
|
||||
|
||||
|
@ -228,39 +229,16 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent);
|
|||
|
||||
echo '</div>';
|
||||
|
||||
//
|
||||
// SIDE MENU
|
||||
//
|
||||
$params = [];
|
||||
// TOP TEXT
|
||||
// Use the no_meta parameter because this image is only in the base console
|
||||
$params['top_text'] = "<div style='color: white; width: 100%; text-align: center; font-weight: bold; vertical-align: top;'>".html_print_image('images/wrench_blanco.png', true, ['width' => '16px'], false, false, true).' '.__('Graph configuration menu').ui_print_help_icon('graphs', true, $config['homeurl'], 'images/help_w.png', true).'</div>';
|
||||
$params['body_text'] = "<div class='menu_sidebar_outer'>";
|
||||
$params['body_text'] .= __('Please, make your changes and apply with the <i>Reload</i> button');
|
||||
|
||||
// MENU
|
||||
$params['body_text'] .= '<form method="get" action="stat_win.php">';
|
||||
$params['body_text'] .= html_print_input_hidden('id', $id, true);
|
||||
$params['body_text'] .= html_print_input_hidden('label', $label, true);
|
||||
|
||||
if (!empty($server_id)) {
|
||||
$params['body_text'] .= html_print_input_hidden('server', $server_id, true);
|
||||
}
|
||||
|
||||
if (isset($_GET['type'])) {
|
||||
$type = get_parameter_get('type');
|
||||
$params['body_text'] .= html_print_input_hidden('type', $type, true);
|
||||
}
|
||||
|
||||
// FORM TABLE
|
||||
// FORM TABLE.
|
||||
$table = html_get_predefined_table('transparent', 2);
|
||||
$table->width = '98%';
|
||||
$table->width = '100%';
|
||||
$table->id = 'stat_win_form_div';
|
||||
$table->style[0] = 'text-align:left; padding: 7px;';
|
||||
$table->style[0] = 'text-align:left;';
|
||||
$table->style[1] = 'text-align:left;';
|
||||
// $table->size[0] = '50%';
|
||||
$table->styleTable = 'border-spacing: 4px;';
|
||||
$table->class = 'alternate';
|
||||
$table->styleTable = 'margin-bottom: 20px;';
|
||||
$table->class = 'events_show_more_table';
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Refresh time');
|
||||
|
@ -407,42 +385,29 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent);
|
|||
true
|
||||
).'</div>';
|
||||
|
||||
unset($table);
|
||||
|
||||
$table = new stdClass();
|
||||
$table->id = 'stat_win_form';
|
||||
$table->width = '100%';
|
||||
$table->cellspacing = 2;
|
||||
$table->cellpadding = 2;
|
||||
$table->class = 'databox';
|
||||
// Menu.
|
||||
$menu_form = "<form method='get' action='stat_win.php'>".html_print_input_hidden('id', $id, true).html_print_input_hidden('label', $label, true);
|
||||
|
||||
$data = [];
|
||||
$data[0] = html_print_div(
|
||||
[
|
||||
'id' => 'field_list',
|
||||
'content' => $form_table,
|
||||
'style' => 'overflow: auto; height: 220px',
|
||||
],
|
||||
true
|
||||
);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
if (!empty($server_id)) {
|
||||
$menu_form .= html_print_input_hidden('server', $server_id, true);
|
||||
}
|
||||
|
||||
$params['body_text'] .= html_print_table($table, true);
|
||||
$params['body_text'] .= '</form>';
|
||||
$params['body_text'] .= '</div>';
|
||||
// outer
|
||||
// ICONS
|
||||
$params['icon_closed'] = '/images/graphmenu_arrow_hide.png';
|
||||
$params['icon_open'] = '/images/graphmenu_arrow.png';
|
||||
if (isset($_GET['type'])) {
|
||||
$type = get_parameter_get('type');
|
||||
$menu_form .= html_print_input_hidden('type', $type, true);
|
||||
}
|
||||
|
||||
// SIZE
|
||||
$params['width'] = 500;
|
||||
|
||||
// POSITION
|
||||
$params['position'] = 'left';
|
||||
|
||||
html_print_side_layer($params);
|
||||
echo $menu_form;
|
||||
echo '<div class="module_graph_menu_dropdown">
|
||||
<div id="module_graph_menu_header" class="module_graph_menu_header">
|
||||
'.html_print_image('images/arrow_down_green.png', true, ['class' => 'module_graph_menu_arrow', 'float' => 'left'], false, false, true).'
|
||||
<span>'.__('Graph configuration menu').ui_print_help_icon('graphs', true, $config['homeurl'], 'images/help_g.png', true).'</span>
|
||||
'.html_print_image('images/config.png', true, ['float' => 'right'], false, false, true).'
|
||||
</div>
|
||||
<div class="module_graph_menu_content module_graph_menu_content_closed" style="display:none;">'.$form_table.'</div>
|
||||
</div>';
|
||||
echo '</form>';
|
||||
|
||||
// Hidden div to forced title
|
||||
html_print_div(
|
||||
|
@ -491,11 +456,21 @@ ui_include_time_picker(true);
|
|||
|
||||
$.datepicker.setDefaults($.datepicker.regional["<?php echo $custom_user_language; ?>"]);
|
||||
|
||||
$(window).ready(function() {
|
||||
$("#field_list").css('height', ($(window).height() - 160) + 'px');
|
||||
// Menu.
|
||||
$('#module_graph_menu_header').on('click', function(){
|
||||
var arrow = $('#module_graph_menu_header .module_graph_menu_arrow');
|
||||
var arrow_up = 'arrow_up_green';
|
||||
var arrow_down = 'arrow_down_green';
|
||||
if( $('.module_graph_menu_content').hasClass('module_graph_menu_content_closed')){
|
||||
$('.module_graph_menu_content').show();
|
||||
$('.module_graph_menu_content').removeClass('module_graph_menu_content_closed');
|
||||
arrow.attr('src',arrow.attr('src').replace(arrow_down, arrow_up));
|
||||
}
|
||||
else{
|
||||
$('.module_graph_menu_content').hide();
|
||||
$('.module_graph_menu_content').addClass('module_graph_menu_content_closed');
|
||||
arrow.attr('src',arrow.attr('src').replace(arrow_up, arrow_down));
|
||||
}
|
||||
});
|
||||
|
||||
$(window).resize(function() {
|
||||
$("#field_list").css('height', ($(document).height() - 160) + 'px');
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.734
|
||||
%define release 190509
|
||||
%define release 190514
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.734
|
||||
%define release 190509
|
||||
%define release 190514
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.734
|
||||
%define release 190509
|
||||
%define release 190514
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
|
|
@ -378,6 +378,7 @@ CREATE TABLE IF NOT EXISTS `talert_commands` (
|
|||
`internal` tinyint(1) default 0,
|
||||
`fields_descriptions` TEXT,
|
||||
`fields_values` TEXT,
|
||||
`fields_hidden` TEXT,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
@ -448,7 +449,7 @@ CREATE TABLE IF NOT EXISTS `talert_templates` (
|
|||
`field13` text NOT NULL,
|
||||
`field14` text NOT NULL,
|
||||
`field15` text NOT NULL,
|
||||
`type` ENUM ('regex', 'max_min', 'max', 'min', 'equal', 'not_equal', 'warning', 'critical', 'onchange', 'unknown', 'always'),
|
||||
`type` ENUM ('regex', 'max_min', 'max', 'min', 'equal', 'not_equal', 'warning', 'critical', 'onchange', 'unknown', 'always', 'not_normal'),
|
||||
`value` varchar(255) default '',
|
||||
`matches_value` tinyint(1) default 0,
|
||||
`max_value` double(18,2) default NULL,
|
||||
|
|
|
@ -114,10 +114,10 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
|
|||
('custom_report_front_logo', 'images/pandora_logo_white.jpg'),
|
||||
('custom_report_front_header', ''),
|
||||
('custom_report_front_footer', ''),
|
||||
('MR', 27),
|
||||
('MR', 28),
|
||||
('identification_reminder', 1),
|
||||
('identification_reminder_timestamp', 0),
|
||||
('current_package_enterprise', '734'),
|
||||
('current_package_enterprise', '735'),
|
||||
('post_process_custom_values', '{"0.00000038580247":"Seconds to months","0.00000165343915":"Seconds to weeks","0.00001157407407":"Seconds to days","0.01666666666667":"Seconds to minutes","0.00000000093132":"Bytes to Gigabytes","0.00000095367432":"Bytes to Megabytes","0.0009765625":"Bytes to Kilobytes","0.00000001653439":"Timeticks to weeks","0.00000011574074":"Timeticks to days"}'),
|
||||
('custom_docs_logo', 'default_docs.png'),
|
||||
('custom_support_logo', 'default_support.png'),
|
||||
|
@ -1158,7 +1158,7 @@ INSERT INTO `tagent_custom_fields` VALUES (1,'Serial Number',0,0,''),(2,'De
|
|||
|
||||
INSERT INTO `ttag` VALUES (1,'network','Network equipment','http://artica.es','',''),(2,'critical','Critical modules','','',''),(3,'dmz','DMZ Network Zone','','',''),(4,'performance','Performance anda capacity modules','','',''),(5,'configuration','','','','');
|
||||
|
||||
INSERT INTO `tevent_response` VALUES (1,'Ping to host','Ping to the agent host','ping -c 5 _agent_address_','command',0,620,500,0,'',0),(3,'Create incident from event','Create a incident from the event with the standard incidents system of Pandora FMS','index.php?sec=workspace&sec2=operation/incidents/incident_detail&insert_form&from_event=_event_id_','url',0,0,0,1,'',0),(4,'Create Integria IMS incident from event','Create a incident from the event with integria incidents system of Pandora FMS. 

Is necessary to enable and configure the Integria incidents in Pandora FMS setup.','index.php?sec=workspace&sec2=operation/integria_incidents/incident&tab=editor&from_event=_event_id_','url',0,0,0,1,'',0),(5,'Restart agent','Restart the agent with using UDP protocol.

To use this response is necessary to have installed Pandora FMS server and console in the same machine.','/usr/share/pandora_server/util/udp_client.pl _agent_address_ 41122 "REFRESH AGENT"','command',0,620,500,0,'',0),(6,'Ping to module agent host','Ping to the module agent host','ping -c 5 _module_address_','command',0,620,500,0,'',0);
|
||||
INSERT INTO `tevent_response` VALUES (1,'Ping to host','Ping to the agent host','ping -c 5 _agent_address_','command',0,620,500,0,'',0),(3,'Create incident from event','Create a incident from the event with the standard incidents system of Pandora FMS','index.php?sec=workspace&sec2=operation/incidents/incident_detail&insert_form&from_event=_event_id_','url',0,0,0,1,'',0),(5,'Restart agent','Restart the agent with using UDP protocol.

To use this response is necessary to have installed Pandora FMS server and console in the same machine.','/usr/share/pandora_server/util/udp_client.pl _agent_address_ 41122 "REFRESH AGENT"','command',0,620,500,0,'',0),(6,'Ping to module agent host','Ping to the module agent host','ping -c 5 _module_address_','command',0,620,500,0,'',0);
|
||||
|
||||
INSERT INTO `tupdate_settings` VALUES ('current_update', '412'), ('customer_key', 'PANDORA-FREE'), ('updating_binary_path', 'Path where the updated binary files will be stored'), ('updating_code_path', 'Path where the updated code is stored'), ('dbname', ''), ('dbhost', ''), ('dbpass', ''), ('dbuser', ''), ('dbport', ''), ('proxy', ''), ('proxy_port', ''), ('proxy_user', ''), ('proxy_pass', '');
|
||||
|
||||
|
@ -1315,4 +1315,4 @@ INSERT INTO `tnotification_source_user`(`id_source`,`id_user`,`enabled`,`also_ma
|
|||
|
||||
INSERT INTO `tnotification_source_group` SELECT `id`,0 FROM `tnotification_source` WHERE `description`="Message";
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-server
|
||||
Version: 7.0NG.734-190509
|
||||
Version: 7.0NG.734-190514
|
||||
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.734-190509"
|
||||
pandora_version="7.0NG.734-190514"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -45,7 +45,7 @@ our @EXPORT = qw(
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.734";
|
||||
my $pandora_build = "190509";
|
||||
my $pandora_build = "190514";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
|
|
@ -391,7 +391,11 @@ sub pandora_generate_alerts ($$$$$$$$;$$$) {
|
|||
}
|
||||
|
||||
# Get enabled alerts associated with this module
|
||||
my $alert_type_filter = defined ($alert_type) ? " AND type = '$alert_type'" : '';
|
||||
my $alert_type_filter = '';
|
||||
if (defined($alert_type)) {
|
||||
# not_normal includes unknown!
|
||||
$alert_type_filter = $alert_type eq 'unknown' ? " AND (type = 'unknown' OR type = 'not_normal')" : " AND type = '$alert_type'";
|
||||
}
|
||||
my @alerts = get_db_rows ($dbh, '
|
||||
SELECT talert_template_modules.id as id_template_module,
|
||||
talert_template_modules.*, talert_templates.*
|
||||
|
@ -566,6 +570,7 @@ sub pandora_evaluate_alert ($$$$$$$;$$$) {
|
|||
return $status if ($last_status != 1 && $alert->{'type'} eq 'critical');
|
||||
return $status if ($last_status != 2 && $alert->{'type'} eq 'warning');
|
||||
return $status if ($last_status != 3 && $alert->{'type'} eq 'unknown');
|
||||
return $status if ($last_status == 0 && $alert->{'type'} eq 'not_normal');
|
||||
}
|
||||
# Event alert
|
||||
else {
|
||||
|
@ -4238,7 +4243,7 @@ sub get_module_status ($$$) {
|
|||
$critical_str = (defined ($critical_str) && valid_regex ($critical_str) == 1) ? safe_output($critical_str) : '';
|
||||
$warning_str = (defined ($warning_str) && valid_regex ($warning_str) == 1) ? safe_output($warning_str) : '';
|
||||
|
||||
if ($module_type =~ m/_proc$/ && ($critical_min eq $critical_max)) {
|
||||
if (($module_type =~ m/_proc$/ || $module_type =~ /web_analysis/) && ($critical_min eq $critical_max)) {
|
||||
($critical_min, $critical_max) = (0, 1);
|
||||
}
|
||||
elsif ($module_type =~ m/keep_alive/ && ($critical_min eq $critical_max)) {
|
||||
|
|
|
@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.734";
|
||||
my $pandora_build = "190509";
|
||||
my $pandora_build = "190514";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.734
|
||||
%define release 190509
|
||||
%define release 190514
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.734
|
||||
%define release 190509
|
||||
%define release 190514
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.734"
|
||||
PI_BUILD="190509"
|
||||
PI_BUILD="190514"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
|
|
@ -34,7 +34,7 @@ use PandoraFMS::Config;
|
|||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.734 PS190509";
|
||||
my $version = "7.0NG.734 PS190514";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
|
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
|||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.734 PS190509";
|
||||
my $version = "7.0NG.734 PS190514";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
|
|
@ -218,6 +218,12 @@ export default class Clock extends Item<ClockProps> {
|
|||
|
||||
const { width, height } = this.getElementSize(); // Destructuring assigment: http://es6-features.org/#ObjectMatchingShorthandNotation
|
||||
|
||||
// Calculate font size to adapt the font to the item size.
|
||||
const baseTimeFontSize = 20; // Per 100px of width.
|
||||
const dateFontSizeMultiplier = 0.5;
|
||||
const dateFontSize =
|
||||
(baseTimeFontSize * dateFontSizeMultiplier * width) / 100;
|
||||
|
||||
const div = document.createElement("div");
|
||||
div.className = "analogic-clock";
|
||||
div.style.width = `${width}px`;
|
||||
|
@ -468,6 +474,16 @@ export default class Clock extends Item<ClockProps> {
|
|||
// Add the clock to the container
|
||||
div.append(svg);
|
||||
|
||||
// Date.
|
||||
if (this.props.clockFormat === "datetime") {
|
||||
const dateElem: HTMLSpanElement = document.createElement("span");
|
||||
dateElem.className = "date";
|
||||
dateElem.textContent = humanDate(date, "default");
|
||||
dateElem.style.fontSize = `${dateFontSize}px`;
|
||||
if (this.props.color) dateElem.style.color = this.props.color;
|
||||
div.append(dateElem);
|
||||
}
|
||||
|
||||
return div;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,6 +35,10 @@
|
|||
|
||||
/* Analog clock */
|
||||
|
||||
.visual-console-item .analogic-clock {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.visual-console-item .analogic-clock .hour-hand {
|
||||
animation: rotate-hour 43200s infinite linear;
|
||||
}
|
||||
|
|
|
@ -115,6 +115,15 @@ export default class Percentile extends Item<PercentileProps> {
|
|||
// SVG container.
|
||||
const svg = document.createElementNS(svgNS, "svg");
|
||||
|
||||
var formatValue;
|
||||
if (this.props.value != null) {
|
||||
if (Intl) {
|
||||
formatValue = Intl.NumberFormat("en-EN").format(this.props.value);
|
||||
} else {
|
||||
formatValue = this.props.value;
|
||||
}
|
||||
}
|
||||
|
||||
switch (this.props.percentileType) {
|
||||
case "progress-bar":
|
||||
{
|
||||
|
@ -142,9 +151,11 @@ export default class Percentile extends Item<PercentileProps> {
|
|||
text.setAttribute("fill", colors.text);
|
||||
|
||||
if (this.props.valueType === "value") {
|
||||
text.style.fontSize = "6pt";
|
||||
|
||||
text.textContent = this.props.unit
|
||||
? `${this.props.value} ${this.props.unit}`
|
||||
: `${this.props.value}`;
|
||||
? `${formatValue} ${this.props.unit}`
|
||||
: `${formatValue}`;
|
||||
} else {
|
||||
text.textContent = `${progress}%`;
|
||||
}
|
||||
|
@ -215,21 +226,24 @@ export default class Percentile extends Item<PercentileProps> {
|
|||
text.setAttribute("font-weight", "bold");
|
||||
text.setAttribute("fill", colors.text);
|
||||
|
||||
if (this.props.valueType === "value") {
|
||||
if (this.props.valueType === "value" && this.props.value != null) {
|
||||
// Show value and unit in 1 (no unit) or 2 lines.
|
||||
if (this.props.unit && this.props.unit.length > 0) {
|
||||
const value = document.createElementNS(svgNS, "tspan");
|
||||
value.setAttribute("x", "0");
|
||||
value.setAttribute("dy", "1em");
|
||||
value.textContent = `${this.props.value}`;
|
||||
value.textContent = `${formatValue}`;
|
||||
value.style.fontSize = "8pt";
|
||||
const unit = document.createElementNS(svgNS, "tspan");
|
||||
unit.setAttribute("x", "0");
|
||||
unit.setAttribute("dy", "1em");
|
||||
unit.textContent = `${this.props.unit}`;
|
||||
unit.style.fontSize = "8pt";
|
||||
text.append(value, unit);
|
||||
text.setAttribute("transform", "translate(50 33)");
|
||||
} else {
|
||||
text.textContent = `${this.props.value}`;
|
||||
text.textContent = `${formatValue}`;
|
||||
text.style.fontSize = "8pt";
|
||||
text.setAttribute("transform", "translate(50 50)");
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue