OLD | NEW |
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.extraColumnHeaders and $scope.imagePairs . | 4 * them into $scope.extraColumnHeaders and $scope.imagePairs . |
5 */ | 5 */ |
6 var Loader = angular.module( | 6 var Loader = angular.module( |
7 'Loader', | 7 'Loader', |
8 ['ConstantsModule'] | 8 ['ConstantsModule'] |
9 ); | 9 ); |
10 | 10 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 } | 120 } |
121 ); | 121 ); |
122 | 122 |
123 | 123 |
124 Loader.controller( | 124 Loader.controller( |
125 'Loader.Controller', | 125 'Loader.Controller', |
126 function($scope, $http, $filter, $location, $log, $timeout, constants) { | 126 function($scope, $http, $filter, $location, $log, $timeout, constants) { |
127 $scope.readyToDisplay = false; | 127 $scope.readyToDisplay = false; |
128 $scope.constants = constants; | 128 $scope.constants = constants; |
129 $scope.windowTitle = "Loading GM Results..."; | 129 $scope.windowTitle = "Loading GM Results..."; |
130 $scope.resultsToLoad = $location.search().resultsToLoad; | 130 $scope.actualsDir = $location.search().actualsDir; |
| 131 $scope.expectationsDir = $location.search().expectationsDir; |
131 $scope.loadingMessage = "please wait..."; | 132 $scope.loadingMessage = "please wait..."; |
132 | 133 |
133 /** | 134 /** |
134 * On initial page load, load a full dictionary of results. | 135 * On initial page load, load a full dictionary of results. |
135 * Once the dictionary is loaded, unhide the page elements so they can | 136 * Once the dictionary is loaded, unhide the page elements so they can |
136 * render the data. | 137 * render the data. |
137 */ | 138 */ |
138 $http.get($scope.resultsToLoad).success( | 139 var liveQueryUrl = |
| 140 "/live-results/actualsDir=" + encodeURIComponent($scope.actualsDir) + |
| 141 "&expectationsDir=" + encodeURIComponent($scope.expectationsDir); |
| 142 $http.get(liveQueryUrl).success( |
139 function(data, status, header, config) { | 143 function(data, status, header, config) { |
140 var dataHeader = data[constants.KEY__ROOT__HEADER]; | 144 var dataHeader = data[constants.KEY__ROOT__HEADER]; |
141 if (dataHeader[constants.KEY__HEADER__SCHEMA_VERSION] != | 145 if (dataHeader[constants.KEY__HEADER__SCHEMA_VERSION] != |
142 constants.VALUE__HEADER__SCHEMA_VERSION) { | 146 constants.VALUE__HEADER__SCHEMA_VERSION) { |
143 $scope.loadingMessage = "ERROR: Got JSON file with schema version " | 147 $scope.loadingMessage = "ERROR: Got JSON file with schema version " |
144 + dataHeader[constants.KEY__HEADER__SCHEMA_VERSION] | 148 + dataHeader[constants.KEY__HEADER__SCHEMA_VERSION] |
145 + " but expected schema version " | 149 + " but expected schema version " |
146 + constants.VALUE__HEADER__SCHEMA_VERSION; | 150 + constants.VALUE__HEADER__SCHEMA_VERSION; |
147 } else if (dataHeader[constants.KEY__HEADER__IS_STILL_LOADING]) { | 151 } else if (dataHeader[constants.KEY__HEADER__IS_STILL_LOADING]) { |
148 // Apply the server's requested reload delay to local time, | 152 // Apply the server's requested reload delay to local time, |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 244 |
241 // TODO(epoger): Special handling for RESULT_TYPE column: | 245 // TODO(epoger): Special handling for RESULT_TYPE column: |
242 // by default, show only KEY__RESULT_TYPE__FAILED results | 246 // by default, show only KEY__RESULT_TYPE__FAILED results |
243 $scope.showingColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE] =
{}; | 247 $scope.showingColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE] =
{}; |
244 $scope.showingColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE][ | 248 $scope.showingColumnValues[constants.KEY__EXTRACOLUMNS__RESULT_TYPE][ |
245 constants.KEY__RESULT_TYPE__FAILED] = true; | 249 constants.KEY__RESULT_TYPE__FAILED] = true; |
246 | 250 |
247 // Set up mapping for URL parameters. | 251 // Set up mapping for URL parameters. |
248 // parameter name -> copier object to load/save parameter value | 252 // parameter name -> copier object to load/save parameter value |
249 $scope.queryParameters.map = { | 253 $scope.queryParameters.map = { |
250 'resultsToLoad': $scope.queryParameters.copiers.simple, | 254 'actualsDir': $scope.queryParameters.copiers.simple, |
| 255 'expectationsDir': $scope.queryParameters.copiers.simple, |
251 'displayLimitPending': $scope.queryParameters.copiers.simple, | 256 'displayLimitPending': $scope.queryParameters.copiers.simple, |
252 'showThumbnailsPending': $scope.queryParameters.copiers.simple, | 257 'showThumbnailsPending': $scope.queryParameters.copiers.simple, |
253 'mergeIdenticalRowsPending': $scope.queryParameters.copiers.simple, | 258 'mergeIdenticalRowsPending': $scope.queryParameters.copiers.simple, |
254 'imageSizePending': $scope.queryParameters.copiers.simple, | 259 'imageSizePending': $scope.queryParameters.copiers.simple, |
255 'sortColumnSubdict': $scope.queryParameters.copiers.simple, | 260 'sortColumnSubdict': $scope.queryParameters.copiers.simple, |
256 'sortColumnKey': $scope.queryParameters.copiers.simple, | 261 'sortColumnKey': $scope.queryParameters.copiers.simple, |
257 }; | 262 }; |
258 // Some parameters are handled differently based on whether they USE_F
REEFORM_FILTER. | 263 // Some parameters are handled differently based on whether they USE_F
REEFORM_FILTER. |
259 angular.forEach( | 264 angular.forEach( |
260 $scope.filterableColumnNames, | 265 $scope.filterableColumnNames, |
(...skipping 14 matching lines...) Expand all Loading... |
275 | 280 |
276 // Any image URLs which are relative should be relative to the JSON | 281 // Any image URLs which are relative should be relative to the JSON |
277 // file's source directory; absolute URLs should be left alone. | 282 // file's source directory; absolute URLs should be left alone. |
278 var baseUrlKey = constants.KEY__IMAGESETS__FIELD__BASE_URL; | 283 var baseUrlKey = constants.KEY__IMAGESETS__FIELD__BASE_URL; |
279 angular.forEach( | 284 angular.forEach( |
280 $scope.imageSets, | 285 $scope.imageSets, |
281 function(imageSet) { | 286 function(imageSet) { |
282 var baseUrl = imageSet[baseUrlKey]; | 287 var baseUrl = imageSet[baseUrlKey]; |
283 if ((baseUrl.substring(0, 1) != '/') && | 288 if ((baseUrl.substring(0, 1) != '/') && |
284 (baseUrl.indexOf('://') == -1)) { | 289 (baseUrl.indexOf('://') == -1)) { |
285 imageSet[baseUrlKey] = $scope.resultsToLoad + '/../' + baseUrl; | 290 imageSet[baseUrlKey] = '/' + baseUrl; |
286 } | 291 } |
287 } | 292 } |
288 ); | 293 ); |
289 | 294 |
290 $scope.readyToDisplay = true; | 295 $scope.readyToDisplay = true; |
291 $scope.updateResults(); | 296 $scope.updateResults(); |
292 $scope.loadingMessage = ""; | 297 $scope.loadingMessage = ""; |
293 $scope.windowTitle = "Current GM Results"; | 298 $scope.windowTitle = "Current GM Results"; |
294 } | 299 } |
295 } | 300 } |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 */ | 1022 */ |
1018 $scope.getImageDiffRelativeUrl = function(imagePair) { | 1023 $scope.getImageDiffRelativeUrl = function(imagePair) { |
1019 var before = | 1024 var before = |
1020 imagePair[constants.KEY__IMAGEPAIRS__IMAGE_A_URL] + "-vs-" + | 1025 imagePair[constants.KEY__IMAGEPAIRS__IMAGE_A_URL] + "-vs-" + |
1021 imagePair[constants.KEY__IMAGEPAIRS__IMAGE_B_URL]; | 1026 imagePair[constants.KEY__IMAGEPAIRS__IMAGE_B_URL]; |
1022 return before.replace(/[^\w\-]/g, "_") + ".png"; | 1027 return before.replace(/[^\w\-]/g, "_") + ".png"; |
1023 } | 1028 } |
1024 | 1029 |
1025 } | 1030 } |
1026 ); | 1031 ); |
OLD | NEW |