Browse Source

Show edge info for Tenant in edgeScope === 'customer'

pull/3811/head
Artem Babak 6 years ago
parent
commit
4b94ffe5b5
  1. 30
      ui-ngx/src/app/modules/home/pages/edge/edge.component.html
  2. 2
      ui-ngx/src/assets/locale/locale.constant-en_US.json

30
ui-ngx/src/app/modules/home/pages/edge/edge.component.html

@ -44,31 +44,31 @@
<button mat-raised-button color="primary"
[disabled]="(isLoading$ | async)"
(click)="onEntityAction($event, 'openEdgeAssets')"
[fxShow]="!isEdit && (edgeScope === 'tenant' || edgeScope === 'customer_user')">
[fxShow]="!isEdit">
{{'edge.manage-edge-assets' | translate }}
</button>
<button mat-raised-button color="primary"
[disabled]="(isLoading$ | async)"
(click)="onEntityAction($event, 'openEdgeDevices')"
[fxShow]="!isEdit && (edgeScope === 'tenant' || edgeScope === 'customer_user')">
[fxShow]="!isEdit">
{{'edge.manage-edge-devices' | translate }}
</button>
<button mat-raised-button color="primary"
[disabled]="(isLoading$ | async)"
(click)="onEntityAction($event, 'openEdgeEntityViews')"
[fxShow]="!isEdit && (edgeScope === 'tenant' || edgeScope === 'customer_user')">
[fxShow]="!isEdit">
{{'edge.manage-edge-entity-views' | translate }}
</button>
<button mat-raised-button color="primary"
[disabled]="(isLoading$ | async)"
(click)="onEntityAction($event, 'openEdgeDashboards')"
[fxShow]="!isEdit && (edgeScope === 'tenant' || edgeScope === 'customer_user')">
[fxShow]="!isEdit">
{{'edge.manage-edge-dashboards' | translate }}
</button>
<button mat-raised-button color="primary"
[disabled]="(isLoading$ | async)"
(click)="onEntityAction($event, 'openEdgeRuleChains')"
[fxShow]="!isEdit && edgeScope === 'tenant'">
[fxShow]="!isEdit && (edgeScope === 'tenant' || edgeScope === 'customer')">
{{'edge.manage-edge-rulechains' | translate }}
</button>
</div>
@ -85,7 +85,7 @@
ngxClipboard
(cbOnSuccess)="onEdgeInfoCopied('key')"
[cbContent]="entity?.routingKey"
[fxShow]="!isEdit && edgeScope === 'tenant'">
[fxShow]="!isEdit && (edgeScope === 'tenant' || edgeScope === 'customer')">
<mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon>
<span translate>edge.copy-edge-key</span>
</button>
@ -93,7 +93,7 @@
ngxClipboard
(cbOnSuccess)="onEdgeInfoCopied('secret')"
[cbContent]="entity?.secret"
[fxShow]="!isEdit && edgeScope === 'tenant'">
[fxShow]="!isEdit && (edgeScope === 'tenant' || edgeScope === 'customer')">
<mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon>
<span translate>edge.copy-edge-secret</span>
</button>
@ -101,7 +101,7 @@
ngxClipboard
[disabled]="(isLoading$ | async)"
(click)="onEntityAction($event, 'syncEdge')"
[fxShow]="!isEdit && edgeScope === 'tenant'">
[fxShow]="!isEdit && (edgeScope === 'tenant' || edgeScope === 'customer')">
<mat-icon svgIcon="mdi:sync"></mat-icon>
<span translate>edge.sync</span>
</button>
@ -111,12 +111,12 @@
<mat-form-field class="mat-block"
[fxShow]="!isEdit && isAssignedToCustomer(entity)
&& !entity?.customerIsPublic && edgeScope === 'tenant'">
<mat-label translate>edge.assigned-to-customer</mat-label>
<mat-label translate>edge.assignedToCustomer</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 }}
[fxShow]="!isEdit && entity?.customerIsPublic && edgeScope === 'tenant'">
{{ 'edge.edge-public' | translate }}
</div>
<form [formGroup]="entityForm">
<fieldset [disabled]="(isLoading$ | async) || !isEdit">
@ -132,7 +132,7 @@
[required]="true"
[entityType]="entityType.EDGE">
</tb-entity-subtype-autocomplete>
<div [fxShow]="edgeScope === 'tenant'">
<div [fxShow]="(edgeScope === 'tenant' || edgeScope === 'customer')">
<div class="tb-hint" [innerHTML]="'edge.edge-license-key-hint' | translate"></div>
<mat-form-field class="mat-block">
<mat-label translate>edge.edge-license-key</mat-label>
@ -142,7 +142,7 @@
</mat-error>
</mat-form-field>
</div>
<div [fxShow]="edgeScope === 'tenant'">
<div [fxShow]="(edgeScope === 'tenant' || edgeScope === 'customer')">
<div translate class="tb-hint">edge.cloud-endpoint-hint</div>
<mat-form-field class="mat-block">
<mat-label translate>edge.cloud-endpoint</mat-label>
@ -153,7 +153,7 @@
</mat-form-field>
</div>
</fieldset>
<div fxLayout="row" [fxShow]="edgeScope === 'tenant'">
<div fxLayout="row" [fxShow]="(edgeScope === 'tenant' || edgeScope === 'customer')">
<mat-form-field class="mat-block" fxFlex>
<mat-label translate>edge.edge-key</mat-label>
<input matInput formControlName="routingKey">
@ -164,7 +164,7 @@
<mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon>
</button>
</div>
<div fxLayout="row" [fxShow]="edgeScope === 'tenant'">
<div fxLayout="row" [fxShow]="(edgeScope === 'tenant' || edgeScope === 'customer')">
<mat-form-field class="mat-block" fxFlex>
<mat-label translate>edge.edge-secret</mat-label>
<input matInput formControlName="secret">

2
ui-ngx/src/assets/locale/locale.constant-en_US.json

@ -1234,6 +1234,8 @@
"assign-to-customer-text": "Please select the customer to assign the edge(s)",
"assign-edge-to-customer": "Assign Edge(s) To Customer",
"assign-edge-to-customer-text": "Please select the edges to assign to the customer",
"assignedToCustomer": "Assigned to customer",
"edge-public": "Edge is public",
"assigned-to-customer": "Assigned to: {{customerTitle}}",
"unassign-from-customer": "Unassign from customer",
"assign-edges-text": "Assign { count, plural, 1 {1 edge} other {# edges} } to customer",

Loading…
Cancel
Save