feat(support): make support type dynamic (#3621)

pull/3646/head
itsconquest 2020-03-19 09:38:56 +13:00 committed by GitHub
parent a11a348893
commit 2c400eb3b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -45,8 +45,8 @@
</div>
<div style="margin-top: 10px; margin-bottom: 95px;">
<label for="endpoint_count" class="col-sm-7 control-label text-left"
style="margin-top: 7px;">Hosts</label>
<label for="endpoint_count" class="col-sm-7 control-label text-left" style="margin-top: 7px;">No. of
{{ state.supportType }}(s)</label>
<div class="col-sm-5">
<input type="number" class="form-control" ng-model="formValues.hostCount" id="endpoint_count"
placeholder="{{ state.placeholder }}" min="{{ state.minHosts }}">

View File

@ -8,7 +8,8 @@ angular.module('portainer.app')
$scope.state = {
minHosts: 0,
placeholder: 0
placeholder: 0,
supportType: ''
};
$scope.isBuyButtonEnabled = function () {
@ -22,16 +23,19 @@ angular.module('portainer.app')
$scope.formValues.hostCount = 1;
$scope.state.minHosts = 1;
$scope.state.placeholder = 1;
$scope.state.supportType = 'Person';
}
if ($scope.product.Id == 2 || $scope.product.Id == 3) {
$scope.formValues.hostCount = 4;
$scope.state.minHosts = 4;
$scope.state.placeholder = 4;
$scope.state.supportType = 'Host';
}
if ($scope.product.Id == 4 || $scope.product.Id == 5) {
$scope.formValues.hostCount = 10;
$scope.state.minHosts = 10;
$scope.state.placeholder = 10;
$scope.state.supportType = 'Host'
}
}