Kaynağa Gözat

AMBARI-14909: Add a clean data dir confirmation pop-up to HAWQ add slave wizard (nalex via jaoki)

Jun Aoki 9 yıl önce
ebeveyn
işleme
60adfbcf8f

+ 19 - 4
ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/step3_controller.js

@@ -33,6 +33,8 @@ App.AddHawqStandbyWizardStep3Controller = Em.Controller.extend({
 
 
   selectedService: null,
   selectedService: null,
 
 
+  hawqProps: null,
+
   hideDependenciesInfoBar: true,
   hideDependenciesInfoBar: true,
 
 
   versionLoaded: true,
   versionLoaded: true,
@@ -107,7 +109,8 @@ App.AddHawqStandbyWizardStep3Controller = Em.Controller.extend({
     this.setDynamicConfigValues(params, data);
     this.setDynamicConfigValues(params, data);
     this.setProperties({
     this.setProperties({
       selectedService: params,
       selectedService: params,
-      isLoaded: true
+      isLoaded: true,
+      hawqProps: data
     });
     });
   },
   },
 
 
@@ -134,11 +137,23 @@ App.AddHawqStandbyWizardStep3Controller = Em.Controller.extend({
     }, this);
     }, this);
   },
   },
 
 
+
   submit: function () {
   submit: function () {
     if (!this.get('isSubmitDisabled')) {
     if (!this.get('isSubmitDisabled')) {
-      App.get('router.mainAdminKerberosController').getKDCSessionState(function() {
-        App.router.send("next");
-      });
+      dataDir = this.get('hawqProps').items[0].properties['hawq_master_directory'];
+      hawqStandby = this.get('hawqProps').items[0].properties['hawq_standby_address_host']
+      App.showConfirmationPopup(
+        function() {
+          App.get('router.mainAdminKerberosController').getKDCSessionState(function() {
+            App.router.send("next");
+          });
+        },
+        Em.I18n.t('admin.addHawqStandby.wizard.step3.confirm.dataDir.body').format(dataDir, hawqStandby),
+        null,
+        Em.I18n.t('admin.addHawqStandby.wizard.step3.confirm.dataDir.title'),
+        "Confirm",
+        false
+      );
     }
     }
   },
   },
 
 

+ 2 - 0
ambari-web/app/messages.js

@@ -2910,6 +2910,8 @@ Em.I18n.translations = {
       '</div>',
       '</div>',
   'admin.addHawqStandby.wizard.step3.hawqMaster': 'Current HAWQ Master',
   'admin.addHawqStandby.wizard.step3.hawqMaster': 'Current HAWQ Master',
   'admin.addHawqStandby.wizard.step3.newHawqStandby': 'New HAWQ Standby Master',
   'admin.addHawqStandby.wizard.step3.newHawqStandby': 'New HAWQ Standby Master',
+  'admin.addHawqStandby.wizard.step3.confirm.dataDir.title': 'HAWQ Standby Master Directory Confirmation',
+  'admin.addHawqStandby.wizard.step3.confirm.dataDir.body': 'Please confirm that the HAWQ data directory <b>{0}</b> on the Standby Master <b>{1}</b> does not exist or is empty.</br>If there is pre-existing data then HAWQ Standby will get initialized with stale data.',
   'admin.addHawqStandby.step4.save.configuration.note': 'This configuration is created by Add HAWQ Standby wizard',
   'admin.addHawqStandby.step4.save.configuration.note': 'This configuration is created by Add HAWQ Standby wizard',
   'admin.addHawqStandby.wizard.step4.header': 'Configure Components',
   'admin.addHawqStandby.wizard.step4.header': 'Configure Components',
   'admin.addHawqStandby.wizard.step4.task0.title': 'Stop HAWQ Service',
   'admin.addHawqStandby.wizard.step4.task0.title': 'Stop HAWQ Service',