diff options
author | 2021-04-08 12:39:48 +0000 | |
---|---|---|
committer | 2021-04-08 12:39:48 +0000 | |
commit | d702f00b71218c56af766363ce19f2459081d73c (patch) | |
tree | fafd0b1b622473745bebd767ccab55382d79b5df /sdnr/wt/odlux/apps/connectApp/src/handlers/networkElementsHandler.ts | |
parent | f3969004c6ccac18e742c5fc48c844e315991023 (diff) | |
parent | 21e4a946cd24b8a03ea577352f0271ebf7669ffa (diff) |
Merge "update odlux for notification change"
Diffstat (limited to 'sdnr/wt/odlux/apps/connectApp/src/handlers/networkElementsHandler.ts')
-rw-r--r-- | sdnr/wt/odlux/apps/connectApp/src/handlers/networkElementsHandler.ts | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sdnr/wt/odlux/apps/connectApp/src/handlers/networkElementsHandler.ts b/sdnr/wt/odlux/apps/connectApp/src/handlers/networkElementsHandler.ts index 4fe858c69..b74a39427 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/handlers/networkElementsHandler.ts +++ b/sdnr/wt/odlux/apps/connectApp/src/handlers/networkElementsHandler.ts @@ -17,10 +17,11 @@ */ import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; +import { getAccessPolicyByUrl } from '../../../../framework/src/services/restService'; import { NetworkElementConnection } from '../models/networkElementConnection'; -import connectService from '../services/connectService'; -import { requestRest } from '../../../../framework/src/services/restService'; +import { connectService } from '../services/connectService'; + export interface INetworkElementsState extends IExternalTableState<NetworkElementConnection> { } // create eleactic search material data fetch handler @@ -31,8 +32,7 @@ export const { createActions: createNetworkElementsActions, createProperties: createNetworkElementsProperties, reloadAction: networkElementsReloadAction, - reloadActionAsync: networkElementsReloadActionAsync - + // set value action, to change a value } = createExternal<NetworkElementConnection>(networkElementsSearchHandler, appState => { @@ -43,9 +43,9 @@ export const { appState.connect.networkElements.rows.forEach(element => { if (element.status === "Connected") { - const webUri = webUris.find(item => item.nodeId === element.id as string); + const webUri = webUris.find(item => item.id === element.id as string); if (webUri) { - element.webUri = webUri.webUri; + element.weburi = webUri.weburi; element.isWebUriUnreachable = false; } else { @@ -56,5 +56,10 @@ export const { } return appState.connect.networkElements +}, (ne) => { + if (!ne || !ne.id) return true; + const neUrl = connectService.getNetworkElementUri(ne.id); + const policy = getAccessPolicyByUrl(neUrl); + return !(policy.GET || policy.POST); }); |