Kaynağa Gözat

AMBARI-3967. Config Groups: some fields missing in Select Group Hosts popup. (onechiporenko)

Oleg Nechiporenko 11 yıl önce
ebeveyn
işleme
4f822ca934

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

@@ -45,7 +45,7 @@ App.enableExperimental = false;
 App.supports = {
   addServices: false,
   hostOverrides: true,
-  hostOverridesInstaller: false,
+  hostOverridesInstaller: true,
   hostOverridesHost: true,
   mirroring: false,
   secureCluster: true,

+ 4 - 4
ambari-web/app/controllers/wizard.js

@@ -523,11 +523,8 @@ App.WizardController = Em.Controller.extend({
     App.ModalPopup.show({
       header: header,
       secondary: false,
-      onPrimary: function () {
-        this.hide();
-      },
       bodyClass: Ember.View.extend({
-        template: Ember.Handlebars.compile(['<p>{{view.message}}</p>'].join('\n')),
+        template: Ember.Handlebars.compile('<p>{{view.message}}</p>'),
         message: message
       })
     });
@@ -546,6 +543,9 @@ App.WizardController = Em.Controller.extend({
           cpu: _host.cpu,
           memory: _host.memory,
           disk_info: _host.disk_info,
+          os_type: _host.os_type,
+          os_arch: _host.os_arch,
+          ip: _host.ip,
           bootStatus: _host.bootStatus,
           isInstalled: false
         };

+ 5 - 27
ambari-web/app/controllers/wizard/step3_controller.js

@@ -518,11 +518,8 @@ App.WizardStep3Controller = Em.Controller.extend({
     App.ModalPopup.show({
       header: header,
       secondary: false,
-      onPrimary: function () {
-        this.hide();
-      },
       bodyClass: Ember.View.extend({
-        template: Ember.Handlebars.compile(['<p>{{view.message}}</p>'].join('\n')),
+        template: Ember.Handlebars.compile('<p>{{view.message}}</p>'),
         message: message
       })
     });
@@ -557,6 +554,8 @@ App.WizardStep3Controller = Em.Controller.extend({
         _host.memory = ((parseInt(host.Hosts.total_mem))).toFixed(2);
         _host.disk_info = host.Hosts.disk_info;
         _host.os_type = host.Hosts.os_type;
+        _host.os_arch = host.Hosts.os_arch;
+        _host.ip = host.Hosts.ip;
 
         var context = self.checkHostOSType(host.Hosts.os_type, host.Hosts.host_name);
         if(context) {
@@ -649,10 +648,6 @@ App.WizardStep3Controller = Em.Controller.extend({
       header: Em.I18n.t('installer.step3.hostLog.popup.header').format(host.get('name')),
       secondary: null,
 
-      onPrimary: function () {
-        this.hide();
-      },
-
       bodyClass: Ember.View.extend({
         templateName: require('templates/wizard/step3_host_log_popup'),
         host: host,
@@ -995,16 +990,7 @@ App.WizardStep3Controller = Em.Controller.extend({
       },
 
       footerClass: Ember.View.extend({
-        template: Ember.Handlebars.compile([
-          '<div class="update-progress pull-left">',
-          '{{#if view.isUpdateInProgress}}',
-          '<div class="progress-info active progress">',
-          '<div class="bar" {{bindAttr style="view.progressWidth"}}></div></div>',
-          '{{else}}<label {{bindAttr class="view.updateStatusClass"}}>{{view.updateStatus}}</label>',
-          '{{/if}}</div>',
-          '{{#if view.parentView.secondary}}<button type="button" class="btn btn-info" {{bindAttr disabled="view.isUpdateInProgress"}} {{action onSecondary target="view.parentView"}}><i class="icon-repeat"></i>&nbsp;{{view.parentView.secondary}}</button>{{/if}}',
-          '{{#if view.parentView.primary}}<button type="button" class="btn" {{action onPrimary target="view.parentView"}}>{{view.parentView.primary}}</button>{{/if}}'
-        ].join('')),
+        templateName: require('templates/wizard/step3_host_warning_popup_footer'),
         classNames: ['modal-footer', 'host-checks-update'],
         progressWidth: function(){
           return 'width:'+App.router.get('wizardStep3Controller.checksUpdateProgress')+'%';
@@ -1145,9 +1131,6 @@ App.WizardStep3Controller = Em.Controller.extend({
               hosts: hosts.context,
               template: Ember.Handlebars.compile('<ul>{{#each host in view.hosts}}<li>{{host}}</li>{{/each}}</ul>')
             }),
-            onPrimary: function () {
-              this.hide();
-            },
             secondary: null
           });
         },
@@ -1226,12 +1209,7 @@ App.WizardStep3Controller = Em.Controller.extend({
       header: Em.I18n.t('installer.step3.warning.registeredHosts').format(this.get('registeredHosts').length),
       secondary: null,
       bodyClass: Ember.View.extend({
-        template: Ember.Handlebars.compile([
-          '<p>{{view.message}}</p>',
-          '<ul>{{#each host in view.registeredHosts}}',
-              '<li>{{host}}</li>',
-          '{{/each}}</ul>'
-        ].join('')),
+        templateName: require('templates/wizard/step3_registered_hosts_popup'),
         message: Em.I18n.t('installer.step3.registeredHostsPopup'),
         registeredHosts: self.get('registeredHosts')
       })

+ 12 - 3
ambari-web/app/controllers/wizard/step7_controller.js

@@ -321,9 +321,6 @@ App.WizardStep7Controller = Em.Controller.extend({
       header: Em.I18n.t('installer.step7.ConfigErrMsg.header'),
       primary: Em.I18n.t('ok'),
       secondary: null,
-      onPrimary: function () {
-        this.hide();
-      },
       bodyClass: Ember.View.extend({
         message: Em.I18n.t('installer.step7.ConfigErrMsg.message'),
         siteProperties: customConfig,
@@ -417,13 +414,25 @@ App.WizardStep7Controller = Em.Controller.extend({
 
     for (var hostName in hosts) {
       var host = hosts[hostName];
+      var disksOverallCapacity = 0;
+      var diskFree = 0;
+      host.disk_info.forEach(function(disk) {
+        disksOverallCapacity += parseFloat(disk.size);
+        diskFree += parseFloat(disk.available);
+      });
       App.store.load(App.Host,
         {
           id: host.name,
+          ip: host.ip,
+          os_type: host.os_type,
+          os_arch: host.os_arch,
           host_name: host.name,
           public_host_name: host.name,
           cpu: host.cpu,
           memory: host.memory,
+          disk_info: host.disk_info,
+          disk_total: disksOverallCapacity / (1024 * 1024),
+          disk_free: diskFree / (1024 * 1024),
           host_components: host.hostComponents
         }
       )

+ 5 - 0
ambari-web/app/models/host.js

@@ -64,6 +64,11 @@ App.Host = DS.Model.extend({
   publicHostNameFormatted: function() {
     return this.get('publicHostName').length < 43 ? this.get('publicHostName') : this.get('publicHostName').substr(0, 40) + '...';
   }.property('publicHostName'),
+
+  disksMounted: function() {
+    return this.get('diskInfo.length');
+  }.property('diskInfo.length'),
+
   /**
    * API return diskTotal and diskFree. Need to save their different
    */

+ 33 - 0
ambari-web/app/templates/wizard/step3_host_warning_popup_footer.hbs

@@ -0,0 +1,33 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
+<div class="update-progress pull-left">
+  {{#if view.isUpdateInProgress}}
+    <div class="progress-info active progress">
+      <div class="bar" {{bindAttr style="view.progressWidth"}}></div>
+    </div>
+  {{else}}
+    <label {{bindAttr class="view.updateStatusClass"}}>{{view.updateStatus}}</label>
+  {{/if}}
+</div>
+{{#if view.parentView.secondary}}
+  <button type="button" class="btn btn-info" {{bindAttr disabled="view.isUpdateInProgress"}} {{action onSecondary target="view.parentView"}}><i class="icon-repeat"></i>&nbsp;{{view.parentView.secondary}}</button>
+{{/if}}
+{{#if view.parentView.primary}}
+  <button type="button" class="btn" {{action onPrimary target="view.parentView"}}>{{view.parentView.primary}}</button>
+{{/if}}

+ 24 - 0
ambari-web/app/templates/wizard/step3_registered_hosts_popup.hbs

@@ -0,0 +1,24 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
+<p>{{view.message}}</p>
+<ul>
+  {{#each host in view.registeredHosts}}
+    <li>{{host}}</li>
+  {{/each}}
+</ul>

+ 1 - 1
ambari-web/app/utils/ajax.js

@@ -1059,7 +1059,7 @@ var urls = {
     }
   },
   'wizard.step3.host_info': {
-    'real': '/hosts?fields=Hosts/total_mem,Hosts/cpu_count,Hosts/disk_info,Hosts/last_agent_env,Hosts/host_name,Hosts/os_type',
+    'real': '/hosts?fields=Hosts/total_mem,Hosts/cpu_count,Hosts/disk_info,Hosts/last_agent_env,Hosts/host_name,Hosts/os_type,Hosts/os_arch,Hosts/ip',
     'mock': '/data/wizard/bootstrap/two_hosts_information.json',
     'format': function (data, opt) {
       return {

+ 4 - 4
ambari-web/app/utils/hosts.js

@@ -79,10 +79,10 @@ module.exports = {
           Ember.Object.create({id: 'ip', name: 'IP Address', selected: false}),
           Ember.Object.create({id: 'cpu', name: 'CPU', selected: false}),
           Ember.Object.create({id: 'memory', name: 'RAM', selected: false}),
-          Ember.Object.create({id: 'diskUsage', name: 'Disk Usage', selected: false}),
-          Ember.Object.create({id: 'loadAvg', name: 'Load Average', selected: false}),
           Ember.Object.create({id: 'osArch', name: 'OS Architecture', selected: false}),
-          Ember.Object.create({id: 'osType', name: 'OS Type', selected: false})
+          Ember.Object.create({id: 'osType', name: 'OS Type', selected: false}),
+          Ember.Object.create({id: 'diskTotal', name: 'Total Disks Capacity', selected: false}),
+          Ember.Object.create({id: 'disksMounted', name: '# of Disk Mounts', selected: false})
         ]),
         showOnlySelectedHosts: false,
         filterComponents: validComponents,
@@ -103,7 +103,7 @@ module.exports = {
             var value = ahost.get(filterColumn.id);
             host.set('filterColumnValue', value);
             if (filterText != null && filterText.length > 0) {
-              if ((value == null || !value.match(filterText)) && !host.get('host.publicHostName').match(filterText)) {
+              if ((value == null || !value.toString().match(filterText)) && !host.get('host.publicHostName').match(filterText)) {
                 skip = true;
               }
             }