Skip to content
This repository has been archived by the owner on Oct 20, 2021. It is now read-only.

Commit

Permalink
feat(rate-limit): Set appropriate time-window options for each type o…
Browse files Browse the repository at this point in the history
…f rate-limit

Closes gravitee-io/issues#744
  • Loading branch information
brasseld authored and NicolasGeraud committed Sep 7, 2017
1 parent b36f0cb commit 2b542e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/management/api/plans/apiPlans.controller.ts
Expand Up @@ -88,7 +88,9 @@ class ApiPlansController {
}
};

$scope.timeUnits = ['SECONDS', 'MINUTES', 'HOURS', 'DAYS'];
$scope.rateLimitTimeUnits = ['SECONDS', 'MINUTES'];
$scope.quotaTimeUnits = ['HOURS', 'DAYS', "WEEKS", "MONTHS"];

$scope.methods = ['GET', 'POST', 'PUT', 'DELETE', 'HEAD', 'PATCH', 'OPTIONS', 'TRACE', 'CONNECT'];

this.resetResourceFiltering();
Expand Down
4 changes: 2 additions & 2 deletions src/management/api/plans/apiPlans.html
Expand Up @@ -201,7 +201,7 @@ <h4>Rate limit</h4>
<md-input-container class="md-block">
<label>Period time unit</label>
<md-select ng-model="rateLimit.periodTimeUnit" placeholder="Select a time unit" ng-required="rateLimit.limit">
<md-option ng-value="timeUnit" ng-repeat="timeUnit in timeUnits">{{timeUnit}}</md-option>
<md-option ng-value="timeUnit" ng-repeat="timeUnit in rateLimitTimeUnits">{{timeUnit}}</md-option>
</md-select>
</md-input-container>
</div>
Expand All @@ -228,7 +228,7 @@ <h4>Quota</h4>
<md-input-container class="md-block">
<label>Period time unit</label>
<md-select ng-model="quota.periodTimeUnit" placeholder="Select a time unit" ng-required="quota.limit">
<md-option ng-value="timeUnit" ng-repeat="timeUnit in timeUnits">{{timeUnit}}</md-option>
<md-option ng-value="timeUnit" ng-repeat="timeUnit in quotaTimeUnits">{{timeUnit}}</md-option>
</md-select>
</md-input-container>
</div>
Expand Down

0 comments on commit 2b542e3

Please sign in to comment.