From da4fd6169717cfa04d644d0af0d23dd089a6e373 Mon Sep 17 00:00:00 2001 From: herbert Date: Sat, 14 Dec 2019 00:06:42 +0100 Subject: remove old version of devicemodel devicemanager oldux featureaggregator Issue-ID: SDNC-1004 Signed-off-by: herbert Change-Id: I5337643181e2398e5a8097e4ee14fa4ac96d0d4c --- sdnr/wt/odlux/apps/connectApp/.babelrc | 17 -- sdnr/wt/odlux/apps/connectApp/package.json | 40 ---- sdnr/wt/odlux/apps/connectApp/pom.xml | 161 -------------- .../src/actions/mountedNetworkElementsActions.ts | 122 ---------- .../src/actions/requiredNetworkElementsActions.ts | 55 ----- .../src/components/connectionStatusLog.tsx | 53 ----- .../src/components/editNetworkElementDialog.tsx | 246 --------------------- .../src/components/requiredNetworkElements.tsx | 210 ------------------ .../src/components/unknownNetworkElements.tsx | 211 ------------------ .../src/handlers/connectAppRootHandler.tsx | 42 ---- .../src/handlers/connectionStatusLogHandler.tsx | 51 ----- .../src/handlers/mountedNetworkElementsHandler.tsx | 111 ---------- .../handlers/requiredNetworkElementsHandler.tsx | 35 --- sdnr/wt/odlux/apps/connectApp/src/index.html | 26 --- .../connectApp/src/models/connectionStatusLog.ts | 27 --- .../src/models/mountedNetworkElements.ts | 28 --- .../connectApp/src/models/networkElementBase.ts | 22 -- .../src/models/requiredNetworkElements.ts | 27 --- .../apps/connectApp/src/models/topologyNetconf.ts | 53 ----- sdnr/wt/odlux/apps/connectApp/src/plugin.tsx | 69 ------ .../apps/connectApp/src/services/connectService.ts | 214 ------------------ .../apps/connectApp/src/views/connectView.tsx | 116 ---------- .../sdnr/wt/odlux/bundles/MyOdluxBundle.java | 68 ------ .../resources/OSGI-INF/blueprint/blueprint.xml | 9 - .../sdnr/wt/odlux/bundles/test/TestBundleRes.java | 45 ---- .../apps/connectApp/src2/test/resources/test.js | 5 - sdnr/wt/odlux/apps/connectApp/tsconfig.json | 37 ---- sdnr/wt/odlux/apps/connectApp/webpack.config.js | 139 ------------ 28 files changed, 2239 deletions(-) delete mode 100644 sdnr/wt/odlux/apps/connectApp/.babelrc delete mode 100644 sdnr/wt/odlux/apps/connectApp/package.json delete mode 100644 sdnr/wt/odlux/apps/connectApp/pom.xml delete mode 100644 sdnr/wt/odlux/apps/connectApp/src/actions/mountedNetworkElementsActions.ts delete mode 100644 sdnr/wt/odlux/apps/connectApp/src/actions/requiredNetworkElementsActions.ts delete mode 100644 sdnr/wt/odlux/apps/connectApp/src/components/connectionStatusLog.tsx delete mode 100644 sdnr/wt/odlux/apps/connectApp/src/components/editNetworkElementDialog.tsx delete mode 100644 sdnr/wt/odlux/apps/connectApp/src/components/requiredNetworkElements.tsx delete mode 100644 sdnr/wt/odlux/apps/connectApp/src/components/unknownNetworkElements.tsx delete mode 100644 sdnr/wt/odlux/apps/connectApp/src/handlers/connectAppRootHandler.tsx delete mode 100644 sdnr/wt/odlux/apps/connectApp/src/handlers/connectionStatusLogHandler.tsx delete mode 100644 sdnr/wt/odlux/apps/connectApp/src/handlers/mountedNetworkElementsHandler.tsx delete mode 100644 sdnr/wt/odlux/apps/connectApp/src/handlers/requiredNetworkElementsHandler.tsx delete mode 100644 sdnr/wt/odlux/apps/connectApp/src/index.html delete mode 100644 sdnr/wt/odlux/apps/connectApp/src/models/connectionStatusLog.ts delete mode 100644 sdnr/wt/odlux/apps/connectApp/src/models/mountedNetworkElements.ts delete mode 100644 sdnr/wt/odlux/apps/connectApp/src/models/networkElementBase.ts delete mode 100644 sdnr/wt/odlux/apps/connectApp/src/models/requiredNetworkElements.ts delete mode 100644 sdnr/wt/odlux/apps/connectApp/src/models/topologyNetconf.ts delete mode 100644 sdnr/wt/odlux/apps/connectApp/src/plugin.tsx delete mode 100644 sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts delete mode 100644 sdnr/wt/odlux/apps/connectApp/src/views/connectView.tsx delete mode 100644 sdnr/wt/odlux/apps/connectApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java delete mode 100644 sdnr/wt/odlux/apps/connectApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml delete mode 100644 sdnr/wt/odlux/apps/connectApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java delete mode 100644 sdnr/wt/odlux/apps/connectApp/src2/test/resources/test.js delete mode 100644 sdnr/wt/odlux/apps/connectApp/tsconfig.json delete mode 100644 sdnr/wt/odlux/apps/connectApp/webpack.config.js (limited to 'sdnr/wt/odlux/apps/connectApp') diff --git a/sdnr/wt/odlux/apps/connectApp/.babelrc b/sdnr/wt/odlux/apps/connectApp/.babelrc deleted file mode 100644 index 3d8cd1260..000000000 --- a/sdnr/wt/odlux/apps/connectApp/.babelrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/connectApp/package.json b/sdnr/wt/odlux/apps/connectApp/package.json deleted file mode 100644 index 269fa2a8c..000000000 --- a/sdnr/wt/odlux/apps/connectApp/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "@odlux/connect-app", - "version": "0.1.1", - "description": "A react based modular UI to display network connect 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": "Matthias Fischer", - "license": "Apache-2.0", - "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/connectApp/pom.xml b/sdnr/wt/odlux/apps/connectApp/pom.xml deleted file mode 100644 index d85feb127..000000000 --- a/sdnr/wt/odlux/apps/connectApp/pom.xml +++ /dev/null @@ -1,161 +0,0 @@ - - - 4.0.0 - - - org.onap.ccsdk.parent - odlparent - 1.5.1-SNAPSHOT - - - - org.onap.ccsdk.features.sdnr.wt - sdnr-wt-odlux-app-connectApp - 0.7.0-SNAPSHOT - bundle - - sdnr-wt-odlux-app-connectApp - - - 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 - - - - - - highstreet repo - https://cloud-highstreet-technologies.com/mvn/ - - true - always - - - - - - src2/main/java - - - dist - odlux - - - src2/main/resources - - - src2/test/resources - - - - - 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.* - - - - - - - diff --git a/sdnr/wt/odlux/apps/connectApp/src/actions/mountedNetworkElementsActions.ts b/sdnr/wt/odlux/apps/connectApp/src/actions/mountedNetworkElementsActions.ts deleted file mode 100644 index 12f7c8594..000000000 --- a/sdnr/wt/odlux/apps/connectApp/src/actions/mountedNetworkElementsActions.ts +++ /dev/null @@ -1,122 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * 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========================================================================== - */ -import { Action } from '../../../../framework/src/flux/action'; -import { Dispatch } from '../../../../framework/src/flux/store'; - -import { MountedNetworkElementType } from '../models/mountedNetworkElements'; -import { RequiredNetworkElementType } from '../models/requiredNetworkElements'; - -import { connectService } from '../services/connectService'; -import { AddSnackbarNotification } from '../../../../framework/src/actions/snackbarActions'; - -/** Represents the base action. */ -export class BaseAction extends Action { } - -/** Represents an action causing the store to load all mounted network elements. */ -export class LoadAllMountedNetworkElementsAction extends BaseAction { } - -/** Represents an action causing the store to update all mounted network elements. */ -export class AllMountedNetworkElementsLoadedAction extends BaseAction { - constructor(public mountedNetworkElements: MountedNetworkElementType[] | null, public error?: string) { - super(); - } -} - -/** Represents an action causing the store to update all mounted network elements. */ -export class AddOrUpdateMountedNetworkElement extends BaseAction { - constructor(public mountedNetworkElement: MountedNetworkElementType | null, public error?: string) { - super(); - } -} - -export class RemoveMountedNetworkElement extends BaseAction { - constructor(public mountId: string) { - super(); - } -} - -export class UpdateConnectionStateMountedNetworkElement extends BaseAction { - constructor(public mountId: string, connectionState: string) { - super(); - } -} - - -export class UpdateRequiredMountedNetworkElement extends BaseAction { - constructor(public mountId: string, public required: boolean) { - super(); - } -} - -/** - * Represents an action crator for a async thunk action to add an allready mounted element to the state of this app. - * Note: Use this action to add created object notified by the websocket. -*/ -export const addMountedNetworkElementAsyncActionCreator = (mountId: string) => async (dispatch: Dispatch) => { - return connectService.getMountedNetworkElementByMountId(mountId).then(mountedNetworkElement => { - mountedNetworkElement && dispatch(new AddOrUpdateMountedNetworkElement(mountedNetworkElement)); - }).catch(error => { - dispatch(new AddOrUpdateMountedNetworkElement(null, error)); - }); -}; - -export const updateMountedNetworkElementAsyncActionCreator = (mountId: string) => async (dispatch: Dispatch) => { - return connectService.getMountedNetworkElementByMountId(mountId).then(mountedNetworkElement => { - if (mountedNetworkElement) { - dispatch(new AddOrUpdateMountedNetworkElement(mountedNetworkElement)); - } else { - dispatch(new RemoveMountedNetworkElement(mountId)); - } - }).catch(error => { - dispatch(new AddOrUpdateMountedNetworkElement(null, error)); - }); -}; - -/** Represents an async thunk action to load all mounted network elements. */ -export const loadAllMountedNetworkElementsAsync = (dispatch: Dispatch) => { - dispatch(new LoadAllMountedNetworkElementsAction()); - return connectService.getMountedNetworkElementsList().then(mountedNetworkElements => { - mountedNetworkElements && dispatch(new AllMountedNetworkElementsLoadedAction(mountedNetworkElements)); - }).catch(error => { - dispatch(new AllMountedNetworkElementsLoadedAction(null, error)); - }); -}; - -/** Represents an action crator for a async thunk action to mount a network element. */ -export const mountNetworkElementAsyncActionCreator = (networkElement: RequiredNetworkElementType) => (dispatch: Dispatch) => { - return connectService.mountNetworkElement(networkElement).then((success) => { - success && ( - dispatch(addMountedNetworkElementAsyncActionCreator(networkElement.mountId)) && - dispatch(new AddSnackbarNotification({ message: `Requesting mount [${networkElement.mountId}]`, options: { variant: 'info' } })) - ) || dispatch(new AddSnackbarNotification({ message: `Failed to mount [${ networkElement.mountId }]`, options: { variant: 'warning' } })); - }).catch(error => { - dispatch(new AddOrUpdateMountedNetworkElement(null, error)); - }); -}; - -/** Represents an action crator for a async thunk action to unmount a network element. */ -export const unmountNetworkElementAsyncActionCreator = (mountId: string) => (dispatch: Dispatch) => { - return connectService.unmountNetworkElement(mountId).then((success) => { - success && dispatch(new AddSnackbarNotification({ message: `Requesting unmount [${ mountId }]`, options: { variant: 'info' } })) - || dispatch(new AddSnackbarNotification({ message: `Failed to unmount [${ mountId }]`, options: { variant: 'warning' } })); - }).catch(error => { - dispatch(new AddOrUpdateMountedNetworkElement(null, error)); - }); -}; - - diff --git a/sdnr/wt/odlux/apps/connectApp/src/actions/requiredNetworkElementsActions.ts b/sdnr/wt/odlux/apps/connectApp/src/actions/requiredNetworkElementsActions.ts deleted file mode 100644 index 0e55cadf4..000000000 --- a/sdnr/wt/odlux/apps/connectApp/src/actions/requiredNetworkElementsActions.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * 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========================================================================== - */ -import { Action } from '../../../../framework/src/flux/action'; -import { Dispatch } from '../../../../framework/src/flux/store'; -import { RequiredNetworkElementType } from '../models/requiredNetworkElements'; -import { requiredNetworkElementsReloadAction } from '../handlers/requiredNetworkElementsHandler'; -import { UpdateRequiredMountedNetworkElement } from '../actions/mountedNetworkElementsActions'; - -import { AddSnackbarNotification } from '../../../../framework/src/actions/snackbarActions'; - -import { connectService } from '../services/connectService'; - -/** Represents the base action. */ -export class BaseAction extends Action { } - - -/** Represents an async thunk action creator to add an element to the required network elements. */ -export const addToRequiredNetworkElementsAsyncActionCreator = (element: RequiredNetworkElementType) => (dispatch: Dispatch) => { - connectService.insertRequiredNetworkElement(element).then(_ => { - window.setTimeout(() => { - dispatch(requiredNetworkElementsReloadAction); - dispatch(new UpdateRequiredMountedNetworkElement(element.mountId, true)); - dispatch(new AddSnackbarNotification({ message: `Successfully added [${ element.mountId }]`, options: { variant: 'success' } })); - }, 900); - }); -}; - -/** Represents an async thunk action creator to delete an element from the required network elements. */ -export const removeFromRequiredNetworkElementsAsyncActionCreator = (element: RequiredNetworkElementType) => (dispatch: Dispatch) => { - connectService.deleteRequiredNetworkElement(element).then(_ => { - window.setTimeout(() => { - dispatch(requiredNetworkElementsReloadAction); - dispatch(new UpdateRequiredMountedNetworkElement(element.mountId, false)); - dispatch(new AddSnackbarNotification({ message: `Successfully removed [${ element.mountId }]`, options: { variant: 'success' } })); - }, 900); - }); -}; - - - diff --git a/sdnr/wt/odlux/apps/connectApp/src/components/connectionStatusLog.tsx b/sdnr/wt/odlux/apps/connectApp/src/components/connectionStatusLog.tsx deleted file mode 100644 index 3cc104836..000000000 --- a/sdnr/wt/odlux/apps/connectApp/src/components/connectionStatusLog.tsx +++ /dev/null @@ -1,53 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * 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========================================================================== - */ -import * as React from 'react'; -import connect, { IDispatcher, Connect } from '../../../../framework/src/flux/connect'; -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; -import { MaterialTable, ColumnType, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; - -import { createConnectionStatusLogActions, createConnectionStatusLogProperties } from '../handlers/connectionStatusLogHandler'; -import { ConnectionStatusLogType } from '../models/connectionStatusLog'; - -const mapProps = (state: IApplicationStoreState) => ({ - connectionStatusLogProperties: createConnectionStatusLogProperties(state), -}); - -const mapDispatch = (dispatcher: IDispatcher) => ({ - connectionStatusLogActions: createConnectionStatusLogActions(dispatcher.dispatch), -}); - -const ConnectionStatusTable = MaterialTable as MaterialTableCtorType; - -type ConnectionStatusLogComponentProps = Connect; - -class ConnectionStatusLogComponent extends React.Component { - render(): JSX.Element { - return ( - - - ); - }; - -} - -export const ConnectionStatusLog = connect(mapProps, mapDispatch)(ConnectionStatusLogComponent); -export default ConnectionStatusLog; \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/connectApp/src/components/editNetworkElementDialog.tsx b/sdnr/wt/odlux/apps/connectApp/src/components/editNetworkElementDialog.tsx deleted file mode 100644 index 32b23a41e..000000000 --- a/sdnr/wt/odlux/apps/connectApp/src/components/editNetworkElementDialog.tsx +++ /dev/null @@ -1,246 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * 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========================================================================== - */ -import * as React from 'react'; - -import Button from '@material-ui/core/Button'; -import TextField from '@material-ui/core/TextField'; -import Dialog from '@material-ui/core/Dialog'; -import DialogActions from '@material-ui/core/DialogActions'; -import DialogContent from '@material-ui/core/DialogContent'; -import DialogContentText from '@material-ui/core/DialogContentText'; -import DialogTitle from '@material-ui/core/DialogTitle'; - -import { IDispatcher, connect, Connect } from '../../../../framework/src/flux/connect'; - -import { - addToRequiredNetworkElementsAsyncActionCreator, - removeFromRequiredNetworkElementsAsyncActionCreator -} from '../actions/requiredNetworkElementsActions'; - -import { unmountNetworkElementAsyncActionCreator, mountNetworkElementAsyncActionCreator } from '../actions/mountedNetworkElementsActions'; -import { RequiredNetworkElementType } from '../models/requiredNetworkElements'; - -export enum EditNetworkElementDialogMode { - None = "none", - UnknownNetworkElementToRequiredNetworkElements = "unknownNetworkElementToRequiredNetworkElements", - RequiredNetworkElementToUnknownNetworkElements = "requiredNetworkElementToUnknownNetworkElements", - MountNetworkElementToRequiredNetworkElements = "mountNetworkElementToRequiredNetworkElements", - MountNetworkElementToUnknonwNetworkElements = "mountNetworkElementToRequiredUnknownElements", - MountNetworkElement = "mountNetworkElement", - UnmountNetworkElement = "unmountNetworkElement", -} - -const mapDispatch = (dispatcher: IDispatcher) => ({ - addToRequiredNetworkElements: (element: RequiredNetworkElementType) => { - dispatcher.dispatch(addToRequiredNetworkElementsAsyncActionCreator(element)); - }, - removeFromRequiredNetworkElements: (element: RequiredNetworkElementType) => { - dispatcher.dispatch(removeFromRequiredNetworkElementsAsyncActionCreator(element)); - }, - mountNetworkElement: (element: RequiredNetworkElementType) => { - dispatcher.dispatch(mountNetworkElementAsyncActionCreator(element)); - }, - mountAndRquireNetworkElement: (element: RequiredNetworkElementType) => { - dispatcher.dispatch(addToRequiredNetworkElementsAsyncActionCreator(element)); - dispatcher.dispatch(mountNetworkElementAsyncActionCreator(element)); - }, - unmountNetworkElement: (element: RequiredNetworkElementType) => { - dispatcher.dispatch(unmountNetworkElementAsyncActionCreator(element && element.mountId)); - } -} -); - -type DialogSettings = { - dialogTitle: string, - dialogDescription: string, - applyButtonText: string, - cancelButtonText: string, - enableMountIdEditor: boolean, - enableUsernameEditor: boolean, - enableExtendedEditor: boolean, -} - -const settings: { [key: string]: DialogSettings } = { - [EditNetworkElementDialogMode.None]: { - dialogTitle: "", - dialogDescription: "", - applyButtonText: "", - cancelButtonText: "", - enableMountIdEditor: false, - enableUsernameEditor: false, - enableExtendedEditor: false, - }, - [EditNetworkElementDialogMode.UnknownNetworkElementToRequiredNetworkElements] : { - dialogTitle: "Add to required network elements" , - dialogDescription: "Create a new NetworkElement in planning database as clone of existing real NetworkElement." , - applyButtonText: "Add to required network elements" , - cancelButtonText: "Cancel", - enableMountIdEditor: false, - enableUsernameEditor: true, - enableExtendedEditor: false, - }, - [EditNetworkElementDialogMode.RequiredNetworkElementToUnknownNetworkElements]: { - dialogTitle: "Remove from required network elements", - dialogDescription: "Do you really want to remove the required element:", - applyButtonText: "Remove network element", - cancelButtonText: "Cancel", - enableMountIdEditor: false, - enableUsernameEditor: false, - enableExtendedEditor: false, - }, - [EditNetworkElementDialogMode.MountNetworkElementToUnknonwNetworkElements]: { - dialogTitle: "Mount to unknown network elements", - dialogDescription: "Mount this network element:", - applyButtonText: "Mount network element", - cancelButtonText: "Cancel", - enableMountIdEditor: true, - enableUsernameEditor: true, - enableExtendedEditor: true, - }, - [EditNetworkElementDialogMode.MountNetworkElementToRequiredNetworkElements]: { - dialogTitle: "Mount to required network elements", - dialogDescription: "Mount this network element:", - applyButtonText: "Mount network element", - cancelButtonText: "Cancel", - enableMountIdEditor: true, - enableUsernameEditor: true, - enableExtendedEditor: true, - }, - [EditNetworkElementDialogMode.MountNetworkElement]: { - dialogTitle: "Mount network element", - dialogDescription: "mount this network element:", - applyButtonText: "mount network element", - cancelButtonText: "Cancel", - enableMountIdEditor: false, - enableUsernameEditor: false, - enableExtendedEditor: false, - }, - [EditNetworkElementDialogMode.UnmountNetworkElement]: { - dialogTitle: "Unmount network element", - dialogDescription: "unmount this network element:", - applyButtonText: "Unmount network element", - cancelButtonText: "Cancel", - enableMountIdEditor: false, - enableUsernameEditor: false, - enableExtendedEditor: false, - }, -} - -type EditNetworkElementDialogComponentProps = Connect & { - mode: EditNetworkElementDialogMode; - initialNetworkElement: RequiredNetworkElementType; - onClose: () => void; -}; - -type EditNetworkElementDialogComponentState = RequiredNetworkElementType & { - required: boolean; -}; - -class EditNetworkElementDialogComponent extends React.Component { - constructor(props: EditNetworkElementDialogComponentProps) { - super(props); - - this.state = { - mountId: this.props.initialNetworkElement.mountId, - host: this.props.initialNetworkElement.host, - port: this.props.initialNetworkElement.port, - password: this.props.initialNetworkElement.password, - username: this.props.initialNetworkElement.username, - required: false - }; - } - - render(): JSX.Element { - const setting = settings[this.props.mode]; - return ( - - { setting.dialogTitle } - - - { setting.dialogDescription } - - { this.setState({mountId: event.target.value}); } } /> - { this.setState({host: event.target.value}); } }/> - { this.setState({port: +event.target.value}); } }/> - { setting.enableUsernameEditor && { this.setState({ username: event.target.value }); } } /> || null } - { setting.enableUsernameEditor && { this.setState({ password: event.target.value }); } } /> || null } - - - - - - - ) - } - - private onApply = (element: RequiredNetworkElementType) => { - this.props.onClose && this.props.onClose(); - switch (this.props.mode) { - case EditNetworkElementDialogMode.UnknownNetworkElementToRequiredNetworkElements: - element && this.props.addToRequiredNetworkElements(element); - break; - case EditNetworkElementDialogMode.RequiredNetworkElementToUnknownNetworkElements: - element && this.props.removeFromRequiredNetworkElements(element); - break; - case EditNetworkElementDialogMode.MountNetworkElementToUnknonwNetworkElements: - element && this.props.mountNetworkElement(element); - break; - case EditNetworkElementDialogMode.MountNetworkElementToRequiredNetworkElements: - element && this.props.mountAndRquireNetworkElement(element); - break; - case EditNetworkElementDialogMode.MountNetworkElement: - element && this.props.mountNetworkElement(element); - break; - case EditNetworkElementDialogMode.UnmountNetworkElement: - element && this.props.unmountNetworkElement(element); - break; - } - }; - - private onCancel = () => { - this.props.onClose && this.props.onClose(); - } - - static getDerivedStateFromProps(props: EditNetworkElementDialogComponentProps, state: EditNetworkElementDialogComponentState & { _initialNetworkElement: RequiredNetworkElementType }): EditNetworkElementDialogComponentState & { _initialNetworkElement: RequiredNetworkElementType } { - if (props.initialNetworkElement !== state._initialNetworkElement) { - state = { - ...state, - ...props.initialNetworkElement, - _initialNetworkElement: props.initialNetworkElement, - }; - } - return state; - } -} - -export const EditNetworkElementDialog = connect(undefined, mapDispatch)(EditNetworkElementDialogComponent); -export default EditNetworkElementDialog; \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/connectApp/src/components/requiredNetworkElements.tsx b/sdnr/wt/odlux/apps/connectApp/src/components/requiredNetworkElements.tsx deleted file mode 100644 index 2fb7594aa..000000000 --- a/sdnr/wt/odlux/apps/connectApp/src/components/requiredNetworkElements.tsx +++ /dev/null @@ -1,210 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * 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========================================================================== - */ -import * as React from 'react'; -import { Theme, createStyles, withStyles, WithStyles } from '@material-ui/core/styles'; - -import AddIcon from '@material-ui/icons/Add'; -import LinkIcon from '@material-ui/icons/Link'; -import LinkOffIcon from '@material-ui/icons/LinkOff'; -import RemoveIcon from '@material-ui/icons/RemoveCircleOutline'; - -import Button from '@material-ui/core/Button'; -import IconButton from '@material-ui/core/IconButton'; - -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 { NavigateToApplication } from '../../../../framework/src/actions/navigationActions'; - -import { RequiredNetworkElementType } from '../models/requiredNetworkElements'; -import { createRequiredNetworkElementsActions, createRequiredNetworkElementsProperties } from '../handlers/requiredNetworkElementsHandler'; - -import EditNetworkElementDialog, { EditNetworkElementDialogMode } from './editNetworkElementDialog'; -import { Tooltip } from '@material-ui/core'; -import { NetworkElementBaseType } from 'models/networkElementBase'; - -const styles = (theme: Theme) => createStyles({ - connectionStatusConnected: { - color: 'darkgreen', - }, - connectionStatusConnecting: { - color: 'blue', - }, - connectionStatusDisconnected: { - color: 'red', - }, - button: { - margin: 0, - padding: "6px 6px", - minWidth: 'unset' - }, - spacer: { - marginLeft: theme.spacing.unit, - marginRight: theme.spacing.unit, - display: "inline" - } -}); - -const mapProps = (state: IApplicationStoreState) => ({ - requiredNetworkElementsProperties: createRequiredNetworkElementsProperties(state), - mountedNetworkElements: state.connect.mountedNetworkElements -}); - -const mapDispatch = (dispatcher: IDispatcher) => ({ - requiredNetworkElementsActions: createRequiredNetworkElementsActions(dispatcher.dispatch), - navigateToApplication: (applicationName: string, path?: string) => dispatcher.dispatch(new NavigateToApplication(applicationName, path)), -}); - -type RequiredNetworkElementsListComponentProps = WithStyles & Connect; -type RequiredNetworkElementsListComponentState = { - networkElementToEdit: RequiredNetworkElementType, - networkElementEditorMode: EditNetworkElementDialogMode -} - -const emptyRequireNetworkElement = { mountId: '', host: '', port: 0 }; - -const RequiredNetworkElementTable = MaterialTable as MaterialTableCtorType; - -export class RequiredNetworkElementsListComponent extends React.Component { - - constructor(props: RequiredNetworkElementsListComponentProps) { - super(props); - - this.state = { - networkElementToEdit: emptyRequireNetworkElement, - networkElementEditorMode: EditNetworkElementDialogMode.None - }; - } - - // private navigationCreator - - render(): JSX.Element { - const { classes } = this.props; - const { networkElementToEdit } = this.state; - const addRequireNetworkElementAction = { - icon: AddIcon, tooltip: 'Add', onClick: () => { - this.setState({ - networkElementEditorMode: EditNetworkElementDialogMode.MountNetworkElementToRequiredNetworkElements, - networkElementToEdit: emptyRequireNetworkElement, - }); - } - }; - return ( - <> - { - const unknownNetworkElement = this.props.mountedNetworkElements.elements.find(el => el.mountId === rowData.mountId); - const connectionStatus = unknownNetworkElement && unknownNetworkElement.connectionStatus || 'disconnected'; - const cssClasses = connectionStatus === "connected" - ? classes.connectionStatusConnected - : connectionStatus === "disconnected" - ? classes.connectionStatusDisconnected - : classes.connectionStatusConnecting - return
{ connectionStatus }
- - } - }, - { property: "host", title: "Host", type: ColumnType.text }, - { property: "port", title: "Port", type: ColumnType.text }, - // { property: "username", title: "Username", type: ColumnType.text }, - // { property: "password", title: "Password", type: ColumnType.text }, - { - property: "actions", title: "Actions", type: ColumnType.custom, customControl: ({ rowData }) => { - const unknownNetworkElement = this.props.mountedNetworkElements.elements.find(el => el.mountId === rowData.mountId); - const connectionStatus = unknownNetworkElement && unknownNetworkElement.connectionStatus || 'disconnected'; - return ( - <> -
- this.onOpenMountdNetworkElementsDialog(event, rowData) }> - this.onOpenUnmountdNetworkElementsDialog(event, rowData) }> - this.onOpenRemoveRequiredNetworkElementDialog(event, rowData) } > -
-
- -
-
- - - - - -
- - ) - } - }, - ] } idProperty="mountId" { ...this.props.requiredNetworkElementsActions } { ...this.props.requiredNetworkElementsProperties } asynchronus > -
- - - ); - }; - - public componentDidMount() { - this.props.requiredNetworkElementsActions.onRefresh(); - } - - private onOpenRemoveRequiredNetworkElementDialog = (event: React.MouseEvent, element: RequiredNetworkElementType) => { - this.setState({ - networkElementToEdit: element, - networkElementEditorMode: EditNetworkElementDialogMode.RequiredNetworkElementToUnknownNetworkElements - }); - event.preventDefault(); - event.stopPropagation(); - } - - private onOpenUnmountdNetworkElementsDialog = (event: React.MouseEvent, element: RequiredNetworkElementType) => { - this.setState({ - networkElementToEdit: element, - networkElementEditorMode: EditNetworkElementDialogMode.UnmountNetworkElement - }); - event.preventDefault(); - event.stopPropagation(); - } - - private onOpenMountdNetworkElementsDialog = (event: React.MouseEvent, element: RequiredNetworkElementType) => { - this.setState({ - networkElementToEdit: element, - networkElementEditorMode: EditNetworkElementDialogMode.MountNetworkElement - }); - event.preventDefault(); - event.stopPropagation(); - } - - private onCloseEditNetworkElementDialog = () => { - this.setState({ - networkElementEditorMode: EditNetworkElementDialogMode.None, - networkElementToEdit: emptyRequireNetworkElement, - }); - } - - private navigateToApplicationHandlerCreator = (applicationName: string, element: NetworkElementBaseType) => (event: React.MouseEvent) => { - this.props.navigateToApplication(applicationName, element.mountId); - event.preventDefault(); - event.stopPropagation(); - } -} - -export const RequiredNetworkElementsList = withStyles(styles)(connect(mapProps, mapDispatch)(RequiredNetworkElementsListComponent)); -export default RequiredNetworkElementsList; \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/connectApp/src/components/unknownNetworkElements.tsx b/sdnr/wt/odlux/apps/connectApp/src/components/unknownNetworkElements.tsx deleted file mode 100644 index 62b969575..000000000 --- a/sdnr/wt/odlux/apps/connectApp/src/components/unknownNetworkElements.tsx +++ /dev/null @@ -1,211 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * 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========================================================================== - */ -import * as React from 'react'; -import { Theme, createStyles, WithStyles, withStyles, Tooltip } from '@material-ui/core'; - -import AddIcon from '@material-ui/icons/Add'; -import LinkOffIcon from '@material-ui/icons/LinkOff'; -import AddCircleIcon from '@material-ui/icons/AddCircleOutline'; - -import Button from '@material-ui/core/Button'; -import IconButton from '@material-ui/core/IconButton'; - -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; -import { MaterialTable, ColumnType, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; -import { Connect, connect, IDispatcher } from '../../../../framework/src/flux/connect'; -import { NavigateToApplication } from '../../../../framework/src/actions/navigationActions'; - -import { RequiredNetworkElementType } from '../models/requiredNetworkElements'; -import { IMountedNetworkElementsState } from '../handlers/mountedNetworkElementsHandler'; -import EditNetworkElementDialog, { EditNetworkElementDialogMode } from './editNetworkElementDialog'; -import { NetworkElementBaseType } from 'models/networkElementBase'; - - -const styles = (theme: Theme) => createStyles({ - button: { - margin: 0, - padding: "6px 6px", - minWidth: 'unset' - }, - spacer: { - marginLeft: theme.spacing.unit, - marginRight: theme.spacing.unit, - display: "inline" - } -}); - -const mapProps = ({ connect: state }: IApplicationStoreState) => ({ - mountedNetworkElements: state.mountedNetworkElements -}); - -const mapDispatch = (dispatcher: IDispatcher) => ({ - navigateToApplication: (applicationName: string, path?: string) => dispatcher.dispatch(new NavigateToApplication(applicationName, path)), -}); -type UnknownNetworkElementDisplayType = NetworkElementBaseType & { - connectionStatus: string, - coreModelRev: string, - airInterfaceRev: string -} - -type UnknownNetworkElementsListProps = WithStyles & Connect & {} - -type UnknownNetworkElementsListState = { - - unknownNetworkElements: UnknownNetworkElementDisplayType[]; - - networkElementToEdit: RequiredNetworkElementType; - networkElementEditorMode: EditNetworkElementDialogMode; -} - - -const emptyRequireNetworkElement = { mountId: '', host: '', port: 0 }; -const UnknownNetworkElementTable = MaterialTable as MaterialTableCtorType; -export class UnknownNetworkElementsListComponent extends React.Component { - - constructor(props: UnknownNetworkElementsListProps) { - super(props); - - this.state = { - unknownNetworkElements: [], - networkElementToEdit: emptyRequireNetworkElement, - networkElementEditorMode: EditNetworkElementDialogMode.None, - }; - } - - static getDerivedStateFromProps(props: UnknownNetworkElementsListProps, state: UnknownNetworkElementsListState & { _mountedNetworkElements: IMountedNetworkElementsState }) { - if (props.mountedNetworkElements != state._mountedNetworkElements) { - state.unknownNetworkElements = props.mountedNetworkElements.elements.filter(element => !element.required).map(element => { - - // handle onfCoreModelRevision - const onfCoreModelRevision = element.capabilities.find((cap) => { - return cap.module === 'core-model' || cap.module === 'CoreModel-CoreNetworkModule-ObjectClasses' ; - }); - const onfAirInterfaceRevision = element.capabilities.find((cap) => { - return cap.module === 'microwave-model' || cap.module === 'MicrowaveModel-ObjectClasses-AirInterface' ; - }); - return { - mountId: element.mountId, - host: element.host, - port: element.port, - connectionStatus: element.connectionStatus, - coreModelRev: onfCoreModelRevision && onfCoreModelRevision.revision || 'unknown', - airInterfaceRev: onfAirInterfaceRevision && onfAirInterfaceRevision.revision || 'unknown' - } - } - ); - } - return state; - } - - render(): JSX.Element { - const { classes } = this.props; - const { networkElementToEdit, networkElementEditorMode, unknownNetworkElements } = this.state; - const addRequireNetworkElementAction = { - icon: AddIcon, tooltip: 'Add', onClick: () => { - this.setState({ - networkElementEditorMode: EditNetworkElementDialogMode.MountNetworkElementToUnknonwNetworkElements, - networkElementToEdit: emptyRequireNetworkElement, - }); - } - }; - return ( - <> - ( - <> -
- this.onOpenUnmountdNetworkElementsDialog(event, rowData) } > - this.onOpenAddToRequiredNetworkElementsDialog(event, rowData) } > -
-
- -
-
- - - - - -
- - ) - }, - ] } idProperty="mountId" > -
- - - - ); - }; - - private onOpenAddToRequiredNetworkElementsDialog = (event: React.MouseEvent, element: UnknownNetworkElementDisplayType) => { - this.setState({ - networkElementToEdit: { - mountId: element.mountId, - host: element.host, - port: element.port, - username: 'admin', - password: 'admin', - }, - networkElementEditorMode: EditNetworkElementDialogMode.UnknownNetworkElementToRequiredNetworkElements - }); - event.preventDefault(); - event.stopPropagation(); - } - - private onOpenUnmountdNetworkElementsDialog = (event: React.MouseEvent, element: UnknownNetworkElementDisplayType) => { - this.setState({ - networkElementToEdit: { - mountId: element.mountId, - host: element.host, - port: element.port - }, - networkElementEditorMode: EditNetworkElementDialogMode.UnmountNetworkElement - }); - event.preventDefault(); - event.stopPropagation(); - } - - private onCloseEditNetworkElementDialog = () => { - this.setState({ - networkElementEditorMode: EditNetworkElementDialogMode.None, - networkElementToEdit: emptyRequireNetworkElement, - }); - } - - private navigateToApplicationHandlerCreator = (applicationName: string, element: NetworkElementBaseType) => (event: React.MouseEvent) => { - this.props.navigateToApplication(applicationName, element.mountId); - event.preventDefault(); - event.stopPropagation(); - } - -} - -export const UnknownNetworkElementsList = withStyles(styles)(connect(mapProps, mapDispatch)(UnknownNetworkElementsListComponent)); -export default UnknownNetworkElementsList; diff --git a/sdnr/wt/odlux/apps/connectApp/src/handlers/connectAppRootHandler.tsx b/sdnr/wt/odlux/apps/connectApp/src/handlers/connectAppRootHandler.tsx deleted file mode 100644 index 1c27f4b32..000000000 --- a/sdnr/wt/odlux/apps/connectApp/src/handlers/connectAppRootHandler.tsx +++ /dev/null @@ -1,42 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * 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========================================================================== - */ -import { combineActionHandler } from '../../../../framework/src/flux/middleware'; -import { IRequiredNetworkElementsState, requiredNetworkElementsActionHandler } from './requiredNetworkElementsHandler'; -import { IMountedNetworkElementsState, mountedNetworkElementsActionHandler } from './mountedNetworkElementsHandler'; -import { IConnectionStatusLogState, connectionStatusLogActionHandler } from './connectionStatusLogHandler'; - -export interface IConnectAppStoreState { - requiredNetworkElements: IRequiredNetworkElementsState; - mountedNetworkElements: IMountedNetworkElementsState; - connectionStatusLog: IConnectionStatusLogState; -} - -declare module '../../../../framework/src/store/applicationStore' { - interface IApplicationStoreState { - connect: IConnectAppStoreState - } -} - -const actionHandlers = { - requiredNetworkElements: requiredNetworkElementsActionHandler, - mountedNetworkElements: mountedNetworkElementsActionHandler, - connectionStatusLog: connectionStatusLogActionHandler -}; - -export const connectAppRootHandler = combineActionHandler (actionHandlers); -export default connectAppRootHandler; diff --git a/sdnr/wt/odlux/apps/connectApp/src/handlers/connectionStatusLogHandler.tsx b/sdnr/wt/odlux/apps/connectApp/src/handlers/connectionStatusLogHandler.tsx deleted file mode 100644 index 57e1930ed..000000000 --- a/sdnr/wt/odlux/apps/connectApp/src/handlers/connectionStatusLogHandler.tsx +++ /dev/null @@ -1,51 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * 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========================================================================== - */ -import { createExternal,IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; -import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; - -import { ConnectionStatusLogType } from '../models/connectionStatusLog'; -export interface IConnectionStatusLogState extends IExternalTableState { } - -// create eleactic search material data fetch handler -const connectionStatusLogSearchHandler = createSearchDataHandler<{ event: ConnectionStatusLogType }, ConnectionStatusLogType>('sdnevents_v1/eventlog', null, - (event) => ({ - _id: event._id, - timeStamp: event._source.event.timeStamp, - objectId: event._source.event.objectId, - type: event._source.event.type, - elementStatus: event._source.event.type === 'ObjectCreationNotificationXml' - ? 'mounted' - : event._source.event.type === 'ObjectDeletionNotificationXml' - ? 'unmounted' - : event._source.event.type === 'AttributeValueChangedNotificationXml' - ? event._source.event.newValue - : 'unknown', - newValue: '' - - }), - (name) => `event.${ name }`); - -export const { - actionHandler: connectionStatusLogActionHandler, - createActions: createConnectionStatusLogActions, - createProperties: createConnectionStatusLogProperties, - reloadAction: connectionStatusLogReloadAction, - - // set value action, to change a value -} = createExternal(connectionStatusLogSearchHandler, appState => appState.connect.connectionStatusLog); - diff --git a/sdnr/wt/odlux/apps/connectApp/src/handlers/mountedNetworkElementsHandler.tsx b/sdnr/wt/odlux/apps/connectApp/src/handlers/mountedNetworkElementsHandler.tsx deleted file mode 100644 index 089268946..000000000 --- a/sdnr/wt/odlux/apps/connectApp/src/handlers/mountedNetworkElementsHandler.tsx +++ /dev/null @@ -1,111 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * 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========================================================================== - */ -import { IActionHandler } from '../../../../framework/src/flux/action'; - -import { - AddOrUpdateMountedNetworkElement, - AllMountedNetworkElementsLoadedAction, - LoadAllMountedNetworkElementsAction, - RemoveMountedNetworkElement, - UpdateConnectionStateMountedNetworkElement, - UpdateRequiredMountedNetworkElement -} from '../actions/mountedNetworkElementsActions'; - -import { MountedNetworkElementType } from '../models/mountedNetworkElements'; - -export interface IMountedNetworkElementsState { - elements: MountedNetworkElementType[]; - busy: boolean; -} - -const mountedNetworkElementsStateInit: IMountedNetworkElementsState = { - elements: [], - busy: false -}; - -export const mountedNetworkElementsActionHandler: IActionHandler = (state = mountedNetworkElementsStateInit, action) => { - if (action instanceof LoadAllMountedNetworkElementsAction) { - - state = { - ...state, - busy: true - }; - - } else if (action instanceof AllMountedNetworkElementsLoadedAction) { - if (!action.error && action.mountedNetworkElements) { - state = { - ...state, - elements: action.mountedNetworkElements, - busy: false - }; - } else { - state = { - ...state, - busy: false - }; - } - } else if (action instanceof AddOrUpdateMountedNetworkElement) { - if (!action.mountedNetworkElement) return state; // should handle error here - const index = state.elements.findIndex(el => el.mountId === (action.mountedNetworkElement && action.mountedNetworkElement.mountId)); - if (index > -1) { - state = { - ...state, - elements: [ - ...state.elements.slice(0, index), - action.mountedNetworkElement, - ...state.elements.slice(index + 1) - ] - } - } else { - state = { - ...state, - elements: [...state.elements, action.mountedNetworkElement], - } - }; - } else if (action instanceof RemoveMountedNetworkElement) { - state = { - ...state, - elements: state.elements.filter(e => e.mountId !== action.mountId), - }; - } else if (action instanceof UpdateConnectionStateMountedNetworkElement) { - const index = state.elements.findIndex(el => el.mountId === action.mountId); - if (index > -1) { - state = { - ...state, - elements: [ - ...state.elements.slice(0, index), - { ...state.elements[index], connectionStatus: action.mountId }, - ...state.elements.slice(index + 1) - ] - } - } - } else if (action instanceof UpdateRequiredMountedNetworkElement) { - const index = state.elements.findIndex(el => el.mountId === action.mountId); - if (index > -1 && (state.elements[index].required !== action.required)) { - state = { - ...state, - elements: [ - ...state.elements.slice(0, index), - { ...state.elements[index], required: action.required }, - ...state.elements.slice(index + 1) - ] - } - } - }; - return state; -}; \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/connectApp/src/handlers/requiredNetworkElementsHandler.tsx b/sdnr/wt/odlux/apps/connectApp/src/handlers/requiredNetworkElementsHandler.tsx deleted file mode 100644 index 10b3b1b07..000000000 --- a/sdnr/wt/odlux/apps/connectApp/src/handlers/requiredNetworkElementsHandler.tsx +++ /dev/null @@ -1,35 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * 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========================================================================== - */ -import { createExternal,IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; -import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; - -import { RequiredNetworkElementType } from '../models/requiredNetworkElements'; -export interface IRequiredNetworkElementsState extends IExternalTableState { } - -// create eleactic search material data fetch handler -const requiredNetworkElementsSearchHandler = createSearchDataHandler('mwtn/required-networkelement'); - -export const { - actionHandler: requiredNetworkElementsActionHandler, - createActions: createRequiredNetworkElementsActions, - createProperties: createRequiredNetworkElementsProperties, - reloadAction: requiredNetworkElementsReloadAction, - - // set value action, to change a value -} = createExternal(requiredNetworkElementsSearchHandler, appState => appState.connect.requiredNetworkElements); - diff --git a/sdnr/wt/odlux/apps/connectApp/src/index.html b/sdnr/wt/odlux/apps/connectApp/src/index.html deleted file mode 100644 index 0f95005de..000000000 --- a/sdnr/wt/odlux/apps/connectApp/src/index.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - connectApp - - - -
- - - - - - \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/connectApp/src/models/connectionStatusLog.ts b/sdnr/wt/odlux/apps/connectApp/src/models/connectionStatusLog.ts deleted file mode 100644 index df43c217a..000000000 --- a/sdnr/wt/odlux/apps/connectApp/src/models/connectionStatusLog.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * 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========================================================================== - */ - -export type ConnectionStatusLogType = { - _id: string; - elementStatus: string; - timeStamp: string; - objectId: string; - type: string; - newValue: string; -} - diff --git a/sdnr/wt/odlux/apps/connectApp/src/models/mountedNetworkElements.ts b/sdnr/wt/odlux/apps/connectApp/src/models/mountedNetworkElements.ts deleted file mode 100644 index 0be38a615..000000000 --- a/sdnr/wt/odlux/apps/connectApp/src/models/mountedNetworkElements.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * 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========================================================================== - */ -import { NetworkElementBaseType } from "./networkElementBase"; - -/** -* Represents data of an mounted network elements. -*/ -export type MountedNetworkElementType = NetworkElementBaseType & { - connectionStatus: string; - required: boolean; - capabilities: { module: string, revision: string }[]; -}; - diff --git a/sdnr/wt/odlux/apps/connectApp/src/models/networkElementBase.ts b/sdnr/wt/odlux/apps/connectApp/src/models/networkElementBase.ts deleted file mode 100644 index 39278a8e1..000000000 --- a/sdnr/wt/odlux/apps/connectApp/src/models/networkElementBase.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * 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========================================================================== - */ -export type NetworkElementBaseType = { - mountId: string, - host: string, - port: number, -} \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/connectApp/src/models/requiredNetworkElements.ts b/sdnr/wt/odlux/apps/connectApp/src/models/requiredNetworkElements.ts deleted file mode 100644 index 42d22afc0..000000000 --- a/sdnr/wt/odlux/apps/connectApp/src/models/requiredNetworkElements.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * 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========================================================================== - */ -import { NetworkElementBaseType } from "./networkElementBase"; - -/** -* Represents data of Required Network Elements. -*/ -export type RequiredNetworkElementType = NetworkElementBaseType & { - username?: string; - password?: string; -} - diff --git a/sdnr/wt/odlux/apps/connectApp/src/models/topologyNetconf.ts b/sdnr/wt/odlux/apps/connectApp/src/models/topologyNetconf.ts deleted file mode 100644 index 357245d46..000000000 --- a/sdnr/wt/odlux/apps/connectApp/src/models/topologyNetconf.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * 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========================================================================== - */ -export interface UnavailableCapability { - capability: string; - "failure-reason": string; -} - -export interface NetconfNodeTopologyUnavailableCapabilities { - "unavailable-capability": UnavailableCapability[]; -} - -export interface AvailableCapability { - "capability-origin": string; - capability: string; -} - -export interface NetconfNodeTopologyAvailableCapabilities { - "available-capability": AvailableCapability[]; -} - -export interface NetconfNodeTopologyClusteredConnectionStatus { - "netconf-master-node": string -} - -export interface TopologyNode { - "node-id": string; - "netconf-node-topology:clustered-connection-status": NetconfNodeTopologyClusteredConnectionStatus; - "netconf-node-topology:unavailable-capabilities": NetconfNodeTopologyUnavailableCapabilities; - "netconf-node-topology:available-capabilities": NetconfNodeTopologyAvailableCapabilities; - "netconf-node-topology:host": string; - "netconf-node-topology:connection-status": string; - "netconf-node-topology:port": number; -} - -export interface Topology { - "topology-id": string; - node: TopologyNode[]; -} diff --git a/sdnr/wt/odlux/apps/connectApp/src/plugin.tsx b/sdnr/wt/odlux/apps/connectApp/src/plugin.tsx deleted file mode 100644 index aa08e7b15..000000000 --- a/sdnr/wt/odlux/apps/connectApp/src/plugin.tsx +++ /dev/null @@ -1,69 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * 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========================================================================== - */ - -import { faPlug } from '@fortawesome/free-solid-svg-icons'; - -import applicationManager from '../../../framework/src/services/applicationManager'; -import { subscribe, IFormatedMessage } from '../../../framework/src/services/notificationService'; - -import connectAppRootHandler from './handlers/connectAppRootHandler'; -import ConnectApplication from './views/connectView'; - -import { - addMountedNetworkElementAsyncActionCreator, - updateMountedNetworkElementAsyncActionCreator, - loadAllMountedNetworkElementsAsync -} from './actions/mountedNetworkElementsActions'; - -import { AddSnackbarNotification } from '../../../framework/src/actions/snackbarActions'; - -type ObjectNotification = { - counter: string; - nodeName: string; - objectId: string; - timeStamp: string; -} - -export function register() { - const applicationApi = applicationManager.registerApplication({ - name: "connect", - icon: faPlug, - rootComponent: ConnectApplication, - rootActionHandler: connectAppRootHandler, - menuEntry: "Connect" - }); - - const updateAllMountedNetworkElements = () => { - applicationApi.applicationStoreInitialized.then(applicationStore => { applicationStore.dispatch(loadAllMountedNetworkElementsAsync); }) - }; - - applicationApi.loginEvent.addHandler(updateAllMountedNetworkElements); - updateAllMountedNetworkElements(); - - // subscribe to the websocket notifications - subscribe(["ObjectCreationNotification", "ObjectDeletionNotification", "AttributeValueChangedNotification"], (msg => { - const store = 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" || msg.notifType === "AttributeValueChangedNotification") && store) { - store.dispatch(new AddSnackbarNotification({ message: `Updating network element [${msg.objectId}]`, options: { variant: 'info' } })); - store.dispatch(updateMountedNetworkElementAsyncActionCreator(msg.objectId)); - } - })); -} \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts b/sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts deleted file mode 100644 index b50a06ee1..000000000 --- a/sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts +++ /dev/null @@ -1,214 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * 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========================================================================== - */ -import { RequiredNetworkElementType } from '../models/requiredNetworkElements'; -import { MountedNetworkElementType } from '../models/mountedNetworkElements'; -import { Topology, TopologyNode } from '../models/topologyNetconf'; - -import { requestRest } from '../../../../framework/src/services/restService'; -import { Result, HitEntry } from '../../../../framework/src/models/elasticSearch'; - - -/** - * Represents a web api accessor service for all Network Elements actions. - */ -class ConnectService { - /** - * Gets all known required network elements from the backend. - */ - public async getAllRequiredNetworkElements(): Promise<(RequiredNetworkElementType & { _id: string })[] | null> { - const path = 'database/mwtn/required-networkelement/_search'; - const query = { "query": { "match_all": {} } }; - - const result = await requestRest>(path, { method: "POST", body: JSON.stringify(query) }); - return result && result.hits && result.hits.hits && result.hits.hits.map(ne => ({ - _id: ne._id, - mountId: ne._source && ne._source.mountId, - host: ne._source && ne._source.host, - port: ne._source && ne._source.port, - username: ne._source && ne._source.username, - password: ne._source && ne._source.password, - })) || null; - } - - public async getRequiredNetworkElementByMountId(mountId:string): Promise<(RequiredNetworkElementType & { _id: string }) | null> { - const path = `database/mwtn/required-networkelement/${mountId}`; - - const result = await requestRest & { found: boolean }>(path, { method: "GET" }); - return result && result.found && result._source && { - _id: result._id, - mountId: result._source.mountId, - host: result._source.host, - port: result._source.port, - username: result._source.username, - password: result._source.password, - } || null; - } - - /** - * Inserts data into the required network elements table. - */ - public async insertRequiredNetworkElement(element: RequiredNetworkElementType): Promise { - const path = `database/mwtn/required-networkelement/${ element.mountId }`; - const result = await requestRest(path, { method: "POST", body: JSON.stringify(element) }); - return result || null; - } - - /** - * Deletes data from the Required Network Elements backend. - */ - public async deleteRequiredNetworkElement(element: RequiredNetworkElementType): Promise { - const path = `database/mwtn/required-networkelement/${ element.mountId }`; - const result = await requestRest(path, { method: "DELETE", body: JSON.stringify(element) }); - return result || null; - } - - private static mapTopologyNode = (mountPoint: TopologyNode, required: boolean ) => { - // handle onfCapabilities - let onfCapabilities: { module: string, revision: string }[] | undefined = undefined; - - const capId = 'netconf-node-topology:available-capabilities'; - if (mountPoint[capId] && mountPoint[capId]['available-capability']) { - onfCapabilities = mountPoint[capId]['available-capability'].filter((cap) => { - return cap.capability.includes('?revision='); - }).map((cap) => { - return { - module: cap.capability.split(')')[1], - revision: cap.capability.split('?revision=')[1].substring(0, 10) - }; - }).sort((a, b) => { - if (a.module < b.module) return -1; - if (a.module > b.module) return 1; - return 0; - }); - } - - // handle clustered-connection-status - const statusId = 'netconf-node-topology:clustered-connection-status'; - let client = 'localhost'; - - if (mountPoint[statusId] && mountPoint[statusId]['netconf-master-node']) { - let node = mountPoint[statusId]['netconf-master-node']; - node = node.substring(node.indexOf('@')); - client = node.substring(1, node.indexOf(':')); - } - const mountId = mountPoint["node-id"]; - return { - mountId: mountId, - host: mountPoint["netconf-node-topology:host"], - port: mountPoint["netconf-node-topology:port"], - connectionStatus: mountPoint['netconf-node-topology:connection-status'], - capabilities: onfCapabilities || [], - required: required, - client - } - } - - /** Get all mounted network elements and fills the property required according to the database contents. */ - public async getMountedNetworkElementsList(): Promise { - const path = 'restconf/operational/network-topology:network-topology/topology/topology-netconf'; - - const topologyRequestPomise = requestRest<{ topology: Topology[] | null }>(path, { method: "GET" }); - const requiredNetworkElementsPromise = this.getAllRequiredNetworkElements(); - - const [netconfResponse, requiredNetworkElements] = await Promise.all([topologyRequestPomise, requiredNetworkElementsPromise]); - - // process topologyNetconf (get all known network elements) - const topologyNetconf = netconfResponse && netconfResponse.topology && netconfResponse.topology.find(topology => topology["topology-id"] === 'topology-netconf'); - let mountPoints = topologyNetconf && topologyNetconf.node && topologyNetconf.node.filter( - mountPoint => mountPoint['node-id'] !== 'controller-config').map(mountedElement => { - const required = requiredNetworkElements && requiredNetworkElements.some( - requiredElement => requiredElement.mountId === mountedElement["node-id"]); - return ConnectService.mapTopologyNode(mountedElement, !!required); - }); - - return mountPoints || []; - } - - /** Get one mounted network element. */ - public async getMountedNetworkElementByMountId(mountId: string): Promise { - const path = 'restconf/operational/network-topology:network-topology/topology/topology-netconf/node/' + mountId; - const getMountedNetworkElementByMountIdPromise = requestRest<{ node: TopologyNode[] | null }>(path, { method: "GET" }); - const getRequiredNetworkElementByMountIdPromise = this.getRequiredNetworkElementByMountId(mountId); - - const [mountedNetworkElement, requiredNetworkElement] = await Promise.all([getMountedNetworkElementByMountIdPromise, getRequiredNetworkElementByMountIdPromise]); - return mountedNetworkElement && mountedNetworkElement.node && ConnectService.mapTopologyNode(mountedNetworkElement.node[0], requiredNetworkElement && requiredNetworkElement.mountId === mountedNetworkElement.node[0]["node-id"] || false) || null; - } - - /** Mounts an required network element. */ - public async mountNetworkElement(networkElement: RequiredNetworkElementType): Promise { - const path = 'restconf/config/network-topology:network-topology/topology/topology-netconf/node/' + networkElement.mountId; - const mountXml = [ - '', - `${ networkElement.mountId }`, - `${ networkElement.host }`, - `${ networkElement.port }`, - `${ networkElement.username }`, - `${ networkElement.password }`, - ' false', - - ' ', - ' false', - ' 20000', - ' 100', - ' 2000', - ' 1.5', - - ' ', - ' 120', - ''].join(''); - - try { - const result = await requestRest(path, { - method: 'PUT', - headers: { - 'Content-Type': 'application/xml', - 'Accept': 'application/xml' - }, - body: mountXml - }); - // expect an empty answer - return result !== null; - } catch { - return false; - } - }; - - /** Unmounts a network element by its id. */ - public async unmountNetworkElement(mountId: string): Promise { - const path = 'restconf/config/network-topology:network-topology/topology/topology-netconf/node/' + mountId; - - try { - const result = await requestRest(path, { - method: 'DELETE', - headers: { - 'Content-Type': 'application/xml', - 'Accept': 'application/xml' - }, - }); - // expect an empty answer - return result !== null; - - } catch { - return false; - } - }; - - -} -export const connectService = new ConnectService(); -export default connectService; diff --git a/sdnr/wt/odlux/apps/connectApp/src/views/connectView.tsx b/sdnr/wt/odlux/apps/connectApp/src/views/connectView.tsx deleted file mode 100644 index c86b384e1..000000000 --- a/sdnr/wt/odlux/apps/connectApp/src/views/connectView.tsx +++ /dev/null @@ -1,116 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * 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========================================================================== - */ -import * as React from 'react'; - -import connect, { IDispatcher, Connect } from '../../../../framework/src/flux/connect'; -import { Panel } from '../../../../framework/src/components/material-ui'; - -import { requiredNetworkElementsReloadAction, createRequiredNetworkElementsActions } from '../handlers/requiredNetworkElementsHandler'; -import { loadAllMountedNetworkElementsAsync } from '../actions/mountedNetworkElementsActions'; -import { connectionStatusLogReloadAction, createConnectionStatusLogActions } from '../handlers/connectionStatusLogHandler'; - -import { RequiredNetworkElementsList } from '../components/requiredNetworkElements'; -import { ConnectionStatusLog } from '../components/connectionStatusLog'; -import { UnknownNetworkElementsList } from '../components/unknownNetworkElements'; - -const mapDispatcher = (dispatcher: IDispatcher) => ({ - requiredNetworkElementsActions: createRequiredNetworkElementsActions(dispatcher.dispatch), - connectionStatusLogActions: createConnectionStatusLogActions(dispatcher.dispatch), - onLoadUnknownNetworkElements: () => { - dispatcher.dispatch(loadAllMountedNetworkElementsAsync); - }, - onLoadRequiredNetworkElements: () => { - dispatcher.dispatch(requiredNetworkElementsReloadAction); - }, - onLoadConnectionStatusLog: () => { - dispatcher.dispatch(connectionStatusLogReloadAction); - } -}); - -type PanelId = null | "RequiredNetworkElements" | "UnknownNetworkElements" | "ConnectionStatusLog"; - -type ConnectApplicationComponentProps = Connect ; - -type ConnectApplicationComponentState = { - activePanel: PanelId; -}; - -class ConnectApplicationComponent extends React.Component{ - /** - * Initialises this instance - */ - constructor(props: ConnectApplicationComponentProps) { - super(props); - - this.state = { - activePanel: null - }; - } - - private onTogglePanel = (panelId: PanelId) => { - const nextActivePanel = panelId === this.state.activePanel ? null : panelId; - this.setState({ - activePanel: nextActivePanel - }, () => { - switch (nextActivePanel) { - case 'RequiredNetworkElements': - this.props.onLoadRequiredNetworkElements(); - break; - case 'UnknownNetworkElements': - // todo: should we update the application state ? - break; - case 'ConnectionStatusLog': - this.props.onLoadConnectionStatusLog(); - break; - case null: - // do nothing if all panels are closed - break; - default: - console.warn("Unknown nextActivePanel [" + nextActivePanel + "] in connectView"); - break; - } - }); - }; - - render(): JSX.Element { - const { activePanel } = this.state; - - return ( - <> - - - - - - - - - - - ); - }; - public componentDidMount() { - this.onTogglePanel("RequiredNetworkElements"); - this.props.onLoadUnknownNetworkElements(); - this.props.requiredNetworkElementsActions.onToggleFilter(); - this.props.connectionStatusLogActions.onToggleFilter(); - } -} - -export const ConnectApplication = (connect(undefined, mapDispatcher)(ConnectApplicationComponent)); -export default ConnectApplication; \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/connectApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java b/sdnr/wt/odlux/apps/connectApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java deleted file mode 100644 index 1e882fc69..000000000 --- a/sdnr/wt/odlux/apps/connectApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * ============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/connectApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml b/sdnr/wt/odlux/apps/connectApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml deleted file mode 100644 index adc9b777b..000000000 --- a/sdnr/wt/odlux/apps/connectApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/connectApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java b/sdnr/wt/odlux/apps/connectApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java deleted file mode 100644 index edf68e096..000000000 --- a/sdnr/wt/odlux/apps/connectApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * ============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/connectApp/src2/test/resources/test.js b/sdnr/wt/odlux/apps/connectApp/src2/test/resources/test.js deleted file mode 100644 index b47fdc39f..000000000 --- a/sdnr/wt/odlux/apps/connectApp/src2/test/resources/test.js +++ /dev/null @@ -1,5 +0,0 @@ -asdac sad -as -d -sad - sadfa \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/connectApp/tsconfig.json b/sdnr/wt/odlux/apps/connectApp/tsconfig.json deleted file mode 100644 index a66b5d828..000000000 --- a/sdnr/wt/odlux/apps/connectApp/tsconfig.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "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/connectApp/webpack.config.js b/sdnr/wt/odlux/apps/connectApp/webpack.config.js deleted file mode 100644 index a70e62976..000000000 --- a/sdnr/wt/odlux/apps/connectApp/webpack.config.js +++ /dev/null @@ -1,139 +0,0 @@ -/** - * 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: { - connectApp: ["./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