Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miner link #11

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions css/miningcore.css
Original file line number Diff line number Diff line change
Expand Up @@ -1005,12 +1005,13 @@ div.card-chart {
*/
#pool-coins td:nth-of-type(1):before { content: "Pool coin"; }
#pool-coins td:nth-of-type(2):before { content: "Algorithm"; }
#pool-coins td:nth-of-type(3):before { content: "Miners"; }
#pool-coins td:nth-of-type(4):before { content: "Pool Hashrate"; }
#pool-coins td:nth-of-type(5):before { content: "Fee"; }
#pool-coins td:nth-of-type(6):before { content: "Network Hashrate"; }
#pool-coins td:nth-of-type(7):before { content: "Network Difficulty"; }
#pool-coins td:nth-of-type(8):before { content: ""; }
#pool-coins td:nth-of-type(3):before { content: "Scheme"; }
#pool-coins td:nth-of-type(4):before { content: "Miners"; }
#pool-coins td:nth-of-type(5):before { content: "Pool Hashrate"; }
#pool-coins td:nth-of-type(6):before { content: "Fee"; }
#pool-coins td:nth-of-type(7):before { content: "Network Hashrate"; }
#pool-coins td:nth-of-type(8):before { content: "Network Difficulty"; }
#pool-coins td:nth-of-type(9):before { content: ""; }

.sidebar-open .main-sidebar {
-webkit-transform:translate(0, 0);
Expand Down
Binary file added img/coin/icon/erg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 9 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ <h5 class="card-header bg-green"><i class="fas fa-coins"></i> Pool Coins</h5>
<tr class="border-0">
<th class="coin border-0">Pool coin</th>
<th class="algo border-0">Algorithm</th>
<th class="paytype border-0">Payout Type</th>
<th class="miniers border-0">Miners</th>
<th class="pool-hash border-0">Pool Hashrate</th>
<th class="fee border-0">Fee</th>
Expand Down Expand Up @@ -586,13 +587,14 @@ <h3 class="card-title "><p><i class="fas fa-cubes"></i> Blocks Mined</p></h3>
<thead class=" text-primary">

<tr class="blocks">
<th>Found</th>
<th>Height</th>
<th>Effort</th>
<th>Status</th>
<th>Reward</th>
<th>Confirmation</th>
</tr>
<th>When</th>
<th>Found by</th>
<th>Height</th>
<th>Effort</th>
<th>Status</th>
<th>Reward</th>
<th>Confirmation</th>
</tr>

</thead>
<tbody id="blockList"></tbody>
Expand Down
80 changes: 37 additions & 43 deletions js/miningcore.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,14 @@



// read WebURL from current browser
var WebURL = window.location.protocol + "//" + window.location.hostname + "/"; // Website URL is: https://domain.com/
// WebURL correction if not ends with /
if (WebURL.substring(WebURL.length-1) != "/")
{
WebURL = WebURL + "/";
console.log('Corrected WebURL, does not end with / -> New WebURL : ', WebURL);
}
var API = WebURL + "api/"; // API address is: https://domain.com/api/
var API = "https://miningcore-api.mattsnoby.com/api/";
// API correction if not ends with /
if (API.substring(API.length-1) != "/")
{
API = API + "/";
console.log('Corrected API, does not end with / -> New API : ', API);
}
var stratumAddress = window.location.hostname; // Stratum address is: domain.com
var stratumAddress = "ergo.mattsnoby.com:3056";



Expand All @@ -49,7 +41,6 @@ var stratumAddress = window.location.hostname; // Stratum address
// --------------------------------------------------------------------------------------------
// no need to change anything below here
// --------------------------------------------------------------------------------------------
console.log('MiningCore.WebUI : ', WebURL); // Returns website URL
console.log('API address used : ', API); // Returns API URL
console.log('Stratum address : ', "stratum+tcp://" + stratumAddress + ":"); // Returns Stratum URL
console.log('Page Load : ', window.location.href); // Returns full URL
Expand Down Expand Up @@ -172,6 +163,7 @@ function loadHomePage() {
poolCoinTableTemplate += "<tr class='coin-table-row' href='#" + value.id + "'>";
poolCoinTableTemplate += "<td class='coin'><a href='#" + value.id + "'<span>" + coinLogo + coinName + " (" + value.coin.type.toUpperCase() + ") </span></a></td>";
poolCoinTableTemplate += "<td class='algo'>" + value.coin.algorithm + "</td>";
poolCoinTableTemplate += "<td class='paytype'>" + value.paymentProcessing.payoutScheme + "</td>";
poolCoinTableTemplate += "<td class='miners'>" + value.poolStats.connectedMiners + "</td>";
poolCoinTableTemplate += "<td class='pool-hash'>" + _formatter(value.poolStats.poolHashrate, 5, "H/s") + "</td>";
poolCoinTableTemplate += "<td class='fee'>" + value.poolFeePercent + " %</td>";
Expand Down Expand Up @@ -261,39 +253,38 @@ function loadDashboardPage() {
}
}


// Load MINERS page content
function loadMinersPage() {
return $.ajax(API + "pools/" + currentPool + "/miners?page=0&pagesize=20")
.done(function(data) {
var minerList = "";
if (data.length > 0) {
$.each(data, function(index, value) {
minerList += "<tr>";
//minerList += "<td>" + value.miner + "</td>";
minerList += '<td>' + value.miner.substring(0, 12) + ' &hellip; ' + value.miner.substring(value.miner.length - 12) + '</td>';
//minerList += '<td><a href="' + value.minerAddressInfoLink + '" target="_blank">' + value.miner.substring(0, 12) + ' &hellip; ' + value.miner.substring(value.miner.length - 12) + '</td>';
minerList += "<td>" + _formatter(value.hashrate, 5, "H/s") + "</td>";
minerList += "<td>" + _formatter(value.sharesPerSecond, 5, "S/s") + "</td>";
minerList += "</tr>";
});
} else {
minerList += '<tr><td colspan="4">No miner connected</td></tr>';
}
$("#minerList").html(minerList);
})
.fail(function() {
$.notify(
{
message: "Error: No response from API.<br>(loadMinersList)"
},
{
type: "danger",
timer: 3000
}
);
});
}
return $.ajax(API + "pools/" + currentPool + "/miners?page=0&pagesize=20")
.done(function(data) {
var minerList = "";
if (data.length > 0) {
$.each(data, function(index, value) {
var url = "?#" + currentPool + "/dashboard?address=" + value.miner;
console.log(url)
minerList += "<tr>";
minerList += "<td>" + "<a href=" +url + ">" + value.miner +"</a>" + "</td>";
minerList += "<td>" + _formatter(value.hashrate, 5, "H/s") + "</td>";
minerList += "<td>" + _formatter(value.sharesPerSecond, 5, "S/s") + "</td>";
minerList += "</tr>";
});
} else {
minerList += '<tr><td colspan="4">No miner connected</td></tr>';
}
$("#minerList").html(minerList);
})
.fail(function() {
$.notify(
{
message: "Error: No response from API.<br>(loadMinersList)"
},
{
type: "danger",
timer: 3000
}
);
});
}


// Load BLOCKS page content
Expand All @@ -304,7 +295,7 @@ function loadBlocksPage() {
if (data.length > 0) {
$.each(data, function(index, value) {
var createDate = convertLocalDateToUTCDate(new Date(value.created),false);
var effort = Math.round(value.effort * 100);
var effort = Math.round(value.effort * 10000);
var effortClass = "";
if (effort < 30) {
effortClass = "effort1";
Expand All @@ -316,8 +307,11 @@ function loadBlocksPage() {
effortClass = "effort4";
}

var url = "?#" + currentPool + "/dashboard?address=" + value.miner;

blockList += "<tr>";
blockList += "<td>" + createDate + "</td>";
blockList += "<td><a href=" +url +">" + value.miner.substring(value.miner.length -12) +"</a>" + "</td>";
blockList += "<td><a href='" + value.infoLink + "' target='_blank'>" + value.blockHeight + "</a></td>";
if (typeof value.effort !== "undefined") {
blockList += "<td class='" + effortClass + "'>" + effort + "%</td>";
Expand Down
6 changes: 6 additions & 0 deletions poolconfig/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ <h4>crypto mining software</h4>
</p>
<p>Where:</p>
<ul>
<li>For PPLNS Pool : no ssl 'ergo.mattsnoby.com' </li>
<li> 'low' difficulty connect to Port 9053 </li>
<li> 'high' difficulty connect to Port 9054 </li>
<li>For Solo Pool : no ssl 'ergo.mattsnoby.com' </li>
<li> 'low' difficulty connect to Port 9055 </li>
<li> 'high' difficulty connect to Port 9056 </li>
<li>POOL STRATUM ADDRESS AND PORT - one off the stratum addresses above in the Pool Configuration section depending on the difficuty you want</li>
<li>YOUR_WALLET_ADDRESS - your valid {{ coinName }} wallet address</li>
<li>WORKERNAME - an optional workername can be used to identify the miner or RIG</li>
Expand Down