Fix monitoring table layout & text wrapping

This commit is contained in:
Mononaut 2024-06-20 03:09:54 +00:00
parent 02eb633d89
commit 25b510359f
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E
3 changed files with 8 additions and 17 deletions

View File

@ -9,13 +9,13 @@
<ng-container *ngIf="(hosts$ | async) as hosts"> <ng-container *ngIf="(hosts$ | async) as hosts">
<div class="status-panel"> <div class="status-panel">
<table class="status-table table table-fixed table-borderless table-striped" *ngIf="(tip$ | async) as tip"> <table class="status-table table table-borderless table-striped" *ngIf="(tip$ | async) as tip">
<tbody> <tbody>
<tr> <tr>
<th class="rank"></th> <th class="rank"></th>
<th class="flag"></th> <th class="flag"></th>
<th class="host">Host</th> <th class="host">Host</th>
<th class="updated">Last checked</th> <th class="updated">Updated</th>
<th class="rtt only-small">RTT</th> <th class="rtt only-small">RTT</th>
<th class="rtt only-large">RTT</th> <th class="rtt only-large">RTT</th>
<th class="height">Height</th> <th class="height">Height</th>

View File

@ -20,26 +20,21 @@
td, th { td, th {
padding: 0.25em; padding: 0.25em;
width: 0%;
&.rank, &.flag { &.rank, &.flag {
width: 28px;
text-align: right; text-align: right;
} }
&.updated { &.updated {
display: none; display: none;
width: 130px;
text-align: right; text-align: right;
white-space: pre-wrap; white-space: nowrap;
} }
&.rtt, &.height { &.rtt, &.height {
width: 92px;
text-align: right; text-align: right;
} }
&.only-small { &.only-small {
display: table-cell; display: table-cell;
&.rtt {
width: 60px;
}
} }
&.only-large { &.only-large {
display: none; display: none;
@ -48,21 +43,17 @@
padding-right: 0.5em; padding-right: 0.5em;
} }
&.host { &.host {
width: auto; width: 100%;
max-width: 0;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap;
} }
@media (min-width: 576px) { @media (min-width: 576px) {
&.rank, &.flag {
width: 32px;
}
&.updated { &.updated {
display: table-cell; display: table-cell;
} }
&.rtt, &.height {
width: 96px;
}
&.only-small { &.only-small {
display: none; display: none;
} }

View File

@ -62,7 +62,7 @@ export class ServerHealthComponent implements OnInit {
getLastUpdateSeconds(host: HealthCheckHost): string { getLastUpdateSeconds(host: HealthCheckHost): string {
if (host.lastChecked) { if (host.lastChecked) {
const seconds = Math.ceil((this.now - host.lastChecked) / 1000); const seconds = Math.ceil((this.now - host.lastChecked) / 1000);
return `${seconds} second${seconds > 1 ? 's' : ' '} ago`; return `${seconds} s`;
} else { } else {
return '~'; return '~';
} }