Commit 91c4affb0748f733c67233abb471c5a739a60938

Authored by Artem Babak
1 parent 6ce8de58

Minor edge changes

1 <component name="ProjectRunConfigurationManager"> 1 <component name="ProjectRunConfigurationManager">
2 - <configuration default="false" name="[CE Edge] Install" type="Application" factoryName="Application"> 2 + <configuration default="false" name="[CE 3] Install" type="Application" factoryName="Application">
3 <envs> 3 <envs>
4 <env name="SPRING_DATASOURCE_URL" value="jdbc:postgresql://localhost:5432/tb_ce_3" /> 4 <env name="SPRING_DATASOURCE_URL" value="jdbc:postgresql://localhost:5432/tb_ce_3" />
5 </envs> 5 </envs>
1 <component name="ProjectRunConfigurationManager"> 1 <component name="ProjectRunConfigurationManager">
2 - <configuration default="false" name="[CE Edge] Server" type="Application" factoryName="Application"> 2 + <configuration default="false" name="[CE 3] Server" type="Application" factoryName="Application">
3 <envs> 3 <envs>
4 <env name="SPRING_DATASOURCE_URL" value="jdbc:postgresql://localhost:5432/tb_ce_3" /> 4 <env name="SPRING_DATASOURCE_URL" value="jdbc:postgresql://localhost:5432/tb_ce_3" />
5 <env name="EDGES_RPC_PORT" value="7070" /> 5 <env name="EDGES_RPC_PORT" value="7070" />
6 - <env name="COAP_ENABLED" value="true" /> 6 + <env name="COAP_ENABLED" value="false" />
7 <env name="EDGES_RPC_ENABLED" value="true" /> 7 <env name="EDGES_RPC_ENABLED" value="true" />
8 <env name="MQTT_BIND_PORT" value="1884" /> 8 <env name="MQTT_BIND_PORT" value="1884" />
9 </envs> 9 </envs>
@@ -176,4 +176,4 @@ public abstract class AbstractEdgeEntity<T extends Edge> extends BaseSqlEntity<T @@ -176,4 +176,4 @@ public abstract class AbstractEdgeEntity<T extends Edge> extends BaseSqlEntity<T
176 edge.setAdditionalInfo(additionalInfo); 176 edge.setAdditionalInfo(additionalInfo);
177 return edge; 177 return edge;
178 } 178 }
179 -}  
  179 +}
