|
@@ -286,6 +286,29 @@ App.WizardController = Em.Controller.extend({
|
|
|
};
|
|
|
data = JSON.stringify(data);
|
|
|
break;
|
|
|
+ case 'addServiceController':
|
|
|
+ if (isRetry) {
|
|
|
+ this.getFailedHostComponents();
|
|
|
+ console.log('failedHostComponents', this.get('failedHostComponents'));
|
|
|
+ name = 'wizard.install_services.installer_controller.is_retry';
|
|
|
+ data = {
|
|
|
+ "RequestInfo": {
|
|
|
+ "context" : Em.I18n.t('requestInfo.installComponents'),
|
|
|
+ "query": "HostRoles/component_name.in(" + this.get('failedHostComponents').join(',') + ")"
|
|
|
+ },
|
|
|
+ "Body": {
|
|
|
+ "HostRoles": {
|
|
|
+ "state": "INSTALLED"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ data = JSON.stringify(data);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ name = 'wizard.install_services.installer_controller.not_is_retry';
|
|
|
+ data = '{"RequestInfo": {"context" :"' + Em.I18n.t('requestInfo.installServices') + '"}, "Body": {"ServiceInfo": {"state": "INSTALLED"}}}';
|
|
|
+ }
|
|
|
+ break;
|
|
|
case 'installerController':
|
|
|
default:
|
|
|
if (isRetry) {
|
|
@@ -311,6 +334,40 @@ App.WizardController = Em.Controller.extend({
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ /**
|
|
|
+ * List of failed to install HostComponents while adding Service
|
|
|
+ */
|
|
|
+ failedHostComponents: [],
|
|
|
+
|
|
|
+ getFailedHostComponents: function() {
|
|
|
+ App.ajax.send({
|
|
|
+ name: 'wizard.install_services.add_service_controller.get_failed_host_components',
|
|
|
+ sender: this,
|
|
|
+ success: 'getFailedHostComponentsSuccessCallback',
|
|
|
+ error: 'getFailedHostComponentsErrorCallback'
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Parse all failed components and filter out installed earlier components (based on selected to install services)
|
|
|
+ * @param {Object} json
|
|
|
+ */
|
|
|
+ getFailedHostComponentsSuccessCallback: function(json) {
|
|
|
+ var allFailed = json.items.filterProperty('HostRoles.state', 'INSTALL_FAILED');
|
|
|
+ var currentFailed = [];
|
|
|
+ var selectedServices = App.db.getService().filterProperty('isInstalled', false).filterProperty('isSelected', true).mapProperty('serviceName');
|
|
|
+ allFailed.forEach(function(failed) {
|
|
|
+ if (selectedServices.contains(failed.component[0].ServiceComponentInfo.service_name)) {
|
|
|
+ currentFailed.push(failed.HostRoles.component_name);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.set('failedHostComponents', currentFailed);
|
|
|
+ },
|
|
|
+
|
|
|
+ getFailedHostComponentsErrorCallback: function(request, ajaxOptions, error) {
|
|
|
+ console.warn(error);
|
|
|
+ },
|
|
|
+
|
|
|
installServicesSuccessCallback: function (jsonData) {
|
|
|
var installStartTime = new Date().getTime();
|
|
|
console.log("TRACE: In success function for the installService call");
|