You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by me...@apache.org on 2016/10/17 07:55:04 UTC
[1/2] mesos git commit: Disabled error dialog in WebUI when user is
unauthorized to see metrics.
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 <al...@mesosphere.io>
Authored: Mon Oct 17 00:53:02 2016 -0700
Committer: Adam B <ad...@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();
+ }
}
});
};
[2/2] mesos git commit: Changed error message in pailer if user is
unauthorized.
Posted by me...@apache.org.
Changed error message in pailer if user is unauthorized.
If attempts to use the pailer to access sandboxes and/or mesos logs fail
because the user is unauthorized, an error telling the user he is
unauthorized is shown to the client instead of showing the misguiding
_Failed to initialize... retrying_. It also disables retry in case the
client is unauthorized.
Review: https://reviews.apache.org/r/52042/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/d410814b
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/d410814b
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/d410814b
Branch: refs/heads/master
Commit: d410814b9f491b0d7416e6219c00326ce742e96b
Parents: 5bead0a
Author: Alexander Rojas <al...@mesosphere.io>
Authored: Mon Oct 17 00:52:13 2016 -0700
Committer: Adam B <ad...@mesosphere.io>
Committed: Mon Oct 17 00:54:39 2016 -0700
----------------------------------------------------------------------
src/webui/master/static/js/jquery.pailer.js | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/d410814b/src/webui/master/static/js/jquery.pailer.js
----------------------------------------------------------------------
diff --git a/src/webui/master/static/js/jquery.pailer.js b/src/webui/master/static/js/jquery.pailer.js
index 79c3c0d..537fe00 100644
--- a/src/webui/master/static/js/jquery.pailer.js
+++ b/src/webui/master/static/js/jquery.pailer.js
@@ -133,12 +133,17 @@
this_.element.html('');
setTimeout(function() { this_.tail(); }, 0);
})
- .error(function() {
- this_.indicate('(FAILED TO INITIALIZE ... RETRYING)');
- setTimeout(function() {
- this_.indicate('');
- this_.initialize();
- }, 1000);
+ .error(function(response, msg, code) {
+ if ([401, 403].indexOf(response.status) > -1) {
+ // Unauthorized user.
+ this_.indicate('YOU ARE UNAUTHORIZED TO ACCESS THIS CONTENT');
+ } else {
+ this_.indicate('(FAILED TO INITIALIZE ... RETRYING)');
+ setTimeout(function() {
+ this_.indicate('');
+ this_.initialize();
+ }, 1000);
+ }
});
};