feat(services): hide webhook interface (#4794)

pull/4414/merge
Chaim Lev-Ari 2021-02-25 00:08:22 +02:00 committed by GitHub
parent 7e7127831d
commit c72d07441d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 16 deletions

View File

@ -31,7 +31,6 @@ angular.module('portainer.docker').controller('CreateServiceController', [
'HttpRequestHelper', 'HttpRequestHelper',
'NodeService', 'NodeService',
'WebhookService', 'WebhookService',
'EndpointProvider',
'endpoint', 'endpoint',
function ( function (
$q, $q,
@ -57,9 +56,10 @@ angular.module('portainer.docker').controller('CreateServiceController', [
HttpRequestHelper, HttpRequestHelper,
NodeService, NodeService,
WebhookService, WebhookService,
EndpointProvider,
endpoint endpoint
) { ) {
$scope.endpoint = endpoint;
$scope.formValues = { $scope.formValues = {
Name: '', Name: '',
RegistryModel: new PorImageRegistryModel(), RegistryModel: new PorImageRegistryModel(),
@ -493,7 +493,7 @@ angular.module('portainer.docker').controller('CreateServiceController', [
const resourceControl = data.Portainer.ResourceControl; const resourceControl = data.Portainer.ResourceControl;
const userId = Authentication.getUserDetails().ID; const userId = Authentication.getUserDetails().ID;
const rcPromise = ResourceControlService.applyResourceControl(userId, accessControlData, resourceControl); const rcPromise = ResourceControlService.applyResourceControl(userId, accessControlData, resourceControl);
const webhookPromise = $q.when($scope.formValues.Webhook && WebhookService.createServiceWebhook(serviceId, EndpointProvider.endpointID())); const webhookPromise = $q.when(endpoint.Type !== 4 && $scope.formValues.Webhook && WebhookService.createServiceWebhook(serviceId, endpoint.ID));
return $q.all([rcPromise, webhookPromise]); return $q.all([rcPromise, webhookPromise]);
}) })
.then(function success() { .then(function success() {

View File

@ -95,6 +95,7 @@
</div> </div>
<!-- !port-mapping --> <!-- !port-mapping -->
<!-- create-webhook --> <!-- create-webhook -->
<div ng-if="endpoint.Type !== 4">
<div class="col-sm-12 form-section-title"> <div class="col-sm-12 form-section-title">
Webhooks Webhooks
</div> </div>
@ -110,6 +111,7 @@
<label class="switch" style="margin-left: 20px;"> <input type="checkbox" ng-model="formValues.Webhook" /><i></i> </label> <label class="switch" style="margin-left: 20px;"> <input type="checkbox" ng-model="formValues.Webhook" /><i></i> </label>
</div> </div>
</div> </div>
</div>
<!-- !create-webhook --> <!-- !create-webhook -->
<!-- access-control --> <!-- access-control -->
<por-access-control-form form-data="formValues.AccessControlData"></por-access-control-form> <por-access-control-form form-data="formValues.AccessControlData"></por-access-control-form>