show 'this connection' label when remote host has current peer address

This commit is contained in:
ghost 2023-08-22 19:38:58 +03:00
parent 1950197b91
commit bd28e705a4
2 changed files with 31 additions and 1 deletions

View File

@ -44,6 +44,16 @@
color: #5785b7;
}
.label {
padding: 4px 8px;
border-radius: 3px;
}
.label-green {
color: #277b1b;
border: 1px #92bc8c solid;
}
.line-height-26 {
line-height: 26px;
}
@ -62,6 +72,18 @@
cursor: default;
}
.cursor-help {
cursor: help;
}
.font-width-normal {
font-weight: normal;
}
.font-size-12 {
font-size: 12px;
}
.font-size-22 {
font-size: 22px;
}

View File

@ -224,7 +224,15 @@ $peerPortStatuses = $db->findLastPeerPortStatusesByPeerId($requestPeerId);
<div class="row">
<div class="column width-100">
<div class="padding-4">
<h1><?php echo sprintf(_('Peer %s'), $peerInfo->address) ?></h1>
<h1>
<?php echo sprintf(_('Peer %s'), $peerInfo->address) ?>
<?php if (!empty($_SERVER['REMOTE_ADDR']) && $peerInfo->address == $_SERVER['REMOTE_ADDR']) { ?>
<span class="label label-green font-size-12 font-width-normal cursor-default" title="<?php echo _('you have connected from this peer') ?>">
<?php echo _('this connection') ?>
</span>
<?php } ?>
</h1>
</div>
</div>
</div>