Commit b1c4c30317b1fd6c6aedee7d5df0a6d9902a55ae
1 parent
acfb6de8
Fixed fetchEdgeRuleChains. Added Downlink
Showing
4 changed files
with
13 additions
and
15 deletions
@@ -293,16 +293,11 @@ export class RuleChainService { | @@ -293,16 +293,11 @@ export class RuleChainService { | ||
293 | ); | 293 | ); |
294 | } | 294 | } |
295 | 295 | ||
296 | - public getEdgeRuleChains(edgeId: string, pageLink: PageLink, | ||
297 | - config?:RequestConfig): Observable<PageData<RuleChain>> { | 296 | + public getEdgeRuleChains(edgeId: string, pageLink: PageLink, config?:RequestConfig): Observable<PageData<RuleChain>> { |
298 | return this.http.get<PageData<RuleChain>>(`/api/edge/${edgeId}/ruleChains${pageLink.toQuery()}`, | 297 | return this.http.get<PageData<RuleChain>>(`/api/edge/${edgeId}/ruleChains${pageLink.toQuery()}`, |
299 | defaultHttpOptionsFromConfig(config) ) | 298 | defaultHttpOptionsFromConfig(config) ) |
300 | } | 299 | } |
301 | 300 | ||
302 | - public getEdgesRuleChains(pageLink: PageLink, config?: RequestConfig): Observable<PageData<RuleChain>> { | ||
303 | - return this.getRuleChains(pageLink, ruleChainType.edge, config); | ||
304 | - } | ||
305 | - | ||
306 | public assignRuleChainToEdge(edgeId: string, ruleChainId: string, config?: RequestConfig): Observable<RuleChain> { | 301 | public assignRuleChainToEdge(edgeId: string, ruleChainId: string, config?: RequestConfig): Observable<RuleChain> { |
307 | return this.http.post<RuleChain>(`/api/edge/${edgeId}/ruleChain/${ruleChainId}`, null, | 302 | return this.http.post<RuleChain>(`/api/edge/${edgeId}/ruleChain/${ruleChainId}`, null, |
308 | defaultHttpOptionsFromConfig(config)); | 303 | defaultHttpOptionsFromConfig(config)); |
@@ -179,10 +179,10 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig< | @@ -179,10 +179,10 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig< | ||
179 | configureEntityFunctions(ruleChainScope: string): void { | 179 | configureEntityFunctions(ruleChainScope: string): void { |
180 | if (ruleChainScope === 'tenant') { | 180 | if (ruleChainScope === 'tenant') { |
181 | this.config.tableTitle = this.translate.instant('rulechain.core-rulechains'); | 181 | this.config.tableTitle = this.translate.instant('rulechain.core-rulechains'); |
182 | - this.config.entitiesFetchFunction = pageLink => this.fetchRuleChains(pageLink, ruleChainType.core, ruleChainScope); | 182 | + this.config.entitiesFetchFunction = pageLink => this.fetchRuleChains(pageLink, ruleChainType.core); |
183 | } else if (ruleChainScope === 'edges') { | 183 | } else if (ruleChainScope === 'edges') { |
184 | this.config.tableTitle = this.translate.instant('rulechain.edge-rulechains'); | 184 | this.config.tableTitle = this.translate.instant('rulechain.edge-rulechains'); |
185 | - this.config.entitiesFetchFunction = pageLink => this.fetchRuleChains(pageLink, ruleChainType.edge, ruleChainScope); | 185 | + this.config.entitiesFetchFunction = pageLink => this.fetchRuleChains(pageLink, ruleChainType.edge); |
186 | } else if (ruleChainScope === 'edge') { | 186 | } else if (ruleChainScope === 'edge') { |
187 | if (this.edgeId) { | 187 | if (this.edgeId) { |
188 | this.edgeService.getEdge(this.edgeId) | 188 | this.edgeService.getEdge(this.edgeId) |
@@ -481,13 +481,8 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig< | @@ -481,13 +481,8 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig< | ||
481 | return (isDefined(ruleChain)) && !ruleChain.root && !ruleChain.isDefault; | 481 | return (isDefined(ruleChain)) && !ruleChain.root && !ruleChain.isDefault; |
482 | } | 482 | } |
483 | 483 | ||
484 | - fetchRuleChains(pageLink: PageLink, type: string, ruleChainScope: string) { | ||
485 | - if (ruleChainScope === 'tenant') { | 484 | + fetchRuleChains(pageLink: PageLink, type: string) { |
486 | return this.ruleChainService.getRuleChains(pageLink, type); | 485 | return this.ruleChainService.getRuleChains(pageLink, type); |
487 | - } | ||
488 | - else if (ruleChainScope === 'edges') { | ||
489 | - this.ruleChainService.getRuleChains(pageLink, type) | ||
490 | - } | ||
491 | } | 486 | } |
492 | 487 | ||
493 | } | 488 | } |
@@ -23,7 +23,8 @@ import { ContentType } from '@shared/models/constants'; | @@ -23,7 +23,8 @@ import { ContentType } from '@shared/models/constants'; | ||
23 | export enum EventType { | 23 | export enum EventType { |
24 | ERROR = 'ERROR', | 24 | ERROR = 'ERROR', |
25 | LC_EVENT = 'LC_EVENT', | 25 | LC_EVENT = 'LC_EVENT', |
26 | - STATS = 'STATS' | 26 | + STATS = 'STATS', |
27 | + EDGE_EVENT = 'EDGE_EVENT' | ||
27 | } | 28 | } |
28 | 29 | ||
29 | export enum DebugEventType { | 30 | export enum DebugEventType { |
@@ -36,6 +37,7 @@ export const eventTypeTranslations = new Map<EventType | DebugEventType, string> | @@ -36,6 +37,7 @@ export const eventTypeTranslations = new Map<EventType | DebugEventType, string> | ||
36 | [EventType.ERROR, 'event.type-error'], | 37 | [EventType.ERROR, 'event.type-error'], |
37 | [EventType.LC_EVENT, 'event.type-lc-event'], | 38 | [EventType.LC_EVENT, 'event.type-lc-event'], |
38 | [EventType.STATS, 'event.type-stats'], | 39 | [EventType.STATS, 'event.type-stats'], |
40 | + [EventType.EDGE_EVENT, 'event.type-edge-event'], | ||
39 | [DebugEventType.DEBUG_RULE_NODE, 'event.type-debug-rule-node'], | 41 | [DebugEventType.DEBUG_RULE_NODE, 'event.type-debug-rule-node'], |
40 | [DebugEventType.DEBUG_RULE_CHAIN, 'event.type-debug-rule-chain'], | 42 | [DebugEventType.DEBUG_RULE_CHAIN, 'event.type-debug-rule-chain'], |
41 | ] | 43 | ] |
@@ -61,6 +63,11 @@ export interface StatsEventBody extends BaseEventBody { | @@ -61,6 +63,11 @@ export interface StatsEventBody extends BaseEventBody { | ||
61 | errorsOccurred: number; | 63 | errorsOccurred: number; |
62 | } | 64 | } |
63 | 65 | ||
66 | +export interface EdgeEventBody extends BaseEventBody { | ||
67 | + messagesProcessed: number; | ||
68 | + errorsOccurred: number; | ||
69 | +} | ||
70 | + | ||
64 | export interface DebugRuleNodeEventBody extends BaseEventBody { | 71 | export interface DebugRuleNodeEventBody extends BaseEventBody { |
65 | type: string; | 72 | type: string; |
66 | entityId: string; | 73 | entityId: string; |
@@ -1226,6 +1226,7 @@ | @@ -1226,6 +1226,7 @@ | ||
1226 | "type-stats": "Statistics", | 1226 | "type-stats": "Statistics", |
1227 | "type-debug-rule-node": "Debug", | 1227 | "type-debug-rule-node": "Debug", |
1228 | "type-debug-rule-chain": "Debug", | 1228 | "type-debug-rule-chain": "Debug", |
1229 | + "type-edge-event": "Downlink", | ||
1229 | "no-events-prompt": "No events found", | 1230 | "no-events-prompt": "No events found", |
1230 | "error": "Error", | 1231 | "error": "Error", |
1231 | "alarm": "Alarm", | 1232 | "alarm": "Alarm", |