Переглянути джерело

AMBARI-16977 VDF: couple UI bugs in Install Wiz (zhewang)

Zhe (Joe) Wang 9 роки тому
батько
коміт
cea4f8ec7e

+ 6 - 0
ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css

@@ -1607,6 +1607,12 @@ thead.view-permission-header > tr > th {
 #upload-definition-file-panel .dropdown-menu li a {
   cursor: pointer;
 }
+
+#upload-definition-file-panel .disabled span {
+  opacity: 0.7;
+  cursor: default;
+}
+
 .register-version-options {
   padding-left: 25px;
 }

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

@@ -99,9 +99,9 @@
 
 <div id="upload-definition-file-panel" ng-if="createController">
 
-  <div class="col-sm-12 big-radio clearfix">
+  <div class="col-sm-12 big-radio clearfix" ng-class="{'disabled' : networkLost || useRedhatSatellite}">
     <input type="radio" ng-model="selectedOption.index" value="1" ng-change="togglePublicLocalOptionSelect()" ng-disabled="networkLost || useRedhatSatellite">
-    {{'versions.usePublic' | translate}}
+    <span>{{'versions.usePublic' | translate}}</span>
     <a id="public-disabled-link" href="javascript:void(0);" ng-if="networkLost" ng-click="showPublicRepoDisabledDialog()">{{'versions.networkIssues.networkLost'| translate}}</a>
   </div>
   <div class="col-sm-12 big-radio clearfix">

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

@@ -185,7 +185,13 @@ App.WizardStep1Controller = Em.Controller.extend({
    */
   onNetworkIssuesExist: function() {
     if (this.get('networkIssuesExist')) {
-      this.useLocalRepo();
+      this.get('content.stacks').forEach(function (stack) {
+        stack.setProperties({
+          usePublicRepo: false,
+          useLocalRepo: true
+        });
+        stack.cleanReposBaseUrls();
+      });
     }
   }.observes('networkIssuesExist'),
 
@@ -282,7 +288,7 @@ App.WizardStep1Controller = Em.Controller.extend({
 
       controller: this,
 
-      header: Em.I18n.t('installer.step1.changeVersion.title'),
+      header: Em.I18n.t('installer.step1.addVersion.title'),
 
       primary: Em.I18n.t('installer.step1.useLocalRepo.readButton'),
 

+ 1 - 1
ambari-web/app/messages.js

@@ -554,7 +554,7 @@ Em.I18n.translations = {
 
   'installer.step1.header':'Select Version',
   'installer.step1.body':'Select the software version and method of delivery for your cluster. Using a Public Repository requires Internet connectivity. Using a Local Repository requires you have configured the software in a repository available in your network.',
-  'installer.step1.changeVersion.title':'Change Version',
+  'installer.step1.addVersion.title':'Add Version',
   'installer.step1.changeVersion.defaultVersion':'Default Version Definition',
   'installer.step1.selectUseRepoOptions.public':'Use Public Repository',
   'installer.step1.selectUseRepoOptions.public.networkLost.button':'Not Available',

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

@@ -6246,6 +6246,9 @@ input[type="radio"].align-checkbox, input[type="checkbox"].align-checkbox {
   .big-radio {
     font-weight: bold;
     padding: 5px 15px;
+    &.disabled>span{
+      opacity: 0.7;
+    }
   }
   #public-disabled-link {
     margin-left: 10px;

+ 1 - 1
ambari-web/app/templates/wizard/step1.hbs

@@ -76,7 +76,7 @@
   {{! left tabs end }}
 
   {{! Public Repository radio }}
-  <label class="radio big-radio">
+  <label {{bindAttr class=":radio :big-radio :public-radio networkIssuesExist:disabled"}}>
     {{view view.usePublicRepoRadioButton}} {{t installer.step1.selectUseRepoOptions.public}}
     {{#if networkIssuesExist}}
       <a id="public-disabled-link" {{action "openPublicOptionDisabledWindow" target="view"}}>{{t installer.step1.selectUseRepoOptions.public.networkLost}}</a>

+ 1 - 1
ambari-web/test/controllers/wizard/step1_test.js

@@ -59,7 +59,7 @@ var stacks = [
 ];
 
 function getController() {
-  return App.WizardStep1Controller.create({content: Em.Object.create({stacks: stacks})});
+  return App.WizardStep1Controller.create({content: Em.Object.create({stacks: stacks}), onNetworkIssuesExist: Em.K});
 }
 
 describe('App.WizardStep1Controller', function () {