mirror of
https://github.com/seigler/dash-website
synced 2025-07-27 07:16:10 +00:00
- Removed the duplicate hero files that were located in the _i18n directory and moved them into the _includes. - Changed the hero image to a variable. - New hero images.
160 lines
No EOL
3.7 KiB
HTML
160 lines
No EOL
3.7 KiB
HTML
---
|
|
layout: default
|
|
title: pages.currency.title
|
|
description: pages.currency.description
|
|
---
|
|
|
|
{% include hero/currency.html %}
|
|
|
|
<div class="content">
|
|
|
|
<h2>{% t pages.currency.markets-heading %}</h2>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Exchange</th>
|
|
<th>Volume (24h)</th>
|
|
<th>Price</th>
|
|
<th>Volume (%)</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="exchanges">
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
<h2>{% t pages.currency.governance-heading %}</h2>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Title</th>
|
|
<th>Owner</th>
|
|
<th>Votes (yes/no)</th>
|
|
<th>Votes Required</th>
|
|
<th>Monthly Amount</th>
|
|
<th>Will be Funded</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="budgets">
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
<h2>{% t pages.currency.network-heading %}</h2>
|
|
|
|
<div id="masternodes_count"></div>
|
|
<div id="masternodes_max"></div>
|
|
|
|
<h2>{% t pages.currency.blockchain-heading %}</h2>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Height</th>
|
|
<th>Age</th>
|
|
<th>Transactions</th>
|
|
<th>Value Out</th>
|
|
<th>Difficulty</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="blocks">
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
window.onload = function () {
|
|
$( document ).ready(function(){
|
|
|
|
// Get the exchange data
|
|
$.ajax({
|
|
url: "{{ site.api }}/exchange/",
|
|
error: function(jqXHR, textStatus, errorThrown) {
|
|
console.log(jqXHR);
|
|
console.log(textStatus);
|
|
console.log('errorThrown:');
|
|
}
|
|
})
|
|
.done(function(response){
|
|
var exchanges = response;
|
|
|
|
exchanges.map(function(exchange){
|
|
if(exchange){
|
|
console.log('exchange',exchange);
|
|
var name = exchange.exchange,
|
|
url = exchange.url
|
|
volume = "$" + formatCurrency(exchange.volume,0),
|
|
price = "$" + formatCurrency(exchange.price),
|
|
change = formatNumber(exchange.percent_change);
|
|
|
|
|
|
$("#exchanges").append('<tr><td><a target="_blank" href="' + url + '">' + name + '</a></td><td>' + volume + '</td><td>' + price + '</td><td>' + change + '%</td></tr>');
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
// Get the current number of masternodes.
|
|
$.ajax({
|
|
url: "{{ site.api }}/masternodes/stats/"
|
|
})
|
|
.done(function(response){
|
|
console.log('masternode stats', response.stats);
|
|
var masternodes_count = formatNumber(response.stats['count']),
|
|
masternodes_max = formatNumber(response.stats['max']);
|
|
|
|
$("#masternodes_count").text(masternodes_count);
|
|
$("#masternodes_max").text(masternodes_max);
|
|
});
|
|
|
|
|
|
// Get the budget proposals
|
|
$.ajax({
|
|
url: "{{ site.api }}/budgets/"
|
|
})
|
|
.done(function(response){
|
|
var proposals = response.proposals;
|
|
|
|
proposals.map(function(proposal){
|
|
var title = proposal.title ? proposal.title : proposal.name,
|
|
url = proposal.dw_url,
|
|
owner = proposal.owner_username,
|
|
votes_yes = proposal.yes,
|
|
votes_no = proposal.no,
|
|
required_votes = proposal.remaining_yes_votes_until_funding,
|
|
amount_monthly = formatCurrency(proposal.monthly_amount)
|
|
will_be_funded = proposal.will_be_funded ? "yes" : "no";
|
|
|
|
|
|
|
|
$("#budgets").append('<tr><td>' + title + '</td><td>' + owner + '</td><td>' + votes_yes + '/' + votes_no + '</td><td>' + required_votes + '</td><td>' + amount_monthly + '</td><td>' + will_be_funded + '</td></tr>');
|
|
|
|
});
|
|
});
|
|
|
|
|
|
// Get the blockchain info
|
|
$.ajax({
|
|
url: "{{ site.api }}/chain/latestBlocks/"
|
|
})
|
|
.done(function(response){
|
|
var blocks = response.blocks;
|
|
|
|
blocks.map(function(block){
|
|
var height = block.height,
|
|
age = moment.unix(block.time).format("LLL"),
|
|
txs = block.txlength,
|
|
out = block.cbvalue,
|
|
difficulty = block.difficulty;
|
|
|
|
$("#blocks").append('<tr><td>' + height + '</td><td>' + age + '</td><td>' + txs + '</td><td>' + out + '</td><td>' + difficulty + '</td></tr>');
|
|
});
|
|
});
|
|
|
|
});
|
|
}
|
|
</script> |