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] .= '