Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web view improvements (update interval, settings) #286

Merged
merged 27 commits into from
Apr 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
bcb3be2
Increase page update interval
ckcollab Mar 31, 2017
de08e92
show yearly earnings as well
ckcollab Mar 31, 2017
1a58be0
Display USD with 2 decimal places
ckcollab Mar 31, 2017
45bc439
display total holdings
ckcollab Apr 2, 2017
d2aaf68
fix grabbing totals when totalCoins not defined
ckcollab Apr 2, 2017
94b5f42
use max coins not total coins for total holdings
ckcollab Apr 3, 2017
30cd953
adds toastr and settings for interval + stats
ckcollab Apr 6, 2017
1b026fa
remove cruft
ckcollab Apr 6, 2017
654c6ab
change "init" to "update" as it is ran multiple times
ckcollab Apr 8, 2017
b5567c5
missed an init->update refactor
ckcollab Apr 13, 2017
d1b4516
add EUR to nice currency printing
ckcollab Apr 13, 2017
4e087cb
verify refresh rate value
ckcollab Apr 14, 2017
61081dd
new html header with collapsing menu
Apr 14, 2017
24da4cd
restore default refreshrate to 30 seconds
Apr 14, 2017
ded06c3
added a version parameter to the javascript to force reload
Apr 14, 2017
2e6cac4
added missing scheme in toastr urls
Apr 14, 2017
b97ab45
rename loadSave to loadSettings
Apr 14, 2017
5234536
Added Bitcoin Display Unit to Settings.
Apr 14, 2017
a644a86
Added OutputCurrencyDisplayMode to Settings.
Apr 14, 2017
65fadef
Added Effective Rate Calculation to Settings.
Apr 14, 2017
851c30e
Fix indentation issues
rnevet Apr 15, 2017
d18500e
refactor validating... will still behave weirdly if somehow manages t…
ckcollab Apr 15, 2017
42294a3
Fixed indent issue
rnevet Apr 15, 2017
f98a4ab
Restored btcDisplayUnitsModes saving method
rnevet Apr 15, 2017
d8fb51e
Merge pull request #1 from Mikadily/web_setting
ckcollab Apr 15, 2017
52b6830
Close menu when settings is pressed.
rnevet Apr 16, 2017
b930c92
use icon192
rnevet Apr 16, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
174 changes: 143 additions & 31 deletions www/lendingbot.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,43 @@

<!-- Bootstrap Core CSS -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">

<!-- jQuery Version 1.12.2 -->
<script src="https://code.jquery.com/jquery-1.12.2.min.js"></script>

<!-- Bootstrap Core JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>

<script src="lendingbot.js" ></script>


<!-- toastr -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css" rel="stylesheet">

<script src="lendingbot.js?version=1" ></script>

<style>
body {
padding-top: 50px;
}
.brand-margin{
margin-top:4px;
margin-bottom:4px
}

.inlinediv {
display: inline-block;
padding-right: 5%;
vertical-align: top;
}
.plb-tooltip {
white-space: nowrap;
text-decoration: none;
border-bottom: 1px dotted;
color: black;
}
.plb-tooltip:hover {
text-decoration: none;
}
display: inline-block;
padding-right: 5%;
vertical-align: top;
}
.plb-tooltip {
white-space: nowrap;
text-decoration: none;
border-bottom: 1px dotted;
color: black;
}
.plb-tooltip:hover {
text-decoration: none;
}

.modal-body form label {
margin-top:8px;
}
</style>

</head>
Expand All @@ -61,19 +71,36 @@
<!-- Page Content -->
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="row">
<div class="col-xs-7">
<h4>
Poloniex Lending Bot
</h4>
</div>
<div class="col-xs-5" style="text-align:right;margin: 10px auto;" >
<span id="updated">Not updated</span>

<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header" style="margin-left:8px">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<img src="images/icon192.png" height="32" width="32" style="margin-top: 8px;margin-right: 8px;margin-left: -15px;vertical-align:top">
<div style="display:inline-block">
<h4 class="brand-margin">Poloniex Lending Bot</h4>
<h7 class="brand-margin" id="updated">Not updated</h7>
</div>
</div>

<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li data-toggle="collapse" data-target=".navbar-collapse.in" >
<a data-toggle="modal" data-target="#settings_modal">
<i class="glyphicon glyphicon-cog" style="color: black; cursor: pointer;"></i>
Settings
</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="container" style="padding-top:50px">
<div class="row" style="overflow-x:auto">
<div id="file" style="margin-top:8px;display:none" >Select log file: <input type="file" name="file" style="display:inline-block" onchange="handleLocalFile(this.files[0])" /></div>
<table class="table table-responsive">
Expand All @@ -93,14 +120,99 @@ <h4>
<th colspan="2">Log (Reversed ordered):</th>
</tr>
</thead>
<tbody id="logtable">
<tbody id="logtable">
</tbody>
</table>
</div>
</div>
<!-- /.container -->



<div class="modal fade" id="settings_modal" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">Settings</h4>
</div>
<div class="modal-body">
<form>
<label>Page Refresh interval (10-60 seconds)</label>
<div class="form-group">
<input type="number" class="form-control" id="refresh_interval" placeholder="(10-60)">
</div>

<label>Date ranges to display earnings for</label>
<div class="form-group">

<div class="checkbox-inline" style="margin-top: 0;">
<input data-timespan="Hour" type="checkbox"> Hourly
</div>
<div class="checkbox-inline">
<input data-timespan="Day" type="checkbox"> Daily
</div>
<div class="checkbox-inline">
<input data-timespan="Week" type="checkbox"> Weekly
</div>
<div class="checkbox-inline">
<input data-timespan="Month" type="checkbox"> Monthly
</div>
<div class="checkbox-inline">
<input data-timespan="Year" type="checkbox"> Yearly
</div>
</div>

<label>Bitcoin Display Unit</label>
<div class="form-group">

<div class="radio-inline" style="margin-top: 0;">
<input value="BTC" type="radio" name="btcDisplayUnit"> BTC
</div>
<div class="radio-inline">
<input value="mBTC" type="radio" name="btcDisplayUnit"> mBTC
</div>
<div class="radio-inline">
<input value="Bits" type="radio" name="btcDisplayUnit"> Bits
</div>
<div class="radio-inline">
<input value="Satoshi" type="radio" name="btcDisplayUnit"> Satoshi
</div>
</div>

<label>Which earnings are displayed in selected output currency</label>
<div class="form-group">

<div class="radio-inline" style="margin-top: 0;">
<input value="all" type="radio" name="outputCurrencyDisplayMode"> All Coins
</div>
<div class="radio-inline">
<input value="summary" type="radio" name="outputCurrencyDisplayMode"> Only Summary
</div>
</div>

<label>Effective loan rates calculation</label>
<p class="small">Effective rate can either take into consideration the actual amount actively lent OR consider only Poloniex 15% fee</p>
<div class="form-group">

<div class="radio-inline" style="margin-top: 0;">
<input value="lentperc" type="radio" name="effRateMode"> Fee and Effective Lent
</div>
<div class="radio-inline">
<input value="onlyfee" type="radio" name="effRateMode"> Fee Only
</div>
</div>

</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" onclick="doSave()">Save changes</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</body>

</html>
Loading