You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aurora.apache.org by ma...@apache.org on 2014/04/05 02:04:51 UTC

[05/50] [abbrv] git commit: Merged error and errorMsg into one field in the UI.

Merged error and errorMsg into one field in the UI.


Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/4c0e6e1e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/4c0e6e1e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/4c0e6e1e

Branch: refs/heads/mansu/job_page
Commit: 4c0e6e1e1885a1795c7e90f978f213694d23ecef
Parents: 7aecc4c
Author: Suman Karumuri <sk...@twitter.com>
Authored: Wed Mar 26 15:29:30 2014 -0700
Committer: Suman Karumuri <sk...@twitter.com>
Committed: Wed Mar 26 15:29:30 2014 -0700

----------------------------------------------------------------------
 .../org/apache/aurora/scheduler/http/ui/error.html |  2 +-
 .../org/apache/aurora/scheduler/http/ui/home.html  |  4 ++--
 .../aurora/scheduler/http/ui/js/controllers.js     | 17 +++++++----------
 .../org/apache/aurora/scheduler/http/ui/role.html  |  8 ++++----
 4 files changed, 14 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/4c0e6e1e/src/main/resources/org/apache/aurora/scheduler/http/ui/error.html
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/http/ui/error.html b/src/main/resources/org/apache/aurora/scheduler/http/ui/error.html
index 96aee3e..96dcf11 100644
--- a/src/main/resources/org/apache/aurora/scheduler/http/ui/error.html
+++ b/src/main/resources/org/apache/aurora/scheduler/http/ui/error.html
@@ -3,5 +3,5 @@
     An error occurred when querying the server. Please reload this page.
   </p>
 
-  <p class='text-center text-warning'>{{errorMsg}}</p>
+  <p class='text-center text-warning'>{{error}}</p>
 </div>

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/4c0e6e1e/src/main/resources/org/apache/aurora/scheduler/http/ui/home.html
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/http/ui/home.html b/src/main/resources/org/apache/aurora/scheduler/http/ui/home.html
index 1864206..d367b81 100644
--- a/src/main/resources/org/apache/aurora/scheduler/http/ui/home.html
+++ b/src/main/resources/org/apache/aurora/scheduler/http/ui/home.html
@@ -1,9 +1,9 @@
 <div>
-  <div ng-show='{{error}}'>
+  <div ng-show='error'>
     <error/>
   </div>
 
-  <div ng-hide='{{error}}'>
+  <div ng-hide='error'>
     <div>
       <breadcrumb/>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/4c0e6e1e/src/main/resources/org/apache/aurora/scheduler/http/ui/js/controllers.js
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/http/ui/js/controllers.js b/src/main/resources/org/apache/aurora/scheduler/http/ui/js/controllers.js
index e744f37..4853a75 100644
--- a/src/main/resources/org/apache/aurora/scheduler/http/ui/js/controllers.js
+++ b/src/main/resources/org/apache/aurora/scheduler/http/ui/js/controllers.js
@@ -4,7 +4,6 @@
 
 var auroraUIControllers = angular.module('auroraUI.controllers', []);
 
-
 var globalTableConfig = {
   isGlobalSearchActivated: true,
   isPaginationEnabled: true,
@@ -18,7 +17,6 @@ auroraUIControllers.controller('RoleSummaryController',
     $scope.title = 'Scheduled Jobs Summary';
 
     $scope.error = false;
-    $scope.errorMsg = '';
 
     $scope.roleSummaryColumns = [
       {label: 'Role', map: 'role', cellTemplateUrl: 'roleLink.html'},
@@ -29,8 +27,11 @@ auroraUIControllers.controller('RoleSummaryController',
     $scope.roleSummaries = parseResponse(auroraClient.getRoleSummary());
 
     function parseResponse(response) {
-      $scope.error = response.error;
-      $scope.errorMsg = response.errorMsg;
+      $scope.error = response.error ? 'Error requesting role summary: ' + response.errorMsg : '';
+
+      if ($scope.error) {
+        return [];
+      }
 
       // Not the best way to set the page title, but this works on all browsers.
       $window.document.title = response.pageTitle;
@@ -57,7 +58,6 @@ auroraUIControllers.controller('JobSummaryController',
     $scope.environment = $routeParams.environment;
 
     $scope.error = false;
-    $scope.errorMsg = '';
 
     var showResourcesMsg = 'Show Resource Consumption';
     var hideResourcesMsg = 'Hide Resource Consumption';
@@ -104,8 +104,7 @@ auroraUIControllers.controller('JobSummaryController',
 
     function getJobs() {
       var summaries = auroraClient.getJobSummary($scope.role);
-      $scope.error = summaries.error;
-      $scope.errorMsg = summaries.errorMsg;
+      $scope.error = summaries.error ? 'Error fetching job summaries: ' + summaries.errorMsg : '';
 
       if ($scope.error) {
         return [];
@@ -216,7 +215,6 @@ auroraUIControllers.controller('JobSummaryController',
 auroraUIControllers.controller('QuotaController',
   function ($scope, auroraClient) {
     $scope.error = false;
-    $scope.errorMsg = '';
 
     $scope.resourcesTableColumns = [
       {label: 'Resource', map: 'resource'},
@@ -235,8 +233,7 @@ auroraUIControllers.controller('QuotaController',
 
     function getQuota() {
       var quotaResponse = auroraClient.getQuota($scope.role);
-      $scope.error = quotaResponse.error;
-      $scope.errorMsg = quotaResponse.errorMsg;
+      $scope.error = quotaResponse.error ? 'Error fetching quota: ' + quotaResponse.errorMsg : '';
 
       if (quotaResponse.error) {
         return [];

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/4c0e6e1e/src/main/resources/org/apache/aurora/scheduler/http/ui/role.html
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/http/ui/role.html b/src/main/resources/org/apache/aurora/scheduler/http/ui/role.html
index ab94e6a..5698542 100644
--- a/src/main/resources/org/apache/aurora/scheduler/http/ui/role.html
+++ b/src/main/resources/org/apache/aurora/scheduler/http/ui/role.html
@@ -1,9 +1,9 @@
 <div>
-  <div ng-show='{{error}}'>
+  <div ng-show='error'>
     <error/>
   </div>
 
-  <div ng-hide='{{error}}'>
+  <div ng-hide='error'>
     <div>
       <div>
         <breadcrumb/>
@@ -27,11 +27,11 @@
           <div ng-show='showResources && !environment'>
             <div class='span8 center'>
               <div ng-controller="QuotaController">
-                <div ng-show='{{error}}'>
+                <div ng-show='error'>
                   <error/>
                 </div>
 
-                <div ng-hide='{{error}}'>
+                <div ng-hide='error'>
                   <smart-table config='resourcesTableConfig'
                                columns='resourcesTableColumns'
                                rows='resources'