StatusPage icon indicating copy to clipboard operation
StatusPage copied to clipboard

Make compatible with API v2

Open bgeneto opened this issue 7 years ago • 12 comments

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

bgeneto avatar Apr 05 '17 18:04 bgeneto

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

TomasHurtz avatar May 09 '17 02:05 TomasHurtz

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 .

bgeneto avatar May 09 '17 13:05 bgeneto

Can you advise the javascript change needs, thanks

TomasHurtz avatar May 09 '17 14:05 TomasHurtz

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

bgeneto avatar May 09 '17 16:05 bgeneto

thank you :-)

TomasHurtz avatar May 10 '17 03:05 TomasHurtz

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.

nerdbaggy avatar May 10 '17 12:05 nerdbaggy

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.

Chris6284 avatar Jun 02 '17 07:06 Chris6284

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

TomasHurtz avatar Jul 26 '17 12:07 TomasHurtz

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

davidus05 avatar Jul 02 '18 14:07 davidus05

Yes - I got it working thank you :-)

TomasHurtz avatar Jul 02 '18 22:07 TomasHurtz

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 avatar Nov 30 '18 04:11 TomasHurtz

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

TomasHurtz avatar Nov 30 '18 12:11 TomasHurtz