summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/apps/connectApp/src/actions
diff options
context:
space:
mode:
authorMichael Dürre <michael.duerre@highstreet-technologies.com>2022-09-08 09:45:06 +0200
committerMichael Dürre <michael.duerre@highstreet-technologies.com>2022-09-08 09:46:47 +0200
commita2b6dd34d73bf432846dc59c6f57dd59a03aff9b (patch)
tree35658e382769bc7575f87d0e9580d6ee98230eb2 /sdnr/wt/odlux/apps/connectApp/src/actions
parent6f9c3d2cea04a2af7a73d8df1de87d584b277552 (diff)
update odlux sources
update basic odlux functionality for kohn Issue-ID: CCSDK-3765 Signed-off-by: Michael Dürre <michael.duerre@highstreet-technologies.com> Change-Id: I3723c9c2f35b9012ba537920b294a54bb556cbc6 Signed-off-by: Michael Dürre <michael.duerre@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/odlux/apps/connectApp/src/actions')
-rw-r--r--sdnr/wt/odlux/apps/connectApp/src/actions/connectionStatusCountActions.ts55
-rw-r--r--sdnr/wt/odlux/apps/connectApp/src/actions/mountedNetworkElementsActions.ts4
-rw-r--r--sdnr/wt/odlux/apps/connectApp/src/actions/networkElementsActions.ts6
3 files changed, 5 insertions, 60 deletions
diff --git a/sdnr/wt/odlux/apps/connectApp/src/actions/connectionStatusCountActions.ts b/sdnr/wt/odlux/apps/connectApp/src/actions/connectionStatusCountActions.ts
deleted file mode 100644
index 43bae720c..000000000
--- a/sdnr/wt/odlux/apps/connectApp/src/actions/connectionStatusCountActions.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 { getConnectionStatusCountStateFromDatabase } from '../services/connectionStatusCountService';
-import { Dispatch } from '../../../../framework/src/flux/store';
-
-import { Action } from '../../../../framework/src/flux/action';
-
-
-export class ConnectionStatusCountBaseAction extends Action { }
-
-
-export class SetConnectionStatusCountAction extends ConnectionStatusCountBaseAction {
- constructor(public ConnectedCount: number, public ConnectingCount: number, public DisconnectedCount: number,
- public MountedCount: number, public UnableToConnectCount: number, public UndefinedCount: number, public UnmountedCount: number, public totalCount: number, public isLoadingConnectionStatusChart: boolean) {
- super();
- }
-}
-
-
-export const refreshConnectionStatusCountAsyncAction = async (dispatch: Dispatch) => {
- dispatch(new SetConnectionStatusCountAction(0, 0, 0, 0, 0, 0, 0, 0, true));
- const result = await getConnectionStatusCountStateFromDatabase().catch(_ => null);
- if (result) {
- const statusAction = new SetConnectionStatusCountAction(
- result["Connected"] || 0,
- result["Connecting"] || 0,
- result["Disconnected"] || 0,
- result["Mounted"] || 0,
- result["UnableToConnect"] || 0,
- result["Undefined"] || 0,
- result["Unmounted"] || 0,
- result["total"] || 0,
- false
- );
- dispatch(statusAction);
- return;
- } else {
- dispatch(new SetConnectionStatusCountAction(0, 0, 0, 0, 0, 0, 0, 0, false));
- }
-}
diff --git a/sdnr/wt/odlux/apps/connectApp/src/actions/mountedNetworkElementsActions.ts b/sdnr/wt/odlux/apps/connectApp/src/actions/mountedNetworkElementsActions.ts
index 84e73ae5a..26ee7674f 100644
--- a/sdnr/wt/odlux/apps/connectApp/src/actions/mountedNetworkElementsActions.ts
+++ b/sdnr/wt/odlux/apps/connectApp/src/actions/mountedNetworkElementsActions.ts
@@ -27,7 +27,7 @@ import { updateCurrentViewAsyncAction } from './commonNetworkElementsActions';
/** Represents the base action. */
export class BaseAction extends Action { }
-/** Represents an action crator for a async thunk action to mount a network element. */
+/** Represents an action creator for a async thunk action to mount a network element/node. */
export const mountNetworkElementAsyncActionCreator = (networkElement: NetworkElementConnection) => (dispatch: Dispatch) => {
return connectService.mountNetworkElement(networkElement).then((success) => {
if (success) {
@@ -42,7 +42,7 @@ export const mountNetworkElementAsyncActionCreator = (networkElement: NetworkEle
});
};
-/** Represents an action crator for a async thunk action to unmount a network element. */
+/** Represents an action creator for a async thunk action to unmount a network element/node. */
export const unmountNetworkElementAsyncActionCreator = (nodeId: string) => (dispatch: Dispatch) => {
return connectService.unmountNetworkElement(nodeId).then((success) => {
if (success) {
diff --git a/sdnr/wt/odlux/apps/connectApp/src/actions/networkElementsActions.ts b/sdnr/wt/odlux/apps/connectApp/src/actions/networkElementsActions.ts
index 041cff9da..57f036e56 100644
--- a/sdnr/wt/odlux/apps/connectApp/src/actions/networkElementsActions.ts
+++ b/sdnr/wt/odlux/apps/connectApp/src/actions/networkElementsActions.ts
@@ -28,14 +28,14 @@ import { unmountNetworkElementAsyncActionCreator } from './mountedNetworkElement
/** Represents the base action. */
export class BaseAction extends Action { }
-/** Represents an async thunk action creator to add an element to the network elements. */
+/** Represents an async thunk action creator to add an element to the network elements/nodes. */
export const addNewNetworkElementAsyncActionCreator = (element: NetworkElementConnection) => async (dispatch: Dispatch) => {
const res = await connectService.createNetworkElement({ ...element });
dispatch(updateCurrentViewAsyncAction());
dispatch(new AddSnackbarNotification({ message: `Successfully added [${element.nodeId}]`, options: { variant: 'success' } }));
};
-/** Represents an async thunk action creator to edit network element. */
+/** Represents an async thunk action creator to edit network element/node. */
export const editNetworkElementAsyncActionCreator = (element: UpdateNetworkElement) => async (dispatch: Dispatch) => {
const connectionStatus: ConnectionStatus[] = (await connectService.getNetworkElementConnectionStatus(element.id).then(ne => (ne))) || [];
const currentConnectionStatus = connectionStatus[0].status;
@@ -50,7 +50,7 @@ export const editNetworkElementAsyncActionCreator = (element: UpdateNetworkEleme
};
-/** Represents an async thunk action creator to delete an element from network elements. */
+/** Represents an async thunk action creator to delete an element from network elements/nodes. */
export const removeNetworkElementAsyncActionCreator = (element: UpdateNetworkElement) => async (dispatch: Dispatch) => {
const res = await connectService.deleteNetworkElement(element);
await dispatch(unmountNetworkElementAsyncActionCreator(element && element.id));