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

Side by Side Diff: push/res/imp/server.html

Issue 803243002: Git hash links now go to githug compare view. (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Created 6 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!-- The <push-selection-sk> custom element declaration. 1 <!-- The <push-selection-sk> custom element declaration.
2 2
3 Presents a dialog of package choices and generates an event when the user has 3 Presents a dialog of package choices and generates an event when the user has
4 made a selection. It is a custom element used by <push-server-sk>. 4 made a selection. It is a custom element used by <push-server-sk>.
5 5
6 Attributes: 6 Attributes:
7 'choices' 7 'choices'
8 The list of packages that are available. 8 The list of packages that are available.
9 'choice' 9 'choice'
10 The selected package. 10 The selected package.
11 Events: 11 Events:
12 'change' 12 'change'
13 A 'change' event is generated when the user selects a package to push. 13 A 'change' event is generated when the user selects a package to push.
14 The change event has the following attributes: 14 The change event has the following attributes:
15 15
16 event.detail.name - The full name of the package selected. 16 event.detail.name - The full name of the package selected.
17 Methods: 17 Methods:
18 toggle() 18 toggle()
19 Toggles the visibility of the selection dialog. 19 Toggles the visibility of the selection dialog.
20 --> 20 -->
21 <style type="text/css" media="screen"> 21 <style type="text/css" media="screen">
22 html /deep/ .pushSelection { 22 html /deep/ .pushSelection {
23 font-family: monospace; 23 font-family: monospace;
24 padding: 0.5em; 24 padding: 0.5em;
25 cursor: pointer; 25 cursor: pointer;
26 } 26 }
27 html /deep/ .pushSelection:hover { 27 html /deep/ .pushSelection:hover {
28 background: #eee; 28 background: #eee;
29 } 29 }
30 html /deep/ .built {
31 color: #D95F02;
32 display:inline;
33 }
34 html /deep/ .userid {
35 color: #7570B3;
36 display:inline;
37 }
30 </style> 38 </style>
31 <polymer-element name="push-selection-sk"> 39 <polymer-element name="push-selection-sk">
32 <template> 40 <template>
33 <paper-action-dialog id=chooser heading="Choose a release package to push"> 41 <paper-action-dialog id=chooser heading="Choose a release package to push">
34 <core-selector id=newChoice> 42 <core-selector id=newChoice>
35 <template repeat="{{p in choices}}"> 43 <template repeat="{{p in choices}}">
36 <div class=pushSelection name="{{p.Name}}"> 44 <div class=pushSelection name="{{p.Name}}">
37 <core-icon icon="{{choice == p.Name ? 'check' : ''}}" title="Current ly installed"></core-icon> 45 <core-icon icon="{{choice == p.Name ? 'check' : ''}}" title="Current ly installed"></core-icon>
38 <a href="https://skia.googlesource.com/buildbot/+/{{p.Hash}}">{{p.Ha sh | shortHash}}</a> 46 <a href="https://github.com/google/skia-buildbot/compare/{{p.Hash}}. ..HEAD">{{p.Hash | short}}</a>
borenet 2014/12/16 12:33:34 FWIW this also seems to work: https://skia.googles
jcgregorio 2014/12/16 12:45:50 Right, but I don't know how far back I am from HEA
borenet 2014/12/16 12:48:32 That was just an example. You can use any refs.
jcgregorio 2014/12/16 12:52:13 Ah, OK, got it, I thought you we're talking about
39 <pre style="color: #D95F02;display:inline;"> {{p.Built | humanDiffDa te }} </pre> 47 <pre class=built> {{p.Built | humanDiffDate }} </pre>
48 <pre class=userid title="{{p.UserID}}"> {{p.UserID | short}} </pre>
40 {{p.Note}} 49 {{p.Note}}
41 <core-icon icon="{{p.Dirty ? 'warning' : ''}}" title="Uncommited cha nges when the package was built."></core-icon> 50 <core-icon icon="{{p.Dirty ? 'warning' : ''}}" title="Uncommited cha nges when the package was built."></core-icon>
42 </div> 51 </div>
43 </template> 52 </template>
44 </core-selector> 53 </core-selector>
45 <paper-button dismissive>Cancel</paper-button> 54 <paper-button dismissive>Cancel</paper-button>
46 </paper-action-dialog> 55 </paper-action-dialog>
47 </template> 56 </template>
48 <script> 57 <script>
49 (function() { 58 (function() {
(...skipping 23 matching lines...) Expand all
73 that.toggle(); 82 that.toggle();
74 var detail = {name: that.$.newChoice.selected}; 83 var detail = {name: that.$.newChoice.selected};
75 that.dispatchEvent(new CustomEvent('change', {detail: detail})); 84 that.dispatchEvent(new CustomEvent('change', {detail: detail}));
76 }); 85 });
77 }, 86 },
78 87
79 toggle: function() { 88 toggle: function() {
80 this.$.chooser.toggle(); 89 this.$.chooser.toggle();
81 }, 90 },
82 91
83 // shortHash is a utility function used in templates to truncate git has hes. 92 // short is a utility function used in templates to truncate strings.
84 shortHash: function(s) { 93 short: function(s) {
85 return s.slice(0, 8); 94 return s.slice(0, 8);
86 }, 95 },
borenet 2014/12/16 12:33:34 What's in a user id? If it's an email address, may
jcgregorio 2014/12/16 12:45:51 They are just email addresses, but I'm being lazy
borenet 2014/12/16 12:48:32 SGTM
87 96
88 humanDiffDate: function(s) { 97 humanDiffDate: function(s) {
89 var diff = (Date.now() - Date.parse(s))/1000; 98 var diff = (Date.now() - Date.parse(s))/1000;
90 for (var i=0; i<deltas.length; i++) { 99 for (var i=0; i<deltas.length; i++) {
91 if (deltas[i].delta < diff) { 100 if (deltas[i].delta < diff) {
92 var s = Math.round(diff/deltas[i].delta)+deltas[i].units; 101 var s = Math.round(diff/deltas[i].delta)+deltas[i].units;
93 while (s.length < 4) { 102 while (s.length < 4) {
94 s = ' ' + s; 103 s = ' ' + s;
95 } 104 }
96 return s; 105 return s;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 <template repeat="{{server in servers}}"> 206 <template repeat="{{server in servers}}">
198 <section> 207 <section>
199 <h2>{{server.Name}}</h2> [<a target=_blank href="http://{{ip[server.Name ]}}:10114">monit</a>] [<a target=_blank href="http://{{ip[server.Name]}}:10115"> logs</a>] 208 <h2>{{server.Name}}</h2> [<a target=_blank href="http://{{ip[server.Name ]}}:10114">monit</a>] [<a target=_blank href="http://{{ip[server.Name]}}:10115"> logs</a>]
200 <table> 209 <table>
201 <template repeat="{{id in server.Installed}}"> 210 <template repeat="{{id in server.Installed}}">
202 <tr> 211 <tr>
203 <td> 212 <td>
204 <paper-button class=application data-server="{{server.Name}}" data -name="{{id}}" data-app="{{id | prefixOf}}"><core-icon icon="create" title="Edit which package is installed."></core-icon></paper-button> 213 <paper-button class=application data-server="{{server.Name}}" data -name="{{id}}" data-app="{{id | prefixOf}}"><core-icon icon="create" title="Edit which package is installed."></core-icon></paper-button>
205 </td> 214 </td>
206 <td><span class=appName>{{id | prefixOf}}</span></td> 215 <td><span class=appName>{{id | prefixOf}}</span></td>
207 <td><span class=appName><a href="https://skia.googlesource.com/build bot/+/{{id | fullHash}}">{{id | shortHash}}</a></span></td> 216 <td><span class=appName><a href="https://github.com/google/skia-buil dbot/compare/{{id | fullHash}}...HEAD">{{id | short}}</a></span></td>
208 <td><core-icon icon="{{packageLookup[id].Latest ? '' : 'alarm'}}" ti tle="Out of date."></core-icon></td> 217 <td><core-icon icon="{{packageLookup[id].Latest ? '' : 'alarm'}}" ti tle="Out of date."></core-icon></td>
209 <td><core-icon icon="{{packageLookup[id].Dirty ? 'warning' : ''}}" t itle="Uncommited changes when the package was built."></core-icon></td> 218 <td><core-icon icon="{{packageLookup[id].Dirty ? 'warning' : ''}}" t itle="Uncommited changes when the package was built."></core-icon></td>
210 </tr> 219 </tr>
211 </template> 220 </template>
212 </table> 221 </table>
213 </section> 222 </section>
214 </template> 223 </template>
215 <push-selection-sk id=extChooser></push-selection-sk> 224 <push-selection-sk id=extChooser></push-selection-sk>
216 </template> 225 </template>
217 <script> 226 <script>
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 prefixOf: function(s) { 302 prefixOf: function(s) {
294 return s.split('/')[0]; 303 return s.split('/')[0];
295 }, 304 },
296 305
297 // fullHash is a utility function used in templates to extract the full gi t hash 306 // fullHash is a utility function used in templates to extract the full gi t hash
298 // from a package name. 307 // from a package name.
299 fullHash: function(s) { 308 fullHash: function(s) {
300 return s.slice(s.length-44, s.length-4) 309 return s.slice(s.length-44, s.length-4)
301 }, 310 },
302 311
303 // shortHash is a utility function used in templates to truncate git hashe s. 312 // short is a utility function used in templates to truncate strings.
304 shortHash: function(s) { 313 short: function(s) {
305 return this.fullHash(s).slice(0, 6); 314 return this.fullHash(s).slice(0, 6);
306 }, 315 },
307 316
317
308 }); 318 });
309 </script> 319 </script>
310 </polymer-element> 320 </polymer-element>
311 321
312 322
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698