portainer/portainer

View on GitHub
app/docker/components/imageRegistry/por-image-registry-rate-limits.html

Summary

Maintainability
Test Coverage
<div class="form-group" ng-if="$ctrl.pullRateLimits">
  <div class="col-sm-12 small">
    <div ng-if="$ctrl.pullRateLimits.remaining > 0" class="text-muted vertical-center">
      <pr-icon icon="'alert-circle'" mode="'primary'"></pr-icon>
      <span ng-if="$ctrl.isAuthenticated">
        You are currently using a free account to pull images from DockerHub and will be limited to 200 pulls every 6 hours. Remaining pulls:
        <span style="font-weight: bold">{{ $ctrl.pullRateLimits.remaining }}/{{ $ctrl.pullRateLimits.limit }}</span>
      </span>
      <span ng-if="!$ctrl.isAuthenticated">
        <span ng-if="$ctrl.isAdmin">
          You are currently using an anonymous account to pull images from DockerHub and will be limited to 100 pulls every 6 hours. You can configure DockerHub authentication in
          the
          <a ui-sref="portainer.registries">Registries View</a>. Remaining pulls:
          <span style="font-weight: bold">{{ $ctrl.pullRateLimits.remaining }}/{{ $ctrl.pullRateLimits.limit }}</span>
        </span>
        <span ng-if="!$ctrl.isAdmin">
          You are currently using an anonymous account to pull images from DockerHub and will be limited to 100 pulls every 6 hours. Contact your administrator to configure
          DockerHub authentication. Remaining pulls: <span style="font-weight: bold">{{ $ctrl.pullRateLimits.remaining }}/{{ $ctrl.pullRateLimits.limit }}</span>
        </span>
      </span>
    </div>
    <div ng-if="$ctrl.pullRateLimits.remaining <= 0" class="text-warning vertical-center">
      <pr-icon icon="'alert-triangle'" mode="'warning'"></pr-icon>
      <span ng-if="$ctrl.isAuthenticated">
        Your authorized pull count quota as a free user is now exceeded.
        <span ng-transclude="rateLimitExceeded">You will not be able to pull any image from the DockerHub registry.</span>
      </span>
      <span ng-if="!$ctrl.isAuthenticated">
        Your authorized pull count quota as an anonymous user is now exceeded.
        <span ng-transclude="rateLimitExceeded">You will not be able to pull any image from the DockerHub registry.</span>
      </span>
    </div>
  </div>
</div>