| <!-- |
| The common.js file must be included before this file. |
| |
| This in an HTML Import-able file that contains the definition |
| of the following elements: |
| |
| <fuzzer-summary-sk> |
| <fuzzer-tile> |
| |
| This element will request once from /json/fuzz-summary for the fuzz contents to display, which will be an array of FileDetails. |
| See fuzzer-collapse-file-sk.html for more information. |
| |
| To use this file import it: |
| |
| <link href="/res/imp/fuzzer-summary-sk.html" rel="import" /> |
| |
| Usage: |
| |
| <fuzzer-summary-sk></fuzzer-summary-sk> |
| |
| Properties: |
| None. |
| |
| Methods: |
| None. |
| |
| Events: |
| None. |
| --> |
| <link rel="import" href="/res/imp/bower_components/iron-ajax/iron-ajax.html"> |
| <link rel="import" href="/res/imp/bower_components/iron-flex-layout/iron-flex-layout-classes.html"> |
| |
| <dom-module id="fuzzer-summary-sk"> |
| <template> |
| <style include="iron-flex iron-flex-alignment"> |
| .summaryBox { |
| max-width: inherit; |
| } |
| </style> |
| <iron-ajax auto url="/json/fuzz-summary" handle-as="json" last-response="{{fuzzers}}"></iron-ajax> |
| <h2>Stable Fuzzers</h2> |
| <div class="summaryBox" class="horizontal layout wrap around-justified"> |
| <template is="dom-repeat" items="[[stable_fuzzers]]" as="fuzzer"> |
| <fuzzer-tile fuzzer=[[fuzzer]]></fuzzer-tile> |
| </template> |
| </div> |
| <h2>Experimental Fuzzers</h2> |
| <div class="summaryBox" class="horizontal layout wrap around-justified"> |
| <template is="dom-repeat" items="[[experimental_fuzzers]]" as="fuzzer"> |
| <fuzzer-tile fuzzer=[[fuzzer]]></fuzzer-tile> |
| </template> |
| </div> |
| </template> |
| <script> |
| Polymer({ |
| is: 'fuzzer-summary-sk', |
| |
| properties: { |
| fuzzers: { |
| type: Array, |
| value: function() { |
| return []; |
| } |
| }, |
| |
| experimental_fuzzers: { |
| type: Array, |
| computed: "experimental(fuzzers)", |
| }, |
| stable_fuzzers: { |
| type: Array, |
| computed: "stable(fuzzers)", |
| }, |
| }, |
| |
| experimental: function(fuzzers) { |
| fuzzers = fuzzers || []; |
| return fuzzers.filter(function(f){ |
| return f.status === "experimental"; |
| }); |
| }, |
| |
| stable: function(fuzzers) { |
| fuzzers = fuzzers || []; |
| return fuzzers.filter(function(f){ |
| return f.status === "stable"; |
| }); |
| }, |
| |
| }); |
| </script> |
| </dom-module> |
| |
| |
| <dom-module id="fuzzer-tile"> |
| <template> |
| <style> |
| :host { |
| margin: 5px; |
| } |
| /* This aligns the 4 counts in a nice grid structure, with the fuzz type as a header. */ |
| .countBox { |
| border: 1px solid black; |
| padding: 5px; |
| border-radius: 8px; |
| display: table-cell; |
| } |
| .countRow { |
| display: table-row; |
| } |
| .cell { |
| display: table-cell; |
| padding: 1px 5px; |
| } |
| .header { |
| text-align: center; |
| padding: 1px; |
| font-size: 1.3em; |
| } |
| .subheader { |
| text-align: center; |
| padding: 1px; |
| font-size: 1.0em; |
| } |
| </style> |
| <span class="countBox"> |
| <div class="header"> |
| <a href$="[[getLink(fuzzer)]]">[[fuzzer.categoryDisplay]]</a> |
| </div> |
| <div class="subheader">Groomer: [[fuzzer.groomer]]</div> |
| <div class="countRow"> |
| <span class="cell">New Bad Fuzzes: [[fuzzer.thisBadCount]]</span> |
| <span class="cell">Regressed Fuzzes: [[fuzzer.thisRegressionCount]]</span> |
| </div> |
| <div class="countRow"> |
| <span class="cell">Total Bad Fuzzes: [[fuzzer.totalBadCount]]</span> |
| <span class="cell">Total Grey Fuzzes: [[fuzzer.totalGreyCount]]</span> |
| </div> |
| </span> |
| </template> |
| <script> |
| Polymer({ |
| is: 'fuzzer-tile', |
| properties: { |
| fuzzer: { |
| type: Object, |
| }, |
| }, |
| getLink: function(fuzzer){ |
| return "/category/"+fuzzer.category; |
| }, |
| }); |
| </script> |
| </dom-module> |