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, public assignDashboardToEdge(edgeId: string, dashboardId: string,
config?: RequestConfig): Observable<Dashboard> { config?: RequestConfig): Observable<Dashboard> {
return this.http.post<Dashboard>(`/api/edge/${edgeId}/dashboard/${dashboardId}`, return this.http.post<Dashboard>(`/api/edge/${edgeId}/dashboard/${dashboardId}`, null,
null, defaultHttpOptionsFromConfig(config)); defaultHttpOptionsFromConfig(config));
} }
public unassignDashboardFromEdge(edgeId: string, dashboardId: string, config?: RequestConfig) { public unassignDashboardFromEdge(edgeId: string, dashboardId: string,
return this.http.delete(`/api/edge/${edgeId}/dashboard/${dashboardId}`, defaultHttpOptionsFromConfig(config)); 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)); return this.http.delete(`/api/customer/device/${deviceName}/claim`, defaultHttpOptionsFromConfig(config));
} }
public assignDeviceToEdge(edgeId: string, deviceId: string, config?: RequestConfig): Observable<Device> { public assignDeviceToEdge(edgeId: string, deviceId: string,
return this.http.post<Device>(`/api/edge/${edgeId}/device/${deviceId}`, defaultHttpOptionsFromConfig(config)); 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}`, return this.http.delete(`/api/edge/${edgeId}/device/${deviceId}`,
defaultHttpOptionsFromConfig(config)); 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)); 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 = '', public getCustomerEdgeInfos(customerId: string, pageLink: PageLink, type: string = '',
config?: RequestConfig): Observable<PageData<EdgeInfo>> { config?: RequestConfig): Observable<PageData<EdgeInfo>> {
return this.http.get<PageData<EdgeInfo>>(`/api/customer/${customerId}/edgeInfos${pageLink.toQuery()}&type=${type}`, return this.http.get<PageData<EdgeInfo>>(`/api/customer/${customerId}/edgeInfos${pageLink.toQuery()}&type=${type}`,
defaultHttpOptionsFromConfig(config)); defaultHttpOptionsFromConfig(config));
} }
public assignEdgeToCustomer(customerId: string, edgeId: string, config?: RequestConfig): Observable<Edge> { public assignEdgeToCustomer(customerId: string, edgeId: string,
return this.http.post<Edge>(`/api/customer/${customerId}/edge/${edgeId}`, defaultHttpOptionsFromConfig(config)); config?: RequestConfig): Observable<Edge> {
return this.http.post<Edge>(`/api/customer/${customerId}/edge/${edgeId}`,
defaultHttpOptionsFromConfig(config));
} }
public unassignEdgeFromCustomer(edgeId: string, config?: RequestConfig) { 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> { 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> { public setRootRuleChain(edgeId: string, ruleChainId: string,
return this.http.post<Edge>(`/api/edge/${edgeId}/${ruleChainId}/root`, defaultHttpOptionsFromConfig(config)); config?: RequestConfig): Observable<Edge> {
return this.http.post<Edge>(`/api/edge/${edgeId}/${ruleChainId}/root`,
defaultHttpOptionsFromConfig(config));
} }
public getTenantEdgeInfos(pageLink: PageLink, type: string = '', public getTenantEdgeInfos(pageLink: PageLink, type: string = '',
@ -95,10 +89,12 @@ export class EdgeService {
} }
public findByQuery(query: EdgeSearchQuery, config?: RequestConfig): Observable<Array<Edge>> { 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()}`, return this.http.get<PageData<Event>>(`/api/edge/${entityId.id}/events` + `${pageLink.toQuery()}`,
defaultHttpOptionsFromConfig(config)); defaultHttpOptionsFromConfig(config));
} }

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

