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

Side by Side Diff: Tools/GardeningServer/model/tree-status.html

Issue 728023004: Remove GardeningServer. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 <!--
2 Copyright 2014 The Chromium Authors. All rights reserved.
3 Use of this source code is governed by a BSD-style license that can be
4 found in the LICENSE file.
5 -->
6
7 <link rel="import" href="../lib/net.html">
8
9 <script>
10 function TreeStatus(project) {
11 this.project = project;
12 this.message = '';
13 this.status = 'unknown';
14
15 this.url = "https://{1}-status.appspot.com/".assign(project);
16 }
17
18 TreeStatus.prototype.update = function() {
19 var url = this.url + 'current?format=json';
20 return net.json(url).then(function(response) {
21 this.updateStatus(response);
22 }.bind(this));
23 };
24
25 TreeStatus.prototype.updateStatus = function(status) {
26 if (status.can_commit_freely) {
27 this.message = null;
28 this.status = 'open';
29 return;
30 }
31
32 this.message = status.message + ' by ' + status.username;
33 var responseLowerCase = status.message.toLowerCase();
34 if (responseLowerCase.indexOf('throttled') != -1) {
35 this.status = 'throttled';
36 } else if (responseLowerCase.indexOf("closed") != -1) {
37 this.status = 'closed';
38 } else {
39 this.status = 'unknown';
40 }
41 };
42 </script>
OLDNEW
« no previous file with comments | « Tools/GardeningServer/model/test/tree-status-tests.html ('k') | Tools/GardeningServer/package.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698