Merge pull request #5176 from mempool/mononaut/fix-monitoring-layout

Fix monitoring table layout & text wrapping
This commit is contained in:
softsimon 2024-06-22 12:58:53 +09:00 committed by GitHub
commit cf8d179925
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 17 deletions

View File

@ -9,13 +9,13 @@
<ng-container *ngIf="(hosts$ | async) as hosts">
<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>
<tr>
<th class="rank"></th>
<th class="flag"></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-large">RTT</th>
<th class="height">Height</th>

View File

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

View File

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