<!--
  #%L
  thinkbig-ui-operations-manager
  %%
  Copyright (C) 2017 ThinkBig Analytics
  %%
  Licensed 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.
  #L%
  -->

<div layout="row" layout-sm="column" layout-xs="column"  >
    <div layout="column" flex="100" flex-gt-sm="70" flex-order="1" flex-order-xs="2" flex-order-sm="2" >
            <tba-feed-activity  feed-name="vm.feedName"></tba-feed-activity>
      <tba-jobs hide-feed-column="true" card-title="Jobs" feed-filter="vm.feedName" feed="vm.feed"
                page-name="feed-job-details" on-job-action="vm.onJobAction(action,job)"></tba-jobs>
    </div>

    <div layout="column"  flex="100"  flex-gt-sm="30"  style="margin:8px;" flex-order="2" flex-order-xs="1" flex-order-sm="1">
        <card-layout body-css="job-details-right-body">
            <header-section transclude-to="head">
                <div style="white-space:nowrap" class="card-title" flex>Feed Details</div>
                </header-section>
            <body-section transclude-to="body">
                <md-content flex md-scroll-y>
                <md-list flex layout-fill class="feed-details-list list-item-table">
                <md-list-item>
                    <div layout="column"  class="item-column md-list-item-text ">
                      <span class="item-title">
                          {{vm.feedName}}
                      </span>
                      <div layout="row" layout-align="space-between center"
                            class="{{vm.feed.iconstyle}} column-title-bottom">
                          <div>
                              <ng-md-icon icon="{{vm.feed.icon}}" size="20"
                                      ng-if="vm.feed.icon"></ng-md-icon>
                                {{vm.feed.healthText}}
                          </div>
                      </div>
                    </div>
                    </md-list-item>
                <md-divider></md-divider>

                <md-list-item>
                    <div layout="column"  class="item-column md-list-item-text ">

                                   <span  class="item-title" ng-class="{'healthy':vm.feed.displayStatus == 'COMPLETED' || vm.feed.displayStatus =='RUNNING','error':vm.feed.displayStatus == 'FAILED'}">
                                     {{vm.feed.displayStatus}}</span>
                                     <span class="column-title column-title-bottom">
                                     Status
                                   </span>
                        </div>
                </md-list-item>
                <md-divider></md-divider>

                <md-list-item >
                    <div layout="column"  class="item-column md-list-item-text ">
                                    <span class="item-title">
                                        <kylo-timer start-time="vm.feed.timeSinceEndTime"></kylo-timer>
                                   </span>
                        <span class="column-title column-title-bottom">Since</span>
                        </div>
                </md-list-item>
                <md-divider></md-divider>

                <md-list-item >
                    <div layout="column"  class="item-column md-list-item-text ">
                        <span class="item-title">{{vm.feed.runTimeString}}</span>
                        <span class="column-title column-title-bottom">Last Run Time</span>
                        </div>
                </md-list-item>
                    </md-list>

                  <md-divider></md-divider>

                  <div layout="column" class="layout-padding-top-bottom layout-padding-left-right"  layout-align="space-between start">
                    <div class="md-subheader layout-padding-bottom">Feed Manager</div>
                    <span class="layout-padding-bottom">
                       <a href ng-click="vm.gotoFeedDetails($event)">Feed Details</a>
                    </span>
                  </div>


                </md-content>
            </body-section>
        </card-layout>
        <tba-alerts feed-name="{{vm.feedName}}" style="margin-left:8px;" >
        </tba-alerts>
    </div>

</div>