@@ -76,12 +76,6 @@ export class EdgeService { @@ -76,12 +76,6 @@ export class EdgeService {
76 defaultHttpOptionsFromConfig(config)); 76 defaultHttpOptionsFromConfig(config));
77 } 77 }
78 78
79 - public setRootRuleChain(edgeId: string, ruleChainId: string,  
80 - config?: RequestConfig): Observable<Edge> {  
81 - return this.http.post<Edge>(`/api/edge/${edgeId}/${ruleChainId}/root`,  
82 - defaultHttpOptionsFromConfig(config));  
83 - }  
84 -  
85 public getTenantEdgeInfos(pageLink: PageLink, type: string = '', 79 public getTenantEdgeInfos(pageLink: PageLink, type: string = '',
86 config?: RequestConfig): Observable<PageData<EdgeInfo>> { 80 config?: RequestConfig): Observable<PageData<EdgeInfo>> {
87 return this.http.get<PageData<EdgeInfo>>(`/api/tenant/edgeInfos${pageLink.toQuery()}&type=${type}`, 81 return this.http.get<PageData<EdgeInfo>>(`/api/tenant/edgeInfos${pageLink.toQuery()}&type=${type}`,
@@ -44,6 +44,7 @@ import { TranslateService } from '@ngx-translate/core'; @@ -44,6 +44,7 @@ import { TranslateService } from '@ngx-translate/core';
44 import { EntityType } from '@shared/models/entity-type.models'; 44 import { EntityType } from '@shared/models/entity-type.models';
45 import { deepClone, snakeCase } from '@core/utils'; 45 import { deepClone, snakeCase } from '@core/utils';
46 import { DebugRuleNodeEventBody } from '@app/shared/models/event.models'; 46 import { DebugRuleNodeEventBody } from '@app/shared/models/event.models';
  47 +import { Edge } from "@shared/models/edge.models";
47 48
48 @Injectable({ 49 @Injectable({
49 providedIn: 'root' 50 providedIn: 'root'
@@ -323,4 +324,9 @@ export class RuleChainService { @@ -323,4 +324,9 @@ export class RuleChainService {
323 return this.http.get<Array<RuleChain>>(`/api/ruleChain/defaultEdgeRuleChains`, defaultHttpOptionsFromConfig(config)); 324 return this.http.get<Array<RuleChain>>(`/api/ruleChain/defaultEdgeRuleChains`, defaultHttpOptionsFromConfig(config));
324 } 325 }
325 326
  327 + public setEdgeRootRuleChain(edgeId: string, ruleChainId: string, config?: RequestConfig): Observable<Edge> { //TODO deaflynx EdgeInfo vs. Edge check usage
  328 + return this.http.post<Edge>(`/api/edge/${edgeId}/${ruleChainId}/root`,
  329 + defaultHttpOptionsFromConfig(config));
  330 + }
  331 +
326 } 332 }
@@ -53,7 +53,7 @@ const routes: Routes = [ @@ -53,7 +53,7 @@ const routes: Routes = [
53 auth: [Authority.TENANT_ADMIN], 53 auth: [Authority.TENANT_ADMIN],
54 ruleChainsType: 'edge', 54 ruleChainsType: 'edge',
55 breadcrumb: { 55 breadcrumb: {
56 - label: 'edge.rulechains', 56 + label: 'rulechain.edge-rulechains',
57 icon: 'settings_ethernet' 57 icon: 'settings_ethernet'
58 }, 58 },
59 }, 59 },
@@ -149,10 +149,10 @@ export class EdgesTableConfigResolver implements Resolve<EntityTableConfig<EdgeI @@ -149,10 +149,10 @@ export class EdgesTableConfigResolver implements Resolve<EntityTableConfig<EdgeI
149 if (edgeScope === 'tenant') { 149 if (edgeScope === 'tenant') {
150 columns.push( 150 columns.push(
151 new EntityTableColumn<EdgeInfo>('customerTitle', 'customer.customer', '25%'), 151 new EntityTableColumn<EdgeInfo>('customerTitle', 'customer.customer', '25%'),
152 - new EntityTableColumn<EdgeInfo>('customerIsPublic', 'edge.public', '60px', 152 + /* new EntityTableColumn<EdgeInfo>('customerIsPublic', 'edge.public', '60px',
153 entity => { 153 entity => {
154 return checkBoxCell(entity.customerIsPublic); 154 return checkBoxCell(entity.customerIsPublic);
155 - }, () => ({}), false), 155 + }, () => ({}), false) */
156 ); 156 );
157 } 157 }
158 return columns; 158 return columns;
@@ -175,12 +175,12 @@ export class EdgesTableConfigResolver implements Resolve<EntityTableConfig<EdgeI @@ -175,12 +175,12 @@ export class EdgesTableConfigResolver implements Resolve<EntityTableConfig<EdgeI
175 const actions: Array<CellActionDescriptor<EdgeInfo>> = []; 175 const actions: Array<CellActionDescriptor<EdgeInfo>> = [];
176 if (edgeScope === 'tenant') { 176 if (edgeScope === 'tenant') {
177 actions.push( 177 actions.push(
178 - {  
179 - name: this.translate.instant('edge.make-public'),  
180 - icon: 'share',  
181 - isEnabled: (entity) => (!entity.customerId || entity.customerId.id === NULL_UUID),  
182 - onAction: ($event, entity) => this.makePublic($event, entity)  
183 - }, 178 + /* {
  179 + name: this.translate.instant('edge.make-public'),
  180 + icon: 'share',
  181 + isEnabled: (entity) => (!entity.customerId || entity.customerId.id === NULL_UUID),
  182 + onAction: ($event, entity) => this.makePublic($event, entity)
  183 + }, */
184 { 184 {
185 name: this.translate.instant('edge.assign-to-customer'), 185 name: this.translate.instant('edge.assign-to-customer'),
186 icon: 'assignment_ind', 186 icon: 'assignment_ind',
@@ -335,7 +335,7 @@ export class EdgesTableConfigResolver implements Resolve<EntityTableConfig<EdgeI @@ -335,7 +335,7 @@ export class EdgesTableConfigResolver implements Resolve<EntityTableConfig<EdgeI
335 }); 335 });
336 } 336 }
337 337
338 - makePublic($event: Event, edge: Edge) { 338 + /* makePublic($event: Event, edge: Edge) {
339 if ($event) { 339 if ($event) {
340 $event.stopPropagation(); 340 $event.stopPropagation();
341 } 341 }
@@ -355,7 +355,7 @@ export class EdgesTableConfigResolver implements Resolve<EntityTableConfig<EdgeI @@ -355,7 +355,7 @@ export class EdgesTableConfigResolver implements Resolve<EntityTableConfig<EdgeI
355 } 355 }
356 } 356 }
357 ); 357 );
358 - } 358 + } */
359 359
360 openEdgeDashboards($event, edge) { 360 openEdgeDashboards($event, edge) {
361 if ($event) { 361 if ($event) {
@@ -474,9 +474,9 @@ export class EdgesTableConfigResolver implements Resolve<EntityTableConfig<EdgeI @@ -474,9 +474,9 @@ export class EdgesTableConfigResolver implements Resolve<EntityTableConfig<EdgeI
474 474
475 onEdgeAction(action: EntityAction<EdgeInfo>): boolean { 475 onEdgeAction(action: EntityAction<EdgeInfo>): boolean {
476 switch (action.action) { 476 switch (action.action) {
477 - case 'makePublic':  
478 - this.makePublic(action.event, action.entity);  
479 - return true; 477 + // case 'makePublic':
  478 + // this.makePublic(action.event, action.entity);
  479 + // return true;
480 case 'assignToCustomer': 480 case 'assignToCustomer':
481 this.assignToCustomer(action.event, [action.entity.id]); 481 this.assignToCustomer(action.event, [action.entity.id]);
482 return true; 482 return true;
@@ -210,7 +210,7 @@ const routes: Routes = [ @@ -210,7 +210,7 @@ const routes: Routes = [
210 component: EntitiesTableComponent, 210 component: EntitiesTableComponent,
211 data: { 211 data: {
212 auth: [Authority.TENANT_ADMIN], 212 auth: [Authority.TENANT_ADMIN],
213 - title: 'edge.rulechains', 213 + title: 'rulechain.edge-rulechains',
214 ruleChainsType: 'edges' 214 ruleChainsType: 'edges'
215 }, 215 },
216 resolve: { 216 resolve: {
@@ -227,7 +227,7 @@ const routes: Routes = [ @@ -227,7 +227,7 @@ const routes: Routes = [
227 icon: 'settings_ethernet' 227 icon: 'settings_ethernet'
228 } as BreadCrumbConfig<RuleChainPageComponent>, 228 } as BreadCrumbConfig<RuleChainPageComponent>,
229 auth: [Authority.TENANT_ADMIN], 229 auth: [Authority.TENANT_ADMIN],
230 - title: 'edge.rulechain', 230 + title: 'rulechain.edge-rulechain',
231 import: false, 231 import: false,
232 ruleChainType: ruleChainType.edge 232 ruleChainType: ruleChainType.edge
233 }, 233 },
@@ -248,7 +248,7 @@ const routes: Routes = [ @@ -248,7 +248,7 @@ const routes: Routes = [
248 icon: 'settings_ethernet' 248 icon: 'settings_ethernet'
249 } as BreadCrumbConfig<RuleChainPageComponent>, 249 } as BreadCrumbConfig<RuleChainPageComponent>,
250 auth: [Authority.TENANT_ADMIN], 250 auth: [Authority.TENANT_ADMIN],
251 - title: 'edge.rulechain', 251 + title: 'rulechain.edge-rulechain',
252 import: true, 252 import: true,
253 ruleChainType: ruleChainType.edge 253 ruleChainType: ruleChainType.edge
254 }, 254 },
@@ -100,11 +100,11 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig< @@ -100,11 +100,11 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
100 }; 100 };
101 if (this.config.componentsData.edgeId) { 101 if (this.config.componentsData.edgeId) {
102 this.config.entitySelectionEnabled = ruleChain => this.config.componentsData.edge.rootRuleChainId.id != ruleChain.id.id; 102 this.config.entitySelectionEnabled = ruleChain => this.config.componentsData.edge.rootRuleChainId.id != ruleChain.id.id;
103 - this.config.deleteEnabled = () => false;  
104 this.edgeService.getEdge(this.config.componentsData.edgeId).subscribe(edge => { 103 this.edgeService.getEdge(this.config.componentsData.edgeId).subscribe(edge => {
105 this.config.componentsData.edge = edge; 104 this.config.componentsData.edge = edge;
106 this.config.tableTitle = edge.name + ': ' + this.translate.instant('rulechain.edge-rulechains'); 105 this.config.tableTitle = edge.name + ': ' + this.translate.instant('rulechain.edge-rulechains');
107 }); 106 });
  107 + this.config.entitiesDeleteEnabled = false;
108 } 108 }
109 else { 109 else {
110 this.config.entitySelectionEnabled = ruleChain => ruleChain && !ruleChain.root; 110 this.config.entitySelectionEnabled = ruleChain => ruleChain && !ruleChain.root;
@@ -294,7 +294,7 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig< @@ -294,7 +294,7 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
294 ).subscribe((res) => { 294 ).subscribe((res) => {
295 if (res) { 295 if (res) {
296 if (this.config.componentsData.edgeId) { 296 if (this.config.componentsData.edgeId) {
297 - this.edgeService.setRootRuleChain(this.config.componentsData.edgeId, ruleChain.id.id).subscribe( 297 + this.ruleChainService.setEdgeRootRuleChain(this.config.componentsData.edgeId, ruleChain.id.id).subscribe(
298 (edge) => { 298 (edge) => {
299 this.config.componentsData.edge = edge; 299 this.config.componentsData.edge = edge;
300 this.config.table.updateData(); 300 this.config.table.updateData();
@@ -980,8 +980,6 @@ @@ -980,8 +980,6 @@
980 "unassign-from-edge": "Unassign from edge", 980 "unassign-from-edge": "Unassign from edge",
981 "dashboards": "Edge Dashboards", 981 "dashboards": "Edge Dashboards",
982 "manage-edge-rulechains": "Manage edge rule chains", 982 "manage-edge-rulechains": "Manage edge rule chains",
983 - "rulechains": "Edge Rule Chains",  
984 - "rulechain": "Edge Rule Chain",  
985 "edge-key": "Edge key", 983 "edge-key": "Edge key",
986 "copy-edge-key": "Copy Edge key", 984 "copy-edge-key": "Copy Edge key",
987 "edge-key-copied-message": "Edge key has been copied to clipboard", 985 "edge-key-copied-message": "Edge key has been copied to clipboard",
@@ -1832,6 +1830,7 @@ @@ -1832,6 +1830,7 @@
1832 "open-rulechain": "Open rule chain", 1830 "open-rulechain": "Open rule chain",
1833 "assign-new-rulechain": "Assign new rulechain", 1831 "assign-new-rulechain": "Assign new rulechain",
1834 "edge-rulechains": "Edge Rule chains", 1832 "edge-rulechains": "Edge Rule chains",
  1833 + "edge-rulechain": "Edge Rule chain",
1835 "core-rulechains": "Core Rule chains", 1834 "core-rulechains": "Core Rule chains",
1836 "unassign-rulechain-from-edge-text": "After the confirmation the rulechain will be unassigned and won't be accessible by the edge.", 1835 "unassign-rulechain-from-edge-text": "After the confirmation the rulechain will be unassigned and won't be accessible by the edge.",
1837 "unassign-rulechains-from-edge-title": "Unassign { count, plural, 1 {1 rulechain} other {# rulechains} } from edge", 1836 "unassign-rulechains-from-edge-title": "Unassign { count, plural, 1 {1 rulechain} other {# rulechains} } from edge",
@@ -194,7 +194,7 @@ export default function EdgeRoutes($stateProvider, types) { @@ -194,7 +194,7 @@ export default function EdgeRoutes($stateProvider, types) {
194 }, 194 },
195 data: { 195 data: {
196 searchEnabled: true, 196 searchEnabled: true,
197 - pageTitle: 'edge.rulechains', 197 + pageTitle: 'rulechain.edge-rulechains',
198 ruleChainsType: 'edge' 198 ruleChainsType: 'edge'
199 }, 199 },
200 ncyBreadcrumb: { 200 ncyBreadcrumb: {