nombre())) {
if ($message === true) {
return 'The agent name already exists in DB.';
}
@@ -2064,7 +2064,7 @@ function api_set_new_agent($id_node, $thrash2, $other, $trhash3, $return=false,
}
}
- if ($return === false) {
+ if ($return !== true) {
returnData(
'string',
[
diff --git a/pandora_console/include/functions_cron_task.php b/pandora_console/include/functions_cron_task.php
index 40a6e159cc..042d79dad7 100644
--- a/pandora_console/include/functions_cron_task.php
+++ b/pandora_console/include/functions_cron_task.php
@@ -383,6 +383,13 @@ function cron_task_run(
$nameday = strtolower($datetime->format('l'));
}
}
+ } else if (empty($old_args['first_execution']) === false) {
+ $datetime = new DateTime();
+ $datetime->setTimestamp($old_args['first_execution']);
+ $datetime->modify('+7 day');
+ $weekly_date = $datetime->format('Y-m-d');
+ $weekly_time = $datetime->format('H:i:s');
+ $old_args['first_execution'] = strtotime($weekly_date.' '.$weekly_time);
}
} else {
// Add it to next execution.
diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php
index acbc12d304..cd22b55f1b 100644
--- a/pandora_console/include/functions_events.php
+++ b/pandora_console/include/functions_events.php
@@ -1318,7 +1318,7 @@ function events_get_all(
if ($tags[0] === $id_tag) {
$_tmp .= ' AND (( ';
} else {
- $_tmp .= ' OR ( ';
+ $_tmp .= ' AND ( ';
}
$_tmp .= sprintf(
@@ -1969,7 +1969,7 @@ function events_get_all(
// -1 For pagination 'All'.
((int) $limit === -1)
? $end = count($data)
- : $end = ((int) $offset !== 0) ? ($offset + $limit) : $limit;
+ : $end = $limit;
$finally = array_slice($data, $offset, $end, true);
$return = [
'buffers' => $buffers,
diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php
index 06ab07598d..bb6a785812 100644
--- a/pandora_console/include/functions_html.php
+++ b/pandora_console/include/functions_html.php
@@ -774,7 +774,8 @@ function html_print_select(
$select2_multiple_enable_all=false,
$form='',
$order=false,
- $custom_id=null
+ $custom_id=null,
+ $placeholder='',
) {
$output = "\n";
@@ -1013,7 +1014,8 @@ function html_print_select(
$output .= '
\ No newline at end of file
diff --git a/pandora_console/operation/search_agents.getdata.php b/pandora_console/operation/search_agents.getdata.php
index 0284f8e738..7e6128edf5 100644
--- a/pandora_console/operation/search_agents.getdata.php
+++ b/pandora_console/operation/search_agents.getdata.php
@@ -170,12 +170,26 @@ if ($searchAgents) {
}
foreach ($agents as $key => $agent) {
+ $agent_quiet = '';
+ if ((bool) $agent['quiet'] === true) {
+ $agent_quiet = html_print_image(
+ 'images/dot_blue.png',
+ true,
+ [
+ 'border' => '0',
+ 'title' => __('Quiet'),
+ 'alt' => '',
+ 'class' => 'mrgn_lft_5px',
+ ]
+ );
+ }
+
if ($agent['disabled']) {
$agents[$key]['agent'] = '
'.ucfirst(strtolower($agent['alias'])).''.ui_print_help_tip(__('Disabled'), true).'';
+ title="'.$agent['id_agente'].'">
'.ucfirst(strtolower($agent['alias'])).''.ui_print_help_tip(__('Disabled'), true).''.$agent_quiet;
} else {
$agents[$key]['agent'] = '
'.ucfirst(strtolower($agent['alias'])).'';
+ title='.$agent['nombre'].'>
'.ucfirst(strtolower($agent['alias'])).''.$agent_quiet;
}
$agents[$key]['os'] = ui_print_os_icon($agent['id_os'], false, true);
diff --git a/pandora_console/operation/search_results.php b/pandora_console/operation/search_results.php
index 76638e3525..3903ddca19 100644
--- a/pandora_console/operation/search_results.php
+++ b/pandora_console/operation/search_results.php
@@ -33,7 +33,7 @@ foreach ($arrayKeywords as $keyword) {
array_push($temp, '%'.$keyword.'%');
}
-$stringSearchSQL = implode(' ', $temp);
+$stringSearchSQL = implode('', $temp);
$stringSearchSQL = str_replace('_', '\_', $stringSearchSQL);
$_SESSION['stringSearchSQL'] = $stringSearchSQL;
@@ -206,7 +206,7 @@ ui_print_standard_header(
);
$only_count = false;
-
+hd(io_safe_input($_SESSION['stringSearchSQL']), true);
switch ($searchTab) {
case 'main':
$only_count = true;
diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec
index c5f8dbeeda..10d8ffa8ff 100644
--- a/pandora_console/pandora_console.redhat.spec
+++ b/pandora_console/pandora_console.redhat.spec
@@ -6,7 +6,7 @@
%define debug_package %{nil}
%define name pandorafms_console
%define version 7.0NG.775
-%define release 240117
+%define release 240119
# User and Group under which Apache is running
%define httpd_name httpd
diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec
index 5f5f50c73b..3ddd0ab7d7 100644
--- a/pandora_console/pandora_console.rhel7.spec
+++ b/pandora_console/pandora_console.rhel7.spec
@@ -6,7 +6,7 @@
%define debug_package %{nil}
%define name pandorafms_console
%define version 7.0NG.775
-%define release 240117
+%define release 240119
# User and Group under which Apache is running
%define httpd_name httpd
diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec
index 2ef1567d6c..cf12b9032e 100644
--- a/pandora_console/pandora_console.spec
+++ b/pandora_console/pandora_console.spec
@@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.775
-%define release 240117
+%define release 240119
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2
diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql
index 697dd2a3d9..792ca2770c 100644
--- a/pandora_console/pandoradb.sql
+++ b/pandora_console/pandoradb.sql
@@ -1294,7 +1294,7 @@ CREATE TABLE IF NOT EXISTS `tusuario` (
`section` TEXT,
`data_section` TEXT,
`metaconsole_section` VARCHAR(255) NOT NULL DEFAULT 'Default',
- `metaconsole_data_section` VARCHAR(255) NOT NULL DEFAULT '',
+ `metaconsole_data_section` TEXT,
`force_change_pass` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`last_pass_change` DATETIME,
`last_failed_login` DATETIME,
diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql
index a7df8d9764..19e3c16aa9 100644
--- a/pandora_console/pandoradb_data.sql
+++ b/pandora_console/pandoradb_data.sql
@@ -2841,8 +2841,8 @@ INSERT INTO `treport_content` (`id_rc`,`id_report`,`id_gs`,`id_agent_module`,`ty
(2,1,0,0,'top_n',28800,0,2,'Top CPU per agent','',0,'<p>This type of report implies loading a lot of data. Therefore it is recommended for scheduled reports, not real-time view.</p>',NULL,0,'','','','00:00:00','00:00:00',1,1,1,1,1,1,1,0,3,10,0,10,0,1,1,0,'{"show_in_same_row":0,"hide_notinit_agents":0,"priority_mode":"1","dyn_height":"250","text_agent":"Lio=","text_agent_module":"Y3B1Lio="}',0,0,'',0,0,300,0,0,NULL,NULL,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,NULL,NULL,1,0,0,NULL),
(3,1,0,0,'event_report_group',21600,0,3,'General event report','This is a sample of not normal events for any agent available in the last 6 hours',0,'<p>This type of report implies loading a lot of data. Therefore it is recommended for scheduled reports, not real-time view.</p>',NULL,0,'','','','00:00:00','00:00:00',1,1,1,1,1,1,1,0,0,10,0,10,0,0,0,0,'{"show_in_same_row":0,"hide_notinit_agents":0,"priority_mode":"1","dyn_height":"250","server_multiple":"\"\"","show_summary_group":0,"filter_event_severity":"[\"20\"]","filter_event_type":"[\"all\"]","filter_event_status":"[\"-1\"]","event_graph_by_agent":"1","event_graph_by_user_validator":"1","event_graph_by_criticity":"1","event_graph_validated_vs_unvalidated":0,"event_filter_search":"","event_filter_exclude":"","custom_data_events":"1","label":""}',0,0,'',0,0,300,0,0,NULL,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,NULL,NULL,1,0,0,NULL);
INSERT INTO `tdashboard` (`id`,`name`,`id_user`,`id_group`,`active`,`cells`,`cells_slideshow`) VALUES
- (1,'Sample Dashboard #1','',0,0,0,0),
- (2,'Sample Dashboard #2','',0,0,0,0);
+ (1,'Sample Dashboard #1','',0,0,7,0),
+ (2,'Sample Dashboard #2','',0,0,10,0);
INSERT INTO `twidget_dashboard` (`id`,`position`,`options`,`order`,`id_dashboard`,`id_widget`,`prop_width`,`prop_height`) VALUES
(1,'{\"x\":\"0\",\"y\":\"0\",\"width\":\"4\",\"height\":\"4\"}','{\"title\":\"Agents hive\",\"background\":\"#ffffff\",\"groups\":[\"12,8,4,9,2,10,13,11\"]}',0,1,1,0.32,0.32),
(2,'{\"x\":\"4\",\"y\":\"0\",\"width\":\"3\",\"height\":\"4\"}','{\"title\":\"Clock\",\"background\":\"#ffffff\",\"clockType\":\"analogic\"}',1,1,12,0.32,0.32),
diff --git a/pandora_console/views/dashboard/header.php b/pandora_console/views/dashboard/header.php
index f59391a083..6dce805533 100644
--- a/pandora_console/views/dashboard/header.php
+++ b/pandora_console/views/dashboard/header.php
@@ -214,7 +214,7 @@ $enable_disable['text'] = html_print_div(
);
// New Widget.
-$newWidget['text'] = '
';
+$newWidget['text'] = '';
$newWidget['text'] .= html_print_image(
'images/plus@svg.svg',
true,
diff --git a/pandora_console/views/dashboard/list.php b/pandora_console/views/dashboard/list.php
index aae6778f6d..aaf675e64a 100644
--- a/pandora_console/views/dashboard/list.php
+++ b/pandora_console/views/dashboard/list.php
@@ -112,7 +112,11 @@ if (empty($dashboards) === true) {
'manageDashboards' => $manageDashboards,
],
'default_pagination' => $config['block_size'],
- 'no_sortable_columns' => [],
+ 'no_sortable_columns' => [
+ 4,
+ 5,
+ 6,
+ ],
'order' => [
'field' => 'name',
'direction' => 'desc',
diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control
index b9f9bdb9a7..02299d83a4 100644
--- a/pandora_server/DEBIAN/control
+++ b/pandora_server/DEBIAN/control
@@ -1,5 +1,5 @@
package: pandorafms-server
-Version: 7.0NG.775-240117
+Version: 7.0NG.775-240119
Architecture: all
Priority: optional
Section: admin
diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh
index 2d84c1d127..0238427ed3 100644
--- a/pandora_server/DEBIAN/make_deb_package.sh
+++ b/pandora_server/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-pandora_version="7.0NG.775-240117"
+pandora_version="7.0NG.775-240119"
package_cpan=0
package_pandora=1
diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm
index e518b9e038..8363918d50 100644
--- a/pandora_server/lib/PandoraFMS/Config.pm
+++ b/pandora_server/lib/PandoraFMS/Config.pm
@@ -46,7 +46,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.775";
-my $pandora_build = "240117";
+my $pandora_build = "240119";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash
diff --git a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm
index 6c2927f2a6..c50fa2e8f8 100644
--- a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm
+++ b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm
@@ -1662,9 +1662,6 @@ sub PandoraFMS::Recon::Base::report_scanned_agents($;$) {
$os_id = $self->guess_os($data->{'agent'}{'direccion'});
}
- if (is_empty($data->{'agent'}{'os_version'})) {
- $data->{'agent'}{'os_version'} = $self->guess_os($data->{'agent'}{'direccion'}, undef, 1);
- }
$self->call('message', "Agent accepted: ".$data->{'agent'}{'nombre'}, 5);
@@ -2022,8 +2019,14 @@ sub PandoraFMS::Recon::Base::report_scanned_agents($;$) {
# Retrieve target agent OS.
$self->{'agents_found'}->{$addr}{'agent'}{'id_os'} = $self->guess_os($addr);
+ my $os_version = $self->get_os_version($addr);
+
+ if (is_empty($os_version)) {
+ $os_version = $self->guess_os($addr, undef, 1);
+ }
+
# Retrieve target agent OS version.
- $self->{'agents_found'}->{$addr}{'agent'}{'os_version'} = $self->get_os_version($addr);
+ $self->{'agents_found'}->{$addr}{'agent'}{'os_version'} = $os_version;
$self->call('update_progress', $progress);
$progress += $step;
diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm
index 86e7c3cd58..1c17df468e 100644
--- a/pandora_server/lib/PandoraFMS/PluginTools.pm
+++ b/pandora_server/lib/PandoraFMS/PluginTools.pm
@@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.775";
-my $pandora_build = "240117";
+my $pandora_build = "240119";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec
index 6461867d48..aaa11cd9d1 100644
--- a/pandora_server/pandora_server.redhat.spec
+++ b/pandora_server/pandora_server.redhat.spec
@@ -7,7 +7,7 @@
%define debug_package %{nil}
%define name pandorafms_server
%define version 7.0NG.775
-%define release 240117
+%define release 240119
Summary: Pandora FMS Server
Name: %{name}
diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec
index c07fdbd3db..cc280a9d3c 100644
--- a/pandora_server/pandora_server.spec
+++ b/pandora_server/pandora_server.spec
@@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.775
-%define release 240117
+%define release 240119
Summary: Pandora FMS Server
Name: %{name}
diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer
index 50ba633f64..dcb9bf7a41 100755
--- a/pandora_server/pandora_server_installer
+++ b/pandora_server/pandora_server_installer
@@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.775"
-PI_BUILD="240117"
+PI_BUILD="240119"
MODE=$1
if [ $# -gt 1 ]; then
diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl
index 0ffa9fb970..662d00deac 100755
--- a/pandora_server/util/pandora_db.pl
+++ b/pandora_server/util/pandora_db.pl
@@ -38,7 +38,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
-my $version = "7.0NG.775 Build 240117";
+my $version = "7.0NG.775 Build 240119";
# Pandora server configuration
my %conf;
diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl
index 1a4bf702df..dfa6b177fc 100755
--- a/pandora_server/util/pandora_manage.pl
+++ b/pandora_server/util/pandora_manage.pl
@@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
-my $version = "7.0NG.775 Build 240117";
+my $version = "7.0NG.775 Build 240119";
# save program name for logging
my $progname = basename($0);
@@ -264,7 +264,7 @@ sub help_screen{
########################################################################
#
########################################################################
-sub api_call($$$;$$$$) {
+sub manage_api_call($$$;$$$$) {
my ($pa_config, $op, $op2, $id, $id2, $other, $return_type) = @_;
my $content = undef;
@@ -400,7 +400,7 @@ sub pandora_disable_group ($$$) {
foreach my $id_agent (@agents_bd) {
# Call the API.
- $result += api_call(
+ $result += manage_api_call(
$conf, 'set', 'disabled_and_standby', $id_agent->{'id_agente'}, $server, '1|1'
);
}
@@ -2261,7 +2261,7 @@ sub cli_module_group_synch() {
if ($return_type eq '') {
$return_type = 'csv';
}
- my $result = api_call(\%conf,'set', 'module_group_synch', undef, undef, "$other", $return_type);
+ my $result = manage_api_call(\%conf,'set', 'module_group_synch', undef, undef, "$other", $return_type);
print "$result \n\n ";
}
@@ -2329,7 +2329,7 @@ sub cli_create_network_component() {
my $other2 = join('|', @todo2);
# Call the API.
- my $result = api_call( $conf, 'set', 'new_network_component', $c_name, undef, "$c_type|$other|$c_group|$other2");
+ my $result = manage_api_call( $conf, 'set', 'new_network_component', $c_name, undef, "$c_type|$other|$c_group|$other2");
print "$result \n\n ";
}
@@ -4337,7 +4337,7 @@ sub cli_get_alert_actions() {
if ($return_type eq '') {
$return_type = 'csv';
}
- my $result = api_call(\%conf,'get', 'alert_actions', undef, undef, "$action_name|$separator",$return_type);
+ my $result = manage_api_call(\%conf,'get', 'alert_actions', undef, undef, "$action_name|$separator",$return_type);
print "$result \n\n ";
}
@@ -4352,7 +4352,7 @@ sub cli_get_alert_actions_meta() {
$return_type = 'csv';
}
- my $result = api_call(\%conf,'get', 'alert_actions_meta', undef, undef, "$server_name|$action_name|$separator",$return_type);
+ my $result = manage_api_call(\%conf,'get', 'alert_actions_meta', undef, undef, "$server_name|$action_name|$separator",$return_type);
print "$result \n\n ";
}
@@ -4574,7 +4574,7 @@ sub cli_create_event() {
sub cli_update_event_custom_id() {
my ($id_event, $event_custom_id) = @ARGV[2..3];
- my $result = api_call(\%conf, 'set', 'event_custom_id', $id_event, $event_custom_id);
+ my $result = manage_api_call(\%conf, 'set', 'event_custom_id', $id_event, $event_custom_id);
print "\n$result\n";
}
@@ -4866,7 +4866,7 @@ sub cli_apply_policy() {
my ($id_policy, $id_agent, $name, $id_server) = @ARGV[2..5];
# Call the API.
- my $result = api_call(\%conf, 'set', 'apply_policy', $id_policy, $id_agent, "$name|$id_server");
+ my $result = manage_api_call(\%conf, 'set', 'apply_policy', $id_policy, $id_agent, "$name|$id_server");
print "\n$result\n";
}
@@ -6039,7 +6039,7 @@ sub cli_policy_add_agent() {
sub cli_policy_delete_agent() {
my ($policy_id, $agent_id) = @ARGV[2..3];
- my $result = api_call(\%conf,'set', 'remove_agent_from_policy', $policy_id, $agent_id);
+ my $result = manage_api_call(\%conf,'set', 'remove_agent_from_policy', $policy_id, $agent_id);
print "$result \n\n ";
}
@@ -6049,7 +6049,7 @@ sub cli_create_planned_downtime() {
my @todo = @ARGV[3..21];
my $other = join('|', @todo);
- my $result = api_call(\%conf,'set', 'planned_downtimes_created', $name, undef, "$other");
+ my $result = manage_api_call(\%conf,'set', 'planned_downtimes_created', $name, undef, "$other");
print "$result \n\n ";
}
@@ -6063,7 +6063,7 @@ sub cli_add_item_planned_downtime() {
my $other_modules = join(';', @modules);
my $other = $other_agents . "|" . $other_modules;
- my $result = api_call(\%conf,'set', 'planned_downtimes_additem', $id, undef, "$other");
+ my $result = manage_api_call(\%conf,'set', 'planned_downtimes_additem', $id, undef, "$other");
print_log "$result \n\n";
}
@@ -8662,7 +8662,7 @@ sub cli_create_tag() {
my ($tag_name, $tag_description, $tag_url, $tag_email) = @ARGV[2..5];
# Call the API.
- my $result = api_call(\%conf, 'set', 'create_tag', undef, undef, "$tag_name|$tag_description|$tag_url|$tag_email");
+ my $result = manage_api_call(\%conf, 'set', 'create_tag', undef, undef, "$tag_name|$tag_description|$tag_url|$tag_email");
print "\n$result\n";
}
@@ -8699,7 +8699,7 @@ sub cli_add_tag_to_user_profile() {
exist_check($user_profile_id, 'given profile and group combination for user', $user_id);
# Call the API.
- my $result = api_call(\%conf, 'set', 'tag_user_profile', $user_id, $tag_id, "$group_id|$profile_id");
+ my $result = manage_api_call(\%conf, 'set', 'tag_user_profile', $user_id, $tag_id, "$group_id|$profile_id");
print "\n$result\n";
}
@@ -8723,7 +8723,7 @@ sub cli_add_tag_to_module() {
exist_check($module_id, 'module name', $module_name);
# Call the API.
- my $result = api_call(\%conf, 'set', 'add_tag_module', $module_id, $tag_id);
+ my $result = manage_api_call(\%conf, 'set', 'add_tag_module', $module_id, $tag_id);
print "\n$result\n";
}
@@ -8742,7 +8742,7 @@ sub cli_migration_agent_queue() {
}
# Call the API.
- my $result = api_call( $conf, 'set', 'migrate_agent', $id_agent, 0, "$source_name|$target_name|$only_db" );
+ my $result = manage_api_call( $conf, 'set', 'migrate_agent', $id_agent, 0, "$source_name|$target_name|$only_db" );
print "\n$result\n";
}
@@ -8757,7 +8757,7 @@ sub cli_migration_agent() {
}
# Call the API.
- my $result = api_call( $conf, 'get', 'migrate_agent', $id_agent);
+ my $result = manage_api_call( $conf, 'get', 'migrate_agent', $id_agent);
if( defined($result) && "$result" ne "" ){
print "\n1\n";
@@ -8866,7 +8866,7 @@ sub cli_new_cluster() {
my ($cluster_name,$cluster_type,$description,$group_id) = @ARGV[2..5];
# Call the API.
- my $result = api_call( $conf, 'set', 'new_cluster', undef, undef, "$cluster_name|$cluster_type|$description|$group_id");
+ my $result = manage_api_call( $conf, 'set', 'new_cluster', undef, undef, "$cluster_name|$cluster_type|$description|$group_id");
if( defined($result) && "$result" ne "" ){
print "\n1\n";
@@ -8884,7 +8884,7 @@ sub cli_add_cluster_agent() {
my ($other) = @ARGV[2..2];
# Call the API.
- my $result = api_call( $conf, 'set', 'add_cluster_agent', undef, undef, $other);
+ my $result = manage_api_call( $conf, 'set', 'add_cluster_agent', undef, undef, $other);
if( defined($result) && "$result" ne "" ){
print "\n1\n";
@@ -8902,7 +8902,7 @@ sub cli_add_cluster_item() {
my ($other) = @ARGV[2..2];
# Call the API.
- my $result = api_call( $conf, 'set', 'add_cluster_item', undef, undef, $other);
+ my $result = manage_api_call( $conf, 'set', 'add_cluster_item', undef, undef, $other);
if( defined($result) && "$result" ne "" ){
print "\n1\n";
@@ -8920,7 +8920,7 @@ sub cli_delete_cluster() {
my ($id) = @ARGV[2..2];
# Call the API.
- my $result = api_call( $conf, 'set', 'delete_cluster', $id);
+ my $result = manage_api_call( $conf, 'set', 'delete_cluster', $id);
if( defined($result) && "$result" ne "" ){
print "\n1\n";
@@ -8938,7 +8938,7 @@ sub cli_delete_cluster_agent() {
my ($id_agent,$id_cluster) = @ARGV[2..3];
# Call the API.
- my $result = api_call( $conf, 'set', 'delete_cluster_agent', undef, undef, "$id_agent|$id_cluster");
+ my $result = manage_api_call( $conf, 'set', 'delete_cluster_agent', undef, undef, "$id_agent|$id_cluster");
if( defined($result) && "$result" ne "" ){
print "\n1\n";
@@ -8956,7 +8956,7 @@ sub cli_delete_cluster_item() {
my ($id) = @ARGV[2..2];
# Call the API.
- my $result = api_call( $conf, 'set', 'delete_cluster_item', $id);
+ my $result = manage_api_call( $conf, 'set', 'delete_cluster_item', $id);
if( defined($result) && "$result" ne "" ){
print "\n1\n";
@@ -8975,7 +8975,7 @@ sub cli_get_cluster_status() {
my ($id) = @ARGV[2..2];
# Call the API.
- my $result = api_call( $conf, 'get', 'cluster_status', $id);
+ my $result = manage_api_call( $conf, 'get', 'cluster_status', $id);
if( defined($result) && "$result" ne "" ){
print "\n1\n";
@@ -8996,7 +8996,7 @@ sub cli_set_disabled_and_standby() {
$value = 1 unless defined($value); #Set to disabled by default
# Call the API.
- my $result = api_call(
+ my $result = manage_api_call(
$conf, 'set', 'disabled_and_standby', $id, $id_node, $value
);
@@ -9012,7 +9012,7 @@ sub cli_set_disabled_and_standby() {
sub cli_reset_agent_counts() {
my $agent_id = @ARGV[2];
- my $result = api_call(\%conf,'set', 'reset_agent_counts', $agent_id);
+ my $result = manage_api_call(\%conf,'set', 'reset_agent_counts', $agent_id);
print "$result \n\n ";
}
@@ -9027,7 +9027,7 @@ sub cli_event_in_progress() {
my $event_id = @ARGV[2];
# Call the API.
- my $result = api_call(
+ my $result = manage_api_call(
$conf, 'set', 'event_in_progress', $event_id
);
@@ -9097,7 +9097,7 @@ sub cli_get_gis_agent(){
my $agent_id = @ARGV[2];
- my $result = api_call(\%conf,'get', 'gis_agent', $agent_id);
+ my $result = manage_api_call(\%conf,'get', 'gis_agent', $agent_id);
print "$result \n\n ";
}
@@ -9113,7 +9113,7 @@ sub cli_insert_gis_data(){
my @position = @ARGV[3..5];
my $other = join('|', @position);
- my $result = api_call(\%conf,'set', 'gis_agent_only_position', $agent_id, undef, "$other");
+ my $result = manage_api_call(\%conf,'set', 'gis_agent_only_position', $agent_id, undef, "$other");
print "$result \n\n ";
}
diff --git a/visual_console_client/src/Item.ts b/visual_console_client/src/Item.ts
index f0849c94a6..bf37145805 100644
--- a/visual_console_client/src/Item.ts
+++ b/visual_console_client/src/Item.ts
@@ -851,12 +851,14 @@ abstract class VisualConsoleItem {
const newLabelHtml = this.createLabelDomElement().innerHTML;
if (oldLabelHtml !== newLabelHtml) {
this.labelElementRef.innerHTML = newLabelHtml;
+ this.changeLabelPosition(this.itemProps.labelPosition);
+ } else {
+ // Change label position.
+ if (!prevProps || prevProps.labelPosition !== this.props.labelPosition) {
+ this.changeLabelPosition(this.props.labelPosition);
+ }
}
- // Change label position.
- if (!prevProps || prevProps.labelPosition !== this.props.labelPosition) {
- this.changeLabelPosition(this.props.labelPosition);
- }
//Change z-index class is-on-top
if (!prevProps || prevProps.isOnTop !== this.props.isOnTop) {
if (this.props.isOnTop) {