forked from rdewilde-ion/ion-monitor-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
136 lines (134 loc) · 4.33 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!DOCTYPE html>
<!--[if lt IE 7]> <html lang="en" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html lang="en" class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html lang="en" class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>ION stats</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/materialize.min.css" rel="stylesheet">
<script src="js/jquery.min.js"></script>
<script src="js/materialize.min.js"></script>
<style type="text/css">
.valign-wrapper{
min-height: 100vh;
}
/* fallback */
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: local('Material Icons'), local('MaterialIcons-Regular'), url(fonts/2fcrYFNaTjcS6g4U3t-Y5ZjZjT5FdEJ140U2DJYC3mY.woff2) format('woff2');
}
.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
-webkit-font-feature-settings: 'liga';
-webkit-font-smoothing: antialiased;
}
h4 {
padding: 10px 0;
background: rgb(2,40,68);
background: -moz-linear-gradient(left, rgba(2,40,68,1) 0%, rgba(4,100,166,1) 100%);
background: -webkit-linear-gradient(left, rgba(2,40,68,1) 0%,rgba(4,100,166,1) 100%);
background: linear-gradient(to right, rgba(2,40,68,1) 0%,rgba(4,100,166,1) 100%);
border-radius: 5px;
}
</style>
<script src="js/firebase.js"></script>
<script src="js/highcharts.js"></script>
<script src="js/exporting.js"></script>
<script>
// Initialize Firebase
var config = {
apiKey: "Your apikey",
authDomain: "Your authDomain",
databaseURL: "Your databaseURL",
storageBucket: "Your storageBucket",
messagingSenderId: "Your messagingSenderId"
};
firebase.initializeApp(config);
var db = firebase.database();
var ref = db.ref();
var masternodesRef = ref.child("masternodes");
masternodesRef.limitToLast(20).on("child_added", function(data) {
var dataVal = data.val();
$("#count").html(dataVal.count);
$('#masternodecount').highcharts().series[0].addPoint({
x: new Date(dataVal.moment),
y: dataVal.count
}, false);
$('#masternodecount').highcharts().redraw();
});
</script>
</head>
<body>
<div class="row valign-wrapper">
<div class="container valign center">
<div class="col s12 m8 l6 offset-m2 offset-l3 darken-1 white-text">
<h4>Masternodes online</h4>
<h5 class="black-text" id="count">Loading...</h5>
</div>
<div class="col s12 m8 l6 offset-m2 offset-l3 darken-1 white-text">
<h4>Graph</h4>
<div class="col-sm-4 text-center">
<div id="masternodecount" style="width: 100%; height: 300px;"></div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
Highcharts.setOptions({
global: {
useUTC: false
}
});
// set up highcharts
$('#masternodecount').highcharts({
chart: {
type: 'spline'
},
title: {
text: ''
},
xAxis: {
type: 'datetime'
},
yAxis: {
labels: {
format: '{value}'
},
title: {
text: 'Count'
}
},
legend: {
enabled: false
},
exporting: {
enabled: false
},
series: [{
name: 'Count',
color: '#0464a6',
yAxis: 0
}]
});
});
</script>
</body>
</html>