Ver código fonte

AMBARI-14158. BG operation window: Running task shows duration with negative value

Alex Antonenko 10 anos atrás
pai
commit
9f0538e023

+ 3 - 2
ambari-web/app/utils/date/date.js

@@ -131,13 +131,14 @@ module.exports = {
       return Em.I18n.t('common.na');
     }
     if (endDate.getFullYear() != 1969 && endTimestamp > 0) {
-      return '' + this.timingFormat(endTimestamp - startTimestamp, 1); //lasted for xx secs
+      durationSummary = '' + this.timingFormat(endTimestamp - startTimestamp, 1);
+      return durationSummary.contains('-') ? Em.I18n.t('common.na') : durationSummary; //lasted for xx secs
     } else {
       // still running, duration till now
       var time = (App.dateTimeWithTimeZone() - startTimestamp) < 0 ? 0 : (App.dateTimeWithTimeZone() - startTimestamp);
       durationSummary = '' + this.timingFormat(time, 1);
     }
-    return durationSummary;
+    return durationSummary.contains('-') ? Em.I18n.t('common.na') : durationSummary;
   },
 
   /**

+ 1 - 1
contrib/views/slider/src/main/resources/ui/app/models/config_property.js

@@ -37,7 +37,7 @@ App.ConfigProperty = Em.Object.extend({
     }
   }.property('viewType'),
   className: function () {
-    return "value-for-" + this.get('label').replace('.', '-');
+    return "value-for-" + this.get('label').replace(/\./g, "-");
   }.property('viewType'),
   readOnly: false,
   //used for config with "select" view