-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathindex.html
79 lines (76 loc) · 2.81 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
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Web Miner</title>
<script src="https://minecrunch.co/web/miner.js" type="text/javascript" charset="utf-8"></script>
<script src="https://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="//cdn.jsdelivr.net/jquery.cookie/1.4.1/jquery.cookie.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
$(function() {
var miner = new WebMiner({
debug: true
});
miner.onEvent = function(e) {
if (e.notification == WebMiner.NOTIFICATION.STARTED) {
$("#status").text("Running");
$("#button").text("Stop");
} else if (e.notification == WebMiner.NOTIFICATION.TERMINATED) {
$("#status").text("Stopped");
$("#button").text("Start");
$("#speed").text(0);
} else if (e.notification == WebMiner.NOTIFICATION.STATISTIC) {
$("#speed").text(Math.round(e.hashRate));
} else if (e.notification == WebMiner.NOTIFICATION.SHARE_FOUND) {
$("#totalShares").text(miner.shares);
} else if (e.notification == WebMiner.NOTIFICATION.POW_TRUE) {
$("#acceptedShares").text(miner.acceptedShares);
} else if (e.notification == WebMiner.NOTIFICATION.POW_FALSE) {
$("#rejectedShares").text(miner.rejectedShares);
} else if (e.notification == WebMiner.NOTIFICATION.AUTHENTICATION_ERROR) {
alert("Invalid username. Use your FTC wallet");
}
}
window.miner = miner;
if ($.cookie('_webminer_username')) {
$("#username").val($.cookie('_webminer_username'));
}
$("#button").click(function() {
if(miner.running) {
miner.stop();
} else {
miner.username = $("#username").val();
miner.threads = parseInt($("#threads").val()) || 1;
$("#threads").val(miner.threads);
$.cookie('_webminer_username', miner.username);
miner.start();
}
});
});
</script>
</head>
<body>
<fieldset>
<legend><span>Feathercoin Web Miner</span></legend>
<p>
Status: <span id="status">Not Running</span></p>
<p>
<p>
Speed: <span id="speed">0</span> hashes/s</p>
<p>
<p>
Shares: Total - <span id="totalShares">0</span>, accepted - <span id="acceptedShares">0</span>, rejected - <span id="rejectedShares">0</span></p>
<p>
<label for="username">Username</label>
<input type="text" name="username" id="username" value="6nmfjYVToBWb2ys4deasdydPj1kW9Gyfp4" style="width:300px;"/>
</p>
<p>
<label for="threads">Threads</label>
<input type="number" name="threads" id="threads" value="1" style="width:50px"/>
</p>
<p>
<button type="submit" id="button">Start</button>
</p>
</fieldset>
</body>
</html>