Browse Source

Merge pull request #60 from deaflynx/develop/3.3-edge

Develop/3.3 edge
pull/3811/head
VoBa 6 years ago
committed by GitHub
parent
commit
2ddbe0afad
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      ui-ngx/src/app/core/http/dashboard.service.ts
  2. 9
      ui-ngx/src/app/core/http/device.service.ts
  3. 36
      ui-ngx/src/app/core/http/edge.service.ts
  4. 3
      ui-ngx/src/app/core/http/entity-view.service.ts
  5. 5
      ui-ngx/src/app/core/http/entity.service.ts
  6. 3
      ui-ngx/src/app/core/http/event.service.ts
  7. 5
      ui-ngx/src/app/core/http/rule-chain.service.ts
  8. 27
      ui-ngx/src/app/modules/home/components/event/event-table-config.ts
  9. 2
      ui-ngx/src/app/modules/home/components/event/event-table.component.ts
  10. 1
      ui-ngx/src/app/modules/home/models/entity/entities-table-config.models.ts
  11. 2
      ui-ngx/src/app/modules/home/pages/asset/asset.component.ts
  12. 18
      ui-ngx/src/app/modules/home/pages/asset/assets-table-config.resolver.ts
  13. 2
      ui-ngx/src/app/modules/home/pages/customer/customer-routing.module.ts
  14. 2
      ui-ngx/src/app/modules/home/pages/dashboard/dashboard-form.component.ts
  15. 5
      ui-ngx/src/app/modules/home/pages/dashboard/dashboards-table-config.resolver.ts
  16. 2
      ui-ngx/src/app/modules/home/pages/device/device.component.ts
  17. 19
      ui-ngx/src/app/modules/home/pages/device/devices-table-config.resolver.ts
  18. 4
      ui-ngx/src/app/modules/home/pages/edge/edge-routing.module.ts
  19. 10
      ui-ngx/src/app/modules/home/pages/edge/edge-tabs.component.ts
  20. 33
      ui-ngx/src/app/modules/home/pages/edge/edge.component.html
  21. 11
      ui-ngx/src/app/modules/home/pages/edge/edges-table-config.resolver.ts
  22. 2
      ui-ngx/src/app/modules/home/pages/entity-view/entity-view.component.ts
  23. 18
      ui-ngx/src/app/modules/home/pages/entity-view/entity-views-table-config.resolver.ts
  24. 2
      ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.ts
  25. 43
      ui-ngx/src/app/modules/home/pages/rulechain/rulechain-routing.module.ts
  26. 76
      ui-ngx/src/app/modules/home/pages/rulechain/rulechains-table-config.resolver.ts
  27. 2
      ui-ngx/src/app/shared/components/entity/entity-subtype-list.component.ts
  28. 16
      ui-ngx/src/app/shared/models/ace/service-completion.models.ts
  29. 1
      ui-ngx/src/app/shared/models/alias.models.ts
  30. 1
      ui-ngx/src/app/shared/models/asset.models.ts
  31. 15
      ui-ngx/src/app/shared/models/event.models.ts
  32. 9
      ui-ngx/src/assets/locale/locale.constant-en_US.json

10
ui-ngx/src/app/core/http/dashboard.service.ts

@ -165,12 +165,14 @@ export class DashboardService {
public assignDashboardToEdge(edgeId: string, dashboardId: string,
config?: RequestConfig): Observable<Dashboard> {
return this.http.post<Dashboard>(`/api/edge/${edgeId}/dashboard/${dashboardId}`,
null, defaultHttpOptionsFromConfig(config));
return this.http.post<Dashboard>(`/api/edge/${edgeId}/dashboard/${dashboardId}`, null,
defaultHttpOptionsFromConfig(config));
}
public unassignDashboardFromEdge(edgeId: string, dashboardId: string, config?: RequestConfig) {
return this.http.delete(`/api/edge/${edgeId}/dashboard/${dashboardId}`, defaultHttpOptionsFromConfig(config));
public unassignDashboardFromEdge(edgeId: string, dashboardId: string,
config?: RequestConfig) {
return this.http.delete(`/api/edge/${edgeId}/dashboard/${dashboardId}`,
defaultHttpOptionsFromConfig(config));
}
}

9
ui-ngx/src/app/core/http/device.service.ts

@ -155,11 +155,14 @@ export class DeviceService {
return this.http.delete(`/api/customer/device/${deviceName}/claim`, defaultHttpOptionsFromConfig(config));
}
public assignDeviceToEdge(edgeId: string, deviceId: string, config?: RequestConfig): Observable<Device> {
return this.http.post<Device>(`/api/edge/${edgeId}/device/${deviceId}`, defaultHttpOptionsFromConfig(config));
public assignDeviceToEdge(edgeId: string, deviceId: string,
config?: RequestConfig): Observable<Device> {
return this.http.post<Device>(`/api/edge/${edgeId}/device/${deviceId}`,
defaultHttpOptionsFromConfig(config));
}
public unassignDeviceFromEdge(edgeId: string, deviceId: string, config?: RequestConfig) {
public unassignDeviceFromEdge(edgeId: string, deviceId: string,
config?: RequestConfig) {
return this.http.delete(`/api/edge/${edgeId}/device/${deviceId}`,
defaultHttpOptionsFromConfig(config));
}

36
ui-ngx/src/app/core/http/edge.service.ts

@ -54,38 +54,32 @@ export class EdgeService {
return this.http.get<Array<EntitySubtype>>('/api/edge/types', defaultHttpOptionsFromConfig(config));
}
public getTenantEdges(pageLink: PageLink, type: string = '',
config?: RequestConfig): Observable<PageData<EdgeInfo>> {
return this.http.get<PageData<EdgeInfo>>(`/api/tenant/edges${pageLink.toQuery()}&type=${type}`,
defaultHttpOptionsFromConfig(config));
}
public getCustomerEdges(customerId: string, pageLink: PageLink, type: string = '',
config?: RequestConfig): Observable<PageData<EdgeInfo>> {
return this.http.get<PageData<EdgeInfo>>(`/api/customer/${customerId}/edges${pageLink.toQuery()}&type=${type}`,
defaultHttpOptionsFromConfig(config));
}
public getCustomerEdgeInfos(customerId: string, pageLink: PageLink, type: string = '',
config?: RequestConfig): Observable<PageData<EdgeInfo>> {
return this.http.get<PageData<EdgeInfo>>(`/api/customer/${customerId}/edgeInfos${pageLink.toQuery()}&type=${type}`,
defaultHttpOptionsFromConfig(config));
}
public assignEdgeToCustomer(customerId: string, edgeId: string, config?: RequestConfig): Observable<Edge> {
return this.http.post<Edge>(`/api/customer/${customerId}/edge/${edgeId}`, defaultHttpOptionsFromConfig(config));
public assignEdgeToCustomer(customerId: string, edgeId: string,
config?: RequestConfig): Observable<Edge> {
return this.http.post<Edge>(`/api/customer/${customerId}/edge/${edgeId}`,
defaultHttpOptionsFromConfig(config));
}
public unassignEdgeFromCustomer(edgeId: string, config?: RequestConfig) {
return this.http.delete(`/api/customer/edge/${edgeId}`, defaultHttpOptionsFromConfig(config));
return this.http.delete(`/api/customer/edge/${edgeId}`,
defaultHttpOptionsFromConfig(config));
}
public makeEdgePublic(edgeId: string, config?: RequestConfig): Observable<Edge> {
return this.http.post<Edge>(`/api/customer/public/edge/${edgeId}`, defaultHttpOptionsFromConfig(config));
return this.http.post<Edge>(`/api/customer/public/edge/${edgeId}`,
defaultHttpOptionsFromConfig(config));
}
public setRootRuleChain(edgeId: string, ruleChainId: string, config?: RequestConfig): Observable<Edge> {
return this.http.post<Edge>(`/api/edge/${edgeId}/${ruleChainId}/root`, defaultHttpOptionsFromConfig(config));
public setRootRuleChain(edgeId: string, ruleChainId: string,
config?: RequestConfig): Observable<Edge> {
return this.http.post<Edge>(`/api/edge/${edgeId}/${ruleChainId}/root`,
defaultHttpOptionsFromConfig(config));
}
public getTenantEdgeInfos(pageLink: PageLink, type: string = '',
@ -95,10 +89,12 @@ export class EdgeService {
}
public findByQuery(query: EdgeSearchQuery, config?: RequestConfig): Observable<Array<Edge>> {
return this.http.post<Array<Edge>>('/api/edges', query, defaultHttpOptionsFromConfig(config));
return this.http.post<Array<Edge>>('/api/edges', query,
defaultHttpOptionsFromConfig(config));
}
public getEdgeEvents(entityId: EntityId, pageLink: TimePageLink, config?: RequestConfig): Observable<PageData<Event>> {
public getEdgeEvents(entityId: EntityId, pageLink: TimePageLink,
config?: RequestConfig): Observable<PageData<Event>> {
return this.http.get<PageData<Event>>(`/api/edge/${entityId.id}/events` + `${pageLink.toQuery()}`,
defaultHttpOptionsFromConfig(config));
}

3
ui-ngx/src/app/core/http/entity-view.service.ts

@ -88,7 +88,8 @@ export class EntityViewService {
defaultHttpOptionsFromConfig(config));
}
public unassignEntityViewFromEdge(edgeId: string, entityViewId: string, config?: RequestConfig) {
public unassignEntityViewFromEdge(edgeId: string, entityViewId: string,
config?: RequestConfig) {
return this.http.delete(`/api/edge/${edgeId}/entityView/${entityViewId}`,
defaultHttpOptionsFromConfig(config));
}

5
ui-ngx/src/app/core/http/entity.service.ts

@ -68,7 +68,6 @@ import {
StringOperation
} from '@shared/models/query/query.models';
import { alarmFields } from '@shared/models/alarm.models';
import { EdgeService } from "@core/http/edge.service";
import { ruleChainType } from "@shared/models/rule-chain.models";
import { Router } from "@angular/router";
@ -93,7 +92,7 @@ export class EntityService {
private entityRelationService: EntityRelationService,
private attributeService: AttributeService,
private utils: UtilsService,
private route: Router
private router: Router
) { }
private getEntityObservable(entityType: EntityType, entityId: string,
@ -323,7 +322,7 @@ export class EntityService {
break;
case EntityType.RULE_CHAIN:
pageLink.sortOrder.property = 'name';
if (this.route.url.includes('edge')) {
if (this.router.url.includes('edge')) {
entitiesObservable = this.ruleChainService.getRuleChains(pageLink, ruleChainType.edge, config);
} else {
entitiesObservable = this.ruleChainService.getRuleChains(pageLink, ruleChainType.core, config);

3
ui-ngx/src/app/core/http/event.service.ts

@ -39,7 +39,8 @@ export class EventService {
defaultHttpOptionsFromConfig(config));
}
public getEdgeEvents(entityId: EntityId, pageLink: TimePageLink, config?: RequestConfig): Observable<PageData<Event>> {
public getEdgeEvents(entityId: EntityId, pageLink: TimePageLink,
config?: RequestConfig): Observable<PageData<Event>> {
return this.http.get<PageData<Event>>(`/api/edge/${entityId.id}/events` + `${pageLink.toQuery()}`,
defaultHttpOptionsFromConfig(config));
}

5
ui-ngx/src/app/core/http/rule-chain.service.ts

@ -25,9 +25,10 @@ import {
RuleChain,
RuleChainConnectionInfo,
RuleChainMetaData,
ruleChainNodeComponent, RuleChainType,
ruleChainNodeComponent,
ruleNodeTypeComponentTypes,
unknownNodeComponent
unknownNodeComponent,
RuleChainType
} from '@shared/models/rule-chain.models';
import { ComponentDescriptorService } from './component-descriptor.service';
import {

27
ui-ngx/src/app/modules/home/components/event/event-table-config.ts

@ -22,11 +22,11 @@ import {
} from '@home/models/entity/entities-table-config.models';
import {
DebugEventType,
EdgeEventType,
EdgeEventStatusColor,
edgeEventStatusColor,
Event,
EventType
EventType,
EdgeEventType,
EdgeEventStatus,
edgeEventStatusColor
} from '@shared/models/event.models';
import {TimePageLink} from '@shared/models/page/page-link';
import {TranslateService} from '@ngx-translate/core';
@ -66,7 +66,7 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
}
eventTypes: Array<EventType | DebugEventType>;
queueStartTs: any;
queueStartTs: number;
constructor(private eventService: EventService,
private dialogService: DialogService,
@ -197,7 +197,7 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
new EntityTableColumn<Event>('status', 'event.status', '100%',
(entity) => this.updateEdgeEventStatus(entity.createdTime),
entity => ({
color: this.isPending(entity.createdTime) ? edgeEventStatusColor.get(EdgeEventStatusColor.PENDING) : edgeEventStatusColor.get(EdgeEventStatusColor.DEPLOYED)
color: this.isPending(entity.createdTime) ? edgeEventStatusColor.get(EdgeEventStatus.PENDING) : edgeEventStatusColor.get(EdgeEventStatus.DEPLOYED)
}), false),
new EntityActionTableColumn<Event>('data', 'event.data',
{
@ -347,14 +347,10 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
}
updateEdgeEventStatus(createdTime) {
if (this.queueStartTs) {
var status: string;
if (createdTime < this.queueStartTs) {
status = this.translate.instant('edge.success');
} else {
status = this.translate.instant('edge.failed');
}
return status;
if (this.queueStartTs && createdTime < this.queueStartTs) {
return this.translate.instant('edge.success');
} else {
return this.translate.instant('edge.failed');
}
}
@ -363,13 +359,14 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
}
loadEdgeInfo() {
this.attributeService.getEntityAttributes(this.entityId, AttributeScope.SERVER_SCOPE,["queueStartTs"])
this.attributeService.getEntityAttributes(this.entityId, AttributeScope.SERVER_SCOPE, ['queueStartTs'])
.subscribe(
attributes => this.onUpdate(attributes)
);
}
onUpdate(attributes) {
this.queueStartTs = 0;
let edge = attributes.reduce(function (map, attribute) {
map[attribute.key] = attribute;
return map;

2
ui-ngx/src/app/modules/home/components/event/event-table.component.ts

@ -25,7 +25,7 @@ import { EventService } from '@core/http/event.service';
import { DialogService } from '@core/services/dialog.service';
import { DebugEventType, EventType } from '@shared/models/event.models';
import { RuleChainService } from "@core/http/rule-chain.service";
import {AttributeService} from "@core/http/attribute.service";
import { AttributeService } from "@core/http/attribute.service";
@Component({
selector: 'tb-event-table',

1
ui-ngx/src/app/modules/home/models/entity/entities-table-config.models.ts

@ -107,6 +107,7 @@ export class EntityActionTableColumn<T extends BaseData<HasId>> extends BaseEnti
super('action', key, title, width, false);
}
}
export class DateEntityTableColumn<T extends BaseData<HasId>> extends EntityTableColumn<T> {
constructor(key: string,
title: string,

2
ui-ngx/src/app/modules/home/pages/asset/asset.component.ts

@ -35,7 +35,7 @@ export class AssetComponent extends EntityComponent<AssetInfo> {
entityType = EntityType;
assetScope: 'tenant' | 'customer' | 'customer_user';
assetScope: 'tenant' | 'customer' | 'customer_user' | 'edge';
constructor(protected store: Store<AppState>,
protected translate: TranslateService,

18
ui-ngx/src/app/modules/home/pages/asset/assets-table-config.resolver.ts

@ -70,7 +70,6 @@ export class AssetsTableConfigResolver implements Resolve<EntityTableConfig<Asse
private readonly config: EntityTableConfig<AssetInfo> = new EntityTableConfig<AssetInfo>();
private customerId: string;
private edgeId: string;
constructor(private store: Store<AppState>,
private broadcast: BroadcastService,
@ -115,10 +114,10 @@ export class AssetsTableConfigResolver implements Resolve<EntityTableConfig<Asse
const routeParams = route.params;
this.config.componentsData = {
assetScope: route.data.assetsType,
assetType: ''
assetType: '',
edgeId: routeParams.edgeId
};
this.customerId = routeParams.customerId;
this.edgeId = routeParams.edgeId;
return this.store.pipe(select(selectAuthUser), take(1)).pipe(
tap((authUser) => {
if (authUser.authority === Authority.CUSTOMER_USER) {
@ -137,8 +136,9 @@ export class AssetsTableConfigResolver implements Resolve<EntityTableConfig<Asse
this.config.tableTitle = parentCustomer.title + ': ' + this.translate.instant('asset.assets');
}
} else if (this.config.componentsData.assetScope === 'edge') {
this.edgeService.getEdge(this.edgeId).pipe(map(edge =>
this.config.tableTitle = edge.name + ': ' + this.translate.instant('asset.assets'))).subscribe();
this.edgeService.getEdge(this.config.componentsData.edgeId).subscribe(
edge => this.config.tableTitle = edge.name + ': ' + this.translate.instant('asset.assets')
);
} else {
this.config.tableTitle = this.translate.instant('asset.assets');
}
@ -181,7 +181,7 @@ export class AssetsTableConfigResolver implements Resolve<EntityTableConfig<Asse
this.config.deleteEntity = id => this.assetService.deleteAsset(id.id);
} else if (assetScope === 'edge') {
this.config.entitiesFetchFunction = pageLink =>
this.assetService.getEdgeAssets(this.edgeId, pageLink, this.config.componentsData.assetType);
this.assetService.getEdgeAssets(this.config.componentsData.edgeId, pageLink, this.config.componentsData.assetType);
} else {
this.config.entitiesFetchFunction = pageLink =>
this.assetService.getCustomerAssetInfos(this.customerId, pageLink, this.config.componentsData.assetType);
@ -479,7 +479,7 @@ export class AssetsTableConfigResolver implements Resolve<EntityTableConfig<Asse
disableClose: true,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
data: {
edgeId: this.edgeId,
edgeId: this.config.componentsData.edgeId,
entityType: EntityType.ASSET
}
}).afterClosed()
@ -502,7 +502,7 @@ export class AssetsTableConfigResolver implements Resolve<EntityTableConfig<Asse
true
).subscribe((res) => {
if (res) {
this.assetService.unassignAssetFromEdge(this.edgeId, asset.id.id).subscribe(
this.assetService.unassignAssetFromEdge(this.config.componentsData.edgeId, asset.id.id).subscribe(
() => {
this.config.table.updateData();
}
@ -527,7 +527,7 @@ export class AssetsTableConfigResolver implements Resolve<EntityTableConfig<Asse
const tasks: Observable<any>[] = [];
assets.forEach(
(asset) => {
tasks.push(this.assetService.unassignAssetFromEdge(this.edgeId, asset.id.id));
tasks.push(this.assetService.unassignAssetFromEdge(this.config.componentsData.edgeId, asset.id.id));
}
);
forkJoin(tasks).subscribe(

2
ui-ngx/src/app/modules/home/pages/customer/customer-routing.module.ts

@ -27,7 +27,7 @@ import { DashboardsTableConfigResolver } from '@modules/home/pages/dashboard/das
import { DashboardPageComponent } from '@home/pages/dashboard/dashboard-page.component';
import { BreadCrumbConfig } from '@shared/components/breadcrumb';
import { dashboardBreadcumbLabelFunction, DashboardResolver } from '@home/pages/dashboard/dashboard-routing.module';
import {EdgesTableConfigResolver} from "@home/pages/edge/edges-table-config.resolver";
import { EdgesTableConfigResolver } from "@home/pages/edge/edges-table-config.resolver";
const routes: Routes = [
{

2
ui-ngx/src/app/modules/home/pages/dashboard/dashboard-form.component.ts

@ -38,7 +38,7 @@ import { isEqual } from '@core/utils';
})
export class DashboardFormComponent extends EntityComponent<Dashboard> {
dashboardScope: 'tenant' | 'customer' | 'customer_user';
dashboardScope: 'tenant' | 'customer' | 'customer_user' | 'edge';
customerId: string;
publicLink: string;

5
ui-ngx/src/app/modules/home/pages/dashboard/dashboards-table-config.resolver.ts

@ -132,8 +132,9 @@ export class DashboardsTableConfigResolver implements Resolve<EntityTableConfig<
this.config.tableTitle = parentCustomer.title + ': ' + this.translate.instant('dashboard.dashboards');
}
} else if (this.config.componentsData.dashboardScope === 'edge') {
this.edgeService.getEdge(this.config.componentsData.edgeId).pipe(map(edge =>
this.config.tableTitle = edge.name + ': ' + this.translate.instant('dashboard.dashboards'))).subscribe();
this.edgeService.getEdge(this.config.componentsData.edgeId).subscribe(
edge => this.config.tableTitle = edge.name + ': ' + this.translate.instant('dashboard.dashboards')
);
} else {
this.config.tableTitle = this.translate.instant('dashboard.dashboards');
}

2
ui-ngx/src/app/modules/home/pages/device/device.component.ts

@ -46,7 +46,7 @@ export class DeviceComponent extends EntityComponent<DeviceInfo> {
entityType = EntityType;
deviceScope: 'tenant' | 'customer' | 'customer_user';
deviceScope: 'tenant' | 'customer' | 'customer_user' | 'edge';
constructor(protected store: Store<AppState>,
protected translate: TranslateService,

19
ui-ngx/src/app/modules/home/pages/device/devices-table-config.resolver.ts

@ -73,7 +73,6 @@ export class DevicesTableConfigResolver implements Resolve<EntityTableConfig<Dev
private readonly config: EntityTableConfig<DeviceInfo> = new EntityTableConfig<DeviceInfo>();
private customerId: string;
private edgeId: string;
constructor(private store: Store<AppState>,
private broadcast: BroadcastService,
@ -120,10 +119,11 @@ export class DevicesTableConfigResolver implements Resolve<EntityTableConfig<Dev
const routeParams = route.params;
this.config.componentsData = {
deviceScope: route.data.devicesType,
deviceProfileId: null
deviceProfileId: null,
edgeId: routeParams.edgeId
};
this.customerId = routeParams.customerId;
this.edgeId = routeParams.edgeId;
this.config.componentsData.edgeId = routeParams.edgeId;
return this.store.pipe(select(selectAuthUser), take(1)).pipe(
tap((authUser) => {
if (authUser.authority === Authority.CUSTOMER_USER) {
@ -142,8 +142,9 @@ export class DevicesTableConfigResolver implements Resolve<EntityTableConfig<Dev
this.config.tableTitle = parentCustomer.title + ': ' + this.translate.instant('device.devices');
}
} else if (this.config.componentsData.deviceScope === 'edge') {
this.edgeService.getEdge(this.edgeId).pipe(map(edge =>
this.config.tableTitle = edge.name + ': ' + this.translate.instant('device.devices'))).subscribe();
this.edgeService.getEdge(this.config.componentsData.edgeId).subscribe(
edge => this.config.tableTitle = edge.name + ': ' + this.translate.instant('device.devices')
);
} else {
this.config.tableTitle = this.translate.instant('device.devices');
}
@ -194,7 +195,7 @@ export class DevicesTableConfigResolver implements Resolve<EntityTableConfig<Dev
this.config.deleteEntity = id => this.deviceService.deleteDevice(id.id);
} else if (deviceScope === 'edge') {
this.config.entitiesFetchFunction = pageLink =>
this.deviceService.getEdgeDevices(this.edgeId, pageLink, this.config.componentsData.edgeType);
this.deviceService.getEdgeDevices(this.config.componentsData.edgeId, pageLink, this.config.componentsData.edgeType);
} else {
this.config.entitiesFetchFunction = pageLink =>
this.deviceService.getCustomerDeviceInfosByDeviceProfileId(this.customerId, pageLink,
@ -534,7 +535,7 @@ export class DevicesTableConfigResolver implements Resolve<EntityTableConfig<Dev
disableClose: true,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
data: {
edgeId: this.edgeId,
edgeId: this.config.componentsData.edgeId,
entityType: EntityType.DEVICE
}
}).afterClosed()
@ -557,7 +558,7 @@ export class DevicesTableConfigResolver implements Resolve<EntityTableConfig<Dev
true
).subscribe((res) => {
if (res) {
this.deviceService.unassignDeviceFromEdge(this.edgeId, device.id.id).subscribe(
this.deviceService.unassignDeviceFromEdge(this.config.componentsData.edgeId, device.id.id).subscribe(
() => {
this.config.table.updateData();
}
@ -582,7 +583,7 @@ export class DevicesTableConfigResolver implements Resolve<EntityTableConfig<Dev
const tasks: Observable<any>[] = [];
devices.forEach(
(device) => {
tasks.push(this.deviceService.unassignDeviceFromEdge(this.edgeId, device.id.id));
tasks.push(this.deviceService.unassignDeviceFromEdge(this.config.componentsData.edgeId, device.id.id));
}
);
forkJoin(tasks).subscribe(

4
ui-ngx/src/app/modules/home/pages/edge/edge-routing.module.ts

@ -50,8 +50,8 @@ const routes: Routes = [
path: ':edgeId/ruleChains',
component: EntitiesTableComponent,
data: {
auth: [Authority.TENANT_ADMIN, Authority.CUSTOMER_USER],
ruleChainScope: 'edge',
auth: [Authority.TENANT_ADMIN],
ruleChainsType: 'edge',
breadcrumb: {
label: 'edge.rulechains',
icon: 'settings_ethernet'

10
ui-ngx/src/app/modules/home/pages/edge/edge-tabs.component.ts

@ -14,11 +14,11 @@
/// limitations under the License.
///
import {Component} from '@angular/core';
import {Store} from "@ngrx/store";
import {AppState} from "@core/core.state";
import {EdgeInfo} from "@shared/models/edge.models";
import {EntityTabsComponent} from "@home/components/entity/entity-tabs.component";
import { Component } from '@angular/core';
import { Store } from "@ngrx/store";
import { AppState } from "@core/core.state";
import { EdgeInfo } from "@shared/models/edge.models";
import { EntityTabsComponent } from "@home/components/entity/entity-tabs.component";
@Component({
selector: 'tb-edge-tabs',

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

@ -79,6 +79,23 @@
<mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon>
<span translate>edge.copy-id</span>
</button>
<button mat-raised-button
ngxClipboard
(cbOnSuccess)="onEdgeKeyCopied($event)"
[cbContent]="entity?.routingKey"
[fxShow]="!isEdit">
<mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon>
<span translate>edge.copy-edge-key</span>
</button>
<button mat-raised-button
ngxClipboard
(cbOnSuccess)="onEdgeSecretCopied($event)"
[cbContent]="entity?.secret"
[fxShow]="!isEdit">
<mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon>
<span translate>edge.copy-edge-secret</span>
</button>
</div>
</div>
<div class="mat-padding" fxLayout="column">
@ -147,14 +164,6 @@
<input matInput formControlName="routingKey">
</mat-form-field>
</fieldset>
<button mat-button mat-icon-button
style="margin-top: 14px"
ngxClipboard
(cbOnSuccess)="onEdgeKeyCopied($event)"
[cbContent]="entity?.routingKey"
[fxShow]="!isEdit">
<mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon>
</button>
</div>
<div fxLayout="row">
<fieldset fxFlex disabled>
@ -163,14 +172,6 @@
<input matInput formControlName="secret">
</mat-form-field>
</fieldset>
<button mat-button mat-icon-button
style="margin-top: 14px"
ngxClipboard
(cbOnSuccess)="onEdgeSecretCopied($event)"
[cbContent]="entity?.secret"
[fxShow]="!isEdit">
<mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon>
</button>
</div>
</form>
</div>

11
ui-ngx/src/app/modules/home/pages/edge/edges-table-config.resolver.ts

@ -51,7 +51,6 @@ import {
AddEntitiesToCustomerDialogData
} from '../../dialogs/add-entities-to-customer-dialog.component';
import { HomeDialogsService } from '@home/dialogs/home-dialogs.service';
import { Edge, EdgeInfo } from "@shared/models/edge.models";
import { EdgeService } from "@core/http/edge.service";
import { EdgeComponent } from "@home/pages/edge/edge.component";
@ -96,19 +95,15 @@ export class EdgesTableConfigResolver implements Resolve<EntityTableConfig<EdgeI
mergeMap((savedEdge) => this.edgeService.getEdge(savedEdge.id.id)
));
};
this.config.onEntityAction = action => this.onEdgeAction(action);
this.config.detailsReadonly = () => this.config.componentsData.edgeScope === 'customer_user';
this.config.headerComponent = EdgeTableHeaderComponent;
}
resolve(route: ActivatedRouteSnapshot): Observable<EntityTableConfig<EdgeInfo>> {
const routeParams = route.params;
this.config.componentsData = {
edgeScope: route.data.edgesType,
edgeType: ''
edgeScope: route.data.edgesType
};
this.customerId = routeParams.customerId;
return this.store.pipe(select(selectAuthUser), take(1)).pipe(
@ -166,12 +161,12 @@ export class EdgesTableConfigResolver implements Resolve<EntityTableConfig<EdgeI
configureEntityFunctions(edgeScope: string): void {
if (edgeScope === 'tenant') {
this.config.entitiesFetchFunction = pageLink =>
this.edgeService.getTenantEdgeInfos(pageLink, this.config.componentsData.edgeType);
this.edgeService.getTenantEdgeInfos(pageLink);
this.config.deleteEntity = id => this.edgeService.deleteEdge(id.id);
}
if (edgeScope === 'customer') {
this.config.entitiesFetchFunction = pageLink =>
this.edgeService.getCustomerEdgeInfos(this.customerId, pageLink, this.config.componentsData.edgeType);
this.edgeService.getCustomerEdgeInfos(this.customerId, pageLink);
this.config.deleteEntity = id => this.edgeService.unassignEdgeFromCustomer(id.id);
}
}

2
ui-ngx/src/app/modules/home/pages/entity-view/entity-view.component.ts

@ -40,7 +40,7 @@ export class EntityViewComponent extends EntityComponent<EntityViewInfo> {
dataKeyType = DataKeyType;
entityViewScope: 'tenant' | 'customer' | 'customer_user';
entityViewScope: 'tenant' | 'customer' | 'customer_user' | 'edge';
allowedEntityTypes = [EntityType.DEVICE, EntityType.ASSET];

18
ui-ngx/src/app/modules/home/pages/entity-view/entity-views-table-config.resolver.ts

@ -68,7 +68,6 @@ export class EntityViewsTableConfigResolver implements Resolve<EntityTableConfig
private readonly config: EntityTableConfig<EntityViewInfo> = new EntityTableConfig<EntityViewInfo>();
private customerId: string;
private edgeId: string;
constructor(private store: Store<AppState>,
private broadcast: BroadcastService,
@ -115,10 +114,10 @@ export class EntityViewsTableConfigResolver implements Resolve<EntityTableConfig
const routeParams = route.params;
this.config.componentsData = {
entityViewScope: route.data.entityViewsType,
entityViewType: ''
entityViewType: '',
edgeId: routeParams.edgeId
};
this.customerId = routeParams.customerId;
this.edgeId = routeParams.edgeId;
return this.store.pipe(select(selectAuthUser), take(1)).pipe(
tap((authUser) => {
if (authUser.authority === Authority.CUSTOMER_USER) {
@ -137,8 +136,9 @@ export class EntityViewsTableConfigResolver implements Resolve<EntityTableConfig
this.config.tableTitle = parentCustomer.title + ': ' + this.translate.instant('entity-view.entity-views');
}
} else if (this.config.componentsData.entityViewScope === 'edge') {
this.edgeService.getEdge(this.edgeId).pipe(map(edge =>
this.config.tableTitle = edge.name + ': ' + this.translate.instant('entity-view.entity-views'))).subscribe();
this.edgeService.getEdge(this.config.componentsData.edgeId).subscribe(
edge => this.config.tableTitle = edge.name + ': ' + this.translate.instant('entity-view.entity-views')
);
}
else {
this.config.tableTitle = this.translate.instant('entity-view.entity-views');
@ -181,7 +181,7 @@ export class EntityViewsTableConfigResolver implements Resolve<EntityTableConfig
this.config.deleteEntity = id => this.entityViewService.deleteEntityView(id.id);
} else if (entityViewScope === 'edge') {
this.config.entitiesFetchFunction = pageLink =>
this.entityViewService.getEdgeEntityViews(this.edgeId, pageLink, this.config.componentsData.entityViewType);
this.entityViewService.getEdgeEntityViews(this.config.componentsData.edgeId, pageLink, this.config.componentsData.entityViewType);
} else {
this.config.entitiesFetchFunction = pageLink =>
this.entityViewService.getCustomerEntityViewInfos(this.customerId, pageLink, this.config.componentsData.entityViewType);
@ -454,7 +454,7 @@ export class EntityViewsTableConfigResolver implements Resolve<EntityTableConfig
disableClose: true,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
data: {
edgeId: this.edgeId,
edgeId: this.config.componentsData.edgeId,
entityType: EntityType.ENTITY_VIEW
}
}).afterClosed()
@ -477,7 +477,7 @@ export class EntityViewsTableConfigResolver implements Resolve<EntityTableConfig
true
).subscribe((res) => {
if (res) {
this.entityViewService.unassignEntityViewFromEdge(this.edgeId, entityView.id.id).subscribe(
this.entityViewService.unassignEntityViewFromEdge(this.config.componentsData.edgeId, entityView.id.id).subscribe(
() => {
this.config.table.updateData();
}
@ -502,7 +502,7 @@ export class EntityViewsTableConfigResolver implements Resolve<EntityTableConfig
const tasks: Observable<any>[] = [];
entityViews.forEach(
(entityView) => {
tasks.push(this.entityViewService.unassignEntityViewFromEdge(this.edgeId, entityView.id.id));
tasks.push(this.entityViewService.unassignEntityViewFromEdge(this.config.componentsData.edgeId, entityView.id.id));
}
);
forkJoin(tasks).subscribe(

2
ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.ts

@ -1281,7 +1281,7 @@ export class RuleChainPageComponent extends PageComponent
if (this.isImport) {
this.isDirtyValue = false;
this.isImport = false;
this.router.navigateByUrl(`ruleChains/${this.ruleChain.id.id}`);
this.router.navigateByUrl(`ruleChains/${this.route.snapshot.data.ruleChainType.toLowerCase()}/${this.ruleChain.id.id}`);
} else {
this.createRuleChainModel();
}

43
ui-ngx/src/app/modules/home/pages/rulechain/rulechain-routing.module.ts

@ -34,7 +34,6 @@ import { BreadCrumbConfig, BreadCrumbLabelFunction } from '@shared/components/br
import {
ResolvedRuleChainMetaData,
RuleChain,
RuleChainType,
ruleChainType,
} from '@shared/models/rule-chain.models';
import { RuleChainService } from '@core/http/rule-chain.service';
@ -76,8 +75,7 @@ export class RuleNodeComponentsResolver implements Resolve<Array<RuleNodeCompone
}
resolve(route: ActivatedRouteSnapshot): Observable<Array<RuleNodeComponentDescriptor>> {
const ruleChainType: RuleChainType = route.data.type;
return this.ruleChainService.getRuleNodeComponents(this.modulesMap, ruleChainType);
return this.ruleChainService.getRuleNodeComponents(this.modulesMap, route.data.ruleChainType);
}
}
@ -151,8 +149,7 @@ const routes: Routes = [
data: {
auth: [Authority.TENANT_ADMIN],
title: 'rulechain.rulechains',
ruleChainScope: 'tenant',
type: ruleChainType.core
ruleChainsType: 'tenant'
},
resolve: {
entitiesTableConfig: RuleChainsTableConfigResolver
@ -170,7 +167,7 @@ const routes: Routes = [
auth: [Authority.TENANT_ADMIN],
title: 'rulechain.rulechain',
import: false,
type: ruleChainType.core
ruleChainType: ruleChainType.core
},
resolve: {
ruleChain: RuleChainResolver,
@ -190,7 +187,8 @@ const routes: Routes = [
} as BreadCrumbConfig<RuleChainPageComponent>,
auth: [Authority.TENANT_ADMIN],
title: 'rulechain.rulechain',
import: true
import: true,
ruleChainType: ruleChainType.core
},
resolve: {
ruleNodeComponents: RuleNodeComponentsResolver
@ -204,8 +202,7 @@ const routes: Routes = [
breadcrumb: {
label: 'rulechain.edge-rulechains',
icon: 'settings_ethernet'
},
type: 'edge'
}
},
children: [
{
@ -214,48 +211,48 @@ const routes: Routes = [
data: {
auth: [Authority.TENANT_ADMIN],
title: 'edge.rulechains',
ruleChainScope: 'edges',
type: ruleChainType.edge
ruleChainsType: 'edges'
},
resolve: {
entitiesTableConfig: RuleChainsTableConfigResolver
}
},
{
path: 'ruleChain/import',
path: ':ruleChainId',
component: RuleChainPageComponent,
canActivate: [RuleChainImportGuard],
canDeactivate: [ConfirmOnExitGuard],
data: {
breadcrumb: {
labelFunction: importRuleChainBreadcumbLabelFunction,
labelFunction: ruleChainBreadcumbLabelFunction,
icon: 'settings_ethernet'
} as BreadCrumbConfig<RuleChainPageComponent>,
auth: [Authority.TENANT_ADMIN],
title: 'rulechain.rulechain',
import: true
title: 'edge.rulechain',
import: false,
ruleChainType: ruleChainType.edge
},
resolve: {
ruleChain: RuleChainResolver,
ruleChainMetaData: ResolvedRuleChainMetaDataResolver,
ruleNodeComponents: RuleNodeComponentsResolver
}
},
{
path: ':ruleChainId',
path: 'ruleChain/import',
component: RuleChainPageComponent,
canActivate: [RuleChainImportGuard],
canDeactivate: [ConfirmOnExitGuard],
data: {
breadcrumb: {
labelFunction: ruleChainBreadcumbLabelFunction,
labelFunction: importRuleChainBreadcumbLabelFunction,
icon: 'settings_ethernet'
} as BreadCrumbConfig<RuleChainPageComponent>,
auth: [Authority.TENANT_ADMIN],
title: 'rulechain.rulechain',
import: false,
type: ruleChainType.edge
title: 'edge.rulechain',
import: true,
ruleChainType: ruleChainType.edge
},
resolve: {
ruleChain: RuleChainResolver,
ruleChainMetaData: ResolvedRuleChainMetaDataResolver,
ruleNodeComponents: RuleNodeComponentsResolver
}
}

76
ui-ngx/src/app/modules/home/pages/rulechain/rulechains-table-config.resolver.ts

@ -52,7 +52,6 @@ import { Edge } from "@shared/models/edge.models";
export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<RuleChain>> {
private readonly config: EntityTableConfig<RuleChain> = new EntityTableConfig<RuleChain>();
private edgeId: string;
private edge: Edge;
constructor(private ruleChainService: RuleChainService,
@ -75,11 +74,11 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
new EntityTableColumn<RuleChain>('name', 'rulechain.name', '100%'),
new EntityTableColumn<RuleChain>('root', 'rulechain.root', '60px',
entity => {
if (isDefined(this.edgeId) && this.edgeId != null) {
return checkBoxCell((this.edge.rootRuleChainId.id == entity.id.id));
} else {
return checkBoxCell(entity.root);
}
if (isDefined(this.config.componentsData.edgeId)) {
return checkBoxCell((this.config.componentsData.edge.rootRuleChainId.id == entity.id.id));
} else {
return checkBoxCell(entity.root);
}
})
);
this.config.deleteEntityTitle = ruleChain => this.translate.instant('rulechain.delete-rulechain-title',
@ -91,23 +90,26 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
this.config.saveEntity = ruleChain => this.saveRuleChain(ruleChain);
this.config.deleteEntity = id => this.ruleChainService.deleteRuleChain(id.id);
this.config.onEntityAction = action => this.onRuleChainAction(action);
this.config.deleteEnabled = (ruleChain) => ruleChain && !ruleChain.root && !this.edgeId;
this.config.entitySelectionEnabled = (ruleChain) => {
if (isDefined(this.edgeId) && this.edgeId != null) {
return this.edge.rootRuleChainId.id != ruleChain.id.id;
} else {
return ruleChain && !ruleChain.root;
}
}
}
resolve(route: ActivatedRouteSnapshot): EntityTableConfig<RuleChain> {
const routeParams = route.params;
this.config.componentsData = {
ruleChainScope: route.data.ruleChainScope,
type: route.data.type
ruleChainScope: route.data.ruleChainsType,
edgeId: routeParams.edgeId
};
this.edgeId = routeParams.edgeId;
if (this.config.componentsData.edgeId) {
this.config.entitySelectionEnabled = ruleChain => this.config.componentsData.edge.rootRuleChainId.id != ruleChain.id.id;
this.config.deleteEnabled = () => false;
this.edgeService.getEdge(this.config.componentsData.edgeId).subscribe(edge => {
this.config.componentsData.edge = edge;
this.config.tableTitle = edge.name + ': ' + this.translate.instant('rulechain.edge-rulechains');
});
}
else {
this.config.entitySelectionEnabled = ruleChain => ruleChain && !ruleChain.root;
this.config.deleteEnabled = (ruleChain) => ruleChain && !ruleChain.root;
}
this.configureEntityFunctions(this.config.componentsData.ruleChainScope);
this.config.groupActionDescriptors = this.configureGroupActions(this.config.componentsData.ruleChainScope);
this.config.addActionDescriptors = this.configureAddActions(this.config.componentsData.ruleChainScope);
@ -154,14 +156,7 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
this.config.tableTitle = this.translate.instant('rulechain.edge-rulechains');
this.config.entitiesFetchFunction = pageLink => this.fetchEdgeRuleChains(pageLink);
} else if (ruleChainScope === 'edge') {
if (isDefined(this.edgeId) && this.edgeId != null) {
this.edgeService.getEdge(this.edgeId)
.pipe(map(edge => {
this.edge = edge;
this.config.tableTitle = edge.name + ': ' + this.translate.instant('rulechain.edge-rulechains')
})).subscribe();
}
this.config.entitiesFetchFunction = pageLink => this.ruleChainService.getEdgeRuleChains(this.edgeId, pageLink);
this.config.entitiesFetchFunction = pageLink => this.ruleChainService.getEdgeRuleChains(this.config.componentsData.edgeId, pageLink);
}
}
@ -241,7 +236,7 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
{
name: this.translate.instant('edge.unassign-from-edge'),
icon: 'portable_wifi_off',
isEnabled: (entity) => entity.id.id != this.edge.rootRuleChainId.id,
isEnabled: (entity) => entity.id.id != this.config.componentsData.edge.rootRuleChainId.id,
onAction: ($event, entity) => this.unassignFromEdge($event, entity)
}
)
@ -298,10 +293,10 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
true
).subscribe((res) => {
if (res) {
if (isDefined(this.edgeId) && this.edgeId != null) {
this.edgeService.setRootRuleChain(this.edgeId, ruleChain.id.id).subscribe(
if (this.config.componentsData.edgeId) {
this.edgeService.setRootRuleChain(this.config.componentsData.edgeId, ruleChain.id.id).subscribe(
(edge) => {
this.edge = edge;
this.config.componentsData.edge = edge;
this.config.table.updateData();
}
)
@ -363,7 +358,7 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
disableClose: true,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
data: {
edgeId: this.edgeId,
edgeId: this.config.componentsData.edgeId,
entityType: EntityType.RULE_CHAIN
}
}).afterClosed()
@ -387,7 +382,7 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
true
).subscribe((res) => {
if (res) {
this.ruleChainService.unassignRuleChainFromEdge(this.edgeId, ruleChain.id.id).subscribe(
this.ruleChainService.unassignRuleChainFromEdge(this.config.componentsData.edgeId, ruleChain.id.id).subscribe(
() => {
this.config.table.updateData();
}
@ -470,8 +465,8 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
}
isNonRootRuleChain(ruleChain: RuleChain) {
if (isDefined(this.edgeId) && this.edgeId != null) {
return (isDefined(this.edge.rootRuleChainId) && this.edge.rootRuleChainId != null && this.edge.rootRuleChainId.id != ruleChain.id.id);
if (this.config.componentsData.edgeId) {
return (isDefined(this.config.componentsData.edge.rootRuleChainId) && this.config.componentsData.edge.rootRuleChainId != null && this.config.componentsData.edge.rootRuleChainId.id != ruleChain.id.id);
}
return (isDefined(ruleChain)) && !ruleChain.root;
}
@ -490,21 +485,16 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
fetchEdgeRuleChains(pageLink: PageLink) {
let defaultEdgeRuleChainIds: Array<string> = [];
this.ruleChainService.getDefaultEdgeRuleChains().pipe(
map(ruleChains =>
ruleChains.map(ruleChain =>
defaultEdgeRuleChainIds.push(ruleChain.id.id)
)
)
).subscribe();
this.ruleChainService.getDefaultEdgeRuleChains().subscribe(ruleChains => {
ruleChains.map(ruleChain => defaultEdgeRuleChainIds.push(ruleChain.id.id))
});
return this.ruleChainService.getRuleChains(pageLink, ruleChainType.edge).pipe(
map((response) => {
map(response => {
response.data.map(ruleChain =>
ruleChain.isDefault = defaultEdgeRuleChainIds.some(id => ruleChain.id.id.includes(id))
);
return response;
return response;
})
);
}
}

2
ui-ngx/src/app/shared/components/entity/entity-subtype-list.component.ts

@ -143,7 +143,7 @@ export class EntitySubTypeListComponent implements ControlValueAccessor, OnInit,
break;
case EntityType.EDGE:
this.placeholder = this.required ? this.translate.instant('edge.enter-edge-type')
: this.translate.instant('edge-any-edge');
: this.translate.instant('edge.edge-any-edge');
this.secondaryPlaceholder = '+' + this.translate.instant('edge.edge-type');
this.noSubtypesMathingText = 'edge.no-edge-types-matching';
this.broadcastSubscription = this.broadcast.on('edgeSaved', () => {

16
ui-ngx/src/app/shared/models/ace/service-completion.models.ts

@ -18,13 +18,13 @@ import { FunctionArg, FunctionArgType, TbEditorCompletions } from '@shared/model
export const entityIdHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/id/entity-id.ts#L20">EntityId</a>';
export const baseDataHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/base-data.ts#L22">Base data</a>';
export const baseDataHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/base-data.ts#L22">Base data</a>';
export const alarmDataHref = '<a href="https://github.com/thingsboard/thingsboard/blob/master/ui-ngx/src/app/shared/models/query/query.models.ts#L573">Alarm data</a>';
export const alarmDataQueryHref = '<a href="https://github.com/thingsboard/thingsboard/blob/master/ui-ngx/src/app/shared/models/query/query.models.ts#L558">Alarm data query</a>';
export const alarmDataQueryHref = '<a href="https://github.com/thingsboard/thingsboard/blob/master/ui-ngx/src/app/shared/models/query/query.models.ts#L558">Alarm data query</a>';
export const attributeScopeHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/telemetry/telemetry.models.ts#L37">Attribute scope</a>';
export const attributeScopeHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/telemetry/telemetry.models.ts#L37">Attribute scope</a>';
export const entityTypeHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/entity-type.models.ts#L36">EntityType</a>';
@ -32,15 +32,15 @@ export const pageDataHref = '<a href="https://github.com/thingsboard/thingsboard
export const deviceInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/device.models.ts#L33">DeviceInfo</a>';
export const assetInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/asset.models.ts#L32">AssetInfo</a>';
export const assetInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/asset.models.ts#L32">AssetInfo</a>';
export const entityViewInfoHref = '<a href = "https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/entity-view.models.ts#L47">EntityViewInfo</a>';
export const entityRelationsQueryHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/relation.models.ts#L69">EntityRelationsQuery</a>';
export const entityRelationInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/relation.models.ts#L87">EntityRelationInfo</a>';
export const entityRelationInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/relation.models.ts#L87">EntityRelationInfo</a>';
export const dashboardInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/dashboard.models.ts#L25">DashboardInfo</a>';
export const dashboardInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/dashboard.models.ts#L25">DashboardInfo</a>';
export const deviceHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/device.models.ts#L24">Device</a>';
@ -50,13 +50,13 @@ export const entityViewHref = '<a href="https://github.com/thingsboard/thingsboa
export const entityRelationHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/relation.models.ts#L79">Entity relation</a>';
export const dashboardHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/dashboard.models.ts#L102">Dashboard</a>';
export const dashboardHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/dashboard.models.ts#L102">Dashboard</a>';
export const customerHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/customer.model.ts#L21">Customer</a>';
export const attributeDataHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/telemetry/telemetry.models.ts#L76">Attribute Data</a>';
export const userHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/user.model.ts#L23">User</a>';
export const userHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/user.model.ts#L23">User</a>';
export const entityDataHref = '<a href="https://github.com/thingsboard/thingsboard/blob/master/ui-ngx/src/app/shared/models/query/query.models.ts#L567">Entity data</a>';

1
ui-ngx/src/app/shared/models/alias.models.ts

@ -17,7 +17,6 @@
import { EntityType } from '@shared/models/entity-type.models';
import { EntityId } from '@shared/models/id/entity-id';
import { EntitySearchDirection, EntityTypeFilter } from '@shared/models/relation.models';
import { EntityInfo } from './entity.models';
import { EntityFilter } from '@shared/models/query/query.models';
export enum AliasFilterType {

1
ui-ngx/src/app/shared/models/asset.models.ts

@ -19,7 +19,6 @@ import { AssetId } from './id/asset-id';
import { TenantId } from '@shared/models/id/tenant-id';
import { CustomerId } from '@shared/models/id/customer-id';
import { EntitySearchQuery } from '@shared/models/relation.models';
import { EdgeId } from "@shared/models/id/edge-id";
export interface Asset extends BaseData<AssetId> {
tenantId?: TenantId;

15
ui-ngx/src/app/shared/models/event.models.ts

@ -31,7 +31,7 @@ export enum DebugEventType {
DEBUG_RULE_NODE = 'DEBUG_RULE_NODE',
DEBUG_RULE_CHAIN = 'DEBUG_RULE_CHAIN'
}
//TODO deaflynx filter CE only event types
export enum EdgeEventType {
DASHBOARD = "DASHBOARD",
ASSET = "ASSET",
@ -44,25 +44,20 @@ export enum EdgeEventType {
USER = "USER",
CUSTOMER = "CUSTOMER",
RELATION = "RELATION",
ENTITY_GROUP = "ENTITY_GROUP",
SCHEDULER_EVENT = "SCHEDULER_EVENT",
WHITE_LABELING = "WHITE_LABELING",
LOGIN_WHITE_LABELING = "LOGIN_WHITE_LABELING",
CUSTOM_TRANSLATION = "CUSTOM_TRANSLATION",
WIDGETS_BUNDLE = "WIDGETS_BUNDLE",
WIDGET_TYPE = "WIDGET_TYPE",
ADMIN_SETTINGS = "ADMIN_SETTINGS"
}
export enum EdgeEventStatusColor {
export enum EdgeEventStatus {
DEPLOYED = "DEPLOYED",
PENDING = "PENDING"
}
export const edgeEventStatusColor = new Map<EdgeEventStatusColor, string> (
export const edgeEventStatusColor = new Map<EdgeEventStatus, string> (
[
[EdgeEventStatusColor.DEPLOYED, '#000000'],
[EdgeEventStatusColor.PENDING, '#9e9e9e']
[EdgeEventStatus.DEPLOYED, '#000000'],
[EdgeEventStatus.PENDING, '#9e9e9e']
]
);

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

@ -983,10 +983,10 @@
"rulechains": "Edge Rule Chains",
"rulechain": "Edge Rule Chain",
"edge-key": "Edge key",
"copy-edge-key": "Copy edge key",
"copy-edge-key": "Copy Edge key",
"edge-key-copied-message": "Edge key has been copied to clipboard",
"edge-secret": "Edge secret",
"copy-edge-secret": "Copy edge secret",
"copy-edge-secret": "Copy Edge secret",
"edge-secret-copied-message": "Edge secret has been copied to clipboard",
"manage-edge-assets": "Manage edge assets",
"manage-edge-devices": "Manage edge devices",
@ -1001,7 +1001,10 @@
"success": "Deployed",
"failed": "Pending",
"search": "Search edges",
"selected-edges": "{ count, plural, 1 {1 edge} other {# edges} } selected"
"selected-edges": "{ count, plural, 1 {1 edge} other {# edges} } selected",
"enter-edge-type": "Enter entity view type",
"any-edge": "Any edge",
"no-edge-types-matching": "No edge types matching '{{entitySubtype}}' were found."
},
"error": {
"unable-to-connect": "Unable to connect to the server! Please check your internet connection.",

Loading…
Cancel
Save