From 2110e2e1f490bb2c492eba87ff52d330482ca3b8 Mon Sep 17 00:00:00 2001 From: gonefishing4422 <119458070+gonefishing4422@users.noreply.github.com> Date: Thu, 4 Jan 2024 17:58:27 -0600 Subject: [PATCH] add content --- js/getblockmns.js | 48 ++++ masternodes.html | 701 ++++++++++++++++++++++------------------------ 2 files changed, 378 insertions(+), 371 deletions(-) diff --git a/js/getblockmns.js b/js/getblockmns.js index 0654eea..1c1c80c 100644 --- a/js/getblockmns.js +++ b/js/getblockmns.js @@ -1,3 +1,40 @@ +// Function to make the API call and update the DOM for mn-lock-funds +async function fetchLockFunds() { + try { + const response = await fetch('https://api.nosocoin.com/info/locked_supply'); + const mnLockFunds = await response.text(); + + if (!isNaN(mnLockFunds)) { + document.getElementById('mn-lock-funds').innerText = mnLockFunds; + return mnLockFunds; + } else { + throw new Error('mn-lock-funds data not a valid number.'); + } + } catch (error) { + console.error('Error fetching mn-lock-funds:', error); + } +} + +// Function to calculate and display mn-lock-count +function displayLockCount(mnLockFunds) { + const mnLockCount = mnLockFunds / 10500; + document.getElementById('mn-lock-count').innerText = mnLockCount; +} + +// Function to calculate and display mn-inactive-nodes +function calculateInactiveNodes(mnLockCount, nodeCount) { + const mnInactiveNodes = mnLockCount - nodeCount; + document.getElementById('mn-inactive-nodes').innerText = mnInactiveNodes; +} + +// Call the functions when the page loads +fetchLockFunds().then(mnLockFunds => { + // Call the lock count function after fetching mn-lock-funds + if (!isNaN(mnLockFunds)) { + displayLockCount(mnLockFunds); + } +}); + document.addEventListener("DOMContentLoaded", function () { const urlParams = new URLSearchParams(window.location.search); let blockHeight = urlParams.get('blockheight'); @@ -94,6 +131,10 @@ document.addEventListener("DOMContentLoaded", function () { const earningPercentage = (totalReward / (totalReward * activeNodes)) * 100; document.getElementById('earning-percentage').textContent = earningPercentage.toFixed(2) + '%'; + // Call the function to calculate and display mn-inactive-nodes + const mnLockCount = parseFloat(document.getElementById('mn-lock-count').innerText); + calculateInactiveNodes(mnLockCount, nodeCount); + // Call the function to fetch data for the line chart fetchBlockDataForChart(); }) @@ -264,3 +305,10 @@ document.addEventListener("DOMContentLoaded", function () { .catch(error => console.error(error)); } }); + +// Function to calculate and display mn-inactive-nodes +document.addEventListener("DOMContentLoaded", function () { + const mnLockCount = parseFloat(document.getElementById('mn-lock-count').innerText); + const nodeCount = parseFloat(document.getElementById('node-count').innerText); + calculateInactiveNodes(mnLockCount, nodeCount); +}); diff --git a/masternodes.html b/masternodes.html index 3383cf9..fccc833 100644 --- a/masternodes.html +++ b/masternodes.html @@ -1,383 +1,342 @@ - - - - - - - - - Noso Explorer - - - - - - - - - - - - - - -
- - -
-
-
-
-
-
+ + + +
+
+
+
+
+ - + - + - + -
-
-
-
-
-
- -
-
-
- -
-
-
-
-
-
-
-

    Block Height:  

-  
-
-
-
-
-
-
-
-

Active - Masternodes:  0

+ Order +
+
+
+
+
+
+ +
+
+
+ +
+
+
+
+
+
+
+

    Block Height:  

+  
+
+
+
+
+
+
+

Total - Reward:  - 0

+ Reward:  + 0

Individual - Reward:  - 0

-

 

-
-
-
-
-
-
-
-
-
-
-

Locked - in Nodes: 0

+ Reward:  + 0

Earning - Percentage: 0 -

-

 

-

 

-
-
-
-
-
-
- -
-
-
-
-


- Active Nodes in the past 24hrs
-

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

Node Estimated - Earnings

-
+ Percentage: 0

+

 0

+
+
+
+
+
+
+
+
+
+
+

Active + Masternodes:  0

+

Inactive + Masternodes: 

+

Funds + in 14 Day Lock: +

+

Funds + in Active Nodes: 0

+
+
+
+
+
+
+ +
+
+
+
+


+ Active Nodes in the past 24hrs
+

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

Node Estimated + Earnings

+

Estimated - 24hr Reward: 0

+ 24 Hour Reward: 0

Estimated - 7 day Reward: 0

+ 7 Day Reward: 0

Estimated - 30 day Reward: 0

-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-


- Masternodes paid in this block:
-

-
-
-
-
-
-
-
-
-
-
-
-
-

nosologo Powered by NOSO Blockchain  |   - Built by the NOSO Community

-
-
-
- - - - - - - - - - - - - + 30 Day Reward: 0

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+


+ Masternodes paid in this block:
+

+
+
+
+
+
+
+
+
+
+
+
+
+

nosologo Powered by NOSO Blockchain  |   + Built by the NOSO Community

+
+ + + + + + + + + + + + + +