Welcome pack

This commit is contained in:
fbsanchez 2019-11-07 10:42:46 +01:00
parent 3eb0a6bb95
commit d080f1d6a7
4 changed files with 107 additions and 25 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

View File

@ -142,8 +142,8 @@ class WelcomeWindow extends Wizard
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>', url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
modal: { modal: {
title: "<?php echo __('Welcome to Pandora FMS'); ?>", title: "<?php echo __('Welcome to Pandora FMS'); ?>",
cancel: '<?php echo __('Ignore'); ?>', cancel: '<?php echo __('Do not show anymore'); ?>',
ok: '<?php echo __('Cancel'); ?>' ok: '<?php echo __('Close'); ?>'
}, },
onshow: { onshow: {
page: '<?php echo $this->ajaxController; ?>', page: '<?php echo $this->ajaxController; ?>',
@ -258,16 +258,25 @@ class WelcomeWindow extends Wizard
$btn_create_alert_class = ''; $btn_create_alert_class = '';
$btn_create_discovery_class = 'pending'; $btn_create_discovery_class = 'pending';
$li_configure_mail_class = 'green';
$li_create_agent_class = 'green';
$li_create_module_class = 'grey';
$li_create_alert_class = 'grey';
$li_create_discovery_class = 'green';
switch ($this->step) { switch ($this->step) {
case W_CREATE_AGENT: case W_CREATE_AGENT:
$btn_configure_mail_class = ' completed'; $btn_configure_mail_class = ' completed';
$btn_create_agent_class = ' pending'; $btn_create_agent_class = ' pending';
$li_create_module_class = 'green';
break; break;
case W_CREATE_MODULE: case W_CREATE_MODULE:
$btn_configure_mail_class = ' completed'; $btn_configure_mail_class = ' completed';
$btn_create_agent_class = ' completed'; $btn_create_agent_class = ' completed';
$btn_create_module_class = ' pending'; $btn_create_module_class = ' pending';
$li_create_module_class = 'green';
$li_create_alert_class = 'green';
break; break;
case W_CREATE_ALERT: case W_CREATE_ALERT:
@ -275,6 +284,8 @@ class WelcomeWindow extends Wizard
$btn_create_agent_class = ' completed'; $btn_create_agent_class = ' completed';
$btn_create_module_class = ' completed'; $btn_create_module_class = ' completed';
$btn_create_alert_class = ' pending'; $btn_create_alert_class = ' pending';
$li_create_module_class = 'green';
$li_create_alert_class = 'green';
break; break;
case W_CREATE_TASK: case W_CREATE_TASK:
@ -283,6 +294,8 @@ class WelcomeWindow extends Wizard
$btn_create_module_class = ' completed'; $btn_create_module_class = ' completed';
$btn_create_alert_class = ' completed'; $btn_create_alert_class = ' completed';
$btn_create_discovery_class = ' pending'; $btn_create_discovery_class = ' pending';
$li_create_module_class = 'green';
$li_create_alert_class = 'green';
break; break;
case WELCOME_FINISHED: case WELCOME_FINISHED:
@ -292,6 +305,8 @@ class WelcomeWindow extends Wizard
$btn_create_module_class = ' completed'; $btn_create_module_class = ' completed';
$btn_create_alert_class = ' completed'; $btn_create_alert_class = ' completed';
$btn_create_discovery_class = ' completed'; $btn_create_discovery_class = ' completed';
$li_create_module_class = 'green';
$li_create_alert_class = 'green';
break; break;
default: default:
@ -308,11 +323,32 @@ class WelcomeWindow extends Wizard
'class' => 'modal', 'class' => 'modal',
]; ];
$logo_url = '';
if (enterprise_installed()) {
$logo_url = ENTERPRISE_DIR.'/';
}
$logo_url .= 'images/custom_logo/'.$config['custom_logo_white_bg'];
$inputs = [ $inputs = [
[
'class' => 'white_box',
'block_content' => [
[
'class' => 'centered_full',
'arguments' => [
'type' => 'image',
'src' => $logo_url,
'value' => 1,
'return' => true,
],
],
],
],
[ [
'wrapper' => 'div', 'wrapper' => 'div',
'block_id' => 'div_configure_mail', 'block_id' => 'div_configure_mail',
'class' => 'flex-row w100p', 'class' => 'hole flex-row w100p '.$li_configure_mail_class,
'direct' => 1, 'direct' => 1,
'block_content' => [ 'block_content' => [
[ [
@ -333,10 +369,20 @@ class WelcomeWindow extends Wizard
], ],
], ],
], ],
],[ ],
[
'label' => 'Learn to monitor',
'class' => 'extra',
'arguments' => [
'class' => 'class="lbl_learn"',
'name' => 'lbl_learn',
'id' => 'lbl_learn',
],
],
[
'wrapper' => 'div', 'wrapper' => 'div',
'block_id' => 'div_create_agent', 'block_id' => 'div_create_agent',
'class' => 'flex-row w100p', 'class' => 'learn_content_indented flex-row w100p '.$li_create_agent_class,
'direct' => 1, 'direct' => 1,
'block_content' => [ 'block_content' => [
[ [
@ -358,18 +404,10 @@ class WelcomeWindow extends Wizard
], ],
], ],
], ],
[
'label' => 'Learn to monitor',
'arguments' => [
'class' => 'class="lbl_learn"',
'name' => 'lbl_learn',
'id' => 'lbl_learn',
],
],
[ [
'wrapper' => 'div', 'wrapper' => 'div',
'block_id' => 'div_monitor_actions', 'block_id' => 'div_monitor_actions',
'class' => 'learn_content_indented flex-row w100p', 'class' => 'learn_content_indented flex-row w100p '.$li_create_module_class,
'direct' => 1, 'direct' => 1,
'block_content' => [ 'block_content' => [
[ [
@ -394,7 +432,7 @@ class WelcomeWindow extends Wizard
[ [
'wrapper' => 'div', 'wrapper' => 'div',
'block_id' => 'div_monitor_actions', 'block_id' => 'div_monitor_actions',
'class' => 'learn_content_indented flex-row w100p', 'class' => 'hole learn_content_indented flex-row w100p '.$li_create_alert_class,
'direct' => 1, 'direct' => 1,
'block_content' => [ 'block_content' => [
[ [
@ -419,7 +457,7 @@ class WelcomeWindow extends Wizard
[ [
'wrapper' => 'div', 'wrapper' => 'div',
'block_id' => 'div_discover', 'block_id' => 'div_discover',
'class' => 'flex-row w100p', 'class' => 'hole flex-row w100p '.$li_create_discovery_class,
'direct' => 1, 'direct' => 1,
'block_content' => [ 'block_content' => [
[ [
@ -444,7 +482,7 @@ class WelcomeWindow extends Wizard
[ [
'wrapper' => 'div', 'wrapper' => 'div',
'block_id' => 'div_not_working', 'block_id' => 'div_not_working',
'class' => 'flex-row w100p', 'class' => 'hole flex-row w100p',
'direct' => 1, 'direct' => 1,
'block_content' => [ 'block_content' => [
[ [
@ -505,6 +543,11 @@ class WelcomeWindow extends Wizard
// Check current page. // Check current page.
$sec2 = get_parameter('sec2', ''); $sec2 = get_parameter('sec2', '');
// Search also does not fulfill sec2.
if (empty($sec2) === true) {
$sec2 = get_parameter('keywords', '');
}
if ($must_run === false if ($must_run === false
|| $config['welcome_state'] === WELCOME_FINISHED || $config['welcome_state'] === WELCOME_FINISHED
) { ) {
@ -545,12 +588,11 @@ class WelcomeWindow extends Wizard
/* /*
* Create agent. Control current flow. * Create agent. Control current flow.
* *
* On empty sec2: show current step. * Welcome wizard is shown if you create your first agent.
* On agent creation page: do not show. *
* After agent creation: enable module step.
*/ */
if ($this->step === W_CREATE_AGENT) { if (empty($config['welcome_id_agent']) === true) {
// Create agent is pending. // Create agent is pending.
if ($sec2 === 'godmode/agentes/configurar_agente' if ($sec2 === 'godmode/agentes/configurar_agente'
&& get_parameter('create_agent', false) !== false && get_parameter('create_agent', false) !== false

View File

@ -17,10 +17,11 @@
*/ */
} }
#welcome_form ul.wizard li { #welcome_form ul.wizard > li {
padding: 1em; padding: 1em;
padding-bottom: 0; padding-bottom: 0.6em;
padding-top: 1em; padding-top: 0.6em;
padding-left: 0.7em;
} }
#welcome_form label { #welcome_form label {
@ -55,8 +56,44 @@
.pending { .pending {
background-image: url(../../images/darrowright.png); background-image: url(../../images/darrowright.png);
background-image: url(../../images/arrow-icon.png);
} }
.completed { .completed {
background-image: url(../../images/input_tick.png); background-image: url(../../images/input_tick.png);
} }
.centered_full {
padding: 1em;
text-align: center;
}
#welcome_form li.centered_full > label {
width: auto;
}
#welcome_form ul.wizard li.white_box {
padding: 0;
margin-bottom: 2em;
}
#welcome_form ul.wizard li.centered_full {
padding-top: 1em;
padding-bottom: 1em;
}
#welcome_form li:not(.centered_full):not(.white_box) {
border-left: 4px solid #79a930;
}
#welcome_form li:not(.centered_full):not(.white_box).grey {
border-left: 4px solid #d6d6d6;
}
#welcome_form li.hole {
margin-bottom: 0.8em;
}
#welcome_form li.extra {
padding-bottom: 2.5em;
}

View File

@ -10,7 +10,8 @@ button.submit-cancel {
cursor: pointer; cursor: pointer;
text-align: center; text-align: center;
height: 30px; height: 30px;
width: 90px; width: auto;
min-width: 90px;
} }
input[type="submit"].submit-cancel:hover, input[type="submit"].submit-cancel:hover,
@ -32,6 +33,8 @@ input[type="button"].submit-next {
cursor: pointer; cursor: pointer;
text-align: center; text-align: center;
height: 30px; height: 30px;
width: auto;
min-width: 90px;
} }
input[type="submit"].submit-next:hover, input[type="submit"].submit-next:hover,