Author: yusaku
Date: Wed May 29 01:56:27 2013
New Revision: 1487191
URL: http://svn.apache.org/r1487191
Log:
AMBARI-2203. Background operations popup does not automatically refresh the
task log. (yusaku)
Modified:
incubator/ambari/trunk/CHANGES.txt
incubator/ambari/trunk/ambari-web/app/utils/host_progress_popup.js
Modified: incubator/ambari/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1487191&r1=1487190&r2=1487191&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Wed May 29 01:56:27 2013
@@ -895,6 +895,9 @@ Trunk (unreleased changes):
BUG FIXES
+ AMBARI-2203. Background operations popup does not automatically refresh the
+ task log. (yusaku)
+
AMBARI-2202. Running the smoke test for a specific service should set the
appropriate request context showing the service name. (yusaku)
Modified: incubator/ambari/trunk/ambari-web/app/utils/host_progress_popup.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/utils/host_progress_popup.js?rev=1487191&r1=1487190&r2=1487191&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/utils/host_progress_popup.js
(original)
+++ incubator/ambari/trunk/ambari-web/app/utils/host_progress_popup.js Wed May
29 01:56:27 2013
@@ -31,6 +31,7 @@ App.HostPopup = Em.Object.create({
popupHeaderName: "",
serviceController: null,
showServices: false,
+ currentHostName: null,
/**
* Sort object array
@@ -53,12 +54,10 @@ App.HostPopup = Em.Object.create({
initPopup: function (serviceName, controller, showServices) {
this.set("serviceName", serviceName);
this.set("serviceController", controller);
- if (showServices) {
- this.set("showServices", true);
- } else {
- this.set("showServices", false);
+ if (!showServices) {
this.set("popupHeaderName", serviceName);
}
+ this.set("showServices", showServices);
this.set("hosts", null);
this.set("servicesInfo", null);
this.set("inputData", null);
@@ -165,7 +164,7 @@ App.HostPopup = Em.Object.create({
if (this.get("serviceName") == "")
this.setBackgroundOperationHeader();
}
- }.observes("this.inputData"),
+ }.observes("inputData"),
/**
* Create hosts and tasks data structure for popup
@@ -175,7 +174,7 @@ App.HostPopup = Em.Object.create({
var self = this;
if (this.get("inputData")) {
var hostsArr = [];
- var hostsData = this.get("inputData")
+ var hostsData = this.get("inputData");
var hosts = [];
if (this.get("showServices") && this.get("serviceName") == "") {
hostsData.forEach(function (service) {
@@ -183,14 +182,16 @@ App.HostPopup = Em.Object.create({
host.setEach("serviceName", service.name);
hosts.push.apply(hosts, host);
});
- } else {
- if(this.get("currentServiceId") != null){
+ }
+ else {
+ if(this.get("currentServiceId") != null) {
hostsData = hostsData.filterProperty("id",
this.get("currentServiceId")).objectAt(0);
- }else{
+ }
+ else {
hostsData = hostsData.filterProperty("name",
this.get("serviceName")).objectAt(0);
}
- if(hostsData.hosts){
+ if(hostsData && hostsData.hosts) {
hosts = hostsData.hosts;
}
@@ -265,7 +266,7 @@ App.HostPopup = Em.Object.create({
}
self.set("hosts", hostsArr);
- }.observes("this.inputData"),
+ }.observes("inputData"),
/**
* Sort tasks by it`s id
@@ -321,10 +322,16 @@ App.HostPopup = Em.Object.create({
isHostEmptyList: true,
isTasksEmptyList: true,
controller: this,
- hosts: hostsInfo,
- services: servicesInfo,
+ hosts: self.get("hosts"),
+ services: self.get('servicesInfo'),
- tasks: null,
+ tasks: function() {
+ if (!this.get('controller.currentHostName')) return [];
+ if (this.get('hosts')) {
+ return this.get('hosts').findProperty('name',
this.get('controller.currentHostName')).get('tasks');
+ }
+ return [];
+ }.property('[email protected]', '[email protected][email protected]'),
didInsertElement: function () {
this.setOnStart();
@@ -346,12 +353,11 @@ App.HostPopup = Em.Object.create({
* When popup is opened, and data after polling has changed, update
this data in component
*/
updateHostInfo: function () {
- //debugger;
this.get("controller").set("inputData", null);
this.get("controller").set("inputData",
this.get("controller.serviceController.services"));
this.set("hosts", this.get("controller.hosts"));
this.set("services", this.get("controller.servicesInfo"));
- }.observes("this.controller.serviceController.serviceTimestamp"),
+ }.observes("controller.serviceController.serviceTimestamp"),
/**
* Depending on service filter, set which services should be shown
@@ -560,6 +566,7 @@ App.HostPopup = Em.Object.create({
var taskInfo = event.context.tasks;
if (taskInfo.length) {
this.get("controller").set("popupHeaderName",
taskInfo.objectAt(0).hostName);
+ this.get("controller").set("currentHostName",
taskInfo.objectAt(0).hostName);
}
this.set('tasks', taskInfo);
this.set("isHostListHidden", true);
@@ -588,7 +595,7 @@ App.HostPopup = Em.Object.create({
return Ember.Object.create();
}
return this.get('tasks').findProperty('id',
this.get('openedTaskId'));
- }.property('tasks', 'openedTaskId'),
+ }.property('tasks', '[email protected]', '[email protected]',
'openedTaskId'),
/**
* Onclick event for show task detail info