Skip to content

Instantly share code, notes, and snippets.

@GentlemanHal
Last active June 23, 2020 18:35
Show Gist options
  • Save GentlemanHal/f10519c100f576c7169a to your computer and use it in GitHub Desktop.
Save GentlemanHal/f10519c100f576c7169a to your computer and use it in GitHub Desktop.
Nevergreen MVP monitor page
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
</head>
<body>
<ul id="projects">
</ul>
<script>
function update() {
var cctrayUrl = 'https://builds.apache.org/cc.xml'
$.ajax({
type: 'POST',
url: 'https://nevergreen.io/api/projects',
data: JSON.stringify({feeds: [{url: cctrayUrl}]}),
timeout: 15000,
crossDomain: true,
headers: {
Accept: 'application/json; charset=utf-8',
'Content-Type': 'application/json; charset=utf-8'
}
}).done(function (response) {
$("#projects").empty()
response.forEach(function (project) {
$('#projects').append('<li>' + project.description + ' (' + project.prognosis + ')</li>')
})
})
}
update() // run immediately
setInterval(update, 10000) // then every 10 seconds
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment