Commit acfb6de8846de6dff7c24c46c898430a803fcd82

Authored by Artem Babak
1 parent e64bbad4

Added Edge edgeLicenseKey and cloudEndpoint

1 1 <component name="ProjectRunConfigurationManager">
2 2 <configuration default="false" name="[CE Edge] Install" type="Application" factoryName="Application">
3 3 <envs>
4   - <env name="SPRING_DATASOURCE_URL" value="jdbc:postgresql://localhost:5432/tb_ce_edge_3" />
  4 + <env name="SPRING_DATASOURCE_URL" value="jdbc:postgresql://localhost:5432/tb_ce_3" />
5 5 </envs>
6 6 <option name="MAIN_CLASS_NAME" value="org.thingsboard.server.ThingsboardInstallApplication" />
7 7 <module name="application" />
... ...
1 1 <component name="ProjectRunConfigurationManager">
2 2 <configuration default="false" name="[CE Edge] Server" type="Application" factoryName="Application">
3 3 <envs>
4   - <env name="SPRING_DATASOURCE_URL" value="jdbc:postgresql://localhost:5432/tb_ce_edge_3" />
  4 + <env name="SPRING_DATASOURCE_URL" value="jdbc:postgresql://localhost:5432/tb_ce_3" />
5 5 <env name="EDGES_RPC_PORT" value="7070" />
6 6 <env name="COAP_ENABLED" value="true" />
7 7 <env name="EDGES_RPC_ENABLED" value="true" />
... ...
... ... @@ -14,15 +14,14 @@
14 14 /// limitations under the License.
15 15 ///
16 16
17   -import { Injectable } from '@angular/core';
  17 +import {Inject, Injectable} from '@angular/core';
18 18 import { defaultHttpOptionsFromConfig, RequestConfig } from './http-utils';
19 19 import { Observable } from 'rxjs';
20 20 import { HttpClient } from '@angular/common/http';
21 21 import { PageLink } from '@shared/models/page/page-link';
22 22 import { PageData } from '@shared/models/page/page-data';
23 23 import { EntitySubtype } from '@app/shared/models/entity-type.models';
24   -import {Edge, EdgeInfo, EdgeSearchQuery } from "@shared/models/edge.models";
25   -
  24 +import { Edge, EdgeInfo, EdgeSearchQuery } from "@shared/models/edge.models";
26 25 @Injectable({
27 26 providedIn: 'root'
28 27 })
... ...
... ... @@ -89,6 +89,28 @@
89 89 </div>
90 90 </fieldset>
91 91 <div fxLayout="row">
  92 + <fieldset fxFlex>
  93 + <mat-form-field class="mat-block">
  94 + <mat-label translate>edge.cloud-endpoint</mat-label>
  95 + <input matInput formControlName="cloudEndpoint" required>
  96 + <mat-error *ngIf="entityForm.get('cloudEndpoint').hasError('required')">
  97 + {{ 'edge.cloud-endpoint-required' | translate }}
  98 + </mat-error>
  99 + </mat-form-field>
  100 + </fieldset>
  101 + </div>
  102 + <div fxLayout="row">
  103 + <fieldset fxFlex>
  104 + <mat-form-field class="mat-block">
  105 + <mat-label translate>edge.edge-license-key</mat-label>
  106 + <input matInput formControlName="edgeLicenseKey" required>
  107 + <mat-error *ngIf="entityForm.get('edgeLicenseKey').hasError('required')">
  108 + {{ 'edge.edge-license-key-required' | translate }}
  109 + </mat-error>
  110 + </mat-form-field>
  111 + </fieldset>
  112 + </div>
  113 + <div fxLayout="row">
