forked from laizy/ontology-old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.go
111 lines (102 loc) · 3.68 KB
/
template.go
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
/*
* Copyright (C) 2018 The ontology Authors
* This file is part of The ontology library.
*
* The ontology is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The ontology is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with The ontology. If not, see <http://www.gnu.org/licenses/>.
*/
package nodeinfo
const TEMPLATE_PAGE = `
<html>
<head>
<meta http-equiv="refresh" content="3">
<title>Node Information</title>
<style type="text/css">
a:link {color: #FCFCFC}
a:visited {color: #FCFCFC}
a:hover {color: #FCFCFC}
a:active {color: #FCFCFC}
body {background:#212124; color:#F8F8FF; font-size:20px;}
td.bh {color: #00FF00}
td.pk {word-break: break-all; overflow: hidden}
table.bd {border: 1px solid #111111; font-size:20px;}
table.bt {border: 1px solid #111111; font-size:25px;}
table.font {font-size:20px;}
a.site {cursor:hand; text-decoration:none;}
</style>
</head>
<body>
<center>
<br><br><br>
<table class="bt" width="80%">
<tr><th>Node Information</th></tr>
</table>
<br>
<table class="bd" width="80%">
<tr>
<td width="20%" >
<table class="font" width="100%">
<tr><th>BlockHeight</th></tr>
<tr><td align="center"><b><font size="40px">{{.BlockHeight}}</font></b></td></tr>
</table>
</td>
<td width="80%">
<table class="font" width="100%">
<tr><td colspan="1" width="25%">Node Version:</td><td width="25%">{{.NodeVersion}}</td><td width="25%">NodeID:</td><td width="25%">{{.NodeId}}</td></tr>
<tr><td width="25%">NodeType:</td><td width="25%">{{.NodeType}}</td><td width="25%">NodePort:</td><td width="25%">{{.NodePort}}</td></tr>
<tr><td width="25%">HttpRestPort:</td><td width="25%">{{.HttpRestPort}}</td><td width="25%">HttpWsPort:</td><td width="25%">{{.HttpWsPort}}</td></tr>
<tr><td width="25%">HttpJsonPort:</td><td width="25%">{{.HttpJsonPort}}</td><td width="25%">HttpLocalPort:</td><td width="25%">{{.HttpLocalPort}}</td></tr>
</table>
</td>
</tr>
</table>
<br><br><br><br>
<table class="bt" width="80%">
<tr><th>Neighbors Information</th></tr>
</table>
<br>
<table class="bd" width="80%">
<tr>
<td width="20%" >
<table class="font" width="100%">
<tr><th>Neighbor Count</th></tr>
<tr><td align="center"><b><font size="40px">{{.NeighborCnt}}</font></b></td></tr>
</table>
</td>
<td width="80%">
<table class="font" width="100%">
<tr><th>Neighbor IP</th><th>Neighbor Id</th><th>Neighbor Type</th></tr>
{{range .Neighbors}}
{{if .HttpInfoStart}}
<tr><td align="center">{{.NgbAddr}}</td><td align="center"><a href="http://{{.HttpInfoAddr}}/info" style="cursor:hand">{{.NgbId}}</a></td><td align="center">{{.NgbType}}</td></tr>
{{else}}
<tr><td align="center">{{.NgbAddr}}</td><td align="center">{{.NgbId}}</td><td align="center">{{.NgbType}}</td></tr>
{{end}}
{{end}}
</table>
</td>
</tr>
</table>
<br><br><br><br><br><br>
<table class="font" border="0" width="80%">
<tr>
<td width="26%" align="left"><a href="https://forum.dnaproject.org" class="site">forum : https://forum.dnaproject.org</a><br></td>
<td width="26%" align="center"><a href="https://www.dnaproject.org" class="site">site : https://www.dnaproject.org</a></td>
<td width="28%" align="right"><a href="https://wiki.dnaproject.org/docs/dnaproject" class="site">doc : https://wiki.dnaproject.org</a></td>
</tr>
</table>
<br><br><br><br>
</center>
</body>
</html>
`