[24/27] ambari git commit: AMBARI-18407 BE:api/v1/persist/CLUSTER_CURRENT_STATUS takes more than 2s for transferring 307KB response. (atkach)
AMBARI-18407 BE:api/v1/persist/CLUSTER_CURRENT_STATUS takes more than 2s for transferring 307KB response. (atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/51cbf0df Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/51cbf0df Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/51cbf0df Branch: refs/heads/branch-dev-patch-upgrade Commit: 51cbf0df6b6ba6922b236c3a0a4cfa39e3d919e5 Parents: 9f9e89a Author: Andrii Tkach Authored: Thu Sep 15 21:56:50 2016 +0300 Committer: Andrii Tkach Committed: Fri Sep 16 12:38:27 2016 +0300 -- .../global/user_settings_controller.js | 6 ++-- ambari-web/app/controllers/login_controller.js | 1 - ambari-web/app/router.js| 3 +- .../views/common/widget/graph_widget_view.js| 5 ++-- .../global/user_settings_controller_test.js | 31 +--- .../test/controllers/login_controller_test.js | 4 +++ .../common/widget/graph_widget_view_test.js | 4 +-- .../manage_alert_notifications_view_test.js | 5 8 files changed, 44 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/51cbf0df/ambari-web/app/controllers/global/user_settings_controller.js -- diff --git a/ambari-web/app/controllers/global/user_settings_controller.js b/ambari-web/app/controllers/global/user_settings_controller.js index 8bcba75..9580400 100644 --- a/ambari-web/app/controllers/global/user_settings_controller.js +++ b/ambari-web/app/controllers/global/user_settings_controller.js @@ -81,13 +81,13 @@ App.UserSettingsController = Em.Controller.extend(App.UserPref, { /** * Success-callback for user pref * - * @param {*} response + * @param {?object} response * @param {object} opt - * @returns {*} + * @returns {?object} * @method getUserPrefSuccessCallback */ getUserPrefSuccessCallback: function (response, opt) { -var getAllRequest = opt.url.contains('persist/?_'); +var getAllRequest = opt.url.endsWith('persist/'); if (Em.isNone(response)) { this.updateUserPrefWithDefaultValues(response, getAllRequest); } http://git-wip-us.apache.org/repos/asf/ambari/blob/51cbf0df/ambari-web/app/controllers/login_controller.js -- diff --git a/ambari-web/app/controllers/login_controller.js b/ambari-web/app/controllers/login_controller.js index 24c04f7..350da87 100644 --- a/ambari-web/app/controllers/login_controller.js +++ b/ambari-web/app/controllers/login_controller.js @@ -49,7 +49,6 @@ App.LoginController = Em.Object.extend({ } this.set('errorMessage', errorMessage); } -App.router.get('userSettingsController').dataLoading(); this.set('isSubmitDisabled', false); } http://git-wip-us.apache.org/repos/asf/ambari/blob/51cbf0df/ambari-web/app/router.js -- diff --git a/ambari-web/app/router.js b/ambari-web/app/router.js index c7a70f1..0270771 100644 --- a/ambari-web/app/router.js +++ b/ambari-web/app/router.js @@ -420,7 +420,6 @@ App.Router = Em.Router.extend({ loginSuccessCallback: function(data, opt, params) { var self = this; -App.router.set('loginController.isSubmitDisabled', false); App.usersMapper.map({"items": [data]}); this.setUserLoggedIn(data.Users.user_name); var requestData = { @@ -585,7 +584,7 @@ App.Router = Em.Router.extend({ } } App.set('isPermissionDataLoaded', true); -App.router.get('userSettingsController').dataLoading(); +App.router.get('loginController').postLogin(true, true); }, /** http://git-wip-us.apache.org/repos/asf/ambari/blob/51cbf0df/ambari-web/app/views/common/widget/graph_widget_view.js -- diff --git a/ambari-web/app/views/common/widget/graph_widget_view.js b/ambari-web/app/views/common/widget/graph_widget_view.js index 6348077..2ee76be 100644 --- a/ambari-web/app/views/common/widget/graph_widget_view.js +++ b/ambari-web/app/views/common/widget/graph_widget_view.js @@ -336,8 +336,9 @@ App.GraphWidgetView = Em.View.extend(App.WidgetMixin, App.ExportMetricsMixin, { }, loadData: function () { - Em.run.next(this, function () { -this._refreshGraph(this.get('parentView.data'), this.get('parentView')); + var self = this; + Em.run.next(function () { +self._refreshGraph(self.get('parentView.data'), self.get('parentView')); }); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/51cbf0df/ambari-web/test/controllers/global/user_settings_controller_test.js --
ambari git commit: AMBARI-18407 BE:api/v1/persist/CLUSTER_CURRENT_STATUS takes more than 2s for transferring 307KB response. (atkach)
Repository: ambari Updated Branches: refs/heads/trunk 9f9e89afb -> 51cbf0df6 AMBARI-18407 BE:api/v1/persist/CLUSTER_CURRENT_STATUS takes more than 2s for transferring 307KB response. (atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/51cbf0df Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/51cbf0df Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/51cbf0df Branch: refs/heads/trunk Commit: 51cbf0df6b6ba6922b236c3a0a4cfa39e3d919e5 Parents: 9f9e89a Author: Andrii Tkach Authored: Thu Sep 15 21:56:50 2016 +0300 Committer: Andrii Tkach Committed: Fri Sep 16 12:38:27 2016 +0300 -- .../global/user_settings_controller.js | 6 ++-- ambari-web/app/controllers/login_controller.js | 1 - ambari-web/app/router.js| 3 +- .../views/common/widget/graph_widget_view.js| 5 ++-- .../global/user_settings_controller_test.js | 31 +--- .../test/controllers/login_controller_test.js | 4 +++ .../common/widget/graph_widget_view_test.js | 4 +-- .../manage_alert_notifications_view_test.js | 5 8 files changed, 44 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/51cbf0df/ambari-web/app/controllers/global/user_settings_controller.js -- diff --git a/ambari-web/app/controllers/global/user_settings_controller.js b/ambari-web/app/controllers/global/user_settings_controller.js index 8bcba75..9580400 100644 --- a/ambari-web/app/controllers/global/user_settings_controller.js +++ b/ambari-web/app/controllers/global/user_settings_controller.js @@ -81,13 +81,13 @@ App.UserSettingsController = Em.Controller.extend(App.UserPref, { /** * Success-callback for user pref * - * @param {*} response + * @param {?object} response * @param {object} opt - * @returns {*} + * @returns {?object} * @method getUserPrefSuccessCallback */ getUserPrefSuccessCallback: function (response, opt) { -var getAllRequest = opt.url.contains('persist/?_'); +var getAllRequest = opt.url.endsWith('persist/'); if (Em.isNone(response)) { this.updateUserPrefWithDefaultValues(response, getAllRequest); } http://git-wip-us.apache.org/repos/asf/ambari/blob/51cbf0df/ambari-web/app/controllers/login_controller.js -- diff --git a/ambari-web/app/controllers/login_controller.js b/ambari-web/app/controllers/login_controller.js index 24c04f7..350da87 100644 --- a/ambari-web/app/controllers/login_controller.js +++ b/ambari-web/app/controllers/login_controller.js @@ -49,7 +49,6 @@ App.LoginController = Em.Object.extend({ } this.set('errorMessage', errorMessage); } -App.router.get('userSettingsController').dataLoading(); this.set('isSubmitDisabled', false); } http://git-wip-us.apache.org/repos/asf/ambari/blob/51cbf0df/ambari-web/app/router.js -- diff --git a/ambari-web/app/router.js b/ambari-web/app/router.js index c7a70f1..0270771 100644 --- a/ambari-web/app/router.js +++ b/ambari-web/app/router.js @@ -420,7 +420,6 @@ App.Router = Em.Router.extend({ loginSuccessCallback: function(data, opt, params) { var self = this; -App.router.set('loginController.isSubmitDisabled', false); App.usersMapper.map({"items": [data]}); this.setUserLoggedIn(data.Users.user_name); var requestData = { @@ -585,7 +584,7 @@ App.Router = Em.Router.extend({ } } App.set('isPermissionDataLoaded', true); -App.router.get('userSettingsController').dataLoading(); +App.router.get('loginController').postLogin(true, true); }, /** http://git-wip-us.apache.org/repos/asf/ambari/blob/51cbf0df/ambari-web/app/views/common/widget/graph_widget_view.js -- diff --git a/ambari-web/app/views/common/widget/graph_widget_view.js b/ambari-web/app/views/common/widget/graph_widget_view.js index 6348077..2ee76be 100644 --- a/ambari-web/app/views/common/widget/graph_widget_view.js +++ b/ambari-web/app/views/common/widget/graph_widget_view.js @@ -336,8 +336,9 @@ App.GraphWidgetView = Em.View.extend(App.WidgetMixin, App.ExportMetricsMixin, { }, loadData: function () { - Em.run.next(this, function () { -this._refreshGraph(this.get('parentView.data'), this.get('parentView')); + var self = this; + Em.run.next(function () { +self._refreshGraph(self.get('parentView.data'), self.get('parentView')); }); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/51cbf0df/ambari-web/test/controllers/global/user_settings_control