#11051 Fix conflict css

This commit is contained in:
miguel angel rasteu 2023-08-21 09:01:05 +02:00
commit ebd98b479d
23 changed files with 234 additions and 113 deletions

View File

@ -25,7 +25,7 @@ Requires(preun): chkconfig /bin/rm /usr/sbin/userdel
Requires: coreutils unzip Requires: coreutils unzip
Requires: util-linux procps grep Requires: util-linux procps grep
Requires: /sbin/ip /bin/awk Requires: /sbin/ip /bin/awk
Requires: perl(Sys::Syslog) perl(IO::Compress::Zip) Requires: perl(Sys::Syslog) perl(IO::Compress::Zip) perl(File::Copy) perl(Sys::Hostname)
# Required by plugins # Required by plugins
#Requires: sh-utils sed passwd net-tools rpm #Requires: sh-utils sed passwd net-tools rpm
AutoReq: 0 AutoReq: 0

View File

@ -26,9 +26,7 @@ Requires(preun): chkconfig /bin/rm /usr/sbin/userdel
Requires: coreutils unzip Requires: coreutils unzip
Requires: util-linux procps grep Requires: util-linux procps grep
Requires: /sbin/ip /bin/awk Requires: /sbin/ip /bin/awk
Requires: perl(Sys::Syslog) perl(IO::Compress::Zip) #Requires: libnsl
# Required by plugins
#Requires: sh-utils sed passwd net-tools rpm
AutoReq: 0 AutoReq: 0
Provides: %{name}-%{version} Provides: %{name}-%{version}

View File