@ -88,7 +88,8 @@ export class EntityViewService {
defaultHttpOptionsFromConfig(config)); 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}`, return this.http.delete(`/api/edge/${edgeId}/entityView/${entityViewId}`,
defaultHttpOptionsFromConfig(config)); defaultHttpOptionsFromConfig(config));
} }

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

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

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

@ -25,9 +25,10 @@ import {
RuleChain, RuleChain,
RuleChainConnectionInfo, RuleChainConnectionInfo,
RuleChainMetaData, RuleChainMetaData,
ruleChainNodeComponent, RuleChainType, ruleChainNodeComponent,
ruleNodeTypeComponentTypes, ruleNodeTypeComponentTypes,
unknownNodeComponent unknownNodeComponent,
RuleChainType
} from '@shared/models/rule-chain.models'; } from '@shared/models/rule-chain.models';
import { ComponentDescriptorService } from './component-descriptor.service'; import { ComponentDescriptorService } from './component-descriptor.service';
import { 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'; } from '@home/models/entity/entities-table-config.models';
import { import {
DebugEventType, DebugEventType,
EdgeEventType,
EdgeEventStatusColor,
edgeEventStatusColor,
Event, Event,
EventType EventType,
EdgeEventType,
EdgeEventStatus,
edgeEventStatusColor
} from '@shared/models/event.models'; } from '@shared/models/event.models';
import {TimePageLink} from '@shared/models/page/page-link'; import {TimePageLink} from '@shared/models/page/page-link';
import {TranslateService} from '@ngx-translate/core'; import {TranslateService} from '@ngx-translate/core';
@ -66,7 +66,7 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
} }
eventTypes: Array<EventType | DebugEventType>; eventTypes: Array<EventType | DebugEventType>;
queueStartTs: any; queueStartTs: number;
constructor(private eventService: EventService, constructor(private eventService: EventService,
private dialogService: DialogService, private dialogService: DialogService,
@ -197,7 +197,7 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
new EntityTableColumn<Event>('status', 'event.status', '100%', new EntityTableColumn<Event>('status', 'event.status', '100%',
(entity) => this.updateEdgeEventStatus(entity.createdTime), (entity) => this.updateEdgeEventStatus(entity.createdTime),
entity => ({ 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), }), false),
new EntityActionTableColumn<Event>('data', 'event.data', new EntityActionTableColumn<Event>('data', 'event.data',
{ {
@ -347,14 +347,10 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
} }
updateEdgeEventStatus(createdTime) { updateEdgeEventStatus(createdTime) {
if (this.queueStartTs) { if (this.queueStartTs && createdTime < this.queueStartTs) {
var status: string; return this.translate.instant('edge.success');
if (createdTime < this.queueStartTs) { } else {
status = this.translate.instant('edge.success'); return this.translate.instant('edge.failed');
} else {
status = this.translate.instant('edge.failed');
}
return status;
} }
} }
@ -363,13 +359,14 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
} }
loadEdgeInfo() { loadEdgeInfo() {
this.attributeService.getEntityAttributes(this.entityId, AttributeScope.SERVER_SCOPE,["queueStartTs"]) this.attributeService.getEntityAttributes(this.entityId, AttributeScope.SERVER_SCOPE, ['queueStartTs'])
.subscribe( .subscribe(
attributes => this.onUpdate(attributes) attributes => this.onUpdate(attributes)
); );
} }
onUpdate(attributes) { onUpdate(attributes) {
this.queueStartTs = 0;
let edge = attributes.reduce(function (map, attribute) { let edge = attributes.reduce(function (map, attribute) {
map[attribute.key] = attribute; map[attribute.key] = attribute;
return map; 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 { DialogService } from '@core/services/dialog.service';
import { DebugEventType, EventType } from '@shared/models/event.models'; import { DebugEventType, EventType } from '@shared/models/event.models';
import { RuleChainService } from "@core/http/rule-chain.service"; import { RuleChainService } from "@core/http/rule-chain.service";
import {AttributeService} from "@core/http/attribute.service"; import { AttributeService } from "@core/http/attribute.service";
@Component({ @Component({
selector: 'tb-event-table', 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); super('action', key, title, width, false);
} }
} }
export class DateEntityTableColumn<T extends BaseData<HasId>> extends EntityTableColumn<T> { export class DateEntityTableColumn<T extends BaseData<HasId>> extends EntityTableColumn<T> {
constructor(key: string, constructor(key: string,
title: 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; entityType = EntityType;
assetScope: 'tenant' | 'customer' | 'customer_user'; assetScope: 'tenant' | 'customer' | 'customer_user' | 'edge';
constructor(protected store: Store<AppState>, constructor(protected store: Store<AppState>,
protected translate: TranslateService, 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 readonly config: EntityTableConfig<AssetInfo> = new EntityTableConfig<AssetInfo>();
private customerId: string; private customerId: string;
private edgeId: string;
constructor(private store: Store<AppState>, constructor(private store: Store<AppState>,
private broadcast: BroadcastService, private broadcast: BroadcastService,
@ -115,10 +114,10 @@ export class AssetsTableConfigResolver implements Resolve<EntityTableConfig<Asse
const routeParams = route.params; const routeParams = route.params;
this.config.componentsData = { this.config.componentsData = {
assetScope: route.data.assetsType, assetScope: route.data.assetsType,
assetType: '' assetType: '',
edgeId: routeParams.edgeId
}; };
this.customerId = routeParams.customerId; this.customerId = routeParams.customerId;
this.edgeId = routeParams.edgeId;
return this.store.pipe(select(selectAuthUser), take(1)).pipe( return this.store.pipe(select(selectAuthUser), take(1)).pipe(
tap((authUser) => { tap((authUser) => {
if (authUser.authority === Authority.CUSTOMER_USER) { 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'); this.config.tableTitle = parentCustomer.title + ': ' + this.translate.instant('asset.assets');
} }
} else if (this.config.componentsData.assetScope === 'edge') { } else if (this.config.componentsData.assetScope === 'edge') {
this.edgeService.getEdge(this.edgeId).pipe(map(edge => this.edgeService.getEdge(this.config.componentsData.edgeId).subscribe(
this.config.tableTitle = edge.name + ': ' + this.translate.instant('asset.assets'))).subscribe(); edge => this.config.tableTitle = edge.name + ': ' + this.translate.instant('asset.assets')
);
} else { } else {
this.config.tableTitle = this.translate.instant('asset.assets'); 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); this.config.deleteEntity = id => this.assetService.deleteAsset(id.id);
} else if (assetScope === 'edge') { } else if (assetScope === 'edge') {
this.config.entitiesFetchFunction = pageLink => 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 { } else {
this.config.entitiesFetchFunction = pageLink => this.config.entitiesFetchFunction = pageLink =>
this.assetService.getCustomerAssetInfos(this.customerId, pageLink, this.config.componentsData.assetType); this.assetService.getCustomerAssetInfos(this.customerId, pageLink, this.config.componentsData.assetType);
@ -479,7 +479,7 @@ export class AssetsTableConfigResolver implements Resolve<EntityTableConfig<Asse
disableClose: true, disableClose: true,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'], panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
data: { data: {
edgeId: this.edgeId, edgeId: this.config.componentsData.edgeId,
entityType: EntityType.ASSET entityType: EntityType.ASSET
} }
}).afterClosed() }).afterClosed()
@ -502,7 +502,7 @@ export class AssetsTableConfigResolver implements Resolve<EntityTableConfig<Asse
true true
).subscribe((res) => { ).subscribe((res) => {
if (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(); this.config.table.updateData();
} }
@ -527,7 +527,7 @@ export class AssetsTableConfigResolver implements Resolve<EntityTableConfig<Asse
const tasks: Observable<any>[] = []; const tasks: Observable<any>[] = [];
assets.forEach( assets.forEach(
(asset) => { (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( 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 { DashboardPageComponent } from '@home/pages/dashboard/dashboard-page.component';
import { BreadCrumbConfig } from '@shared/components/breadcrumb'; import { BreadCrumbConfig } from '@shared/components/breadcrumb';
import { dashboardBreadcumbLabelFunction, DashboardResolver } from '@home/pages/dashboard/dashboard-routing.module'; 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 = [ 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> { export class DashboardFormComponent extends EntityComponent<Dashboard> {
dashboardScope: 'tenant' | 'customer' | 'customer_user'; dashboardScope: 'tenant' | 'customer' | 'customer_user' | 'edge';
customerId: string; customerId: string;
publicLink: 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'); this.config.tableTitle = parentCustomer.title + ': ' + this.translate.instant('dashboard.dashboards');
} }
} else if (this.config.componentsData.dashboardScope === 'edge') { } else if (this.config.componentsData.dashboardScope === 'edge') {
this.edgeService.getEdge(this.config.componentsData.edgeId).pipe(map(edge => this.edgeService.getEdge(this.config.componentsData.edgeId).subscribe(
this.config.tableTitle = edge.name + ': ' + this.translate.instant('dashboard.dashboards'))).subscribe(); edge => this.config.tableTitle = edge.name + ': ' + this.translate.instant('dashboard.dashboards')
);
} else { } else {
this.config.tableTitle = this.translate.instant('dashboard.dashboards'); 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; entityType = EntityType;
deviceScope: 'tenant' | 'customer' | 'customer_user'; deviceScope: 'tenant' | 'customer' | 'customer_user' | 'edge';
constructor(protected store: Store<AppState>, constructor(protected store: Store<AppState>,
protected translate: TranslateService, 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 readonly config: EntityTableConfig<DeviceInfo> = new EntityTableConfig<DeviceInfo>();
private customerId: string; private customerId: string;
private edgeId: string;
constructor(private store: Store<AppState>, constructor(private store: Store<AppState>,
private broadcast: BroadcastService, private broadcast: BroadcastService,
@ -120,10 +119,11 @@ export class DevicesTableConfigResolver implements Resolve<EntityTableConfig<Dev
const routeParams = route.params; const routeParams = route.params;
this.config.componentsData = { this.config.componentsData = {
deviceScope: route.data.devicesType, deviceScope: route.data.devicesType,
deviceProfileId: null deviceProfileId: null,
edgeId: routeParams.edgeId
}; };
this.customerId = routeParams.customerId; this.customerId = routeParams.customerId;
this.edgeId = routeParams.edgeId; this.config.componentsData.edgeId = routeParams.edgeId;
return this.store.pipe(select(selectAuthUser), take(1)).pipe( return this.store.pipe(select(selectAuthUser), take(1)).pipe(
tap((authUser) => { tap((authUser) => {
if (authUser.authority === Authority.CUSTOMER_USER) { 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'); this.config.tableTitle = parentCustomer.title + ': ' + this.translate.instant('device.devices');
} }
} else if (this.config.componentsData.deviceScope === 'edge') { } else if (this.config.componentsData.deviceScope === 'edge') {
this.edgeService.getEdge(this.edgeId).pipe(map(edge => this.edgeService.getEdge(this.config.componentsData.edgeId).subscribe(
this.config.tableTitle = edge.name + ': ' + this.translate.instant('device.devices'))).subscribe(); edge => this.config.tableTitle = edge.name + ': ' + this.translate.instant('device.devices')
);
} else { } else {
this.config.tableTitle = this.translate.instant('device.devices'); 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); this.config.deleteEntity = id => this.deviceService.deleteDevice(id.id);
} else if (deviceScope === 'edge') { } else if (deviceScope === 'edge') {
this.config.entitiesFetchFunction = pageLink => 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 { } else {
this.config.entitiesFetchFunction = pageLink => this.config.entitiesFetchFunction = pageLink =>
this.deviceService.getCustomerDeviceInfosByDeviceProfileId(this.customerId, pageLink, this.deviceService.getCustomerDeviceInfosByDeviceProfileId(this.customerId, pageLink,
@ -534,7 +535,7 @@ export class DevicesTableConfigResolver implements Resolve<EntityTableConfig<Dev
disableClose: true, disableClose: true,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'], panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
data: { data: {
edgeId: this.edgeId, edgeId: this.config.componentsData.edgeId,
entityType: EntityType.DEVICE entityType: EntityType.DEVICE
} }
}).afterClosed() }).afterClosed()
@ -557,7 +558,7 @@ export class DevicesTableConfigResolver implements Resolve<EntityTableConfig<Dev
true true
).subscribe((res) => { ).subscribe((res) => {
if (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(); this.config.table.updateData();
} }
@ -582,7 +583,7 @@ export class DevicesTableConfigResolver implements Resolve<EntityTableConfig<Dev
const tasks: Observable<any>[] = []; const tasks: Observable<any>[] = [];
devices.forEach( devices.forEach(
(device) => { (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( 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', path: ':edgeId/ruleChains',
component: EntitiesTableComponent, component: EntitiesTableComponent,
data: { data: {
auth: [Authority.TENANT_ADMIN, Authority.CUSTOMER_USER], auth: [Authority.TENANT_ADMIN],
ruleChainScope: 'edge', ruleChainsType: 'edge',
breadcrumb: { breadcrumb: {
label: 'edge.rulechains', label: 'edge.rulechains',
icon: 'settings_ethernet' icon: 'settings_ethernet'

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

@ -14,11 +14,11 @@
/// limitations under the License. /// limitations under the License.
/// ///
import {Component} from '@angular/core'; import { Component } from '@angular/core';
import {Store} from "@ngrx/store"; import { Store } from "@ngrx/store";
import {AppState} from "@core/core.state"; import { AppState } from "@core/core.state";
import {EdgeInfo} from "@shared/models/edge.models"; import { EdgeInfo } from "@shared/models/edge.models";
import {EntityTabsComponent} from "@home/components/entity/entity-tabs.component"; import { EntityTabsComponent } from "@home/components/entity/entity-tabs.component";
@Component({ @Component({
selector: 'tb-edge-tabs', 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> <mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon>
<span translate>edge.copy-id</span> <span translate>edge.copy-id</span>
</button> </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> </div>
<div class="mat-padding" fxLayout="column"> <div class="mat-padding" fxLayout="column">
@ -147,14 +164,6 @@
<input matInput formControlName="routingKey"> <input matInput formControlName="routingKey">
</mat-form-field> </mat-form-field>
</fieldset> </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>
<div fxLayout="row"> <div fxLayout="row">
<fieldset fxFlex disabled> <fieldset fxFlex disabled>
@ -163,14 +172,6 @@
<input matInput formControlName="secret"> <input matInput formControlName="secret">
</mat-form-field> </mat-form-field>
</fieldset> </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> </div>
</form> </form>
</div> </div>

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

@ -51,7 +51,6 @@ import {
AddEntitiesToCustomerDialogData AddEntitiesToCustomerDialogData
} from '../../dialogs/add-entities-to-customer-dialog.component'; } from '../../dialogs/add-entities-to-customer-dialog.component';
import { HomeDialogsService } from '@home/dialogs/home-dialogs.service'; import { HomeDialogsService } from '@home/dialogs/home-dialogs.service';
import { Edge, EdgeInfo } from "@shared/models/edge.models"; import { Edge, EdgeInfo } from "@shared/models/edge.models";
import { EdgeService } from "@core/http/edge.service"; import { EdgeService } from "@core/http/edge.service";
import { EdgeComponent } from "@home/pages/edge/edge.component"; 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) mergeMap((savedEdge) => this.edgeService.getEdge(savedEdge.id.id)
)); ));
}; };
this.config.onEntityAction = action => this.onEdgeAction(action); this.config.onEntityAction = action => this.onEdgeAction(action);
this.config.detailsReadonly = () => this.config.componentsData.edgeScope === 'customer_user'; this.config.detailsReadonly = () => this.config.componentsData.edgeScope === 'customer_user';
this.config.headerComponent = EdgeTableHeaderComponent; this.config.headerComponent = EdgeTableHeaderComponent;
} }
resolve(route: ActivatedRouteSnapshot): Observable<EntityTableConfig<EdgeInfo>> { resolve(route: ActivatedRouteSnapshot): Observable<EntityTableConfig<EdgeInfo>> {
const routeParams = route.params; const routeParams = route.params;
this.config.componentsData = { this.config.componentsData = {
edgeScope: route.data.edgesType, edgeScope: route.data.edgesType
edgeType: ''
}; };
this.customerId = routeParams.customerId; this.customerId = routeParams.customerId;
return this.store.pipe(select(selectAuthUser), take(1)).pipe( return this.store.pipe(select(selectAuthUser), take(1)).pipe(
@ -166,12 +161,12 @@ export class EdgesTableConfigResolver implements Resolve<EntityTableConfig<EdgeI
configureEntityFunctions(edgeScope: string): void { configureEntityFunctions(edgeScope: string): void {
if (edgeScope === 'tenant') { if (edgeScope === 'tenant') {
this.config.entitiesFetchFunction = pageLink => 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); this.config.deleteEntity = id => this.edgeService.deleteEdge(id.id);
} }
if (edgeScope === 'customer') { if (edgeScope === 'customer') {
this.config.entitiesFetchFunction = pageLink => 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); 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; dataKeyType = DataKeyType;
entityViewScope: 'tenant' | 'customer' | 'customer_user'; entityViewScope: 'tenant' | 'customer' | 'customer_user' | 'edge';
allowedEntityTypes = [EntityType.DEVICE, EntityType.ASSET]; 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 readonly config: EntityTableConfig<EntityViewInfo> = new EntityTableConfig<EntityViewInfo>();
private customerId: string; private customerId: string;
private edgeId: string;
constructor(private store: Store<AppState>, constructor(private store: Store<AppState>,
private broadcast: BroadcastService, private broadcast: BroadcastService,
@ -115,10 +114,10 @@ export class EntityViewsTableConfigResolver implements Resolve<EntityTableConfig
const routeParams = route.params; const routeParams = route.params;
this.config.componentsData = { this.config.componentsData = {
entityViewScope: route.data.entityViewsType, entityViewScope: route.data.entityViewsType,
entityViewType: '' entityViewType: '',
edgeId: routeParams.edgeId
}; };
this.customerId = routeParams.customerId; this.customerId = routeParams.customerId;
this.edgeId = routeParams.edgeId;
return this.store.pipe(select(selectAuthUser), take(1)).pipe( return this.store.pipe(select(selectAuthUser), take(1)).pipe(
tap((authUser) => { tap((authUser) => {
if (authUser.authority === Authority.CUSTOMER_USER) { 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'); this.config.tableTitle = parentCustomer.title + ': ' + this.translate.instant('entity-view.entity-views');
} }
} else if (this.config.componentsData.entityViewScope === 'edge') { } else if (this.config.componentsData.entityViewScope === 'edge') {
this.edgeService.getEdge(this.edgeId).pipe(map(edge => this.edgeService.getEdge(this.config.componentsData.edgeId).subscribe(
this.config.tableTitle = edge.name + ': ' + this.translate.instant('entity-view.entity-views'))).subscribe(); edge => this.config.tableTitle = edge.name + ': ' + this.translate.instant('entity-view.entity-views')
);
} }
else { else {
this.config.tableTitle = this.translate.instant('entity-view.entity-views'); 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); this.config.deleteEntity = id => this.entityViewService.deleteEntityView(id.id);
} else if (entityViewScope === 'edge') { } else if (entityViewScope === 'edge') {
this.config.entitiesFetchFunction = pageLink => 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 { } else {
this.config.entitiesFetchFunction = pageLink => this.config.entitiesFetchFunction = pageLink =>
this.entityViewService.getCustomerEntityViewInfos(this.customerId, pageLink, this.config.componentsData.entityViewType); this.entityViewService.getCustomerEntityViewInfos(this.customerId, pageLink, this.config.componentsData.entityViewType);
@ -454,7 +454,7 @@ export class EntityViewsTableConfigResolver implements Resolve<EntityTableConfig
disableClose: true, disableClose: true,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'], panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
data: { data: {
edgeId: this.edgeId, edgeId: this.config.componentsData.edgeId,
entityType: EntityType.ENTITY_VIEW entityType: EntityType.ENTITY_VIEW
} }
}).afterClosed() }).afterClosed()
@ -477,7 +477,7 @@ export class EntityViewsTableConfigResolver implements Resolve<EntityTableConfig
true true
).subscribe((res) => { ).subscribe((res) => {
if (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(); this.config.table.updateData();
} }
@ -502,7 +502,7 @@ export class EntityViewsTableConfigResolver implements Resolve<EntityTableConfig
const tasks: Observable<any>[] = []; const tasks: Observable<any>[] = [];
entityViews.forEach( entityViews.forEach(
(entityView) => { (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( 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) { if (this.isImport) {
this.isDirtyValue = false; this.isDirtyValue = false;
this.isImport = 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 { } else {
this.createRuleChainModel(); 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 { import {
ResolvedRuleChainMetaData, ResolvedRuleChainMetaData,
RuleChain, RuleChain,
RuleChainType,
ruleChainType, ruleChainType,
} from '@shared/models/rule-chain.models'; } from '@shared/models/rule-chain.models';
import { RuleChainService } from '@core/http/rule-chain.service'; 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>> { resolve(route: ActivatedRouteSnapshot): Observable<Array<RuleNodeComponentDescriptor>> {
const ruleChainType: RuleChainType = route.data.type; return this.ruleChainService.getRuleNodeComponents(this.modulesMap, route.data.ruleChainType);
return this.ruleChainService.getRuleNodeComponents(this.modulesMap, ruleChainType);
} }
} }
@ -151,8 +149,7 @@ const routes: Routes = [
data: { data: {
auth: [Authority.TENANT_ADMIN], auth: [Authority.TENANT_ADMIN],
title: 'rulechain.rulechains', title: 'rulechain.rulechains',
ruleChainScope: 'tenant', ruleChainsType: 'tenant'
type: ruleChainType.core
}, },
resolve: { resolve: {
entitiesTableConfig: RuleChainsTableConfigResolver entitiesTableConfig: RuleChainsTableConfigResolver
@ -170,7 +167,7 @@ const routes: Routes = [
auth: [Authority.TENANT_ADMIN], auth: [Authority.TENANT_ADMIN],
title: 'rulechain.rulechain', title: 'rulechain.rulechain',
import: false, import: false,
type: ruleChainType.core ruleChainType: ruleChainType.core
}, },
resolve: { resolve: {
ruleChain: RuleChainResolver, ruleChain: RuleChainResolver,
@ -190,7 +187,8 @@ const routes: Routes = [
} as BreadCrumbConfig<RuleChainPageComponent>, } as BreadCrumbConfig<RuleChainPageComponent>,
auth: [Authority.TENANT_ADMIN], auth: [Authority.TENANT_ADMIN],
title: 'rulechain.rulechain', title: 'rulechain.rulechain',
import: true import: true,
ruleChainType: ruleChainType.core
}, },
resolve: { resolve: {
ruleNodeComponents: RuleNodeComponentsResolver ruleNodeComponents: RuleNodeComponentsResolver
@ -204,8 +202,7 @@ const routes: Routes = [
breadcrumb: { breadcrumb: {
label: 'rulechain.edge-rulechains', label: 'rulechain.edge-rulechains',
icon: 'settings_ethernet' icon: 'settings_ethernet'
}, }
type: 'edge'
}, },
children: [ children: [
{ {
@ -214,48 +211,48 @@ const routes: Routes = [
data: { data: {
auth: [Authority.TENANT_ADMIN], auth: [Authority.TENANT_ADMIN],
title: 'edge.rulechains', title: 'edge.rulechains',
ruleChainScope: 'edges', ruleChainsType: 'edges'
type: ruleChainType.edge
}, },
resolve: { resolve: {
entitiesTableConfig: RuleChainsTableConfigResolver entitiesTableConfig: RuleChainsTableConfigResolver
} }
}, },
{ {
path: 'ruleChain/import', path: ':ruleChainId',
component: RuleChainPageComponent, component: RuleChainPageComponent,
canActivate: [RuleChainImportGuard],
canDeactivate: [ConfirmOnExitGuard], canDeactivate: [ConfirmOnExitGuard],
data: { data: {
breadcrumb: { breadcrumb: {
labelFunction: importRuleChainBreadcumbLabelFunction, labelFunction: ruleChainBreadcumbLabelFunction,
icon: 'settings_ethernet' icon: 'settings_ethernet'
} as BreadCrumbConfig<RuleChainPageComponent>, } as BreadCrumbConfig<RuleChainPageComponent>,
auth: [Authority.TENANT_ADMIN], auth: [Authority.TENANT_ADMIN],
title: 'rulechain.rulechain', title: 'edge.rulechain',
import: true import: false,
ruleChainType: ruleChainType.edge
}, },
resolve: { resolve: {
ruleChain: RuleChainResolver,
ruleChainMetaData: ResolvedRuleChainMetaDataResolver,
ruleNodeComponents: RuleNodeComponentsResolver ruleNodeComponents: RuleNodeComponentsResolver
} }
}, },
{ {
path: ':ruleChainId', path: 'ruleChain/import',
component: RuleChainPageComponent, component: RuleChainPageComponent,
canActivate: [RuleChainImportGuard],
canDeactivate: [ConfirmOnExitGuard], canDeactivate: [ConfirmOnExitGuard],
data: { data: {
breadcrumb: { breadcrumb: {
labelFunction: ruleChainBreadcumbLabelFunction, labelFunction: importRuleChainBreadcumbLabelFunction,
icon: 'settings_ethernet' icon: 'settings_ethernet'
} as BreadCrumbConfig<RuleChainPageComponent>, } as BreadCrumbConfig<RuleChainPageComponent>,
auth: [Authority.TENANT_ADMIN], auth: [Authority.TENANT_ADMIN],
title: 'rulechain.rulechain', title: 'edge.rulechain',
import: false, import: true,
type: ruleChainType.edge ruleChainType: ruleChainType.edge
}, },
resolve: { resolve: {
ruleChain: RuleChainResolver,
ruleChainMetaData: ResolvedRuleChainMetaDataResolver,
ruleNodeComponents: RuleNodeComponentsResolver 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>> { export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<RuleChain>> {
private readonly config: EntityTableConfig<RuleChain> = new EntityTableConfig<RuleChain>(); private readonly config: EntityTableConfig<RuleChain> = new EntityTableConfig<RuleChain>();
private edgeId: string;
private edge: Edge; private edge: Edge;
constructor(private ruleChainService: RuleChainService, constructor(private ruleChainService: RuleChainService,
@ -75,11 +74,11 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
new EntityTableColumn<RuleChain>('name', 'rulechain.name', '100%'), new EntityTableColumn<RuleChain>('name', 'rulechain.name', '100%'),
new EntityTableColumn<RuleChain>('root', 'rulechain.root', '60px', new EntityTableColumn<RuleChain>('root', 'rulechain.root', '60px',
entity => { entity => {
if (isDefined(this.edgeId) && this.edgeId != null) { if (isDefined(this.config.componentsData.edgeId)) {
return checkBoxCell((this.edge.rootRuleChainId.id == entity.id.id)); return checkBoxCell((this.config.componentsData.edge.rootRuleChainId.id == entity.id.id));
} else { } else {
return checkBoxCell(entity.root); return checkBoxCell(entity.root);
} }
}) })
); );
this.config.deleteEntityTitle = ruleChain => this.translate.instant('rulechain.delete-rulechain-title', 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.saveEntity = ruleChain => this.saveRuleChain(ruleChain);
this.config.deleteEntity = id => this.ruleChainService.deleteRuleChain(id.id); this.config.deleteEntity = id => this.ruleChainService.deleteRuleChain(id.id);
this.config.onEntityAction = action => this.onRuleChainAction(action); 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> { resolve(route: ActivatedRouteSnapshot): EntityTableConfig<RuleChain> {
const routeParams = route.params; const routeParams = route.params;
this.config.componentsData = { this.config.componentsData = {
ruleChainScope: route.data.ruleChainScope, ruleChainScope: route.data.ruleChainsType,
type: route.data.type 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.configureEntityFunctions(this.config.componentsData.ruleChainScope);
this.config.groupActionDescriptors = this.configureGroupActions(this.config.componentsData.ruleChainScope); this.config.groupActionDescriptors = this.configureGroupActions(this.config.componentsData.ruleChainScope);
this.config.addActionDescriptors = this.configureAddActions(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.tableTitle = this.translate.instant('rulechain.edge-rulechains');
this.config.entitiesFetchFunction = pageLink => this.fetchEdgeRuleChains(pageLink); this.config.entitiesFetchFunction = pageLink => this.fetchEdgeRuleChains(pageLink);
} else if (ruleChainScope === 'edge') { } else if (ruleChainScope === 'edge') {
if (isDefined(this.edgeId) && this.edgeId != null) { this.config.entitiesFetchFunction = pageLink => this.ruleChainService.getEdgeRuleChains(this.config.componentsData.edgeId, pageLink);
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);
} }
} }
@ -241,7 +236,7 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
{ {
name: this.translate.instant('edge.unassign-from-edge'), name: this.translate.instant('edge.unassign-from-edge'),
icon: 'portable_wifi_off', 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) onAction: ($event, entity) => this.unassignFromEdge($event, entity)
} }
) )
@ -298,10 +293,10 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
true true
).subscribe((res) => { ).subscribe((res) => {
if (res) { if (res) {
if (isDefined(this.edgeId) && this.edgeId != null) { if (this.config.componentsData.edgeId) {
this.edgeService.setRootRuleChain(this.edgeId, ruleChain.id.id).subscribe( this.edgeService.setRootRuleChain(this.config.componentsData.edgeId, ruleChain.id.id).subscribe(
(edge) => { (edge) => {
this.edge = edge; this.config.componentsData.edge = edge;
this.config.table.updateData(); this.config.table.updateData();
} }
) )
@ -363,7 +358,7 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
disableClose: true, disableClose: true,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'], panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
data: { data: {
edgeId: this.edgeId, edgeId: this.config.componentsData.edgeId,
entityType: EntityType.RULE_CHAIN entityType: EntityType.RULE_CHAIN
} }
}).afterClosed() }).afterClosed()
@ -387,7 +382,7 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
true true
).subscribe((res) => { ).subscribe((res) => {
if (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(); this.config.table.updateData();
} }
@ -470,8 +465,8 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
} }
isNonRootRuleChain(ruleChain: RuleChain) { isNonRootRuleChain(ruleChain: RuleChain) {
if (isDefined(this.edgeId) && this.edgeId != null) { if (this.config.componentsData.edgeId) {
return (isDefined(this.edge.rootRuleChainId) && this.edge.rootRuleChainId != null && this.edge.rootRuleChainId.id != ruleChain.id.id); 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; return (isDefined(ruleChain)) && !ruleChain.root;
} }
@ -490,21 +485,16 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
fetchEdgeRuleChains(pageLink: PageLink) { fetchEdgeRuleChains(pageLink: PageLink) {
let defaultEdgeRuleChainIds: Array<string> = []; let defaultEdgeRuleChainIds: Array<string> = [];
this.ruleChainService.getDefaultEdgeRuleChains().pipe( this.ruleChainService.getDefaultEdgeRuleChains().subscribe(ruleChains => {
map(ruleChains => ruleChains.map(ruleChain => defaultEdgeRuleChainIds.push(ruleChain.id.id))
ruleChains.map(ruleChain => });
defaultEdgeRuleChainIds.push(ruleChain.id.id)
)
)
).subscribe();
return this.ruleChainService.getRuleChains(pageLink, ruleChainType.edge).pipe( return this.ruleChainService.getRuleChains(pageLink, ruleChainType.edge).pipe(
map((response) => { map(response => {
response.data.map(ruleChain => response.data.map(ruleChain =>
ruleChain.isDefault = defaultEdgeRuleChainIds.some(id => ruleChain.id.id.includes(id)) 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; break;
case EntityType.EDGE: case EntityType.EDGE:
this.placeholder = this.required ? this.translate.instant('edge.enter-edge-type') 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.secondaryPlaceholder = '+' + this.translate.instant('edge.edge-type');
this.noSubtypesMathingText = 'edge.no-edge-types-matching'; this.noSubtypesMathingText = 'edge.no-edge-types-matching';
this.broadcastSubscription = this.broadcast.on('edgeSaved', () => { 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 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 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>'; 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 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 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 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>'; 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 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 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 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>'; 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 { EntityType } from '@shared/models/entity-type.models';
import { EntityId } from '@shared/models/id/entity-id'; import { EntityId } from '@shared/models/id/entity-id';
import { EntitySearchDirection, EntityTypeFilter } from '@shared/models/relation.models'; import { EntitySearchDirection, EntityTypeFilter } from '@shared/models/relation.models';
import { EntityInfo } from './entity.models';
import { EntityFilter } from '@shared/models/query/query.models'; import { EntityFilter } from '@shared/models/query/query.models';
export enum AliasFilterType { 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 { TenantId } from '@shared/models/id/tenant-id';
import { CustomerId } from '@shared/models/id/customer-id'; import { CustomerId } from '@shared/models/id/customer-id';
import { EntitySearchQuery } from '@shared/models/relation.models'; import { EntitySearchQuery } from '@shared/models/relation.models';
import { EdgeId } from "@shared/models/id/edge-id";
export interface Asset extends BaseData<AssetId> { export interface Asset extends BaseData<AssetId> {
tenantId?: TenantId; 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_NODE = 'DEBUG_RULE_NODE',
DEBUG_RULE_CHAIN = 'DEBUG_RULE_CHAIN' DEBUG_RULE_CHAIN = 'DEBUG_RULE_CHAIN'
} }
//TODO deaflynx filter CE only event types
export enum EdgeEventType { export enum EdgeEventType {
DASHBOARD = "DASHBOARD", DASHBOARD = "DASHBOARD",
ASSET = "ASSET", ASSET = "ASSET",
@ -44,25 +44,20 @@ export enum EdgeEventType {
USER = "USER", USER = "USER",
CUSTOMER = "CUSTOMER", CUSTOMER = "CUSTOMER",
RELATION = "RELATION", 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", WIDGETS_BUNDLE = "WIDGETS_BUNDLE",
WIDGET_TYPE = "WIDGET_TYPE", WIDGET_TYPE = "WIDGET_TYPE",
ADMIN_SETTINGS = "ADMIN_SETTINGS" ADMIN_SETTINGS = "ADMIN_SETTINGS"
} }
export enum EdgeEventStatusColor { export enum EdgeEventStatus {
DEPLOYED = "DEPLOYED", DEPLOYED = "DEPLOYED",
PENDING = "PENDING" PENDING = "PENDING"
} }
export const edgeEventStatusColor = new Map<EdgeEventStatusColor, string> ( export const edgeEventStatusColor = new Map<EdgeEventStatus, string> (
[ [
[EdgeEventStatusColor.DEPLOYED, '#000000'], [EdgeEventStatus.DEPLOYED, '#000000'],
[EdgeEventStatusColor.PENDING, '#9e9e9e'] [EdgeEventStatus.PENDING, '#9e9e9e']
] ]
); );

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

@ -983,10 +983,10 @@
"rulechains": "Edge Rule Chains", "rulechains": "Edge Rule Chains",
"rulechain": "Edge Rule Chain", "rulechain": "Edge Rule Chain",
"edge-key": "Edge key", "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-key-copied-message": "Edge key has been copied to clipboard",
"edge-secret": "Edge secret", "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", "edge-secret-copied-message": "Edge secret has been copied to clipboard",
"manage-edge-assets": "Manage edge assets", "manage-edge-assets": "Manage edge assets",
"manage-edge-devices": "Manage edge devices", "manage-edge-devices": "Manage edge devices",
@ -1001,7 +1001,10 @@
"success": "Deployed", "success": "Deployed",
"failed": "Pending", "failed": "Pending",
"search": "Search edges", "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": { "error": {
"unable-to-connect": "Unable to connect to the server! Please check your internet connection.", "unable-to-connect": "Unable to connect to the server! Please check your internet connection.",

Loading…
Cancel
Save