92 114 <fieldset fxFlex disabled>
93 115 <mat-form-field class="mat-block">
94 116 <mat-label translate>edge.edge-key</mat-label>
... ...
... ... @@ -48,7 +48,7 @@ export class EdgeComponent extends EntityComponent<EdgeInfo>{
48 48
49 49 ngOnInit() {
50 50 this.edgeScope = this.entitiesTableConfig.componentsData.edgeScope;
51   - super.ngOnInit()
  51 + super.ngOnInit();
52 52 }
53 53
54 54 hideDelete() {
... ... @@ -69,6 +69,8 @@ export class EdgeComponent extends EntityComponent<EdgeInfo>{
69 69 name: [entity ? entity.name : '', [Validators.required]],
70 70 type: [entity ? entity.type : null, [Validators.required]],
71 71 label: [entity ? entity.label : ''],
  72 + cloudEndpoint: '',
  73 + edgeLicenseKey: '',
72 74 routingKey: guid(),
73 75 secret: this.generateSecret(20),
74 76 additionalInfo: this.fb.group(
... ... @@ -84,6 +86,8 @@ export class EdgeComponent extends EntityComponent<EdgeInfo>{
84 86 this.entityForm.patchValue({name: entity.name});
85 87 this.entityForm.patchValue({type: entity.type});
86 88 this.entityForm.patchValue({label: entity.label});
  89 + this.entityForm.patchValue({cloudEndpoint: entity.cloudEndpoint});
  90 + this.entityForm.patchValue({edgeLicenseKey: entity.edgeLicenseKey});
87 91 this.entityForm.patchValue({routingKey: entity.routingKey});
88 92 this.entityForm.patchValue({secret: entity.secret});
89 93 this.entityForm.patchValue({additionalInfo: {
... ...
... ... @@ -27,6 +27,8 @@ export interface Edge extends BaseData<EdgeId> {
27 27 type: string;
28 28 secret: string;
29 29 routingKey: string;
  30 + cloudEndpoint: string;
  31 + edgeLicenseKey: string;
30 32 label?: string;
31 33 additionalInfo?: any;
32 34 }
... ...
... ... @@ -916,15 +916,24 @@
916 916 "delete-edges-text": "Be careful, after the confirmation all selected edges will be removed and all related data will become unrecoverable.",
917 917 "name": "Name",
918 918 "name-required": "Name is required.",
  919 + "edge-license-key": "Edge License Key",
  920 + "edge-license-key-required": "Edge License Key is required.",
  921 + "cloud-endpoint": "Cloud Endpoint",
  922 + "cloud-endpoint-required": "Cloud Endpoint is required.",
919 923 "description": "Description",
920   - "events": "Events",
  924 + "entity-info": "Entity info",
921 925 "details": "Details",
  926 + "events": "Events",
922 927 "copy-id": "Copy Edge Id",
923 928 "id-copied-message": "Edge Id has been copied to clipboard",
  929 + "sync": "Sync Edge",
  930 + "sync-message": "Edge has been synchronized",
924 931 "permissions": "Permissions",
925 932 "edge-required": "Edge required",
926 933 "edge-type": "Edge type",
927 934 "edge-type-required": "Edge type is required.",
  935 + "event-action": "Event action",
  936 + "entity-id": "Entity ID",
928 937 "select-edge-type": "Select edge type",
929 938 "assign-to-customer": "Assign to customer",
930 939 "assign-to-customer-text": "Please select the customer to assign the edge(s)",
... ... @@ -935,6 +944,8 @@
935 944 "assign-edges-text": "Assign { count, plural, 1 {1 edge} other {# edges} } to customer",
936 945 "unassign-edge-title": "Are you sure you want to unassign the edge '{{edgeName}}'?",
937 946 "unassign-edge-text": "After the confirmation the edge will be unassigned and won't be accessible by the customer.",
  947 + "unassign-edges-title": "Are you sure you want to unassign { count, plural, 1 {1 edge} other {# edges} }?",
  948 + "unassign-edges-text": "After the confirmation all selected edges will be unassigned and won't be accessible by the customer.",
938 949 "make-public": "Make edge public",
939 950 "make-public-edge-title": "Are you sure you want to make the edge '{{edgeName}}' public?",
940 951 "make-public-edge-text": "After the confirmation the edge and all its data will be made public and accessible by others.",
... ... @@ -944,6 +955,7 @@
944 955 "make-private-edge-text": "After the confirmation the edge and all its data will be made private and won't be accessible by others.",
945 956 "import": "Import edge",
946 957 "label": "Label",
  958 + "load-entity-error": "Entity not found. Failed to load info",
947 959 "assign-new-edge": "Assign new edge",
948 960 "manage-edge-dashboards": "Manage edge dashboards",
949 961 "unassign-from-edge": "Unassign from edge",
... ... @@ -966,9 +978,9 @@
966 978 "set-root-rule-chain-text": "Please select root rule chain for edge(s)",
967 979 "set-root-rule-chain-to-edges": "Set root rule chain for Edge(s)",
968 980 "set-root-rule-chain-to-edges-text": "Set root rule chain for { count, plural, 1 {1 edge} other {# edges} }",
969   - "selected-edges": "{ count, plural, 1 {1 edge} other {# edges} } selected",
970   - "name-starts-with": "Edge name starts with",
971   - "search": "Search edges"
  981 + "status": "Received by edge",
  982 + "success": "Deployed",
  983 + "failed": "Pending"
972 984 },
973 985 "error": {
974 986 "unable-to-connect": "Unable to connect to the server! Please check your internet connection.",
... ...