Browse Source

AMBARI-15047. Add UI option to make Red Hat Satellite work (onechiporenko)

Oleg Nechiporenko 9 years ago
parent
commit
c86964b542

+ 1 - 0
ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js

@@ -23,6 +23,7 @@ angular.module('ambariAdminConsole')
   $scope.createController = true;
   $scope.osList = [];
   $scope.skipValidation = false;
+  $scope.useRedhatSatellite = false;
   $scope.selectedOS = 0;
   $scope.repoSubversion = "";
 

+ 1 - 0
ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js

@@ -23,6 +23,7 @@ angular.module('ambariAdminConsole')
   $scope.editController = true;
   $scope.osList = [];
   $scope.skipValidation = false;
+  $scope.useRedhatSatellite = false;
   $scope.selectedOS = 0;
 
   $scope.loadStackVersionInfo = function () {

+ 3 - 0
ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js

@@ -304,6 +304,8 @@ angular.module('ambariAdminConsole')
       'os': 'OS',
       'baseURL': 'Base URL',
       'skipValidation': 'Skip Repository Base URL validation (Advanced)',
+      'useRedhatSatellite': 'Use RedHat Satellite/Spacewalk',
+
 
       'changeBaseURLConfirmation': {
         'title': 'Confirm Base URL Change',
@@ -314,6 +316,7 @@ angular.module('ambariAdminConsole')
         'baseURLs': 'Provide Base URLs for the Operating Systems you are configuring. Uncheck all other Operating Systems.',
         'validationFailed': 'Some of the repositories failed validation. Make changes to the base url or skip validation if you are sure that urls are correct',
         'skipValidationWarning': '<b>Warning:</b> This is for advanced users only. Use this option if you want to skip validation for Repository Base URLs.',
+        'useRedhatSatelliteWarning': 'Disable distributed repositories and use RedHat Satellite/Spacewalk channels instead',
         'filterListError': 'Fetch stack version filter list error',
         'versionCreated': 'Created version <a href="#/stackVersions/{{stackName}}/{{versionName}}/edit">{{stackName}}-{{versionName}}</a>',
         'versionCreationError': 'Version creation error',

+ 8 - 0
ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html

@@ -92,6 +92,14 @@
             </label>
           </div>
         </div>
+        <div class="col-sm-12 hidden" id="use-redhat">
+          <div class="checkbox">
+            <label>
+              <input type="checkbox" ng-model="useRedhatSatellite" ng-change="clearErrors()">
+              {{'versions.useRedhatSatellite' | translate}} <span class="glyphicon glyphicon-question-sign" tooltip-html-unsafe="{{'versions.alerts.useRedhatSatelliteWarning' | translate}}"></span>
+            </label>
+          </div>
+        </div>
       </div>
     </div>
   </div>

+ 2 - 1
ambari-web/app/config.js

@@ -81,7 +81,8 @@ App.supports = {
   preInstallChecks: false,
   hostComboSearchBox: false,
   serviceAutoStart: false,
-  logSearch: false
+  logSearch: false,
+  redhatSatellite: false
 };
 
 if (App.enableExperimental) {

+ 2 - 0
ambari-web/app/controllers/wizard/step1_controller.js

@@ -27,6 +27,8 @@ App.WizardStep1Controller = Em.Controller.extend({
    */
   skipValidationChecked: false,
 
+  useRedhatSatellite: false,
+
   selectedStack: function() {
     return App.Stack.find().findProperty('isSelected');
   }.property('content.stacks.@each.isSelected')

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

@@ -542,7 +542,9 @@ Em.I18n.translations = {
   '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.useRedhatSatellite.tooltip':'Disable distributed repositories and use RedHat Satellite/Spacewalk channels instead',
   'installer.step1.advancedRepo.skipValidation.message':'Skip Repository Base URL validation (Advanced)',
+  'installer.step1.advancedRepo.useRedhatSatellite.message': 'Use RedHat Satellite/Spacewalk',
   '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.',

+ 7 - 0
ambari-web/app/templates/main/admin/stack_upgrade/edit_repositories.hbs

@@ -50,3 +50,10 @@
     <i class="icon-question-sign" rel="skip-validation-tooltip"
        data-toggle="tooltip" {{translateAttr title="installer.step1.advancedRepo.skipValidation.tooltip"}}></i></label>
 </div>
+{{#if App.supports.redhatSatellite}}
+  <div id="use-redhat">
+    <label>{{view Ember.Checkbox classNames="align-checkbox" checkedBinding="view.parentView.useRedhatSatellite"}}{{t installer.step1.advancedRepo.useRedhatSatellite.message}}
+      <i class="icon-question-sign" rel="use-redhat-tooltip"
+         data-toggle="tooltip" {{translateAttr title="installer.step1.advancedRepo.useRedhatSatellite.tooltip"}}></i></label>
+  </div>
+{{/if}}

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

@@ -98,6 +98,13 @@
               <i class="icon-question-sign" rel="skip-validation-tooltip"
                  data-toggle="tooltip" {{translateAttr title="installer.step1.advancedRepo.skipValidation.tooltip"}}></i></label>
           </div>
+          {{#if App.supports.redhatSatellite}}
+            <div id="use-redhat">
+              <label>{{view Ember.Checkbox classNames="align-checkbox" checkedBinding="useRedhatSatellite"}}{{t installer.step1.advancedRepo.useRedhatSatellite.message}}
+                <i class="icon-question-sign" rel="use-redhat-tooltip"
+                   data-toggle="tooltip" {{translateAttr title="installer.step1.advancedRepo.useRedhatSatellite.tooltip"}}></i></label>
+            </div>
+          {{/if}}
           {{#if view.invalidFormatUrlExist}}
             <div class="alert">{{t installer.step1.attentionNeeded}}</div>
           {{/if}}

+ 6 - 2
ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js

@@ -307,6 +307,7 @@ App.UpgradeVersionBoxView = Em.View.extend({
     return this.get('isRepoUrlsEditDisabled') ? null : App.ModalPopup.show({
       classNames: ['repository-list', 'sixty-percent-width-modal'],
       skipValidation: false,
+      useRedhatSatellite: false,
       autoHeight: false,
       /**
        * @type {boolean}
@@ -333,14 +334,17 @@ App.UpgradeVersionBoxView = Em.View.extend({
 
           this.get('content.operatingSystems').forEach(function (os) {
             os.get('repositories').forEach(function (repo) {
-              disablePrimary = (!disablePrimary) ? repo.get('hasError') : disablePrimary;
+              disablePrimary = !disablePrimary ? repo.get('hasError') : disablePrimary;
             }, this);
           }, this);
           this.set('parentView.disablePrimary', disablePrimary);
         },
         templateName: require('templates/main/admin/stack_upgrade/edit_repositories'),
         didInsertElement: function () {
-          App.tooltip($("[rel=skip-validation-tooltip]"), {placement: 'right'});
+          App.tooltip($("[rel=skip-validation-tooltip], [rel=use-redhat-tooltip]"), {placement: 'right'});
+        },
+        willDestroyElement: function () {
+          $("[rel=skip-validation-tooltip], [rel=use-redhat-tooltip]").tooltip('destroy');
         }
       }),
       header: Em.I18n.t('common.repositories'),

+ 1 - 1
ambari-web/test/views/common/log_file_search_view_test.js

@@ -32,7 +32,7 @@ describe('App.LogFileSearchView', function() {
         isIncluded: !!isIncluded
       });
     };
-    var cases = [
+    [
       {
         viewContent: {
           keywordsFilterValue: 'some_keyword'