|
@@ -53,11 +53,12 @@ App.HostPopup = Em.Object.create({
|
|
|
* @param showServices
|
|
|
*/
|
|
|
initPopup: function (serviceName, controller, showServices) {
|
|
|
- this.set("serviceName", serviceName);
|
|
|
- this.set("serviceController", controller);
|
|
|
if (!showServices) {
|
|
|
+ this.clearHostPopup();
|
|
|
this.set("popupHeaderName", serviceName);
|
|
|
}
|
|
|
+ this.set("serviceName", serviceName);
|
|
|
+ this.set("serviceController", controller);
|
|
|
this.set("showServices", showServices);
|
|
|
this.set("inputData", this.get("serviceController.services"));
|
|
|
if(this.get('showServices')){
|
|
@@ -68,6 +69,19 @@ App.HostPopup = Em.Object.create({
|
|
|
return this.createPopup();
|
|
|
},
|
|
|
|
|
|
+ clearHostPopup: function () {
|
|
|
+ this.set('servicesInfo', null);
|
|
|
+ this.set('hosts', null);
|
|
|
+ this.set('inputData', null);
|
|
|
+ this.set('serviceName', "");
|
|
|
+ this.set('currentServiceId', null);
|
|
|
+ this.set('previousServiceId', null);
|
|
|
+ this.set('popupHeaderName', "");
|
|
|
+ this.set('serviceController', null);
|
|
|
+ this.set('showServices', false);
|
|
|
+ this.set('currentHostName', null);
|
|
|
+ },
|
|
|
+
|
|
|
/**
|
|
|
* Depending on tasks status
|
|
|
* @param tasks
|
|
@@ -298,7 +312,7 @@ App.HostPopup = Em.Object.create({
|
|
|
|
|
|
var existedHosts = self.get('hosts');
|
|
|
|
|
|
- if (hosts) {
|
|
|
+ if (hosts.length > 0) {
|
|
|
if (existedHosts && this.get('currentServiceId') === this.get('previousServiceId')) {
|
|
|
existedHosts.forEach(function (host) {
|
|
|
var newHostInfo = hosts.findProperty('name', host.get('name'));
|