Skip to content

Commit cd092d7

Browse files
committed
Polish server list page
1 parent fa206b1 commit cd092d7

File tree

2 files changed

+27
-36
lines changed

2 files changed

+27
-36
lines changed

src/static/a/servers.css

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,17 @@
22
* BNETDocs (C) 2016 Creative Commons CC-BY-NC-SA 4.0 License
33
*/
44

5-
table.servers {
6-
font-size: smaller;
7-
line-height: 17px;
8-
}
9-
table.servers td {
10-
border: 1px solid rgba(255,255,255,0.05);
11-
border-left: 0px;
12-
border-right: 0px;
13-
line-height: normal;
14-
padding: 2px 1px;
15-
}
16-
table.servers tr:first-child td {
17-
border-top: 0px;
18-
}
19-
table.servers tr:last-child td {
20-
border-bottom: 0px;
5+
@media screen and (max-width: 999px) {
6+
table.servers {
7+
font-size: 12pt;
8+
}
219
}
22-
table.servers td.status {
10+
table.servers th.status {
2311
width: 50px;
2412
}
25-
table.servers td.label {
26-
width: 140px;
27-
}
2813
table.servers td.address {
2914
font-family: source code pro, courier new, monospace;
30-
width: 280px;
31-
}
32-
table.servers td.updated {
15+
font-size: smaller;
3316
}
3417
table.servers td.offline {
3518
color: #d74747;

src/templates/Servers.phtml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,21 @@ require("./header.inc.phtml");
2626
<p>Below is a list of servers that our automated system checks the status of. The status represents if the port is opened or closed, not if the service is functioning correctly.</p>
2727
<p>We have a total of <strong><?php echo number_format(count($this->context->servers)); ?> servers</strong> that we monitor. <a href="<?php echo Common::relativeUrlToAbsolute("/servers.json"); ?>">Click here</a> to see this list in JSON format.</p>
2828
</section>
29-
</article>
30-
<article>
29+
<section>
30+
<table class="servers">
31+
<thead>
32+
<tr>
33+
<th class="status">Status</th>
34+
<th class="label">Label</th>
35+
<th class="address">Address</th>
36+
<th></th>
37+
</tr>
38+
</thead>
39+
<tbody>
3140
<?php foreach ($servers_by_type as $type_id => $servers) {
3241
$server_type = new ServerType($type_id);
3342
?>
34-
<header><?php echo $server_type->getLabel(); ?></header>
35-
<section>
36-
<table class="servers"><tbody>
43+
<tr><th colspan="4"><?php echo $server_type->getLabel(); ?></th></tr>
3744
<?php foreach ($servers as $server) {
3845
$status_bitmask = $server->getStatusBitmask();
3946
if ($status_bitmask & Server::STATUS_ONLINE) {
@@ -44,15 +51,16 @@ require("./header.inc.phtml");
4451
$status_subclass = "offline"; $status = "Offline";
4552
}
4653
?>
47-
<tr>
48-
<td class="left status <?php echo $status_subclass; ?>"><?php echo $status; ?></td>
49-
<td class="left label"><?php echo ($server->getLabel() != $server->getAddress() && !is_null($server->getLabel()) ? $server->getLabel() : "&nbsp;"); ?></td>
50-
<td class="left address" onclick="bnetdocs.fSelectText(this);"><?php echo $server->getAddress(); ?>:<?php echo $server->getPort(); ?></td>
51-
<td class="left updated">last updated <time datetime="<?php echo $server->getUpdatedDateTime()->format("c"); ?>"><?php echo Common::relativeDateTimeString($server->getUpdatedDateTime()); ?></time></td>
52-
</tr>
54+
<tr>
55+
<td class="status center <?php echo $status_subclass; ?>"><?php echo $status; ?></td>
56+
<td class="label"><?php echo ($server->getLabel() != $server->getAddress() && !is_null($server->getLabel()) ? $server->getLabel() : "&nbsp;"); ?></td>
57+
<td class="address" onclick="bnetdocs.fSelectText(this);"><?php echo $server->getAddress(); ?>:<?php echo $server->getPort(); ?></td>
58+
<td class="center"><a href="<?php echo Common::relativeUrlToAbsolute("/server/" . $server->getId()); ?>">View Details</a></td>
59+
</tr>
5360
<?php } ?>
54-
</tbody></table>
55-
</section>
5661
<?php } ?>
62+
</tbody>
63+
</table>
64+
</section>
5765
</article>
5866
<?php require("./footer.inc.phtml"); ?>

0 commit comments

Comments
 (0)