Last active
August 29, 2015 13:56
-
-
Save dhensby/8955816 to your computer and use it in GitHub Desktop.
Script to auto reload DigitalOcean graphs on the droplet page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Refreshes the graphs at their interval | |
*/ | |
//generic function for generating a graph by parent ID | |
function genNewGraphByID(id) { | |
$(id).find('div.graph').each(function() { | |
$(this).children().remove(); | |
drawGraph(this); | |
}); | |
} | |
// real time | |
setInterval(function() { | |
genNewGraphByID('#action-graphs_real'); | |
}, 60000); | |
// daily | |
setInterval(function() { | |
genNewGraphByID('#action-graphs_daily'); | |
}, 300000); | |
// weekly | |
setInterval(function() { | |
genNewGraphByID('#action-graphs_weekly'); | |
}, 1800000); | |
// monthly | |
setInterval(function() { | |
genNewGraphByID('#action-graphs_monthly'); | |
}, 7200000); | |
// yearly | |
setInterval(function() { | |
genNewGraphByID('#action-graphs_yearly'); | |
}, 86400000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment