|
@@ -358,48 +358,49 @@ App.AddHostController = App.WizardController.extend({
|
|
|
loadServiceConfigGroups: function () {
|
|
|
var slaveComponentHosts = this.get('content.slaveComponentHosts');
|
|
|
var selectedServices = [];
|
|
|
- var selectedClientHosts = slaveComponentHosts.findProperty('componentName','CLIENT').hosts.mapProperty('hostName');
|
|
|
-
|
|
|
- slaveComponentHosts.forEach(function (slave){
|
|
|
- if(slave.hosts.length > 0){
|
|
|
- if(slave.componentName != "CLIENT"){
|
|
|
- var service = App.HostComponent.find().findProperty('componentName', slave.componentName).get('service');
|
|
|
- var configGroups = this.get('content.configGroups').filterProperty('ConfigGroup.tag', service.get('id'));
|
|
|
- var configGroupsNames = configGroups.mapProperty('ConfigGroup.group_name')
|
|
|
+ var selectedClientHosts = slaveComponentHosts.findProperty('componentName', 'CLIENT').hosts.mapProperty('hostName');
|
|
|
+ var componentServiceMap = App.QuickDataMapper.componentServiceMap;
|
|
|
+
|
|
|
+ slaveComponentHosts.forEach(function (slave) {
|
|
|
+ if (slave.hosts.length > 0) {
|
|
|
+ if (slave.componentName != "CLIENT") {
|
|
|
+ var service = componentServiceMap[slave.componentName];
|
|
|
+ var configGroups = this.get('content.configGroups').filterProperty('ConfigGroup.tag', service);
|
|
|
+ var configGroupsNames = configGroups.mapProperty('ConfigGroup.group_name');
|
|
|
configGroupsNames.push('Default');
|
|
|
selectedServices.push({
|
|
|
- serviceId : service.get('id'),
|
|
|
- displayName : service.get('displayName'),
|
|
|
- hosts : slave.hosts.mapProperty('hostName'),
|
|
|
- configGroupsNames : configGroupsNames,
|
|
|
- configGroups : configGroups,
|
|
|
+ serviceId: service,
|
|
|
+ displayName: App.Service.DisplayNames[service],
|
|
|
+ hosts: slave.hosts.mapProperty('hostName'),
|
|
|
+ configGroupsNames: configGroupsNames,
|
|
|
+ configGroups: configGroups,
|
|
|
selectedConfigGroup: "Default"
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
- },this);
|
|
|
- if(selectedClientHosts.length > 0){
|
|
|
+ }, this);
|
|
|
+ if (selectedClientHosts.length > 0) {
|
|
|
this.loadClients();
|
|
|
var clients = this.get('content.clients');
|
|
|
clients.forEach(function (client) {
|
|
|
- var service = App.HostComponent.find().findProperty('componentName', client.component_name).get('service');
|
|
|
- var serviceMatch = selectedServices.findProperty('serviceId',service.get('id'));
|
|
|
- if(serviceMatch){
|
|
|
+ var service = componentServiceMap[client.component_name];
|
|
|
+ var serviceMatch = selectedServices.findProperty('serviceId', service);
|
|
|
+ if (serviceMatch) {
|
|
|
serviceMatch.hosts = serviceMatch.hosts.concat(selectedClientHosts).uniq();
|
|
|
- }else{
|
|
|
- var configGroups = this.get('content.configGroups').filterProperty('ConfigGroup.tag', service.get('id'));
|
|
|
- var configGroupsNames = configGroups.mapProperty('ConfigGroup.group_name')
|
|
|
+ } else {
|
|
|
+ var configGroups = this.get('content.configGroups').filterProperty('ConfigGroup.tag', service);
|
|
|
+ var configGroupsNames = configGroups.mapProperty('ConfigGroup.group_name');
|
|
|
configGroupsNames.push('Default');
|
|
|
selectedServices.push({
|
|
|
- serviceId : service.get('id'),
|
|
|
- displayName : service.get('displayName'),
|
|
|
- hosts : selectedClientHosts,
|
|
|
- configGroupsNames : configGroupsNames,
|
|
|
- configGroups : configGroups,
|
|
|
+ serviceId: service,
|
|
|
+ displayName: App.Service.DisplayNames[service],
|
|
|
+ hosts: selectedClientHosts,
|
|
|
+ configGroupsNames: configGroupsNames,
|
|
|
+ configGroups: configGroups,
|
|
|
selectedConfigGroup: "Default"
|
|
|
});
|
|
|
}
|
|
|
- },this);
|
|
|
+ }, this);
|
|
|
}
|
|
|
this.set('content.serviceConfigGroups', selectedServices);
|
|
|
},
|