diff --git a/SingularityUI/app/models/TaskHistory.coffee b/SingularityUI/app/models/TaskHistory.coffee index eeeb899293..2fc56026f9 100644 --- a/SingularityUI/app/models/TaskHistory.coffee +++ b/SingularityUI/app/models/TaskHistory.coffee @@ -12,6 +12,7 @@ class TaskHistory extends Model parse: (taskHistory) -> taskHistory.taskUpdates = _.sortBy taskHistory.taskUpdates, (t) -> t.timestamp + taskHistory.lastKnownState = _.last(taskHistory.taskUpdates).taskState taskHistory.healthcheckResults = (_.sortBy taskHistory.healthcheckResults, (t) -> t.timestamp).reverse() taskHistory.task?.mesosTask?.executor?.command?.environment?.variables = _.sortBy taskHistory.task.mesosTask.executor.command.environment.variables, "name" @@ -52,7 +53,7 @@ class TaskHistory extends Model taskHistory.slaveMissing = true - taskHistory.isCleaning = _.last( taskHistory.taskUpdates ).taskState is 'TASK_CLEANING' + taskHistory.isCleaning = taskHistory.lastKnownState is 'TASK_CLEANING' taskHistory.requestId = taskHistory.task.taskId.requestId diff --git a/SingularityUI/app/views/taskHealthcheckNotificationSubview.coffee b/SingularityUI/app/views/taskHealthcheckNotificationSubview.coffee index e6eafc4e7a..c73d17d375 100644 --- a/SingularityUI/app/views/taskHealthcheckNotificationSubview.coffee +++ b/SingularityUI/app/views/taskHealthcheckNotificationSubview.coffee @@ -3,6 +3,12 @@ Task = require '../models/Task' class taskHealthcheckNotificationSubview extends View + noHealthcheckMessageStates: [ + 'TASK_FAILED', + 'TASK_FINISHED', + 'TASK_LOST' + ] + events: -> _.extend super, 'click [data-action="viewHealthchecks"]': 'triggerToggleHealthchecks' @@ -14,6 +20,7 @@ class taskHealthcheckNotificationSubview extends View render: => return if not @model.synced + return if @model.attributes.lastKnownState in @noHealthcheckMessageStates @$el.html @template @renderData() renderData: =>