diff options
author | Aijana Schumann <aijana.schumann@highstreet-technologies.com> | 2021-07-28 11:19:09 +0200 |
---|---|---|
committer | Aijana Schumann <aijana.schumann@highstreet-technologies.com> | 2021-07-28 11:19:09 +0200 |
commit | d70d7624795a9305eef1f0a6d3842d47ecd27160 (patch) | |
tree | 5324c4484be5a94d2a8f2cebb8035792a6073d7b /sdnr/wt/odlux/apps/connectApp/src/handlers/infoNetworkElementHandler.ts | |
parent | 2aa3a5dd6c190bf0a6c398bf7bf69e359eff2f9d (diff) |
ODLUX Connect App Info enhancement
Present yang capabilities in a table view instead of list
Issue-ID: SDNC-1121
Signed-off-by: Aijana Schumann <aijana.schumann@highstreet-technologies.com>
Change-Id: I4904fb132351199b57a851faf07d371fa5e575ab
Diffstat (limited to 'sdnr/wt/odlux/apps/connectApp/src/handlers/infoNetworkElementHandler.ts')
-rw-r--r-- | sdnr/wt/odlux/apps/connectApp/src/handlers/infoNetworkElementHandler.ts | 117 |
1 files changed, 75 insertions, 42 deletions
diff --git a/sdnr/wt/odlux/apps/connectApp/src/handlers/infoNetworkElementHandler.ts b/sdnr/wt/odlux/apps/connectApp/src/handlers/infoNetworkElementHandler.ts index d67a81ec4..3e2d1cec1 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/handlers/infoNetworkElementHandler.ts +++ b/sdnr/wt/odlux/apps/connectApp/src/handlers/infoNetworkElementHandler.ts @@ -15,46 +15,79 @@ * the License. * ============LICENSE_END========================================================================== */ -import { IActionHandler } from '../../../../framework/src/flux/action'; + import { IActionHandler } from '../../../../framework/src/flux/action'; -import { AllElementInfoLoadedAction, LoadAllElementInfoAction } from '../actions/infoNetworkElementActions'; - -import { TopologyNode } from '../models/topologyNetconf'; - -export interface IInfoNetworkElementsState { - elementInfo: TopologyNode; - busy: boolean; -} - -const infoNetworkElementsStateInit: IInfoNetworkElementsState = { - elementInfo: { - "node-id": "", - "netconf-node-topology:available-capabilities": { - "available-capability": [] - } - }, - busy: false -}; - -export const infoNetworkElementsActionHandler: IActionHandler<IInfoNetworkElementsState> = (state = infoNetworkElementsStateInit, action) => { - if (action instanceof LoadAllElementInfoAction) { - state = { - ...state, - busy: true - }; - } else if (action instanceof AllElementInfoLoadedAction) { - if (!action.error && action.elementInfo) { - state = { - ...state, - elementInfo: action.elementInfo, - busy: false - }; - } else { - state = { - ...state, - busy: false - }; - } - } - return state; -};
\ No newline at end of file + import { AllElementInfoLoadedAction, AllElementInfoFeatureLoadedAction, LoadAllElementInfoAction } from '../actions/infoNetworkElementActions'; + + import { Module, TopologyNode } from '../models/topologyNetconf'; + + export interface IInfoNetworkElementsState { + elementInfo: TopologyNode; + busy: boolean; + } + + export interface IInfoNetworkElementFeaturesState { + elementFeatureInfo: Module[]; + busy: boolean; + } + + const infoNetworkElementsStateInit: IInfoNetworkElementsState = { + elementInfo: { + "node-id": "", + "netconf-node-topology:available-capabilities": { + "available-capability": [] + } + }, + busy: false + }; + + const infoNetworkElementFeaturesStateInit: IInfoNetworkElementFeaturesState = { + elementFeatureInfo: [], + busy: false + }; + + export const infoNetworkElementsActionHandler: IActionHandler<IInfoNetworkElementsState> = (state = infoNetworkElementsStateInit, action) => { + if (action instanceof LoadAllElementInfoAction) { + state = { + ...state, + busy: true + }; + } else if (action instanceof AllElementInfoLoadedAction) { + if (!action.error && action.elementInfo) { + state = { + ...state, + elementInfo: action.elementInfo, + busy: false + }; + } else { + state = { + ...state, + busy: false + }; + } + } + return state; + }; + + export const infoNetworkElementFeaturesActionHandler: IActionHandler<IInfoNetworkElementFeaturesState> = (state = infoNetworkElementFeaturesStateInit, action) => { + if (action instanceof LoadAllElementInfoAction) { + state = { + ...state, + busy: true + }; + } else if (action instanceof AllElementInfoFeatureLoadedAction) { + if (!action.error && action.elementFeatureInfo) { + state = { + ...state, + elementFeatureInfo: action.elementFeatureInfo, + busy: false + }; + } else { + state = { + ...state, + busy: false + }; + } + } + return state; + };
\ No newline at end of file |