<!--
Copyright 2017 The Kubernetes Authors.

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.
-->

<!--
   External endpoints are shown with link, to make it easy to access the deployed application.
   This is important because the text might be ellipsized and copy & paste not possible. The
   Link is always shown independent of the endpoint capabilities to support HTTP.
-->
<div>
  <div *ngFor="let endpoint of endpoints">
    <div *ngFor="let port of endpoint?.ports">
      <div>
        <a href="http://{{endpoint.host}}:{{port.port}}"
           target="_blank">
          {{endpoint.host}}:{{port.port}}
          <mat-icon *ngIf="!hideExternalIcon"
                    class="kd-endpoint-icon">open_in_new</mat-icon>
        </a>
      </div>
      <div *ngIf="!port.port">
        <a href="http://{{endpoint.host}}:{{port.nodePort}}"
           target="_blank">
          {{endpoint.host}}:{{port.nodePort}}
          <mat-icon *ngIf="!hideExternalIcon"
                    class="kd-endpoint-icon">open_in_new</mat-icon>
        </a>
      </div>
    </div>
    <div *ngIf="!endpoint.ports?.length">
      <a href="http://{{endpoint.host}}"
         target="_blank">
        {{endpoint.host}}
        <mat-icon *ngIf="!hideExternalIcon"
                  class="kd-endpoint-icon">open_in_new</mat-icon>
      </a>
    </div>
  </div>
  <div *ngIf="endpoints.length === 0">-</div>
</div>
