automated terminal push
This commit is contained in:
13
web/pages/index.html
Executable file
13
web/pages/index.html
Executable file
@@ -0,0 +1,13 @@
|
||||
<html lang="en">
|
||||
|
||||
<body>
|
||||
|
||||
<script>
|
||||
|
||||
window.location.replace("portal.html");
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
250
web/pages/populate-top-bar.js
Executable file
250
web/pages/populate-top-bar.js
Executable file
@@ -0,0 +1,250 @@
|
||||
|
||||
//var apiURL = "http://veneno.embanet.online:8888";
|
||||
|
||||
//var apiURL = "http://aventador.embanet.online:4242";
|
||||
|
||||
var apiURL = "https://apis.projectchimba.valorantdigital.com";
|
||||
|
||||
function formatNumber(number) {
|
||||
|
||||
return Math.round(number).toLocaleString();
|
||||
|
||||
}
|
||||
|
||||
|
||||
function formatDollar(number) {
|
||||
|
||||
return '$ ' + Math.round(number).toLocaleString();
|
||||
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
getAccountInformation();
|
||||
|
||||
setInterval(getAccountInformation, 1000 * 10);
|
||||
|
||||
});
|
||||
|
||||
function getAccountInformation() {
|
||||
|
||||
console.debug("enter > getAccountInformation");
|
||||
|
||||
$.ajax({
|
||||
|
||||
type: "GET",
|
||||
|
||||
url: apiURL + "/broker/account",
|
||||
|
||||
contentType: "text/plain",
|
||||
|
||||
crossDomain: true,
|
||||
|
||||
success: function (data, status, exception) {
|
||||
|
||||
updateComponentsWithLiveData(data);
|
||||
|
||||
},
|
||||
|
||||
error: function (exception, status) {
|
||||
|
||||
console.log("exception", exception);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
console.debug("exit < getAccountInformation");
|
||||
|
||||
}
|
||||
|
||||
function updateComponentsWithLiveData(data) {
|
||||
|
||||
$('#account-sidebar-name').html(data.alias);
|
||||
|
||||
$('#account-topright-name').html(data.alias);
|
||||
|
||||
$('#account-bar-nav').html(formatDollar(data.nav));
|
||||
|
||||
$('#account-sidebar-nav').html(formatDollar(data.nav));
|
||||
|
||||
//////
|
||||
|
||||
$('#account-bar-balance').html(formatDollar(data.balance));
|
||||
|
||||
$('#account-bar-position-value').html(formatDollar(data.positionValue));
|
||||
|
||||
$('#account-bar-profit').html(formatDollar(data.pl));
|
||||
|
||||
|
||||
populateLongPositionsTable(data);
|
||||
|
||||
populateShortPositionsTable(data);
|
||||
|
||||
}
|
||||
|
||||
////////////////////////////
|
||||
|
||||
|
||||
function populateLongPositionsTable(data) {
|
||||
|
||||
var html = '';
|
||||
|
||||
var rowCount = 0;
|
||||
|
||||
for (var index = data.positions.length - 1; index >= 0; index--) {
|
||||
|
||||
// increment counter and break on threshold break
|
||||
|
||||
rowCount = rowCount + 1;
|
||||
|
||||
if (rowCount > 50) {
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if (data.positions[index].long.units > 0) {
|
||||
|
||||
html += '<tr>';
|
||||
|
||||
html += '<td> <div class="form-check form-check-muted m-0"> <label class="form-check-label"> <input type="checkbox" class="form-check-input"> <i class="input-helper"></i><i class="input-helper"></i><i class="input-helper"></i></label> </div> </td> <td> <img src="assets/images/faces/face1.jpg" alt="image"> <span class="ps-2">';
|
||||
|
||||
html += data.positions[index].instrument;
|
||||
|
||||
html += '</span> </td>';
|
||||
|
||||
// html += '<td class="">' + data.positions[index].instrument + '</td>';
|
||||
|
||||
html += '<td class="">' + formatNumber(data.positions[index].long.units) + '</td>';
|
||||
|
||||
html += '<td class="">' + data.positions[index].long.averagePrice + '</td>';
|
||||
|
||||
var purchasePrice = data.positions[index].long.units * data.positions[index].long.averagePrice;
|
||||
|
||||
console.log("purchasePrice /" + purchasePrice);
|
||||
|
||||
var purchasePrice2 = formatDollar(purchasePrice);
|
||||
|
||||
console.log("purchasePrice2 /" + purchasePrice2);
|
||||
|
||||
//alert(purchasePrice2);
|
||||
|
||||
html += '<td class="">' + purchasePrice2 + '</td>';
|
||||
|
||||
|
||||
|
||||
|
||||
/////
|
||||
|
||||
var profit = data.positions[index].long.unrealizedPL;
|
||||
|
||||
console.log("profit /" + profit);
|
||||
|
||||
var totalpositionworth = parseFloat(purchasePrice) + parseFloat(profit);
|
||||
|
||||
console.log("totalpositionworth /" + totalpositionworth);
|
||||
|
||||
|
||||
html += '<td class="">' + formatDollar(totalpositionworth) + '</td>';
|
||||
|
||||
if (data.positions[index].long.unrealizedPL > 0) {
|
||||
|
||||
html += '<td><div class="badge badge-outline-success">' + formatDollar(data.positions[index].long.unrealizedPL) + '</div></td>';
|
||||
|
||||
} else {
|
||||
|
||||
html += '<td><div class="badge badge-outline-danger"> ' + formatDollar(data.positions[index].long.unrealizedPL) + '</div></td>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
html += '</tr>';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
$('#table-positions-long > tbody').html(html);
|
||||
|
||||
}
|
||||
|
||||
function populateShortPositionsTable(data) {
|
||||
|
||||
var html = '';
|
||||
|
||||
var rowCount = 0;
|
||||
|
||||
for (var index = data.positions.length - 1; index >= 0; index--) {
|
||||
|
||||
// increment counter and break on threshold break
|
||||
|
||||
rowCount = rowCount + 1;
|
||||
|
||||
if (rowCount > 50) {
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if (data.positions[index].short.units < 0) {
|
||||
|
||||
html += '<tr>';
|
||||
|
||||
html += '<td> <div class="form-check form-check-muted m-0"> <label class="form-check-label"> <input type="checkbox" class="form-check-input"> <i class="input-helper"></i><i class="input-helper"></i><i class="input-helper"></i></label> </div> </td> <td> <img src="assets/images/faces/face1.jpg" alt="image"> <span class="ps-2">';
|
||||
|
||||
html += data.positions[index].instrument;
|
||||
|
||||
|
||||
html += '</span> </td>';
|
||||
|
||||
// html += '<td class="">' + data.positions[index].instrument + '</td>';
|
||||
|
||||
html += '<td class="">' + data.positions[index].short.units + '</td>';
|
||||
html += '<td class="">' + data.positions[index].short.averagePrice + '</td>';
|
||||
|
||||
html += '<td class="">' + data.positions[index].short.units * data.positions[index].short.averagePrice + '</td>';
|
||||
|
||||
html += '<td class="">' + (parseFloat(data.positions[index].short.units * data.positions[index].short.averagePrice) + parseFloat(data.positions[index].short.unrealizedPL)) + '</td>';
|
||||
|
||||
if (data.positions[index].short.unrealizedPL > 0) {
|
||||
html += '<td><div class="badge badge-outline-success">' + data.positions[index].short.unrealizedPL + '</div></td>';
|
||||
} else {
|
||||
html += '<td><div class="badge badge-outline-danger"> $ ' + data.positions[index].short.unrealizedPL + '</div></td>';
|
||||
}
|
||||
html += '</tr>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$('#table-positions-short > tbody').html(html);
|
||||
|
||||
}
|
||||
|
||||
function recycle() {
|
||||
|
||||
html += '<td> $ ' + response.executionReports[index].triggerJustificationReport.sma.toFixed(2) + '</td>';
|
||||
|
||||
html += '<td> $ ' + response.executionReports[index].triggerJustificationReport.price.toFixed(2) + '</td>';
|
||||
|
||||
html += '<td>' + response.executionReports[index].triggerJustificationReport.reason + '</td>';
|
||||
|
||||
if (response.executionReports[index].trigger) {
|
||||
|
||||
html += '<td><span class="badge pill bg-primary">' +
|
||||
response.executionReports[index].trigger + '</span></td>';
|
||||
|
||||
} else {
|
||||
|
||||
html += '<td><span class="badge pill bg-secondary">' +
|
||||
response.executionReports[index].trigger + '</span></td>';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
253
web/pages/portal.html
Executable file
253
web/pages/portal.html
Executable file
@@ -0,0 +1,253 @@
|
||||
|
||||
|
||||
<div id="ssss">
|
||||
|
||||
<div id="apssssps">
|
||||
|
||||
apps
|
||||
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<br />
|
||||
|
||||
<a
|
||||
|
||||
class="link"
|
||||
|
||||
target="countdown"
|
||||
|
||||
href="apps/content/article-magick-reloaded/"
|
||||
|
||||
>
|
||||
|
||||
<i class=""> </i> app > article magick reloaded
|
||||
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
<!--
|
||||
|
||||
##
|
||||
## productivity tools and things
|
||||
##
|
||||
|
||||
-->
|
||||
|
||||
|
||||
<div id="xdd">
|
||||
|
||||
<div id="useddrName">
|
||||
|
||||
productivity
|
||||
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<br />
|
||||
|
||||
<a
|
||||
|
||||
class="link"
|
||||
|
||||
tdarget="countdown"
|
||||
|
||||
href="tools/productivity/10x-countdown-timer/"
|
||||
|
||||
>
|
||||
|
||||
<i class=""> </i> tool > 10x timer
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<br />
|
||||
|
||||
<br />
|
||||
|
||||
<a
|
||||
|
||||
class="link"
|
||||
|
||||
tdarget="countdown"
|
||||
|
||||
href="tools/productivity/wheel/"
|
||||
|
||||
>
|
||||
|
||||
<i class=""> </i> spinning wheel
|
||||
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<br />
|
||||
|
||||
<!--
|
||||
|
||||
##
|
||||
## productivity tools and things
|
||||
##
|
||||
|
||||
-->
|
||||
|
||||
|
||||
<div id="xdd">
|
||||
|
||||
<div id="useddrName">
|
||||
|
||||
calculators
|
||||
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<br />
|
||||
|
||||
<a
|
||||
|
||||
class="link"
|
||||
|
||||
tdarget="countdown"
|
||||
|
||||
href="calculators/influencer/subscriber-revenue-projections/"
|
||||
|
||||
>
|
||||
|
||||
<i class=""> </i> calc > subscriber revenue
|
||||
|
||||
</a>
|
||||
|
||||
<br />
|
||||
|
||||
<br />
|
||||
|
||||
<a
|
||||
|
||||
class="link"
|
||||
|
||||
tdarget="countdown"
|
||||
|
||||
href="calculators/finance/the-valkyrie-calculators/web/valkyrie-bancolombia.html"
|
||||
|
||||
>
|
||||
|
||||
<i class=""> </i> calc > valkyrie calculator
|
||||
|
||||
</a>
|
||||
|
||||
<br />
|
||||
|
||||
<br />
|
||||
|
||||
</div>
|
||||
|
||||
<!--
|
||||
|
||||
##
|
||||
## next
|
||||
##
|
||||
|
||||
--
|
||||
|
||||
|
||||
<!--
|
||||
|
||||
##
|
||||
## games
|
||||
##
|
||||
|
||||
-->
|
||||
|
||||
|
||||
<div id="xdd">
|
||||
|
||||
<div id="useddrName">
|
||||
|
||||
games
|
||||
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<br />
|
||||
|
||||
<a
|
||||
|
||||
class="link"
|
||||
|
||||
tdarget="countdown"
|
||||
|
||||
href="games/casino/"
|
||||
|
||||
>
|
||||
|
||||
<i class=""> </i> games > casino
|
||||
|
||||
</a>
|
||||
|
||||
<br />
|
||||
|
||||
<br />
|
||||
|
||||
</div>
|
||||
|
||||
<!--
|
||||
|
||||
##
|
||||
## next
|
||||
##>
|
||||
|
||||
|
||||
<!--
|
||||
|
||||
##
|
||||
## games
|
||||
##
|
||||
|
||||
-->
|
||||
|
||||
|
||||
<div id="xdd">
|
||||
|
||||
<div id="useddrName">
|
||||
|
||||
tunnel
|
||||
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<br />
|
||||
|
||||
<a
|
||||
|
||||
class="link"
|
||||
|
||||
tdarget="tunnel"
|
||||
|
||||
href="tunnel/"
|
||||
|
||||
>
|
||||
|
||||
<i class=""> </i> tunnel apps
|
||||
|
||||
</a>
|
||||
|
||||
<br />
|
||||
|
||||
<br />
|
||||
|
||||
</div>
|
||||
|
||||
<!--
|
||||
|
||||
##
|
||||
## next
|
||||
##>
|
||||
|
||||
19
web/pages/rankings/phaseone.html
Normal file
19
web/pages/rankings/phaseone.html
Normal file
@@ -0,0 +1,19 @@
|
||||
# useful links and stuff
|
||||
|
||||
## stub data loading from twitchtracker.com
|
||||
|
||||
http://localhost:8888/twitch/channel/
|
||||
|
||||
http://localhost:8888/twitchtracker.com/channel/rankings/stub/truncate
|
||||
|
||||
http://localhost:8888/twitchtracker.com/channel/rankings/stub/load
|
||||
|
||||
http://localhost:8888/twitch/channel/
|
||||
|
||||
## live loading from twitchtracker.com
|
||||
|
||||
http://localhost:8888/twitchtracker.com/channel/rankings/truncate
|
||||
|
||||
http://localhost:8888/twitchtracker.com/channel/rankings/load
|
||||
|
||||
http://localhost:8888/twitch/channel/
|
||||
39
web/pages/rankings/teststub.bash
Executable file
39
web/pages/rankings/teststub.bash
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
set -x
|
||||
|
||||
reset
|
||||
|
||||
clear
|
||||
|
||||
echo
|
||||
echo "TEST / data / view application channel data"
|
||||
echo
|
||||
|
||||
curl http://localhost:8888/twitch/channel/
|
||||
|
||||
echo
|
||||
echo "TEST / operation / delete all application channel data from database"
|
||||
echo
|
||||
|
||||
curl http://localhost:8888/twitchtracker.com/channel/rankings/truncate
|
||||
|
||||
echo
|
||||
echo "TEST / data / view application channel data"
|
||||
echo
|
||||
|
||||
curl http://localhost:8888/twitch/channel/
|
||||
|
||||
echo
|
||||
echo "TEST / operation / load application channel data from twitchtracker.com"
|
||||
echo
|
||||
|
||||
curl http://localhost:8888/twitchtracker.com/channel/rankings/stub/load
|
||||
|
||||
echo
|
||||
echo "TEST / data / view application channel data"
|
||||
echo
|
||||
|
||||
curl http://localhost:8888/twitch/channel/
|
||||
Reference in New Issue
Block a user