@ -366,59 +366,37 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
$header_autorefresh_counter .= '</div>'; $header_autorefresh_counter .= '</div>';
} }
// Button for feedback pandora. $modal_box = '<div id="modal_help" class="invisible">
if (enterprise_installed() && $config['activate_feedback']) { <div id="modal-feedback-form" class="invisible"></div>
$header_feedback = '<div id="feedback-icon-header">'; <div id="msg-header" class="invisible"></div>
$header_feedback .= '<div id="modal-feedback-form" class="invisible"></div>'; <a href="https://pandorafms.com/manual" target="_blank">'.__('Pandora documentation').'</a>';
$header_feedback .= '<div id="msg-header" class="invisible"></div>'; if (enterprise_installed() === true) {
$header_feedback .= html_print_image( $modal_box .= '<a href="https://support.pandorafms.com/" target="_blank">'.__('Enterprise support ').'</a>';
'images/send_feedback@header.svg', $modal_box .= '<a href="#" id="feedback-header">'.__('Give us feedback').'</a>';
true,
[
'class' => 'main_menu_icon invert_filter',
'title' => __('Feedback'),
'id' => 'feedback-header',
'alt' => __('Feedback'),
'style' => 'cursor: pointer;',
]
);
$header_feedback .= '</div>';
}
// Support.
if (enterprise_installed()) {
$header_support_link = $config['custom_support_url'];
} else { } else {
$header_support_link = 'https://pandorafms.com/forums/'; $modal_box .= '<a href="https://pandorafms.com/community/forums/" target="_blank">'.__('Community Support').'</a>';
} }
$header_support = '<div id="header_support">'; $modal_box .= '<hr class="separator" />';
$header_support .= '<a href="'.ui_get_full_external_url($header_support_link).'" target="_blank">'; $modal_box .= '<a href="https://github.com/pandorafms/pandorafms/issues" target="_blank">'.__('Open an issue in Github').'</a>';
$header_support .= html_print_image( $modal_box .= '<a href="https://discord.com/invite/xVt2ruSxmr" target="_blank">'.__('Join discord community').'</a>';
'images/support@header.svg', $modal_box .= '</div>';
true,
[
'title' => __('Go to support'),
'class' => 'main_menu_icon bot invert_filter',
'alt' => 'user',
]
);
$header_support .= '</a></div>';
// Documentation. $modal_help = html_print_div(
$header_docu = '<div id="header_docu">';
$header_docu .= '<a href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank">';
$header_docu .= html_print_image(
'images/documentation@header.svg',
true,
[ [
'title' => __('Go to documentation'), 'id' => 'modal-help-content',
'class' => 'main_menu_icon bot invert_filter', 'content' => html_print_image(
'alt' => 'user', 'images/help@header.svg',
] true,
[
'title' => __('Help'),
'class' => 'main_menu_icon bot invert_filter',
'alt' => 'user',
]
).$modal_box,
],
true,
); );
$header_docu .= '</a></div>';
// User. // User.
@ -472,11 +450,11 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
echo '</span>'; echo '</span>';
echo '</div>'; echo '</div>';
echo '<div class="header_center"></div>'; echo '<div class="header_center"></div>';
echo '<div class="header_right">'.$header_support, $header_docu, $header_user, $header_logout.'</div>'; echo '<div class="header_right">'.$modal_help, $header_user, $header_logout.'</div>';
} else { } else {
echo '<div class="header_left"><span class="header_title">'.$config['custom_title_header'].'</span><span class="header_subtitle">'.$config['custom_subtitle_header'].'</span></div> echo '<div class="header_left"><span class="header_title">'.$config['custom_title_header'].'</span><span class="header_subtitle">'.$config['custom_subtitle_header'].'</span></div>
<div class="header_center">'.$header_searchbar.'</div> <div class="header_center">'.$header_searchbar.'</div>
<div class="header_right">'.$header_autorefresh, $header_autorefresh_counter, $header_discovery, $header_welcome, $servers_list, $header_feedback, $header_support, $header_docu, $header_user, $header_logout.'</div>'; <div class="header_right">'.$header_autorefresh, $header_autorefresh_counter, $header_discovery, $header_welcome, $servers_list, $modal_help, $header_user, $header_logout.'</div>';
} }
?> ?>
</div> <!-- Closes #table_header_inner --> </div> <!-- Closes #table_header_inner -->
@ -1008,8 +986,6 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
<?php if (enterprise_installed()) { ?> <?php if (enterprise_installed()) { ?>
// Feedback. // Feedback.
$("#feedback-header").click(function () { $("#feedback-header").click(function () {
// Clean DOM.
$("#feedback-header").empty();
// Function charge Modal. // Function charge Modal.
show_feedback(); show_feedback();
}); });
@ -1115,6 +1091,22 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
return false; return false;
}); });
$(document).click(function(event) {
if (!$(event.target).closest('#modal-help-content').length &&
$('#modal_help').hasClass('invisible') === false) {
$('#modal_help').addClass('invisible');
}
});
$('#modal-help-content').on('click', (e) => {
if($(e.target).prop('tagName') === 'A') {
$('#modal_help').addClass('invisible');
} else {
$('#modal_help').removeClass('invisible');
}
});
}); });
/* ]]> */ /* ]]> */
</script> </script>

View File

