generated from nathanwoodburn/python-webserver-template
feat: Update javascript to show USD with dollar symbol
All checks were successful
Build Docker / BuildImage (push) Successful in 32s
All checks were successful
Build Docker / BuildImage (push) Successful in 32s
This commit is contained in:
parent
afc03cd65d
commit
163dc9167a
@ -1,3 +1,4 @@
|
|||||||
# python-webserver-template
|
# Woodburn Vault Website
|
||||||
|
|
||||||
Python3 website template including git actions
|
This is the source code for the Woodburn Vault website.
|
||||||
|
https://sol.woodburn.au
|
2
cache/1981e30de11cf0845e8b5affb4dc75e0.json
vendored
2
cache/1981e30de11cf0845e8b5affb4dc75e0.json
vendored
@ -1 +1 @@
|
|||||||
{"timestamp": 1733446009.8000035, "result": 3851.54}
|
{"timestamp": 1733452460.1627874, "result": 3858.15}
|
2
cache/1ccff5c6f117409fea0c861aa44b8e62.json
vendored
2
cache/1ccff5c6f117409fea0c861aa44b8e62.json
vendored
@ -1 +1 @@
|
|||||||
{"timestamp": 1733446072.6788523, "result": 1.18}
|
{"timestamp": 1733452583.3367944, "result": 1.18}
|
2
cache/29409a8a40dd2d547a7a44b8f6758f54.json
vendored
2
cache/29409a8a40dd2d547a7a44b8f6758f54.json
vendored
@ -1 +1 @@
|
|||||||
{"timestamp": 1733446070.7321002, "result": 4.18}
|
{"timestamp": 1733452521.11626, "result": 4.18}
|
2
cache/4104ed0427efe63d4ca0dead970a4391.json
vendored
2
cache/4104ed0427efe63d4ca0dead970a4391.json
vendored
@ -1 +1 @@
|
|||||||
{"timestamp": 1733446008.9807563, "result": 253.52}
|
{"timestamp": 1733452459.4338732, "result": 256.86}
|
2
cache/46c1ec7f5edb30c070003dc54e072f41.json
vendored
2
cache/46c1ec7f5edb30c070003dc54e072f41.json
vendored
@ -1 +1 @@
|
|||||||
{"timestamp": 1733446071.34895, "result": 4.24}
|
{"timestamp": 1733452521.7992837, "result": 4.27}
|
2
cache/598f5dbf97fb0d45cbc6e1a5b0a3b575.json
vendored
2
cache/598f5dbf97fb0d45cbc6e1a5b0a3b575.json
vendored
@ -1 +1 @@
|
|||||||
{"timestamp": 1733446003.3492062, "result": 239.52}
|
{"timestamp": 1733452455.4462905, "result": 242.74}
|
2
cache/6cc6c6a0b2d0654f551d33209c1fd824.json
vendored
2
cache/6cc6c6a0b2d0654f551d33209c1fd824.json
vendored
@ -1 +1 @@
|
|||||||
{"timestamp": 1733446071.701356, "result": 4.38}
|
{"timestamp": 1733452582.4154658, "result": 4.42}
|
2
cache/6eec370e2713cfc84c84e1080b8a191a.json
vendored
2
cache/6eec370e2713cfc84c84e1080b8a191a.json
vendored
@ -1 +1 @@
|
|||||||
{"timestamp": 1733446001.4129517, "result": 183.854558203}
|
{"timestamp": 1733452453.802349, "result": 220.385447719}
|
2
cache/790b28a9a21cf694ad9577ef1072ac9e.json
vendored
2
cache/790b28a9a21cf694ad9577ef1072ac9e.json
vendored
@ -1 +1 @@
|
|||||||
{"timestamp": 1733446002.9388597, "result": 0.00925676}
|
{"timestamp": 1733452455.0318573, "result": 0.00926176}
|
2
cache/a071d7bdda25c22e42ad7840f17c4b0e.json
vendored
2
cache/a071d7bdda25c22e42ad7840f17c4b0e.json
vendored
@ -1 +1 @@
|
|||||||
{"timestamp": 1733446006.2181199, "result": 1.002}
|
{"timestamp": 1733452457.4861891, "result": 0.999534}
|
2
cache/a099e7e540e16a185b0279b9494e5099.json
vendored
2
cache/a099e7e540e16a185b0279b9494e5099.json
vendored
@ -1 +1 @@
|
|||||||
{"timestamp": 1733446007.035127, "result": 97423}
|
{"timestamp": 1733452458.1552694, "result": 97550}
|
2
cache/a0ee60913ba556f39d128e7d7249e788.json
vendored
2
cache/a0ee60913ba556f39d128e7d7249e788.json
vendored
@ -1 +1 @@
|
|||||||
{"timestamp": 1733446071.70293, "result": [{"mint": "3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh", "balance": 0.00011819, "price": 97423, "value": 11.51442437, "name": "Wrapped BTC (Wormhole)", "symbol": "wbtc"}, {"mint": "jupSoLaHXQiZZTSfEWMTRRgpnyFm8f6sZdosWBjx93v", "balance": 0.039815492, "price": 253.52, "value": 10.094023531840001, "name": "Jupiter Staked SOL", "symbol": "jupsol"}, {"mint": "7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs", "balance": 0.00255735, "price": 3851.54, "value": 9.849735819, "name": "Ethereum (Wormhole)", "symbol": "eth"}, {"mint": "27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4", "balance": 2.402337, "price": 4.18, "value": 10.04176866, "name": "Jupiter Perpetuals Liquidity Provider Token", "symbol": "jlp"}, {"mint": "0x2::sui::SUI", "balance": 0.902850107, "price": 4.24, "value": 3.8280844536800003, "name": "Sui", "symbol": "sui"}, {"mint": "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT", "balance": 9.658874002, "price": 4.38, "value": 42.30586812876, "name": "Volo Staked SUI", "symbol": "vsui"}]}
|
{"timestamp": 1733452582.4186058, "result": [{"mint": "3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh", "balance": 0.00011819, "price": 97550, "value": 11.5294345, "name": "Wrapped BTC (Wormhole)", "symbol": "wbtc"}, {"mint": "jupSoLaHXQiZZTSfEWMTRRgpnyFm8f6sZdosWBjx93v", "balance": 0.039815492, "price": 256.86, "value": 10.22700727512, "name": "Jupiter Staked SOL", "symbol": "jupsol"}, {"mint": "7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs", "balance": 0.00255735, "price": 3858.15, "value": 9.8666399025, "name": "Ethereum (Wormhole)", "symbol": "eth"}, {"mint": "27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4", "balance": 10.355235, "price": 4.18, "value": 43.2848823, "name": "Jupiter Perpetuals Liquidity Provider Token", "symbol": "jlp"}, {"mint": "0x2::sui::SUI", "balance": 0.902850107, "price": 4.27, "value": 3.8551699568899997, "name": "Sui", "symbol": "sui"}, {"mint": "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT", "balance": 9.658874002, "price": 4.42, "value": 42.692223088839995, "name": "Volo Staked SUI", "symbol": "vsui"}]}
|
2
cache/c652e896f57f598d23e3dbebdb815ef6.json
vendored
2
cache/c652e896f57f598d23e3dbebdb815ef6.json
vendored
@ -1 +1 @@
|
|||||||
{"timestamp": 1733446071.702515, "result": [{"mint": "0x2::sui::SUI", "balance": 0.902850107, "price": 4.24, "value": 3.8280844536800003, "name": "Sui", "symbol": "sui"}, {"mint": "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT", "balance": 9.658874002, "price": 4.38, "value": 42.30586812876, "name": "Volo Staked SUI", "symbol": "vsui"}]}
|
{"timestamp": 1733452582.4178462, "result": [{"mint": "0x2::sui::SUI", "balance": 0.902850107, "price": 4.27, "value": 3.8551699568899997, "name": "Sui", "symbol": "sui"}, {"mint": "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT", "balance": 9.658874002, "price": 4.42, "value": 42.692223088839995, "name": "Volo Staked SUI", "symbol": "vsui"}]}
|
2
cache/ccf2a009e56f1b05d471a55d9c9ea8ea.json
vendored
2
cache/ccf2a009e56f1b05d471a55d9c9ea8ea.json
vendored
@ -1 +1 @@
|
|||||||
{"timestamp": 1733446072.368228, "result": 82.815227}
|
{"timestamp": 1733452583.030624, "result": 82.815227}
|
@ -339,8 +339,6 @@ def getSuiTokens(address: str):
|
|||||||
address
|
address
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
# Define headers (if needed)
|
|
||||||
headers = {
|
headers = {
|
||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json"
|
||||||
}
|
}
|
||||||
|
BIN
stWDBRN.bsdesign
BIN
stWDBRN.bsdesign
Binary file not shown.
@ -169,7 +169,7 @@
|
|||||||
amountCell.style.padding = '8px 20px';
|
amountCell.style.padding = '8px 20px';
|
||||||
|
|
||||||
const valueCell = document.createElement('td');
|
const valueCell = document.createElement('td');
|
||||||
valueCell.textContent = data[token].value;
|
valueCell.textContent = `$${data[token].value.toFixed(2)}`;
|
||||||
valueCell.style.border = '1px solid #ccc';
|
valueCell.style.border = '1px solid #ccc';
|
||||||
valueCell.style.padding = '8px 20px';
|
valueCell.style.padding = '8px 20px';
|
||||||
|
|
||||||
@ -184,20 +184,21 @@
|
|||||||
table.appendChild(tbody);
|
table.appendChild(tbody);
|
||||||
tableContainer.appendChild(table);
|
tableContainer.appendChild(table);
|
||||||
sortTableByValue(tbody);
|
sortTableByValue(tbody);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function to sort table rows by the "Value" column
|
// Function to sort table rows by the "Value" column
|
||||||
function sortTableByValue(tbody) {
|
function sortTableByValue(tbody) {
|
||||||
const rows = Array.from(tbody.querySelectorAll('tr'));
|
const rows = Array.from(tbody.querySelectorAll('tr'));
|
||||||
const sortedRows = rows.sort((a, b) => {
|
const sortedRows = rows.sort((a, b) => {
|
||||||
const valueA = parseFloat(a.children[2].textContent) || 0;
|
// Remove `$` and parse the value as float
|
||||||
const valueB = parseFloat(b.children[2].textContent) || 0;
|
const valueA = parseFloat(a.children[2].textContent.replace('$', '')) || 0;
|
||||||
|
const valueB = parseFloat(b.children[2].textContent.replace('$', '')) || 0;
|
||||||
return valueA - valueB;
|
return valueA - valueB;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Reverse order if already sorted in ascending order
|
// Reverse order if already sorted in ascending order
|
||||||
const isDecending = tbody.getAttribute('data-sort-order') === 'desc';
|
const isDescending = tbody.getAttribute('data-sort-order') === 'desc';
|
||||||
if (!isDecending) {
|
if (!isDescending) {
|
||||||
sortedRows.reverse();
|
sortedRows.reverse();
|
||||||
tbody.setAttribute('data-sort-order', 'desc');
|
tbody.setAttribute('data-sort-order', 'desc');
|
||||||
} else {
|
} else {
|
||||||
@ -207,9 +208,7 @@ function sortTableByValue(tbody) {
|
|||||||
// Append sorted rows back to the tbody
|
// Append sorted rows back to the tbody
|
||||||
tbody.innerHTML = '';
|
tbody.innerHTML = '';
|
||||||
sortedRows.forEach(row => tbody.appendChild(row));
|
sortedRows.forEach(row => tbody.appendChild(row));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async function toggleChart() {
|
async function toggleChart() {
|
||||||
isPerTokenView = !isPerTokenView;
|
isPerTokenView = !isPerTokenView;
|
||||||
@ -250,8 +249,7 @@ function sortTableByValue(tbody) {
|
|||||||
// Set button event listener
|
// Set button event listener
|
||||||
document.getElementById('chart-header').addEventListener('click', toggleChart);
|
document.getElementById('chart-header').addEventListener('click', toggleChart);
|
||||||
};
|
};
|
||||||
</script>
|
</script></div><a class="btn btn-secondary" role="button" href="https://www.coingecko.com/en/portfolios/public/vault" target="_blank" style="margin: 10px;">View on Coingecko</a>
|
||||||
</div><a class="btn btn-secondary" role="button" href="https://www.coingecko.com/en/portfolios/public/vault" target="_blank" style="margin: 10px;">View on Coingecko</a>
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
@ -366,7 +364,7 @@ function sortTableByValue(tbody) {
|
|||||||
<div class="col-lg-6 order-lg-1">
|
<div class="col-lg-6 order-lg-1">
|
||||||
<div class="p-5">
|
<div class="p-5">
|
||||||
<h2 class="display-4">3. Sell your tokens</h2>
|
<h2 class="display-4">3. Sell your tokens</h2>
|
||||||
<p>When you want to cash out just sell your tokens back to us at the current token price.</p><a class="btn btn-primary" role="button" href="mailto:vault@woodburn.au">Sell Tokens</a>
|
<p>When you want to cash out just sell your tokens back to me at the current token price.</p><a class="btn btn-primary" role="button" href="mailto:vault@woodburn.au" target="_blank">Contact to sell tokens</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user