StatusPage
StatusPage copied to clipboard
Make compatible with API v2
Hello! Uptime Robot API v1 will be dead after june 2017. I've created a new "statusPage.php" file compatible with API v2. You have to change "main.js" duration calculation method, but It's even easier now: just use the new "events.duration" as "diffSeconds" instead of doing the math by hand. Regards. Sorry for posting code directly in here... I'm no github guru :-)
Also looking for that. Does this really work with API 2 ? Thanks for file - I will give try.
Copied to Paste Bin: https://pastebin.com/Pdkzrwr1
Yep. I'm currently using this file in production (via Heroku). But there is a small change you have to do in Javascript in order to output the duration correctly. The new API v2 already returns the duration in milliseconds.
Regards.
Em 8 de mai de 2017 23:23, "TomasHurtz" [email protected] escreveu:
Also looking for that. Does this really work with API 2 ?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nerdbaggy/StatusPage/issues/44#issuecomment-300043205, or mute the thread https://github.com/notifications/unsubscribe-auth/AAc38snpLVNXRrlzKbeEiTbgGF8Aqz5mks5r384GgaJpZM4M0opO .
Can you advise the javascript change needs, thanks
The updated js file is here (see variables diffSeconds, diffHours, diffMinutes, and timeDiff): main.js And the v2 compatible php file is here (same file as above): statusPage.php
thank you :-)
I will be working on updating it this weekend. Thanks for the code!
On May 8, 2017, at 10:23 PM, TomasHurtz [email protected] wrote:
Also looking for that. Does this really work with API 2 ?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Thanks bgeneto. Could you please add an file statuspage.min.js with your new version of main.js. So Users could just replace the statuspage.min.js instead of Running it through Gulp.
Any chance of finding a way to sort them: https://github.com/nerdbaggy/StatusPage/issues/18
@TomasHurtz I posted a way to do this in #18
Yes - I got it working thank you :-)
Hey all -
[EDIT: I fixed the below issue using the revised statusPage.php file in the above comment > https://github.com/nerdbaggy/StatusPage/issues/44#issuecomment-300221190
@bgeneto What I would like to know is what is the difference between main.js and statuspage.min.js ? Do I need both of these JS files (main.js does not appear in the main build ? ] - otherwise - how to incorporate JS changes mentioned?
Issue I am facing is it does not appear to be collecting any Graphing Data in my outputted page: When clicking on the graph icon
Clicking on the icon I get "No graphing data is currently available, sorry!" (appears to be generating from the JS file)
Any one else have this issue? I cleared cache - but not changed.
Could this be due to incorrect API parameters in statusPage.php ? I notice parameters used appear to be from APIv1 (different in APIv2)
Fixed! Working again now - I had to delete htaccess file and phpfastcache. Then restore phpfastcache.
Would be good if the main branch could be updated to latest ;-)