Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed active device highlight in racks #3911

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 26 additions & 1 deletion functions/classes/class.Rackspace.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ public function draw_rack ($id, $deviceId = false, $is_back = false, $draw_names
"name"=>$c->name,
"startLocation"=>$c->rack_start-$rack->size,
"size"=>$c->rack_size,
"type"=>"content",
"rackName"=>$rack->name
);
// if startlocation is not set
Expand All @@ -335,6 +336,7 @@ public function draw_rack ($id, $deviceId = false, $is_back = false, $draw_names
"name"=>$c->name,
"startLocation"=>$c->rack_start,
"size"=>$c->rack_size,
"type"=>"content",
"rackName"=>$rack->name
);
// if startlocation is not set
Expand All @@ -359,6 +361,7 @@ public function draw_rack ($id, $deviceId = false, $is_back = false, $draw_names
"name"=>$d->hostname,
"startLocation"=>$d->rack_start-$rack->size,
"size"=>$d->rack_size,
"type"=>"device",
"rackName"=>$rack->name
);
// if startlocation is not set
Expand All @@ -377,6 +380,7 @@ public function draw_rack ($id, $deviceId = false, $is_back = false, $draw_names
"name"=>$d->hostname,
"startLocation"=>$d->rack_start,
"size"=>$d->rack_size,
"type"=>"device",
"rackName"=>$rack->name
);
// if startlocation is not set
Expand Down Expand Up @@ -424,7 +428,7 @@ private function set_rack () {
*/
public function set_active_rack_device ($id) {
foreach ($this->Rack->getContent() as $content) {
if ($content->getId() == $id) {
if ($content->getId() == $id && $content->getType() == "device") {
$content->setActive();
}
}
Expand Down Expand Up @@ -957,6 +961,27 @@ public function setActive($active = true) {
$this->active = $active;
}

/**
* returns type
*
* @access public
* @return string
*/
public function getType() {
return $this->type;
}

/**
* Sets type
*
* @access public
* @param string $type
* @return void
*/
public function setType($type) {
$this->type = $type;
}

/**
* Returns start position
*
Expand Down