You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by sk...@apache.org on 2013/08/12 22:24:38 UTC
svn commit: r1513244 - in /incubator/climate/trunk/rcmet/src/main/ui/app:
js/controllers/ResultCtrl.js js/controllers/ResultDetailCtrl.js
partials/results.detail.html partials/results.list.html
Author: skhudiky
Date: Mon Aug 12 20:24:37 2013
New Revision: 1513244
URL: http://svn.apache.org/r1513244
Log:
CLIMATE-249 - Add results/history page
Added:
incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ResultDetailCtrl.js
incubator/climate/trunk/rcmet/src/main/ui/app/partials/results.detail.html
incubator/climate/trunk/rcmet/src/main/ui/app/partials/results.list.html
Modified:
incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ResultCtrl.js
Modified: incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ResultCtrl.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ResultCtrl.js?rev=1513244&r1=1513243&r2=1513244&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ResultCtrl.js (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ResultCtrl.js Mon Aug 12 20:24:37 2013
@@ -21,10 +21,14 @@
App.Controllers.controller('ResultCtrl', ['$rootScope', '$scope', '$http',
function($rootScope, $scope, $http) {
- // Grab all figures
- $scope.figures = [];
- $http.jsonp($rootScope.baseURL + '/getResultDirInfo?callback=JSON_CALLBACK').
- success(function(data) {
- $scope.figures = data;
- });
+ $scope.results = [];
+
+ // Get all evaluation directories
+ $http.jsonp($rootScope.baseURL + '/getResultDirInfo?callback=JSON_CALLBACK')
+ .success(function(data) {
+ var removeItem = "/cache";
+ data.splice( $.inArray(removeItem,data) ,1 );
+ $scope.results = data.sort().reverse();
+ });
+
}]);
Added: incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ResultDetailCtrl.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ResultDetailCtrl.js?rev=1513244&view=auto
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ResultDetailCtrl.js (added)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ResultDetailCtrl.js Mon Aug 12 20:24:37 2013
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http: *www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+**/
+
+// Controller for result page
+App.Controllers.controller('ResultDetailCtrl', ['$rootScope', '$scope', '$http', '$stateParams',
+function($rootScope, $scope, $http, $stateParams) {
+
+ // Grab all figures
+ $scope.result = $stateParams.resultId;
+
+ $http.jsonp($rootScope.baseURL + '/getResults//' + $scope.result + '?callback=JSON_CALLBACK')
+ .success(function(data) {
+ if (data.length < 1){
+ $scope.figures = null;
+ $scope.alertMessage = "No results found.";
+ $scope.alertClass = "alert alert-danger";
+ } else {
+ $scope.figures = data;
+ }
+ });
+
+}]);
Added: incubator/climate/trunk/rcmet/src/main/ui/app/partials/results.detail.html
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/partials/results.detail.html?rev=1513244&view=auto
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/partials/results.detail.html (added)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/partials/results.detail.html Mon Aug 12 20:24:37 2013
@@ -0,0 +1,11 @@
+<div>
+ <h2>{{result}}</h2>
+ <div class="row-fluid text-center">
+ <div class="{{alertClass}}">{{alertMessage}}</div>
+ <ul>
+ <li ng-repeat="figure in figures">
+ <img class="result-figures" ng-src="{{baseURL}}/static/evalResults{{figure}}" alt="" />
+ </li>
+ </ul>
+ </div>
+</div>
Added: incubator/climate/trunk/rcmet/src/main/ui/app/partials/results.list.html
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/partials/results.list.html?rev=1513244&view=auto
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/partials/results.list.html (added)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/partials/results.list.html Mon Aug 12 20:24:37 2013
@@ -0,0 +1,8 @@
+<h4>Select one of your previous run. If none are displayed, go to the main page and start one!</h4>
+<ul>
+ <li ng-repeat="result in results"
+ ng-class="{ active: $state.includes('results.detail') && $stateParams.resultId == result }">
+ <a href="#/results/{{result.replace('/', '')}}" >{{result}}</a>
+ </li>
+</ul>
+