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

Side by Side Diff: appengine_apps/trooper_o_matic/model/json-graph-data.html

Issue 774323002: Moved trooper_o_matic to appengine/ (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@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
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 JSONGraphData(url) {
11 this.rowItemsAvailable = false;
12 this._url = url;
13 this._formattedDataCache = null;
14 }
15
16 JSONGraphData.prototype.get = function() {
17 if (this._formattedDataCache) {
18 return Promise.resolve(this._formattedDataCache);
19 }
20 var self = this;
21 return net.json({url: this._url}).then(function(data) {
22 // Convert timestamps to Date objects.
23 data.rows.forEach(function(row) {
24 row[0] = new Date(row[0] * 1000);
25 });
26 self._formattedDataCache = data;
27 return data;
28 });
29 };
30 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698