Commit 6f6f6fb1164c258afcbaa4cb567bea02afde2aa0
1 parent
40feb8f6
Code review. 1) edge.service: removed getTenantEdges, getCustomerEdges 2)service…
….completion.model.ts: code beautify
Showing
2 changed files
with
24 additions
and
28 deletions
@@ -54,38 +54,32 @@ export class EdgeService { | @@ -54,38 +54,32 @@ export class EdgeService { | ||
54 | return this.http.get<Array<EntitySubtype>>('/api/edge/types', defaultHttpOptionsFromConfig(config)); | 54 | return this.http.get<Array<EntitySubtype>>('/api/edge/types', defaultHttpOptionsFromConfig(config)); |
55 | } | 55 | } |
56 | 56 | ||
57 | - public getTenantEdges(pageLink: PageLink, type: string = '', | ||
58 | - config?: RequestConfig): Observable<PageData<EdgeInfo>> { | ||
59 | - return this.http.get<PageData<EdgeInfo>>(`/api/tenant/edges${pageLink.toQuery()}&type=${type}`, | ||
60 | - defaultHttpOptionsFromConfig(config)); | ||
61 | - } | ||
62 | - | ||
63 | - public getCustomerEdges(customerId: string, pageLink: PageLink, type: string = '', | ||
64 | - config?: RequestConfig): Observable<PageData<EdgeInfo>> { | ||
65 | - return this.http.get<PageData<EdgeInfo>>(`/api/customer/${customerId}/edges${pageLink.toQuery()}&type=${type}`, | ||
66 | - defaultHttpOptionsFromConfig(config)); | ||
67 | - } | ||
68 | - | ||
69 | public getCustomerEdgeInfos(customerId: string, pageLink: PageLink, type: string = '', | 57 | public getCustomerEdgeInfos(customerId: string, pageLink: PageLink, type: string = '', |
70 | config?: RequestConfig): Observable<PageData<EdgeInfo>> { | 58 | config?: RequestConfig): Observable<PageData<EdgeInfo>> { |
71 | return this.http.get<PageData<EdgeInfo>>(`/api/customer/${customerId}/edgeInfos${pageLink.toQuery()}&type=${type}`, | 59 | return this.http.get<PageData<EdgeInfo>>(`/api/customer/${customerId}/edgeInfos${pageLink.toQuery()}&type=${type}`, |
72 | defaultHttpOptionsFromConfig(config)); | 60 | defaultHttpOptionsFromConfig(config)); |
73 | } | 61 | } |
74 | 62 | ||
75 | - public assignEdgeToCustomer(customerId: string, edgeId: string, config?: RequestConfig): Observable<Edge> { | ||
76 | - return this.http.post<Edge>(`/api/customer/${customerId}/edge/${edgeId}`, defaultHttpOptionsFromConfig(config)); | 63 | + public assignEdgeToCustomer(customerId: string, edgeId: string, |
64 | + config?: RequestConfig): Observable<Edge> { | ||
65 | + return this.http.post<Edge>(`/api/customer/${customerId}/edge/${edgeId}`, | ||
66 | + defaultHttpOptionsFromConfig(config)); | ||
77 | } | 67 | } |
78 | 68 | ||
79 | public unassignEdgeFromCustomer(edgeId: string, config?: RequestConfig) { | 69 | public unassignEdgeFromCustomer(edgeId: string, config?: RequestConfig) { |
80 | - return this.http.delete(`/api/customer/edge/${edgeId}`, defaultHttpOptionsFromConfig(config)); | 70 | + return this.http.delete(`/api/customer/edge/${edgeId}`, |
71 | + defaultHttpOptionsFromConfig(config)); | ||
81 | } | 72 | } |
82 | 73 | ||
83 | public makeEdgePublic(edgeId: string, config?: RequestConfig): Observable<Edge> { | 74 | public makeEdgePublic(edgeId: string, config?: RequestConfig): Observable<Edge> { |
84 | - return this.http.post<Edge>(`/api/customer/public/edge/${edgeId}`, defaultHttpOptionsFromConfig(config)); | 75 | + return this.http.post<Edge>(`/api/customer/public/edge/${edgeId}`, |
76 | + defaultHttpOptionsFromConfig(config)); | ||
85 | } | 77 | } |
86 | 78 | ||
87 | - public setRootRuleChain(edgeId: string, ruleChainId: string, config?: RequestConfig): Observable<Edge> { | ||
88 | - return this.http.post<Edge>(`/api/edge/${edgeId}/${ruleChainId}/root`, defaultHttpOptionsFromConfig(config)); | 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)); | ||
89 | } | 83 | } |
90 | 84 | ||
91 | public getTenantEdgeInfos(pageLink: PageLink, type: string = '', | 85 | public getTenantEdgeInfos(pageLink: PageLink, type: string = '', |
@@ -95,10 +89,12 @@ export class EdgeService { | @@ -95,10 +89,12 @@ export class EdgeService { | ||
95 | } | 89 | } |
96 | 90 | ||
97 | public findByQuery(query: EdgeSearchQuery, config?: RequestConfig): Observable<Array<Edge>> { | 91 | public findByQuery(query: EdgeSearchQuery, config?: RequestConfig): Observable<Array<Edge>> { |
98 | - return this.http.post<Array<Edge>>('/api/edges', query, defaultHttpOptionsFromConfig(config)); | 92 | + return this.http.post<Array<Edge>>('/api/edges', query, |
93 | + defaultHttpOptionsFromConfig(config)); | ||
99 | } | 94 | } |
100 | 95 | ||
101 | - public getEdgeEvents(entityId: EntityId, pageLink: TimePageLink, config?: RequestConfig): Observable<PageData<Event>> { | 96 | + public getEdgeEvents(entityId: EntityId, pageLink: TimePageLink, |
97 | + config?: RequestConfig): Observable<PageData<Event>> { | ||
102 | return this.http.get<PageData<Event>>(`/api/edge/${entityId.id}/events` + `${pageLink.toQuery()}`, | 98 | return this.http.get<PageData<Event>>(`/api/edge/${entityId.id}/events` + `${pageLink.toQuery()}`, |
103 | defaultHttpOptionsFromConfig(config)); | 99 | defaultHttpOptionsFromConfig(config)); |
104 | } | 100 | } |
@@ -18,13 +18,13 @@ import { FunctionArg, FunctionArgType, TbEditorCompletions } from '@shared/model | @@ -18,13 +18,13 @@ import { FunctionArg, FunctionArgType, TbEditorCompletions } from '@shared/model | ||
18 | 18 | ||
19 | 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>'; | 19 | 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>'; |
20 | 20 | ||
21 | -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>'; | 21 | +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>'; |
22 | 22 | ||
23 | 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>'; | 23 | 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>'; |
24 | 24 | ||
25 | -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>'; | 25 | +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>'; |
26 | 26 | ||
27 | -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>'; | 27 | +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>'; |
28 | 28 | ||
29 | 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>'; | 29 | 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>'; |
30 | 30 | ||
@@ -32,15 +32,15 @@ export const pageDataHref = '<a href="https://github.com/thingsboard/thingsboard | @@ -32,15 +32,15 @@ export const pageDataHref = '<a href="https://github.com/thingsboard/thingsboard | ||
32 | 32 | ||
33 | export const deviceInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/device.models.ts#L33">DeviceInfo</a>'; | 33 | export const deviceInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/device.models.ts#L33">DeviceInfo</a>'; |
34 | 34 | ||
35 | -export const assetInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/asset.models.ts#L32">AssetInfo</a>'; | 35 | +export const assetInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/asset.models.ts#L32">AssetInfo</a>'; |
36 | 36 | ||
37 | 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>'; | 37 | 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>'; |
38 | 38 | ||
39 | export const entityRelationsQueryHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/relation.models.ts#L69">EntityRelationsQuery</a>'; | 39 | export const entityRelationsQueryHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/relation.models.ts#L69">EntityRelationsQuery</a>'; |
40 | 40 | ||
41 | -export const entityRelationInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/relation.models.ts#L87">EntityRelationInfo</a>'; | 41 | +export const entityRelationInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/relation.models.ts#L87">EntityRelationInfo</a>'; |
42 | 42 | ||
43 | -export const dashboardInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/dashboard.models.ts#L25">DashboardInfo</a>'; | 43 | +export const dashboardInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/dashboard.models.ts#L25">DashboardInfo</a>'; |
44 | 44 | ||
45 | export const deviceHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/device.models.ts#L24">Device</a>'; | 45 | export const deviceHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/device.models.ts#L24">Device</a>'; |
46 | 46 | ||
@@ -50,13 +50,13 @@ export const entityViewHref = '<a href="https://github.com/thingsboard/thingsboa | @@ -50,13 +50,13 @@ export const entityViewHref = '<a href="https://github.com/thingsboard/thingsboa | ||
50 | 50 | ||
51 | 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>'; | 51 | 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>'; |
52 | 52 | ||
53 | -export const dashboardHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/dashboard.models.ts#L102">Dashboard</a>'; | 53 | +export const dashboardHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/dashboard.models.ts#L102">Dashboard</a>'; |
54 | 54 | ||
55 | export const customerHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/customer.model.ts#L21">Customer</a>'; | 55 | export const customerHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/customer.model.ts#L21">Customer</a>'; |
56 | 56 | ||
57 | 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>'; | 57 | 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>'; |
58 | 58 | ||
59 | -export const userHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/user.model.ts#L23">User</a>'; | 59 | +export const userHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/user.model.ts#L23">User</a>'; |
60 | 60 | ||
61 | 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>'; | 61 | 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>'; |
62 | 62 |