2025-01-07 19:07:33 +02:00
|
|
|
<!--
|
|
|
|
|
|
2025-02-25 09:39:16 +02:00
|
|
|
Copyright © 2016-2025 The Thingsboard Authors
|
2025-01-07 19:07:33 +02:00
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
-->
|
|
|
|
|
<section [formGroup]="restApiCallConfigForm" class="flex flex-col">
|
|
|
|
|
<mat-form-field class="mat-block" subscriptSizing="dynamic">
|
2025-01-14 10:48:07 +02:00
|
|
|
<mat-label translate>rule-node-config.endpoint-url-pattern</mat-label>
|
2025-01-07 19:07:33 +02:00
|
|
|
<input required matInput formControlName="restEndpointUrlPattern">
|
|
|
|
|
<mat-error *ngIf="restApiCallConfigForm.get('restEndpointUrlPattern').hasError('required')">
|
2025-01-14 10:48:07 +02:00
|
|
|
{{ 'rule-node-config.endpoint-url-pattern-required' | translate }}
|
2025-01-07 19:07:33 +02:00
|
|
|
</mat-error>
|
2025-01-14 10:48:07 +02:00
|
|
|
<mat-hint translate>rule-node-config.general-pattern-hint</mat-hint>
|
2025-01-07 19:07:33 +02:00
|
|
|
</mat-form-field>
|
|
|
|
|
<mat-form-field class="mat-block">
|
2025-01-14 10:48:07 +02:00
|
|
|
<mat-label translate>rule-node-config.request-method</mat-label>
|
2025-01-07 19:07:33 +02:00
|
|
|
<mat-select formControlName="requestMethod">
|
|
|
|
|
<mat-option *ngFor="let requestType of httpRequestTypes" [value]="requestType">
|
|
|
|
|
{{ requestType }}
|
|
|
|
|
</mat-option>
|
|
|
|
|
</mat-select>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<mat-checkbox formControlName="enableProxy">
|
2025-01-14 10:48:07 +02:00
|
|
|
{{ 'rule-node-config.enable-proxy' | translate }}
|
2025-01-07 19:07:33 +02:00
|
|
|
</mat-checkbox>
|
|
|
|
|
<mat-checkbox *ngIf="!restApiCallConfigForm.get('enableProxy').value" formControlName="useSimpleClientHttpFactory">
|
2025-01-14 10:48:07 +02:00
|
|
|
{{ 'rule-node-config.use-simple-client-http-factory' | translate }}
|
2025-01-07 19:07:33 +02:00
|
|
|
</mat-checkbox>
|
|
|
|
|
<mat-checkbox formControlName="parseToPlainText">
|
2025-01-14 10:48:07 +02:00
|
|
|
{{ 'rule-node-config.parse-to-plain-text' | translate }}
|
2025-01-07 19:07:33 +02:00
|
|
|
</mat-checkbox>
|
2025-01-14 10:48:07 +02:00
|
|
|
<div class="tb-hint" style="padding-bottom: 5px;" translate>rule-node-config.parse-to-plain-text-hint</div>
|
2025-01-07 19:07:33 +02:00
|
|
|
<mat-checkbox formControlName="ignoreRequestBody">
|
2025-01-14 10:48:07 +02:00
|
|
|
{{ 'rule-node-config.ignore-request-body' | translate }}
|
2025-01-07 19:07:33 +02:00
|
|
|
</mat-checkbox>
|
|
|
|
|
<div *ngIf="restApiCallConfigForm.get('enableProxy').value">
|
|
|
|
|
<mat-checkbox formControlName="useSystemProxyProperties">
|
2025-01-14 10:48:07 +02:00
|
|
|
{{ 'rule-node-config.use-system-proxy-properties' | translate }}
|
2025-01-07 19:07:33 +02:00
|
|
|
</mat-checkbox>
|
|
|
|
|
<div *ngIf="!restApiCallConfigForm.get('useSystemProxyProperties').value">
|
|
|
|
|
<div class="gt-sm:flex gt-sm:flex-row gt-sm:gap-2">
|
|
|
|
|
<mat-form-field class="mat-block gt-sm:max-w-10% gt-sm:flex-full">
|
2025-01-14 10:48:07 +02:00
|
|
|
<mat-label translate>rule-node-config.proxy-scheme</mat-label>
|
2025-01-07 19:07:33 +02:00
|
|
|
<mat-select formControlName="proxyScheme">
|
|
|
|
|
<mat-option *ngFor="let proxyScheme of proxySchemes" [value]="proxyScheme">
|
|
|
|
|
{{ proxyScheme }}
|
|
|
|
|
</mat-option>
|
|
|
|
|
</mat-select>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<mat-form-field class="md-block gt-sm:max-w-50% gt-sm:flex-full">
|
2025-01-14 10:48:07 +02:00
|
|
|
<mat-label translate>rule-node-config.proxy-host</mat-label>
|
2025-01-07 19:07:33 +02:00
|
|
|
<input matInput required formControlName="proxyHost">
|
|
|
|
|
<mat-error *ngIf="restApiCallConfigForm.get('proxyHost').hasError('required')">
|
2025-01-14 10:48:07 +02:00
|
|
|
{{ 'rule-node-config.proxy-host-required' | translate }}
|
2025-01-07 19:07:33 +02:00
|
|
|
</mat-error>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<mat-form-field class="mat-block gt-sm:max-w-40% gt-sm:flex-full">
|
2025-01-14 10:48:07 +02:00
|
|
|
<mat-label translate>rule-node-config.proxy-port</mat-label>
|
2025-01-07 19:07:33 +02:00
|
|
|
<input matInput required formControlName="proxyPort" type="number" step="1">
|
|
|
|
|
<mat-error *ngIf="restApiCallConfigForm.get('proxyPort').hasError('required')">
|
2025-01-14 10:48:07 +02:00
|
|
|
{{ 'rule-node-config.proxy-port-required' | translate }}
|
2025-01-07 19:07:33 +02:00
|
|
|
</mat-error>
|
|
|
|
|
<mat-error
|
|
|
|
|
*ngIf="restApiCallConfigForm.get('proxyPort').hasError('min') || restApiCallConfigForm.get('proxyPort').hasError('max')">
|
2025-01-14 10:48:07 +02:00
|
|
|
{{ 'rule-node-config.proxy-port-range' | translate }}
|
2025-01-07 19:07:33 +02:00
|
|
|
</mat-error>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</div>
|
|
|
|
|
<mat-form-field class="mat-block">
|
2025-01-14 10:48:07 +02:00
|
|
|
<mat-label translate>rule-node-config.proxy-user</mat-label>
|
2025-01-07 19:07:33 +02:00
|
|
|
<input matInput formControlName="proxyUser">
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<mat-form-field class="mat-block">
|
2025-01-14 10:48:07 +02:00
|
|
|
<mat-label translate>rule-node-config.proxy-password</mat-label>
|
2025-01-07 19:07:33 +02:00
|
|
|
<input matInput formControlName="proxyPassword">
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<mat-form-field *ngIf="!restApiCallConfigForm.get('useSimpleClientHttpFactory').value || restApiCallConfigForm.get('enableProxy').value" class="mat-block"
|
|
|
|
|
subscriptSizing="dynamic">
|
2025-01-14 10:48:07 +02:00
|
|
|
<mat-label translate>rule-node-config.read-timeout</mat-label>
|
2025-01-07 19:07:33 +02:00
|
|
|
<input type="text" min="0" [max]="IntLimit" inputmode="numeric" pattern="[0-9]*" matInput formControlName="readTimeoutMs">
|
2025-01-14 10:48:07 +02:00
|
|
|
<mat-hint translate>rule-node-config.read-timeout-hint</mat-hint>
|
2025-01-07 19:07:33 +02:00
|
|
|
<mat-error
|
|
|
|
|
*ngIf="restApiCallConfigForm.get('readTimeoutMs').hasError('max')">
|
2025-01-14 10:48:07 +02:00
|
|
|
{{ 'rule-node-config.int-range' | translate }}
|
2025-01-07 19:07:33 +02:00
|
|
|
</mat-error>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<mat-form-field class="mat-block" subscriptSizing="dynamic">
|
2025-01-14 10:48:07 +02:00
|
|
|
<mat-label translate>rule-node-config.max-parallel-requests-count</mat-label>
|
2025-01-07 19:07:33 +02:00
|
|
|
<input type="text" min="0" [max]="IntLimit" inputmode="numeric" pattern="[0-9]*" matInput formControlName="maxParallelRequestsCount">
|
2025-01-14 10:48:07 +02:00
|
|
|
<mat-hint translate>rule-node-config.max-parallel-requests-count-hint</mat-hint>
|
2025-01-07 19:07:33 +02:00
|
|
|
<mat-error
|
|
|
|
|
*ngIf="restApiCallConfigForm.get('maxParallelRequestsCount').hasError('max')">
|
2025-01-14 10:48:07 +02:00
|
|
|
{{ 'rule-node-config.int-range' | translate }}
|
2025-01-07 19:07:33 +02:00
|
|
|
</mat-error>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<mat-form-field class="mat-block" subscriptSizing="dynamic">
|
2025-01-14 10:48:07 +02:00
|
|
|
<mat-label translate>rule-node-config.max-response-size</mat-label>
|
2025-01-07 19:07:33 +02:00
|
|
|
<input type="text" min="1" [max]="MemoryBufferSizeInKbLimit" inputmode="numeric" pattern="[0-9]*" matInput formControlName="maxInMemoryBufferSizeInKb">
|
2025-01-14 10:48:07 +02:00
|
|
|
<mat-hint translate>rule-node-config.max-response-size-hint</mat-hint>
|
2025-01-07 19:07:33 +02:00
|
|
|
<mat-error
|
|
|
|
|
*ngIf="restApiCallConfigForm.get('maxInMemoryBufferSizeInKb').hasError('min') || restApiCallConfigForm.get('maxInMemoryBufferSizeInKb').hasError('max')">
|
2025-01-14 10:48:07 +02:00
|
|
|
{{ 'rule-node-config.memory-buffer-size-range' | translate: { max: MemoryBufferSizeInKbLimit } }}
|
2025-01-07 19:07:33 +02:00
|
|
|
</mat-error>
|
|
|
|
|
</mat-form-field>
|
2025-01-14 10:48:07 +02:00
|
|
|
<label translate class="tb-title">rule-node-config.headers</label>
|
|
|
|
|
<div class="tb-hint" [innerHTML]="'rule-node-config.headers-hint' | translate | safe: 'html'"> </div>
|
2025-01-07 19:07:33 +02:00
|
|
|
<tb-kv-map-config-old
|
|
|
|
|
required="false"
|
|
|
|
|
formControlName="headers"
|
2025-01-14 10:48:07 +02:00
|
|
|
keyText="rule-node-config.header"
|
|
|
|
|
keyRequiredText="rule-node-config.header-required"
|
|
|
|
|
valText="rule-node-config.value"
|
|
|
|
|
valRequiredText="rule-node-config.value-required">
|
2025-01-07 19:07:33 +02:00
|
|
|
</tb-kv-map-config-old>
|
|
|
|
|
<tb-credentials-config formControlName="credentials" [disableCertPemCredentials]="restApiCallConfigForm.get('useSimpleClientHttpFactory').value"></tb-credentials-config>
|
|
|
|
|
</section>
|