Skip to content

Commit

Permalink
Adjust rewards appearance/styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Liquid369 committed Apr 17, 2023
1 parent 9b62d48 commit 698a553
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
20 changes: 8 additions & 12 deletions index.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -983,18 +983,14 @@ <h4 class="stake-balances" style="background-color: #2c0044; border-radius: 10px
<h2 id="mnLastPaid" class="stake-balances" style="overflow-wrap: anywhere; top: 50%; left: 50%; transform: translate(-50%, -50%); position: absolute; width: 100%; padding: 10px; font-size: xx-large;" id="mnStatus"></h2>
</div>
<!-- // MASTERNODE REWARD LIST -->
<div class="staking-banner-bottom">
<div class="stake-box large-box col-md-4">
<div id="masternode-rewards-title" class="staking-rewards-header">
<h5><span data-i18n="masternode">Masternode</span> <span data-i18n="rewards">Rewards</span></h5>
</div>
<div class="masternode-rewards-list">
<div id="masternode-rewards-content"></div>
<button type="button" id="stakingLoadMore" onclick="MPW.updateMasternodeRewardsGUI()">
<span class="buttoni-icon" id="stakingLoadMoreIcon"><i class="fas fa-sync fa-tiny-margin"></i></span>
<span class="buttoni-text" data-i18n="stakingLoadMore">Load more</span>
</button>
</div>
<div class="stake-box large-box col-md-4">
<h4 class="stake-balances" style="background-color: #2c0044; border-radius: 10px;"><span data-i18n="masternode">Masternode</span> <span data-i18n="rewards">Rewards</span></h4>
<div class="masternode-rewards-list">
<div id="masternode-rewards-content"></div>
<button type="button" id="stakingLoadMore" onclick="MPW.updateMasternodeRewardsGUI()">
<span class="buttoni-icon" id="stakingLoadMoreIcon"><i class="fas fa-sync fa-tiny-margin"></i></span>
<span class="buttoni-text" data-i18n="stakingLoadMore">Load more</span>
</button>
</div>
</div>
</div>
Expand Down
8 changes: 8 additions & 0 deletions scripts/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export function start() {
domMnNetType: document.getElementById('mnNetType'),
domMnNetIP: document.getElementById('mnNetIP'),
domMnLastSeen: document.getElementById('mnLastSeen'),
domMnLastPaid: document.getElementById('mnLastPaid'),

domAccessWallet: document.getElementById('accessWallet'),
domImportWallet: document.getElementById('importWallet'),
Expand Down Expand Up @@ -1568,6 +1569,7 @@ export async function updateMasternodeTab() {

async function refreshMasternodeData(cMasternode, fAlert = false) {
const cMasternodeData = await cMasternode.getFullData();
const cMasternodeReward = await cMasternode.getNextMasternodePaymentInMinutes();
if (debug) console.log(cMasternodeData);

// If we have MN data available, update the dashboard
Expand All @@ -1584,6 +1586,12 @@ async function refreshMasternodeData(cMasternode, fAlert = false) {
doms.domMnLastSeen.innerText = new Date(
cMasternodeData.lastseen * 1000
).toLocaleTimeString();

if (cMasternodeReward != 0 && cMasternodeReward > 30) {
doms.domMnLastPaid.innerText = "~" + cMasternodeReward + " blocks";
} else {
doms.domMnLastPaid.innerText = "Coming soon";
}
}

if (cMasternodeData.status === 'MISSING') {
Expand Down

0 comments on commit 698a553

Please sign in to comment.