Repository navigation
Expand file tree
/
Copy pathadmin.html
More file actions
164 lines (135 loc) · 4.27 KB
/
Copy pathadmin.html
File metadata and controls
164 lines (135 loc) · 4.27 KB
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
<title>Arqma with PLE or XCY or TRTL Mining Pool - Admin Panel</title>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-timeago/1.6.3/jquery.timeago.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mustache.js/3.0.1/mustache.min.js"></script>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
</head>
<body>
<div id="wrapper">
<!-- Navigation -->
<div class="nav-side-menu">
<div class="brand"><a href="/">Admin Panel</a></div>
<i class="fa fa-bars fa-2x toggle-btn" data-toggle="collapse" data-target="#menu-content"></i>
<div class="menu-list">
<ul id="menu-content" class="menu-content collapsed out">
<li><a class="hot_link" data-page="admin/statistics.html" href="#">
<i class="fa fa-bar-chart-o"></i> Statistics
</a></li>
<li><a class="hot_link" data-page="admin/monitoring.html" href="#monitoring">
<i class="fa fa-eye"></i> Monitoring
</a></li>
<li><a class="hot_link" data-page="admin/userslist.html" href="#users_list">
<i class="fa fa-users"></i> Users List
</a></li>
<li><a class="hot_link" data-page="admin/ports.html" href="#ports">
<i class="fa fa-link"></i> Ports Usage
</a></li>
<li><a class="hot_link" data-page="admin/tools.html" href="#tools">
<i class="fa fa-gears"></i> Tools
</a></li>
<li class="sign-out"><a class="hot_link" href="/">
<i class="fa fa-sign-out"></i> Return to Pool
</a></li>
</ul>
</div>
</div>
<!-- Page content -->
<div id="page-wrapper">
<div id="page"></div>
<p id="loading" class="text-center"><i class="fa fa-circle-o-notch fa-spin"></i></p>
</div>
</div>
<!-- Footer -->
<footer>
<div class="text-muted">
Powered by <a target="_blank" href="https://github.com/dvandal/cryptonote-nodejs-pool"><i class="fa fa-github"></i> cryptonote-nodejs-pool</a>
<span id="poolVersion"></span>
<span class="hidden-xs">open sourced under the <a href="http://www.gnu.org/licenses/gpl-2.0.html">GPL</a></span>
</div>
</footer>
<!-- Javascript -->
<script src="config.js"></script>
<script src="js/common.js"></script>
<script>
// Fetch pool statistics
lastStats = {};
mergedStats = {};
let mergedApis = {};
$(function () {
let merged_apis = $.ajax({
url: `${api}/get_apis`,
dataType: 'json',
cache: 'false'
})
let poolStats = $.ajax({
url: `${api}/stats`,
dataType: 'json',
cache: 'false'
})
Promise.all([poolStats, merged_apis])
.then(values => {
lastStats = values[0]
mergedApis = values[1]
let subs = [];
Object.keys(mergedApis)
.some(key => {
let apiUrl = `${mergedApis[key].api}/stats`
subs.push($.ajax({
url: apiUrl,
dataType: 'json',
cache: 'false'
}))
})
Promise.all(subs)
.then(data => {
data.forEach(item => {
mergedStats[item.config.coin] = item
})
$('#poolVersion')
.html(lastStats.config.version);
routePage();
})
})
});
function fetchLiveStats () {
$.ajax({
url: api + '/live_stats',
dataType: 'json',
cache: 'false'
})
.done(function (data) {
if (currentPage.update) {
currentPage.update();
}
})
.always(function () {
fetchLiveStats();
});
}
function renderTemplate (usersData, templateId, view) {
let source = $(templateId)
.html()
Mustache.parse(source)
let rendered = Mustache.render(source, usersData)
$(view)
.append(rendered)
}
// Initialize
$(function () {
$("head")
.append("<link rel='stylesheet' href=" + themeCss + ">");
$("head")
.append("<link rel='stylesheet' href=themes/admin.css>");
$("head")
.append("<link rel='stylesheet' href=themes/custom.css>");
});
</script>
</body>
</html>