From 62e834802dae0bd15504785503060d7875c7b4ad Mon Sep 17 00:00:00 2001 From: Herbert Eiselt Date: Thu, 28 Mar 2019 19:00:35 +0100 Subject: Add SDN-R odlux performance A UI displaying performance monitoring data Change-Id: I2a9c28549aee1bcac366354c343a63f884bf09e0 Issue-ID: SDNC-585 Signed-off-by: Herbert Eiselt --- sdnr/wt/odlux/apps/apiDemo/pom.xml | 8 +- sdnr/wt/odlux/apps/app-feature/pom.xml | 134 ++++---- sdnr/wt/odlux/apps/app-installer/pom.xml | 271 +++++++-------- sdnr/wt/odlux/apps/connectApp/pom.xml | 8 +- .../src/components/requiredNetworkElements.tsx | 14 +- .../src/components/unknownNetworkElements.tsx | 12 +- .../src/handlers/connectAppRootHandler.tsx | 2 +- .../src/handlers/connectionStatusLogHandler.tsx | 4 +- .../handlers/requiredNetworkElementsHandler.tsx | 4 +- sdnr/wt/odlux/apps/connectApp/src/plugin.tsx | 8 +- sdnr/wt/odlux/apps/demoApp/pom.xml | 8 +- .../demoApp/src/handlers/demoAppRootHandler.ts | 2 +- sdnr/wt/odlux/apps/demoApp/src/plugin.tsx | 16 +- .../odlux/apps/demoApp/src/views/authorsList.tsx | 4 +- sdnr/wt/odlux/apps/faultApp/pom.xml | 8 +- .../src/handlers/alarmLogEntriesHandler.ts | 4 +- .../src/handlers/currentProblemsHandler.ts | 4 +- .../faultApp/src/handlers/faultAppRootHandler.ts | 2 +- sdnr/wt/odlux/apps/faultApp/src/plugin.tsx | 14 +- .../apps/faultApp/src/views/faultApplication.tsx | 22 +- sdnr/wt/odlux/apps/helpApp/pom.xml | 8 +- .../apps/helpApp/src/components/subMenuEntry.tsx | 14 +- .../helpApp/src/handlers/helpAppRootHandler.ts | 4 +- sdnr/wt/odlux/apps/helpApp/src/index.html | 2 +- sdnr/wt/odlux/apps/helpApp/src/plugin.tsx | 10 +- .../odlux/apps/helpApp/src/services/helpService.ts | 4 +- .../apps/helpApp/src/views/helpApplication.tsx | 16 +- sdnr/wt/odlux/apps/helpApp/webpack.config.js | 22 +- sdnr/wt/odlux/apps/inventoryApp/pom.xml | 8 +- sdnr/wt/odlux/apps/inventoryApp/src/plugin.tsx | 4 +- .../apps/inventoryApp/src/views/dashboard.tsx | 15 +- sdnr/wt/odlux/apps/maintenanceApp/pom.xml | 8 +- .../src/actions/maintenenceActions.ts | 2 +- .../src/handlers/maintenanceAppRootHandler.ts | 4 +- sdnr/wt/odlux/apps/maintenanceApp/src/plugin.tsx | 4 +- .../maintenanceApp/src/views/maintenenceView.tsx | 4 +- .../wt/odlux/apps/maintenanceApp/webpack.config.js | 4 +- sdnr/wt/odlux/apps/mediatorApp/pom.xml | 10 +- .../src/actions/mediatorConfigActions.ts | 16 +- .../src/actions/mediatorServerActions.ts | 6 +- .../src/components/editMediatorConfigDialog.tsx | 22 +- .../src/components/editMediatorServerDialog.tsx | 34 +- .../handlers/avaliableMediatorServersHandler.ts | 4 +- .../src/handlers/mediatorAppRootHandler.ts | 2 +- sdnr/wt/odlux/apps/mediatorApp/src/plugin.tsx | 14 +- .../mediatorApp/src/views/mediatorApplication.tsx | 14 +- .../src/views/mediatorServerSelection.tsx | 10 +- sdnr/wt/odlux/apps/minimumApp/pom.xml | 8 +- .../src/handlers/minimumAppRootHandler.ts | 2 +- sdnr/wt/odlux/apps/minimumApp/src/plugin.tsx | 4 +- sdnr/wt/odlux/apps/performanceHistoryApp/.babelrc | 17 + .../odlux/apps/performanceHistoryApp/package.json | 40 +++ sdnr/wt/odlux/apps/performanceHistoryApp/pom.xml | 158 +++++++++ .../src/actions/connectedNetworkElementsActions.ts | 41 +++ .../performanceHistoryApp/src/actions/ltpAction.ts | 75 +++++ .../src/actions/panelChangeActions.ts | 15 + .../src/components/adaptiveModulation.tsx | 140 ++++++++ .../src/components/crossPolarDiscrimination.tsx | 74 +++++ .../src/components/performanceData.tsx | 75 +++++ .../src/components/receiveLevel.tsx | 74 +++++ .../src/components/signalToInterference.tsx | 75 +++++ .../src/components/temperature.tsx | 74 +++++ .../src/components/transmissionPower.tsx | 74 +++++ .../src/handlers/adaptiveModulation15minHandler.ts | 29 ++ .../handlers/adaptiveModulation24hoursHandler.ts | 29 ++ .../src/handlers/availableLtpsActionHandler.ts | 43 +++ .../connectedNetworkElementsActionHandler.ts | 43 +++ .../crossPolarDiscrimination15minHandler.ts | 29 ++ .../crossPolarDiscrimination24hoursHandler.ts | 29 ++ .../src/handlers/performanceData15minHandler.ts | 28 ++ .../src/handlers/performanceData24hoursHandler.ts | 28 ++ .../src/handlers/performanceHistoryRootHandler.ts | 83 +++++ .../src/handlers/receiveLevel15minHandler.ts | 29 ++ .../src/handlers/receiveLevel24hoursHandler.ts | 29 ++ .../handlers/signalToInterference15minHandler.ts | 29 ++ .../handlers/signalToInterference24hoursHandler.ts | 29 ++ .../src/handlers/temperature15minHandler.tsx | 29 ++ .../src/handlers/temperature24hoursHandler.ts | 29 ++ .../src/handlers/transmissionPower15minHandler.tsx | 29 ++ .../handlers/transmissionPower24hoursHandler.ts | 28 ++ .../apps/performanceHistoryApp/src/index.html | 25 ++ .../src/models/adaptiveModulationDataType.ts | 53 +++ .../src/models/availableLtps.ts | 14 + .../src/models/connectedNetworkElements.ts | 6 + .../src/models/crossPolarDiscriminationDataType.ts | 20 ++ .../performanceHistoryApp/src/models/panelId.ts | 4 + .../src/models/performanceDataType.ts | 20 ++ .../src/models/receiveLevelDataType.ts | 20 ++ .../src/models/signalToInteferenceDataType.ts | 20 ++ .../src/models/temperatureDataType.ts | 20 ++ .../src/models/topologyNetConf.ts | 12 + .../src/models/transmissionPowerDataType.ts | 20 ++ .../apps/performanceHistoryApp/src/plugin.tsx | 17 + .../src/services/performanceHistoryService.tsx | 93 ++++++ .../src/views/performanceHistoryApplication.tsx | 363 +++++++++++++++++++++ .../sdnr/wt/odlux/bundles/MyOdluxBundle.java | 68 ++++ .../resources/OSGI-INF/blueprint/blueprint.xml | 9 + .../sdnr/wt/odlux/bundles/test/TestBundleRes.java | 45 +++ .../src2/test/resources/test.js | 5 + .../odlux/apps/performanceHistoryApp/tsconfig.json | 37 +++ .../apps/performanceHistoryApp/webpack.config.js | 139 ++++++++ 101 files changed, 2955 insertions(+), 387 deletions(-) create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/.babelrc create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/package.json create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/pom.xml create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/actions/connectedNetworkElementsActions.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/actions/ltpAction.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/actions/panelChangeActions.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/components/adaptiveModulation.tsx create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/components/crossPolarDiscrimination.tsx create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/components/performanceData.tsx create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/components/receiveLevel.tsx create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/components/signalToInterference.tsx create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/components/temperature.tsx create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/components/transmissionPower.tsx create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/adaptiveModulation15minHandler.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/adaptiveModulation24hoursHandler.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/connectedNetworkElementsActionHandler.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/crossPolarDiscrimination15minHandler.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/crossPolarDiscrimination24hoursHandler.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceData15minHandler.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceData24hoursHandler.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceHistoryRootHandler.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/receiveLevel15minHandler.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/receiveLevel24hoursHandler.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/signalToInterference15minHandler.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/signalToInterference24hoursHandler.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/temperature15minHandler.tsx create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/temperature24hoursHandler.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/transmissionPower15minHandler.tsx create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/transmissionPower24hoursHandler.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/index.html create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/models/adaptiveModulationDataType.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/models/availableLtps.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/models/connectedNetworkElements.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/models/crossPolarDiscriminationDataType.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/models/panelId.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/models/performanceDataType.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/models/receiveLevelDataType.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/models/signalToInteferenceDataType.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/models/temperatureDataType.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/models/topologyNetConf.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/models/transmissionPowerDataType.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/plugin.tsx create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/services/performanceHistoryService.tsx create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/views/performanceHistoryApplication.tsx create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src2/test/resources/test.js create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/tsconfig.json create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/webpack.config.js (limited to 'sdnr/wt/odlux/apps') diff --git a/sdnr/wt/odlux/apps/apiDemo/pom.xml b/sdnr/wt/odlux/apps/apiDemo/pom.xml index 8cf7e3243..ae19899b5 100644 --- a/sdnr/wt/odlux/apps/apiDemo/pom.xml +++ b/sdnr/wt/odlux/apps/apiDemo/pom.xml @@ -1,11 +1,13 @@ - + org.onap.ccsdk.parent odlparent 1.2.2-SNAPSHOT - + 4.0.0 org.onap.ccsdk.features.sdnr.wt @@ -133,7 +135,7 @@ org.onap.ccsdk.features.sdnr.wt.odlux.model.*,com.opensymphony.* - + diff --git a/sdnr/wt/odlux/apps/app-feature/pom.xml b/sdnr/wt/odlux/apps/app-feature/pom.xml index ce74a3a0b..beabc38f0 100644 --- a/sdnr/wt/odlux/apps/app-feature/pom.xml +++ b/sdnr/wt/odlux/apps/app-feature/pom.xml @@ -1,68 +1,76 @@ - - - 4.0.0 + - org.onap.ccsdk.features.sdnr.wt - sdnr-wt-odlux-apps-feature - 0.4.2-SNAPSHOT - feature - ccsdk-features-sdnr-wt :: ${project.artifactId} :: feature + + 4.0.0 - - org.onap.ccsdk.parent - single-feature-parent - 1.2.2-SNAPSHOT - - - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0 - - + org.onap.ccsdk.features.sdnr.wt + sdnr-wt-odlux-apps-feature + 0.4.2-SNAPSHOT + feature + ccsdk-features-sdnr-wt :: ${project.artifactId} :: feature - - - ${project.groupId} - sdnr-wt-odlux-app-connectApp - ${project.version} - - - ${project.groupId} - sdnr-wt-odlux-app-faultApp - ${project.version} - - - ${project.groupId} - sdnr-wt-odlux-app-helpApp - ${project.version} - - - ${project.groupId} - sdnr-wt-odlux-app-inventoryApp - ${project.version} - - - ${project.groupId} - sdnr-wt-odlux-app-mediatorApp - ${project.version} - - - ${project.groupId} - sdnr-wt-odlux-app-maintenanceApp - ${project.version} - - + + org.onap.ccsdk.parent + single-feature-parent + 1.2.2-SNAPSHOT + + + + + Apache License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + + + + + + ${project.groupId} + sdnr-wt-odlux-app-connectApp + ${project.version} + + + ${project.groupId} + sdnr-wt-odlux-app-faultApp + ${project.version} + + + ${project.groupId} + sdnr-wt-odlux-app-helpApp + ${project.version} + + + ${project.groupId} + sdnr-wt-odlux-app-inventoryApp + ${project.version} + + + ${project.groupId} + sdnr-wt-odlux-app-mediatorApp + ${project.version} + + + ${project.groupId} + sdnr-wt-odlux-app-maintenanceApp + ${project.version} + + + ${project.groupId} + sdnr-wt-odlux-app-performanceHistoryApp + ${project.version} + + diff --git a/sdnr/wt/odlux/apps/app-installer/pom.xml b/sdnr/wt/odlux/apps/app-installer/pom.xml index 1c26e2bf0..3b47d64a1 100755 --- a/sdnr/wt/odlux/apps/app-installer/pom.xml +++ b/sdnr/wt/odlux/apps/app-installer/pom.xml @@ -1,139 +1,146 @@ - - 4.0.0 + + 4.0.0 - org.onap.ccsdk.features.sdnr.wt - sdnr-wt-odlux-apps-installer - 0.4.2-SNAPSHOT - pom - ccsdk-features-sdnr-wt :: ${project.artifactId} + org.onap.ccsdk.features.sdnr.wt + sdnr-wt-odlux-apps-installer + 0.4.2-SNAPSHOT + pom + ccsdk-features-sdnr-wt :: ${project.artifactId} - - org.onap.ccsdk.parent - odlparent-lite - 1.2.2-SNAPSHOT - - + + org.onap.ccsdk.parent + odlparent-lite + 1.2.2-SNAPSHOT + + - - sdnr-wt-odlux-apps - false - - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0 - - + + sdnr-wt-odlux-apps + false + + + + Apache License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + + - - - org.onap.ccsdk.features.sdnr.wt - ${application.name}-feature - ${project.version} - xml - features - - - * - * - - - - - ${project.groupId} - sdnr-wt-odlux-app-apiDemo - ${project.version} - - - ${project.groupId} - sdnr-wt-odlux-app-connectApp - ${project.version} - - - ${project.groupId} - sdnr-wt-odlux-app-demoApp - ${project.version} - - - ${project.groupId} - sdnr-wt-odlux-app-faultApp - ${project.version} - - - ${project.groupId} - sdnr-wt-odlux-app-helpApp - ${project.version} - - - ${project.groupId} - sdnr-wt-odlux-app-inventoryApp - ${project.version} - - - ${project.groupId} - sdnr-wt-odlux-app-minimumApp - ${project.version} - - - ${project.groupId} - sdnr-wt-odlux-app-mediatorApp - ${project.version} - - - ${project.groupId} - sdnr-wt-odlux-app-maintenanceApp - ${project.version} - - + + + org.onap.ccsdk.features.sdnr.wt + ${application.name}-feature + ${project.version} + xml + features + + + * + * + + + + + ${project.groupId} + sdnr-wt-odlux-app-apiDemo + ${project.version} + + + ${project.groupId} + sdnr-wt-odlux-app-connectApp + ${project.version} + + + ${project.groupId} + sdnr-wt-odlux-app-demoApp + ${project.version} + + + ${project.groupId} + sdnr-wt-odlux-app-faultApp + ${project.version} + + + ${project.groupId} + sdnr-wt-odlux-app-helpApp + ${project.version} + + + ${project.groupId} + sdnr-wt-odlux-app-inventoryApp + ${project.version} + + + ${project.groupId} + sdnr-wt-odlux-app-minimumApp + ${project.version} + + + ${project.groupId} + sdnr-wt-odlux-app-mediatorApp + ${project.version} + + + ${project.groupId} + sdnr-wt-odlux-app-maintenanceApp + ${project.version} + + + ${project.groupId} + sdnr-wt-odlux-app-performanceHistoryApp + ${project.version} + + - - - - maven-assembly-plugin - - - maven-repo-zip - - single - - package - - true - stage/${application.name}-${project.version} - - src/assembly/assemble_mvnrepo_zip.xml - - true - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-nested-dependencies - - copy-dependencies - - prepare-package - - true - ${project.build.directory}/assembly/system - false - true - true - true - false - false - - - - - - - - + + + + maven-assembly-plugin + + + maven-repo-zip + + single + + package + + true + stage/${application.name}-${project.version} + + src/assembly/assemble_mvnrepo_zip.xml + + true + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-nested-dependencies + + copy-dependencies + + prepare-package + + true + ${project.build.directory}/assembly/system + false + true + true + true + false + false + + + + + + + + diff --git a/sdnr/wt/odlux/apps/connectApp/pom.xml b/sdnr/wt/odlux/apps/connectApp/pom.xml index d8579e43c..b59a360eb 100644 --- a/sdnr/wt/odlux/apps/connectApp/pom.xml +++ b/sdnr/wt/odlux/apps/connectApp/pom.xml @@ -1,11 +1,13 @@ - + org.onap.ccsdk.parent odlparent 1.2.2-SNAPSHOT - + 4.0.0 org.onap.ccsdk.features.sdnr.wt @@ -125,7 +127,7 @@ org.onap.ccsdk.features.sdnr.wt.odlux.model.*,com.opensymphony.* - + diff --git a/sdnr/wt/odlux/apps/connectApp/src/components/requiredNetworkElements.tsx b/sdnr/wt/odlux/apps/connectApp/src/components/requiredNetworkElements.tsx index 9cbc368cb..aed81993b 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/components/requiredNetworkElements.tsx +++ b/sdnr/wt/odlux/apps/connectApp/src/components/requiredNetworkElements.tsx @@ -45,7 +45,7 @@ const styles = (theme: Theme) => createStyles({ const mapProps = (state: IApplicationStoreState) => ({ requiredNetworkElementsProperties: createRequiredNetworkElementsProperties(state), - mountedNetworkElements: state.connectApp.mountedNetworkElements + mountedNetworkElements: state.connect.mountedNetworkElements }); const mapDispatch = (dispatcher: IDispatcher) => ({ @@ -74,7 +74,7 @@ export class RequiredNetworkElementsListComponent extends React.Component
- - - - - + + + + +
) diff --git a/sdnr/wt/odlux/apps/connectApp/src/components/unknownNetworkElements.tsx b/sdnr/wt/odlux/apps/connectApp/src/components/unknownNetworkElements.tsx index fe2c58ced..a72a709e0 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/components/unknownNetworkElements.tsx +++ b/sdnr/wt/odlux/apps/connectApp/src/components/unknownNetworkElements.tsx @@ -32,7 +32,7 @@ const styles = (theme: Theme) => createStyles({ } }); -const mapProps = ({ connectApp: state }: IApplicationStoreState) => ({ +const mapProps = ({ connect: state }: IApplicationStoreState) => ({ mountedNetworkElements: state.mountedNetworkElements }); @@ -126,11 +126,11 @@ export class UnknownNetworkElementsListComponent extends React.Component
- - - - - + + + + +
) diff --git a/sdnr/wt/odlux/apps/connectApp/src/handlers/connectAppRootHandler.tsx b/sdnr/wt/odlux/apps/connectApp/src/handlers/connectAppRootHandler.tsx index dd9e3e1df..f67d5b8c9 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/handlers/connectAppRootHandler.tsx +++ b/sdnr/wt/odlux/apps/connectApp/src/handlers/connectAppRootHandler.tsx @@ -11,7 +11,7 @@ export interface IConnectAppStoreState { declare module '../../../../framework/src/store/applicationStore' { interface IApplicationStoreState { - connectApp: IConnectAppStoreState + connect: IConnectAppStoreState } } diff --git a/sdnr/wt/odlux/apps/connectApp/src/handlers/connectionStatusLogHandler.tsx b/sdnr/wt/odlux/apps/connectApp/src/handlers/connectionStatusLogHandler.tsx index 140020eaa..78da2c9af 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/handlers/connectionStatusLogHandler.tsx +++ b/sdnr/wt/odlux/apps/connectApp/src/handlers/connectionStatusLogHandler.tsx @@ -25,6 +25,6 @@ export const { createProperties: createConnectionStatusLogProperties, reloadAction: connectionStatusLogReloadAction, - // set value action, to change a value -} = createExternal(connectionStatusLogSearchHandler, appState => appState.connectApp.connectionStatusLog); + // set value action, to change a value +} = createExternal(connectionStatusLogSearchHandler, appState => appState.connect.connectionStatusLog); diff --git a/sdnr/wt/odlux/apps/connectApp/src/handlers/requiredNetworkElementsHandler.tsx b/sdnr/wt/odlux/apps/connectApp/src/handlers/requiredNetworkElementsHandler.tsx index b2d547717..332cb6dcb 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/handlers/requiredNetworkElementsHandler.tsx +++ b/sdnr/wt/odlux/apps/connectApp/src/handlers/requiredNetworkElementsHandler.tsx @@ -13,6 +13,6 @@ export const { createProperties: createRequiredNetworkElementsProperties, reloadAction: requiredNetworkElementsReloadAction, - // set value action, to change a value -} = createExternal(requiredNetworkElementsSearchHandler, appState => appState.connectApp.requiredNetworkElements); + // set value action, to change a value +} = createExternal(requiredNetworkElementsSearchHandler, appState => appState.connect.requiredNetworkElements); diff --git a/sdnr/wt/odlux/apps/connectApp/src/plugin.tsx b/sdnr/wt/odlux/apps/connectApp/src/plugin.tsx index 4a02b9f35..4da33e0af 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/plugin.tsx +++ b/sdnr/wt/odlux/apps/connectApp/src/plugin.tsx @@ -23,20 +23,20 @@ type ObjectNotification = { export function register() { const applicationApi = applicationManager.registerApplication({ - name: "connectApp", + name: "connect", icon: faPlug, rootComponent: ConnectApplication, rootActionHandler: connectAppRootHandler, - menuEntry: "Connect App" + menuEntry: "Connect" }); // subscribe to the websocket notifications - subscribe(["ObjectCreationNotification", "ObjectDeletionNotification"], (msg => { + subscribe(["ObjectCreationNotification", "ObjectDeletionNotification","AttributeValueChangedNotification"], (msg => { const store = applicationApi && applicationApi.applicationStore; if (msg && msg.notifType === "ObjectCreationNotification" && store) { store.dispatch(addMountedNetworkElementAsyncActionCreator(msg.objectId)); store.dispatch(new AddSnackbarNotification({ message: `Adding network element [${ msg.objectId }]`, options: { variant: 'info' } })); - } else if (msg && msg.notifType === "ObjectDeletionNotification" && store) { + } else if (msg && (msg.notifType === "ObjectDeletionNotification" || msg.notifType === "AttributeValueChangedNotification") && store) { store.dispatch(new AddSnackbarNotification({ message: `Updating network element [${ msg.objectId }]`, options: { variant: 'info' } })); store.dispatch(updateMountedNetworkElementAsyncActionCreator(msg.objectId)); } diff --git a/sdnr/wt/odlux/apps/demoApp/pom.xml b/sdnr/wt/odlux/apps/demoApp/pom.xml index 6e7065664..1d8b9d739 100644 --- a/sdnr/wt/odlux/apps/demoApp/pom.xml +++ b/sdnr/wt/odlux/apps/demoApp/pom.xml @@ -1,11 +1,13 @@ - + org.onap.ccsdk.parent odlparent 1.2.2-SNAPSHOT - + 4.0.0 org.onap.ccsdk.features.sdnr.wt @@ -125,7 +127,7 @@ org.onap.ccsdk.features.sdnr.wt.odlux.model.*,com.opensymphony.* - + diff --git a/sdnr/wt/odlux/apps/demoApp/src/handlers/demoAppRootHandler.ts b/sdnr/wt/odlux/apps/demoApp/src/handlers/demoAppRootHandler.ts index ee21a9c90..00546fd07 100644 --- a/sdnr/wt/odlux/apps/demoApp/src/handlers/demoAppRootHandler.ts +++ b/sdnr/wt/odlux/apps/demoApp/src/handlers/demoAppRootHandler.ts @@ -13,7 +13,7 @@ export interface IDemoAppStoreState { declare module '../../../../framework/src/store/applicationStore' { interface IApplicationStoreState { - demoApp: IDemoAppStoreState + demo: IDemoAppStoreState } } diff --git a/sdnr/wt/odlux/apps/demoApp/src/plugin.tsx b/sdnr/wt/odlux/apps/demoApp/src/plugin.tsx index f450275c2..cd9efe136 100644 --- a/sdnr/wt/odlux/apps/demoApp/src/plugin.tsx +++ b/sdnr/wt/odlux/apps/demoApp/src/plugin.tsx @@ -1,4 +1,4 @@ -import * as React from "react"; +import * as React from "react"; import { withRouter, RouteComponentProps, Route, Switch, Redirect } from 'react-router-dom'; import { faAddressBook, faRegistered } from '@fortawesome/free-solid-svg-icons'; @@ -17,21 +17,21 @@ type AppProps = RouteComponentProps & Connect; const App = (props: AppProps) => ( - - + + -); - -const FinalApp = withRouter(connect()(App)); +); + +const FinalApp = withRouter(connect()(App)); export function register() { const applicationApi = applicationManager.registerApplication({ - name: "demoApp", + name: "demo", icon: faAddressBook, rootComponent: FinalApp, rootActionHandler: demoAppRootHandler, exportedComponents: { counter: Counter }, - menuEntry: "Demo App" + menuEntry: "Demo" }); } diff --git a/sdnr/wt/odlux/apps/demoApp/src/views/authorsList.tsx b/sdnr/wt/odlux/apps/demoApp/src/views/authorsList.tsx index b192fccf8..75761cd19 100644 --- a/sdnr/wt/odlux/apps/demoApp/src/views/authorsList.tsx +++ b/sdnr/wt/odlux/apps/demoApp/src/views/authorsList.tsx @@ -20,7 +20,7 @@ interface IAuthorsListProps { } class AuthorsListComponent extends React.Component { - + render(): JSX.Element { const { authors, busy } = this.props; return ( @@ -58,7 +58,7 @@ class AuthorsListComponent extends React.Component ({ + ({ demo: state }) => ({ authors: state.listAuthors.authors, busy: state.listAuthors.busy }), diff --git a/sdnr/wt/odlux/apps/faultApp/pom.xml b/sdnr/wt/odlux/apps/faultApp/pom.xml index 376449bc0..5bfcd52ec 100644 --- a/sdnr/wt/odlux/apps/faultApp/pom.xml +++ b/sdnr/wt/odlux/apps/faultApp/pom.xml @@ -1,11 +1,13 @@ - + org.onap.ccsdk.parent odlparent 1.2.2-SNAPSHOT - + 4.0.0 @@ -126,7 +128,7 @@ org.onap.ccsdk.features.sdnr.wt.odlux.model.*,com.opensymphony.* - + diff --git a/sdnr/wt/odlux/apps/faultApp/src/handlers/alarmLogEntriesHandler.ts b/sdnr/wt/odlux/apps/faultApp/src/handlers/alarmLogEntriesHandler.ts index 0b974207b..3cc467546 100644 --- a/sdnr/wt/odlux/apps/faultApp/src/handlers/alarmLogEntriesHandler.ts +++ b/sdnr/wt/odlux/apps/faultApp/src/handlers/alarmLogEntriesHandler.ts @@ -19,6 +19,6 @@ export const { createProperties: createAlarmLogEntriesProperties, reloadAction: alarmLogEntriesReloadAction, - // set value action, to change a value -} = createExternal(alarmLogEntriesSearchHandler, appState => appState.faultApp.alarmLogEntries); + // set value action, to change a value +} = createExternal(alarmLogEntriesSearchHandler, appState => appState.fault.alarmLogEntries); diff --git a/sdnr/wt/odlux/apps/faultApp/src/handlers/currentProblemsHandler.ts b/sdnr/wt/odlux/apps/faultApp/src/handlers/currentProblemsHandler.ts index 6bbe2976f..67eb10d32 100644 --- a/sdnr/wt/odlux/apps/faultApp/src/handlers/currentProblemsHandler.ts +++ b/sdnr/wt/odlux/apps/faultApp/src/handlers/currentProblemsHandler.ts @@ -19,6 +19,6 @@ export const { createProperties: createCurrentProblemsProperties, reloadAction: currentProblemsReloadAction, - // set value action, to change a value -} = createExternal(currentProblemsSearchHandler, appState => appState.faultApp.currentProblems); + // set value action, to change a value +} = createExternal(currentProblemsSearchHandler, appState => appState.fault.currentProblems); diff --git a/sdnr/wt/odlux/apps/faultApp/src/handlers/faultAppRootHandler.ts b/sdnr/wt/odlux/apps/faultApp/src/handlers/faultAppRootHandler.ts index 005e3e5a4..a887a3327 100644 --- a/sdnr/wt/odlux/apps/faultApp/src/handlers/faultAppRootHandler.ts +++ b/sdnr/wt/odlux/apps/faultApp/src/handlers/faultAppRootHandler.ts @@ -27,7 +27,7 @@ const currentOpenPanelHandler: IActionHandler = (state = null, ac declare module '../../../../framework/src/store/applicationStore' { interface IApplicationStoreState { - faultApp: IFaultAppStoreState; + fault: IFaultAppStoreState; } } diff --git a/sdnr/wt/odlux/apps/faultApp/src/plugin.tsx b/sdnr/wt/odlux/apps/faultApp/src/plugin.tsx index 6f83e74dc..c4545ad1a 100644 --- a/sdnr/wt/odlux/apps/faultApp/src/plugin.tsx +++ b/sdnr/wt/odlux/apps/faultApp/src/plugin.tsx @@ -1,7 +1,7 @@ // app configuration and main entry point for the app -import * as React from "react"; +import * as React from "react"; import { withRouter, RouteComponentProps, Route, Switch, Redirect } from 'react-router-dom'; import connect, { Connect, IDispatcher } from '../../../framework/src/flux/connect'; @@ -22,7 +22,7 @@ import { AddFaultNotificationAction } from "./actions/notificationActions"; import { createCurrentProblemsProperties, createCurrentProblemsActions } from "./handlers/currentProblemsHandler"; -let currentMountId: string | undefined = undefined; +let currentMountId: string | undefined = undefined; const mapProps = (state: IApplicationStoreState) => ({ currentProblemsProperties: createCurrentProblemsProperties(state), @@ -35,7 +35,7 @@ const mapDisp = (dispatcher: IDispatcher) => ({ const FaultApplicationRouteAdapter = connect(mapProps, mapDisp)((props: RouteComponentProps<{ mountId?: string }> & Connect) => { if (currentMountId !== props.match.params.mountId) { - // route parameter has changed + // route parameter has changed currentMountId = props.match.params.mountId || undefined; // Hint: This timeout is need, since it is not recommended to change the state while rendering is in progress ! window.setTimeout(() => { @@ -54,14 +54,14 @@ const FaultApplicationRouteAdapter = connect(mapProps, mapDisp)((props: RouteCom const App = withRouter((props: RouteComponentProps) => ( - + -)); - +)); + export function register() { const applicationApi = applicationManager.registerApplication({ - name: "faultApp", + name: "fault", icon: faBell, rootComponent: App, rootActionHandler: faultAppRootHandler, diff --git a/sdnr/wt/odlux/apps/faultApp/src/views/faultApplication.tsx b/sdnr/wt/odlux/apps/faultApp/src/views/faultApplication.tsx index 9eb3a00ff..d4c7c597a 100644 --- a/sdnr/wt/odlux/apps/faultApp/src/views/faultApplication.tsx +++ b/sdnr/wt/odlux/apps/faultApp/src/views/faultApplication.tsx @@ -3,7 +3,7 @@ import * as React from 'react'; import { withRouter, RouteComponentProps } from 'react-router-dom'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons'; +import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons'; import { MaterialTable, ColumnType, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; import { Panel } from '../../../../framework/src/components/material-ui'; @@ -19,9 +19,9 @@ import { createAlarmLogEntriesProperties, createAlarmLogEntriesActions, alarmLog import { SetPanelAction } from '../actions/panelChangeActions'; const mapProps = (state: IApplicationStoreState) => ({ - activePanel: state.faultApp.currentOpenPanel, + activePanel: state.fault.currentOpenPanel, currentProblemsProperties: createCurrentProblemsProperties(state), - faultNotifications: state.faultApp.faultNotifications, + faultNotifications: state.fault.faultNotifications, alarmLogEntriesProperties: createAlarmLogEntriesProperties(state) }); @@ -39,15 +39,15 @@ type FaultApplicationComponentProps = RouteComponentProps & Connect; class FaultApplicationComponent extends React.Component{ - + render(): JSX.Element { - + const { activePanel } = this.props; - + const onTogglePanel = (panelId: PanelId) => { const nextActivePanel = panelId === this.props.activePanel ? null : panelId; this.props.setCurrentPanel(nextActivePanel); - + switch (nextActivePanel) { case 'CurrentProblem': this.props.reloadCurrentProblems(); @@ -66,7 +66,7 @@ class FaultApplicationComponent extends React.Component - - + { return ( - + ); - }; + }; } diff --git a/sdnr/wt/odlux/apps/helpApp/pom.xml b/sdnr/wt/odlux/apps/helpApp/pom.xml index 3e1d4e0ca..9115d896a 100644 --- a/sdnr/wt/odlux/apps/helpApp/pom.xml +++ b/sdnr/wt/odlux/apps/helpApp/pom.xml @@ -1,11 +1,13 @@ - + org.onap.ccsdk.parent odlparent 1.2.2-SNAPSHOT - + 4.0.0 org.onap.ccsdk.features.sdnr.wt @@ -125,7 +127,7 @@ org.onap.ccsdk.features.sdnr.wt.odlux.model.*,com.opensymphony.* - + diff --git a/sdnr/wt/odlux/apps/helpApp/src/components/subMenuEntry.tsx b/sdnr/wt/odlux/apps/helpApp/src/components/subMenuEntry.tsx index 72bb39e39..2328b12b3 100644 --- a/sdnr/wt/odlux/apps/helpApp/src/components/subMenuEntry.tsx +++ b/sdnr/wt/odlux/apps/helpApp/src/components/subMenuEntry.tsx @@ -13,23 +13,23 @@ import { TocTreeNode } from '../models/tocNode'; const TocTree = TreeView as any as TreeViewCtorType; const mapProps = (state: IApplicationStoreState) => ({ - helpToc: state.helpApp.toc, - helpBusy: state.helpApp.busy + helpToc: state.help.toc, + helpBusy: state.help.busy }); const mapDisp = (dispatcher: IDispatcher) => ({ - requestDocument: (node: TocTreeNode) => dispatcher.dispatch(new NavigateToApplication("helpApp", node.uri)) + requestDocument: (node: TocTreeNode) => dispatcher.dispatch(new NavigateToApplication("help", node.uri)) }); const SubMenuEntryComponent: React.SFC> = (props) => { return props.helpToc ? ( - ) - : ( - Loading ... - ) + : ( + Loading ... + ) }; export const SubMenuEntry = connect(mapProps, mapDisp)(SubMenuEntryComponent); diff --git a/sdnr/wt/odlux/apps/helpApp/src/handlers/helpAppRootHandler.ts b/sdnr/wt/odlux/apps/helpApp/src/handlers/helpAppRootHandler.ts index efdc6e83d..b9ddc50af 100644 --- a/sdnr/wt/odlux/apps/helpApp/src/handlers/helpAppRootHandler.ts +++ b/sdnr/wt/odlux/apps/helpApp/src/handlers/helpAppRootHandler.ts @@ -14,14 +14,14 @@ export interface IHelpAppStoreState { declare module '../../../../framework/src/store/applicationStore' { interface IApplicationStoreState { - helpApp: IHelpAppStoreState + help: IHelpAppStoreState } } const helpAppStoreStateInit: IHelpAppStoreState = { busy: false, toc: undefined, - content: undefined, + content: undefined, currentPath: undefined }; diff --git a/sdnr/wt/odlux/apps/helpApp/src/index.html b/sdnr/wt/odlux/apps/helpApp/src/index.html index 2d20410e0..6865db051 100644 --- a/sdnr/wt/odlux/apps/helpApp/src/index.html +++ b/sdnr/wt/odlux/apps/helpApp/src/index.html @@ -17,7 +17,7 @@ // run the application require(["app", "helpApp"], function (app, helpApp) { helpApp.register(); - app("./app.tsx") + app("./app.tsx").runApplication(); }); diff --git a/sdnr/wt/odlux/apps/helpApp/src/plugin.tsx b/sdnr/wt/odlux/apps/helpApp/src/plugin.tsx index d1cf80804..f871ab9d9 100644 --- a/sdnr/wt/odlux/apps/helpApp/src/plugin.tsx +++ b/sdnr/wt/odlux/apps/helpApp/src/plugin.tsx @@ -1,6 +1,6 @@ // app configuration and main entry point for the app -import * as React from "react"; +import * as React from "react"; import { withRouter, RouteComponentProps, Route, Switch, Redirect } from 'react-router-dom'; import { faFirstAid } from '@fortawesome/free-solid-svg-icons'; // select app icon @@ -18,7 +18,7 @@ import { SubMenuEntry } from "./components/subMenuEntry"; import '!style-loader!css-loader!highlight.js/styles/default.css'; const mapProps = (state: IApplicationStoreState) => ({ - + }); const mapDisp = (dispatcher: IDispatcher) => ({ @@ -31,7 +31,7 @@ let currentHelpPath: string | undefined = undefined; const HelpApplicationRouteAdapter = connect(mapProps, mapDisp)((props: RouteComponentProps<{ '0'?: string }> & Connect) => { if (currentHelpPath !== props.match.params["0"]) { - // route parameter has changed + // route parameter has changed currentHelpPath = props.match.params["0"] || undefined; // Hint: This timeout is need, since it is not recommended to change the state while rendering is in progress ! window.setTimeout(() => { @@ -54,7 +54,7 @@ const App = withRouter((props: RouteComponentProps) => ( export async function register() { const applicationApi = applicationManager.registerApplication({ - name: "helpApp", + name: "help", icon: faFirstAid, rootComponent: App, rootActionHandler: helpAppRootHandler, @@ -63,7 +63,7 @@ export async function register() { }); // start the initial toc request after the application store is initalized - const store = await applicationApi.applicationStoreInitialized; + const store = await applicationApi.applicationStoreInitialized; store.dispatch(requestTocAsyncAction); } \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/helpApp/src/services/helpService.ts b/sdnr/wt/odlux/apps/helpApp/src/services/helpService.ts index 480cdd04e..800e0b47f 100644 --- a/sdnr/wt/odlux/apps/helpApp/src/services/helpService.ts +++ b/sdnr/wt/odlux/apps/helpApp/src/services/helpService.ts @@ -9,7 +9,7 @@ class HelpService { public async getDocument(path: string): Promise { // check if the result is allready in the cache if (this.documents[path]) return Promise.resolve(this.documents[path]); - + // request the document const result = await requestRest(`/help/${ path }`.replace(/\/{2,}/i, '/')); if (result) { @@ -23,7 +23,7 @@ class HelpService { if (this.tocNodeCollection) return Promise.resolve(this.tocNodeCollection); // request the table of contents - const result = await requestRest('/help/?meta'); + const result = await requestRest('/help/?meta', undefined, false); if (result !== false) { const mapNodesCollection = (col: TocNodeCollection): TocTreeNode[] => { return Object.keys(col).reduce ((acc, key) => { diff --git a/sdnr/wt/odlux/apps/helpApp/src/views/helpApplication.tsx b/sdnr/wt/odlux/apps/helpApp/src/views/helpApplication.tsx index dedb93607..54f708458 100644 --- a/sdnr/wt/odlux/apps/helpApp/src/views/helpApplication.tsx +++ b/sdnr/wt/odlux/apps/helpApp/src/views/helpApplication.tsx @@ -11,8 +11,8 @@ import { Markdown } from "../components/markdown"; import '!style-loader!css-loader!github-markdown-css/github-markdown.css' const mapProps = (state: IApplicationStoreState) => ({ - content: state.helpApp.content, - currentPath: state.helpApp.currentPath + content: state.help.content, + currentPath: state.help.currentPath }); type HelpApplicationComponentProps = Connect; @@ -22,27 +22,27 @@ class HelpApplicationComponent extends React.Component { // check if href is rel or abs const absUrlMatch = href.trim().match(/^https?:\/\//i); - return `${ text }` + return `${text}` }; this.renderer.image = (href: string, title: string) => { - return `${ title }` + return `${title}` }; } render(): JSX.Element { return this.props.content ? ( - + ) : (

Loading ...

) } diff --git a/sdnr/wt/odlux/apps/helpApp/webpack.config.js b/sdnr/wt/odlux/apps/helpApp/webpack.config.js index fdae7d957..f9448a310 100644 --- a/sdnr/wt/odlux/apps/helpApp/webpack.config.js +++ b/sdnr/wt/odlux/apps/helpApp/webpack.config.js @@ -143,8 +143,26 @@ module.exports = (env) => { colors: true }, proxy: { - "/help": { - target: "http://localhost:8181", + "/oauth2/": { + target: "http://localhost:3000", + secure: false + }, + "/database/": { + target: "http://localhost:3000", + secure: false + }, + "/restconf/": { + target: "http://localhost:3000", + secure: false + }, + "/help/": { + target: "http://localhost:3000", + secure: false + }, + "/websocket/": { + target: "http://localhost:3000", + ws: true, + changeOrigin: true, secure: false } } diff --git a/sdnr/wt/odlux/apps/inventoryApp/pom.xml b/sdnr/wt/odlux/apps/inventoryApp/pom.xml index b2572563f..713dd3606 100644 --- a/sdnr/wt/odlux/apps/inventoryApp/pom.xml +++ b/sdnr/wt/odlux/apps/inventoryApp/pom.xml @@ -1,11 +1,13 @@ - + org.onap.ccsdk.parent odlparent 1.2.2-SNAPSHOT - + 4.0.0 org.onap.ccsdk.features.sdnr.wt @@ -125,7 +127,7 @@ org.onap.ccsdk.features.sdnr.wt.odlux.model.*,com.opensymphony.* - + diff --git a/sdnr/wt/odlux/apps/inventoryApp/src/plugin.tsx b/sdnr/wt/odlux/apps/inventoryApp/src/plugin.tsx index 52e1d4802..6022d9569 100644 --- a/sdnr/wt/odlux/apps/inventoryApp/src/plugin.tsx +++ b/sdnr/wt/odlux/apps/inventoryApp/src/plugin.tsx @@ -9,9 +9,9 @@ import { Dashboard } from './views/dashboard'; export function register() { applicationManager.registerApplication({ - name: "inventoryApp", + name: "inventory", icon: faShoppingBag, rootComponent: Dashboard, - menuEntry: "Inventory App" + menuEntry: "Inventory" }); } diff --git a/sdnr/wt/odlux/apps/inventoryApp/src/views/dashboard.tsx b/sdnr/wt/odlux/apps/inventoryApp/src/views/dashboard.tsx index 8d07fa88c..b2361af7f 100644 --- a/sdnr/wt/odlux/apps/inventoryApp/src/views/dashboard.tsx +++ b/sdnr/wt/odlux/apps/inventoryApp/src/views/dashboard.tsx @@ -6,13 +6,13 @@ import { Result, InventoryType } from '../models/inventory'; const url = `${ window.location.origin}/database/sdnevents/inventoryequipment/_search`; -const fetchData: DataCallback = async (page, rowsPerPage, orderBy, order, filter) => { +const fetchData: DataCallback = async (page, rowsPerPage, orderBy, order, filter) => { const from = rowsPerPage && page != null && !isNaN(+page) ? (+page) * rowsPerPage : null; const filterKeys = filter && Object.keys(filter) || []; - + const query = { ...filterKeys.length > 0 ? { query: { @@ -30,7 +30,7 @@ const fetchData: DataCallback = async (page, rowsPerPage, orderBy, order, filter ...from ? { "from": from } : {}, ...orderBy && order ? { "sort": [{ [orderBy]: order }] } : {}, }; - + const result = await fetch(url, { method: "POST", // *GET, POST, PUT, DELETE, etc. mode: "no-cors", // no-cors, cors, *same-origin @@ -45,8 +45,13 @@ const fetchData: DataCallback = async (page, rowsPerPage, orderBy, order, filter if (result.ok) { const queryResult: Result = await result.json(); const data = { - page: Math.min(page || 0, queryResult.hits.total || 0 / (rowsPerPage || 1)), rowCount: queryResult.hits.total, rows: queryResult && queryResult.hits && queryResult.hits.hits && queryResult.hits.hits.map(h => ( - { ...h._source, _id: h._id } + page: Math.min(page || 0, queryResult.hits.total || 0 / (rowsPerPage || 1)), + rowCount: queryResult.hits.total, + rows: queryResult && queryResult.hits && queryResult.hits.hits && queryResult.hits.hits.map(h => ( + { + ...h._source, + _id: h._id + } )) || [] }; return data; diff --git a/sdnr/wt/odlux/apps/maintenanceApp/pom.xml b/sdnr/wt/odlux/apps/maintenanceApp/pom.xml index cdbc9b096..87ff29043 100644 --- a/sdnr/wt/odlux/apps/maintenanceApp/pom.xml +++ b/sdnr/wt/odlux/apps/maintenanceApp/pom.xml @@ -1,11 +1,13 @@ - + org.onap.ccsdk.parent odlparent 1.2.2-SNAPSHOT - + 4.0.0 org.onap.ccsdk.features.sdnr.wt @@ -125,7 +127,7 @@ org.onap.ccsdk.features.sdnr.wt.odlux.model.*,com.opensymphony.* - + diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src/actions/maintenenceActions.ts b/sdnr/wt/odlux/apps/maintenanceApp/src/actions/maintenenceActions.ts index 753c1183f..3fe75ad51 100644 --- a/sdnr/wt/odlux/apps/maintenanceApp/src/actions/maintenenceActions.ts +++ b/sdnr/wt/odlux/apps/maintenanceApp/src/actions/maintenenceActions.ts @@ -30,7 +30,7 @@ export const loadAllMainteneceEntriesAsyncAction = (dispatch: Dispatch , getStat } // combine ell entries from the maintenance index with all networkelements - const networkElements = getState().connectApp.mountedNetworkElements; + const networkElements = getState().connect.mountedNetworkElements; const maintenenceEntries = networkElements.elements.reduce((acc, cur) => { const entry = entries.find(e => e.mountId === cur.mountId); acc.push(entry || { diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src/handlers/maintenanceAppRootHandler.ts b/sdnr/wt/odlux/apps/maintenanceApp/src/handlers/maintenanceAppRootHandler.ts index 956d05843..d2e387cc4 100644 --- a/sdnr/wt/odlux/apps/maintenanceApp/src/handlers/maintenanceAppRootHandler.ts +++ b/sdnr/wt/odlux/apps/maintenanceApp/src/handlers/maintenanceAppRootHandler.ts @@ -14,8 +14,8 @@ export interface IMaintenanceAppStoreState { declare module '../../../../framework/src/store/applicationStore' { interface IApplicationStoreState { - maintenanceApp: IMaintenanceAppStoreState, - connectApp: IConnectAppStoreState + maintenance: IMaintenanceAppStoreState, + connect: IConnectAppStoreState } } diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src/plugin.tsx b/sdnr/wt/odlux/apps/maintenanceApp/src/plugin.tsx index 19e188ec2..f23a875e3 100644 --- a/sdnr/wt/odlux/apps/maintenanceApp/src/plugin.tsx +++ b/sdnr/wt/odlux/apps/maintenanceApp/src/plugin.tsx @@ -16,11 +16,11 @@ const App : React.SFC = (props) => { export function register() { applicationManager.registerApplication({ - name: "maintenanceApp", + name: "maintenance", icon: faLock, rootComponent: App, rootActionHandler: maintenanceAppRootHandler, - menuEntry: "Maintenance App" + menuEntry: "Maintenance" }); } diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src/views/maintenenceView.tsx b/sdnr/wt/odlux/apps/maintenanceApp/src/views/maintenenceView.tsx index f048d6cc5..0a8ad4a59 100644 --- a/sdnr/wt/odlux/apps/maintenanceApp/src/views/maintenenceView.tsx +++ b/sdnr/wt/odlux/apps/maintenanceApp/src/views/maintenenceView.tsx @@ -37,8 +37,8 @@ const styles = (theme: Theme) => createStyles({ const MaintenenceEntriesTable = MaterialTable as MaterialTableCtorType; const mapProps = (state: IApplicationStoreState) => ({ - maintenenceEntries: state.maintenanceApp.maintenenceEntries.entries, - busy: state.maintenanceApp.maintenenceEntries.busy + maintenenceEntries: state.maintenance.maintenenceEntries.entries, + busy: state.maintenance.maintenenceEntries.busy }); const mapDispatcher = (dispatcher: IDispatcher) => ({ diff --git a/sdnr/wt/odlux/apps/maintenanceApp/webpack.config.js b/sdnr/wt/odlux/apps/maintenanceApp/webpack.config.js index 0a2f5abb8..325e70380 100644 --- a/sdnr/wt/odlux/apps/maintenanceApp/webpack.config.js +++ b/sdnr/wt/odlux/apps/maintenanceApp/webpack.config.js @@ -127,11 +127,11 @@ module.exports = (env) => { }, proxy: { "/restconf": { - target: "http://localhost:8181", + target: "http://localhost:3000", secure: false }, "/database": { - target: "http://localhost:8181", + target: "http://localhost:3000", secure: false } } diff --git a/sdnr/wt/odlux/apps/mediatorApp/pom.xml b/sdnr/wt/odlux/apps/mediatorApp/pom.xml index 826e6b586..a8c9cea9f 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/pom.xml +++ b/sdnr/wt/odlux/apps/mediatorApp/pom.xml @@ -1,11 +1,13 @@ - + org.onap.ccsdk.parent odlparent - 1.2.2-SNAPSHOT - + 1.1.2 + 4.0.0 @@ -126,7 +128,7 @@ org.onap.ccsdk.features.sdnr.wt.odlux.model.*,com.opensymphony.* - + diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/actions/mediatorConfigActions.ts b/sdnr/wt/odlux/apps/mediatorApp/src/actions/mediatorConfigActions.ts index fcfc63e22..058110614 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/actions/mediatorConfigActions.ts +++ b/sdnr/wt/odlux/apps/mediatorApp/src/actions/mediatorConfigActions.ts @@ -38,11 +38,11 @@ export class RemoveMediatorConfig extends BaseAction { export const startMediatorByNameAsyncActionCreator = (name: string) => (dispatch: Dispatch, getState: () => IApplicationStoreState) => { dispatch(new SetMediatorBusyByName(name, true)); - const { mediatorApp: { mediatorServerState: { url } } } = getState(); + const { mediator: { mediatorServerState: { url } } } = getState(); if (url) { mediatorService.startMediatorByName(url, name).then(msg => { dispatch(new AddSnackbarNotification({ message: msg + ' ' + name, options: { variant: 'info' } })); - // since there is no notification, a timeout will be need here + // since there is no notification, a timeout will be need here window.setTimeout(() => { mediatorService.getMediatorServerConfigByName(url, name).then(config => { if (config) { @@ -62,11 +62,11 @@ export const startMediatorByNameAsyncActionCreator = (name: string) => (dispatch export const stopMediatorByNameAsyncActionCreator = (name: string) => (dispatch: Dispatch, getState: () => IApplicationStoreState) => { dispatch(new SetMediatorBusyByName(name, true)); - const { mediatorApp: { mediatorServerState: { url } } } = getState(); + const { mediator: { mediatorServerState: { url } } } = getState(); if (url) { mediatorService.stopMediatorByName(url, name).then(msg => { dispatch(new AddSnackbarNotification({ message: msg + ' ' + name, options: { variant: 'info' } })); - // since there is no notification, a timeout will be need here + // since there is no notification, a timeout will be need here window.setTimeout(() => { mediatorService.getMediatorServerConfigByName(url, name).then(config => { if (config) { @@ -86,11 +86,11 @@ export const stopMediatorByNameAsyncActionCreator = (name: string) => (dispatch: export const addMediatorConfigAsyncActionCreator = (config: MediatorConfig) => (dispatch: Dispatch, getState: () => IApplicationStoreState) => { const { Name: name } = config; - const { mediatorApp: { mediatorServerState: { url } } } = getState(); + const { mediator: { mediatorServerState: { url } } } = getState(); if (url) { mediatorService.createMediatorConfig(url, config).then(msg => { dispatch(new AddSnackbarNotification({ message: msg + ' ' + name, options: { variant: 'info' } })); - // since there is no notification, a timeout will be need here + // since there is no notification, a timeout will be need here window.setTimeout(() => { mediatorService.getMediatorServerConfigByName(url, name).then(config => { if (config) { @@ -112,11 +112,11 @@ export const updateMediatorConfigAsyncActionCreator = (config: MediatorConfig) = export const removeMediatorConfigAsyncActionCreator = (config: MediatorConfig) => (dispatch: Dispatch, getState: () => IApplicationStoreState) => { const { Name: name } = config; - const { mediatorApp: { mediatorServerState: { url } } } = getState(); + const { mediator: { mediatorServerState: { url } } } = getState(); if (url) { mediatorService.deleteMediatorConfigByName(url, name).then(msg => { dispatch(new AddSnackbarNotification({ message: msg + ' ' + name, options: { variant: 'info' } })); - // since there is no notification, a timeout will be need here + // since there is no notification, a timeout will be need here window.setTimeout(() => { mediatorService.getMediatorServerConfigByName(url, config.Name).then(config => { if (!config) { diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/actions/mediatorServerActions.ts b/sdnr/wt/odlux/apps/mediatorApp/src/actions/mediatorServerActions.ts index b8e8c7e94..e7719aac5 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/actions/mediatorServerActions.ts +++ b/sdnr/wt/odlux/apps/mediatorApp/src/actions/mediatorServerActions.ts @@ -62,11 +62,11 @@ export const initializeMediatorServerAsyncActionCreator = (serverId: string) => if (!mediatorServer) { dispatch(new SetMediatorServerBusy(false)); dispatch(new AddSnackbarNotification({ message: `Error loading mediator server [${serverId}]`, options: { variant: 'error' } })); - dispatch(new NavigateToApplication("mediatorApp")); - return; + dispatch(new NavigateToApplication("mediator")); + return; } dispatch(new SetMediatorServerInfo(mediatorServer.name, mediatorServer.url)); - + mediatorService.getMediatorServerVersion(mediatorServer.url).then(versionInfo => { dispatch(new SetMediatorServerVersion(versionInfo)); }); diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/components/editMediatorConfigDialog.tsx b/sdnr/wt/odlux/apps/mediatorApp/src/components/editMediatorConfigDialog.tsx index c1167c4a7..ef12ee253 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/components/editMediatorConfigDialog.tsx +++ b/sdnr/wt/odlux/apps/mediatorApp/src/components/editMediatorConfigDialog.tsx @@ -78,7 +78,7 @@ export enum EditMediatorConfigDialogMode { } const mapProps = (state: IApplicationStoreState) => ({ - supportedDevices: state.mediatorApp.mediatorServerState.supportedDevices + supportedDevices: state.mediator.mediatorServerState.supportedDevices }); const mapDispatch = (dispatcher: IDispatcher) => ({ @@ -182,7 +182,7 @@ class EditMediatorConfigDialogComponent extends React.Component - { this.state.activeTab === 0 ? + {this.state.activeTab === 0 ? { this.setState({ Name: event.target.value }); }} /> Device @@ -204,15 +204,15 @@ class EditMediatorConfigDialogComponent extends React.Component ({`${device.vendor} - ${device.device} (${device.version || '0.0.0'}) `}))} - { this.setState({ DeviceIp: event.target.value }); }} /> - { this.setState({ DevicePort: +event.target.value }); }} /> + { this.setState({ DeviceIp: event.target.value }); }} /> + { this.setState({ DevicePort: +event.target.value }); }} /> { this.setState({ TrapPort: +event.target.value }); }} /> { this.setState({ NcUsername: event.target.value }); }} /> { this.setState({ NcPassword: event.target.value }); }} /> { this.setState({ NcPort: +event.target.value }); }} /> : null} - { this.state.activeTab === 1 ? - { this.state.ODLConfig && this.state.ODLConfig.length > 0 + {this.state.activeTab === 1 ? + {this.state.ODLConfig && this.state.ODLConfig.length > 0 ? this.state.ODLConfig.map((cfg, ind) => { const panelId = `panel-${ind}`; const deleteButton = ( { @@ -227,15 +227,15 @@ class EditMediatorConfigDialogComponent extends React.Component this.setState({ activeOdlConfig: (this.state.activeOdlConfig === id) ? "" : (id || "") })} >
- + Protocoll - (e.target.value))} inputProps={{ name: `protocol-${ind}`, id: `protocol-${ind}` }} fullWidth > http https e.target.value)} /> - +e.target.value)} /> + +e.target.value)} />
e.target.value)} /> @@ -310,6 +310,4 @@ class EditMediatorConfigDialogComponent extends React.Component & { +type EditMediatorServerDialogComponentProps = Connect & { mode: EditMediatorServerDialogMode; mediatorServer: MediatorServer; onClose: () => void; }; -type EditMediatorServerDialogComponentState = MediatorServer ; +type EditMediatorServerDialogComponentState = MediatorServer; class EditMediatorServerDialogComponent extends React.Component { - constructor(props: EditMediatorServerDialogComponentProps) { + constructor (props: EditMediatorServerDialogComponentProps) { super(props); - + this.state = { ...this.props.mediatorServer }; @@ -91,18 +91,18 @@ class EditMediatorServerDialogComponent extends React.Component - { setting.dialogTitle } + + {setting.dialogTitle} - { setting.dialogDescription } + {setting.dialogDescription} - { this.setState({_id: event.target.value}); } } /> - { this.setState({name: event.target.value}); } }/> - { this.setState({url: event.target.value}); } }/> - + {/* { this.setState({_id: event.target.value}); } } /> */} + { this.setState({ name: event.target.value }); }} /> + { this.setState({ url: event.target.value }); }} /> + - - + + }} color="secondary"> {setting.cancelButtonText} ) diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/handlers/avaliableMediatorServersHandler.ts b/sdnr/wt/odlux/apps/mediatorApp/src/handlers/avaliableMediatorServersHandler.ts index 447e5e5bd..244a9d185 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/handlers/avaliableMediatorServersHandler.ts +++ b/sdnr/wt/odlux/apps/mediatorApp/src/handlers/avaliableMediatorServersHandler.ts @@ -15,5 +15,5 @@ export const { createProperties: createAvaliableMediatorServersProperties, reloadAction: avaliableMediatorServersReloadAction, - // set value action, to change a value -} = createExternal(avaliableMediatorServersSearchHandler, appState => appState.mediatorApp.avaliableMediatorServers); \ No newline at end of file + // set value action, to change a value +} = createExternal(avaliableMediatorServersSearchHandler, appState => appState.mediator.avaliableMediatorServers); \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/handlers/mediatorAppRootHandler.ts b/sdnr/wt/odlux/apps/mediatorApp/src/handlers/mediatorAppRootHandler.ts index bfebbdf5d..b64c0a72a 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/handlers/mediatorAppRootHandler.ts +++ b/sdnr/wt/odlux/apps/mediatorApp/src/handlers/mediatorAppRootHandler.ts @@ -13,7 +13,7 @@ export interface IMediatorAppStoreState { declare module '../../../../framework/src/store/applicationStore' { interface IApplicationStoreState { - mediatorApp: IMediatorAppStoreState + mediator: IMediatorAppStoreState } } diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/plugin.tsx b/sdnr/wt/odlux/apps/mediatorApp/src/plugin.tsx index 0878fee65..7f440a2ae 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/plugin.tsx +++ b/sdnr/wt/odlux/apps/mediatorApp/src/plugin.tsx @@ -16,7 +16,7 @@ import { MediatorApplication } from "./views/mediatorApplication"; import { MediatorServerSelection } from "./views/mediatorServerSelection"; import { initializeMediatorServerAsyncActionCreator } from "./actions/mediatorServerActions"; -let currentMediatorServerId: string | undefined = undefined; +let currentMediatorServerId: string | undefined = undefined; const mapDisp = (dispatcher: IDispatcher) => ({ loadMediatorServer : (mediatorServerId: string) => dispatcher.dispatch(initializeMediatorServerAsyncActionCreator(mediatorServerId)), @@ -24,7 +24,7 @@ const mapDisp = (dispatcher: IDispatcher) => ({ const MediatorServerRouteAdapter = connect(undefined, mapDisp)((props: RouteComponentProps<{ mediatorServerId: string }> & Connect) => { if (currentMediatorServerId !== props.match.params.mediatorServerId) { - // route parameter has changed + // route parameter has changed currentMediatorServerId = props.match.params.mediatorServerId || undefined; // Hint: This timeout is need, since it is not recommended to change the state while rendering is in progress ! window.setTimeout(() => { @@ -42,21 +42,21 @@ type AppProps = RouteComponentProps & Connect; const App = (props: AppProps) => ( - - + + -); +); const FinalApp = withRouter(connect()(App)); export function register() { const applicationApi = applicationManager.registerApplication({ - name: "mediatorApp", + name: "mediator", icon: faGlobe, rootComponent: FinalApp, rootActionHandler: mediatorAppRootHandler, - menuEntry: "Mediator App" + menuEntry: "Mediator" }); // prefetch all avaliable mediator servers diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorApplication.tsx b/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorApplication.tsx index 6b1532cc8..95dee8df7 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorApplication.tsx +++ b/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorApplication.tsx @@ -50,13 +50,13 @@ const styles = (theme: Theme) => createStyles({ }); const mapProps = (state: IApplicationStoreState) => ({ - serverName: state.mediatorApp.mediatorServerState.name, - serverUrl: state.mediatorApp.mediatorServerState.url, - serverVersion: state.mediatorApp.mediatorServerState.serverVersion, - mediatorVersion: state.mediatorApp.mediatorServerState.mediatorVersion, - configurations: state.mediatorApp.mediatorServerState.configurations, - supportedDevices: state.mediatorApp.mediatorServerState.supportedDevices, - busy: state.mediatorApp.mediatorServerState.busy, + serverName: state.mediator.mediatorServerState.name, + serverUrl: state.mediator.mediatorServerState.url, + serverVersion: state.mediator.mediatorServerState.serverVersion, + mediatorVersion: state.mediator.mediatorServerState.mediatorVersion, + configurations: state.mediator.mediatorServerState.configurations, + supportedDevices: state.mediator.mediatorServerState.supportedDevices, + busy: state.mediator.mediatorServerState.busy, }); const mapDispatch = (dispatcher: IDispatcher) => ({ diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorServerSelection.tsx b/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorServerSelection.tsx index 38bbdecb4..4e221b613 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorServerSelection.tsx +++ b/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorServerSelection.tsx @@ -37,7 +37,7 @@ const mapProps = (state: IApplicationStoreState) => ({ const mapDispatch = (dispatcher: IDispatcher) => ({ mediatorServersActions: createAvaliableMediatorServersActions(dispatcher.dispatch), - selectMediatorServer: (mediatorServerId: string) => mediatorServerId && dispatcher.dispatch(new NavigateToApplication("mediatorApp", mediatorServerId)), + selectMediatorServer: (mediatorServerId: string) => mediatorServerId && dispatcher.dispatch(new NavigateToApplication("mediator", mediatorServerId)), }); const emptyMediatorServer: MediatorServer = { @@ -77,7 +77,7 @@ class MediatorServerSelectionComponent extends React.Component - - @@ -103,7 +103,7 @@ class MediatorServerSelectionComponent extends React.Component, server: MediatorServer) => { event.preventDefault(); @@ -121,7 +121,7 @@ class MediatorServerSelectionComponent extends React.Component { this.setState({ diff --git a/sdnr/wt/odlux/apps/minimumApp/pom.xml b/sdnr/wt/odlux/apps/minimumApp/pom.xml index f8ee69737..9003ed74e 100644 --- a/sdnr/wt/odlux/apps/minimumApp/pom.xml +++ b/sdnr/wt/odlux/apps/minimumApp/pom.xml @@ -1,11 +1,13 @@ - + org.onap.ccsdk.parent odlparent 1.2.2-SNAPSHOT - + 4.0.0 org.onap.ccsdk.features.sdnr.wt @@ -125,7 +127,7 @@ org.onap.ccsdk.features.sdnr.wt.odlux.model.*,com.opensymphony.* - + diff --git a/sdnr/wt/odlux/apps/minimumApp/src/handlers/minimumAppRootHandler.ts b/sdnr/wt/odlux/apps/minimumApp/src/handlers/minimumAppRootHandler.ts index d1d030488..ae7d7c0bd 100644 --- a/sdnr/wt/odlux/apps/minimumApp/src/handlers/minimumAppRootHandler.ts +++ b/sdnr/wt/odlux/apps/minimumApp/src/handlers/minimumAppRootHandler.ts @@ -9,7 +9,7 @@ export interface IMinimumAppStoreState { declare module '../../../../framework/src/store/applicationStore' { interface IApplicationStoreState { - minimumApp: IMinimumAppStoreState + minimum: IMinimumAppStoreState } } diff --git a/sdnr/wt/odlux/apps/minimumApp/src/plugin.tsx b/sdnr/wt/odlux/apps/minimumApp/src/plugin.tsx index dc698e11b..5209abac1 100644 --- a/sdnr/wt/odlux/apps/minimumApp/src/plugin.tsx +++ b/sdnr/wt/odlux/apps/minimumApp/src/plugin.tsx @@ -20,11 +20,11 @@ const FinalApp = withRouter(connect()(App)); export function register() { applicationManager.registerApplication({ - name: "minimumApp", + name: "minimum", icon: faLock, rootComponent: FinalApp, rootActionHandler: minimumAppRootHandler, - menuEntry: "Minimum App" + menuEntry: "Minimum" }); } diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/.babelrc b/sdnr/wt/odlux/apps/performanceHistoryApp/.babelrc new file mode 100644 index 000000000..3d8cd1260 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/.babelrc @@ -0,0 +1,17 @@ +{ + "presets": [ + ["@babel/preset-react"], + ["@babel/preset-env", { + "targets": { + "chrome": "66" + }, + "spec": true, + "loose": false, + "modules": false, + "debug": false, + "useBuiltIns": "usage", + "forceAllTransforms": true + }] + ], + "plugins": [] +} diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/package.json b/sdnr/wt/odlux/apps/performanceHistoryApp/package.json new file mode 100644 index 000000000..b066010b9 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/package.json @@ -0,0 +1,40 @@ +{ + "name": "@odlux/performancehistory-app", + "version": "0.1.1", + "description": "A react based modular UI to display performance history data from a database.", + "main": "index.js", + "scripts": { + "start": "webpack-dev-server --env debug", + "build": "webpack --env release --config webpack.config.js", + "build:dev": "webpack --env debug --config webpack.config.js" + }, + "repository": { + "type": "git", + "url": "https://git.mfico.de/highstreet-technologies/odlux.git" + }, + "keywords": [ + "reactjs", + "redux", + "ui", + "framework" + ], + "author": "Sai Neetha Phulmali", + "license": "MIT", + "dependencies": { + "@odlux/framework" : "*" + }, + "peerDependencies": { + "@types/react": "16.4.14", + "@types/react-dom": "16.0.8", + "@types/react-router-dom": "4.3.1", + "@material-ui/core": "3.8.3", + "@material-ui/icons": "3.0.2", + "@types/classnames": "2.2.6", + "@types/flux": "3.1.8", + "@types/jquery": "3.3.10", + "jquery": "3.3.1", + "react": "16.5.2", + "react-dom": "16.5.2", + "react-router-dom": "4.3.1" + } +} \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/pom.xml b/sdnr/wt/odlux/apps/performanceHistoryApp/pom.xml new file mode 100644 index 000000000..d24bfddf0 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/pom.xml @@ -0,0 +1,158 @@ + + + + + org.onap.ccsdk.parent + odlparent + 1.2.2-SNAPSHOT + + + 4.0.0 + org.onap.ccsdk.features.sdnr.wt + sdnr-wt-odlux-app-performanceHistoryApp + 0.4.2-SNAPSHOT + bundle + sdnr-wt-odlux-app-performanceHistoryApp + + + Apache License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + + + + + ${project.groupId} + sdnr-wt-odlux-core-model + ${project.version} + + + ${project.groupId} + sdnr-wt-odlux-core-provider + ${project.version} + test + + + junit + junit + test + + + + src2/main/java + + + maven-clean-plugin + + + + dist + false + + + node + false + + + node_modules + false + + + ../node_modules + false + + + + bin + false + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + add-test-source + generate-test-sources + + add-test-source + + + + src2/test/java + + + + + + + de.jacksitlab + frontend-maven-plugin + 1.7.1 + + + install node and yarn + + install-node-and-yarn + + + initialize + + v8.10.0 + v1.12.3 + + + + yarn build + + yarn + + + run build + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + org.apache.felix + maven-bundle-plugin + true + + + org.onap.ccsdk.features.sdnr.wt.odlux.model.*,com.opensymphony.* + + + + + + + + dist + odlux + + + src2/main/resources + + + src2/test/resources + + + + + + highstreet repo + https://cloud-highstreet-technologies.com/mvn/ + + true + always + + + + diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/actions/connectedNetworkElementsActions.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/actions/connectedNetworkElementsActions.ts new file mode 100644 index 000000000..0906584b7 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/actions/connectedNetworkElementsActions.ts @@ -0,0 +1,41 @@ +import { Action } from '../../../../framework/src/flux/action'; +import { Dispatch } from '../../../../framework/src/flux/store'; + +import { ConnectedNetworkElements } from '../models/connectedNetworkElements'; +import { PerformanceHistoryService } from '../services/performanceHistoryService'; + +/** + * Represents the base action. + */ +export class BaseAction extends Action { } + +/** + * Represents an action causing the store to load all connected network elements. + */ +export class LoadAllConnectedNetworkElementsAction extends BaseAction { } + +/** + * Represents an action causing the store to update all connected network elements. + */ +export class AllConnectedNetworkElementsLoadedAction extends BaseAction { + /** + * Initialize this instance. + * + * @param connectedNetworkElements The network elements which are returned from the restconf. + */ + constructor(public connectedNetworkElements: ConnectedNetworkElements[] | null, public error?: string) { + super(); + } +} + +/** + * Represents an asynchronous thunk action to load all connected network elements from the restconf. + */ +export const loadAllConnectedNetworkElementsAsync = (dispatch: Dispatch) => { + dispatch(new LoadAllConnectedNetworkElementsAction()); + PerformanceHistoryService.getConnectedNetworkElementsList().then(networkElements => { + networkElements && dispatch(new AllConnectedNetworkElementsLoadedAction(networkElements)); + }).catch(error => { + dispatch(new AllConnectedNetworkElementsLoadedAction(null, error)); + }); +}; \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/actions/ltpAction.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/actions/ltpAction.ts new file mode 100644 index 000000000..d8842ffbe --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/actions/ltpAction.ts @@ -0,0 +1,75 @@ +import { Action } from '../../../../framework/src/flux/action'; +import { Dispatch } from '../../../../framework/src/flux/store'; + +import { Ltp } from '../models/availableLtps'; +import { PerformanceHistoryService } from '../services/performanceHistoryService'; + +/** + * Represents the base action. + */ +export class BaseAction extends Action { } + +/** + * Represents an action causing the store to load available ltps. + */ +export class LoadAllAvailableLtpsAction extends BaseAction { } + +/** + * Represents an action causing the store to update available ltps. + */ +export class AllAvailableLtpsLoadedAction extends BaseAction { + /** + * Initialize this instance. + * @param availableLtps The available ltps which are returned from the database. + */ + constructor(public availableLtps: Ltp[] | null, public error?: string) { + super(); + } +} + + +/** + * Represents an asynchronous thunk action to load available distinctLtps by networkElement from the database and set the returned first Ltp as default. + * @param networkElement The network element sent to database to get its available distinct Ltps. + * @param selectedTimePeriod The time period selected sent to database to get the distinct Ltps of the selected network element. + * @param selectedLtp The Ltp which is selected in the dropdown. + * @param selectFirstLtp The function to get the first ltp returned from the database to be selected as default on selection upon network element. + * @param resetLtp The function to verify if the selected ltp is also available in the selected time period database else reset the Ltp dropdown to select. + */ +export const loadDistinctLtpsbyNetworkElementAsync = (networkElement: string, selectedTimePeriod: string, selectedLtp: string, selectFirstLtp?: Function, resetLtp?: Function) => (dispatch: Dispatch) => { + if (selectedTimePeriod == "15min") { + dispatch(new LoadAllAvailableLtpsAction()); + PerformanceHistoryService.getDistinctLtpsFrom15minDatabase(networkElement).then(distinctLtps => { + if(distinctLtps) { + let ltpNotSelected: boolean = true; + selectFirstLtp && selectFirstLtp(distinctLtps[0].key); + distinctLtps.forEach((value: Ltp) => { + if(value.key === selectedLtp) { + ltpNotSelected = false; + } + }); + resetLtp && resetLtp(ltpNotSelected); + dispatch(new AllAvailableLtpsLoadedAction(distinctLtps)) + } + }).catch(error => { + dispatch(new AllAvailableLtpsLoadedAction(null, error)); + }); + } else { + dispatch(new LoadAllAvailableLtpsAction()); + PerformanceHistoryService.getDistinctLtpsFrom24hoursDatabase(networkElement).then(distinctLtps => { + if(distinctLtps) { + let ltpNotSelected: boolean = true; + selectFirstLtp && selectFirstLtp(distinctLtps[0].key); + distinctLtps.forEach((value: Ltp) => { + if(value.key === selectedLtp) { + ltpNotSelected = false; + } + }); + resetLtp && resetLtp(ltpNotSelected); + dispatch(new AllAvailableLtpsLoadedAction(distinctLtps)) + } + }).catch(error => { + dispatch(new AllAvailableLtpsLoadedAction(null, error)); + }); + } +}; \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/actions/panelChangeActions.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/actions/panelChangeActions.ts new file mode 100644 index 000000000..82072c7fe --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/actions/panelChangeActions.ts @@ -0,0 +1,15 @@ +import { Action } from '../../../../framework/src/flux/action'; +import { PanelId } from '../models/panelId'; + +/** + * Represents an action causing the store to update the panel. + */ +export class SetPanelAction extends Action { + /** + * Initialize this instance. + * @param panelId Action to set the current panel by its Id. + */ + constructor(public panelId: PanelId) { + super(); + } +} diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/adaptiveModulation.tsx b/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/adaptiveModulation.tsx new file mode 100644 index 000000000..024315c3a --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/adaptiveModulation.tsx @@ -0,0 +1,140 @@ +import * as React from 'react'; + +import { withRouter, RouteComponentProps } from 'react-router-dom'; + +import { MaterialTable, ColumnType, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; +import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; +import connect, { Connect, IDispatcher } from '../../../../framework/src/flux/connect'; + +import { AdaptiveModulationDataType } from '../models/adaptiveModulationDataType'; +import { createAdaptiveModulation15minProperties, createAdaptiveModulation15minActions, adaptiveModulation15minReloadAction } from '../handlers/adaptiveModulation15minHandler'; +import { createAdaptiveModulation24hoursProperties, createAdaptiveModulation24hoursActions, adaptiveModulation24hoursReloadAction } from '../handlers/adaptiveModulation24hoursHandler'; + + +const mapProps = (state: IApplicationStoreState) => ({ + adaptiveModulation15minProperties: createAdaptiveModulation15minProperties(state), + adaptiveModulation24hoursProperties: createAdaptiveModulation24hoursProperties(state), +}); + +const mapDisp = (dispatcher: IDispatcher) => ({ + adaptiveModulation15minActions: createAdaptiveModulation15minActions(dispatcher.dispatch), + adaptiveModulation24hoursActions: createAdaptiveModulation24hoursActions(dispatcher.dispatch), +}); + +type AdaptiveModulationComponentProps = RouteComponentProps & Connect & { + selectedTimePeriod: string +}; + +const AdaptiveModulationTable = MaterialTable as MaterialTableCtorType; + +/** + * The Component which gets the adaptiveModulation data from the database based on the selected time period. + */ +class AdaptiveModulationComponent extends React.Component{ + render(): JSX.Element { + if (this.props.selectedTimePeriod == "15min") { + return ( + { + const suspectIntervalFlag = rowData["suspect-interval-flag"].toString(); + return
{suspectIntervalFlag}
+ } + }, + { property: "time2-states-s", title: "QAM2S", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time2-states", title: "QAM2", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time2-states-l", title: "QAM2L", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time4-states-s", title: "QAM4S", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time4-states", title: "QAM4", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time4-states-l", title: "QAM4L", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time16-states-s", title: "QAM16S", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time16-states", title: "QAM16", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time16-states-l", title: "QAM16L", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time32-states-s", title: "QAM32S", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time32-states", title: "QAM32", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time32-states-l", title: "QAM32L", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time64-states-s", title: "QAM64S", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time64-states", title: "QAM64", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time64-states-l", title: "QAM64L", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time128-states-s", title: "QAM128S", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time128-states", title: "QAM128", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time128-states-l", title: "QAM128L", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time256-states-s", title: "QAM256S", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time256-states", title: "QAM256", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time256-states-l", title: "QAM256L", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time512-states-s", title: "QAM512S", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time512-states", title: "QAM512", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time512-states-l", title: "QAM512L", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time1024-states-s", title: "QAM1024S", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time1024-states", title: "QAM1024", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time1024-states-l", title: "QAM1024L", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time2048-states-s", title: "QAM2048S", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time2048-states", title: "QAM2048", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time2048-states-l", title: "QAM2048L", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time4096-states-s", title: "QAM4096S", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time4096-states", title: "QAM4096", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time4096-states-l", title: "QAM4096L", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time8192-states-s", title: "QAM8192S", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time8192-states", title: "QAM8192", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time8192-states-l", title: "QAM8192L", type: ColumnType.text, disableFilter: true, disableSorting: true }, + ]} {...this.props.adaptiveModulation15minProperties} {...this.props.adaptiveModulation15minActions} /> + ); + } else { + return ( + { + const suspectIntervalFlag = rowData["suspect-interval-flag"].toString(); + return
{suspectIntervalFlag}
+ } + }, + { property: "time2-states-s", title: "QAM2S", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time2-states", title: "QAM2", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time2-states-l", title: "QAM2L", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time4-states-s", title: "QAM4S", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time4-states", title: "QAM4", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time4-states-l", title: "QAM4L", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time16-states-s", title: "QAM16S", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time16-states", title: "QAM16", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time16-states-l", title: "QAM16L", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time32-states-s", title: "QAM32S", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time32-states", title: "QAM32", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time32-states-l", title: "QAM32L", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time64-states-s", title: "QAM64S", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time64-states", title: "QAM64", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time64-states-l", title: "QAM64L", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time128-states-s", title: "QAM128S", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time128-states", title: "QAM128", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time128-states-l", title: "QAM128L", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time256-states-s", title: "QAM256S", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time256-states", title: "QAM256", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time256-states-l", title: "QAM256L", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time512-states-s", title: "QAM512S", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time512-states", title: "QAM512", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time512-states-l", title: "QAM512L", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time1024-states-s", title: "QAM1024S", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time1024-states", title: "QAM1024", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time1024-states-l", title: "QAM1024L", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time2048-states-s", title: "QAM2048S", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time2048-states", title: "QAM2048", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time2048-states-l", title: "QAM2048L", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time4096-states-s", title: "QAM4096S", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time4096-states", title: "QAM4096", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time4096-states-l", title: "QAM4096L", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time8192-states-s", title: "QAM8192S", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time8192-states", title: "QAM8192", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "time8192-states-l", title: "QAM8192L", type: ColumnType.text, disableFilter: true, disableSorting: true }, + ]} {...this.props.adaptiveModulation24hoursProperties} {...this.props.adaptiveModulation24hoursActions} /> + ); + } + }; +} + +export const AdaptiveModulation = withRouter(connect(mapProps, mapDisp)(AdaptiveModulationComponent)); +export default AdaptiveModulation; diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/crossPolarDiscrimination.tsx b/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/crossPolarDiscrimination.tsx new file mode 100644 index 000000000..bbed8abfe --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/crossPolarDiscrimination.tsx @@ -0,0 +1,74 @@ +import * as React from 'react'; + +import { withRouter, RouteComponentProps } from 'react-router-dom'; + +import { MaterialTable, ColumnType, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; +import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; +import connect, { Connect, IDispatcher } from '../../../../framework/src/flux/connect'; + +import { CrossPolarDiscriminationDataType } from '../models/crossPolarDiscriminationDataType'; +import { createCrossPolarDiscrimination15minProperties, createCrossPolarDiscrimination15minActions, crossPolarDiscrimination15minReloadAction } from '../handlers/crossPolarDiscrimination15minHandler'; +import { createCrossPolarDiscrimination24hoursProperties, createCrossPolarDiscrimination24hoursActions, crossPolarDiscrimination24hoursReloadAction } from '../handlers/crossPolarDiscrimination24hoursHandler'; + + +const mapProps = (state: IApplicationStoreState) => ({ + crossPolarDiscrimination15minProperties: createCrossPolarDiscrimination15minProperties(state), + crossPolarDiscrimination24hoursProperties: createCrossPolarDiscrimination24hoursProperties(state), +}); + +const mapDisp = (dispatcher: IDispatcher) => ({ + crossPolarDiscrimination15minActions: createCrossPolarDiscrimination15minActions(dispatcher.dispatch), + crossPolarDiscrimination24hoursActions: createCrossPolarDiscrimination24hoursActions(dispatcher.dispatch), +}); + +type CrossPolarDiscriminationComponentProps = RouteComponentProps & Connect & { + selectedTimePeriod: string +}; + +const CrossPolarDiscriminationTable = MaterialTable as MaterialTableCtorType; + +/** + * The Component which gets the crossPolarDiscrimination data from the database based on the selected time period. + */ +class CrossPolarDiscriminationComponent extends React.Component{ + render(): JSX.Element { + if (this.props.selectedTimePeriod == "15min") { + return ( + { + const suspectIntervalFlag = rowData["suspect-interval-flag"].toString(); + return
{suspectIntervalFlag}
+ } + }, + { property: "xpd-min", title: "CPD (min)[db]", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "xpd-avg", title: "CPD (avg)[db]", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "xpd-max", title: "CPD (max)[db]", type: ColumnType.text, disableFilter: true, disableSorting: true }, + ]} {...this.props.crossPolarDiscrimination15minProperties} {...this.props.crossPolarDiscrimination15minActions} /> + ); + } else { + return ( + { + const suspectIntervalFlag = rowData["suspect-interval-flag"].toString(); + return
{suspectIntervalFlag}
+ } + }, + { property: "xpd-min", title: "CPD (min)[db]", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "xpd-avg", title: "CPD (avg)[db]", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "xpd-max", title: "CPD (max)[db]", type: ColumnType.text, disableFilter: true, disableSorting: true }, + ]} {...this.props.crossPolarDiscrimination24hoursProperties} {...this.props.crossPolarDiscrimination24hoursActions} /> + ); + } + }; +} + +export const CrossPolarDiscrimination = withRouter(connect(mapProps, mapDisp)(CrossPolarDiscriminationComponent)); +export default CrossPolarDiscrimination; diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/performanceData.tsx b/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/performanceData.tsx new file mode 100644 index 000000000..e9a373b11 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/performanceData.tsx @@ -0,0 +1,75 @@ +import * as React from 'react'; + +import { withRouter, RouteComponentProps } from 'react-router-dom'; + +import { MaterialTable, ColumnType, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; +import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; +import connect, { Connect, IDispatcher } from '../../../../framework/src/flux/connect'; + +import { PerformanceDataType } from '../models/performanceDataType'; +import { createPerformanceData15minProperties, createPerformanceData15minActions } from '../handlers/performanceData15minHandler'; +import { createPerformanceData24hoursProperties, createPerformanceData24hoursActions } from '../handlers/performanceData24hoursHandler'; + +const mapProps = (state: IApplicationStoreState) => ({ + performanceData15minProperties: createPerformanceData15minProperties(state), + performanceData24hoursProperties: createPerformanceData24hoursProperties(state), +}); + +const mapDisp = (dispatcher: IDispatcher) => ({ + performanceData15minActions: createPerformanceData15minActions(dispatcher.dispatch), + performanceData24hoursActions: createPerformanceData24hoursActions(dispatcher.dispatch), +}); + +type PerformanceDataComponentProps = RouteComponentProps & Connect & { + selectedTimePeriod: string +}; + +const PerformanceDataTable = MaterialTable as MaterialTableCtorType; + +/** + * The Component which gets the performance data from the database based on the selected time period. + */ +class PerformanceDataComponent extends React.Component{ + render(): JSX.Element { + if (this.props.selectedTimePeriod == "15min") { + return ( + { + const suspectIntervalFlag = rowData["suspect-interval-flag"].toString(); + return
{suspectIntervalFlag}
+ } + }, + { property: "es", title: "ES", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "ses", title: "SES", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "unavailability", title: "UAS", type: ColumnType.text, disableFilter: true, disableSorting: true }, + ]} {...this.props.performanceData15minProperties} {...this.props.performanceData15minActions} + /> + ); + } else { + return ( + { + const suspectIntervalFlag = rowData["suspect-interval-flag"].toString(); + return
{suspectIntervalFlag}
+ } + }, + { property: "es", title: "ES", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "ses", title: "SES", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "unavailability", title: "UAS", type: ColumnType.text, disableFilter: true, disableSorting: true }, + ]} {...this.props.performanceData24hoursProperties} {...this.props.performanceData24hoursActions} + /> + ); + } + }; +} + +export const PerformanceData = withRouter(connect(mapProps, mapDisp)(PerformanceDataComponent)); +export default PerformanceData; diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/receiveLevel.tsx b/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/receiveLevel.tsx new file mode 100644 index 000000000..5f62e585a --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/receiveLevel.tsx @@ -0,0 +1,74 @@ +import * as React from 'react'; + +import { withRouter, RouteComponentProps } from 'react-router-dom'; + +import { MaterialTable, ColumnType, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; +import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; +import connect, { Connect, IDispatcher } from '../../../../framework/src/flux/connect'; + +import { ReceiveLevelDataType } from '../models/receiveLevelDataType'; +import { createReceiveLevel15minProperties, createReceiveLevel15minActions, receiveLevel15minReloadAction } from '../handlers/receiveLevel15minHandler'; +import { createReceiveLevel24hoursProperties, createReceiveLevel24hoursActions, receiveLevel24hoursReloadAction } from '../handlers/receiveLevel24hoursHandler'; + + +const mapProps = (state: IApplicationStoreState) => ({ + receiveLevel15minProperties: createReceiveLevel15minProperties(state), + receiveLevel24hoursProperties: createReceiveLevel24hoursProperties(state), +}); + +const mapDisp = (dispatcher: IDispatcher) => ({ + receiveLevel15minActions: createReceiveLevel15minActions(dispatcher.dispatch), + receiveLevel24hoursActions: createReceiveLevel24hoursActions(dispatcher.dispatch), +}); + +type ReceiveLevelComponentProps = RouteComponentProps & Connect & { + selectedTimePeriod: string +}; + +const ReceiveLevelTable = MaterialTable as MaterialTableCtorType; + +/** + * The Component which gets the receiveLevel data from the database based on the selected time period. + */ +class ReceiveLevelComponent extends React.Component{ + render(): JSX.Element { + if (this.props.selectedTimePeriod == "15min") { + return ( + { + const suspectIntervalFlag = rowData["suspect-interval-flag"].toString(); + return
{suspectIntervalFlag}
+ } + }, + { property: "rx-level-min", title: "Rx min", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "rx-level-avg", title: "Rx avg", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "rx-level-max", title: "Rx max", type: ColumnType.text, disableFilter: true, disableSorting: true }, + ]} {...this.props.receiveLevel15minProperties} {...this.props.receiveLevel15minActions} /> + ); + } else { + return ( + { + const suspectIntervalFlag = rowData["suspect-interval-flag"].toString(); + return
{suspectIntervalFlag}
+ } + }, + { property: "rx-level-min", title: "Rx min", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "rx-level-avg", title: "Rx avg", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "rx-level-max", title: "Rx max", type: ColumnType.text, disableFilter: true, disableSorting: true }, + ]} {...this.props.receiveLevel24hoursProperties} {...this.props.receiveLevel24hoursActions} /> + ); + } + }; +} + +export const ReceiveLevel = withRouter(connect(mapProps, mapDisp)(ReceiveLevelComponent)); +export default ReceiveLevel; diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/signalToInterference.tsx b/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/signalToInterference.tsx new file mode 100644 index 000000000..bd612822e --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/signalToInterference.tsx @@ -0,0 +1,75 @@ +import * as React from 'react'; + +import { withRouter, RouteComponentProps } from 'react-router-dom'; + +import { MaterialTable, ColumnType, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; +import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; +import connect, { Connect, IDispatcher } from '../../../../framework/src/flux/connect'; + +import { SignalToInterferenceDataType } from '../models/signalToInteferenceDataType'; +import { createSignalToInterference15minProperties, createSignalToInterference15minActions } from '../handlers/signalToInterference15minHandler'; +import { createSignalToInterference24hoursProperties, createSignalToInterference24hoursActions } from '../handlers/signalToInterference24hoursHandler'; + +const mapProps = (state: IApplicationStoreState) => ({ + signalToInterference15minProperties: createSignalToInterference15minProperties(state), + signalToInterference24hoursProperties: createSignalToInterference24hoursProperties(state), +}); + +const mapDisp = (dispatcher: IDispatcher) => ({ + signalToInterference15minActions: createSignalToInterference15minActions(dispatcher.dispatch), + signalToInterference24hoursActions: createSignalToInterference24hoursActions(dispatcher.dispatch), +}); + +type SignalToInterferenceComponentProps = RouteComponentProps & Connect & { + selectedTimePeriod: string +}; + +const SignalToInterferenceTable = MaterialTable as MaterialTableCtorType; + +/** + * The Component which gets the signal to interference data from the database based on the selected time period. + */ +class SignalToInterferenceComponent extends React.Component{ + render(): JSX.Element { + if (this.props.selectedTimePeriod == "15min") { + return ( + { + const suspectIntervalFlag = rowData["suspect-interval-flag"].toString(); + return
{suspectIntervalFlag}
+ } + }, + { property: "snir-min", title: "SINR (min)[db]", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "snir-avg", title: "SINR (avg)[db]", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "snir-max", title: "SINR (max)[db]", type: ColumnType.text, disableFilter: true, disableSorting: true }, + ]} {...this.props.signalToInterference15minProperties} {...this.props.signalToInterference15minActions} + /> + ); + } else { + return ( + { + const suspectIntervalFlag = rowData["suspect-interval-flag"].toString(); + return
{suspectIntervalFlag}
+ } + }, + { property: "snir-min", title: "SINR (min)[db]", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "snir-avg", title: "SINR (avg)[db]", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "snir-max", title: "SINR (max)[db]", type: ColumnType.text, disableFilter: true, disableSorting: true }, + ]} {...this.props.signalToInterference24hoursProperties} {...this.props.signalToInterference24hoursActions} + /> + ); + } + }; +} + +export const SignalToInterference = withRouter(connect(mapProps, mapDisp)(SignalToInterferenceComponent)); +export default SignalToInterference; diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/temperature.tsx b/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/temperature.tsx new file mode 100644 index 000000000..1496396aa --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/temperature.tsx @@ -0,0 +1,74 @@ +import * as React from 'react'; + +import { withRouter, RouteComponentProps } from 'react-router-dom'; + +import { MaterialTable, ColumnType, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; +import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; +import connect, { Connect, IDispatcher } from '../../../../framework/src/flux/connect'; + +import { TemperatureDataType } from '../models/temperatureDataType'; +import { createTemperature15minProperties, createTemperature15minActions, temperature15minReloadAction } from '../handlers/temperature15minHandler'; +import { createTemperature24hoursProperties, createTemperature24hoursActions, temperature24hoursReloadAction } from '../handlers/temperature24hoursHandler'; + + +const mapProps = (state: IApplicationStoreState) => ({ + temperature15minProperties: createTemperature15minProperties(state), + temperature24hoursProperties: createTemperature24hoursProperties(state), +}); + +const mapDisp = (dispatcher: IDispatcher) => ({ + temperature15minActions: createTemperature15minActions(dispatcher.dispatch), + temperature24hoursActions: createTemperature24hoursActions(dispatcher.dispatch), +}); + +type TemperatureComponentProps = RouteComponentProps & Connect & { + selectedTimePeriod: string +}; + +const TemperatureTable = MaterialTable as MaterialTableCtorType; + +/** + * The Component which gets the temperature data from the database based on the selected time period. + */ +class TemperatureComponent extends React.Component{ + render(): JSX.Element { + if (this.props.selectedTimePeriod == "15min") { + return ( + { + const suspectIntervalFlag = rowData["suspect-interval-flag"].toString(); + return
{suspectIntervalFlag}
+ } + }, + { property: "rf-temp-min", title: "Rx min", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "rf-temp-avg", title: "Rx avg", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "rf-temp-max", title: "Rx max", type: ColumnType.text, disableFilter: true, disableSorting: true }, + ]} {...this.props.temperature15minProperties} {...this.props.temperature15minActions} /> + ); + } else { + return ( + { + const suspectIntervalFlag = rowData["suspect-interval-flag"].toString(); + return
{suspectIntervalFlag}
+ } + }, + { property: "rf-temp-min", title: "Rx min", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "rf-temp-avg", title: "Rx avg", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "rf-temp-max", title: "Rx max", type: ColumnType.text, disableFilter: true, disableSorting: true }, + ]} {...this.props.temperature24hoursProperties} {...this.props.temperature24hoursActions} /> + ); + } + }; +} + +export const Temperature = withRouter(connect(mapProps, mapDisp)(TemperatureComponent)); +export default Temperature; diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/transmissionPower.tsx b/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/transmissionPower.tsx new file mode 100644 index 000000000..10c25874a --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/transmissionPower.tsx @@ -0,0 +1,74 @@ +import * as React from 'react'; + +import { withRouter, RouteComponentProps } from 'react-router-dom'; + +import { MaterialTable, ColumnType, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; +import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; +import connect, { Connect, IDispatcher } from '../../../../framework/src/flux/connect'; + +import { TransmissionPowerDataType } from '../models/transmissionPowerDataType'; +import { createTransmissionPower15minProperties, createTransmissionPower15minActions } from '../handlers/transmissionPower15minHandler'; +import { createTransmissionPower24hoursProperties, createTransmissionPower24hoursActions } from '../handlers/transmissionPower24hoursHandler'; + + +const mapProps = (state: IApplicationStoreState) => ({ + transmissionPower15minProperties: createTransmissionPower15minProperties(state), + transmissionPower24hoursProperties: createTransmissionPower24hoursProperties(state), +}); + +const mapDisp = (dispatcher: IDispatcher) => ({ + transmissionPower15minActions: createTransmissionPower15minActions(dispatcher.dispatch), + transmissionPower24hoursActions: createTransmissionPower24hoursActions(dispatcher.dispatch), +}); + +type TransmissionPowerComponentProps = RouteComponentProps & Connect & { + selectedTimePeriod: string +} + +const TransmissionPowerTable = MaterialTable as MaterialTableCtorType; + +/** + * The Component which gets the transmission power data from the database based on the selected time period. + */ +class TransmissionPowerComponent extends React.Component{ + render(): JSX.Element { + if (this.props.selectedTimePeriod == "15min") { + return ( + { + const suspectIntervalFlag = rowData["suspect-interval-flag"].toString(); + return
{suspectIntervalFlag}
+ } + }, + { property: "tx-level-min", title: "Tx min", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "tx-level-avg", title: "Tx avg", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "tx-level-max", title: "Tx max", type: ColumnType.text, disableFilter: true, disableSorting: true }, + ]} {...this.props.transmissionPower15minProperties} {...this.props.transmissionPower15minActions} /> + ); + } else { + return ( + { + const suspectIntervalFlag = rowData["suspect-interval-flag"].toString(); + return
{suspectIntervalFlag}
+ } + }, + { property: "tx-level-min", title: "Tx min", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "tx-level-avg", title: "Tx avg", type: ColumnType.text, disableFilter: true, disableSorting: true }, + { property: "tx-level-max", title: "Tx max", type: ColumnType.text, disableFilter: true, disableSorting: true }, + ]} {...this.props.transmissionPower24hoursProperties} {...this.props.transmissionPower24hoursActions} /> + ); + } + }; +} + +export const TransmissionPower = withRouter(connect(mapProps, mapDisp)(TransmissionPowerComponent)); +export default TransmissionPower; diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/adaptiveModulation15minHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/adaptiveModulation15minHandler.ts new file mode 100644 index 000000000..6072cf0fb --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/adaptiveModulation15minHandler.ts @@ -0,0 +1,29 @@ +import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; +import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; + + +import { AdaptiveModulationDataType, AdaptiveModulation, AdaptiveModulationResult } from '../models/adaptiveModulationDataType'; + +export interface IAdaptiveModulation15minState extends IExternalTableState { } + +/** + * Creates elastic search material data fetch handler for Adaptive modulation from historicalperformance15min database. + */ +const adaptiveModulationSearchHandler = createSearchDataHandler( + "sdnperformance/historicalperformance15min", + null, + (hit) => ({ + _id: hit._id, + ...hit._source, + ...hit._source["performance-data"] + }), + (name) => `${name}`); + +export const { + actionHandler: adaptiveModulation15minActionHandler, + createActions: createAdaptiveModulation15minActions, + createProperties: createAdaptiveModulation15minProperties, + createPreActions: createAdaptiveModulation15minPreActions, + reloadAction: adaptiveModulation15minReloadAction, +} = createExternal(adaptiveModulationSearchHandler, appState => appState.performanceHistory.adaptiveModulation15min); + diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/adaptiveModulation24hoursHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/adaptiveModulation24hoursHandler.ts new file mode 100644 index 000000000..466b22966 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/adaptiveModulation24hoursHandler.ts @@ -0,0 +1,29 @@ +import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; +import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; + + +import { AdaptiveModulationDataType, AdaptiveModulation, AdaptiveModulationResult } from '../models/adaptiveModulationDataType'; + +export interface IAdaptiveModulation24hoursState extends IExternalTableState { } + +/** + * Creates elastic search material data fetch handler for Adaptive modulation from historicalperformance24h database. + */ +const adaptiveModulationSearchHandler = createSearchDataHandler( + "sdnperformance/historicalperformance24h", + null, + (hit) => ({ + _id: hit._id, + ...hit._source, + ...hit._source["performance-data"] + }), + (name) => `${name}`); + +export const { + actionHandler: adaptiveModulation24hoursActionHandler, + createActions: createAdaptiveModulation24hoursActions, + createProperties: createAdaptiveModulation24hoursProperties, + createPreActions: createAdaptiveModulation24hoursPreActions, + reloadAction: adaptiveModulation24hoursReloadAction, +} = createExternal(adaptiveModulationSearchHandler, appState => appState.performanceHistory.adaptiveModulation24hours); + diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts new file mode 100644 index 000000000..2fd0ac8f1 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts @@ -0,0 +1,43 @@ +import { IActionHandler } from '../../../../framework/src/flux/action'; + +import { + AllAvailableLtpsLoadedAction, + LoadAllAvailableLtpsAction, +} from '../actions/ltpAction'; + +import { Ltp } from '../models/availableLtps'; + +export interface IAvailableLtpsState { + distinctLtps: Ltp[]; + busy: boolean; +} + +const connectedNetworkElementsStateInit: IAvailableLtpsState = { + distinctLtps: [], + busy: false +}; + +export const availableLtpsActionHandler: IActionHandler = (state = connectedNetworkElementsStateInit, action) => { + if (action instanceof LoadAllAvailableLtpsAction) { + + state = { + ...state, + busy: true + }; + + } else if (action instanceof AllAvailableLtpsLoadedAction) { + if (!action.error && action.availableLtps) { + state = { + ...state, + distinctLtps: action.availableLtps, + busy: false + }; + } else { + state = { + ...state, + busy: false + }; + } + } + return state; +}; \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/connectedNetworkElementsActionHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/connectedNetworkElementsActionHandler.ts new file mode 100644 index 000000000..039ae5357 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/connectedNetworkElementsActionHandler.ts @@ -0,0 +1,43 @@ +import { IActionHandler } from '../../../../framework/src/flux/action'; + +import { + AllConnectedNetworkElementsLoadedAction, + LoadAllConnectedNetworkElementsAction, +} from '../actions/connectedNetworkElementsActions'; + +import { ConnectedNetworkElements } from '../models/connectedNetworkElements'; + +export interface IConnectedNetworkElementsState { + connectedNetworkElements: ConnectedNetworkElements[]; + busy: boolean; +} + +const connectedNetworkElementsStateInit: IConnectedNetworkElementsState = { + connectedNetworkElements: [], + busy: false +}; + +export const connectedNetworkElementsActionHandler: IActionHandler = (state = connectedNetworkElementsStateInit, action) => { + if (action instanceof LoadAllConnectedNetworkElementsAction) { + + state = { + ...state, + busy: true + }; + + } else if (action instanceof AllConnectedNetworkElementsLoadedAction) { + if (!action.error && action.connectedNetworkElements) { + state = { + ...state, + connectedNetworkElements: action.connectedNetworkElements, + busy: false + }; + } else { + state = { + ...state, + busy: false + }; + } + } + return state; +}; \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/crossPolarDiscrimination15minHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/crossPolarDiscrimination15minHandler.ts new file mode 100644 index 000000000..81418db94 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/crossPolarDiscrimination15minHandler.ts @@ -0,0 +1,29 @@ +import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; +import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; + + +import { CrossPolarDiscriminationDataType, CrossPolarDiscrimination, CrossPolarDiscriminationResult } from '../models/crossPolarDiscriminationDataType'; + +export interface ICrossPolarDiscrimination15minState extends IExternalTableState { } + +/** + * Creates elastic search material data fetch handler for CPD from historicalperformance15min database. + */ +const crossPolarDiscriminationSearchHandler = createSearchDataHandler( + "sdnperformance/historicalperformance15min", + null, + (hit) => ({ + _id: hit._id, + ...hit._source, + ...hit._source["performance-data"] + }), + (name) => `${name}`); + +export const { + actionHandler: crossPolarDiscrimination15minActionHandler, + createActions: createCrossPolarDiscrimination15minActions, + createProperties: createCrossPolarDiscrimination15minProperties, + createPreActions: createCrossPolarDiscrimination15minPreActions, + reloadAction: crossPolarDiscrimination15minReloadAction, +} = createExternal(crossPolarDiscriminationSearchHandler, appState => appState.performanceHistory.crossPolarDiscrimination15min); + diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/crossPolarDiscrimination24hoursHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/crossPolarDiscrimination24hoursHandler.ts new file mode 100644 index 000000000..b4d9da393 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/crossPolarDiscrimination24hoursHandler.ts @@ -0,0 +1,29 @@ +import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; +import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; + + +import { CrossPolarDiscriminationDataType, CrossPolarDiscrimination, CrossPolarDiscriminationResult } from '../models/crossPolarDiscriminationDataType'; + +export interface ICrossPolarDiscrimination24hoursState extends IExternalTableState { } + +/** + * Creates elastic search material data fetch handler for CPD from historicalperformance24h database. + */ +const crossPolarDiscriminationSearchHandler = createSearchDataHandler( + "sdnperformance/historicalperformance24h", + null, + (hit) => ({ + _id: hit._id, + ...hit._source, + ...hit._source["performance-data"] + }), + (name) => `${name}`); + +export const { + actionHandler: crossPolarDiscrimination24hoursActionHandler, + createActions: createCrossPolarDiscrimination24hoursActions, + createProperties: createCrossPolarDiscrimination24hoursProperties, + createPreActions: createCrossPolarDiscrimination24hoursPreActions, + reloadAction: crossPolarDiscrimination24hoursReloadAction, +} = createExternal(crossPolarDiscriminationSearchHandler, appState => appState.performanceHistory.crossPolarDiscrimination24hours); + diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceData15minHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceData15minHandler.ts new file mode 100644 index 000000000..4f284a27e --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceData15minHandler.ts @@ -0,0 +1,28 @@ +import { createExternal,IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; +import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; + +import { PerformanceDataType, Performance,PerformanceResult } from '../models/performanceDataType'; + +export interface IPerformanceData15minState extends IExternalTableState {} + +/** + * Creates elastic search material data fetch handler for performance data from historicalperformance15min database. + */ + const performanceDataSearchHandler = createSearchDataHandler( + "sdnperformance/historicalperformance15min", + null, + (hit) => ({ + _id: hit._id, + ...hit._source, + ...hit._source["performance-data"] + }), + (name) => `${name}` ); + +export const { + actionHandler: performanceData15minActionHandler, + createActions: createPerformanceData15minActions, + createProperties: createPerformanceData15minProperties, + createPreActions: createPerformanceData15minPreActions, + reloadAction: performanceData15minReloadAction +} = createExternal(performanceDataSearchHandler, appState => appState.performanceHistory.performanceData15min); + diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceData24hoursHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceData24hoursHandler.ts new file mode 100644 index 000000000..4136ce482 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceData24hoursHandler.ts @@ -0,0 +1,28 @@ +import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; +import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; + +import { PerformanceDataType, Performance, PerformanceResult } from '../models/performanceDataType'; + +export interface IPerformanceData24hoursState extends IExternalTableState { } + +/** + * Creates elastic search material data fetch handler for performance data from historicalperformance24h database. + */ +const performanceDataSearchHandler = createSearchDataHandler( + "sdnperformance/historicalperformance24h", + null, + (hit) => ({ + _id: hit._id, + ...hit._source, + ...hit._source["performance-data"] + }), + (name) => `${name}`); + +export const { + actionHandler: performanceData24hoursActionHandler, + createActions: createPerformanceData24hoursActions, + createProperties: createPerformanceData24hoursProperties, + createPreActions: createPerformanceData24hoursPreActions, + reloadAction: performanceData24hoursReloadAction +} = createExternal(performanceDataSearchHandler, appState => appState.performanceHistory.performanceData24hours); + diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceHistoryRootHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceHistoryRootHandler.ts new file mode 100644 index 000000000..1cf814b5a --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceHistoryRootHandler.ts @@ -0,0 +1,83 @@ +// main state handler + +import { combineActionHandler } from '../../../../framework/src/flux/middleware'; + +// ** do not remove ** +import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; +import { IActionHandler } from '../../../../framework/src/flux/action'; + +import { IPerformanceData15minState, performanceData15minActionHandler } from './performanceData15minHandler'; +import { IReceiveLevel15minState, receiveLevel15minActionHandler } from './receiveLevel15minHandler'; +import { ITransmissionPower15minState, transmissionPower15minActionHandler } from './transmissionPower15minHandler'; +import { IAdaptiveModulation15minState, adaptiveModulation15minActionHandler } from './adaptiveModulation15minHandler'; +import { ITemperature15minState, temperature15minActionHandler } from './temperature15minHandler'; +import { ISignalToInterference15minState, signalToInterference15minActionHandler } from './signalToInterference15minHandler'; +import { ICrossPolarDiscrimination15minState, crossPolarDiscrimination15minActionHandler } from './crossPolarDiscrimination15minHandler'; +import { IPerformanceData24hoursState, performanceData24hoursActionHandler } from './performanceData24hoursHandler'; +import { IReceiveLevel24hoursState, receiveLevel24hoursActionHandler } from './receiveLevel24hoursHandler'; +import { ITransmissionPower24hoursState, transmissionPower24hoursActionHandler } from './transmissionPower24hoursHandler'; +import { IAdaptiveModulation24hoursState, adaptiveModulation24hoursActionHandler } from './adaptiveModulation24hoursHandler'; +import { ITemperature24hoursState, temperature24hoursActionHandler } from './temperature24hoursHandler'; +import { ISignalToInterference24hoursState, signalToInterference24hoursActionHandler } from './signalToInterference24hoursHandler'; +import { ICrossPolarDiscrimination24hoursState, crossPolarDiscrimination24hoursActionHandler } from './crossPolarDiscrimination24hoursHandler'; +import { SetPanelAction } from '../actions/panelChangeActions'; +import { IConnectedNetworkElementsState, connectedNetworkElementsActionHandler } from './connectedNetworkElementsActionHandler'; +import { IAvailableLtpsState, availableLtpsActionHandler } from './availableLtpsActionHandler'; + +export interface IPerformanceHistoryStoreState { + networkElements: IConnectedNetworkElementsState; + ltps: IAvailableLtpsState; + performanceData15min: IPerformanceData15minState; + performanceData24hours: IPerformanceData24hoursState; + receiveLevel15min: IReceiveLevel15minState; + receiveLevel24hours: IReceiveLevel24hoursState; + transmissionPower15min: ITransmissionPower15minState; + transmissionPower24hours: ITransmissionPower24hoursState; + adaptiveModulation15min: IAdaptiveModulation15minState; + adaptiveModulation24hours: IAdaptiveModulation24hoursState; + temperature15min: ITemperature15minState; + temperature24hours: ITemperature24hoursState; + signalToInterference15min:ISignalToInterference15minState; + signalToInterference24hours:ISignalToInterference24hoursState; + crossPolarDiscrimination15min: ICrossPolarDiscrimination15minState; + crossPolarDiscrimination24hours: ICrossPolarDiscrimination24hoursState; + currentOpenPanel: string | null; + +} + +const currentOpenPanelHandler: IActionHandler = (state = null, action) => { + if (action instanceof SetPanelAction) { + state = action.panelId; + } + return state; +} + +declare module '../../../../framework/src/store/applicationStore' { + interface IApplicationStoreState { + performanceHistory: IPerformanceHistoryStoreState; + } +} + +const actionHandlers = { + networkElements: connectedNetworkElementsActionHandler, + ltps: availableLtpsActionHandler, + performanceData15min: performanceData15minActionHandler, + performanceData24hours: performanceData24hoursActionHandler, + receiveLevel15min: receiveLevel15minActionHandler, + receiveLevel24hours: receiveLevel24hoursActionHandler, + transmissionPower15min: transmissionPower15minActionHandler, + transmissionPower24hours: transmissionPower24hoursActionHandler, + adaptiveModulation15min: adaptiveModulation15minActionHandler, + adaptiveModulation24hours: adaptiveModulation24hoursActionHandler, + temperature15min: temperature15minActionHandler, + temperature24hours: temperature24hoursActionHandler, + signalToInterference15min: signalToInterference15minActionHandler, + signalToInterference24hours: signalToInterference24hoursActionHandler, + crossPolarDiscrimination15min: crossPolarDiscrimination15minActionHandler, + crossPolarDiscrimination24hours: crossPolarDiscrimination24hoursActionHandler, + currentOpenPanel: currentOpenPanelHandler, +}; + +export const performanceHistoryRootHandler = combineActionHandler(actionHandlers); +export default performanceHistoryRootHandler; + diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/receiveLevel15minHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/receiveLevel15minHandler.ts new file mode 100644 index 000000000..c7c5e177f --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/receiveLevel15minHandler.ts @@ -0,0 +1,29 @@ +import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; +import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; + + +import { ReceiveLevelDataType, ReceiveLevel, ReceiveLevelResult } from '../models/receiveLevelDataType'; + +export interface IReceiveLevel15minState extends IExternalTableState { } + +/** + * Creates elastic search material data fetch handler for receiveLevel from historicalperformance15min database. + */ +const receiveLevelSearchHandler = createSearchDataHandler( + "sdnperformance/historicalperformance15min", + null, + (hit) => ({ + _id: hit._id, + ...hit._source, + ...hit._source["performance-data"] + }), + (name) => `${name}`); + +export const { + actionHandler: receiveLevel15minActionHandler, + createActions: createReceiveLevel15minActions, + createProperties: createReceiveLevel15minProperties, + createPreActions: createReceiveLevel15minPreActions, + reloadAction: receiveLevel15minReloadAction, +} = createExternal(receiveLevelSearchHandler, appState => appState.performanceHistory.receiveLevel15min); + diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/receiveLevel24hoursHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/receiveLevel24hoursHandler.ts new file mode 100644 index 000000000..f665dfdc6 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/receiveLevel24hoursHandler.ts @@ -0,0 +1,29 @@ +import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; +import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; + + +import { ReceiveLevelDataType, ReceiveLevel, ReceiveLevelResult } from '../models/receiveLevelDataType'; + +export interface IReceiveLevel24hoursState extends IExternalTableState { } + +/** + * Creates elastic search material data fetch handler for receiveLevel from historicalperformance24h database. + */ +const receiveLevelSearchHandler = createSearchDataHandler( + "sdnperformance/historicalperformance24h", + null, + (hit) => ({ + _id: hit._id, + ...hit._source, + ...hit._source["performance-data"] + }), + (name) => `${name}`); + +export const { + actionHandler: receiveLevel24hoursActionHandler, + createActions: createReceiveLevel24hoursActions, + createProperties: createReceiveLevel24hoursProperties, + createPreActions: createReceiveLevel24hoursPreActions, + reloadAction: receiveLevel24hoursReloadAction, +} = createExternal(receiveLevelSearchHandler, appState => appState.performanceHistory.receiveLevel24hours); + diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/signalToInterference15minHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/signalToInterference15minHandler.ts new file mode 100644 index 000000000..536a89ea7 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/signalToInterference15minHandler.ts @@ -0,0 +1,29 @@ +import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; +import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; + + +import { SignalToInterferenceDataType, SignalToInterference, SignalToInterferenceResult } from '../models/signalToInteferenceDataType'; + +export interface ISignalToInterference15minState extends IExternalTableState { } + +/** + * Creates elastic search material data fetch handler for SINR from historicalperformance15min database. + */ +const signalToInterferenceSearchHandler = createSearchDataHandler( + "sdnperformance/historicalperformance15min", + null, + (hit) => ({ + _id: hit._id, + ...hit._source, + ...hit._source["performance-data"] + }), + (name) => `${name}`); + +export const { + actionHandler: signalToInterference15minActionHandler, + createActions: createSignalToInterference15minActions, + createProperties: createSignalToInterference15minProperties, + createPreActions: createSignalToInterference15minPreActions, + reloadAction: signalToInterference15minReloadAction, +} = createExternal(signalToInterferenceSearchHandler, appState => appState.performanceHistory.signalToInterference15min); + diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/signalToInterference24hoursHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/signalToInterference24hoursHandler.ts new file mode 100644 index 000000000..a95d0aecf --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/signalToInterference24hoursHandler.ts @@ -0,0 +1,29 @@ +import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; +import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; + + +import { SignalToInterferenceDataType, SignalToInterference, SignalToInterferenceResult } from '../models/signalToInteferenceDataType'; + +export interface ISignalToInterference24hoursState extends IExternalTableState { } + +/** + * Creates elastic search material data fetch handler for SINR from historicalperformance24h database. + */ +const signalToInterferenceSearchHandler = createSearchDataHandler( + "sdnperformance/historicalperformance24h", + null, + (hit) => ({ + _id: hit._id, + ...hit._source, + ...hit._source["performance-data"] + }), + (name) => `${name}`); + +export const { + actionHandler: signalToInterference24hoursActionHandler, + createActions: createSignalToInterference24hoursActions, + createProperties: createSignalToInterference24hoursProperties, + createPreActions: createSignalToInterference24hoursPreActions, + reloadAction: signalToInterference24hoursReloadAction, +} = createExternal(signalToInterferenceSearchHandler, appState => appState.performanceHistory.signalToInterference24hours); + diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/temperature15minHandler.tsx b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/temperature15minHandler.tsx new file mode 100644 index 000000000..20fb57035 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/temperature15minHandler.tsx @@ -0,0 +1,29 @@ +import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; +import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; + + +import { TemperatureDataType, Temperature, TemperatureResult } from '../models/temperatureDataType'; + +export interface ITemperature15minState extends IExternalTableState { } + +/** + * Creates elastic search material data fetch handler for Temperature from historicalperformance15min database. + */ +const temperatureSearchHandler = createSearchDataHandler( + "sdnperformance/historicalperformance15min", + null, + (hit) => ({ + _id: hit._id, + ...hit._source, + ...hit._source["performance-data"] + }), + (name) => `${name}`); + +export const { + actionHandler: temperature15minActionHandler, + createActions: createTemperature15minActions, + createProperties: createTemperature15minProperties, + createPreActions: createTemperature15minPreActions, + reloadAction: temperature15minReloadAction, +} = createExternal(temperatureSearchHandler, appState => appState.performanceHistory.temperature15min); + diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/temperature24hoursHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/temperature24hoursHandler.ts new file mode 100644 index 000000000..1c36ef876 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/temperature24hoursHandler.ts @@ -0,0 +1,29 @@ +import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; +import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; + + +import { TemperatureDataType, Temperature, TemperatureResult } from '../models/temperatureDataType'; + +export interface ITemperature24hoursState extends IExternalTableState { } + +/** + * Creates elastic search material data fetch handler for temperature from historicalperformance24h database. + */ +const temperatureSearchHandler = createSearchDataHandler( + "sdnperformance/historicalperformance24h", + null, + (hit) => ({ + _id: hit._id, + ...hit._source, + ...hit._source["performance-data"] + }), + (name) => `${name}`); + +export const { + actionHandler: temperature24hoursActionHandler, + createActions: createTemperature24hoursActions, + createProperties: createTemperature24hoursProperties, + createPreActions: createTemperature24hoursPreActions, + reloadAction: temperature24hoursReloadAction, +} = createExternal(temperatureSearchHandler, appState => appState.performanceHistory.temperature24hours); + diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/transmissionPower15minHandler.tsx b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/transmissionPower15minHandler.tsx new file mode 100644 index 000000000..e6ba90f10 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/transmissionPower15minHandler.tsx @@ -0,0 +1,29 @@ +import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; +import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; + + +import { TransmissionPowerDataType, TransmissionPower, TransmissionPowerResult } from '../models/transmissionPowerDataType'; + +export interface ITransmissionPower15minState extends IExternalTableState { } + +/** + * Creates elastic search material data fetch handler for Transmission power from historicalperformance15min database. + */ +const transmissionPowerSearchHandler = createSearchDataHandler( + "sdnperformance/historicalperformance15min", + null, + (hit) => ({ + _id: hit._id, + ...hit._source, + ...hit._source["performance-data"] + }), + (name) => `${name}`); + +export const { + actionHandler: transmissionPower15minActionHandler, + createActions: createTransmissionPower15minActions, + createProperties: createTransmissionPower15minProperties, + createPreActions: createTransmissionPower15minPreActions, + reloadAction: transmissionPower15minReloadAction, +} = createExternal(transmissionPowerSearchHandler, appState => appState.performanceHistory.transmissionPower15min); + diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/transmissionPower24hoursHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/transmissionPower24hoursHandler.ts new file mode 100644 index 000000000..de50629e1 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/transmissionPower24hoursHandler.ts @@ -0,0 +1,28 @@ +import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; +import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; + +import { TransmissionPowerDataType, TransmissionPower, TransmissionPowerResult } from '../models/transmissionPowerDataType'; + +export interface ITransmissionPower24hoursState extends IExternalTableState { } + +/** + * Creates elastic search material data fetch handler for transmission power from historicalperformance24h database. + */ +const transmissionPowerSearchHandler = createSearchDataHandler( + "sdnperformance/historicalperformance24h", + null, + (hit) => ({ + _id: hit._id, + ...hit._source, + ...hit._source["performance-data"] + }), + (name) => `${name}`); + +export const { + actionHandler: transmissionPower24hoursActionHandler, + createActions: createTransmissionPower24hoursActions, + createProperties: createTransmissionPower24hoursProperties, + createPreActions: createTransmissionPower24hoursPreActions, + reloadAction: transmissionPower24hoursReloadAction, +} = createExternal(transmissionPowerSearchHandler, appState => appState.performanceHistory.transmissionPower24hours); + diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/index.html b/sdnr/wt/odlux/apps/performanceHistoryApp/src/index.html new file mode 100644 index 000000000..fce395d33 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/index.html @@ -0,0 +1,25 @@ + + + + + + + + + PM History Application + + + +
+ + + + + + \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/adaptiveModulationDataType.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/adaptiveModulationDataType.ts new file mode 100644 index 000000000..686e3bc96 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/adaptiveModulationDataType.ts @@ -0,0 +1,53 @@ +export { HitEntry, Result } from '../../../../framework/src/models'; + +/** + * Represents Adaptive Modulation data fields of the performance history table. + */ +export type AdaptiveModulationDataType = { + "_id": string; + "radio-signal-id": string; + "scanner-id": string; + "time-stamp": string; + "suspect-interval-flag": boolean; + "time2-states-s": string; + "time2-states": string; + "time2-states-l": string; + "time4-states-s": string; + "time4-states": string; + "time4-states-l": string; + "time16-states-s": string; + "time16-states": string; + "time16-states-l": string; + "time32-states-s": string; + "time32-states": string; + "time32-states-l": string; + "time64-states-s": string; + "time64-states": string; + "time64-states-l": string; + "time128-states-s": string; + "time128-states": string; + "time128-states-l": string; + "time256-states-s": string; + "time256-states": string; + "time256-states-l": string; + "time512-states-s": string; + "time512-states": string; + "time512-states-l": string; + "time1024-states-s": string; + "time1024-states": string; + "time1024-states-l": string; + "time2048-states-s": string; + "time2048-states": string; + "time2048-states-l": string; + "time4096-states-s": string; + "time4096-states": string; + "time4096-states-l": string; + "time8192-states-s": string; + "time8192-states": string; + "time8192-states-l": string; +}; + + +export type AdaptiveModulationResult = { "performance-data": AdaptiveModulationDataType }; + +export type AdaptiveModulation = AdaptiveModulationDataType & { _id: string }; \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/availableLtps.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/availableLtps.ts new file mode 100644 index 000000000..15a27f147 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/availableLtps.ts @@ -0,0 +1,14 @@ + export type Ltp = { + key: string + } + + export type Bucket={ + buckets: Ltp[] + } + +/** + * Represents distinct available ltps using elasticsearch aggregations structure. + */ + export type DistinctLtp = { + "uuid-interface": Bucket + } diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/connectedNetworkElements.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/connectedNetworkElements.ts new file mode 100644 index 000000000..f4afa645d --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/connectedNetworkElements.ts @@ -0,0 +1,6 @@ +/** + * Represents connected network elements. + */ +export type ConnectedNetworkElements = { + mountId: string, + } diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/crossPolarDiscriminationDataType.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/crossPolarDiscriminationDataType.ts new file mode 100644 index 000000000..2dc183eda --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/crossPolarDiscriminationDataType.ts @@ -0,0 +1,20 @@ +export { HitEntry, Result } from '../../../../framework/src/models'; + +/** + * Represents CPD data fields of the performance history table. + */ +export type CrossPolarDiscriminationDataType = { + "_id": string; + "radio-signal-id": string; + "scanner-id": string; + "time-stamp": string; + "suspect-interval-flag": boolean; + "xpd-min": string; + "xpd-avg": string; + "xpd-max": string; +}; + + +export type CrossPolarDiscriminationResult = { "performance-data": CrossPolarDiscriminationDataType }; + +export type CrossPolarDiscrimination = CrossPolarDiscriminationDataType & { _id: string }; \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/panelId.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/panelId.ts new file mode 100644 index 000000000..1f05b47cc --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/panelId.ts @@ -0,0 +1,4 @@ +/** + * Represents PanelIds for the available Expansional panels. + */ +export type PanelId = null | "PerformanceData" | "ReceiveLevel" | "TransmissionPower" | "AdaptiveModulation" | "Temperature" | "SINR" | "CPD"; \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/performanceDataType.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/performanceDataType.ts new file mode 100644 index 000000000..6972998b6 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/performanceDataType.ts @@ -0,0 +1,20 @@ +export { HitEntry, Result } from '../../../../framework/src/models'; + +/** + * Represents performance data fields of the performance history table. + */ +export type PerformanceDataType = { + "_id": string; + "radio-signal-id": string; + "scanner-id": string; + "time-stamp": string; + "suspect-interval-flag": boolean; + "es": string; + "ses": string; + "unavailability": string; +}; + + +export type PerformanceResult = { "performance-data": PerformanceDataType }; + +export type Performance = PerformanceDataType & { _id: string }; \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/receiveLevelDataType.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/receiveLevelDataType.ts new file mode 100644 index 000000000..9f51c8fee --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/receiveLevelDataType.ts @@ -0,0 +1,20 @@ +export { HitEntry, Result } from '../../../../framework/src/models'; + +/** + * Represents Receive level data fields of the performance history table. + */ +export type ReceiveLevelDataType = { + "_id": string; + "radio-signal-id": string; + "scanner-id": string; + "time-stamp": string; + "suspect-interval-flag": boolean; + "rx-level-min": string; + "rx-level-avg": string; + "rx-level-max": string; +}; + + +export type ReceiveLevelResult = { "performance-data": ReceiveLevelDataType }; + +export type ReceiveLevel = ReceiveLevelDataType & { _id: string }; \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/signalToInteferenceDataType.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/signalToInteferenceDataType.ts new file mode 100644 index 000000000..73934bd85 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/signalToInteferenceDataType.ts @@ -0,0 +1,20 @@ +export { HitEntry, Result } from '../../../../framework/src/models'; + +/** + * Represents Signal to interference data fields of the performance history table. + */ +export type SignalToInterferenceDataType = { + "_id": string; + "radio-signal-id": string; + "scanner-id": string; + "time-stamp": string; + "suspect-interval-flag": boolean; + "snir-min": string; + "snir-avg": string; + "snir-max": string; +}; + + +export type SignalToInterferenceResult = { "performance-data": SignalToInterferenceDataType }; + +export type SignalToInterference = SignalToInterferenceDataType & { _id: string }; \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/temperatureDataType.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/temperatureDataType.ts new file mode 100644 index 000000000..e5be6e36c --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/temperatureDataType.ts @@ -0,0 +1,20 @@ +export { HitEntry, Result } from '../../../../framework/src/models'; + +/** + * Represents Temperature data fields of the performance history table. + */ +export type TemperatureDataType = { + "_id": string; + "radio-signal-id": string; + "scanner-id": string; + "time-stamp": string; + "suspect-interval-flag": boolean; + "rf-temp-min": string; + "rf-temp-avg": string; + "rf-temp-max": string; +}; + + +export type TemperatureResult = { "performance-data": TemperatureDataType }; + +export type Temperature = TemperatureDataType & { _id: string }; \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/topologyNetConf.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/topologyNetConf.ts new file mode 100644 index 000000000..84548ce45 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/topologyNetConf.ts @@ -0,0 +1,12 @@ +export interface TopologyNode { + "node-id": string; + "netconf-node-topology:connection-status": string; +} + +/** + * Represents restConf network element topology. + */ +export interface Topology { + "topology-id": string; + "node": TopologyNode[]; +} diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/transmissionPowerDataType.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/transmissionPowerDataType.ts new file mode 100644 index 000000000..948baff12 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/models/transmissionPowerDataType.ts @@ -0,0 +1,20 @@ +export { HitEntry, Result } from '../../../../framework/src/models'; + +/** + * Represents the TransmissionPower data fields of the performance history table. + */ +export type TransmissionPowerDataType = { + "_id": string; + "radio-signal-id": string; + "scanner-id": string; + "time-stamp": string; + "suspect-interval-flag": boolean; + "tx-level-min": string; + "tx-level-avg": string; + "tx-level-max": string; +}; + + +export type TransmissionPowerResult = { "performance-data": TransmissionPowerDataType }; + +export type TransmissionPower = TransmissionPowerDataType & { _id: string }; \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/plugin.tsx b/sdnr/wt/odlux/apps/performanceHistoryApp/src/plugin.tsx new file mode 100644 index 000000000..3e1263e34 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/plugin.tsx @@ -0,0 +1,17 @@ + +import { faBook } from '@fortawesome/free-solid-svg-icons'; + +import applicationManager from '../../../framework/src/services/applicationManager'; + +import performanceHistoryRootHandler from './handlers/performanceHistoryRootHandler'; +import PerformanceHistoryApplication from './views/performanceHistoryApplication'; + +export function register() { + applicationManager.registerApplication({ + name: "performanceHistory", + icon: faBook, + rootComponent: PerformanceHistoryApplication, + rootActionHandler: performanceHistoryRootHandler, + menuEntry: "Performance" + }); +} \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/services/performanceHistoryService.tsx b/sdnr/wt/odlux/apps/performanceHistoryApp/src/services/performanceHistoryService.tsx new file mode 100644 index 000000000..a1cdcffcc --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/services/performanceHistoryService.tsx @@ -0,0 +1,93 @@ +import { requestRest } from '../../../../framework/src/services/restService'; +import { Result } from '../../../../framework/src/models/elasticSearch'; + +import { ConnectedNetworkElements } from '../models/connectedNetworkElements'; +import { DistinctLtp, Ltp } from '../models/availableLtps'; +import { Topology, TopologyNode } from '../models/topologyNetConf'; + +/** + * Represents a web api accessor service for Network elements actions. + */ +class PerformanceService { + + private static networkElementTopology = (mountPoint: TopologyNode) => { + const mountId = mountPoint["node-id"]; + return { + mountId: mountId, + } + } + + /** + * Get all connected network elements from restconf. + */ + public async getConnectedNetworkElementsList(): Promise { + const path = "restconf/operational/network-topology:network-topology/topology/topology-netconf"; + const topologyRequestPomise = requestRest<{ topology: Topology[] | null }>(path, { method: "GET" }, true); + const [netconfResponse] = await Promise.all([topologyRequestPomise]); + const topologyNetconf = netconfResponse && netconfResponse.topology && netconfResponse.topology.find(topology => topology["topology-id"] === "topology-netconf"); + let mountPoints = topologyNetconf && topologyNetconf.node && topologyNetconf.node.filter( + mountPoint => mountPoint["netconf-node-topology:connection-status"] == "connected").map(mountedElement => { + return PerformanceService.networkElementTopology(mountedElement); + }); + return mountPoints || []; + } + + /** + * Get distinct ltps based on the selected network element and time period from the historicalperformance15min database table. + */ + public async getDistinctLtpsFrom15minDatabase(networkElement: string): Promise { + const path = 'database/sdnperformance/historicalperformance15min/_search'; + const query = { + "size": 0, + "query": { + "match": { + "node-name": networkElement + } + }, + "aggs": { + "uuid-interface": { + "terms": { + "field": "uuid-interface" + } + } + } + }; + const result = await requestRest>(path, { method: "POST", body: JSON.stringify(query) }); + if(result && result.aggregations) { + } + return result && result.aggregations && result.aggregations["uuid-interface"].buckets.map(ne=>({ + key:ne.key + }))|| null; + } + + /** + * Get distinct ltps based on the selected network element and time period from the historicalperformance24h database table. + */ + public async getDistinctLtpsFrom24hoursDatabase(networkElement: string): Promise { + const path = 'database/sdnperformance/historicalperformance24h/_search'; + const query = { + "size": 0, + "query": { + "match": { + "node-name": networkElement + } + }, + "aggs": { + "uuid-interface": { + "terms": { + "field": "uuid-interface" + } + } + } + }; + const result = await requestRest>(path, { method: "POST", body: JSON.stringify(query) }); + if(result && result.aggregations) { + } + return result && result.aggregations && result.aggregations["uuid-interface"].buckets.map(ne=>({ + key:ne.key + }))|| null; + } +} + +export const PerformanceHistoryService = new PerformanceService(); +export default PerformanceHistoryService; diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/views/performanceHistoryApplication.tsx b/sdnr/wt/odlux/apps/performanceHistoryApp/src/views/performanceHistoryApplication.tsx new file mode 100644 index 000000000..12027e499 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/views/performanceHistoryApplication.tsx @@ -0,0 +1,363 @@ +import * as React from 'react'; + +import { createStyles, Theme, withStyles, WithStyles } from '@material-ui/core/styles'; +import FormControl from '@material-ui/core/FormControl'; +import MenuItem from '@material-ui/core/MenuItem'; +import Select from '@material-ui/core/Select'; + +import connect, { Connect, IDispatcher } from '../../../../framework/src/flux/connect'; +import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; +import { Panel } from '../../../../framework/src/components/material-ui'; + +import { PanelId } from '../models/panelId'; +import { PerformanceData } from '../components/performanceData'; +import { ReceiveLevel } from '../components/receiveLevel'; +import { TransmissionPower } from '../components/transmissionPower'; +import { AdaptiveModulation } from '../components/adaptiveModulation'; +import { Temperature } from '../components/temperature'; +import { SignalToInterference } from '../components/signalToInterference'; +import { CrossPolarDiscrimination } from '../components/crossPolarDiscrimination'; +import { loadAllConnectedNetworkElementsAsync } from '../actions/connectedNetworkElementsActions'; +import { loadDistinctLtpsbyNetworkElementAsync } from '../actions/ltpAction'; +import { SetPanelAction } from '../actions/panelChangeActions'; +import { createPerformanceData15minPreActions, performanceData15minReloadAction } from '../handlers/performanceData15minHandler'; +import { createPerformanceData24hoursPreActions, performanceData24hoursReloadAction } from '../handlers/performanceData24hoursHandler'; +import { createReceiveLevel15minPreActions, receiveLevel15minReloadAction } from '../handlers/receiveLevel15minHandler'; +import { createReceiveLevel24hoursPreActions, receiveLevel24hoursReloadAction } from '../handlers/receiveLevel24hoursHandler'; +import { createTransmissionPower15minPreActions, transmissionPower15minReloadAction } from '../handlers/transmissionPower15minHandler'; +import { createTransmissionPower24hoursPreActions, transmissionPower24hoursReloadAction } from '../handlers/transmissionPower24hoursHandler'; +import { createAdaptiveModulation15minPreActions, adaptiveModulation15minReloadAction } from '../handlers/adaptiveModulation15minHandler'; +import { createAdaptiveModulation24hoursPreActions, adaptiveModulation24hoursReloadAction } from '../handlers/adaptiveModulation24hoursHandler'; +import { createTemperature15minPreActions, temperature15minReloadAction } from '../handlers/temperature15minHandler'; +import { createTemperature24hoursPreActions, temperature24hoursReloadAction } from '../handlers/temperature24hoursHandler'; +import { createSignalToInterference15minPreActions, signalToInterference15minReloadAction } from '../handlers/signalToInterference15minHandler'; +import { createSignalToInterference24hoursPreActions, signalToInterference24hoursReloadAction } from '../handlers/signalToInterference24hoursHandler'; +import { createCrossPolarDiscrimination15minPreActions, crossPolarDiscrimination15minReloadAction } from '../handlers/crossPolarDiscrimination15minHandler'; +import { createCrossPolarDiscrimination24hoursPreActions, crossPolarDiscrimination24hoursReloadAction } from '../handlers/crossPolarDiscrimination24hoursHandler'; + +const PerformanceHistoryComponentStyles = (theme: Theme) => createStyles({ + root: { + display: "flex", + flexWrap: "wrap", + }, + margin: { + margin: theme.spacing.unit, + }, + display: { + display: "inline-block" + }, + selectDropdown: { + borderRadius: 1, + position: "relative", + backgroundColor: theme.palette.background.paper, + border: "1px solid #ced4da", + fontSize: 16, + width: "auto", + padding: "5px 26px 5px 12px", + transition: theme.transitions.create(["border-color", "box-shadow"]), + } +}); + +const mapProps = (state: IApplicationStoreState) => ({ + activePanel: state.performanceHistory.currentOpenPanel, + availableLtps: state.performanceHistory.ltps.distinctLtps, + networkElements: state.performanceHistory.networkElements.connectedNetworkElements +}); + +const mapDispatcher = (dispatcher: IDispatcher) => ({ + reloadPerformanceData15min: () => dispatcher.dispatch(performanceData15minReloadAction), + reloadPerformanceData24hours: () => dispatcher.dispatch(performanceData24hoursReloadAction), + reloadReceiveLevel15min: () => dispatcher.dispatch(receiveLevel15minReloadAction), + reloadReceiveLevel24hours: () => dispatcher.dispatch(receiveLevel24hoursReloadAction), + reloadTransmissionPower15min: () => dispatcher.dispatch(transmissionPower15minReloadAction), + reloadTransmissionPower24hours: () => dispatcher.dispatch(transmissionPower24hoursReloadAction), + reloadAdaptiveModulation15min: () => dispatcher.dispatch(adaptiveModulation15minReloadAction), + reloadAdaptiveModulation24hours: () => dispatcher.dispatch(adaptiveModulation24hoursReloadAction), + reloadTemperature15min: () => dispatcher.dispatch(temperature15minReloadAction), + reloadTemperature24hours: () => dispatcher.dispatch(temperature24hoursReloadAction), + reloadSignalToInterference15min: () => dispatcher.dispatch(signalToInterference15minReloadAction), + reloadSignalToInterference24hours: () => dispatcher.dispatch(signalToInterference24hoursReloadAction), + reloadCrossPolarDiscrimination15min: () => dispatcher.dispatch(crossPolarDiscrimination15minReloadAction), + reloadCrossPolarDiscrimination24hours: () => dispatcher.dispatch(crossPolarDiscrimination24hoursReloadAction), + performanceData15minPreActions: createPerformanceData15minPreActions(dispatcher.dispatch), + performanceData24hoursPreActions: createPerformanceData24hoursPreActions(dispatcher.dispatch), + receiveLevel15minPreActions: createReceiveLevel15minPreActions(dispatcher.dispatch), + receiveLevel24hoursPreActions: createReceiveLevel24hoursPreActions(dispatcher.dispatch), + transmissionPower15minPreActions: createTransmissionPower15minPreActions(dispatcher.dispatch), + transmissionPower24hoursPreActions: createTransmissionPower24hoursPreActions(dispatcher.dispatch), + adaptiveModulation15minPreActions: createAdaptiveModulation15minPreActions(dispatcher.dispatch), + adaptiveModulation24hoursPreActions: createAdaptiveModulation24hoursPreActions(dispatcher.dispatch), + temperature15minPreActions: createTemperature15minPreActions(dispatcher.dispatch), + temperature24hoursPreActions: createTemperature24hoursPreActions(dispatcher.dispatch), + signalToInterference15minPreActions: createSignalToInterference15minPreActions(dispatcher.dispatch), + signalToInterference24hoursPreActions: createSignalToInterference24hoursPreActions(dispatcher.dispatch), + crossPolarDiscrimination15minPreActions: createCrossPolarDiscrimination15minPreActions(dispatcher.dispatch), + crossPolarDiscrimination24hoursPreActions: createCrossPolarDiscrimination24hoursPreActions(dispatcher.dispatch), + getConnectedNetworkElements: () => dispatcher.dispatch(loadAllConnectedNetworkElementsAsync), + getDistinctLtps: (selectedNetworkElement: string, selectedTimePeriod: string, selectedLtp: string, selectFirstLtp?: Function, resetLTP?: Function) => dispatcher.dispatch(loadDistinctLtpsbyNetworkElementAsync(selectedNetworkElement, selectedTimePeriod, selectedLtp, selectFirstLtp, resetLTP)), + setCurrentPanel: (panelId: PanelId) => dispatcher.dispatch(new SetPanelAction(panelId)) +}); + +type PerformanceHistoryComponentProps = Connect & WithStyles; + +type PerformanceHistoryComponentState = { + selectedNetworkElement: string, + selectedTimePeriod: string, + selectedLtp: string, + showLtps: boolean, + showPanels: boolean +}; + +/** + * Represents the component for Performance history application. + */ +class PerformanceHistoryComponent extends React.Component{ + /** + * Initialises this instance + */ + constructor(props: PerformanceHistoryComponentProps) { + super(props); + this.state = { + selectedNetworkElement: "-1", + selectedTimePeriod: "15min", + selectedLtp: "-1", + showLtps: false, + showPanels: false + }; + } + + render(): JSX.Element { + const { classes } = this.props; + const { activePanel } = this.props; + + const onTogglePanel = (panelId: PanelId) => { + const nextActivePanel = panelId === this.props.activePanel ? null : panelId; + this.props.setCurrentPanel(nextActivePanel); + switch (nextActivePanel) { + case "PerformanceData": + if (this.state.selectedTimePeriod == "15min") { + this.props.reloadPerformanceData15min(); + } else { + + this.props.reloadPerformanceData24hours(); + } + break; + case "ReceiveLevel": + if (this.state.selectedTimePeriod == "15min") { + this.props.reloadReceiveLevel15min(); + } else { + this.props.reloadReceiveLevel24hours(); + } + break; + case "TransmissionPower": + if (this.state.selectedTimePeriod == "15min") { + this.props.reloadTransmissionPower15min(); + } else { + this.props.reloadTransmissionPower24hours(); + } + break; + case "AdaptiveModulation": + if (this.state.selectedTimePeriod == "15min") { + this.props.reloadAdaptiveModulation15min(); + } else { + this.props.reloadAdaptiveModulation24hours(); + } + break; + case "Temperature": + if (this.state.selectedTimePeriod == "15min") { + this.props.reloadTemperature15min(); + } else { + this.props.reloadTemperature24hours(); + } + break; + case "SINR": + if (this.state.selectedTimePeriod == "15min") { + this.props.reloadSignalToInterference15min(); + } else { + this.props.reloadSignalToInterference24hours(); + } + break; + case "CPD": + if (this.state.selectedTimePeriod == "15min") { + this.props.reloadCrossPolarDiscrimination15min(); + } else { + this.props.reloadCrossPolarDiscrimination24hours(); + } + break; + case null: + break; + default: + break; + } + } + + return ( + <> +
+
+ + Select Network element + + +
+
+ { this.state.showLtps && ( +
+ + + Select LTP + + + Time-Period + + + { this.state.showPanels && ( +
+ + + + + + + + + + + + + + + + + + + + + +
+ )} +
+ )} + + ); + }; + + public componentDidMount() { + this.props.getConnectedNetworkElements(); + } + + /** + * Function which selects the first ltp returned from the database on selection of network element. + */ + private selectFirstLtp = (firstLtp: string) => { + this.setState({ + showPanels: true, + selectedLtp: firstLtp + }); + this.preFilterChangeAndReload(this.state.selectedNetworkElement, this.state.selectedTimePeriod, firstLtp); + } + + /** + * A function which loads the tables based on prefilters defined by network element and ltp on selected time period. + */ + private preFilterChangeAndReload = (networkElement: string, timePeriod: string, ltp: string) => { + const preFilter = { + "node-name": networkElement, + "uuid-interface": ltp + }; + if (timePeriod == "15min") { + this.props.performanceData15minPreActions.onPreFilterChanged(preFilter); + this.props.receiveLevel15minPreActions.onPreFilterChanged(preFilter); + this.props.transmissionPower15minPreActions.onPreFilterChanged(preFilter); + this.props.adaptiveModulation15minPreActions.onPreFilterChanged(preFilter); + this.props.temperature15minPreActions.onPreFilterChanged(preFilter); + this.props.signalToInterference15minPreActions.onPreFilterChanged(preFilter); + this.props.crossPolarDiscrimination15minPreActions.onPreFilterChanged(preFilter); + } else if (timePeriod == "24hours") { + this.props.performanceData24hoursPreActions.onPreFilterChanged(preFilter); + this.props.receiveLevel24hoursPreActions.onPreFilterChanged(preFilter); + this.props.transmissionPower24hoursPreActions.onPreFilterChanged(preFilter); + this.props.adaptiveModulation24hoursPreActions.onPreFilterChanged(preFilter); + this.props.temperature24hoursPreActions.onPreFilterChanged(preFilter); + this.props.signalToInterference24hoursPreActions.onPreFilterChanged(preFilter); + this.props.crossPolarDiscrimination24hoursPreActions.onPreFilterChanged(preFilter); + } + } + + /** + * Function which handles network element changes. + */ + private handleNetworkElementChange = (event: React.ChangeEvent) => { + var showLtps: boolean = true; + if (event.target.value === "-1") { + showLtps = false; + } else if (event.target.value !== this.state.selectedNetworkElement) { + this.setState({ + showPanels: false + }); + } + this.setState({ + showLtps: showLtps, + selectedNetworkElement: event.target.value, + selectedLtp: "-1" + }); + this.props.getDistinctLtps(event.target.value, this.state.selectedTimePeriod, "-1", this.selectFirstLtp); + } + + /** + * Function which resets the ltps to "--select--" in the state if the passed parameter @ltpNotSelected is true. + * @param ltpNotSelected: true, if existing selected is not available in the given time period, else false + */ + private resetLtpDropdown = (ltpNotSelected: boolean) => { + if (ltpNotSelected) { + this.setState({ + selectedLtp: "-1", + }); + } + } + + /** + * Function which handles the time period changes. + */ + private handleTimePeriodChange = (event: React.ChangeEvent) => { + this.setState({ + selectedTimePeriod: event.target.value, + }); + if (event.target.value == "15min") { + this.props.getDistinctLtps(this.state.selectedNetworkElement, event.target.value, this.state.selectedLtp, undefined, this.resetLtpDropdown); + } else if (event.target.value == "24hours") { + this.props.getDistinctLtps(this.state.selectedNetworkElement, event.target.value, this.state.selectedLtp, undefined, this.resetLtpDropdown); + } + this.preFilterChangeAndReload(this.state.selectedNetworkElement, event.target.value, this.state.selectedLtp); + } + + /** + * Function which handles the ltp changes. + */ + private handleLtpChange = (event: React.ChangeEvent) => { + var showPanels: boolean = true; + if (event.target.value === "-1") { + showPanels = false; + } + this.setState({ + showPanels: showPanels, + selectedLtp: event.target.value + }); + this.preFilterChangeAndReload(this.state.selectedNetworkElement, this.state.selectedTimePeriod, event.target.value); + } +} + +export const PerformanceHistoryApplication = withStyles(PerformanceHistoryComponentStyles)(connect(mapProps, mapDispatcher)(PerformanceHistoryComponent)); +export default PerformanceHistoryApplication; diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java b/sdnr/wt/odlux/apps/performanceHistoryApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java new file mode 100644 index 000000000..1e882fc69 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java @@ -0,0 +1,68 @@ +/******************************************************************************* + * ============LICENSE_START======================================================================== + * ONAP : ccsdk feature sdnr wt + * ================================================================================================= + * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. + * ================================================================================================= + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * ============LICENSE_END========================================================================== + ******************************************************************************/ +package org.onap.ccsdk.features.sdnr.wt.odlux.bundles; + +import org.onap.ccsdk.features.sdnr.wt.odlux.model.bundles.OdluxBundle; +import org.onap.ccsdk.features.sdnr.wt.odlux.model.bundles.OdluxBundleLoader; + +public class MyOdluxBundle extends OdluxBundle { + + @Override + public void initialize() { + super.initialize(); + } + + @Override + public void clean() { + super.clean(); + } + + @Override + public String getResourceFileContent(String filename) { + return super.getResourceFileContent(filename); + } + + @Override + public boolean hasResource(String filename) { + return super.hasResource(filename); + } + + @Override + public void setBundleName(String bundleName) { + super.setBundleName(bundleName); + } + + @Override + public void setLoader(OdluxBundleLoader loader) { + super.setLoader(loader); + } + + @Override + public String getBundleName() { + return super.getBundleName(); + } + + @Override + public OdluxBundleLoader getLoader() { + return super.getLoader(); + } + + public MyOdluxBundle() { + super(); + } +} diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml b/sdnr/wt/odlux/apps/performanceHistoryApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml new file mode 100644 index 000000000..1bcbf0127 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java b/sdnr/wt/odlux/apps/performanceHistoryApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java new file mode 100644 index 000000000..edf68e096 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * ============LICENSE_START======================================================================== + * ONAP : ccsdk feature sdnr wt + * ================================================================================================= + * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. + * ================================================================================================= + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * ============LICENSE_END========================================================================== + ******************************************************************************/ +package org.onap.ccsdk.features.sdnr.wt.odlux.bundles.test; + +import static org.junit.Assert.*; + +import org.junit.Test; +import org.onap.ccsdk.features.sdnr.wt.odlux.OdluxBundleLoaderImpl; +import org.onap.ccsdk.features.sdnr.wt.odlux.bundles.MyOdluxBundle; + +public class TestBundleRes { + + @Test + public void test() { + OdluxBundleLoaderImpl loader = OdluxBundleLoaderImpl.getInstance(); + MyOdluxBundle b = new MyOdluxBundle(); + b.setLoader(loader); + b.setIndex(0); + b.setBundleName("abc"); + b.initialize(); + assertTrue(loader.getNumberOfBundles()==1); + assertNotNull(b.getLoader()); + assertEquals("abc",b.getBundleName()); + assertTrue(b.hasResource("test.js")); + assertNotNull(b.getResourceFileContent("test.js")); + b.clean(); + assertTrue(loader.getNumberOfBundles()==0); + } + +} diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src2/test/resources/test.js b/sdnr/wt/odlux/apps/performanceHistoryApp/src2/test/resources/test.js new file mode 100644 index 000000000..b47fdc39f --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src2/test/resources/test.js @@ -0,0 +1,5 @@ +asdac sad +as +d +sad + sadfa \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/tsconfig.json b/sdnr/wt/odlux/apps/performanceHistoryApp/tsconfig.json new file mode 100644 index 000000000..a66b5d828 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/tsconfig.json @@ -0,0 +1,37 @@ +{ + "compilerOptions": { + "baseUrl": "./src", + "outDir": "./dist", + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "allowSyntheticDefaultImports": false, + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "strictNullChecks": true, + "pretty": true, + "newLine": "LF", + "module": "es2015", + "target": "es2016", + "moduleResolution": "node", + "experimentalDecorators": true, + "jsx": "preserve", + "lib": [ + "dom", + "es2015", + "es2016" + ], + "types": [ + "prop-types", + "react", + "react-dom" + ] + }, + "exclude": [ + "dist", + "node_modules" + ] +} diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/webpack.config.js b/sdnr/wt/odlux/apps/performanceHistoryApp/webpack.config.js new file mode 100644 index 000000000..27a5949ac --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/webpack.config.js @@ -0,0 +1,139 @@ +/** + * Webpack 4 configuration file + * see https://webpack.js.org/configuration/ + * see https://webpack.js.org/configuration/dev-server/ + */ + +"use strict"; + +const path = require("path"); +const webpack = require("webpack"); +const CopyWebpackPlugin = require("copy-webpack-plugin"); +const TerserPlugin = require('terser-webpack-plugin'); + +// const __dirname = (path => path.replace(/^([a-z]\:)/, c => c.toUpperCase()))(process.__dirname()); + +module.exports = (env) => { + const distPath = path.resolve(__dirname, env === "release" ? "." : "../..", "dist"); + const frameworkPath = path.resolve(__dirname, env === "release" ? "../../framework" : "../..", "dist"); + return [{ + name: "App", + + mode: "none", //disable default behavior + + target: "web", + + context: path.resolve(__dirname, "src"), + + entry: { + performanceHistoryApp: ["./plugin.tsx"] + }, + + devtool: env === "release" ? false : "source-map", + + resolve: { + extensions: [".ts", ".tsx", ".js", ".jsx"] + }, + + output: { + path: distPath, + filename: "[name].js", + library: "[name]", + libraryTarget: "umd2", + chunkFilename: "[name].js" + }, + module: { + rules: [{ + test: /\.tsx?$/, + exclude: /node_modules/, + use: [{ + loader: "babel-loader" + }, { + loader: "ts-loader" + }] + }, { + test: /\.jsx?$/, + exclude: /node_modules/, + use: [{ + loader: "babel-loader" + }] + }] + }, + + optimization: { + noEmitOnErrors: true, + namedModules: env !== "release", + minimize: env === "release", + minimizer: env !== "release" ? [] : [new TerserPlugin({ + terserOptions: { + warnings: false, // false, true, "verbose" + compress: { + drop_console: true, + drop_debugger: true, + } + } + })], + }, + plugins: [ + new webpack.DllReferencePlugin({ + context: path.resolve(__dirname, "../../framework/src"), + manifest: require(path.resolve(frameworkPath, "vendor-manifest.json")), + sourceType: "umd2" + }), + new webpack.DllReferencePlugin({ + context: path.resolve(__dirname, "../../framework/src"), + manifest: require(path.resolve(frameworkPath, "app-manifest.json")), + sourceType: "umd2" + }), + ...(env === "release") ? [ + new webpack.DefinePlugin({ + "process.env": { + NODE_ENV: "'production'", + VERSION: JSON.stringify(require("./package.json").version) + } + }), + ] : [ + new webpack.DefinePlugin({ + "process.env": { + NODE_ENV: "'development'", + VERSION: JSON.stringify(require("./package.json").version) + } + }), + new CopyWebpackPlugin([{ + from: 'index.html', + to: distPath + }]), + ] + ], + + devServer: { + public: "http://localhost:3100", + contentBase: frameworkPath, + + compress: true, + headers: { + "Access-Control-Allow-Origin": "*" + }, + host: "0.0.0.0", + port: 3100, + disableHostCheck: true, + historyApiFallback: true, + inline: true, + hot: false, + quiet: false, + stats: { + colors: true + }, + proxy: { + "/restconf": { + target: "http://localhost:8181", + secure: false + }, + "/database": { + target: "http://localhost:8181", + secure: false + } + } + } + }]; +} -- cgit 1.2.3-korg