Merge branch 'master' of github.com:mix-blockchain/eth-netstats into mix-staging

This commit is contained in:
5chdn 2018-12-01 20:00:37 +01:00
commit 8884cc3bb4
No known key found for this signature in database
GPG Key ID: 1A40871B597F5F80
25 changed files with 3767 additions and 139 deletions

View File

@ -1,9 +1,7 @@
language: node_js language: node_js
node_js: sudo: required
- "8" dist: trusty
env: node_js: '8'
global: install:
secure: Qdkmi13nqcXskABBhbuGZmRakh4orOW1dalkSCyUbzGuYf0OdYF8ttNVuJa0WSWI4KhNXhtz2p3I8dM95wL++LCVqXFmIvZtX8Nca36KlNxIPNXPjn0odayh+c4pgrhrbz8TDmDXl9IPuZmNz8HHtN7xmIn6YDcm13wA3gTmfwo= - npm install
before_install: npm install -g grunt-cli - npm run dist
install: npm install
before_script: grunt build

View File

@ -60,14 +60,14 @@ module.exports = function(grunt) {
{ {
expand: true, expand: true,
cwd: 'src/fonts/', cwd: 'src/fonts/',
src: ['minimal-*.*'], src: ['*.*'],
dest: 'dist/fonts/', dest: 'dist/fonts/',
filter: 'isFile' filter: 'isFile'
}, },
{ {
expand: true, expand: true,
cwd: 'src/images/', cwd: 'src/images/',
src: ['*.ico'], src: ['*.*'],
dest: 'dist/', dest: 'dist/',
filter: 'isFile' filter: 'isFile'
}, },

View File

@ -102,6 +102,9 @@ Node.prototype.setInfo = function(data, callback)
Node.prototype.setGeo = function(ip) Node.prototype.setGeo = function(ip)
{ {
if (ip.substr(0, 7) == "::ffff:") {
ip = ip.substr(7)
}
this.info.ip = ip; this.info.ip = ip;
this.geo = geoip.lookup(ip); this.geo = geoip.lookup(ip);
} }

View File

@ -1,29 +1,6 @@
var trusted = [ var trusted = [];
'52.16.188.185',
'54.94.239.50',
'54.174.74.156',
'54.172.25.93',
'54.174.75.126',
'54.173.232.137',
'52.7.205.180',
'52.7.218.44',
'52.7.205.152',
'52.7.224.174',
'92.51.165.126',
'84.117.82.122',
'73.40.58.88',
'178.19.221.38',
'185.37.145.18',
'172.31.39.87',
'86.120.171.69',
'86.123.155.6',
'188.24.81.133',
'::ffff:127.0.0.1',
];
var banned = [ var banned = [];
// '198.48.150.206'
];
module.exports = { module.exports = {
trusted: trusted, trusted: trusted,

3507
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -10,6 +10,41 @@ body {
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 200;
src: local('Source Sans Pro ExtraLight'), local('SourceSansPro-ExtraLight'), url(../fonts/SourceSansPro-ExtraLight.woff2) format('woff2');
}
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 300;
src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), url(../fonts/SourceSansPro-Light.woff2) format('woff2');
}
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 400;
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(../fonts/SourceSansPro-Regular.woff2) format('woff2');
}
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 600;
src: local('Source Sans Pro SemiBold'), local('SourceSansPro-SemiBold'), url(../fonts/SourceSansPro-SemiBold.woff2) format('woff2');
}
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 700;
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(../fonts/SourceSansPro-Bold.woff2) format('woff2');
}
table td { table td {
font-size: 14px; font-size: 14px;
white-space: nowrap !important; white-space: nowrap !important;
@ -30,37 +65,32 @@ table td {
.bg-success, .bg-success,
.text-success .propagationBox { .text-success .propagationBox {
background: #50fa7b; background: #7bcc3a;
} }
.bg-info, .bg-info,
.text-info .propagationBox { .text-info .propagationBox {
background: #8be9fd; background: #10a0de;
}
.bg-highlight,
.text-highlight .propagationBox {
background: #bd93f9;
} }
.bg-warning, .bg-warning,
.text-warning .propagationBox { .text-warning .propagationBox {
background: #f1fa8c; background: #FFD162;
} }
.bg-orange, .bg-orange,
.text-orange .propagationBox { .text-orange .propagationBox {
background: #ffb86c; background: #ff8a00;
} }
.bg-danger, .bg-danger,
.text-danger .propagationBox { .text-danger .propagationBox {
background: #ff5555; background: #F74B4B;
} }
.text-gray .propagationBox { .text-gray .propagationBox {
background: none !important; background: none !important;
border: 1px solid #f8f8f2; border: 1px solid #777;
} }
.bg-success, .bg-success,
@ -72,11 +102,11 @@ table td {
} }
.text-gray { .text-gray {
color: #f8f8f2 !important; color: #777 !important;
} }
.text-orange { .text-orange {
color: #ffb86c; color: #ff8a00;
} }
.container-fluid { .container-fluid {
@ -153,9 +183,9 @@ span.small-title span.small {
} }
.big-info.chart .big-details { .big-info.chart .big-details {
display: block; display: table;
position: absolute;
top: 40px; top: 40px;
margin: 0 auto;
} }
.big-info.chart { .big-info.chart {
@ -172,6 +202,8 @@ span.small-title span.small {
width: 288px; width: 288px;
padding-top: 6px; padding-top: 6px;
margin-left: -2px; margin-left: -2px;
display: table;
margin: 0 auto;
} }
.blocks-holder { .blocks-holder {
@ -185,7 +217,7 @@ span.small-title span.small {
letter-spacing: -0.1px; letter-spacing: -0.1px;
text-transform: none; text-transform: none;
white-space: nowrap; white-space: nowrap;
color: #f8f8f2; color: #777;
} }
.blocks-holder .block-count { .blocks-holder .block-count {
@ -460,7 +492,7 @@ svg .axis line {
shape-rendering: crispEdges; shape-rendering: crispEdges;
} }
svg .axis text { svg .axis text {
fill: #f8f8f2; fill: #777;
font-size: 10px; font-size: 10px;
letter-spacing: 0px; letter-spacing: 0px;
font-family: "Source Sans Pro"; font-family: "Source Sans Pro";
@ -472,3 +504,51 @@ svg .axis text {
svg .y.axis .tick:first-child text { svg .y.axis .tick:first-child text {
opacity: 0; opacity: 0;
} }
@media (max-width: 768px) {
.container-fluid {
padding-left: 5px;
padding-right: 5px;
}
.big-info .icon-full-width i {
width: 75px;
height: 67px;
font-size: 67px;
margin-left: -25px;
}
.big-info .big-details-holder {
left: 75px;
}
.big-info .big-details {
font-size: 35px;
}
.blocks-holder div.small-title-miner {
font-family: inherit;
font-size: 11px;
letter-spacing: -.5px;
}
.blocks-holder {
width: 100%;
}
.big-info.chart i, .second-row .box i {
font-size: 18px;
margin-right: 0px;
}
.second-row .box {
height: 100%; /* BUG XXX */
}
}
@media (max-width: 600px) {
.blocks-holder div.small-title-miner {
font-size: 10px;
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 574 B

1
src/images/link-logo.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><g display="none"><path display="inline" fill="#000000" d="M14.645,85.355c-8.592-8.592-8.592-22.521,0-31.113l14.85-14.85 c0.901-0.901,1.873-1.686,2.88-2.398c-1.628,4.587-1.826,9.563-0.584,14.244L21.716,61.313c-4.679,4.679-4.68,12.292,0,16.97 c4.679,4.68,12.292,4.68,16.971,0l14.849-14.849c4.679-4.679,4.68-12.292,0-16.971c-2.307-2.306-5.325-3.47-8.354-3.503 c0.388-1.826,1.282-3.566,2.698-4.982l3.945-3.945c3.209,1.037,6.233,2.811,8.782,5.359c8.592,8.592,8.592,22.521,0,31.113 l-14.85,14.85C37.166,93.947,23.236,93.947,14.645,85.355z M52.121,62.021c1.416-1.416,2.311-3.155,2.698-4.982 c-3.029-0.032-6.049-1.196-8.354-3.503c-4.68-4.68-4.679-12.292,0-16.971l14.849-14.85c4.679-4.678,12.292-4.679,16.971,0 c4.679,4.68,4.679,12.293,0,16.971L68.223,48.747c1.245,4.685,1.058,9.673-0.571,14.263c1.001-0.71,1.958-1.508,2.854-2.404 l14.85-14.849c8.592-8.591,8.592-22.521,0-31.112s-22.521-8.592-31.113,0l-14.849,14.85c-8.592,8.591-8.592,22.521,0,31.111 c2.547,2.549,5.564,4.334,8.772,5.37L52.121,62.021z"></path></g><g><path d="M14.645,85.355c-8.592-8.592-8.592-22.521,0-31.113l14.85-14.85c0.901-0.901,1.873-1.686,2.88-2.398 c-1.628,4.587-1.826,9.563-0.584,14.244L21.716,61.313c-4.679,4.679-4.68,12.292,0,16.97c4.679,4.68,12.292,4.68,16.971,0 l14.849-14.849c4.679-4.679,4.68-12.292,0-16.971c-2.307-2.306-5.325-3.47-8.354-3.503c0.388-1.826,1.282-3.566,2.698-4.982 l3.945-3.945c3.209,1.037,6.233,2.811,8.782,5.359c8.592,8.592,8.592,22.521,0,31.113l-14.85,14.85 C37.166,93.947,23.236,93.947,14.645,85.355z M52.121,62.021c1.416-1.416,2.311-3.155,2.698-4.982 c-3.029-0.032-6.049-1.196-8.354-3.503c-4.68-4.68-4.679-12.292,0-16.971l14.849-14.85c4.679-4.678,12.292-4.679,16.971,0 c4.679,4.68,4.679,12.293,0,16.971L68.223,48.747c1.245,4.685,1.058,9.673-0.571,14.263c1.001-0.71,1.958-1.508,2.854-2.404 l14.85-14.849c8.592-8.591,8.592-22.521,0-31.112s-22.521-8.592-31.113,0l-14.849,14.85c-8.592,8.591-8.592,22.521,0,31.111 c2.547,2.549,5.564,4.334,8.772,5.37L52.121,62.021z"></path></g><g display="none"><path display="inline" fill="#000000" stroke="#E00C02" stroke-width="4" stroke-miterlimit="10" d="M56.749,62.902 c-5.019-0.079-10.013-2.023-13.82-5.831l0,0c-7.778-7.778-7.778-20.506,0-28.285l14.143-14.142c7.778-7.778,20.506-7.778,28.284,0 l0,0c7.778,7.778,7.778,20.506,0,28.284L71.213,57.071c-1.064,1.064-2.222,1.984-3.446,2.757"></path><path display="inline" fill="#000000" stroke="#E00C02" stroke-width="4" stroke-miterlimit="10" d="M43.251,37.098 c5.019,0.08,10.013,2.023,13.82,5.831l0,0c7.778,7.778,7.778,20.506,0,28.285L42.929,85.355c-7.778,7.778-20.506,7.778-28.284,0 l0,0c-7.778-7.778-7.778-20.506,0-28.284l14.143-14.143c1.064-1.064,2.222-1.984,3.447-2.758"></path></g><g display="none"><path display="inline" d="M56.718,64.901c-5.758-0.09-11.156-2.369-15.203-6.416c-4.14-4.14-6.42-9.664-6.42-15.557 c0-5.892,2.28-11.417,6.42-15.556L55.657,13.23c4.14-4.14,9.664-6.42,15.556-6.42c5.893,0,11.417,2.28,15.557,6.42 s6.42,9.664,6.42,15.556s-2.28,11.417-6.42,15.556L72.627,58.485c-1.151,1.151-2.427,2.172-3.793,3.034l-2.135-3.383 c1.115-0.704,2.158-1.538,3.1-2.479l14.143-14.143c3.384-3.384,5.248-7.904,5.248-12.728c0-4.823-1.864-9.344-5.248-12.728 c-3.385-3.384-7.904-5.248-12.729-5.248c-4.823,0-9.343,1.864-12.728,5.248L44.343,30.201c-7.019,7.019-7.019,18.438,0,25.457 c3.309,3.308,7.726,5.17,12.438,5.245L56.718,64.901z M44.343,86.77l14.143-14.142c8.578-8.578,8.578-22.535,0-31.113 c-4.046-4.047-9.445-6.325-15.203-6.417l-0.063,3.999c4.712,0.075,9.13,1.938,12.438,5.246c7.019,7.019,7.019,18.438,0,25.457 L41.515,83.941c-7.018,7.018-18.437,7.019-25.456,0c-3.384-3.384-5.248-7.905-5.248-12.728c0-4.824,1.864-9.344,5.248-12.728 l14.143-14.143c0.942-0.942,1.986-1.777,3.101-2.48l-2.135-3.383c-1.365,0.862-2.642,1.883-3.794,3.035L13.23,55.657 c-4.14,4.139-6.42,9.664-6.42,15.556s2.28,11.417,6.42,15.556c4.289,4.289,9.923,6.433,15.556,6.433 C34.42,93.203,40.054,91.058,44.343,86.77z"></path></g></svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 820.47 783.14" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><metadata><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/><dc:title/></cc:Work></rdf:RDF></metadata><style type="text/css">
.st0{fill:none;stroke:#3CC3DB;stroke-width:12.5785;stroke-linejoin:round;stroke-miterlimit:10;}
.st1{fill:#3CC3DB;}
.st2{fill:#006373;}
.st3{fill:#006C77;}
.st4{fill:#00555E;}
.st5{fill:#014C64;}
.st6{fill:#0297AF;}
.st7{fill:#00A5BF;}
.st8{fill:#007E92;}
.st9{fill:#37B2C8;}
.st10{fill:#2C94A6;}
.st11{fill:#32A3B8;}
.st12{fill:#4CC4D4;}
.st13{fill:none;stroke:#3CC3DB;stroke-width:5.5114;stroke-linejoin:round;stroke-miterlimit:10;}
.st14{fill:none;stroke:#3CC3DB;stroke-width:11.7923;stroke-linejoin:round;stroke-miterlimit:10;}
.st15{fill:none;stroke:#3CC3DB;stroke-width:11.5432;stroke-linejoin:round;stroke-miterlimit:10;}
.st16{fill:none;stroke:#4294D1;stroke-width:5.511;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st17{fill:none;stroke:#3DA7D7;stroke-width:5.511;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st18{fill:none;stroke:#3CC3DB;stroke-width:5.511;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st19{fill:none;stroke:#4294D1;stroke-width:11.792;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st20{fill:none;stroke:#3DA7D7;stroke-width:11.792;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st21{fill:none;stroke:#3CC3DB;stroke-width:11.792;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st22{fill:none;stroke:#4294D1;stroke-width:11.543;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st23{fill:none;stroke:#3DA7D7;stroke-width:11.543;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st24{fill:none;stroke:#3CC3DB;stroke-width:11.543;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st25{fill:none;stroke:#4294D1;stroke-width:12.579;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st26{fill:none;stroke:#3DA7D7;stroke-width:12.579;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st27{fill:none;stroke:#3CC3DB;stroke-width:12.579;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st28{fill:none;stroke:#3CC3DB;stroke-width:9;stroke-linejoin:round;stroke-miterlimit:10;}
.st29{fill:none;stroke:#3CC3DB;stroke-width:20.5369;stroke-linejoin:round;stroke-miterlimit:10;}
.st30{fill:none;stroke:#3CC3DB;stroke-width:16;stroke-linejoin:round;stroke-miterlimit:10;}
.st31{fill:none;stroke:#4294D1;stroke-width:9;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st32{fill:none;stroke:#3DA7D7;stroke-width:9;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st33{fill:none;stroke:#3CC3DB;stroke-width:9;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st34{fill:none;stroke:#4294D1;stroke-width:20.537;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st35{fill:none;stroke:#3DA7D7;stroke-width:20.537;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st36{fill:none;stroke:#3CC3DB;stroke-width:20.537;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st37{fill:none;stroke:#4294D1;stroke-width:16;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st38{fill:none;stroke:#3DA7D7;stroke-width:16;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st39{fill:none;stroke:#3CC3DB;stroke-width:16;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st40{fill:none;stroke:#4294D1;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st41{fill:none;stroke:#3DA7D7;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st42{fill:none;stroke:#3CC3DB;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st43{fill:none;stroke:#4294D1;stroke-width:6.913;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st44{fill:none;stroke:#3DA7D7;stroke-width:6.913;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st45{fill:none;stroke:#3CC3DB;stroke-width:6.913;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st46{fill:none;stroke:#4294D1;stroke-width:6.4809;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st47{fill:none;stroke:#3DA7D7;stroke-width:6.4809;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st48{fill:none;stroke:#3CC3DB;stroke-width:6.4809;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st49{fill:none;stroke:#4294D1;stroke-width:6.3442;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st50{fill:none;stroke:#3DA7D7;stroke-width:6.3442;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st51{fill:none;stroke:#3CC3DB;stroke-width:6.3442;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
</style><g transform="translate(-149.02 -151.91)" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="20.537"><g stroke="#4294d1"><rect class="st34" transform="matrix(.5004 -.8658 .8658 .5004 -451.22 634.67)" x="254.55" y="638.53" width="139.54" height="139.54"/><polygon class="st34" points="489.37 803.68 559.19 682.87 419.65 682.81 349.83 803.62"/><polygon class="st34" points="298.82 612.99 229.11 492.11 159.28 612.92 229 733.8"/><polygon class="st34" points="229.17 352.58 159.35 473.39 159.28 612.92 229.11 492.11"/></g><g stroke="#4294d1"><rect class="st34" transform="matrix(.5004 -.8658 .8658 .5004 68.953 876.79)" x="724.42" y="308.88" width="139.54" height="139.54"/><polygon class="st34" points="629.14 283.27 559.32 404.08 698.85 404.14 768.67 283.33"/><polygon class="st34" points="819.68 473.97 889.4 594.84 959.22 474.03 889.5 353.16"/><polygon class="st34" points="889.34 734.38 959.16 613.56 959.22 474.03 889.4 594.84"/></g><g stroke="#3da7d7"><rect class="st35" transform="matrix(.8662 -.4996 .4996 .8662 -57.262 301.17)" x="464.08" y="187.76" width="139.54" height="139.54"/><polygon class="st35" points="368.73 352.78 438.44 473.66 508.26 352.84 438.55 231.97"/><polygon class="st35" points="629.15 283.11 768.68 283.17 698.97 162.3 559.43 162.24"/><polygon class="st35" points="438.44 473.66 559.32 403.94 629.14 283.13 508.26 352.84"/><polygon class="st35" points="889.5 352.99 819.78 232.12 698.97 162.3 768.68 283.17"/></g><g stroke="#3da7d7"><rect class="st35" transform="matrix(.8662 -.4996 .4996 .8662 -336.19 403.04)" x="514.88" y="759.65" width="139.54" height="139.54"/><polygon class="st35" points="749.78 734.17 680.06 613.3 610.24 734.11 679.96 854.98"/><polygon class="st35" points="489.36 803.84 349.82 803.78 419.54 924.65 559.07 924.72"/><polygon class="st35" points="680.06 613.3 559.19 683.01 489.37 803.82 610.24 734.11"/><polygon class="st35" points="229.01 733.96 298.72 854.83 419.54 924.65 349.82 803.78"/></g><g stroke="#3cc3db"><polygon class="st36" points="559.32 404.08 680.13 473.9 819.66 473.97 698.85 404.14"/><rect class="st36" x="749.82" y="594.68" width="139.54" height="139.54"/><polygon class="st36" points="819.66 473.82 680.13 473.76 749.84 594.64 889.38 594.7"/><polygon class="st36" points="749.79 734.19 679.97 855 819.5 855.06 889.33 734.25"/><polygon class="st36" points="680.13 473.76 680.06 613.3 749.78 734.17 749.84 594.64"/><polygon class="st36" points="559.09 924.72 698.63 924.78 819.5 855.06 679.97 855"/></g><g stroke="#3cc3db"><polygon class="st36" points="559.19 682.87 438.38 613.05 298.84 612.99 419.65 682.81"/><rect class="st36" x="229.15" y="352.73" width="139.54" height="139.54"/><polygon class="st36" points="298.84 613.13 438.38 613.19 368.66 492.32 229.13 492.26"/><polygon class="st36" points="368.72 352.76 438.54 231.95 299 231.89 229.18 352.7"/><polygon class="st36" points="438.38 613.19 438.44 473.66 368.73 352.78 368.66 492.32"/><polygon class="st36" points="559.41 162.24 419.88 162.18 299 231.89 438.54 231.95"/></g></g></svg>

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

@ -100,6 +100,24 @@ angular.module('netStatsApp.directives', [])
{ {
tElement.replaceWith('<span>' + tAttrs.data + "</span>"); tElement.replaceWith('<span>' + tAttrs.data + "</span>");
// register resize watcher
var timeout;
var width;
$(window).on('resize', function(e) {
if( $('body').width() < 600 )
width = 4;
else if( $('body').width() < 1200 )
width = 5;
else
width = 6;
if(timeout)
clearTimeout(timeout);
timeout = setTimeout(function() {
$.fn.sparkline.defaults.bar.barWidth = width;
}, 200);
});
return function(scope, element, attrs) return function(scope, element, attrs)
{ {
attrs.$observe("data", function (newValue) attrs.$observe("data", function (newValue)
@ -302,6 +320,12 @@ angular.module('netStatsApp.directives', [])
var width = 280 - margin.left - margin.right, var width = 280 - margin.left - margin.right,
height = 63 - margin.top - margin.bottom; height = 63 - margin.top - margin.bottom;
// fix for mobile devices
if( $('body').width() < 600 )
width = 200 - margin.left - margin.right;
else( $('body').width() < 1200 )
width = 240 - margin.left - margin.right;
var TICKS = 40; var TICKS = 40;
var x = d3.scale.linear() var x = d3.scale.linear()
@ -342,10 +366,26 @@ angular.module('netStatsApp.directives', [])
return '<div class="tooltip-arrow"></div><div class="tooltip-inner"><b>' + (d.x/1000) + 's - ' + ((d.x + d.dx)/1000) + 's</b><div class="small">Percent: <b>' + Math.round(d.y * 100) + '%</b>' + '<br>Frequency: <b>' + d.frequency + '</b><br>Cumulative: <b>' + Math.round(d.cumpercent*100) + '%</b></div></div>'; return '<div class="tooltip-arrow"></div><div class="tooltip-inner"><b>' + (d.x/1000) + 's - ' + ((d.x + d.dx)/1000) + 's</b><div class="small">Percent: <b>' + Math.round(d.y * 100) + '%</b>' + '<br>Frequency: <b>' + d.frequency + '</b><br>Cumulative: <b>' + Math.round(d.cumpercent*100) + '%</b></div></div>';
}) })
scope.init = function() scope.init = function(width)
{ {
var data = scope.data; var data = scope.data;
var x = d3.scale.linear()
.domain([0, 10000])
.rangeRound([0, width])
.interpolate(d3.interpolateRound);
var xAxis = d3.svg.axis()
.scale(x)
.orient("bottom")
.ticks(4, ",.1s")
.tickFormat(function(t){ return t/1000 + "s"});
var line = d3.svg.line()
.x(function(d) { return x(d.x + d.dx/2) - 1; })
.y(function(d) { return y(d.y) - 2; })
.interpolate('basis');
// Adjust y axis // Adjust y axis
y.domain([0, d3.max(data, function(d) { return d.y; })]); y.domain([0, d3.max(data, function(d) { return d.y; })]);
@ -414,9 +454,24 @@ angular.module('netStatsApp.directives', [])
scope.$watch('data', function() { scope.$watch('data', function() {
if(scope.data.length > 0) { if(scope.data.length > 0) {
scope.init(); scope.init(width);
} }
}, true); }, true);
var timeout;
$(window).on('resize', function(e) {
var width = 280 - margin.left - margin.right;
if( $('body').width() < 768 )
width = 200 - margin.left - margin.right;
if(timeout)
clearTimeout(timeout);
timeout = setTimeout(function() {
// redraw
scope.init(width);
}, 200);
});
} }
}; };
}]); }]);

View File

@ -59,35 +59,17 @@ angular.module('netStatsApp.filters', [])
}) })
.filter('hashrateFilter', ['$sce', '$filter', function($sce, filter) { .filter('hashrateFilter', ['$sce', '$filter', function($sce, filter) {
return function(hashes, isMining) { return function(hashes, isMining) {
var result = 0;
var unit = 'K';
if( !isMining ) if( !isMining )
return $sce.trustAsHtml('<i class="icon-cancel"></i>'); return $sce.trustAsHtml('<i class="icon-cancel"></i>');
if(hashes !== 0 && hashes < 1000) { var result = hashes;
result = hashes; var units = ['', 'K', 'M', 'G', 'T', 'P', 'E'];
unit = ''; var unit = 'K';
}
if(hashes >= 1000 && hashes < Math.pow(1000, 2)) { for(var i = 1; result > 1000; i++)
result = hashes / 1000; {
unit = 'K'; result /= 1000;
} unit = units[i];
if(hashes >= Math.pow(1000, 2) && hashes < Math.pow(1000, 3)) {
result = hashes / Math.pow(1000, 2);
unit = 'M';
}
if(hashes >= Math.pow(1000, 3) && hashes < Math.pow(1000, 4)) {
result = hashes / Math.pow(1000, 3);
unit = 'G';
}
if(hashes >= Math.pow(1000, 4) && hashes < Math.pow(1000, 5)) {
result = hashes / Math.pow(1000, 4);
unit = 'T';
} }
return $sce.trustAsHtml('<span class="small">' + filter('number')(result.toFixed(1)) + ' <span class="small-hash">' + unit + 'H/s</span></span>'); return $sce.trustAsHtml('<span class="small">' + filter('number')(result.toFixed(1)) + ' <span class="small-hash">' + unit + 'H/s</span></span>');
@ -95,32 +77,14 @@ angular.module('netStatsApp.filters', [])
}]) }])
.filter('totalDifficultyFilter', function() { .filter('totalDifficultyFilter', function() {
return function(hashes) { return function(hashes) {
var result = 0; var result = hashes;
var units = ['', 'K', 'M', 'G', 'T', 'P', 'E'];
var unit = ''; var unit = '';
if(hashes !== 0 && hashes < 1000) { for(var i = 1; result > 1000; i++)
result = hashes; {
unit = ''; result /= 1000;
} unit = units[i];
if(hashes >= 1000 && hashes < Math.pow(1000, 2)) {
result = hashes / 1000;
unit = 'K';
}
if(hashes >= Math.pow(1000, 2) && hashes < Math.pow(1000, 3)) {
result = hashes / Math.pow(1000, 2);
unit = 'M';
}
if(hashes >= Math.pow(1000, 3) && hashes < Math.pow(1000, 4)) {
result = hashes / Math.pow(1000, 3);
unit = 'G';
}
if(hashes >= Math.pow(1000, 4) && hashes < Math.pow(1000, 5)) {
result = hashes / Math.pow(1000, 4);
unit = 'T';
} }
return result.toFixed(2) + ' ' + unit + 'H'; return result.toFixed(2) + ' ' + unit + 'H';
@ -327,32 +291,14 @@ angular.module('netStatsApp.filters', [])
if(hashes === null) if(hashes === null)
hashes = 0; hashes = 0;
var result = 0; var result = hashes;
var units = ['', 'K', 'M', 'G', 'T', 'P'];
var unit = 'K'; var unit = 'K';
if(hashes !== 0 && hashes < 1000) { for(var i = 1; result > 1000; i++)
result = hashes; {
unit = ''; result /= 1000;
} unit = units[i];
if(hashes >= 1000 && hashes < Math.pow(1000, 2)) {
result = hashes / 1000;
unit = 'K';
}
if(hashes >= Math.pow(1000, 2) && hashes < Math.pow(1000, 3)) {
result = hashes / Math.pow(1000, 2);
unit = 'M';
}
if(hashes >= Math.pow(1000, 3) && hashes < Math.pow(1000, 4)) {
result = hashes / Math.pow(1000, 3);
unit = 'G';
}
if(hashes >= Math.pow(1000, 4) && hashes < Math.pow(1000, 5)) {
result = hashes / Math.pow(1000, 4);
unit = 'T';
} }
if( !isMining ) if( !isMining )

View File

@ -7,6 +7,11 @@
$.fn.sparkline.defaults.bar.height = 63; $.fn.sparkline.defaults.bar.height = 63;
$.fn.sparkline.defaults.bar.barWidth = 6; $.fn.sparkline.defaults.bar.barWidth = 6;
if( $('body').width() < 600 )
$.fn.sparkline.defaults.bar.barWidth = 4;
else if( $('body').width() < 1200 )
$.fn.sparkline.defaults.bar.barWidth = 5;
$.fn.sparkline.defaults.bar.barSpacing = 1; $.fn.sparkline.defaults.bar.barSpacing = 1;
$.fn.sparkline.defaults.bar.tooltipClassname = 'jqstooltip'; $.fn.sparkline.defaults.bar.tooltipClassname = 'jqstooltip';
$.fn.sparkline.defaults.bar.tooltipOffsetX = 0; $.fn.sparkline.defaults.bar.tooltipOffsetX = 0;
@ -26,12 +31,3 @@
moment.relativeTimeThreshold('M', 12); moment.relativeTimeThreshold('M', 12);
})(); })();
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
// ga('create', 'UA-68390837-2', 'auto');
ga('create', 'UA-80834434-1', 'auto');
ga('send', 'pageview');

3
src/robots.txt Normal file
View File

@ -0,0 +1,3 @@
# http://www.robotstxt.org
User-agent: *
Disallow:

View File

@ -3,11 +3,18 @@ doctype html
html(ng-app="netStatsApp") html(ng-app="netStatsApp")
head head
meta(name="viewport", content="width=device-width, initial-scale=1.0, maximum-scale=1.0") meta(name="viewport", content="width=device-width, initial-scale=1.0, maximum-scale=1.0")
title Ethereum Network Status title MIX Network Stats
style(type="text/css") [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak { display: none !important; } style(type="text/css") [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak { display: none !important; }
link(rel='stylesheet', href='//fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700')
link(rel='stylesheet', href='/css/netstats.min.css') link(rel='stylesheet', href='/css/netstats.min.css')
link(rel='shortcut icon', href='/mix-logo-thick.svg', sizes='any' type='image/svg+xml')
link(rel='shortcut icon', href='/mix-logo-thick-1024.png', sizes='1024x1024' type='image/png')
link(rel='shortcut icon', href='/mix-logo-thick-512.png', sizes='512x512' type='image/png')
link(rel='shortcut icon', href='/mix-logo-thick-256.png', sizes='256x256' type='image/png')
link(rel='shortcut icon', href='/mix-logo-thick-128.png', sizes='128x128' type='image/png')
link(rel='shortcut icon', href='/mix-logo-thick-64.png', sizes='64x64' type='image/png')
meta(name='robots', content='index,follow')
meta(name='googlebot', content='index,follow')
body body
block content block content
script(src="/js/netstats.min.js") script(src="/js/netstats.min.js")