Skip to content

Commit bd8813e

Browse files
committed
Add pretty url to server details link
1 parent 290d31b commit bd8813e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/libraries/Server.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,16 @@ public function getTypeId() {
148148
return $this->type_id;
149149
}
150150

151+
public function getURI() {
152+
$value = $this->getLabel();
153+
if (empty($value)) {
154+
$value = $this->getAddress() . ":" . $this->getPort();
155+
}
156+
return Common::relativeUrlToAbsolute(
157+
"/server/" . $this->getId() . "/" . Common::sanitizeForUrl($value, true)
158+
);
159+
}
160+
151161
public function getUpdatedDateTime() {
152162
if (is_null($this->updated_datetime)) {
153163
return $this->updated_datetime;

src/templates/Servers.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ require("./header.inc.phtml");
5555
<td class="status center <?php echo $status_subclass; ?>"><?php echo $status; ?></td>
5656
<td class="label"><?php echo ($server->getLabel() != $server->getAddress() && !is_null($server->getLabel()) ? $server->getLabel() : "&nbsp;"); ?></td>
5757
<td class="address" onclick="bnetdocs.fSelectText(this);"><?php echo $server->getAddress(); ?>:<?php echo $server->getPort(); ?></td>
58-
<td class="details center"><a href="<?php echo Common::relativeUrlToAbsolute("/server/" . $server->getId()); ?>">View Details</a></td>
58+
<td class="details center"><a href="<?php echo $server->getURI(); ?>">View Details</a></td>
5959
</tr>
6060
<?php } ?>
6161
<?php } ?>

0 commit comments

Comments
 (0)