{{!
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
}}

{{#if view.isHeartbeatLost}}
  <div>
    {{t installer.step9.host.heartbeat_lost_popup}}
  </div>
{{else}}
  {{#if view.isNoTasksScheduled}}
    {{t installer.step9.host.status.noTasks}}
  {{else}}
    <div {{bindAttr class="view.isLogWrapHidden::hidden :task-list-main-warp"}}>
      <div class="task-top-wrap">
        <div class="task-name-top task-detail-log-rolename">{{t common.tasks}}</div>
        <div class="select-wrap">
          {{t common.show}}:
          {{view Ember.Select
          contentBinding="view.categories"
          optionValuePath="content.value"
          optionLabelPath="content.label"
          selectionBinding="view.category"
          }}
        </div>
      </div>
      <div id="host-log">
        {{#each taskInfo in view.tasks}}
          <div {{bindAttr class="taskInfo.isVisible::hidden :log-list-wrap"}}>
            <div {{action toggleTaskLog taskInfo}} class="task-list-line-cursor">
              <div class="operation-name-icon-wrap">
                <i {{bindAttr class="taskInfo.status taskInfo.icon"}}></i>
                <a href="#">
                  {{taskInfo.role}} {{taskInfo.command}}
                </a>
              </div>
              <div class="show-details"><i class="icon-caret-right"></i></div>
            </div>
          </div>
        {{/each}}
        {{#if view.isEmptyList}}
          <div class="log-list-wrap">{{t installer.step9.hostLog.popup.noTasksToShow}}</div>
        {{/if}}
      </div>
    </div>

    <div {{bindAttr class="view.isLogWrapHidden:hidden :task-detail-info"}}>
      <div class="task-top-wrap">
        <a class="task-detail-back" href="javascript:void(null)" {{action backToTaskList}} ><i
                class="icon-arrow-left"></i>&nbsp;{{t common.tasks}}</a>

        <div>
          <i {{bindAttr class="view.openedTask.status :task-detail-status-ico view.openedTask.icon"}}></i>
          <div class="task-detail-ico-wrap">
            <a title="Click to Copy" {{action "textTrigger" taskInfo target="view"}} class="task-detail-copy"><i class="icon-copy"></i> {{t common.copy}}</a>
            <a title="Open in New Window" {{action openTaskLogInDialog}} class="task-detail-open-dialog"><i class="icon-external-link"></i> {{t common.open}}</a>
          </div>
          <span class="task-detail-log-rolename">{{view.openedTask.role}} {{view.openedTask.command}}</span>
        </div>

      </div>
      {{#if view.isTaskLoaded}}
          <div class="task-detail-log-info">
              <div class="content-area">
                  <div class="task-detail-log-clipboard-wrap"></div>
                  <div class="task-detail-log-maintext">
                      <h5>stderr: &nbsp; <span class="muted">{{view.openedTask.errorLog}} </span></h5>
                      <pre class="stderr">{{view.openedTask.stderr}}</pre>
                      <h5>stdout: &nbsp; <span class="muted"> {{view.openedTask.outputLog}} </span></h5>
                      <pre class="stdout">{{view.openedTask.stdout}}</pre>
                  </div>
              </div>
          </div>
      {{else}}
        <div class="spinner"></div>
      {{/if}}
    </div>
  {{/if}}
{{/if}}
