mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
#10598 New wizard welcome
This commit is contained in:
parent
4f5315db98
commit
ae526d5df0
@ -34,6 +34,22 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||||||
$notifications_numbers['notifications'],
|
$notifications_numbers['notifications'],
|
||||||
$notifications_numbers['last_id']
|
$notifications_numbers['last_id']
|
||||||
).'</div>';
|
).'</div>';
|
||||||
|
$header_welcome = '';
|
||||||
|
if (check_acl($config['id_user'], $group, 'AW')) {
|
||||||
|
$header_welcome .= '<div id="welcome-icon-header">';
|
||||||
|
$header_welcome .= html_print_image(
|
||||||
|
'images/computer@groups.svg',
|
||||||
|
true,
|
||||||
|
[
|
||||||
|
'class' => 'main_menu_icon invert_filter',
|
||||||
|
'title' => __('Welcome dialog'),
|
||||||
|
'id' => 'Welcome-dialog',
|
||||||
|
'alt' => __('Welcome dialog'),
|
||||||
|
'style' => 'cursor: pointer;',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
$header_welcome .= '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
// ======= Servers List ===============================================
|
// ======= Servers List ===============================================
|
||||||
if ((bool) check_acl($config['id_user'], 0, 'AW') !== false) {
|
if ((bool) check_acl($config['id_user'], 0, 'AW') !== false) {
|
||||||
@ -461,7 +477,7 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||||||
} 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, $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, $header_feedback, $header_support, $header_docu, $header_user, $header_logout.'</div>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</div> <!-- Closes #table_header_inner -->
|
</div> <!-- Closes #table_header_inner -->
|
||||||
@ -904,6 +920,44 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||||||
$("#agent_access").css("display","");
|
$("#agent_access").css("display","");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#welcome-icon-header").click(function () {
|
||||||
|
if (!$('#welcome_modal_window').length){
|
||||||
|
$(document.body).append('<div id="welcome_modal_window"></div>');
|
||||||
|
$(document.body).append( $('<link rel="stylesheet" type="text/css" />').attr('href', 'include/styles/new_installation_welcome_window.css') );
|
||||||
|
}
|
||||||
|
// Clean DOM.
|
||||||
|
load_modal({
|
||||||
|
target: $('#welcome_modal_window'),
|
||||||
|
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
|
||||||
|
modal: {
|
||||||
|
title: "<?php echo __('Welcome to').' '.io_safe_output(get_product_name()); ?>",
|
||||||
|
cancel: '<?php echo __('Do not show anymore'); ?>',
|
||||||
|
ok: '<?php echo __('Close'); ?>'
|
||||||
|
},
|
||||||
|
onshow: {
|
||||||
|
page: 'include/ajax/welcome_window',
|
||||||
|
method: 'loadWelcomeWindow',
|
||||||
|
},
|
||||||
|
oncancel: {
|
||||||
|
page: 'include/ajax/welcome_window',
|
||||||
|
title: "<?php echo __('Cancel Configuration Window'); ?>",
|
||||||
|
method: 'cancelWelcome',
|
||||||
|
confirm: function (fn) {
|
||||||
|
confirmDialog({
|
||||||
|
title: '<?php echo __('Are you sure?'); ?>',
|
||||||
|
message: '<?php echo __('Are you sure you want to cancel this tutorial?'); ?>',
|
||||||
|
ok: '<?php echo __('OK'); ?>',
|
||||||
|
cancel: '<?php echo __('Cancel'); ?>',
|
||||||
|
onAccept: function() {
|
||||||
|
// Continue execution.
|
||||||
|
fn();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
<?php if (enterprise_installed()) { ?>
|
<?php if (enterprise_installed()) { ?>
|
||||||
// Feedback.
|
// Feedback.
|
||||||
$("#feedback-header").click(function () {
|
$("#feedback-header").click(function () {
|
||||||
|
@ -100,21 +100,23 @@ if ($initial && users_is_admin()) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$welcome = !$initial;
|
if (check_acl($config['id_user'], 0, 'AW')) {
|
||||||
try {
|
$welcome = !$initial;
|
||||||
$welcome_window = new WelcomeWindow($welcome);
|
try {
|
||||||
if ($welcome_window !== null) {
|
$welcome_window = new WelcomeWindow($welcome);
|
||||||
$welcome_window->run();
|
if ($welcome_window !== null) {
|
||||||
|
$welcome_window->run();
|
||||||
|
}
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$welcome = false;
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
|
||||||
$welcome = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (isset($_SESSION['showed_tips_window']) === false) {
|
if (isset($_SESSION['showed_tips_window']) === false) {
|
||||||
$tips_window = new TipsWindow();
|
$tips_window = new TipsWindow();
|
||||||
if ($tips_window !== null) {
|
if ($tips_window !== null) {
|
||||||
$tips_window->run();
|
$tips_window->run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
@ -1071,16 +1071,20 @@ if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
|
|||||||
function () {
|
function () {
|
||||||
$(".actions", this).css ("visibility", "hidden");
|
$(".actions", this).css ("visibility", "hidden");
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#ag_group").click (
|
$("#ag_group").click (
|
||||||
function () {
|
function () {
|
||||||
$(this).css ("width", "auto");
|
$(this).css ("width", "auto");
|
||||||
$(this).css ("min-width", "100px");
|
$(this).css ("min-width", "100px");
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#ag_group").blur (function () {
|
$("#ag_group").blur (function () {
|
||||||
$(this).css ("width", "100px");
|
$(this).css ("width", "100px");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var show_deploy_agent = "<?php echo get_parameter('show_deploy_agent', 0); ?>";
|
||||||
|
if (show_deploy_agent !== '0'){
|
||||||
|
$('#button-modal_deploy_agent').click();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -168,6 +168,22 @@ if ($access_console_node === true) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sub = [];
|
$sub = [];
|
||||||
|
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
|
||||||
|
$sub['wizard']['text'] = __('Configuration wizard');
|
||||||
|
$sub['wizard']['id'] = 'conf_wizard';
|
||||||
|
$sub['wizard']['type'] = 'direct';
|
||||||
|
$sub['wizard']['subtype'] = 'nolink';
|
||||||
|
$sub2 = [];
|
||||||
|
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||||
|
$sub2['godmode/wizards/mini_diagnosis']['text'] = __('Mini-diagnosis');
|
||||||
|
$sub2['godmode/wizards/mini_diagnosis']['id'] = 'mini_diagnosis';
|
||||||
|
}
|
||||||
|
|
||||||
|
$sub2['godmode/wizards/task_to_perform']['text'] = __('Tasks to perform');
|
||||||
|
$sub2['godmode/wizards/task_to_perform']['id'] = 'task_to_perform';
|
||||||
|
$sub['wizard']['sub2'] = $sub2;
|
||||||
|
}
|
||||||
|
|
||||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||||
$sub['templates']['text'] = __('Templates');
|
$sub['templates']['text'] = __('Templates');
|
||||||
$sub['templates']['id'] = 'Templates';
|
$sub['templates']['id'] = 'Templates';
|
||||||
|
132
pandora_console/godmode/wizards/mini_diagnosis.php
Normal file
132
pandora_console/godmode/wizards/mini_diagnosis.php
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Extension to schedule tasks on Pandora FMS Console
|
||||||
|
*
|
||||||
|
* @category Wizard
|
||||||
|
* @package Pandora FMS
|
||||||
|
* @subpackage Host&Devices
|
||||||
|
* @version 1.0.0
|
||||||
|
* @license See below
|
||||||
|
*
|
||||||
|
* ______ ___ _______ _______ ________
|
||||||
|
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||||
|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||||
|
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||||
|
*
|
||||||
|
* ============================================================================
|
||||||
|
* Copyright (c) 2005-2023 PandoraFMS S.L.
|
||||||
|
* Please see http://pandorafms.org for full contribution list
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation for version 2.
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
* ============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Begin.
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
$status_um = false;
|
||||||
|
$status_su = false;
|
||||||
|
$status_cm = false;
|
||||||
|
$status_lv = false;
|
||||||
|
|
||||||
|
// Header.
|
||||||
|
ui_print_standard_header(
|
||||||
|
__('Mini-Diagnosis'),
|
||||||
|
'images/op_snmp.png',
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
[],
|
||||||
|
[
|
||||||
|
[
|
||||||
|
'link' => '',
|
||||||
|
'label' => __('Configuration'),
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'link' => '',
|
||||||
|
'label' => __('Configuration wizard'),
|
||||||
|
],
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
if (empty($config['pandora_uid']) === 'ONLINE') {
|
||||||
|
$status_um = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
require_once 'include/functions_servers.php';
|
||||||
|
if (check_all_servers_up() === true) {
|
||||||
|
$status_su = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($config['welcome_mail_configured']) === false) {
|
||||||
|
$status_cm = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (enterprise_installed()) {
|
||||||
|
$license_valid = true;
|
||||||
|
enterprise_include_once('include/functions_license.php');
|
||||||
|
$license = enterprise_hook('license_get_info');
|
||||||
|
$days_to_expiry = ((strtotime($license['expiry_date']) - time()) / (60 * 60 * 24));
|
||||||
|
if ($license === ENTERPRISE_NOT_HOOK || $days_to_expiry <= 30) {
|
||||||
|
$license_valid = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($license_valid === true) {
|
||||||
|
$status_lv = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ui_require_css_file('mini_diagnosis');
|
||||||
|
$table = new stdClass();
|
||||||
|
$table->width = '60%';
|
||||||
|
$table->class = 'filter-table-adv databox';
|
||||||
|
$table->size = [];
|
||||||
|
$table->data = [];
|
||||||
|
$table->size[0] = '30%';
|
||||||
|
$table->size[1] = '30%';
|
||||||
|
$table->data[0][0] = html_print_wizard_diagnosis(__('Verification update manager register'), 'update_manager', __('Verification update manager register'), $status_um, true);
|
||||||
|
$table->data[0][1] = html_print_wizard_diagnosis(__('Please ensure mail configuration matches your needs'), 'configure_email', __('Please ensure mail configuration matches your needs'), $status_cm, true);
|
||||||
|
$table->data[1][0] = html_print_wizard_diagnosis(__('All servers up'), 'servers_up', __('All servers up'), $status_su, true);
|
||||||
|
$table->data[1][1] = html_print_wizard_diagnosis(__('Valid license verification and expiration greater than 30 days'), 'license_valid', __('Valid license verification and expiration greater than 30 days'), $status_lv, true);
|
||||||
|
html_print_table($table);
|
||||||
|
?>
|
||||||
|
<script type="text/javascript">
|
||||||
|
document.getElementById("update_manager").setAttribute(
|
||||||
|
'onclick',
|
||||||
|
'configureUpdateManager()'
|
||||||
|
);
|
||||||
|
document.getElementById("configure_email").setAttribute(
|
||||||
|
'onclick',
|
||||||
|
'configureEmail()'
|
||||||
|
);
|
||||||
|
document.getElementById("servers_up").setAttribute(
|
||||||
|
'onclick',
|
||||||
|
'serversUp()'
|
||||||
|
);
|
||||||
|
document.getElementById("license_valid").setAttribute(
|
||||||
|
'onclick',
|
||||||
|
'messageLicense()'
|
||||||
|
);
|
||||||
|
|
||||||
|
function configureUpdateManager() {
|
||||||
|
window.location = '<?php echo ui_get_full_url('index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=online'); ?>';
|
||||||
|
}
|
||||||
|
|
||||||
|
function configureEmail() {
|
||||||
|
window.location = '<?php echo ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=general#table3'); ?>';
|
||||||
|
}
|
||||||
|
|
||||||
|
function serversUp() {
|
||||||
|
window.location = '<?php echo ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=60'); ?>';
|
||||||
|
}
|
||||||
|
|
||||||
|
function messageLicense() {
|
||||||
|
window.location = '<?php echo ui_get_full_url('index.php?sec=message_list&sec2=operation/messages/message_list'); ?>';
|
||||||
|
}
|
||||||
|
</script>
|
1203
pandora_console/godmode/wizards/task_to_perform.php
Normal file
1203
pandora_console/godmode/wizards/task_to_perform.php
Normal file
File diff suppressed because it is too large
Load Diff
19
pandora_console/images/circle_title.svg
Normal file
19
pandora_console/images/circle_title.svg
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="12px" height="12px" viewBox="0 0 12 12" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>EB094270-FB38-4A58-BE94-D40EA44EA568</title>
|
||||||
|
<g id="Agentes" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<g id="1.a1-Agentes---Listado" transform="translate(-362.500000, -268.000000)" fill="#C1CCDC">
|
||||||
|
<g id="Contenido" transform="translate(310.000000, 188.000000)">
|
||||||
|
<g transform="translate(20.000000, 20.000000)" id="Agentes">
|
||||||
|
<g id="Content" transform="translate(29.308511, 20.000000)">
|
||||||
|
<g id="Top" transform="translate(0.191489, 0.000000)">
|
||||||
|
<g id="Icons/Light/24/example" transform="translate(3.000000, 40.000000)">
|
||||||
|
<circle id="Oval" cx="6" cy="6" r="6"></circle>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.1 KiB |
@ -35,6 +35,13 @@ if (is_ajax() === false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$ajaxPage = 'include/ajax/welcome_window';
|
$ajaxPage = 'include/ajax/welcome_window';
|
||||||
|
// Ajax controller.
|
||||||
|
$method = get_parameter('method', '');
|
||||||
|
|
||||||
|
if ($method === 'loadWelcomeWindow') {
|
||||||
|
unset($config['welcome_state']);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Control call flow.
|
// Control call flow.
|
||||||
try {
|
try {
|
||||||
@ -44,9 +51,6 @@ try {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ajax controller.
|
|
||||||
$method = get_parameter('method', '');
|
|
||||||
|
|
||||||
if (method_exists($welcome_actions, $method) === true) {
|
if (method_exists($welcome_actions, $method) === true) {
|
||||||
if ($welcome_actions->ajaxMethod($method) === true) {
|
if ($welcome_actions->ajaxMethod($method) === true) {
|
||||||
$welcome_actions->{$method}();
|
$welcome_actions->{$method}();
|
||||||
|
@ -336,54 +336,7 @@ class WelcomeWindow extends Wizard
|
|||||||
public function loadWelcomeWindow()
|
public function loadWelcomeWindow()
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
$flag_task = false;
|
||||||
$btn_configure_mail_class = 'pending';
|
|
||||||
$btn_create_agent_class = 'pending';
|
|
||||||
$btn_create_module_class = '';
|
|
||||||
$btn_create_alert_class = '';
|
|
||||||
$btn_create_discovery_class = 'pending';
|
|
||||||
|
|
||||||
$li_configure_mail_class = 'row_green';
|
|
||||||
$li_create_agent_class = 'row_green';
|
|
||||||
$li_create_module_class = 'row_grey';
|
|
||||||
$li_create_alert_class = 'row_grey';
|
|
||||||
$li_create_discovery_class = 'row_green';
|
|
||||||
|
|
||||||
if (empty($config['welcome_mail_configured']) === false) {
|
|
||||||
$btn_configure_mail_class = ' completed';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($config['welcome_id_agent']) === false) {
|
|
||||||
$btn_create_agent_class = ' completed';
|
|
||||||
$btn_create_module_class = ' pending';
|
|
||||||
$li_create_module_class = 'row_green';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($config['welcome_module']) === false) {
|
|
||||||
$btn_create_module_class = ' completed';
|
|
||||||
$btn_create_alert_class = ' pending';
|
|
||||||
$li_create_module_class = 'row_green';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($config['welcome_alert']) === false) {
|
|
||||||
$btn_create_alert_class = ' completed';
|
|
||||||
$li_create_alert_class = 'row_green';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($config['welcome_task']) === false) {
|
|
||||||
$btn_create_discovery_class = ' completed';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((int) $config['welcome_state'] === WELCOME_FINISHED) {
|
|
||||||
// Nothing left to do.
|
|
||||||
$btn_configure_mail_class = ' completed';
|
|
||||||
$btn_create_agent_class = ' completed';
|
|
||||||
$btn_create_module_class = ' completed';
|
|
||||||
$btn_create_alert_class = ' completed';
|
|
||||||
$btn_create_discovery_class = ' completed';
|
|
||||||
$li_create_module_class = 'row_green';
|
|
||||||
$li_create_alert_class = 'row_green';
|
|
||||||
}
|
|
||||||
|
|
||||||
$form = [
|
$form = [
|
||||||
'action' => '#',
|
'action' => '#',
|
||||||
@ -413,187 +366,389 @@ class WelcomeWindow extends Wizard
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
[
|
];
|
||||||
|
|
||||||
|
if (check_acl($config['id_user'], 0, 'PM')) {
|
||||||
|
$flag_um = false;
|
||||||
|
$flag_cm = false;
|
||||||
|
$flag_su = false;
|
||||||
|
$flag_lv = false;
|
||||||
|
|
||||||
|
$btn_update_manager_class = ' pending';
|
||||||
|
$btn_configure_mail_class = ' pending';
|
||||||
|
$btn_servers_up_class = ' pending';
|
||||||
|
$btn_license_valid_class = ' pending';
|
||||||
|
|
||||||
|
$li_update_manager_class = 'row_grey';
|
||||||
|
$li_configure_mail_class = 'row_grey';
|
||||||
|
$li_servers_up_class = 'row_grey';
|
||||||
|
$li_license_valid_class = 'row_grey';
|
||||||
|
|
||||||
|
if ($config['pandora_uid'] === 'ONLINE') {
|
||||||
|
$btn_update_manager_class = ' completed';
|
||||||
|
$li_update_manager_class = 'row_green';
|
||||||
|
$flag_um = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($config['welcome_mail_configured']) === false) {
|
||||||
|
$btn_configure_mail_class = ' completed';
|
||||||
|
$flag_cm = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
include_once 'include/functions_servers.php';
|
||||||
|
if (check_all_servers_up() === true) {
|
||||||
|
$btn_servers_up_class = ' completed';
|
||||||
|
$li_servers_up_class = 'row_green';
|
||||||
|
$flag_su = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (enterprise_installed()) {
|
||||||
|
$license_valid = true;
|
||||||
|
enterprise_include_once('include/functions_license.php');
|
||||||
|
$license = enterprise_hook('license_get_info');
|
||||||
|
$days_to_expiry = ((strtotime($license['expiry_date']) - time()) / (60 * 60 * 24));
|
||||||
|
if ($license === ENTERPRISE_NOT_HOOK || $days_to_expiry <= 30) {
|
||||||
|
$license_valid = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($license_valid === true) {
|
||||||
|
$btn_license_valid_class = ' completed';
|
||||||
|
$li_license_valid_class = 'row_green';
|
||||||
|
$flag_lv = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$inputs[] = [
|
||||||
'wrapper' => 'div',
|
'wrapper' => 'div',
|
||||||
'block_id' => 'div_configure_mail',
|
'block_id' => 'div_diagnosis',
|
||||||
'class' => 'hole flex-row flex-items-center w98p '.$li_configure_mail_class,
|
'class' => 'flex-row flex-items-center w98p ',
|
||||||
'direct' => 1,
|
'direct' => 1,
|
||||||
'block_content' => [
|
'block_content' => [
|
||||||
[
|
[
|
||||||
'label' => __('Please ensure mail configuration matches your needs'),
|
'label' => __('Mini-diagnosis'),
|
||||||
'arguments' => [
|
'arguments' => [
|
||||||
'class' => 'first_lbl',
|
'class' => 'first_lbl',
|
||||||
'name' => 'lbl_create_agent',
|
'name' => 'lbl_diagnosis',
|
||||||
'id' => 'lbl_create_agent',
|
'id' => 'lbl_diagnosis',
|
||||||
],
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'arguments' => [
|
|
||||||
'label' => '',
|
|
||||||
'type' => 'button',
|
|
||||||
'attributes' => [
|
|
||||||
'class' => (empty($btn_configure_mail_class) === false) ? $btn_configure_mail_class : 'invisible_important',
|
|
||||||
'mode' => 'onlyIcon',
|
|
||||||
],
|
|
||||||
'name' => 'btn_email_conf',
|
|
||||||
'id' => 'btn_email_conf',
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
];
|
||||||
[
|
|
||||||
'label' => 'Learn to monitor',
|
if ($flag_um === false || $flag_cm === false || $flag_su === false || $flag_lv === false) {
|
||||||
'class' => 'extra',
|
$inputs[] = [
|
||||||
'arguments' => [
|
'wrapper' => 'div',
|
||||||
'class' => 'class="lbl_learn"',
|
'block_id' => 'div_update_manager',
|
||||||
'name' => 'lbl_learn',
|
'class' => 'hole flex-row flex-items-center w98p '.$li_update_manager_class,
|
||||||
'id' => 'lbl_learn',
|
'direct' => 1,
|
||||||
],
|
'block_content' => [
|
||||||
],
|
[
|
||||||
[
|
'label' => __('Verification update manager register'),
|
||||||
'wrapper' => 'div',
|
'arguments' => [
|
||||||
'block_id' => 'div_create_agent',
|
'class' => 'first_lbl',
|
||||||
'class' => 'learn_content_indented flex-row flex-items-center w98p '.$li_create_agent_class,
|
'name' => 'lbl_update_manager',
|
||||||
'direct' => 1,
|
'id' => 'lbl_update_manager',
|
||||||
'block_content' => [
|
|
||||||
[
|
|
||||||
'label' => __('Create an agent'),
|
|
||||||
'arguments' => [
|
|
||||||
'class' => 'first_lbl',
|
|
||||||
'name' => 'lbl_create_agent',
|
|
||||||
'id' => 'lbl_create_agent',
|
|
||||||
],
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'arguments' => [
|
|
||||||
'label' => '',
|
|
||||||
'type' => 'button',
|
|
||||||
'attributes' => [
|
|
||||||
'class' => (empty($btn_create_agent_class) === false) ? $btn_create_agent_class : 'invisible_important',
|
|
||||||
'mode' => 'onlyIcon',
|
|
||||||
],
|
],
|
||||||
'name' => 'btn_create_agent',
|
|
||||||
'id' => 'btn_create_agent',
|
|
||||||
],
|
],
|
||||||
],
|
[
|
||||||
],
|
'arguments' => [
|
||||||
],
|
'label' => '',
|
||||||
[
|
'type' => 'button',
|
||||||
'wrapper' => 'div',
|
'attributes' => [
|
||||||
'block_id' => 'div_monitor_actions',
|
'class' => (empty($btn_update_manager_class) === false) ? $btn_update_manager_class : 'invisible_important',
|
||||||
'class' => 'learn_content_indented flex-row flex-items-center w98p '.$li_create_module_class,
|
'mode' => 'onlyIcon',
|
||||||
'direct' => 1,
|
],
|
||||||
'block_content' => [
|
'name' => 'btn_update_manager_conf',
|
||||||
[
|
'id' => 'btn_update_manager_conf',
|
||||||
'label' => __('Create a module to check if an agent is online'),
|
|
||||||
'arguments' => [
|
|
||||||
'class' => 'second_lbl',
|
|
||||||
'name' => 'lbl_check_agent',
|
|
||||||
'id' => 'lbl_check_agent',
|
|
||||||
],
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'arguments' => [
|
|
||||||
'label' => '',
|
|
||||||
'type' => 'button',
|
|
||||||
'attributes' => [
|
|
||||||
'class' => (empty($btn_create_module_class) === false) ? $btn_create_module_class : 'invisible_important',
|
|
||||||
'mode' => 'onlyIcon',
|
|
||||||
],
|
],
|
||||||
'name' => 'btn_create_module',
|
|
||||||
'id' => 'btn_create_module',
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
];
|
||||||
],
|
$inputs[] = [
|
||||||
[
|
'wrapper' => 'div',
|
||||||
'wrapper' => 'div',
|
'block_id' => 'div_configure_mail',
|
||||||
'block_id' => 'div_monitor_actions',
|
'class' => 'hole flex-row flex-items-center w98p '.$li_configure_mail_class,
|
||||||
'class' => 'hole learn_content_indented flex-row flex-items-center w98p '.$li_create_alert_class,
|
'direct' => 1,
|
||||||
'direct' => 1,
|
'block_content' => [
|
||||||
'block_content' => [
|
[
|
||||||
[
|
'label' => __('Please ensure mail configuration matches your needs'),
|
||||||
'label' => __('Be warned if something is wrong, create an alert on the module'),
|
'arguments' => [
|
||||||
'arguments' => [
|
'class' => 'first_lbl',
|
||||||
'class' => 'second_lbl',
|
'name' => 'lbl_create_agent',
|
||||||
'name' => 'lbl_create_alert',
|
'id' => 'lbl_create_agent',
|
||||||
'id' => 'lbl_create_alert',
|
|
||||||
],
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'arguments' => [
|
|
||||||
'label' => '',
|
|
||||||
'type' => 'button',
|
|
||||||
'attributes' => [
|
|
||||||
'class' => (empty($btn_create_alert_class) === false) ? $btn_create_alert_class : 'invisible_important',
|
|
||||||
'mode' => 'onlyIcon',
|
|
||||||
],
|
],
|
||||||
'name' => 'btn_create_alert',
|
|
||||||
'id' => 'btn_create_alert',
|
|
||||||
],
|
],
|
||||||
],
|
[
|
||||||
],
|
'arguments' => [
|
||||||
],
|
'label' => '',
|
||||||
[
|
'type' => 'button',
|
||||||
'wrapper' => 'div',
|
'attributes' => [
|
||||||
'block_id' => 'div_discover',
|
'class' => (empty($btn_configure_mail_class) === false) ? $btn_configure_mail_class : 'invisible_important',
|
||||||
'class' => 'hole flex-row flex-items-center w98p '.$li_create_discovery_class,
|
'mode' => 'onlyIcon',
|
||||||
'direct' => 1,
|
],
|
||||||
'block_content' => [
|
'name' => 'btn_email_conf',
|
||||||
[
|
'id' => 'btn_email_conf',
|
||||||
'label' => __('Discover hosts and devices in your network'),
|
|
||||||
'arguments' => [
|
|
||||||
'class' => 'first_lbl',
|
|
||||||
'name' => 'lbl_discover_devices',
|
|
||||||
'id' => 'lbl_discover_devices',
|
|
||||||
],
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'arguments' => [
|
|
||||||
'label' => '',
|
|
||||||
'type' => 'button',
|
|
||||||
'attributes' => [
|
|
||||||
'class' => (empty($btn_create_discovery_class) === false) ? $btn_create_discovery_class : 'invisible_important',
|
|
||||||
'mode' => 'onlyIcon',
|
|
||||||
],
|
],
|
||||||
'name' => 'btn_discover_devices',
|
|
||||||
'id' => 'btn_discover_devices',
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
];
|
||||||
|
$inputs[] = [
|
||||||
|
'wrapper' => 'div',
|
||||||
|
'block_id' => 'div_servers_up',
|
||||||
|
'class' => 'hole flex-row flex-items-center w98p '.$li_servers_up_class,
|
||||||
|
'direct' => 1,
|
||||||
|
'block_content' => [
|
||||||
|
[
|
||||||
|
'label' => __('All servers up'),
|
||||||
|
'arguments' => [
|
||||||
|
'class' => 'first_lbl',
|
||||||
|
'name' => 'lbl_servers_up',
|
||||||
|
'id' => 'lbl_servers_up',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'arguments' => [
|
||||||
|
'label' => '',
|
||||||
|
'type' => 'button',
|
||||||
|
'attributes' => [
|
||||||
|
'class' => (empty($btn_servers_up_class) === false) ? $btn_servers_up_class : 'invisible_important',
|
||||||
|
'mode' => 'onlyIcon',
|
||||||
|
],
|
||||||
|
'name' => 'btn_servers_up_conf',
|
||||||
|
'id' => 'btn_servers_up_conf',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
$inputs[] = [
|
||||||
|
'wrapper' => 'div',
|
||||||
|
'block_id' => 'div_license_valid',
|
||||||
|
'class' => 'hole flex-row flex-items-center w98p '.$li_license_valid_class,
|
||||||
|
'direct' => 1,
|
||||||
|
'block_content' => [
|
||||||
|
[
|
||||||
|
'label' => __('Valid license verification and expiration greater than 30 days'),
|
||||||
|
'arguments' => [
|
||||||
|
'class' => 'first_lbl',
|
||||||
|
'name' => 'lbl_license_valid',
|
||||||
|
'id' => 'lbl_license_valid',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'arguments' => [
|
||||||
|
'label' => '',
|
||||||
|
'type' => 'button',
|
||||||
|
'attributes' => [
|
||||||
|
'class' => (empty($btn_license_valid_class) === false) ? $btn_license_valid_class : 'invisible_important',
|
||||||
|
'mode' => 'onlyIcon',
|
||||||
|
],
|
||||||
|
'name' => 'btn_license_valid_conf',
|
||||||
|
'id' => 'btn_license_valid_conf',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
$key = db_get_value_sql('SELECT `value` FROM tupdate_settings WHERE `key` = "customer_key"');
|
||||||
|
$inputs[] = [
|
||||||
|
'wrapper' => 'div',
|
||||||
|
'block_id' => 'div_all_correct',
|
||||||
|
'class' => 'hole flex-row flex-items-center w98p',
|
||||||
|
'direct' => 1,
|
||||||
|
'block_content' => [
|
||||||
|
[
|
||||||
|
'label' => __('It seems that your Pandora FMS is working correctly and registered with ID:<br> #'.$key.'.<br>For more information use the self-diagnosis tool.'),
|
||||||
|
'arguments' => [
|
||||||
|
'class' => 'first_lbl w98p',
|
||||||
|
'name' => 'lbl_all_correct',
|
||||||
|
'id' => 'lbl_all_correct',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($flag_um === false || $flag_cm === false || $flag_su === false || $flag_lv === false) {
|
||||||
|
$flag_task = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Task to do.
|
||||||
|
$inputs[] = [
|
||||||
|
'wrapper' => 'div',
|
||||||
|
'block_id' => 'div_task_todo',
|
||||||
|
'class' => 'flex-row flex-items-center w98p',
|
||||||
|
'direct' => 1,
|
||||||
|
'block_content' => [
|
||||||
|
[
|
||||||
|
'label' => __('Task to perform'),
|
||||||
|
'arguments' => [
|
||||||
|
'class' => 'first_lbl',
|
||||||
|
'name' => 'lbl_task_todo',
|
||||||
|
'id' => 'lbl_task_todo',
|
||||||
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
if (enterprise_installed() === true) {
|
$inputs[] = [
|
||||||
$inputs[] = [
|
'wrapper' => 'div',
|
||||||
'wrapper' => 'div',
|
'block_id' => 'div_wizard_agent',
|
||||||
'block_id' => 'div_not_working',
|
'class' => 'hole flex-row flex-items-center w98p row_grey',
|
||||||
'class' => 'hole flex-row flex-items-center w98p',
|
'direct' => 1,
|
||||||
'direct' => 1,
|
'block_content' => [
|
||||||
'block_content' => [
|
[
|
||||||
[
|
'label' => __('Wizard install agent'),
|
||||||
'label' => __('If something is not working as expected, look for this icon and report!'),
|
'arguments' => [
|
||||||
'arguments' => [
|
'class' => 'first_lbl row_grey',
|
||||||
'class' => 'first_lbl',
|
'name' => 'lbl_wizard_agent',
|
||||||
'name' => 'lbl_not_working',
|
'id' => 'lbl_wizard_agent',
|
||||||
'id' => 'lbl_not_working',
|
|
||||||
],
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'label' => html_print_image(
|
|
||||||
'images/feedback-header.png',
|
|
||||||
true,
|
|
||||||
[
|
|
||||||
'onclick' => '$(\'#feedback-header\').click()',
|
|
||||||
'style' => 'cursor: pointer;',
|
|
||||||
]
|
|
||||||
),
|
|
||||||
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
];
|
[
|
||||||
|
'arguments' => [
|
||||||
|
'label' => '',
|
||||||
|
'type' => 'button',
|
||||||
|
'attributes' => [
|
||||||
|
'class' => 'completed',
|
||||||
|
'mode' => 'onlyIcon',
|
||||||
|
],
|
||||||
|
'name' => 'btn_wizard_agent_conf',
|
||||||
|
'id' => 'btn_wizard_agent_conf',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
$status_webserver = db_get_row_filter('tserver', ['server_type' => SERVER_TYPE_WEB], 'status')['status'];
|
||||||
|
$check_web_color = 'row_grey';
|
||||||
|
if ($status_webserver === '1') {
|
||||||
|
$check_web_color = 'row_green';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$inputs[] = [
|
||||||
|
'wrapper' => 'div',
|
||||||
|
'block_id' => 'div_check_web',
|
||||||
|
'class' => 'hole flex-row flex-items-center w98p '.$check_web_color,
|
||||||
|
'direct' => 1,
|
||||||
|
'block_content' => [
|
||||||
|
[
|
||||||
|
'label' => __('Create check web'),
|
||||||
|
'arguments' => [
|
||||||
|
'class' => 'first_lbl row_grey',
|
||||||
|
'name' => 'lbl_check_web',
|
||||||
|
'id' => 'lbl_check_web',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'arguments' => [
|
||||||
|
'label' => '',
|
||||||
|
'type' => 'button',
|
||||||
|
'attributes' => [
|
||||||
|
'class' => 'completed',
|
||||||
|
'mode' => 'onlyIcon',
|
||||||
|
],
|
||||||
|
'name' => 'btn_check_web_conf',
|
||||||
|
'id' => 'btn_check_web_conf',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
$status_newtwork = db_get_row_filter('tserver', ['server_type' => SERVER_TYPE_NETWORK], 'status')['status'];
|
||||||
|
$status_pluggin = db_get_row_filter('tserver', ['server_type' => SERVER_TYPE_PLUGIN], 'status')['status'];
|
||||||
|
$check_connectivity = 'row_grey';
|
||||||
|
if ($status_newtwork === '1' && $status_pluggin === '1') {
|
||||||
|
$check_connectivity = 'row_green';
|
||||||
|
}
|
||||||
|
|
||||||
|
$inputs[] = [
|
||||||
|
'wrapper' => 'div',
|
||||||
|
'block_id' => 'div_check_connectivity',
|
||||||
|
'class' => 'hole flex-row flex-items-center w98p '.$check_connectivity,
|
||||||
|
'direct' => 1,
|
||||||
|
'block_content' => [
|
||||||
|
[
|
||||||
|
'label' => __('Create basic connectivity'),
|
||||||
|
'arguments' => [
|
||||||
|
'class' => 'first_lbl row_grey',
|
||||||
|
'name' => 'lbl_check_connectivity',
|
||||||
|
'id' => 'lbl_check_connectivity',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'arguments' => [
|
||||||
|
'label' => '',
|
||||||
|
'type' => 'button',
|
||||||
|
'attributes' => [
|
||||||
|
'class' => 'completed',
|
||||||
|
'mode' => 'onlyIcon',
|
||||||
|
],
|
||||||
|
'name' => 'btn_check_connectivity_conf',
|
||||||
|
'id' => 'btn_check_connectivity_conf',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
$inputs[] = [
|
||||||
|
'wrapper' => 'div',
|
||||||
|
'block_id' => 'div_check_net',
|
||||||
|
'class' => 'hole flex-row flex-items-center w98p row_green',
|
||||||
|
'direct' => 1,
|
||||||
|
'block_content' => [
|
||||||
|
[
|
||||||
|
'label' => __('Create basic net'),
|
||||||
|
'arguments' => [
|
||||||
|
'class' => 'first_lbl row_grey',
|
||||||
|
'name' => 'lbl_check_net',
|
||||||
|
'id' => 'lbl_check_net',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'arguments' => [
|
||||||
|
'label' => '',
|
||||||
|
'type' => 'button',
|
||||||
|
'attributes' => [
|
||||||
|
'class' => 'completed',
|
||||||
|
'mode' => 'onlyIcon',
|
||||||
|
],
|
||||||
|
'name' => 'btn_check_net_conf',
|
||||||
|
'id' => 'btn_check_net_conf',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
$inputs[] = [
|
||||||
|
'wrapper' => 'div',
|
||||||
|
'block_id' => 'div_check_mail_alert',
|
||||||
|
'class' => 'hole flex-row flex-items-center w98p row_green',
|
||||||
|
'direct' => 1,
|
||||||
|
'block_content' => [
|
||||||
|
[
|
||||||
|
'label' => __('Create Alert Mail'),
|
||||||
|
'arguments' => [
|
||||||
|
'class' => 'first_lbl row_grey',
|
||||||
|
'name' => 'lbl_check_mail_alert',
|
||||||
|
'id' => 'lbl_check_mail_alert',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'arguments' => [
|
||||||
|
'label' => '',
|
||||||
|
'type' => 'button',
|
||||||
|
'attributes' => [
|
||||||
|
'class' => 'completed',
|
||||||
|
'mode' => 'onlyIcon',
|
||||||
|
],
|
||||||
|
'name' => 'btn_check_mail_alert_conf',
|
||||||
|
'id' => 'btn_check_mail_alert_conf',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
$output = $this->printForm(
|
$output = $this->printForm(
|
||||||
[
|
[
|
||||||
'form' => $form,
|
'form' => $form,
|
||||||
@ -602,7 +757,7 @@ class WelcomeWindow extends Wizard
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
$output .= $this->loadJS();
|
$output .= $this->loadJS($flag_task);
|
||||||
echo $output;
|
echo $output;
|
||||||
|
|
||||||
// Ajax methods does not continue.
|
// Ajax methods does not continue.
|
||||||
@ -830,82 +985,96 @@ class WelcomeWindow extends Wizard
|
|||||||
*
|
*
|
||||||
* @return string HTML code for javascript functionality.
|
* @return string HTML code for javascript functionality.
|
||||||
*/
|
*/
|
||||||
public function loadJS()
|
public function loadJS($flag_task=false)
|
||||||
{
|
{
|
||||||
ob_start();
|
ob_start();
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
<?php
|
$('#div_all_correct').children().attr('class','w100p').attr('style', 'overflow-wrap: break-word;');
|
||||||
if ($this->step > W_CREATE_AGENT) {
|
<?php if ($flag_task === true) { ?>
|
||||||
switch ($this->step) {
|
document.getElementById("button-btn_update_manager_conf").setAttribute(
|
||||||
case W_CREATE_MODULE:
|
'onclick',
|
||||||
?>
|
'configureUpdateManager()'
|
||||||
document.getElementById("button-btn_create_module").setAttribute(
|
);
|
||||||
'onclick',
|
document.getElementById("button-btn_email_conf").setAttribute(
|
||||||
'checkAgentOnline()'
|
'onclick',
|
||||||
);
|
'configureEmail()'
|
||||||
<?php
|
);
|
||||||
break;
|
document.getElementById("button-btn_servers_up_conf").setAttribute(
|
||||||
|
'onclick',
|
||||||
|
'serversUp()'
|
||||||
|
);
|
||||||
|
document.getElementById("button-btn_license_valid_conf").setAttribute(
|
||||||
|
'onclick',
|
||||||
|
'messageLicense()'
|
||||||
|
);
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
case W_CREATE_ALERT:
|
// Task to do buttons.
|
||||||
?>
|
document.getElementById("button-btn_wizard_agent_conf").setAttribute(
|
||||||
document.getElementById("button-btn_create_alert").setAttribute(
|
'onclick',
|
||||||
'onclick',
|
'deployAgent()'
|
||||||
'createAlertModule()'
|
);
|
||||||
);
|
|
||||||
<?php
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
document.getElementById("button-btn_check_web_conf").setAttribute(
|
||||||
// Ignore.
|
'onclick',
|
||||||
break;
|
'openCreateModulesDialog()'
|
||||||
}
|
);
|
||||||
|
|
||||||
|
document.getElementById("button-btn_check_connectivity_conf").setAttribute(
|
||||||
|
'onclick',
|
||||||
|
'openCreateConnectivityDialog()'
|
||||||
|
);
|
||||||
|
|
||||||
|
document.getElementById("button-btn_check_net_conf").setAttribute(
|
||||||
|
'onclick',
|
||||||
|
'openCreateBasicNetDialog()'
|
||||||
|
);
|
||||||
|
|
||||||
|
document.getElementById("button-btn_check_mail_alert_conf").setAttribute(
|
||||||
|
'onclick',
|
||||||
|
'openCreateAlertMailDialog()'
|
||||||
|
);
|
||||||
|
|
||||||
|
function configureUpdateManager() {
|
||||||
|
window.location = '<?php echo ui_get_full_url('index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=online'); ?>';
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|
||||||
document.getElementById("button-btn_email_conf").setAttribute(
|
function configureEmail() {
|
||||||
'onclick',
|
window.location = '<?php echo ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=general#table3'); ?>';
|
||||||
'configureEmail()'
|
}
|
||||||
);
|
|
||||||
document.getElementById("button-btn_create_agent").setAttribute(
|
|
||||||
'onclick',
|
|
||||||
'createNewAgent()'
|
|
||||||
);
|
|
||||||
document.getElementById("button-btn_discover_devices").setAttribute(
|
|
||||||
'onclick',
|
|
||||||
'discoverDevicesNetwork()'
|
|
||||||
);
|
|
||||||
|
|
||||||
function configureEmail() {
|
function serversUp() {
|
||||||
window.location = '<?php echo ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=general#table3'); ?>';
|
window.location = '<?php echo ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=60'); ?>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function createNewAgent() {
|
function messageLicense() {
|
||||||
window.location = '<?php echo ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&new_agent=1&crt-2=Create+agent'); ?>';
|
window.location = '<?php echo ui_get_full_url('index.php?sec=message_list&sec2=operation/messages/message_list'); ?>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkAgentOnline() {
|
function deployAgent() {
|
||||||
window.location = '<?php echo ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$this->getWelcomeAgent().''); ?>';
|
window.location = '<?php echo ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&show_deploy_agent=1'); ?>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function createAlertModule() {
|
function openCreateModulesDialog() {
|
||||||
window.location = '<?php echo ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente='.$this->getWelcomeAgent().''); ?>';
|
window.location = '<?php echo ui_get_full_url('index.php?sec=wizard&sec2=godmode/wizards/task_to_perform&create_modules_dialog=1'); ?>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function monitorRemoteCommands() {
|
function openCreateConnectivityDialog() {
|
||||||
window.location = '<?php echo ui_get_full_url(''); ?>';
|
window.location = '<?php echo ui_get_full_url('index.php?sec=wizard&sec2=godmode/wizards/task_to_perform&create_connectivity_dialog=1'); ?>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function discoverDevicesNetwork() {
|
function openCreateBasicNetDialog() {
|
||||||
window.location = '<?php echo ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=hd&mode=netscan'); ?>';
|
window.location = '<?php echo ui_get_full_url('index.php?sec=wizard&sec2=godmode/wizards/task_to_perform&create_net_scan_dialog=1'); ?>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function reportIsNotWorking() {
|
function openCreateAlertMailDialog() {
|
||||||
}
|
window.location = '<?php echo ui_get_full_url('index.php?sec=wizard&sec2=godmode/wizards/task_to_perform&create_alert_mail_dialog=1'); ?>';
|
||||||
|
}
|
||||||
|
|
||||||
function cierre_dialog(){
|
function cierre_dialog(){
|
||||||
this.dialog("close");
|
this.dialog("close");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
return ob_get_clean();
|
return ob_get_clean();
|
||||||
|
@ -455,7 +455,7 @@ function alerts_delete_alert_action($id_alert_action)
|
|||||||
*
|
*
|
||||||
* @return mixed Id of the cloned action or false in case of fail.
|
* @return mixed Id of the cloned action or false in case of fail.
|
||||||
*/
|
*/
|
||||||
function alerts_clone_alert_action($id_alert_action, $id_group)
|
function alerts_clone_alert_action($id_alert_action, $id_group, $copy_name='')
|
||||||
{
|
{
|
||||||
$id_alert_action = safe_int($id_alert_action, 1);
|
$id_alert_action = safe_int($id_alert_action, 1);
|
||||||
if (empty($id_alert_action)) {
|
if (empty($id_alert_action)) {
|
||||||
@ -474,7 +474,13 @@ function alerts_clone_alert_action($id_alert_action, $id_group)
|
|||||||
|
|
||||||
unset($action['id']);
|
unset($action['id']);
|
||||||
|
|
||||||
return alerts_create_alert_action($action['name'].' '.__('copy'), $action['id_alert_command'], $action);
|
if ($copy_name !== '') {
|
||||||
|
$copy_name = $copy_name;
|
||||||
|
} else {
|
||||||
|
$copy_name = $action['name'].' '.__('copy');
|
||||||
|
}
|
||||||
|
|
||||||
|
return alerts_create_alert_action($copy_name, $action['id_alert_command'], $action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1916,7 +1916,7 @@ function api_set_update_agent_field($id_agent, $use_agent_alias, $params)
|
|||||||
*
|
*
|
||||||
* @param $thrash3 Don't use.
|
* @param $thrash3 Don't use.
|
||||||
*/
|
*/
|
||||||
function api_set_new_agent($id_node, $thrash2, $other, $trhash3)
|
function api_set_new_agent($id_node, $thrash2, $other, $trhash3, $return=false)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
@ -2038,13 +2038,17 @@ function api_set_new_agent($id_node, $thrash2, $other, $trhash3)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
returnData(
|
if ($return === false) {
|
||||||
'string',
|
returnData(
|
||||||
[
|
'string',
|
||||||
'type' => 'string',
|
[
|
||||||
'data' => $id_agente,
|
'type' => 'string',
|
||||||
]
|
'data' => $id_agente,
|
||||||
);
|
]
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return $id_agente;
|
||||||
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
returnError($e->getMessage());
|
returnError($e->getMessage());
|
||||||
return;
|
return;
|
||||||
|
@ -6977,3 +6977,44 @@ function html_print_code_picker(
|
|||||||
echo $output;
|
echo $output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function html_print_wizard_diagnosis(
|
||||||
|
$title,
|
||||||
|
$id_button,
|
||||||
|
$description='',
|
||||||
|
$status=true,
|
||||||
|
$return=false,
|
||||||
|
) {
|
||||||
|
$button = '';
|
||||||
|
if ($status === true) {
|
||||||
|
$status = 'Connected';
|
||||||
|
$img = '/images/configuration@svg.svg';
|
||||||
|
} else {
|
||||||
|
$status = 'Disconnected';
|
||||||
|
$img = '/images/change-active.svg';
|
||||||
|
}
|
||||||
|
|
||||||
|
$button = html_print_image(
|
||||||
|
$img,
|
||||||
|
true,
|
||||||
|
[
|
||||||
|
'class' => 'main_menu_icon invert_filter float-right mrgn_right_10px',
|
||||||
|
'id' => $id_button,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
$output = '<div class="rectangle rectangle_'.$status.'">
|
||||||
|
<span class="status '.$status.'">'.__($status).$button.'</span>
|
||||||
|
<div class="title">'.html_print_image('/images/circle_title.svg', true, ['class' => 'invert_filter']).'<span>'.$title.'</span></div>
|
||||||
|
<div class="description">
|
||||||
|
<span>'.$description.'</span>
|
||||||
|
</div>
|
||||||
|
</div>';
|
||||||
|
|
||||||
|
if ($return === true) {
|
||||||
|
return $output;
|
||||||
|
} else {
|
||||||
|
echo $output;
|
||||||
|
}
|
||||||
|
}
|
@ -1317,3 +1317,24 @@ function servers_get_master()
|
|||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true if all servers are up.
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
function check_all_servers_up()
|
||||||
|
{
|
||||||
|
$status = true;
|
||||||
|
|
||||||
|
$servers = servers_get_info();
|
||||||
|
|
||||||
|
foreach ($servers as $server) {
|
||||||
|
if ($server['status'] !== '1') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $status;
|
||||||
|
}
|
||||||
|
@ -3078,6 +3078,32 @@ function ui_print_module_status(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns html code to print a shape for a module.
|
||||||
|
*
|
||||||
|
* @param integer $color Hex color.
|
||||||
|
* @param boolean $return True or false.
|
||||||
|
* @param string $class Custom class or use defined.
|
||||||
|
* @param string $div_content Content.
|
||||||
|
*
|
||||||
|
* @return string HTML code for shape.
|
||||||
|
*/
|
||||||
|
function ui_print_diagnosis_status(
|
||||||
|
$color,
|
||||||
|
$return=false,
|
||||||
|
$class='status_rounded_rectangles',
|
||||||
|
$div_content=''
|
||||||
|
) {
|
||||||
|
$output = '<div style="background: '.$color.'" class="'.$class.'">'.$div_content.'</div>';
|
||||||
|
|
||||||
|
if ($return === false) {
|
||||||
|
echo $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the shape of an image by assigning it a CSS class. Prints an image with CSS representing a status.
|
* Get the shape of an image by assigning it a CSS class. Prints an image with CSS representing a status.
|
||||||
*
|
*
|
||||||
|
83
pandora_console/include/styles/mini_diagnosis.css
Normal file
83
pandora_console/include/styles/mini_diagnosis.css
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
.rectangle {
|
||||||
|
background-color: #ffffff;
|
||||||
|
border: 2px solid #e5e9ed;
|
||||||
|
border-radius: 6px;
|
||||||
|
max-width: 475px;
|
||||||
|
width: 475px;
|
||||||
|
height: 161px;
|
||||||
|
display: contents;
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rectangle:hover {
|
||||||
|
background-color: #f3f5f7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rectangle_Connected {
|
||||||
|
border-left: 4px solid #82b92e;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rectangle_Disconnected {
|
||||||
|
border-left: 4px solid #8a96a6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status {
|
||||||
|
font-weight: bold;
|
||||||
|
margin-top: -10px;
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Connected {
|
||||||
|
color: #82b92e;
|
||||||
|
font-family: Lato;
|
||||||
|
font-size: 15px;
|
||||||
|
line-height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Disconnected {
|
||||||
|
color: #8a96a6;
|
||||||
|
font-family: Lato;
|
||||||
|
font-size: 15px;
|
||||||
|
line-height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
margin-top: 20px;
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title > img {
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title > span {
|
||||||
|
color: #14524f;
|
||||||
|
font-family: Lato;
|
||||||
|
font-size: 18px;
|
||||||
|
line-height: 24px;
|
||||||
|
text-align: left;
|
||||||
|
margin-left: 10px;
|
||||||
|
margin-right: 10px;
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: 20px;
|
||||||
|
margin-top: -20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.description {
|
||||||
|
margin-top: 20px;
|
||||||
|
margin-left: 10px;
|
||||||
|
color: #454545;
|
||||||
|
font-family: Lato;
|
||||||
|
font-size: 15px;
|
||||||
|
line-height: 24px;
|
||||||
|
width: 430px;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
span > img:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
@ -86,3 +86,13 @@
|
|||||||
#welcome_form li.extra {
|
#welcome_form li.extra {
|
||||||
padding-bottom: 2.5em;
|
padding-bottom: 2.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#li-div_diagnosis,
|
||||||
|
#li-div_task_todo {
|
||||||
|
border-left: unset !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#div_diagnosis > label,
|
||||||
|
#div_task_todo > label {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user