Ver Fonte

AMBARI-4073. Do not block the user from moving forward if the local repo urls dont work. (xiwang via yusaku)

Yusaku Sako há 11 anos atrás
pai
commit
97d0d2737d

+ 4 - 1
ambari-web/app/controllers/installer.js

@@ -383,7 +383,10 @@ App.InstallerController = App.WizardController.extend({
       this.set('validationCnt', selectedStack.get('operatingSystems').filterProperty('selected', true).length);
       this.set('invalidCnt', 0);
       selectedStack.operatingSystems.forEach(function (os) {
-        if (os.selected) {
+        if (os.skipValidation) {
+          this.set('validationCnt', 0);
+        }
+        if (os.selected && !os.skipValidation) {
           os.validation = 'icon-repeat';
           selectedStack.set('reload', !selectedStack.get('reload'));
           App.ajax.send({

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

@@ -287,6 +287,8 @@ Em.I18n.translations = {
   'installer.step1.advancedRepo.localRepo.label.os':'Operating System',
   'installer.step1.advancedRepo.localRepo.label.baseUrl':'Repository Base URL',
   'installer.step1.advancedRepo.localRepo.label.stack':'Stack',
+  'installer.step1.advancedRepo.skipValidation.tooltip':'<b>Warning:</b> This is for advanced users only. Use this option if you want to skip validation for Repository Base URLs.',
+  'installer.step1.advancedRepo.skipValidation.message':'Skip Repository Base URL validation (Advanced)',
   'installer.step1.attentionNeeded':'<b>Attention:</b> Repository URLs are REQUIRED before you can proceed.',
   'installer.step1.invalidURLAttention': '<b>Attention:</b> Please make sure all repository URLs are valid before proceeding.',
   'installer.step1.checkAtLeastOneAttention': '<b>Attention:</b> Please check at least one repository.',

+ 10 - 0
ambari-web/app/styles/application.less

@@ -4949,6 +4949,16 @@ i.icon-asterisks {
         }
       }
     }
+    #skip-validation {
+      .checkbox {
+        margin-left: 3px;
+        margin-right: 8px;
+        margin-top: 0px;
+      }
+      .icon-question-sign {
+        color: @blue;
+      }
+    }
   }
 }
 

+ 4 - 0
ambari-web/app/templates/wizard/step1.hbs

@@ -95,6 +95,10 @@
               {{/each}}
             </tbody>
           </table>
+          <div id="skip-validation">
+            <label>{{view Ember.Checkbox checkedBinding="view.skipValidationChecked" class="checkbox"}}{{t installer.step1.advancedRepo.skipValidation.message}}
+              <i class="icon-question-sign" rel="skip-validation-tooltip" data-toggle="tooltip" {{translateAttr title="installer.step1.advancedRepo.skipValidation.tooltip"}}></i></label>
+          </div>
           {{#if view.emptyRepoExist}}
             <div class="alert">{{t installer.step1.attentionNeeded}}</div>
           {{/if}}

+ 8 - 1
ambari-web/app/views/wizard/step1_view.js

@@ -84,6 +84,7 @@ App.WizardStep1View = Em.View.extend({
     if (this.get('isRLCollapsed')) {
       this.$('.accordion-body').hide();
     }
+    $("[rel=skip-validation-tooltip]").tooltip({ placement: 'right'});
   },
   loadRepositories: function () {
     var selectedStack = this.get('controller.content.stacks').findProperty('isSelected', true);
@@ -176,15 +177,21 @@ App.WizardStep1View = Em.View.extend({
           self.set('allGroupsCheckbox', self.get('allGroupsCheckbox'));
         } else {
           os.selected = true;
+          os.skipValidation = self.get('skipValidationChecked');
+          if (os.skipValidation) {
+            targetGroup.set('validation', null);
+            targetGroup.set('invalid-error', false);
+          }
           targetGroup.set('clearAll', targetGroup.get('baseUrl'));
           targetGroup.set('empty-error',!targetGroup.get('baseUrl'));
           self.get('allGroupsCheckbox')[groupNumber] = true;
         }
       });
     }
-  }.observes('allRepositoriesGroup.@each.checked'),
+  }.observes('allRepositoriesGroup.@each.checked', 'skipValidationChecked'),
 
   allGroupsCheckbox: [true, true, true],
+  skipValidationChecked: false,
   /**
    * Onclick handler for undo action of each repo group
    */