AMBARI-7525. Slider with incorrect properties does not report about this. (akovalenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c37648dd Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c37648dd Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c37648dd Branch: refs/heads/branch-alerts-dev Commit: c37648dd55da913775c3e97a131d113bd1d96b75 Parents: 1f84009 Author: Aleksandr Kovalenko <akovale...@hortonworks.com> Authored: Fri Sep 26 21:30:35 2014 +0300 Committer: Aleksandr Kovalenko <akovale...@hortonworks.com> Committed: Fri Sep 26 21:30:35 2014 +0300 ---------------------------------------------------------------------- .../resources/ui/app/controllers/slider_apps_controller.js | 3 ++- .../src/main/resources/ui/app/mappers/slider_apps_mapper.js | 7 ++++--- .../src/main/resources/ui/app/templates/unavailable_apps.hbs | 3 +++ .../views/slider/src/main/resources/ui/app/translations.js | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/c37648dd/contrib/views/slider/src/main/resources/ui/app/controllers/slider_apps_controller.js ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/slider_apps_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/slider_apps_controller.js index bd3b284..894fe84 100644 --- a/contrib/views/slider/src/main/resources/ui/app/controllers/slider_apps_controller.js +++ b/contrib/views/slider/src/main/resources/ui/app/controllers/slider_apps_controller.js @@ -20,7 +20,8 @@ App.SliderAppsController = Ember.ArrayController.extend({ /** * show modal popup that says apps currently unavailable */ - showUnavailableAppsPopup: function() { + showUnavailableAppsPopup: function(message) { + this.set('errorMessage', message); Bootstrap.ModalManager.open( "apps-warning-modal", Em.I18n.t('common.warning'), http://git-wip-us.apache.org/repos/asf/ambari/blob/c37648dd/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js b/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js index d224928..56b1081 100644 --- a/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js +++ b/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js @@ -53,13 +53,14 @@ App.SliderAppsMapper = App.Mapper.createWithMixins(App.RunPeriodically, { sender: this, success: 'parse' }).fail(function(jqXHR, textStatus){ - if (textStatus === "timeout" && !self.get('isWarningPopupShown')) { + if (!self.get('isWarningPopupShown')) { + var message = textStatus === "timeout" ? "timeout" : jqXHR.responseText; self.set('isWarningPopupShown', true); - window.App.__container__.lookup('controller:SliderApps').showUnavailableAppsPopup(); + window.App.__container__.lookup('controller:SliderApps').showUnavailableAppsPopup(message); } }).complete(function(){ dfd.resolve(); - }) + }); return dfd.promise(); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/c37648dd/contrib/views/slider/src/main/resources/ui/app/templates/unavailable_apps.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/unavailable_apps.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/unavailable_apps.hbs index f791d15..575a865 100644 --- a/contrib/views/slider/src/main/resources/ui/app/templates/unavailable_apps.hbs +++ b/contrib/views/slider/src/main/resources/ui/app/templates/unavailable_apps.hbs @@ -17,3 +17,6 @@ }} {{t slider.apps.unavailable}} +<div class="alert alert-danger"> + {{controller.errorMessage}} +</div> http://git-wip-us.apache.org/repos/asf/ambari/blob/c37648dd/contrib/views/slider/src/main/resources/ui/app/translations.js ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/app/translations.js b/contrib/views/slider/src/main/resources/ui/app/translations.js index 04c5769..38ce76d 100644 --- a/contrib/views/slider/src/main/resources/ui/app/translations.js +++ b/contrib/views/slider/src/main/resources/ui/app/translations.js @@ -81,7 +81,7 @@ Em.I18n.translations = { 'slider.apps.title': 'Slider Apps', 'slider.apps.create': 'Create App', - 'slider.apps.unavailable': 'HDFS or YARN services are currently unaccessible', + 'slider.apps.unavailable': 'Unable to get list of Slider Apps due to issues below. Possible reasons include incorrect or invalid view parameters. Please contact administrator for setting up proper view parameters and verifying necessary services are working.', 'sliderApps.filters.info': '{0} of {1} sliders showing', 'sliderApp.flex.invalid_counts': 'Instance counts should be integer and >= 0',