Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (34 sloc) 1.26 KB
<html>
<head>
<title>Jenkins XFD</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<link rel="apple-touch-icon"
href="http://agentdero.cachefly.net/continuousblog/newlogo/headshot.png" />
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes"/>
<script>
$(function(){
function show(obj){
var elem = $('#bg');
if(obj.result == 'SUCCESS'){
elem.css('background-color', 'green');
}else if(obj.result == 'UNSTABLE'){
elem.css('background-color', 'yellow');
}else{
elem.css('background-color', 'red');
}
}
var project = window.location.search.substring(1) || 'test';
var ws = new WebSocket('ws://localhost:8081/jenkins');
ws.onmessage = function(msg) {
eval('var obj = ' + msg.data);
if(obj.project != project) return;
show(obj);
};
$.getJSON('http://localhost/jenkins/job/' + project + '/lastBuild/api/json',
show);
});
</script>
</head>
<body id="bg"></body>
</html>