Updated Branches: refs/heads/trunk d0338adf3 -> ab014b384
AMBARI-4470 Logs disappear after installation phase complete. (atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ab014b38 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ab014b38 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ab014b38 Branch: refs/heads/trunk Commit: ab014b38406aa51fd5c930b94d6a182668a4ea3d Parents: d0338ad Author: atkach <[email protected]> Authored: Thu Jan 30 14:38:50 2014 +0200 Committer: atkach <[email protected]> Committed: Thu Jan 30 14:38:50 2014 +0200 ---------------------------------------------------------------------- .../app/controllers/wizard/step9_controller.js | 36 ++------------------ ambari-web/app/views/wizard/step9_view.js | 17 ++------- 2 files changed, 5 insertions(+), 48 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/ab014b38/ambari-web/app/controllers/wizard/step9_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step9_controller.js b/ambari-web/app/controllers/wizard/step9_controller.js index fdec1d9..6c3fe08 100644 --- a/ambari-web/app/controllers/wizard/step9_controller.js +++ b/ambari-web/app/controllers/wizard/step9_controller.js @@ -759,7 +759,6 @@ App.WizardStep9Controller = Em.Controller.extend({ this.getLogsByRequest(url, false); }, this); }, - /** * {Number} * <code>taskId</code> of current open task @@ -771,16 +770,6 @@ App.WizardStep9Controller = Em.Controller.extend({ */ currentOpenTaskRequestId: 0, /** - * {Object} - * Log of current open task (loaded from server) - * Fields: { - * stdout: '', - * stderr: '' - * } - */ - currentOpenTaskLog: null, - - /** * Load form server <code>stderr, stdout</code> of current open task */ loadCurrentTaskLog: function() { @@ -806,18 +795,12 @@ App.WizardStep9Controller = Em.Controller.extend({ }, loadCurrentTaskLogSuccessCallback: function(data) { - this.set('currentOpenTaskLog', { - stdout: data.Tasks.stdout, - stderr: data.Tasks.stderr - }); var taskId = this.get('currentOpenTaskId'); if (taskId) { - var currentTask = this.get('polledData').findProperty('Tasks.id', taskId); - var log = this.get('currentOpenTaskLog'); - if (currentTask && log) { + var currentTask = this.get('hosts').findProperty('name', data.Tasks.host_name).get('logTasks').findProperty('Tasks.id', data.Tasks.id); + if (currentTask) { currentTask.Tasks.stderr = data.Tasks.stderr; currentTask.Tasks.stdout = data.Tasks.stdout; - this.updateHostLogTask(data.Tasks.host_name, data.Tasks.id, data.Tasks.stderr, data.Tasks.stdout); } } this.set('logTasksChangesCounter', this.get('logTasksChangesCounter') + 1); @@ -825,21 +808,6 @@ App.WizardStep9Controller = Em.Controller.extend({ loadCurrentTaskLogErrorCallback: function() { this.set('currentOpenTaskId', 0); - this.set('currentOpenTaskRequestId', 0); - }, - /** - * Update log task for provided host - * @param {String} hostName - * @param {Number} taskId - * @param {String} stderr - * @param {String} stdout - */ - updateHostLogTask: function(hostName, taskId, stderr, stdout) { - var logTask = this.get('hosts').findProperty('name', hostName).get('logTasks').findProperty('Tasks.id', taskId); - if (logTask) { - logTask.Tasks.stderr = stderr; - logTask.Tasks.stdout = stdout; - } }, // polling: whether to continue polling for status or not http://git-wip-us.apache.org/repos/asf/ambari/blob/ab014b38/ambari-web/app/views/wizard/step9_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/wizard/step9_view.js b/ambari-web/app/views/wizard/step9_view.js index 1a4723b..4593622 100644 --- a/ambari-web/app/views/wizard/step9_view.js +++ b/ambari-web/app/views/wizard/step9_view.js @@ -256,20 +256,9 @@ App.HostStatusView = Em.View.extend({ newdocument.close(); }, - openedTask: null, - /** - * Set logs (stderr, stdout) to the current opened task - */ - currentOpenTaskLogObserver: function() { - if (!this.get('parentView.c.currentOpenTaskId')) { - this.set('openedTask', Ember.Object.create()); - } - this.set('openedTask', this.get('tasks').findProperty('id', this.get('parentView.c.currentOpenTaskId'))); - if (this.get('openedTask.stdout') == '') { - this.set('openedTask.stdout', this.get('parentView.c.currentOpenTaskLog').stdout); - this.set('openedTask.stderr', this.get('parentView.c.currentOpenTaskLog').stderr); - } - }.observes('tasks.@each', 'parentView.c.currentOpenTaskLog.stderr', 'parentView.c.currentOpenTaskLog.stdout'), + openedTask: function() { + return this.get('tasks').findProperty('id', this.get('parentView.c.currentOpenTaskId')) + }.property('parentView.c.currentOpenTaskId', 'tasks.@each'), toggleTaskLog: function (event, context) { if (this.get('isLogWrapHidden')) {
