Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Show a jenkins view.

Signed-off-by: François de Metz <fdemetz@af83.com>
  • Loading branch information...
commit 89b8c540c45c72461032137330c7c668c73dfb68 1 parent 7f90f6b
@francois2metz francois2metz authored
Showing with 32 additions and 0 deletions.
  1. +12 −0 index.html
  2. +20 −0 jenkins.js
View
12 index.html
@@ -0,0 +1,12 @@
+<html>
+<body>
+<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
+<script type="text/javascript" src="jenkins.js"></script>
+<script type="text/javascript">
+// wanna watch a jenkins project ?
+new JenkinsState({project: "jenkins_main_trunk", host: "ci.jenkins-ci.org"});
+// wanna watch a jenkins view ?
+new JenkinsViewState({view: "Infrastructure", host: "ci.jenkins-ci.org"});
+</script>
+</body>
+</html>
View
20 jenkins.js
@@ -39,4 +39,24 @@
// ask the state to jenkins.
query();
}
+
+ /**
+ * Use to watch a view state on jenkins
+ */
+ win.JenkinsViewState = function(options) {
+ $.ajax({
+ url: "http://" + options.host + "/view//" + options.view + "/api/json",
+ dataType: "jsonp",
+ jsonp: 'jsonp',
+ success: function(data) {
+ $(data.jobs).each(function(i, job) {
+ new JenkinsState({
+ project: job.name,
+ host: options.host
+ });
+ });
+ }
+ })
+ }
+
})(window, jQuery);
Please sign in to comment.
Something went wrong with that request. Please try again.