<div class="row-fluid" ng-controller="Kubernetes.Pods">
  <div hawtio-confirm-dialog="connect.dialog.show" title="Connect to {{connect.containerName}}?" ok-button-text="Connect" on-ok="connect.onOK()">
    <div class="dialog-body">
      <p>Please enter the user name and password for {{connect.containerName}}:</p>
      <div class="control-group">
        <label class="control-label">User name: </label>
        <div class="controls">
          <input name="userName" ng-model="connect.userName" type="text" autofill>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label">Password: </label>
        <div class="controls">
          <input name="password" ng-model="connect.password" type="password" autofill>
        </div>
      </div>
      <div class="control-group">
        <div class="controls">
          <label class="checkbox">
            <input type="checkbox" ng-model="connect.saveCredentials"> Save these credentials as the default
          </label>
        </div>
      </div>
      <div>
      </div>
    </div>
  </div>
  <script type="text/ng-template" id="imageTemplate.html">
    <div class="ngCellText">
      <!-- in table -->
      <span ng-hide="data">
        <span ng-repeat="container in row.entity.desiredState.manifest.containers">
          <a target="dockerRegistry" href="https://registry.hub.docker.com/u/{{container.image}}" title="{{container.name}}">{{container.image}}</a>
        </span>
      </span>
      <!-- in detail view -->
      <span ng-show="data">
        <a target="dockerRegistry" ng-href="https://registry.hub.docker.com/u/{{data}}" title="{{data}}">{{data}}</a>
      </span>
    </div>
  </script>
  <script type="text/ng-template" id="configDetail.html">
    <pre>{{data}}</pre>
  </script>
  <script type="text/ng-template" id="envItemTemplate.html">
    <span ng-controller="Kubernetes.EnvItem">
      <span class="blue">{{key}}</span>=<span class="green">{{value}}</span>
    </span>
  </script>
  <div class="row-fluid">
    <div class="span12" ng-show="pods.length">
      <span ng-show="!id">
        <hawtio-filter ng-model="tableConfig.filterOptions.filterText"
                       css-class="input-xxlarge"
                       placeholder="Filter pods..."
                       save-as="kubernetes-pods-text-filter"></hawtio-filter>
      </span>
      <button ng-show="fetched"
              class="btn btn-danger pull-right"
              ng-disabled="!id && tableConfig.selectedItems.length == 0"
              ng-click="deletePrompt(id || tableConfig.selectedItems)">
        <i class="icon-remove"></i> Delete
      </button>
      <span class="pull-right">&nbsp;</span>
      <button ng-show="id"
              class="btn btn-primary pull-right"
              ng-click="id = undefined"><i class="icon-list"></i></button>
    </div>
  </div>
  <div class="row-fluid">
    <div class="span12">
      <div ng-hide="fetched">
        <div class="align">
          <i class="icon-spinner icon-spin"></i>
        </div>
      </div>
      <div ng-show="fetched && !id">
        <div ng-hide="pods.length" class="align-center">
          <p class="alert alert-info">There are no pods currently running.</p>
        </div>
        <div ng-show="pods.length">
          <table class="table table-condensed table-striped"
                 hawtio-simple-table="tableConfig"></table>
        </div>
      </div>
    </div>
  </div>
  <div class="row-fluid" ng-show="fetched && id">
    <div class="span12">
      <div hawtio-object="item" config="podDetail"></div>
    </div>
  </div>
</div>
