~linaro-automation/linaro-android-frontend/trunk

« back to all changes in this revision

Viewing changes to static/buildDetails.js

  • Committer: Georgy Redkozubov
  • Date: 2013-06-24 12:02:09 UTC
  • mfrom: (314.1.2 hide-howtos)
  • Revision ID: georgy.redkozubov@linaro.org-20130624120209-z3cs6qq5hopd0wkh
Hide files based on pattrerns from the downloads list

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    }
34
34
    var jobUrl = globalConfig.jenkinsURL + "/job/" + buildName;
35
35
 
 
36
    function patternInName (name, list) {
 
37
      // Check for patterns from 'list' in 'name'.
 
38
      // If found returns 'true' otherwise 'false'.
 
39
      for (var i = 0; i < list.length; i++) {
 
40
        if (name.indexOf(list[i])>=0)
 
41
        {
 
42
          return true;
 
43
        }
 
44
      }
 
45
      return false;
 
46
    }
 
47
 
36
48
    function receivedTestResultJSON (response, loadingNode) {
37
49
        var columns = [
38
50
            {label:"Name", formatter: function (o) {
252
264
        var downloadUrl = 'http://snapshots.linaro.org/android/' + rawBuildName + '/' + results.number.toString() + '/';
253
265
          handleRenderedFiles('android/' + rawBuildName + '/' +
254
266
                              results.number.toString());
 
267
        var hiddenFilesPatterns = ['HOWTO_', 'BUILD-INFO', 'EULA', 'textile'];
255
268
 
256
269
 
257
270
        Y.one('#all-output a').setAttribute('href', downloadUrl);
286
299
 
287
300
          for (var i = 0; i < manifest.length; i++)
288
301
          {
289
 
            if (!manifest[i].match(/\S/))
 
302
            if (!manifest[i].match(/\S/) || patternInName(manifest[i], hiddenFilesPatterns))
290
303
            {
291
304
              continue;
292
305
            }
302
315
          var listNode = Y.Node.create('<ul/>');
303
316
          for (var i = 0; i < results.artifacts.length; i++) {
304
317
            var artifact = results.artifacts[i];
 
318
            if (patternInName(artifact, hiddenFilesPatterns))
 
319
            {
 
320
              continue;
 
321
            }
305
322
            var itemNode = Y.Node.create('<li><a/></li>');
306
323
            itemNode.one('a').setContent(artifact.displayPath);
307
324
            // Strip static '/build/out' from relativePath