Explorar el Código

AMBARI-7525. Slider with incorrect properties does not report about this. (akovalenko)

Aleksandr Kovalenko hace 11 años
padre
commit
c37648dd55

+ 2 - 1
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'),

+ 4 - 3
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();
   },
 

+ 3 - 0
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>

+ 1 - 1
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',