nerdbaggy / StatusPage

Public Status Page for UptimeRobot
http://projects.spencerl.com/statuspage/
MIT License
240 stars 61 forks source link

Make compatible with API v2 #44

Open bgeneto opened 7 years ago

bgeneto commented 7 years ago

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 :-)

statusPage.php

TomasHurtz commented 7 years ago

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

bgeneto commented 7 years ago

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" notifications@github.com 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 .

TomasHurtz commented 7 years ago

Can you advise the javascript change needs, thanks

bgeneto commented 7 years ago

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

TomasHurtz commented 7 years ago

thank you :-)

nerdbaggy commented 7 years ago

I will be working on updating it this weekend. Thanks for the code!

On May 8, 2017, at 10:23 PM, TomasHurtz notifications@github.com 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.

Chris6284 commented 7 years ago

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.

TomasHurtz commented 7 years ago

Any chance of finding a way to sort them: https://github.com/nerdbaggy/StatusPage/issues/18

davidus05 commented 6 years ago

@TomasHurtz I posted a way to do this in #18

TomasHurtz commented 6 years ago

Yes - I got it working thank you :-)

TomasHurtz commented 5 years ago

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

server status

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)

TomasHurtz commented 5 years ago

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 ;-)