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

Side by Side Diff: gm/rebaseline_server/static/loader.js

Issue 117453002: rebaseline_server: return rebaseline results faster, and reload UI page automatically after (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 7 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 | « gm/rebaseline_server/server.py ('k') | 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 /* 1 /*
2 * Loader: 2 * Loader:
3 * Reads GM result reports written out by results.py, and imports 3 * Reads GM result reports written out by results.py, and imports
4 * them into $scope.categories and $scope.testData . 4 * them into $scope.categories and $scope.testData .
5 */ 5 */
6 var Loader = angular.module( 6 var Loader = angular.module(
7 'Loader', 7 'Loader',
8 [] 8 []
9 ); 9 );
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 /** 49 /**
50 * On initial page load, load a full dictionary of results. 50 * On initial page load, load a full dictionary of results.
51 * Once the dictionary is loaded, unhide the page elements so they can 51 * Once the dictionary is loaded, unhide the page elements so they can
52 * render the data. 52 * render the data.
53 */ 53 */
54 $http.get("/results/" + $scope.resultsToLoad).success( 54 $http.get("/results/" + $scope.resultsToLoad).success(
55 function(data, status, header, config) { 55 function(data, status, header, config) {
56 if (data.header.resultsStillLoading) { 56 if (data.header.resultsStillLoading) {
57 $scope.loadingMessage = 57 $scope.loadingMessage =
58 "Server is still loading initial results; will retry at " + 58 "Server is still loading results; will retry at " +
59 $scope.localTimeString(data.header.timeNextUpdateAvailable); 59 $scope.localTimeString(data.header.timeNextUpdateAvailable);
60 $timeout( 60 $timeout(
61 function(){location.reload();}, 61 function(){location.reload();},
62 (data.header.timeNextUpdateAvailable * 1000) - new Date().getTime( )); 62 (data.header.timeNextUpdateAvailable * 1000) - new Date().getTime( ));
63 } else { 63 } else {
64 $scope.loadingMessage = "Processing data, please wait..."; 64 $scope.loadingMessage = "Processing data, please wait...";
65 65
66 $scope.header = data.header; 66 $scope.header = data.header;
67 $scope.categories = data.categories; 67 $scope.categories = data.categories;
68 $scope.testData = data.testData; 68 $scope.testData = data.testData;
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 var itemIndicesToMove = []; 501 var itemIndicesToMove = [];
502 for (var i = 0; i < testDataSubset.length; i++) { 502 for (var i = 0; i < testDataSubset.length; i++) {
503 itemIndicesToMove.push(testDataSubset[i].index); 503 itemIndicesToMove.push(testDataSubset[i].index);
504 } 504 }
505 $scope.moveItemsToTab(itemIndicesToMove, 505 $scope.moveItemsToTab(itemIndicesToMove,
506 "HackToMakeSureThisItemDisappears"); 506 "HackToMakeSureThisItemDisappears");
507 $scope.updateResults(); 507 $scope.updateResults();
508 alert("New baselines submitted successfully!\n\n" + 508 alert("New baselines submitted successfully!\n\n" +
509 "You still need to commit the updated expectations files on " + 509 "You still need to commit the updated expectations files on " +
510 "the server side to the Skia repo.\n\n" + 510 "the server side to the Skia repo.\n\n" +
511 "Also: in order to see the complete updated data, or to submit " + 511 "When you click OK, your web UI will reload; after that " +
512 "more baselines, you will need to reload your client."); 512 "completes, you will see the updated data (once the server has " +
513 $scope.submitPending = false; 513 "finished loading the update results into memory!) and you can " +
514 "submit more baselines if you want.");
515 // I don't know why, but if I just call reload() here it doesn't work.
516 // Making a timer call it fixes the problem.
517 $timeout(function(){location.reload();}, 1);
514 }).error(function(data, status, headers, config) { 518 }).error(function(data, status, headers, config) {
515 alert("There was an error submitting your baselines.\n\n" + 519 alert("There was an error submitting your baselines.\n\n" +
516 "Please see server-side log for details."); 520 "Please see server-side log for details.");
517 $scope.submitPending = false; 521 $scope.submitPending = false;
518 }); 522 });
519 } 523 }
520 524
521 525
522 // 526 //
523 // Operations we use to mimic Set semantics, in such a way that 527 // Operations we use to mimic Set semantics, in such a way that
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 * 614 *
611 * @param secondsPastEpoch (numeric): seconds past epoch in UTC 615 * @param secondsPastEpoch (numeric): seconds past epoch in UTC
612 */ 616 */
613 $scope.localTimeString = function(secondsPastEpoch) { 617 $scope.localTimeString = function(secondsPastEpoch) {
614 var d = new Date(secondsPastEpoch * 1000); 618 var d = new Date(secondsPastEpoch * 1000);
615 return d.toString(); 619 return d.toString();
616 } 620 }
617 621
618 } 622 }
619 ); 623 );
OLDNEW
« no previous file with comments | « gm/rebaseline_server/server.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698