diff --git a/pandora_console/godmode/wizards/HostDevices.class.php b/pandora_console/godmode/wizards/HostDevices.class.php index 83f5d21b4c..b5f635eb40 100755 --- a/pandora_console/godmode/wizards/HostDevices.class.php +++ b/pandora_console/godmode/wizards/HostDevices.class.php @@ -690,6 +690,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 +708,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 65a526cc58..638228c365 100644 --- a/pandora_console/godmode/wizards/Wizard.main.php +++ b/pandora_console/godmode/wizards/Wizard.main.php @@ -104,6 +104,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 * @@ -116,9 +150,15 @@ class Wizard $bc = []; $i = 0; foreach ($urls as $url) { + if ($url['selected'] == 1) { + $class = 'selected'; + } else { + $class = ''; + } + $bc[$i] = ''; - $bc[$i] .= '
'.$url['label'].'
'; - $bc[$i++] .= '
'; + $bc[$i] .= '
'.$url['label']; + $bc[$i++] .= '
'; } $this->setBreadcrum($bc); 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; +}