Browse Source

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

yggdrasil-0.4.7
ghost 1 year ago
parent
commit
bd28e705a4
  1. 22
      src/public/assets/theme/default/css/framework.css
  2. 10
      src/public/peer.php

22
src/public/assets/theme/default/css/framework.css

@ -44,6 +44,16 @@ @@ -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 @@ @@ -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;
}

10
src/public/peer.php

@ -224,7 +224,15 @@ $peerPortStatuses = $db->findLastPeerPortStatusesByPeerId($requestPeerId); @@ -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>

Loading…
Cancel
Save