| <!-- |
| This in an HTML Import-able file that contains the definition |
| of the following elements: |
| |
| <perf-status-sk> |
| |
| To use this file import it: |
| |
| <link href="/res/imp/perf-status-sk.html" rel="import" /> |
| |
| Usage: |
| |
| <perf-status-sk></perf-status-sk> |
| |
| Properties: |
| reload: How often (in seconds) to reload the perf status. |
| --> |
| |
| <link rel="import" href="/res/imp/bower_components/iron-ajax/iron-ajax.html"> |
| <link rel="import" href="/res/common/imp/styles-sk.html"> |
| <link rel="import" href="/res/common/imp/timer-sk.html"> |
| <dom-module id="perf-status-sk"> |
| <template> |
| <style include="styles-sk"> |
| a { |
| color: var(--status-sk-main-text-color); |
| text-decoration: none; |
| text-transform: none; |
| } |
| a:hover { |
| text-decoration: underline; |
| } |
| .table { |
| width: 100%; |
| } |
| .td { |
| padding: 5px; |
| } |
| .value { |
| background-color: var(--status-sk-icon-color); |
| border-radius: 3px; |
| padding: 4px; |
| margin: 5px; |
| } |
| </style> |
| |
| <iron-ajax |
| id="status" |
| auto url="https://perf.skia.org/_/alerts/" |
| handle-as="json" |
| timeout="30000" |
| last-response="{{_perfAlerts}}"> |
| </iron-ajax> |
| <timer-sk period="[[reload]]" on-trigger="_reload"></timer-sk> |
| |
| <div class="table"> |
| <a href="https://perf.skia.org/t/?filter=cat%3AProd" target="_blank" class="tr"> |
| <div class="td">regressions</div> |
| <div class="td number"><span class="value">{{_perfAlerts.alerts}}</span></div> |
| </a> |
| </div> |
| |
| </template> |
| <script> |
| Polymer({ |
| is:"perf-status-sk", |
| |
| properties: { |
| // input |
| reload: { |
| type: Number, |
| value: 60, |
| }, |
| |
| // private |
| _perfAlerts: { |
| type: Object, |
| } |
| }, |
| |
| _reload: function() { |
| this.$.status.generateRequest(); |
| }, |
| |
| }); |
| </script> |
| </dom-module> |