Commit a36de5d62c5ef580fcf0ae7b52d7d98d3f60d590
Committed by
GitHub
1 parent
8cfe4ef4
Add gateway type and clear import (#2677)
Showing
11 changed files
with
26 additions
and
26 deletions
@@ -18,7 +18,7 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; | @@ -18,7 +18,7 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; | ||
18 | import { PageComponent } from '@shared/components/page.component'; | 18 | import { PageComponent } from '@shared/components/page.component'; |
19 | import { Store } from '@ngrx/store'; | 19 | import { Store } from '@ngrx/store'; |
20 | import { AppState } from '@core/core.state'; | 20 | import { AppState } from '@core/core.state'; |
21 | -import { FormGroup, NgForm } from '@angular/forms'; | 21 | +import { FormGroup } from '@angular/forms'; |
22 | 22 | ||
23 | @Component({ | 23 | @Component({ |
24 | selector: 'tb-details-panel', | 24 | selector: 'tb-details-panel', |
@@ -37,7 +37,7 @@ import { AppState } from '@core/core.state'; | @@ -37,7 +37,7 @@ import { AppState } from '@core/core.state'; | ||
37 | import { EntityTableConfig } from '@home/models/entity/entities-table-config.models'; | 37 | import { EntityTableConfig } from '@home/models/entity/entities-table-config.models'; |
38 | import { BaseData, HasId } from '@shared/models/base-data'; | 38 | import { BaseData, HasId } from '@shared/models/base-data'; |
39 | import { EntityType, EntityTypeResource, EntityTypeTranslation } from '@shared/models/entity-type.models'; | 39 | import { EntityType, EntityTypeResource, EntityTypeTranslation } from '@shared/models/entity-type.models'; |
40 | -import { FormGroup, NgForm } from '@angular/forms'; | 40 | +import { FormGroup } from '@angular/forms'; |
41 | import { EntityComponent } from './entity.component'; | 41 | import { EntityComponent } from './entity.component'; |
42 | import { TbAnchorComponent } from '@shared/components/tb-anchor.component'; | 42 | import { TbAnchorComponent } from '@shared/components/tb-anchor.component'; |
43 | import { EntityAction } from '@home/models/entity/entity-component.models'; | 43 | import { EntityAction } from '@home/models/entity/entity-component.models'; |
@@ -30,7 +30,7 @@ import { AuditLogMode } from '@shared/models/audit-log.models'; | @@ -30,7 +30,7 @@ import { AuditLogMode } from '@shared/models/audit-log.models'; | ||
30 | import { DebugEventType, EventType } from '@shared/models/event.models'; | 30 | import { DebugEventType, EventType } from '@shared/models/event.models'; |
31 | import { AttributeScope, LatestTelemetry } from '@shared/models/telemetry/telemetry.models'; | 31 | import { AttributeScope, LatestTelemetry } from '@shared/models/telemetry/telemetry.models'; |
32 | import { NULL_UUID } from '@shared/models/id/has-uuid'; | 32 | import { NULL_UUID } from '@shared/models/id/has-uuid'; |
33 | -import { FormGroup, NgForm } from '@angular/forms'; | 33 | +import { FormGroup } from '@angular/forms'; |
34 | import { PageLink } from '@shared/models/page/page-link'; | 34 | import { PageLink } from '@shared/models/page/page-link'; |
35 | 35 | ||
36 | @Directive() | 36 | @Directive() |
@@ -15,9 +15,9 @@ | @@ -15,9 +15,9 @@ | ||
15 | /// | 15 | /// |
16 | 16 | ||
17 | import { BaseData, HasId } from '@shared/models/base-data'; | 17 | import { BaseData, HasId } from '@shared/models/base-data'; |
18 | -import { FormBuilder, FormGroup, NgForm } from '@angular/forms'; | 18 | +import { FormBuilder, FormGroup } from '@angular/forms'; |
19 | import { PageComponent } from '@shared/components/page.component'; | 19 | import { PageComponent } from '@shared/components/page.component'; |
20 | -import { Directive, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'; | 20 | +import { Directive, EventEmitter, Input, OnInit, Output } from '@angular/core'; |
21 | import { Store } from '@ngrx/store'; | 21 | import { Store } from '@ngrx/store'; |
22 | import { AppState } from '@core/core.state'; | 22 | import { AppState } from '@core/core.state'; |
23 | import { EntityAction } from '@home/models/entity/entity-component.models'; | 23 | import { EntityAction } from '@home/models/entity/entity-component.models'; |
@@ -67,8 +67,12 @@ export const StorageTypeTranslationMap = new Map<StorageType, string>( | @@ -67,8 +67,12 @@ export const StorageTypeTranslationMap = new Map<StorageType, string>( | ||
67 | export enum ConnectorType { | 67 | export enum ConnectorType { |
68 | mqtt= 'MQTT', | 68 | mqtt= 'MQTT', |
69 | modbus = 'Modbus', | 69 | modbus = 'Modbus', |
70 | - opc_ua = 'OPC-UA', | ||
71 | - ble = 'BLE' | 70 | + opcua = 'OPC-UA', |
71 | + ble = 'BLE', | ||
72 | + request = 'Request', | ||
73 | + can = 'CAN', | ||
74 | + bacnet = 'BACnet', | ||
75 | + custom = 'Custom' | ||
72 | } | 76 | } |
73 | 77 | ||
74 | export interface GatewayFormModels { | 78 | export interface GatewayFormModels { |
@@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
14 | /// limitations under the License. | 14 | /// limitations under the License. |
15 | /// | 15 | /// |
16 | 16 | ||
17 | -import { Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core'; | 17 | +import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'; |
18 | import { PageComponent } from '@shared/components/page.component'; | 18 | import { PageComponent } from '@shared/components/page.component'; |
19 | import { Store } from '@ngrx/store'; | 19 | import { Store } from '@ngrx/store'; |
20 | import { AppState } from '@core/core.state'; | 20 | import { AppState } from '@core/core.state'; |
@@ -25,7 +25,7 @@ import { Widget } from '@shared/models/widget.models'; | @@ -25,7 +25,7 @@ import { Widget } from '@shared/models/widget.models'; | ||
25 | import { WidgetComponentService } from '@home/components/widget/widget-component.service'; | 25 | import { WidgetComponentService } from '@home/components/widget/widget-component.service'; |
26 | import { WidgetConfigComponentData } from '../../models/widget-component.models'; | 26 | import { WidgetConfigComponentData } from '../../models/widget-component.models'; |
27 | import { isDefined, isString } from '@core/utils'; | 27 | import { isDefined, isString } from '@core/utils'; |
28 | -import { FormBuilder, FormGroup, NgForm } from '@angular/forms'; | 28 | +import { FormBuilder, FormGroup } from '@angular/forms'; |
29 | 29 | ||
30 | @Component({ | 30 | @Component({ |
31 | selector: 'tb-edit-widget', | 31 | selector: 'tb-edit-widget', |
@@ -16,11 +16,11 @@ | @@ -16,11 +16,11 @@ | ||
16 | 16 | ||
17 | --> | 17 | --> |
18 | <form (ngSubmit)="add()" style="min-width: 650px;"> | 18 | <form (ngSubmit)="add()" style="min-width: 650px;"> |
19 | - <mat-toolbar fxLayout="row" color="primary"> | 19 | + <mat-toolbar color="primary"> |
20 | <h2 translate>rulenode.add</h2> | 20 | <h2 translate>rulenode.add</h2> |
21 | <span fxFlex></span> | 21 | <span fxFlex></span> |
22 | <div [tb-help]="helpLinkIdForRuleNodeType()"></div> | 22 | <div [tb-help]="helpLinkIdForRuleNodeType()"></div> |
23 | - <button mat-button mat-icon-button | 23 | + <button mat-icon-button |
24 | (click)="cancel()" | 24 | (click)="cancel()" |
25 | type="button"> | 25 | type="button"> |
26 | <mat-icon class="material-icons">close</mat-icon> | 26 | <mat-icon class="material-icons">close</mat-icon> |
@@ -38,15 +38,13 @@ | @@ -38,15 +38,13 @@ | ||
38 | </tb-rule-node> | 38 | </tb-rule-node> |
39 | </fieldset> | 39 | </fieldset> |
40 | </div> | 40 | </div> |
41 | - <div mat-dialog-actions fxLayout="row"> | ||
42 | - <span fxFlex></span> | ||
43 | - <button mat-button mat-raised-button color="primary" | 41 | + <div mat-dialog-actions fxLayoutAlign="end center"> |
42 | + <button mat-raised-button color="primary" | ||
44 | type="submit" | 43 | type="submit" |
45 | [disabled]="(isLoading$ | async) || tbRuleNode.ruleNodeFormGroup.invalid || !tbRuleNode.ruleNodeFormGroup.dirty"> | 44 | [disabled]="(isLoading$ | async) || tbRuleNode.ruleNodeFormGroup.invalid || !tbRuleNode.ruleNodeFormGroup.dirty"> |
46 | {{ 'action.add' | translate }} | 45 | {{ 'action.add' | translate }} |
47 | </button> | 46 | </button> |
48 | <button mat-button color="primary" | 47 | <button mat-button color="primary" |
49 | - style="margin-right: 20px;" | ||
50 | type="button" | 48 | type="button" |
51 | [disabled]="(isLoading$ | async)" | 49 | [disabled]="(isLoading$ | async)" |
52 | (click)="cancel()" cdkFocusInitial> | 50 | (click)="cancel()" cdkFocusInitial> |
@@ -15,12 +15,12 @@ | @@ -15,12 +15,12 @@ | ||
15 | limitations under the License. | 15 | limitations under the License. |
16 | 16 | ||
17 | --> | 17 | --> |
18 | -<form [formGroup]="ruleNodeLinkFormGroup" (ngSubmit)="add()" style="width: 900px;"> | ||
19 | - <mat-toolbar fxLayout="row" color="primary"> | 18 | +<form [formGroup]="ruleNodeLinkFormGroup" (ngSubmit)="add()" style="width: 480px;"> |
19 | + <mat-toolbar color="primary"> | ||
20 | <h2 translate>rulenode.add-link</h2> | 20 | <h2 translate>rulenode.add-link</h2> |
21 | <span fxFlex></span> | 21 | <span fxFlex></span> |
22 | <div [tb-help]="'ruleEngine'"></div> | 22 | <div [tb-help]="'ruleEngine'"></div> |
23 | - <button mat-button mat-icon-button | 23 | + <button mat-icon-button |
24 | (click)="cancel()" | 24 | (click)="cancel()" |
25 | type="button"> | 25 | type="button"> |
26 | <mat-icon class="material-icons">close</mat-icon> | 26 | <mat-icon class="material-icons">close</mat-icon> |
@@ -38,15 +38,13 @@ | @@ -38,15 +38,13 @@ | ||
38 | </tb-rule-node-link> | 38 | </tb-rule-node-link> |
39 | </fieldset> | 39 | </fieldset> |
40 | </div> | 40 | </div> |
41 | - <div mat-dialog-actions fxLayout="row"> | ||
42 | - <span fxFlex></span> | ||
43 | - <button mat-button mat-raised-button color="primary" | 41 | + <div mat-dialog-actions fxLayoutAlign="end center"> |
42 | + <button mat-raised-button color="primary" | ||
44 | type="submit" | 43 | type="submit" |
45 | [disabled]="(isLoading$ | async) || ruleNodeLinkFormGroup.invalid || !ruleNodeLinkFormGroup.dirty"> | 44 | [disabled]="(isLoading$ | async) || ruleNodeLinkFormGroup.invalid || !ruleNodeLinkFormGroup.dirty"> |
46 | {{ 'action.add' | translate }} | 45 | {{ 'action.add' | translate }} |
47 | </button> | 46 | </button> |
48 | <button mat-button color="primary" | 47 | <button mat-button color="primary" |
49 | - style="margin-right: 20px;" | ||
50 | type="button" | 48 | type="button" |
51 | [disabled]="(isLoading$ | async)" | 49 | [disabled]="(isLoading$ | async)" |
52 | (click)="cancel()" cdkFocusInitial> | 50 | (click)="cancel()" cdkFocusInitial> |
@@ -18,7 +18,7 @@ import { Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@ | @@ -18,7 +18,7 @@ import { Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@ | ||
18 | import { PageComponent } from '@shared/components/page.component'; | 18 | import { PageComponent } from '@shared/components/page.component'; |
19 | import { Store } from '@ngrx/store'; | 19 | import { Store } from '@ngrx/store'; |
20 | import { AppState } from '@core/core.state'; | 20 | import { AppState } from '@core/core.state'; |
21 | -import { FormBuilder, FormGroup, NgForm, Validators } from '@angular/forms'; | 21 | +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; |
22 | import { FcRuleNode, RuleNodeType } from '@shared/models/rule-node.models'; | 22 | import { FcRuleNode, RuleNodeType } from '@shared/models/rule-node.models'; |
23 | import { EntityType } from '@shared/models/entity-type.models'; | 23 | import { EntityType } from '@shared/models/entity-type.models'; |
24 | import { Subscription } from 'rxjs'; | 24 | import { Subscription } from 'rxjs'; |
@@ -14,8 +14,8 @@ | @@ -14,8 +14,8 @@ | ||
14 | /// limitations under the License. | 14 | /// limitations under the License. |
15 | /// | 15 | /// |
16 | 16 | ||
17 | -import { Component, forwardRef, Input, OnInit, ViewChild } from '@angular/core'; | ||
18 | -import { ControlValueAccessor, FormBuilder, FormGroup, NG_VALUE_ACCESSOR, NgForm, Validators } from '@angular/forms'; | 17 | +import { Component, forwardRef, Input, OnInit } from '@angular/core'; |
18 | +import { ControlValueAccessor, FormBuilder, FormGroup, NG_VALUE_ACCESSOR, Validators } from '@angular/forms'; | ||
19 | import { FcRuleEdge, LinkLabel } from '@shared/models/rule-node.models'; | 19 | import { FcRuleEdge, LinkLabel } from '@shared/models/rule-node.models'; |
20 | import { coerceBooleanProperty } from '@angular/cdk/coercion'; | 20 | import { coerceBooleanProperty } from '@angular/cdk/coercion'; |
21 | import { TruncatePipe } from '@shared/pipe/truncate.pipe'; | 21 | import { TruncatePipe } from '@shared/pipe/truncate.pipe'; |
@@ -18,7 +18,7 @@ import { Component, Inject, OnInit, ViewChild } from '@angular/core'; | @@ -18,7 +18,7 @@ import { Component, Inject, OnInit, ViewChild } from '@angular/core'; | ||
18 | import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; | 18 | import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; |
19 | import { Store } from '@ngrx/store'; | 19 | import { Store } from '@ngrx/store'; |
20 | import { AppState } from '@core/core.state'; | 20 | import { AppState } from '@core/core.state'; |
21 | -import { FormGroup, NgForm } from '@angular/forms'; | 21 | +import { FormGroup } from '@angular/forms'; |
22 | import { UserComponent } from '@modules/home/pages/user/user.component'; | 22 | import { UserComponent } from '@modules/home/pages/user/user.component'; |
23 | import { Authority } from '@shared/models/authority.enum'; | 23 | import { Authority } from '@shared/models/authority.enum'; |
24 | import { ActivationMethod, activationMethodTranslations, User } from '@shared/models/user.model'; | 24 | import { ActivationMethod, activationMethodTranslations, User } from '@shared/models/user.model'; |