2020-06-21 20:38:43 +03:00
|
|
|
<!--
|
|
|
|
|
|
|
|
|
|
Copyright © 2016-2020 The Thingsboard Authors
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
-->
|
|
|
|
|
<div class="tb-details-buttons" fxLayout.xs="column">
|
|
|
|
|
<button mat-raised-button color="primary"
|
|
|
|
|
[disabled]="(isLoading$ | async)"
|
|
|
|
|
(click)="onEntityAction($event, 'makePublic')"
|
|
|
|
|
[fxShow]="!isEdit && edgeScope === 'tenant' && !isAssignedToCustomer(entity) && !entity?.customerIsPublic">
|
|
|
|
|
{{'edge.make-public' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
<button mat-raised-button color="primary"
|
|
|
|
|
[disabled]="(isLoading$ | async)"
|
|
|
|
|
(click)="onEntityAction($event, 'assignToCustomer')"
|
|
|
|
|
[fxShow]="!isEdit && edgeScope === 'tenant' && !isAssignedToCustomer(entity)">
|
|
|
|
|
{{'edge.assign-to-customer' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
<button mat-raised-button color="primary"
|
|
|
|
|
[disabled]="(isLoading$ | async)"
|
|
|
|
|
(click)="onEntityAction($event, 'unassignFromCustomer')"
|
|
|
|
|
[fxShow]="!isEdit && (edgeScope === 'customer' || edgeScope === 'tenant') && isAssignedToCustomer(entity)">
|
|
|
|
|
{{ (entity?.customerIsPublic ? 'edge.make-private' : 'edge.unassign-from-customer') | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
<button mat-raised-button color="primary" fxFlex.xs
|
|
|
|
|
[disabled]="(isLoading$ | async)"
|
|
|
|
|
(click)="onEntityAction($event, 'delete')"
|
|
|
|
|
[fxShow]="!hideDelete() && !isEdit">
|
|
|
|
|
{{'edge.delete' | translate }}
|
|
|
|
|
</button>
|
2020-12-21 19:14:22 +02:00
|
|
|
<div fxLayout="row" fxLayout.xs="column">
|
|
|
|
|
<button mat-raised-button color="primary"
|
|
|
|
|
[disabled]="(isLoading$ | async)"
|
|
|
|
|
(click)="onEntityAction($event, 'openEdgeAssets')"
|
2020-12-29 16:55:07 +02:00
|
|
|
[fxShow]="!isEdit && (edgeScope === 'tenant' || edgeScope === 'customer_user')">
|
2020-12-21 19:14:22 +02:00
|
|
|
{{'edge.manage-edge-assets' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
<button mat-raised-button color="primary"
|
|
|
|
|
[disabled]="(isLoading$ | async)"
|
|
|
|
|
(click)="onEntityAction($event, 'openEdgeDevices')"
|
2020-12-29 16:55:07 +02:00
|
|
|
[fxShow]="!isEdit && (edgeScope === 'tenant' || edgeScope === 'customer_user')">
|
2020-12-21 19:14:22 +02:00
|
|
|
{{'edge.manage-edge-devices' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
<button mat-raised-button color="primary"
|
|
|
|
|
[disabled]="(isLoading$ | async)"
|
|
|
|
|
(click)="onEntityAction($event, 'openEdgeEntityViews')"
|
2020-12-29 16:55:07 +02:00
|
|
|
[fxShow]="!isEdit && (edgeScope === 'tenant' || edgeScope === 'customer_user')">
|
2020-12-21 19:14:22 +02:00
|
|
|
{{'edge.manage-edge-entity-views' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
<button mat-raised-button color="primary"
|
|
|
|
|
[disabled]="(isLoading$ | async)"
|
|
|
|
|
(click)="onEntityAction($event, 'openEdgeDashboards')"
|
2020-12-29 16:55:07 +02:00
|
|
|
[fxShow]="!isEdit && (edgeScope === 'tenant' || edgeScope === 'customer_user')">
|
2020-12-21 19:14:22 +02:00
|
|
|
{{'edge.manage-edge-dashboards' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
<button mat-raised-button color="primary"
|
|
|
|
|
[disabled]="(isLoading$ | async)"
|
|
|
|
|
(click)="onEntityAction($event, 'openEdgeRuleChains')"
|
|
|
|
|
[fxShow]="!isEdit && edgeScope === 'tenant'">
|
|
|
|
|
{{'edge.manage-edge-rulechains' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
2020-06-21 20:38:43 +03:00
|
|
|
<div fxLayout="row" fxLayout.xs="column">
|
|
|
|
|
<button mat-raised-button
|
|
|
|
|
ngxClipboard
|
|
|
|
|
(cbOnSuccess)="onEdgeIdCopied($event)"
|
|
|
|
|
[cbContent]="entity?.id?.id"
|
|
|
|
|
[fxShow]="!isEdit">
|
|
|
|
|
<mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon>
|
|
|
|
|
<span translate>edge.copy-id</span>
|
|
|
|
|
</button>
|
2020-11-09 13:25:02 +02:00
|
|
|
<button mat-raised-button
|
|
|
|
|
ngxClipboard
|
2020-12-22 20:12:04 +02:00
|
|
|
(cbOnSuccess)="onEdgeInfoCopied('key')"
|
2020-11-09 13:25:02 +02:00
|
|
|
[cbContent]="entity?.routingKey"
|
2020-12-29 13:13:25 +02:00
|
|
|
[fxShow]="!isEdit && edgeScope === 'tenant'">
|
2020-11-09 13:25:02 +02:00
|
|
|
<mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon>
|
|
|
|
|
<span translate>edge.copy-edge-key</span>
|
|
|
|
|
</button>
|
2020-11-05 15:56:58 +02:00
|
|
|
<button mat-raised-button
|
|
|
|
|
ngxClipboard
|
2020-12-22 20:12:04 +02:00
|
|
|
(cbOnSuccess)="onEdgeInfoCopied('secret')"
|
2020-11-09 13:25:02 +02:00
|
|
|
[cbContent]="entity?.secret"
|
2020-12-29 13:13:25 +02:00
|
|
|
[fxShow]="!isEdit && edgeScope === 'tenant'">
|
2020-11-05 15:56:58 +02:00
|
|
|
<mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon>
|
|
|
|
|
<span translate>edge.copy-edge-secret</span>
|
|
|
|
|
</button>
|
2020-12-22 20:12:04 +02:00
|
|
|
<button mat-raised-button
|
|
|
|
|
ngxClipboard
|
|
|
|
|
[disabled]="(isLoading$ | async)"
|
|
|
|
|
(click)="onEntityAction($event, 'syncEdge')"
|
2020-12-29 13:13:25 +02:00
|
|
|
[fxShow]="!isEdit && edgeScope === 'tenant'">
|
2020-12-22 20:12:04 +02:00
|
|
|
<mat-icon svgIcon="mdi:sync"></mat-icon>
|
|
|
|
|
<span translate>edge.sync</span>
|
|
|
|
|
</button>
|
2020-06-21 20:38:43 +03:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mat-padding" fxLayout="column">
|
|
|
|
|
<mat-form-field class="mat-block"
|
|
|
|
|
[fxShow]="!isEdit && isAssignedToCustomer(entity)
|
|
|
|
|
&& !entity?.customerIsPublic && edgeScope === 'tenant'">
|
|
|
|
|
<mat-label translate>edge.assigned-to-customer</mat-label>
|
|
|
|
|
<input matInput disabled [ngModel]="entity?.customerTitle">
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<div class="tb-small" style="padding-bottom: 10px; padding-left: 2px;"
|
|
|
|
|
[fxShow]="!isEdit && entity?.customerIsPublic && (edgeScope === 'customer' || edgeScope === 'tenant')">
|
|
|
|
|
{{ 'edge.public' | translate }}
|
|
|
|
|
</div>
|
|
|
|
|
<form [formGroup]="entityForm">
|
|
|
|
|
<fieldset [disabled]="(isLoading$ | async) || !isEdit">
|
|
|
|
|
<mat-form-field class="mat-block">
|
|
|
|
|
<mat-label translate>edge.name</mat-label>
|
|
|
|
|
<input matInput formControlName="name" required>
|
|
|
|
|
<mat-error *ngIf="entityForm.get('name').hasError('required')">
|
|
|
|
|
{{ 'edge.name-required' | translate }}
|
|
|
|
|
</mat-error>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<tb-entity-subtype-autocomplete
|
|
|
|
|
formControlName="type"
|
|
|
|
|
[required]="true"
|
|
|
|
|
[entityType]="entityType.EDGE">
|
|
|
|
|
</tb-entity-subtype-autocomplete>
|
2020-12-29 13:13:25 +02:00
|
|
|
<div fxLayout="row" [fxShow]="edgeScope === 'tenant'">
|
2020-10-16 18:26:22 +03:00
|
|
|
<fieldset fxFlex>
|
2020-12-23 18:24:41 +02:00
|
|
|
<div class="tb-hint" [innerHTML]="'edge.edge-license-key-hint' | translate"></div>
|
2020-10-16 18:26:22 +03:00
|
|
|
<mat-form-field class="mat-block">
|
2020-12-23 18:24:41 +02:00
|
|
|
<mat-label translate>edge.edge-license-key</mat-label>
|
|
|
|
|
<input matInput formControlName="edgeLicenseKey" required>
|
|
|
|
|
<mat-error *ngIf="entityForm.get('edgeLicenseKey').hasError('required')">
|
|
|
|
|
{{ 'edge.edge-license-key-required' | translate }}
|
2020-10-16 18:26:22 +03:00
|
|
|
</mat-error>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</fieldset>
|
|
|
|
|
</div>
|
2020-12-29 13:13:25 +02:00
|
|
|
<div fxLayout="row" [fxShow]="edgeScope === 'tenant'">
|
2020-10-16 18:26:22 +03:00
|
|
|
<fieldset fxFlex>
|
2020-12-23 18:24:41 +02:00
|
|
|
<div translate class="tb-hint">edge.cloud-endpoint-hint</div>
|
2020-10-16 18:26:22 +03:00
|
|
|
<mat-form-field class="mat-block">
|
2020-12-23 18:24:41 +02:00
|
|
|
<mat-label translate>edge.cloud-endpoint</mat-label>
|
|
|
|
|
<input matInput formControlName="cloudEndpoint" required>
|
|
|
|
|
<mat-error *ngIf="entityForm.get('cloudEndpoint').hasError('required')">
|
|
|
|
|
{{ 'edge.cloud-endpoint-required' | translate }}
|
2020-10-16 18:26:22 +03:00
|
|
|
</mat-error>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</fieldset>
|
|
|
|
|
</div>
|
2020-12-29 13:13:25 +02:00
|
|
|
<div fxLayout="row" [fxShow]="edgeScope === 'tenant'">
|
2020-06-21 20:38:43 +03:00
|
|
|
<fieldset fxFlex disabled>
|
2020-12-22 20:12:04 +02:00
|
|
|
<mat-form-field class="mat-block" fxFlex>
|
2020-06-21 20:38:43 +03:00
|
|
|
<mat-label translate>edge.edge-key</mat-label>
|
|
|
|
|
<input matInput formControlName="routingKey">
|
|
|
|
|
</mat-form-field>
|
2020-12-21 19:14:22 +02:00
|
|
|
</fieldset>
|
2020-12-22 20:12:04 +02:00
|
|
|
<button mat-button mat-icon-button type="button" ngxClipboard (cbOnSuccess)="onEdgeInfoCopied('key')"
|
|
|
|
|
[cbContent]="entityForm?.get('routingKey').value"
|
|
|
|
|
matTooltip="{{'edge.copy-edge-key' | translate}}">
|
|
|
|
|
<mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon>
|
|
|
|
|
</button>
|
2020-06-21 20:38:43 +03:00
|
|
|
</div>
|
2020-12-29 13:13:25 +02:00
|
|
|
<div fxLayout="row" [fxShow]="edgeScope === 'tenant'">
|
2020-06-21 20:38:43 +03:00
|
|
|
<fieldset fxFlex disabled>
|
2020-12-22 20:12:04 +02:00
|
|
|
<mat-form-field class="mat-block" fxFlex>
|
2020-06-21 20:38:43 +03:00
|
|
|
<mat-label translate>edge.edge-secret</mat-label>
|
|
|
|
|
<input matInput formControlName="secret">
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</fieldset>
|
2020-12-22 20:12:04 +02:00
|
|
|
<button mat-button mat-icon-button type="button" ngxClipboard (cbOnSuccess)="onEdgeInfoCopied('secret')"
|
|
|
|
|
[cbContent]="entityForm?.get('secret').value"
|
|
|
|
|
matTooltip="{{'edge.copy-edge-secret' | translate}}">
|
|
|
|
|
<mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon>
|
|
|
|
|
</button>
|
2020-06-21 20:38:43 +03:00
|
|
|
</div>
|
2020-12-21 19:14:22 +02:00
|
|
|
<mat-form-field class="mat-block">
|
|
|
|
|
<mat-label translate>edge.label</mat-label>
|
|
|
|
|
<input matInput formControlName="label">
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<div formGroupName="additionalInfo" fxLayout="column">
|
|
|
|
|
<mat-form-field class="mat-block">
|
|
|
|
|
<mat-label translate>edge.description</mat-label>
|
|
|
|
|
<textarea matInput formControlName="description" rows="2"></textarea>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</div>
|
|
|
|
|
</fieldset>
|
2020-06-21 20:38:43 +03:00
|
|
|
</form>
|
|
|
|
|
</div>
|