From 2b1285652b04295c4542bb45b64d2f0ecd1a5e65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Sat, 30 Jul 2016 17:14:51 +0200 Subject: [PATCH] Added a couple of checkbox to choose which builds are included. --- index.html | 8 +++++++- script.js | 9 +++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index da548d7..621e678 100644 --- a/index.html +++ b/index.html @@ -8,9 +8,15 @@

Travis CI build stats

- + +
+ + +
+ +
diff --git a/script.js b/script.js index 3bf798a..24d2a2a 100644 --- a/script.js +++ b/script.js @@ -140,6 +140,8 @@ function getBuildDate(build) { function updateChart() { var repoName = document.getElementById('repo-name').value; + var includeFailed = document.getElementById('include-failed').checked; + var onlyMaster = document.getElementById('only-master').checked; // need at least "a/a" if (repoName.length < 3) { @@ -148,7 +150,7 @@ function updateChart() { var baseUrl = 'https://travis-ci.org/' + repoName + '/builds/'; - var buildsUrl = 'https://api.travis-ci.org/repos/' + repoName + '/builds?event_type=push'; + var buildsUrl = 'https://api.travis-ci.org/repos/' + repoName + '/builds'; // ?event_type=push'; var builds = []; @@ -181,7 +183,10 @@ function updateChart() { curOldestBuild = buildNr; } - if (/*build.branch !== 'master' ||*/ build.state !== 'finished') { + if ((onlyMaster && build.branch !== 'master') + || (build.state !== 'finished') + || (!includeFailed && build.result !== 0) + || (build.event_type != "push" && build.event_type != "cron")) { return; }