Repository: mesos
Updated Branches:
  refs/heads/master 5bead0a34 -> 735d67547


Disabled error dialog in WebUI when user is unauthorized to see metrics.

Disables the dialog showing a connection error in the WebUI if the
returned error code is either _401 Unauthorized_ or _403 Forbidden_.

Showing a connection error is misleading in the latter cases, while
it also rendered the WebUI unusable since the dialog would show
over and over again.

Review: https://reviews.apache.org/r/52034/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/735d6754
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/735d6754
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/735d6754

Branch: refs/heads/master
Commit: 735d675470e39a0f4b2cdc30d84a1eaececba869
Parents: d410814
Author: Alexander Rojas <alexan...@mesosphere.io>
Authored: Mon Oct 17 00:53:02 2016 -0700
Committer: Adam B <a...@mesosphere.io>
Committed: Mon Oct 17 00:54:39 2016 -0700

----------------------------------------------------------------------
 src/webui/master/static/js/controllers.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/735d6754/src/webui/master/static/js/controllers.js
----------------------------------------------------------------------
diff --git a/src/webui/master/static/js/controllers.js 
b/src/webui/master/static/js/controllers.js
index 0a7ea3f..3dead4f 100644
--- a/src/webui/master/static/js/controllers.js
+++ b/src/webui/master/static/js/controllers.js
@@ -407,9 +407,13 @@
             $timeout(pollMetrics, $scope.delay);
           }
         })
-        .error(function() {
+        .error(function(message, code) {
           if ($scope.isErrorModalOpen === false) {
-            popupErrorModal();
+            // If return code is 401 or 403 the user is unauthorized to reach
+            // the endpoint, which is not a connection error.
+            if ([401, 403].indexOf(code) < 0) {
+              popupErrorModal();
+            }
           }
         });
     };

Reply via email to