falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From venkat...@apache.org
Subject [1/3] git commit: FALCON-393 Display error messages when the web UI fails to get the data from the server. Contributed by Haohui Mai
Date Thu, 24 Apr 2014 04:16:18 GMT
Repository: incubator-falcon
Updated Branches:
  refs/heads/master d28ad7e04 -> 946182a09


FALCON-393 Display error messages when the web UI fails to get the data from the server. Contributed
by Haohui Mai


Project: http://git-wip-us.apache.org/repos/asf/incubator-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-falcon/commit/9dcbdf54
Tree: http://git-wip-us.apache.org/repos/asf/incubator-falcon/tree/9dcbdf54
Diff: http://git-wip-us.apache.org/repos/asf/incubator-falcon/diff/9dcbdf54

Branch: refs/heads/master
Commit: 9dcbdf5471191ad75200f1941e86d3d2375b5239
Parents: d28ad7e
Author: Venkatesh Seetharam <venkatesh@hortonworks.com>
Authored: Wed Apr 23 12:40:16 2014 -0700
Committer: Venkatesh Seetharam <venkatesh@hortonworks.com>
Committed: Wed Apr 23 12:40:16 2014 -0700

----------------------------------------------------------------------
 CHANGES.txt                   |  3 +++
 html5-ui/css/falcon.css       | 23 +++++++++++++++++++++--
 html5-ui/entity.html          |  4 ++--
 html5-ui/index.html           | 11 +++++++++--
 html5-ui/js/falcon-entity.js  |  6 +++---
 html5-ui/js/falcon-index.js   |  2 +-
 html5-ui/js/falcon-lineage.js | 18 ++++++++++--------
 html5-ui/js/falcon.js         | 11 +++++++++--
 8 files changed, 58 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/9dcbdf54/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 6f7589e..625de9e 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -98,6 +98,9 @@ Trunk (Unreleased)
     FALCON-373 Display lineage link only for jobs that are succeeded in the web UI
     (Haohui Mai via Venkatesh Seetharam)
 
+    FALCON-393 Display error messages when the web UI fails to get the data from the server
+    (Haohui Mai via Venkatesh Seetharam)
+
   OPTIMIZATIONS
     FALCON-123 Improve build speeds in falcon. (Srikanth Sundarrajan via Shwetha GS)
 

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/9dcbdf54/html5-ui/css/falcon.css
----------------------------------------------------------------------
diff --git a/html5-ui/css/falcon.css b/html5-ui/css/falcon.css
index 990d00c..7b0a929 100644
--- a/html5-ui/css/falcon.css
+++ b/html5-ui/css/falcon.css
@@ -15,14 +15,33 @@
 * limitations under the License.
 */
 
+.falcon-docs-nav, .navbar-header .navbar-brand {
+  border-radius: 0px;
+  background-color: #5fa33e;
+  color: #fff;
+}
+
+.navbar-nav > li > a.btn-entity-list {
+  color: #dcf0d3;
+}
+
+.navbar-nav > .active > a {
+  color: #dcf0d3;
+}
+
 .falcon-brand {
-  padding-left: 40px;
+  padding-left: 50px;
   background-image: url('../img/falcon-64.png');
   background-size: 40px 40px;
   background-repeat: no-repeat;
   background-position: left center;
 }
 
+#alert-panel {
+  margin-top:20px;
+  display: none;
+}
+
 .btn-entity-list {
   cursor: pointer;
 }
@@ -219,4 +238,4 @@ color: #456ab5;
 .lineage-legend-terminal:before {
   -webkit-text-stroke-width: 2px;
   -webkit-text-stroke-color: #ccc;
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/9dcbdf54/html5-ui/entity.html
----------------------------------------------------------------------
diff --git a/html5-ui/entity.html b/html5-ui/entity.html
index d08512e..d4536fb 100644
--- a/html5-ui/entity.html
+++ b/html5-ui/entity.html
@@ -32,9 +32,9 @@
 <link rel="shortcut icon" href="img/favicon.png" />
 </head>
 <body>
-<div class="navbar navbar-default">
+<div class="navbar navbar-inverse falcon-docs-nav">
 <div class="navbar-header"><button type="button" class="navbar-toggle" data-toggle="collapse"
data-target=
-".navbar-collapse"></button> <a class="navbar-brand falcon-brand">Falcon Server</a></div>
+".navbar-collapse"></button> <a class="navbar-brand falcon-brand">Apache Falcon</a></div>
 <div class="navbar-collapse navbar-right collapse">
 <ul class="nav navbar-nav">
 <li><a class="btn-entity-list" href="index.html?type=feed">Data sets</a></li>

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/9dcbdf54/html5-ui/index.html
----------------------------------------------------------------------
diff --git a/html5-ui/index.html b/html5-ui/index.html
index 5719f00..6763cfe 100644
--- a/html5-ui/index.html
+++ b/html5-ui/index.html
@@ -32,9 +32,10 @@
 <link rel="shortcut icon" href="img/favicon.png" />
 </head>
 <body>
-<div class="navbar navbar-default">
+
+<div class="navbar navbar-inverse falcon-docs-nav">
 <div class="navbar-header"><button type="button" class="navbar-toggle" data-toggle="collapse"
data-target=
-".navbar-collapse"></button> <a class="navbar-brand falcon-brand">Falcon Server</a></div>
+".navbar-collapse"></button> <a class="navbar-brand falcon-brand">Apache Falcon</a></div>
 <div class="navbar-collapse navbar-right collapse">
 <ul class="nav navbar-nav">
 <li><a class="btn-entity-list" data-entity-type="feed" href="index.html?type=feed">Data
sets</a></li>
@@ -44,6 +45,12 @@
 </div>
 </div>
 <div class="container">
+<div id="alert-panel">
+  <div class="alert alert-danger">
+    <button type="button" class="close" onclick="$('#alert-panel').hide();">&times;</button>
+    <div class="alert-body" id="alert-panel-body"></div>
+  </div>
+</div>
 <div id="entity-list-container"></div>
 <div id="entity-paginator"></div>
 <hr />

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/9dcbdf54/html5-ui/js/falcon-entity.js
----------------------------------------------------------------------
diff --git a/html5-ui/js/falcon-entity.js b/html5-ui/js/falcon-entity.js
index f0407c4..f5563a2 100644
--- a/html5-ui/js/falcon-entity.js
+++ b/html5-ui/js/falcon-entity.js
@@ -60,7 +60,7 @@
         $('.instance-hdfs-log').tooltip();
         $('#panel-instance').show();
       });
-    });
+    }).fail(falcon.ajaxFailureHandler);
   }
 
   function loadDependency() {
@@ -81,7 +81,7 @@
         switchDependencyView('list');
         $('#panel-dependency').show();
       });
-    });
+    }).fail(falcon.ajaxFailureHandler);
   }
 
   function load() {
@@ -99,7 +99,7 @@
           loadInstance(e.attr('start'), e.attr('end'));
         }
       }
-    });
+    }).fail(falcon.ajaxFailureHandler);
 
     if (!isCluster) {
       loadDependency();

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/9dcbdf54/html5-ui/js/falcon-index.js
----------------------------------------------------------------------
diff --git a/html5-ui/js/falcon-index.js b/html5-ui/js/falcon-index.js
index af5a396..8abdbf1 100644
--- a/html5-ui/js/falcon-index.js
+++ b/html5-ui/js/falcon-index.js
@@ -91,7 +91,7 @@
       $('#entity-paginator').data('activePage', 1);
       falcon.entities = data.entity;
       gotoPage(1);
-    });
+    }).fail(falcon.ajaxFailureHandler);
   }
 
   function initialize() {

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/9dcbdf54/html5-ui/js/falcon-lineage.js
----------------------------------------------------------------------
diff --git a/html5-ui/js/falcon-lineage.js b/html5-ui/js/falcon-lineage.js
index b7e0bda..b554c80 100644
--- a/html5-ui/js/falcon-lineage.js
+++ b/html5-ui/js/falcon-lineage.js
@@ -60,9 +60,10 @@
           data.nodes[n._id] = n;
           q.push({'id': n._id, 'depth': depth - 1});
         }
-      }).always(function() {
-        process_queue(done_cb);
-      });
+      }).fail(falcon.ajaxFailureHandler)
+        .always(function() {
+          process_queue(done_cb);
+        });
     }
 
     var v = data.queue.pop();
@@ -81,9 +82,10 @@
         data.edges[e._id] = e;
       }
       node.is_terminal = !(terminal_has_in_edge && terminal_has_out_edge);
-    }).always(function () {
-      visit_neighbor(v);
-    });
+    }).fail(falcon.ajaxFailureHandler)
+      .always(function () {
+        visit_neighbor(v);
+      });
   }
 
   function draw_graph() {
@@ -111,7 +113,7 @@
             dust.render('info', resp, function(err, out) {
               $('#lineage-info-panel').html(out);
             });
-          });
+          }).fail(falcon.ajaxFailureHandler);
         };
       }
 
@@ -233,6 +235,6 @@
       data.nodes[n._id] = n;
       update_graph();
       $('#lineage-modal').modal('show');
-    });
+    }).fail(falcon.ajaxFailureHandler);
   };
 })(falcon);

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/9dcbdf54/html5-ui/js/falcon.js
----------------------------------------------------------------------
diff --git a/html5-ui/js/falcon.js b/html5-ui/js/falcon.js
index 0a75f6a..b4faf1c 100644
--- a/html5-ui/js/falcon.js
+++ b/html5-ui/js/falcon.js
@@ -19,8 +19,10 @@
 
   var USER_ID = 'dashboard';
 
-  function onError (msg) {
-    alert(msg);
+  function onError(msg) {
+    $('#alert-panel-body').html(msg);
+    $('#alert-panel').alert();
+    $('#alert-panel').show();
   }
 
   function ajax_impl(options) {
@@ -60,6 +62,11 @@
     ajax: ajax_impl,
     getJson: getJson_impl,
     getText: getText_impl,
+    ajaxFailureHandler: function(jqXHR, status, err) {
+      if (jqXHR.status !== 0) {
+        onError('Failed to load data. Error: ' + jqXHR.status + ' ' + err);
+      }
+    },
 
     /**
      * Calling the REST API recursively to get the dependency graph


Mime
View raw message