summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-05-06 17:42:29 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-05-06 17:42:29 -0700
commit03dbec960a7913557ce1659f01d8a6a507cd5ec5 (patch)
treed9bcffefbaf3d88e74267700142e9094a54a6ca7 /ui
parent4a2c46e008044e3c5208646245b3da82408012c4 (diff)
downloadinfinitytier-03dbec960a7913557ce1659f01d8a6a507cd5ec5.tar.gz
infinitytier-03dbec960a7913557ce1659f01d8a6a507cd5ec5.zip
UI tweaks
Diffstat (limited to 'ui')
-rw-r--r--ui/ZeroTierNode.jsx22
-rw-r--r--ui/zerotier.css11
2 files changed, 23 insertions, 10 deletions
diff --git a/ui/ZeroTierNode.jsx b/ui/ZeroTierNode.jsx
index 566bdc60..1edab408 100644
--- a/ui/ZeroTierNode.jsx
+++ b/ui/ZeroTierNode.jsx
@@ -10,8 +10,10 @@ var ZeroTierNode = React.createClass({
},
ago: function(ms) {
- var tmp = (Date.now() - ms);
- return ((tmp > 0) ? tmp : 0);
+ if (ms > 0) {
+ var tmp = Math.round((Date.now() - ms) / 1000);
+ return ((tmp > 0) ? tmp : 0);
+ } else return 0;
},
updatePeers: function() {
@@ -88,7 +90,7 @@ var ZeroTierNode = React.createClass({
componentDidMount: function() {
this.tabIndex = 0;
this.updateAll();
- this.updateIntervalId = setInterval(this.updateAll,5000);
+ this.updateIntervalId = setInterval(this.updateAll,2500);
},
componentWillUnmount: function() {
clearInterval(this.updateIntervalId);
@@ -105,12 +107,12 @@ var ZeroTierNode = React.createClass({
{
(this.tabIndex === 1) ? (
<div className="peers">
- <div className="peer">
- <div className="f"><b>Address</b></div>
- <div className="f"><b>Version</b></div>
- <div className="f"><b>Latency</b></div>
- <div className="f"><b>Direct&nbsp;Paths</b></div>
- <div className="f"><b>Role</b></div>
+ <div className="peerHeader">
+ <div className="f">Address</div>
+ <div className="f">Version</div>
+ <div className="f">Latency</div>
+ <div className="f">Direct&nbsp;Paths</div>
+ <div className="f">Role</div>
</div>
{
this.state._peers.map(function(peer) {
@@ -129,7 +131,7 @@ var ZeroTierNode = React.createClass({
peer['paths'].map(function(path) {
if ((path.active)||(path.fixed)) {
return (
- <div className="peerPath">{path.address}&nbsp;{this.ago(path.lastSend)}&nbsp;{this.ago(path.lastReceive)}</div>
+ <div className="peerPath">{path.address}&nbsp;{this.ago(path.lastSend)}&nbsp;{this.ago(path.lastReceive)}{path.preferred ? ' *' : ''}</div>
);
} else {
return (
diff --git a/ui/zerotier.css b/ui/zerotier.css
index aeb2fe0f..5dd7b892 100644
--- a/ui/zerotier.css
+++ b/ui/zerotier.css
@@ -116,6 +116,17 @@ html,body {
display: table-cell;
font-size: 10pt;
}
+.zeroTierNode > .middle > .middleScroll > .peers > .peerHeader {
+ width: 100%;
+ display: table-row;
+ background: #ffffff;
+ border-bottom: 1px solid #000000;
+}
+.zeroTierNode > .middle > .middleScroll > .peers > .peerHeader > .f {
+ display: table-cell;
+ font-size: 10pt;
+ font-weight: bold;
+}
.zeroTierNode > .bottom {
width: 100%;