-
Notifications
You must be signed in to change notification settings - Fork 347
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
Conversation
Why? The bot has a slow cycle. Since my bot is running at 1 min cycle, 30 sec is optimal for getting reasonable updates and not wasting bandwidth on mobile. In any case, please make it configurable, I see 2 options:
|
Interval ~10seconds -- I love watching the log flying around right after I make changes, etc. across all my coins (and their prices). I'm used to streaming output so I like it as up-to-date as possible :) I mean, ideally it should be configurable based on preferences. I could add a button/slider/drop down to set this value? |
We have already some URL options. |
Oh. I wasn't even aware of the URL options! I skimmed over that in the docs. ...maybe I can add a nice little section for managing all of these options... :) For my reference http://poloniexlendingbot.readthedocs.io/en/latest/configuration.html#lendingbot-html-options |
That would be great, never got to that. |
Just use prettyFloat instead of printFloat. |
Actually I would like the time views to be selectable by checkboxes in the settings as well, personally I would look at daily, monthly only. |
btw, I was working here to add "Total Account Value": |
www/lendingbot.js
Outdated
@@ -246,6 +258,8 @@ function Timespan(name, multiplier) { | |||
} | |||
if (currency == "BTC") { | |||
return displayUnit.formatValue(earnings) + " <span class=" + currencyClass + ">" + displayUnit.name + "</span> / " + name + "<br/>" | |||
} else if (currency == "USD" || currency == "USDT") { | |||
return printFloat(earnings, 2) + " <span class=" + currencyClass + ">" + currency + "</span> / "+ name + "<br/>"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we just use prettyFloat(earnings,2) instead of trying to guess which currency is a Fiat one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i.e. I use EUR. ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would change behavior for quite a few coins, I think we want to see Satoshi level resolution most of the times?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What other currencies should we add here? Some currencies may need special printing, in this case for USD it makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the other currencies in this function use printFloat
, you want to go in and change these to the style you prefer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ckcollab "EUR" for example and actually any currency supported by https://blockchain.info/api/exchange_rates_api
I'm thinking about using the prettyFloat as it will provide an accuracy of 2 decimals for any coin and I think that should be good enough, no? or should we make the accuracy configurable?
I'm open for suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: I also add EUR, but maintain consistency with the surrounding code. Then in a separate PR we decide how to handle this particular problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed.
www/lendingbot.js
Outdated
total_cell.innerHTML = "Total holdings"; | ||
total_cell = total_row.appendChild(document.createElement("th")); | ||
total_cell.setAttribute("colspan", 2); | ||
total_cell.innerHTML = prettyFloat(totalCoinsOverall, 2) + " USD"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
USD? I guess it should be earningsOutputCoin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you're doing this in another PR I'll pull this stuff
If you need a Gear icon you can use one from http://fontawesome.io/icons/ |
Just using the Bootstrap one, is fontawesome also included? Probably not necessary to have two icon libs when we only have the 1 page. |
Goahead and replace, I don't mind :)
Added a check for this.
I'd rather not, very very busy! Glad to share what little I could given I use this all the time, thanks for all the hard work! |
It is great! We will build upon. :) |
I move to merge in its current state, since I don't want to muck around with multiple branches while trying to change a single icon. @rnevet I leave final decision to you. |
@Evanito I've made the rest of the changes and minor fixes in this branch https://github.com/Mikadily/poloniexlendingbot/tree/web_setting. Made a PR back to @ckcollab and when he merges it, it should appear here. (Otherwise we can create a new PR from web_setting branch.) |
Replace printFloat with prettyfloat for Fiat currencies (doesn't display .00)
…o get bad data set (sets localStorage without checking if it's valid)
As btcDisplayUnitsModes isn't a list of strings a simple indexOf won't match the mode.
new header with collapsing menu
@yura-pakhuchiy can you test this as well? |
LGTM! I had exactly the same idea for settings dialog on webpage itself for quite some time. I have never found time to implement it. @ckcollab @rnevet Greak work! Small things which can be improved:
|
@ckcollab Thanks! |
@rnevet my pleasure, thanks for this project! |
Least I could do :) |
Todo
Limit USD view to only show 2 decimal placesBelieve this is being handed off to Total Account Holdings feature?Description
This makes the page update every 10 seconds instead of every 30.
TESTING STAGE
Currently testing this for 24hrs
Types of changes
Checklist: