Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1575)

Unified Diff: status/res/imp/autoroll-widget-sk.html

Issue 1171823005: Add autoroll package, alerts for failed rolls, recent rolls on Status (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Address comments Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « status/go/status/main.go ('k') | status/templates/commits.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: status/res/imp/autoroll-widget-sk.html
diff --git a/status/res/imp/autoroll-widget-sk.html b/status/res/imp/autoroll-widget-sk.html
index 79744349728f84bfc744a39c702e87c74baada6b..ce229a42848309039c62e97f543671099213b1db 100644
--- a/status/res/imp/autoroll-widget-sk.html
+++ b/status/res/imp/autoroll-widget-sk.html
@@ -23,6 +23,13 @@
:host {
width: 180px;
}
+ a {
+ color: inherit;
+ text-decoration: none;
+ }
+ a:hover {
+ text-decoration: underline;
+ }
#statusIndicator /deep/ core-icon{
color: #E6AB02;
}
@@ -34,6 +41,28 @@
text-align: left;
padding: 10px;
}
+ table.rollHistory {
+ border-collapse: collapse;
+ }
+ table.rollHistory /deep/ td {
+ padding: 5px;
+ }
+ table.rollHistory /deep/ th {
+ background-color: #EEEEEE;
+ font-weight: normal;
+ font-size: 1.1em;
+ padding: 8px;
+ text-align:center;
+ }
+ tr.success {
+ background-color: #D1E4BC;
+ }
+ tr.failure {
+ background-color: #D95F02;
+ }
+ tr.inprogress {
+ background-color: #FFFF00;
+ }
</style>
<core-icon-button
id="statusIndicator"
@@ -82,12 +111,32 @@
</td>
</tr>
<tr>
+ <td>Recent:</td>
+ <td>
+ <table class="rollHistory">
+ <tr>
+ <th>Roll</th>
+ <th>Status</th>
+ <th>Last Modified</th>
+ </tr>
+ <template repeat="{{roll in recent}}">
+ <tr class="{{roll.Closed ? (roll.Committed ? 'success' : 'failure') : 'inprogress'}}">
+ <td><a href="https://codereview.chromium.org/{{roll.Issue}}" target="_blank">{{roll.Issue}}</a></td>
+ <td>{{roll.Closed ? (roll.Committed ? 'Succeeded' : 'Failed') : 'In progress'}}</td>
+ <td>{{roll.Modified|readableDate}}</td>
+ </tr>
+ </template>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>Full History:</td>
<td>
<a href="https://codereview.chromium.org/user/skia-deps-roller" target="_blank">
- Uploaded Roll CLs on Rietveld
+ https://codereview.chromium.org/user/skia-deps-roller
</a>
</td>
- <tr>
+ </tr>
</table>
</paper-shadow>
</paper-dropdown>
@@ -102,12 +151,15 @@
},
created: function() {
+ this.recent = null;
+ this.recentTimeout = null;
this.status = null;
- this.timeout = null;
+ this.statusTimeout = null;
},
ready: function() {
this.reloadStatus();
+ this.reloadRecent();
},
toggle: function() {
@@ -118,35 +170,65 @@
},
reloadChanged: function() {
- this.resetTimeout();
+ this.resetRecentTimeout();
+ this.resetStatusTimeout();
+ },
+
+ resetRecentTimeout: function() {
+ if (this.recentTimeout) {
+ window.clearTimeout(this.recentTimeout);
+ }
+ if (this.reload > 0) {
+ var that = this;
+ this.recentTimeout = window.setTimeout(function() { that.reloadRecent(); }, this.reload * 1000);
+ }
},
- resetTimeout: function() {
- if (this.timeout) {
- window.clearTimeout(this.timeout);
+ resetStatusTimeout: function() {
+ if (this.statusTimeout) {
+ window.clearTimeout(this.statusTimeout);
}
if (this.reload > 0) {
var that = this;
- this.timeout = window.setTimeout(function() { that.reloadStatus(); }, this.reload * 1000);
+ this.statusTimeout = window.setTimeout(function() { that.reloadStatus(); }, this.reload * 1000);
}
},
+ updateRecent: function(recent) {
+ this.recent = recent;
+ this.dispatchEvent(new CustomEvent("change", {
+ detail: {
+ recent: this.recent,
+ }
+ }));
+ },
+
updateStatus: function(status) {
this.status = status;
this.dispatchEvent(new CustomEvent("change", {
detail: {
status: this.status,
}
- }))
+ }));
+ },
+
+ reloadRecent: function() {
+ var that = this;
+ sk.get("/json/autoRoll").then(JSON.parse).then(function(json) {
+ that.updateRecent(json.reverse());
+ that.resetRecentTimeout();
+ }).catch(function() {
+ that.resetRecentTimeout();
+ });
},
reloadStatus: function() {
var that = this;
sk.get("https://skia-tree-status.appspot.com/get_arb_status").then(JSON.parse).then(function(json) {
that.updateStatus(json);
- that.resetTimeout();
+ that.resetStatusTimeout();
}).catch(function() {
- that.resetTimeout();
+ that.resetStatusTimeout();
});
},
@@ -156,6 +238,11 @@
}
return commit;
},
+
+ readableDate: function(d) {
+ var rv = new Date(d);
+ return rv.toLocaleDateString() + ", " + rv.toLocaleTimeString();
+ },
});
</script>
</polymer-element>
« no previous file with comments | « status/go/status/main.go ('k') | status/templates/commits.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698