diff --git a/pandora_console/godmode/servers/discovery.php b/pandora_console/godmode/servers/discovery.php index 489293c862..1ac048a9ed 100755 --- a/pandora_console/godmode/servers/discovery.php +++ b/pandora_console/godmode/servers/discovery.php @@ -36,6 +36,9 @@ function get_wiz_class($str) case 'tasklist': return 'DiscoveryTaskList'; + case 'app': + return 'Applications'; + default: // Ignore. return null; @@ -56,6 +59,7 @@ if (enterprise_installed()) { if ($ent_classes === false) { $ent_classes = []; } + $classes = array_merge($classes, $ent_classes); } @@ -63,6 +67,19 @@ foreach ($classes as $classpath) { include_once $classpath; } +// Load enterprise wizards. +if (enterprise_installed() === true) { + $enterprise_classes = glob( + $config['homedir'].'/'.ENTERPRISE_DIR.'/wizards/*.class.php' + ); + foreach ($enterprise_classes as $classpath) { + $r = enterprise_include_once( + 'wizards/'.basename($classpath) + ); + } +} + +$classes = array_merge($classes, $enterprise_classes); $wiz_in_use = get_parameter('wiz', null); $page = get_parameter('page', 0); diff --git a/pandora_console/godmode/wizards/HostDevices.class.php b/pandora_console/godmode/wizards/HostDevices.class.php index 538969e6ef..d9765cf5c2 100755 --- a/pandora_console/godmode/wizards/HostDevices.class.php +++ b/pandora_console/godmode/wizards/HostDevices.class.php @@ -186,24 +186,6 @@ class HostDevices extends Wizard } - /** - * Checks if environment is ready, - * returns array - * icon: icon to be displayed - * label: label to be displayed - * - * @return array With data. - **/ - public function load() - { - return [ - 'icon' => $this->icon, - 'label' => $this->label, - 'url' => $this->url, - ]; - } - - // Extra methods. @@ -690,6 +672,14 @@ class HostDevices extends Wizard 'action' => $this->url.'&mode=netscan&page='.($this->page + 1).$task_url, ]; + // Default. + $interval = 600; + $unit = 60; + if (isset($this->task['interval_sweep']) === true) { + $interval = $this->task['interval_sweep']; + $unit = $this->getTimeUnit($interval); + } + $form['js'] = ' $("select#interval_manual_defined").change(function() { if ($("#interval_manual_defined").val() == 1) { @@ -700,8 +690,8 @@ $("select#interval_manual_defined").change(function() { else { $("#interval_manual_container").show(); $("#text-interval_text").val(10); - $("#hidden-interval").val(600); - $("#interval_units").val(60); + $("#hidden-interval").val('.$interval.'); + $("#interval_units").val('.$unit.'); } }).change();'; diff --git a/pandora_console/godmode/wizards/Wizard.main.php b/pandora_console/godmode/wizards/Wizard.main.php index de6ed6b525..685bb06851 100644 --- a/pandora_console/godmode/wizards/Wizard.main.php +++ b/pandora_console/godmode/wizards/Wizard.main.php @@ -121,6 +121,40 @@ class Wizard } + /** + * Return units associated to target interval (in seconds). + * + * @param integer $interval Target interval. + * + * @return integer Unit. + */ + public function getTimeUnit($interval) + { + $units = [ + 1, + 60, + 3600, + 86400, + 604800, + 2592000, + 31104000, + ]; + + $size = count($units); + for ($i = 0; $i < $size; $i++) { + if ($interval < $units[$i]) { + if (($i - 1) < 0) { + return 1; + } + + return $units[($i - 1)]; + } + } + + return $units[-1]; + } + + /** * Builder for breadcrum * @@ -135,10 +169,15 @@ class Wizard $bc = []; $i = 0; foreach ($urls as $url) { - $href = (isset($url['link']) === true) ? 'href="'.$url['link'].'"' : ''; - $bc[$i] = ''; - $bc[$i] .= '
'.$url['label'].'
'; - $bc[$i++] .= '
'; + if ($url['selected'] == 1) { + $class = 'selected'; + } else { + $class = ''; + } + + $bc[$i] = ''; + $bc[$i] .= '
'.$url['label']; + $bc[$i++] .= '
'; } if ($add === true) { @@ -162,12 +201,20 @@ class Wizard /** - * To be overwritten. + * Checks if environment is ready, + * returns array + * icon: icon to be displayed + * label: label to be displayed * - * @return void - */ + * @return array With data. + **/ public function load() { + return [ + 'icon' => $this->icon, + 'label' => $this->label, + 'url' => $this->url, + ]; } diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php index fa40994962..29ed623d6e 100644 --- a/pandora_console/include/class/ConsoleSupervisor.php +++ b/pandora_console/include/class/ConsoleSupervisor.php @@ -340,6 +340,14 @@ class ConsoleSupervisor enterprise_hook('cron_supervisor_release_lock'); } + /* + * Check if CRON is running. + * NOTIF.CRON.CONFIGURED + */ + if (enterprise_installed()) { + $this->checkCronRunning(); + } + } diff --git a/pandora_console/include/functions_messages.php b/pandora_console/include/functions_messages.php index 3fb907ab06..5374fb7b1e 100644 --- a/pandora_console/include/functions_messages.php +++ b/pandora_console/include/functions_messages.php @@ -375,7 +375,7 @@ function messages_get_count( tnotification_source ns LEFT JOIN tnotification_source_user nsu ON ns.id=nsu.id_source - AND nsu.id_user="test") + AND nsu.id_user="%s") ON tm.id_source=ns.id', $user ); diff --git a/pandora_console/include/styles/discovery.css b/pandora_console/include/styles/discovery.css index 7c5933aba9..aebb0a3d0d 100644 --- a/pandora_console/include/styles/discovery.css +++ b/pandora_console/include/styles/discovery.css @@ -60,7 +60,7 @@ div.data_container:hover { .arrow_box { display: inline-block; position: relative; - background: #82b92e; + background: #ccc; padding: 14px; margin-left: 20px; margin-bottom: 10px; @@ -75,6 +75,9 @@ div.data_container:hover { position: absolute; pointer-events: none; } +.arrow_box.selected { + background: #82b92e; +} .arrow_box:after { left: 0%; @@ -84,7 +87,10 @@ div.data_container:hover { } .arrow_box:before { left: 100%; - border-left-color: #82b92e; + border-left-color: #ccc; border-width: 20px; margin-top: -20px; } +.arrow_box.selected:before { + border-left-color: #82b92e; +}