<page-header ng-if="ctrl.state.viewReady" title="'Application list'" breadcrumbs="['Applications']" reload="true"></page-header>

<kubernetes-view-loading view-ready="ctrl.state.viewReady"></kubernetes-view-loading>

<div ng-if="ctrl.state.viewReady">
  <div class="row">
    <div class="col-sm-12" data-cy="k8sApp-appList">
      <rd-widget>
        <rd-widget-body classes="no-padding">
          <uib-tabset active="ctrl.state.activeTab" justified="true" type="pills">
            <uib-tab index="0" classes="btn-sm" select="ctrl.selectTab(0)">
              <uib-tab-heading class="vertical-center"> <pr-icon icon="'box'" feather="true"></pr-icon> Applications </uib-tab-heading>
              <kubernetes-applications-datatable
                dataset="ctrl.state.applications"
                table-key="kubernetes.applications"
                settings-key="kubernetes.applications"
                order-by="Name"
                remove-action="ctrl.removeAction"
                refresh-callback="ctrl.getApplications"
                on-publishing-mode-click="(ctrl.onPublishingModeClick)"
                is-primary="true"
              >
              </kubernetes-applications-datatable>
            </uib-tab>
            <uib-tab index="1" classes="btn-sm" select="ctrl.selectTab(1)">
              <uib-tab-heading class="vertical-center"> <pr-icon icon="'svg-dataflow'"></pr-icon> Port mappings </uib-tab-heading>
              <kubernetes-applications-ports-datatable dataset="ctrl.state.ports" table-key="kubernetes.applications.ports" order-by="Name" refresh-callback="ctrl.getApplications">
              </kubernetes-applications-ports-datatable>
            </uib-tab>
            <uib-tab index="2" classes="btn-sm" select="ctrl.selectTab(2)">
              <uib-tab-heading class="vertical-center"> <pr-icon icon="'list'" feather="true"></pr-icon> Stacks </uib-tab-heading>
              <kubernetes-applications-stacks-datatable
                dataset="ctrl.state.stacks"
                table-key="kubernetes.applications.stacks"
                order-by="Name"
                refresh-callback="ctrl.getApplications"
                remove-action="ctrl.removeStacksAction"
              >
              </kubernetes-applications-stacks-datatable>
            </uib-tab>
          </uib-tabset>
        </rd-widget-body>
      </rd-widget>
    </div>
  </div>
</div>
