You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by on...@apache.org on 2014/07/01 13:07:26 UTC
git commit: AMBARI-6331. After clicking around different services,
the alert panel on the service page displays alerts from various
services other than the service being viewed (on 2k-node cluster).
(onechiporenko)
Repository: ambari
Updated Branches:
refs/heads/branch-1.6.1 415e5313e -> 37e668d13
AMBARI-6331. After clicking around different services, the alert panel on the service page displays alerts from various services other than the service being viewed (on 2k-node cluster). (onechiporenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/37e668d1
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/37e668d1
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/37e668d1
Branch: refs/heads/branch-1.6.1
Commit: 37e668d1367d40cef17db32440fd482eabbc0d80
Parents: 415e531
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Tue Jul 1 14:01:09 2014 +0300
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Tue Jul 1 14:05:52 2014 +0300
----------------------------------------------------------------------
ambari-web/app/controllers/main/alerts_controller.js | 11 ++++++++++-
ambari-web/app/routes/main.js | 8 +++++++-
2 files changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/37e668d1/ambari-web/app/controllers/main/alerts_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/alerts_controller.js b/ambari-web/app/controllers/main/alerts_controller.js
index dc6adaf..0ea7212 100644
--- a/ambari-web/app/controllers/main/alerts_controller.js
+++ b/ambari-web/app/controllers/main/alerts_controller.js
@@ -93,13 +93,21 @@ App.MainAlertsController = Em.Controller.extend({
return false;
}
},
+
+ /**
+ * Saved request for alerts
+ * Should be aborted if user navigate away from current page (aborting done in router)
+ * @type {$.ajax|null}
+ */
+ servicesRequest: null,
+
/**
* request alerts from server, which belong to particular service
* @return {Boolean}
*/
getAlertsByService: function () {
if (this.get('resourceName')) {
- App.ajax.send({
+ var request = App.ajax.send({
name: 'alerts.get_by_service',
sender: this,
data: {
@@ -108,6 +116,7 @@ App.MainAlertsController = Em.Controller.extend({
success: 'getAlertsSuccessCallback',
error: 'getAlertsErrorCallback'
});
+ this.set('servicesRequest', request);
return true;
} else {
console.warn('GET Alerts error: serviceName parameter is missing');
http://git-wip-us.apache.org/repos/asf/ambari/blob/37e668d1/ambari-web/app/routes/main.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index dd03830..b1f40dd 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -27,7 +27,7 @@ module.exports = Em.Route.extend({
if (router.getAuthenticated()) {
App.router.get('mainAdminAccessController').loadShowJobsForUsers().done(function () {
App.router.get('clusterController').loadClusterName(false);
- if (App.testMode) {
+ if (App.get('testMode')) {
router.get('mainController').initialize();
} else {
App.router.get('mainController').checkServerClientVersion().done(function () {
@@ -685,6 +685,12 @@ module.exports = Em.Route.extend({
} else {
router.transitionTo('services.index');
}
+ },
+ exit: function(router) {
+ var request = router.get('mainAlertsController.servicesRequest');
+ if (request) {
+ request.abort();
+ }
}
}),
metrics: Em.Route.extend({