summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/apps/networkMapApp/src/actions
diff options
context:
space:
mode:
Diffstat (limited to 'sdnr/wt/odlux/apps/networkMapApp/src/actions')
-rw-r--r--sdnr/wt/odlux/apps/networkMapApp/src/actions/connectivityAction.ts63
-rw-r--r--sdnr/wt/odlux/apps/networkMapApp/src/actions/detailsAction.ts161
-rw-r--r--sdnr/wt/odlux/apps/networkMapApp/src/actions/mapActions.ts84
-rw-r--r--sdnr/wt/odlux/apps/networkMapApp/src/actions/popupActions.ts40
-rw-r--r--sdnr/wt/odlux/apps/networkMapApp/src/actions/searchAction.ts25
-rw-r--r--sdnr/wt/odlux/apps/networkMapApp/src/actions/settingsAction.ts85
6 files changed, 0 insertions, 458 deletions
diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/actions/connectivityAction.ts b/sdnr/wt/odlux/apps/networkMapApp/src/actions/connectivityAction.ts
deleted file mode 100644
index 63f52c8f9..000000000
--- a/sdnr/wt/odlux/apps/networkMapApp/src/actions/connectivityAction.ts
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt odlux
- * =================================================================================================
- * Copyright (C) 2020 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 { IApplicationStoreState } from "../../../../framework/src/store/applicationStore";
-
-
-export class IsTopologyServerReachableAction extends Action{
- constructor(public reachable: boolean){
- super();
- }
-}
-
-export class IsTileServerReachableAction extends Action{
- constructor(public reachable: boolean){
- super();
- }
-}
-
-export class IsBusycheckingConnectivityAction extends Action{
- constructor(public isBusy: boolean){
- super();
- }
-}
-
-export const verifyResponse = (response: Response) =>{
-
- if(response.ok){
- return response
- }else{
- throw Error(`Connection Error: ${response.status} | ${response.statusText} | ${response.url}`)
- }
-}
-
-export const handleConnectionError = (error: Error) => (dispatcher: Dispatch, getState: () => IApplicationStoreState)=>{
- const {network:{connectivity: {isToplogyServerAvailable}}} = getState();
- if(isToplogyServerAvailable){
- dispatcher(new IsTopologyServerReachableAction(false))
- }
-}
-
-export const setTileServerReachableAction = (isReachable: boolean) => (dispatcher: Dispatch, getState: () => IApplicationStoreState)=>{
- const {network:{connectivity: {isTileServerAvailable}}} = getState();
- if(isReachable !== isTileServerAvailable){
- dispatcher(new IsTileServerReachableAction(isReachable))
- }
-} \ No newline at end of file
diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/actions/detailsAction.ts b/sdnr/wt/odlux/apps/networkMapApp/src/actions/detailsAction.ts
deleted file mode 100644
index a9bea4fc2..000000000
--- a/sdnr/wt/odlux/apps/networkMapApp/src/actions/detailsAction.ts
+++ /dev/null
@@ -1,161 +0,0 @@
-/**
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt odlux
- * =================================================================================================
- * Copyright (C) 2020 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 { requestRest } from '../../../../framework/src/services/restService';
-
-
-import { Site, Device } from "../model/site";
-import { link } from '../model/link';
-import { HistoryEntry } from "../model/historyEntry";
-import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore';
-import { Dispatch } from '../../../../framework/src/flux/store';
-import { SITEDOC_URL } from '../config';
-
-export class SelectSiteAction extends Action {
- constructor(public site: Site){
- super()
- }
-}
-
-export class SelectLinkAction extends Action {
- constructor(public link: link){
- super();
- }
-}
-
-export class ClearDetailsAction extends Action{
- constructor(){
- super();
- }
-}
-
-export class AddToHistoryAction extends Action {
- constructor(public entry: HistoryEntry){
- super();
- }
-}
-
-export class ClearHistoryAction extends Action {
- constructor(){
- super();
- }
-}
-
-export class IsBusyCheckingDeviceListAction extends Action{
- constructor(public isBusy: boolean){
- super();
- }
-}
-
-export class FinishedLoadingDeviceListAction extends Action{
- constructor(public devices: Device[]){
- super();
- }
-}
-
-export class ClearLoadedDevicesAction extends Action{
- constructor(){
- super();
- }
-}
-
-export class InitializeLoadedDevicesAction extends Action{
- constructor(public devices: Device[]){
- super();
- }
-}
-
-export class IsSitedocReachableAction extends Action{
- constructor(public isReachable: boolean){
- super();
- }
-}
-
-let running=false;
-
-export const UpdateDetailsView = (nodeId: string) =>(dispatcher: Dispatch, getState: () => IApplicationStoreState) =>{
- const {network:{details:{checkedDevices}}} = getState();
- if(checkedDevices!==null){
- const index = checkedDevices.findIndex(item=>item.name===nodeId)
- if(index!==-1)
- requestRest<any>("/rests/operational/network-topology:network-topology/topology/topology-netconf/node/"+nodeId, { method: "GET" })
- .then(result =>{
- if(result!==null){
- checkedDevices[index].status = result.node[0]["netconf-node-topology:connection-status"];
-
- }else{
- checkedDevices[index].status = "Not connected";
- }
- dispatcher(new FinishedLoadingDeviceListAction(checkedDevices));
-
- });
- }
-}
-
-export const CheckDeviceList = (list: Device[]) => async (dispatcher: Dispatch, getState: () => IApplicationStoreState) =>{
-if(running) return;
-running=true;
- dispatcher(new IsBusyCheckingDeviceListAction(true));
-
- const promises = list.map((device)=>{
- if(device.name){
- return requestRest<any>("/rests/data/network-topology:network-topology/topology=topology-netconf/node="+device.name, { method: "GET" })
- }else{
- return device;
- }
-
- })
-
- Promise.all(promises).then((result)=>{
- running=false;
-
-
- result.forEach((res: any, index)=>{
- if(res !==null && res["network-topology:node"]){
- list[index].status = res["network-topology:node"][0]["netconf-node-topology:connection-status"];
- }else{
- list[index].status = "Not connected";
- }
- });
-
- dispatcher(new FinishedLoadingDeviceListAction(list));
- dispatcher(new IsBusyCheckingDeviceListAction(false));
-
- })
- .catch(err=>{
- console.error(err);
-
- dispatcher(new IsBusyCheckingDeviceListAction(false));
-
- });
-}
-
-export const checkSitedockReachablity = () => async (dispatcher: Dispatch, getState: () => IApplicationStoreState) =>{
- console.log("searching for sitedoc server...")
- requestRest<any>(SITEDOC_URL+'/app/versioninfo').then(response =>{
- console.log(response);
- if(response){
-
- dispatcher(new IsSitedocReachableAction(true));
-
- }else{
- dispatcher(new IsSitedocReachableAction(false));
- }
- })
-} \ No newline at end of file
diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/actions/mapActions.ts b/sdnr/wt/odlux/apps/networkMapApp/src/actions/mapActions.ts
deleted file mode 100644
index 9830c06e4..000000000
--- a/sdnr/wt/odlux/apps/networkMapApp/src/actions/mapActions.ts
+++ /dev/null
@@ -1,84 +0,0 @@
-/**
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt odlux
- * =================================================================================================
- * Copyright (C) 2020 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 { link } from "../model/link";
-import { Site } from "../model/site";
-import { Feature } from '../model/Feature';
-import { URL_API } from '../config';
-
-
-export class HighlightLinkAction extends Action{
- constructor(public link: link){
- super();
- }
-}
-
-export class HighlightSiteAction extends Action{
- constructor(public site: Site){
- super();
- }
-}
-
-export class RemoveHighlightingAction extends Action {
- constructor(){
- super();
- }
-}
-
-export class ZoomToSearchResultAction extends Action{
- constructor(public lat: number, public lon: number){
- super();
- }
-}
-
-export class AddAlarmAction extends Action{
- constructor(public site: Site){
- super();
- }
-}
-
-export class SetCoordinatesAction extends Action{
- constructor(public lat: number, public lon: number, public zoom: number){
- super();
- }
-}
-
-export class SetStatistics extends Action{
- constructor(public siteCount: string, public linkCount: string){
- super();
- }
-}
-
-export class SetIconSwitchAction extends Action{
- constructor(public enable:boolean){
- super();
- }
-}
-
-export const findSiteToAlarm = (alarmedNodeId: string) => (dispatcher: Dispatch) =>{
- //TODO: fix!
- fetch(URL_API+"/sites/devices/"+alarmedNodeId)
- .then(res => res.json())
- .then(result=>{
- dispatcher(new AddAlarmAction(result));
- });
-} \ No newline at end of file
diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/actions/popupActions.ts b/sdnr/wt/odlux/apps/networkMapApp/src/actions/popupActions.ts
deleted file mode 100644
index a8c54d4df..000000000
--- a/sdnr/wt/odlux/apps/networkMapApp/src/actions/popupActions.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt odlux
- * =================================================================================================
- * Copyright (C) 2020 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 { PopupElement } from '../model/popupElements';
-import { Action } from '../../../../framework/src/flux/action';
-
-export class SetPopupPositionAction extends Action {
- constructor(public top: number, public left: number){
- super()
- }
-}
-
-export class SelectMultipleLinksAction extends Action {
- constructor(public elements: PopupElement[]) {
- super();
- }
-}
-
-
-
-export class SelectMultipleSitesAction extends Action {
- constructor(public elements: PopupElement[]) {
- super();
- }
-} \ No newline at end of file
diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/actions/searchAction.ts b/sdnr/wt/odlux/apps/networkMapApp/src/actions/searchAction.ts
deleted file mode 100644
index a553319da..000000000
--- a/sdnr/wt/odlux/apps/networkMapApp/src/actions/searchAction.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt odlux
- * =================================================================================================
- * Copyright (C) 2020 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';
-
-export class SetSearchValueAction extends Action{
- constructor(public value: string){
- super();
- }
-}
diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/actions/settingsAction.ts b/sdnr/wt/odlux/apps/networkMapApp/src/actions/settingsAction.ts
deleted file mode 100644
index 5b8982368..000000000
--- a/sdnr/wt/odlux/apps/networkMapApp/src/actions/settingsAction.ts
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt odlux
- * =================================================================================================
- * Copyright (C) 2021 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 { NetworkMapSettings, NetworkMapThemes, NetworkSettings } from '../model/settings';
-import { Action } from '../../../../framework/src/flux/action';
-import { Dispatch } from '../../../../framework/src/flux/store';
-import { settingsService } from '../services/settingsService';
-
-export class SetMapSettingsAction extends Action{
-
- constructor(public settings:NetworkMapSettings) {
- super();
- }
-}
-
-export class SetThemeSettingsAction extends Action{
-
- constructor(public settings:NetworkMapThemes) {
- super();
- }
-}
-
-export class SetSettingsAction extends Action{
-
- constructor(public settings:NetworkSettings) {
- super();
- }
-}
-
-export class SetBusyLoadingAction extends Action{
-
- constructor(public busy: boolean) {
- super();
-
- }
-}
-
-
-export const getSettings = () => async (dispatcher: Dispatch) => {
- dispatcher(new SetBusyLoadingAction(true));
- console.log("getting settings in action..")
- settingsService.getMapSettings().then(result =>{
- if(result){
- if(result.networkMap && result.networkMapThemes){
- const mapSettings : NetworkSettings = { networkMap: result.networkMap, networkMapThemes: result.networkMapThemes}
- dispatcher(new SetSettingsAction(mapSettings));
- }else if(result.networkMap){
- dispatcher(new SetMapSettingsAction(result));
- }else if(result.networkMapThemes){
- dispatcher(new SetThemeSettingsAction(result));
- }
- }
- else{
- console.warn("settings couldn't be loaded.");
- }
- dispatcher(new SetBusyLoadingAction(false));
- });
-}
-
-export const updateSettings = (mapSettings: NetworkMapSettings) => async (dispatcher: Dispatch) =>{
-
- const result = await settingsService.updateMapSettings(mapSettings);
- console.log("update settings");
- dispatcher(new SetMapSettingsAction(mapSettings));
-
- console.log(result);
- if(result){
- }
-
-}