@ -30,7 +30,7 @@ require_once __DIR__.'/../include/functions_html.php';
echo '<style> echo '<style>
:root {'; :root {';
if ($config['style'] === 'pandora') { if ($config['style'] === 'pandora') {
echo '--login-background-color: rgba(255, 255, 255, 0.4);'; echo '--login-background-color: rgba(255, 255, 255, 0.50);';
echo '--login-label-color: #545454;'; echo '--login-label-color: #545454;';
echo '--login-text-color: #000;'; echo '--login-text-color: #000;';
$style_theme = 'white-theme'; $style_theme = 'white-theme';
@ -237,16 +237,18 @@ if (is_metaconsole() === true) {
); );
} }
} else if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) { } else if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
$theme_logo = ($config['style'] === 'pandora') ? 'images/custom_logo_login/Pandora FMS alt black.png' : 'enterprise/images/custom_logo_login/'.$config['custom_logo_login'];
if (!isset($config['custom_logo_login'])) { if (!isset($config['custom_logo_login'])) {
html_print_image(ui_get_full_url('enterprise/images/custom_logo_login/Pandora-FMS-1.png'), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true); html_print_image(ui_get_full_url($theme_logo), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
} else { } else {
html_print_image(ui_get_full_url('enterprise/images/custom_logo_login/'.$config['custom_logo_login']), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true); html_print_image(ui_get_full_url($theme_logo), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
} }
} else { } else {
$theme_logo = ($config['style'] === 'pandora') ? 'images/custom_logo_login/Pandora FMS alt black.png' : 'images/custom_logo_login/'.$config['custom_logo_login'];
if (empty($config['custom_logo_login']) === true) { if (empty($config['custom_logo_login']) === true) {
html_print_image(ui_get_full_url('images/custom_logo_login/Pandora-FMS-1.png'), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true); html_print_image(ui_get_full_url($theme_logo), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
} else { } else {
html_print_image(ui_get_full_url('images/custom_logo_login/').$config['custom_logo_login'], false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true); html_print_image(ui_get_full_url($theme_logo), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
} }
} }

View File

@ -592,6 +592,9 @@ $userManagementTable->data['line2_looknfeel'][0] = html_print_select_from_sql(
true true
); );
// Hidden hint to change theme.
$hin_change_theme = ui_print_help_tip(__('When changing the theme, the login screen logo will be restricted to the default for that color scheme, if you have a custom logo, adjust it after changing the theme.'), true, '', '', 'display: none;');
if (is_metaconsole() === true) { if (is_metaconsole() === true) {
if (users_is_admin() === true) { if (users_is_admin() === true) {
$userManagementTable->data['line1_looknfeel'][1] = $outputMetaAccess[0]; $userManagementTable->data['line1_looknfeel'][1] = $outputMetaAccess[0];
@ -599,7 +602,7 @@ if (is_metaconsole() === true) {
} }
} else { } else {
if (function_exists('skins_print_select')) { if (function_exists('skins_print_select')) {
$userManagementTable->data['line1_looknfeel'][1] = __('User color scheme'); $userManagementTable->data['line1_looknfeel'][1] = __('User color scheme').$hin_change_theme;
$userManagementTable->data['line2_looknfeel'][1] = skins_print_select($id_usr, 'skin', $user_info['id_skin'], '', __('None'), 0, true); $userManagementTable->data['line2_looknfeel'][1] = skins_print_select($id_usr, 'skin', $user_info['id_skin'], '', __('None'), 0, true);
} }
} }
@ -817,5 +820,10 @@ $(document).ready(function () {
128, 128,
128 128
); );
//Hint to change theme.
$('#skin1').on("change", () => {
$('#advanced-line1_looknfeel-1 > a').css('display', 'block');
})
}); });
</script> </script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>help_pandora</title>
<g id="help_pandora" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M10,0 C15.4050388,0 20,1.5951272 20,5.39448104 L20,14.605519 C20,18.4048728 15.4050388,20 10,20 C4.59496118,20 0,18.4048728 0,14.605519 L0,5.39448104 C0,1.5951272 4.59496118,0 10,0 Z M9.79831933,13.1716621 C8.99159664,13.1716621 8.35294118,13.8092643 8.35294118,14.5940054 C8.35294118,15.3623978 8.99159664,16 9.79831933,16 C10.605042,16 11.2605042,15.3623978 11.2605042,14.5940054 C11.2605042,13.8092643 10.605042,13.1716621 9.79831933,13.1716621 Z M9.91596639,4 C7.46218487,4 6,5.61852861 6,7.53133515 C6,7.74386921 6.01680672,7.98910082 6.06722689,8.21798365 L8.42016807,8.29972752 C8.40336134,8.23433243 8.3697479,8.07084469 8.3697479,7.69482289 C8.3697479,6.92643052 8.94117647,6.15803815 9.91596639,6.15803815 C10.9243697,6.15803815 11.4117647,6.77929155 11.4117647,7.41689373 C11.4117647,7.84196185 11.2605042,8.23433243 10.8067227,8.5613079 L9.94957983,9.18256131 C8.99159664,9.88555858 8.67226891,10.719346 8.67226891,11.4877384 C8.67226891,11.7493188 8.68907563,11.9782016 8.7394958,12.2070845 L10.7394958,12.2070845 C10.7394958,11.4713896 11.1428571,11.0463215 11.7310924,10.6212534 L12.3697479,10.1634877 C13.3781513,9.42779292 14,8.52861035 14,7.22070845 C14,5.58583106 12.6386555,4 9.91596639,4 Z" id="Mask" fill="#3F3F3F"></path>
<g id="?" transform="translate(6, 4)"></g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -211,6 +211,12 @@ class ConsoleSupervisor
$this->checkUpdateManagerRegistration(); $this->checkUpdateManagerRegistration();
/*
* Check if has API access.
* NOTIF.API.ACCESS
*/
$this->checkApiAccess();
/* /*
* Check if there're new messages in UM. * Check if there're new messages in UM.
* NOTIF.UPDATEMANAGER.MESSAGES * NOTIF.UPDATEMANAGER.MESSAGES
@ -436,6 +442,12 @@ class ConsoleSupervisor
$this->checkUpdateManagerRegistration(); $this->checkUpdateManagerRegistration();
/*
* Check if has API access.
* NOTIF.API.ACCESS
*/
$this->checkApiAccess();
/* /*
* Check if event storm protection is activated. * Check if event storm protection is activated.
* NOTIF.MISC.EVENTSTORMPROTECTION * NOTIF.MISC.EVENTSTORMPROTECTION
@ -500,6 +512,12 @@ class ConsoleSupervisor
$this->checkUpdateManagerRegistration(); $this->checkUpdateManagerRegistration();
/*
* Check if has API access.
* NOTIF.API.ACCESS
*/
$this->checkApiAccess();
/* /*
* Check if there're new messages in UM. * Check if there're new messages in UM.
* NOTIF.UPDATEMANAGER.MESSAGES * NOTIF.UPDATEMANAGER.MESSAGES
@ -867,6 +885,7 @@ class ConsoleSupervisor
case 'NOTIF.METACONSOLE.DB_CONNECTION': case 'NOTIF.METACONSOLE.DB_CONNECTION':
case 'NOTIF.DOWNTIME': case 'NOTIF.DOWNTIME':
case 'NOTIF.UPDATEMANAGER.REGISTRATION': case 'NOTIF.UPDATEMANAGER.REGISTRATION':
case 'NOTIF.API.ACCESS':
case 'NOTIF.MISC.EVENTSTORMPROTECTION': case 'NOTIF.MISC.EVENTSTORMPROTECTION':
case 'NOTIF.MISC.DEVELOPBYPASS': case 'NOTIF.MISC.DEVELOPBYPASS':
case 'NOTIF.MISC.FONTPATH': case 'NOTIF.MISC.FONTPATH':
@ -2369,6 +2388,30 @@ class ConsoleSupervisor
} }
/**
* Check if has access to the API
*
* @return void
*/
public function checkApiAccess()
{
global $config;
include_once $config['homedir'].'/include/functions_update_manager.php';
if (update_manager_verify_api() === false) {
$this->notify(
[
'type' => 'NOTIF.API.ACCESS',
'title' => __('Cannot access the Pandora FMS API '),
'message' => __('Please check the configuration, some components may fail due to this misconfiguration.'),
]
);
} else {
$this->cleanNotifications('NOTIF.API.ACCESS');
}
}
/** /**
* Check if user 'admin' is enabled and using default password. * Check if user 'admin' is enabled and using default password.
* *

View File

@ -1744,8 +1744,8 @@ function html_print_select_multiple_modules_filtered(array $data):string
[ [
'label' => __('Agents'), 'label' => __('Agents'),
'label_class' => 'font-title-font', 'label_class' => 'font-title-font',
'type' => 'select', 'type' => 'select_from_sql',
'fields' => $agents, 'sql' => 'SELECT `id_agente`,`nombre` FROM tagente',
'name' => 'filtered-module-agents-'.$uniqId, 'name' => 'filtered-module-agents-'.$uniqId,
'selected' => explode(',', $data['mAgents']), 'selected' => explode(',', $data['mAgents']),
'return' => true, 'return' => true,
@ -1925,8 +1925,7 @@ function html_print_extended_select_for_unit(
$select_style=false, $select_style=false,
$unique_name=true, $unique_name=true,
$disabled=false, $disabled=false,
$no_change=0, $no_change=0
$class='w100p'
) { ) {
global $config; global $config;
@ -1958,7 +1957,7 @@ function html_print_extended_select_for_unit(
ob_start(); ob_start();
echo '<div id="'.$uniq_name.'_default" class="'.$class.' inline_line">'; echo '<div id="'.$uniq_name.'_default" class="w100p inline_line">';
html_print_select( html_print_select(
$fields, $fields,
$uniq_name.'_select', $uniq_name.'_select',
@ -3966,14 +3965,6 @@ function html_print_table(&$table, $return=false)
} }
} }
if (isset($table->tdid)) {
foreach ($table->tdid as $keyrow => $tid) {
foreach ($tid as $key => $id) {
$tdid[$keyrow][$key] = $id;
}
}
}
if (isset($table->cellstyle)) { if (isset($table->cellstyle)) {
foreach ($table->cellstyle as $keyrow => $cstyle) { foreach ($table->cellstyle as $keyrow => $cstyle) {
foreach ($cstyle as $key => $cst) { foreach ($cstyle as $key => $cst) {
@ -4157,10 +4148,6 @@ function html_print_table(&$table, $return=false)
$colspan[$keyrow][$key] = ''; $colspan[$keyrow][$key] = '';
} }
if (!isset($tdid[$keyrow][$key])) {
$tdid[$keyrow][$key] = '';
}
if (!isset($rowspan[$keyrow][$key])) { if (!isset($rowspan[$keyrow][$key])) {
$rowspan[$keyrow][$key] = ''; $rowspan[$keyrow][$key] = '';
} }
@ -4181,16 +4168,10 @@ function html_print_table(&$table, $return=false)
$style[$key] = ''; $style[$key] = '';
} }
if ($tdid[$keyrow][$key] !== '') {
$tid = $tdid[$keyrow][$key];
} else {
$tid = $tableid.'-'.$keyrow.'-'.$key;
}
if ($class === 'datos5' && $key === 1) { if ($class === 'datos5' && $key === 1) {
$output .= '<td id="'.$tid.'" style="'.$cellstyle[$keyrow][$key].$style[$key].$valign[$key].$align[$key].$size[$key].$wrap[$key].$colspan[$keyrow][$key].' '.$rowspan[$keyrow][$key].' class="'.$class.' '.$cellclass[$keyrow][$key].'">'.$item.'</td>'."\n"; $output .= '<td id="'.$tableid.'-'.$keyrow.'-'.$key.'" style="'.$cellstyle[$keyrow][$key].$style[$key].$valign[$key].$align[$key].$size[$key].$wrap[$key].$colspan[$keyrow][$key].' '.$rowspan[$keyrow][$key].' class="'.$class.' '.$cellclass[$keyrow][$key].'">'.$item.'</td>'."\n";
} else { } else {
$output .= '<td id="'.$tid.'" style="'.$cellstyle[$keyrow][$key].$style[$key].$valign[$key].$align[$key].$size[$key].$wrap[$key].'" '.$colspan[$keyrow][$key].' '.$rowspan[$keyrow][$key].' class="'.$class.' '.$cellclass[$keyrow][$key].'">'.$item.'</td>'."\n"; $output .= '<td id="'.$tableid.'-'.$keyrow.'-'.$key.'" style="'.$cellstyle[$keyrow][$key].$style[$key].$valign[$key].$align[$key].$size[$key].$wrap[$key].'" '.$colspan[$keyrow][$key].' '.$rowspan[$keyrow][$key].' class="'.$class.' '.$cellclass[$keyrow][$key].'">'.$item.'</td>'."\n";
} }
} }

View File

@ -146,6 +146,7 @@ function notifications_get_subtypes(?string $source=null)
'NOTIF.METACONSOLE.DB_CONNECTION', 'NOTIF.METACONSOLE.DB_CONNECTION',
'NOTIF.DOWNTIME', 'NOTIF.DOWNTIME',
'NOTIF.UPDATEMANAGER.REGISTRATION', 'NOTIF.UPDATEMANAGER.REGISTRATION',
'NOTIF.API.ACCESS',
'NOTIF.MISC.EVENTSTORMPROTECTION', 'NOTIF.MISC.EVENTSTORMPROTECTION',
'NOTIF.MISC.DEVELOPBYPASS', 'NOTIF.MISC.DEVELOPBYPASS',
'NOTIF.MISC.FONTPATH', 'NOTIF.MISC.FONTPATH',

View File

@ -55,6 +55,18 @@ function update_manager_verify_registration()
} }
/**
* Verifies api state.
*
* @return boolean Status.
*/
function update_manager_verify_api()
{
global $config;
return (isset($config['has_api_access']) === true && $config['has_api_access'] == '1');
}
/** /**
* Retrieves current update from DB. * Retrieves current update from DB.
* *

View File

@ -86,8 +86,8 @@ function showConnectionMessage(conn = true, msg = "") {
.closest(".ui-dialog-content") .closest(".ui-dialog-content")
.dialog("close"); .dialog("close");
} else { } else {
data.title = "Connection with server has been lost"; data.title = get_php_value("title_conexion_interval");
data.text = "Connection status: " + msg; data.text = get_php_value("status_conexion_interval") + msg;
infoMessage(data, "message_dialog_connection"); infoMessage(data, "message_dialog_connection");
} }

View File

@ -217,6 +217,8 @@ function initialiceLayout(data) {
success: function(widgetData) { success: function(widgetData) {
// Remove spinner. // Remove spinner.
removeSpinner(element); removeSpinner(element);
widgetData = widgetData.replace("<script", "&lt;script");
widgetData = widgetData.replace("</script", "&lt;/script");
$("#widget-" + id + " .content-widget").append(widgetData); $("#widget-" + id + " .content-widget").append(widgetData);
$("#button-add-widget-" + id).click(function() { $("#button-add-widget-" + id).click(function() {

View File

@ -1535,7 +1535,45 @@ div#head {
input.datos { input.datos {
background-color: #f5f5f5; background-color: #f5f5f5;
} }
#modal_help {
position: absolute;
top: -2px;
right: 32px;
background: white;
display: flex;
min-width: 160px;
flex-direction: column;
filter: drop-shadow(1px 2px 2px #0000005e);
padding: 10px 0px;
}
#modal-help-content {
position: relative;
cursor: pointer;
}
#modal_help a {
margin: 3px 0px;
padding: 0px 15px;
}
#modal_help a:hover {
color: var(--primary-color);
}
#modal_help .separator {
width: 100%;
opacity: 0.4;
}
#modal_help::before {
content: "";
border: 8px solid #0000;
border-bottom: 8px solid white;
left: auto;
right: -16px;
top: 5px;
position: absolute;
transform: rotate(90deg);
}
#modal_help.invisible {
display: none;
}
/* /*
* --------------------------------------------------------------------- * ---------------------------------------------------------------------
* - REPORTS - * - REPORTS -
@ -9412,7 +9450,8 @@ div.stat-win-spinner img {
.select2-selection--multiple .select2-selection--multiple
.select2-selection__rendered { .select2-selection__rendered {
padding: 5px 10px 10px !important; padding: 5px 10px 10px !important;
max-height: 120px; min-height: 100px;
max-height: 250px;
overflow: auto !important; overflow: auto !important;
} }
@ -10792,10 +10831,6 @@ button.ui-button.ui-widget.submit-cancel:active {
border-color: #96a2bf; border-color: #96a2bf;
} }
.cursor-default {
cursor: default;
}
.hasColorPicker { .hasColorPicker {
z-index: 10; z-index: 10;
} }
@ -12288,14 +12323,6 @@ div.parent_graph > p.legend_background > table > tbody > tr {
margin: 0px !important; margin: 0px !important;
} }
form.max_floating_element_size > ul#ul_tree_azure {
background-color: #fff;
border-spacing: 0px;
border-radius: 6px;
margin-bottom: 20px;
border: 1px solid #e2e2e2;
}
#grid_img { #grid_img {
position: absolute; position: absolute;
margin-top: -2px; margin-top: -2px;
@ -12384,6 +12411,10 @@ tr[id^="network_component-plugin-snmp-fields-dynamicMacroRow-"] input {
vertical-align: middle; vertical-align: middle;
} }
.label_agent_service > label {
margin-top: 15px;
}
.animation-blink { .animation-blink {
-webkit-animation: glowing 1500ms infinite; -webkit-animation: glowing 1500ms infinite;
-moz-animation: glowing 1500ms infinite; -moz-animation: glowing 1500ms infinite;

View File

@ -1851,3 +1851,10 @@ a.pandora_pagination,
color: #fff !important; color: #fff !important;
background-color: #333 !important; background-color: #333 !important;
} }
#modal_help {
background: #222222;
}
#modal_help::before {
border-bottom: 8px solid #222222;
}

View File

@ -1516,10 +1516,12 @@ echo html_print_div(
// Connection lost alert. // Connection lost alert.
set_js_value('check_conexion_interval', $config['check_conexion_interval']); set_js_value('check_conexion_interval', $config['check_conexion_interval']);
set_js_value('title_conexion_interval', __('Connection with console has been lost'));
set_js_value('status_conexion_interval', __('Connection status: '));
ui_require_javascript_file('connection_check'); ui_require_javascript_file('connection_check');
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false)); set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
$conn_title = __('Connection with server has been lost'); $conn_title = __('Connection with console has been lost');
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.'); $conn_text = __('Connection to the console has been lost. Please check your internet connection.');
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/fail@svg.svg'); ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/fail@svg.svg');
if ($config['pure'] == 0) { if ($config['pure'] == 0) {

View File

@ -89,8 +89,8 @@ $label = db_get_value(
ui_require_css_file('register', 'include/styles/', true); ui_require_css_file('register', 'include/styles/', true);
// Connection lost alert. // Connection lost alert.
$conn_title = __('Connection with server has been lost'); $conn_title = __('Connection with console has been lost');
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.'); $conn_text = __('Connection to the console has been lost. Please check your internet connection.');
ui_require_javascript_file('connection_check'); ui_require_javascript_file('connection_check');
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false)); set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
ui_print_message_dialog( ui_print_message_dialog(

View File

@ -274,8 +274,8 @@ if ($layers != false) {
// Connection lost alert. // Connection lost alert.
ui_require_css_file('register', 'include/styles/', true); ui_require_css_file('register', 'include/styles/', true);
$conn_title = __('Connection with server has been lost'); $conn_title = __('Connection with console has been lost');
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.'); $conn_text = __('Connection to the console has been lost. Please check your internet connection.');
ui_require_javascript_file('connection_check'); ui_require_javascript_file('connection_check');
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false)); set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/fail@svg.svg'); ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/fail@svg.svg');

View File

@ -54,8 +54,8 @@ echo '<link rel="stylesheet" href="'.$url_css_modal.'?v='.$config['current_packa
// Connection lost alert. // Connection lost alert.
ui_require_javascript_file('connection_check', 'include/javascript/', true); ui_require_javascript_file('connection_check', 'include/javascript/', true);
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false)); set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
$conn_title = __('Connection with server has been lost'); $conn_title = __('Connection with console has been lost');
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.'); $conn_text = __('Connection to the console has been lost. Please check your internet connection.');
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/fail@svg.svg'); ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/fail@svg.svg');
require_once 'include/functions_visual_map.php'; require_once 'include/functions_visual_map.php';

View File

@ -35,8 +35,8 @@ ui_require_css_file('register', 'include/styles/', true);
// Connection lost alert. // Connection lost alert.
ui_require_javascript_file('connection_check', 'include/javascript/', true); ui_require_javascript_file('connection_check', 'include/javascript/', true);
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false)); set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
$conn_title = __('Connection with server has been lost'); $conn_title = __('Connection with console has been lost');
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.'); $conn_text = __('Connection to the console has been lost. Please check your internet connection.');
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/fail@svg.svg'); ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/fail@svg.svg');
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n"; echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";

View File

@ -733,15 +733,29 @@ sub main() {
my $command = $Config{'plugin_exec'}.' 30 curl --cookie-jar /tmp/cron-session-cookies '.$curl_execution.' 2>/dev/null'; my $command = $Config{'plugin_exec'}.' 30 curl --cookie-jar /tmp/cron-session-cookies '.$curl_execution.' 2>/dev/null';
my $exe_testing_api = `$command`; my $exe_testing_api = `$command`;
my @res_testing_api = split(',', $exe_testing_api); my @res_testing_api = split(',', $exe_testing_api);
my $has_api_access = undef;
if ( $res_testing_api[0] ne 'OK' ) { if ( $res_testing_api[0] ne 'OK' ) {
logger(\%Config, "Warning! The server does not have access to the API, this can trigger problems in the generation of reports and graphs.", 1); logger(\%Config, "Warning! The server does not have access to the API, this can trigger problems in the generation of reports and graphs.", 1);
pandora_event (\%Config, "Server does not have access to the API", 0, 0, 0, 0, 0, 'system', 0, $DBH); pandora_event (\%Config, "The server " . $Config{'servername'} ." cannot access the Pandora FMS API through the supplied credentials. Please check the configuration, some components may fail due to this misconfiguration. Look in the manual for the configuration tokens related to console_api_pass.", 0, 0, 0, 0, 0, 'system', 0, $DBH);
$has_api_access = "0";
} else { } else {
# Test successful. # Test successful.
pandora_set_tconfig_token($DBH, 'internal_user_pass', pandora_set_tconfig_token($DBH, 'internal_user_pass',
pandora_input_password(\%Config, $Config{"console_pass"}) pandora_input_password(\%Config, $Config{"console_pass"})
); );
pandora_set_tconfig_token($DBH, 'internal_user', $Config{"console_user"}); pandora_set_tconfig_token($DBH, 'internal_user', $Config{"console_user"});
$has_api_access = "1";
}
my $token = "has_api_access";
my $prev_access = pandora_get_config_value($DBH, $token);
if(defined($prev_access) && $prev_access ne "") {
db_update ($DBH, 'UPDATE tconfig SET value = ? WHERE token = ?', $has_api_access, $token);
}
else {
db_insert ($DBH, 'id_config', 'INSERT INTO tconfig (token, value) VALUES (?, ?)', $token, $has_api_access);
} }
# Generate 'going up' events # Generate 'going up' events

View File

@ -1399,6 +1399,7 @@ sub pandora_execute_action ($$$$$$$$$;$$) {
_timestamp_ => (defined($timestamp)) ? $timestamp : strftime ("%Y-%m-%d %H:%M:%S", localtime()), _timestamp_ => (defined($timestamp)) ? $timestamp : strftime ("%Y-%m-%d %H:%M:%S", localtime()),
_timezone_ => strftime ("%Z", localtime()), _timezone_ => strftime ("%Z", localtime()),
_data_ => $data, _data_ => $data,
_dataunit_ => (defined ($module)) ? $module->{'unit'} : '',
_prevdata_ => undef, _prevdata_ => undef,
_homeurl_ => $pa_config->{'public_url'}, _homeurl_ => $pa_config->{'public_url'},
_alert_name_ => $alert->{'name'}, _alert_name_ => $alert->{'name'},
@ -4905,6 +4906,9 @@ sub on_demand_macro($$$$$$;$) {
my $field_number = $1; my $field_number = $1;
my $field_value = get_db_value($dbh, 'SELECT description FROM tagent_custom_data WHERE id_field=? AND id_agent=?', $field_number, $agent_id); my $field_value = get_db_value($dbh, 'SELECT description FROM tagent_custom_data WHERE id_field=? AND id_agent=?', $field_number, $agent_id);
return (defined($field_value)) ? $field_value : ''; return (defined($field_value)) ? $field_value : '';
} elsif ($macro eq '_dataunit_'){
return '' unless defined ($module);
my $field_value = get_db_value($dbh, 'SELECT unit FROM tagente_modulo where id_agente_modulo = ? limit 1', $module->{'id_agente_modulo'});
} elsif ($macro eq '_prevdata_') { } elsif ($macro eq '_prevdata_') {
return '' unless defined ($module); return '' unless defined ($module);
if ($module->{'id_tipo_modulo'} eq 3){ if ($module->{'id_tipo_modulo'} eq 3){