Pārlūkot izejas kodu

AMBARI-11158. Kerberos: Improve Review page content (alexantonenko)

Alex Antonenko 10 gadi atpakaļ
vecāks
revīzija
3ccfc42bda

+ 30 - 1
ambari-web/app/controllers/main/admin/kerberos/step5_controller.js

@@ -139,5 +139,34 @@ App.KerberosWizardStep5Controller = App.KerberosProgressPageController.extend({
 
   isSubmitDisabled: function () {
     return !["COMPLETED", "FAILED"].contains(this.get('status'));
-  }.property('status')
+  }.property('status'),
+
+  confirmProperties: function () {
+    var kdc_type = App.router.kerberosWizardController.content.serviceConfigProperties.findProperty('name','kdc_type').value,
+      filterObject = [
+        {
+          key: Em.I18n.t('admin.kerberos.wizard.step1.option.kdc'),
+          properties: ['kdc_type','kdc_host','realm','executable_search_paths']
+        },
+        {
+          key: Em.I18n.t('admin.kerberos.wizard.step1.option.ad'),
+          properties: ['kdc_type','kdc_host','realm','ldap_url','container_dn','executable_search_paths']
+        },
+        {
+          key: Em.I18n.t('admin.kerberos.wizard.step1.option.manual'),
+          properties: ['kdc_type','realm','executable_search_paths']
+        }
+      ],
+      kdcTypeProperties = filterObject.filter(function(item) {
+        return item.key === kdc_type;
+      }),
+      filterBy = kdcTypeProperties.length ? kdcTypeProperties[0].properties : [],
+      returnArray = App.router.kerberosWizardController.content.serviceConfigProperties.filter(function(item) {
+        return filterBy.contains(item.name);
+      }).map(function(item) {
+        item['label'] = Em.I18n.t('admin.kerberos.wizard.step5.'+item['name']+'.label');
+        return item;
+      });
+    return returnArray;
+  }.property('App.router.kerberosWizardController.content.@each.serviceConfigProperties')
 });

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

@@ -1026,7 +1026,12 @@ Em.I18n.translations = {
   'admin.kerberos.wizard.step5.info.body': 'Please review the configuration before continuing the setup process',
   'admin.kerberos.wizard.step5.moreInfoNonManual.body': 'Using the <b>Download CSV button</b>, you can download a csv file which contains a list of the principals and keytabs that will automatically be created by Ambari.',
   'admin.kerberos.wizard.step5.moreInfoManual.body': 'Important: Use the <b>Download CSV</b> button to obtain a list of the <b>required</b> principals and keytabs that are needed by Ambari to enable Kerberos in the cluster. <b>Do not proceed</b> until you have manually created and distributed the principals and keytabs to the cluster hosts.',
+  'admin.kerberos.wizard.step5.kdc_type.label': 'KDC Type',
+  'admin.kerberos.wizard.step5.kdc_host.label': 'KDC Host',
   'admin.kerberos.wizard.step5.realm.label': 'Realm Name',
+  'admin.kerberos.wizard.step5.ldap_url.label': 'LDAP URL',
+  'admin.kerberos.wizard.step5.container_dn.label': 'Container DN',
+  'admin.kerberos.wizard.step5.executable_search_paths.label': 'Executable path',
   'admin.kerberos.wizard.step5.exitWizard': 'Exit Wizard',
   'admin.kerberos.wizard.step5.downloadCSV': 'Download CSV',
   'admin.kerberos.wizard.step6.task0.title' : 'Stop Services',

+ 2 - 4
ambari-web/app/templates/main/admin/kerberos/step5.hbs

@@ -36,11 +36,9 @@
     </div>
 
     <div class="well pre-scrollable">
-      <p><strong>{{t installer.step0.clusterName.tooltip.title}}</strong>: {{App.router.clusterController.clusterName}}</p>
-      <p><strong>{{t admin.kerberos.wizard.step1.option.manual}}</strong>: {{App.router.kerberosWizardController.skipClientInstall}}</p>
-      {{#each App.router.kerberosWizardController.content.serviceConfigProperties}}
+      {{#each confirmProperties}}
         {{#if value}}
-          <p><strong>{{name}}</strong>: {{value}}</p>
+          <p><strong>{{label}}</strong>: {{value}}</p>
         {{/if}}
       {{/each}}
     </div>