<opendaylight.root>opt/opendaylight</opendaylight.root>
<docker.push.phase>deploy</docker.push.phase>
<docker.verbose>true</docker.verbose>
-
</properties>
+
+ <distributionManagement>
+ <repository>
+ <id>o-ran-sc-releases</id>
+ <url>${o-ran-sc.nexus.release-url}</url>
+ </repository>
+ <snapshotRepository>
+ <id>o-ran-sc-snapshots</id>
+ <url>${o-ran-sc.nexus.snapshot-url}</url>
+ </snapshotRepository>
+ </distributionManagement>
+
<dependencies>
<dependency>
<groupId>${ccsdk.feature.groupid}</groupId>
<name>SDNR ODLUX :: ${project.artifactId}</name>
+ <distributionManagement>
+ <repository>
+ <id>o-ran-sc-releases</id>
+ <url>https://nexus.o-ran-sc.org/content/repositories/releases</url>
+ </repository>
+ <snapshotRepository>
+ <id>o-ran-sc-snapshots</id>
+ <url>https://nexus.o-ran-sc.org/content/repositories/snapshots</url>
+ </snapshotRepository>
+ </distributionManagement>
+
<modules>
<module>provider</module>
</modules>
<junit.version>4.13.2</junit.version>
</properties>
+ <distributionManagement>
+ <repository>
+ <id>o-ran-sc-releases</id>
+ <url>https://nexus.o-ran-sc.org/content/repositories/releases</url>
+ </repository>
+ <snapshotRepository>
+ <id>o-ran-sc-snapshots</id>
+ <url>https://nexus.o-ran-sc.org/content/repositories/snapshots</url>
+ </snapshotRepository>
+ </distributionManagement>
+
<dependencies>
<dependency>
<groupId>jakarta.servlet</groupId>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.o-ran-sc.oam-controller.parent</groupId>
+ <artifactId>oparent</artifactId>
+ <version>3.0.2-SNAPSHOT</version>
+ </parent>
+
<groupId>org.o-ran-sc.oam-controller.features.sdnr.odlux</groupId>
<artifactId>sdnr-odlux-app-apiDemo</artifactId>
<version>1.7.0-SNAPSHOT</version>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.o-ran-sc.oam-controller.parent</groupId>
+ <artifactId>oparent</artifactId>
+ <version>3.0.2-SNAPSHOT</version>
+ </parent>
+
<groupId>org.o-ran-sc.oam-controller.features.sdnr.odlux</groupId>
<artifactId>sdnr-odlux-apps-installer</artifactId>
<version>1.7.0-SNAPSHOT</version>
<artifactId>sdnr-odlux-app-configurationApp</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>sdnr-odlux-app-networkMapApp</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>sdnr-odlux-app-microwaveApp</artifactId>
- <version>${project.version}</version>
- </dependency>
- <!--<dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>sdnr-odlux-app-lineOfSightApp</artifactId>
- <version>${project.version}</version>
- </dependency> -->
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>sdnr-odlux-app-siteManagerApp</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>sdnr-odlux-app-unmFaultManagementApp</artifactId>
- <version>${project.version}</version>
- </dependency>
</dependencies>
<build>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.o-ran-sc.oam-controller.parent</groupId>
+ <artifactId>oparent</artifactId>
+ <version>3.0.2-SNAPSHOT</version>
+ </parent>
+
<groupId>org.o-ran-sc.oam-controller.features.sdnr.odlux</groupId>
<artifactId>sdnr-odlux-app-configurationApp</artifactId>
<version>1.7.0-SNAPSHOT</version>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.o-ran-sc.oam-controller.parent</groupId>
+ <artifactId>oparent</artifactId>
+ <version>3.0.2-SNAPSHOT</version>
+ </parent>
+
<groupId>org.o-ran-sc.oam-controller.features.sdnr.odlux</groupId>
<artifactId>sdnr-odlux-app-connectApp</artifactId>
<version>1.7.0-SNAPSHOT</version>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.o-ran-sc.oam-controller.parent</groupId>
+ <artifactId>oparent</artifactId>
+ <version>3.0.2-SNAPSHOT</version>
+ </parent>
+
<groupId>org.o-ran-sc.oam-controller.features.sdnr.odlux</groupId>
<artifactId>sdnr-odlux-app-demoApp</artifactId>
<version>1.7.0-SNAPSHOT</version>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.o-ran-sc.oam-controller.parent</groupId>
+ <artifactId>oparent</artifactId>
+ <version>3.0.2-SNAPSHOT</version>
+ </parent>
+
<groupId>org.o-ran-sc.oam-controller.features.sdnr.odlux</groupId>
<artifactId>sdnr-odlux-app-eventLogApp</artifactId>
<version>1.7.0-SNAPSHOT</version>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.o-ran-sc.oam-controller.parent</groupId>
+ <artifactId>oparent</artifactId>
+ <version>3.0.2-SNAPSHOT</version>
+ </parent>
+
<groupId>org.o-ran-sc.oam-controller.features.sdnr.odlux</groupId>
<artifactId>sdnr-odlux-app-faultApp</artifactId>
<version>1.7.0-SNAPSHOT</version>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.o-ran-sc.oam-controller.parent</groupId>
+ <artifactId>oparent</artifactId>
+ <version>3.0.2-SNAPSHOT</version>
+ </parent>
+
<groupId>org.o-ran-sc.oam-controller.features.sdnr.odlux</groupId>
<artifactId>sdnr-odlux-app-helpApp</artifactId>
<version>1.7.0-SNAPSHOT</version>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.o-ran-sc.oam-controller.parent</groupId>
+ <artifactId>oparent</artifactId>
+ <version>3.0.2-SNAPSHOT</version>
+ </parent>
+
<groupId>org.o-ran-sc.oam-controller.features.sdnr.odlux</groupId>
<artifactId>sdnr-odlux-app-inventoryApp</artifactId>
<version>1.7.0-SNAPSHOT</version>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.o-ran-sc.oam-controller.parent</groupId>
+ <artifactId>oparent</artifactId>
+ <version>3.0.2-SNAPSHOT</version>
+ </parent>
+
<groupId>org.o-ran-sc.oam-controller.features.sdnr.odlux</groupId>
<artifactId>sdnr-odlux-app-maintenanceApp</artifactId>
<version>1.7.0-SNAPSHOT</version>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.o-ran-sc.oam-controller.parent</groupId>
+ <artifactId>oparent</artifactId>
+ <version>3.0.2-SNAPSHOT</version>
+ </parent>
+
<groupId>org.o-ran-sc.oam-controller.features.sdnr.odlux</groupId>
<artifactId>sdnr-odlux-app-mediatorApp</artifactId>
<version>1.7.0-SNAPSHOT</version>
+++ /dev/null
-{
- "presets": [
- ["@babel/preset-react"],
- ["@babel/preset-env", {
- "targets": {
- "chrome": "66"
- },
- "spec": true,
- "loose": false,
- "modules": false,
- "debug": false,
- "useBuiltIns": "usage",
- "forceAllTransforms": true
- }]
- ],
- "plugins": []
-}
+++ /dev/null
-{
- "name": "@odlux/microwave-app",
- "version": "0.1.0",
- "description": "A react based modular UI to do link analysis.",
- "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": "Mohammad Boroon",
- "license": "Apache-2.0",
- "dependencies": {
- "@fortawesome/free-solid-svg-icons": "5.6.3",
- "@fortawesome/react-fontawesome": "0.1.14",
- "@emotion/react": "^11.7.0",
- "@emotion/styled": "^11.6.0",
- "@mui/icons-material": "^5.2.0",
- "@mui/material": "^5.2.2",
- "@mui/styles": "^5.2.2",
- "@odlux/framework": "*",
- "@types/d3": "^6.7.0",
- "@types/node": "^12.0.0",
- "d3": "^7.0.0",
- "d3-polygon": "^3.0.1",
- "maplibre-gl": "^3.0.0",
- "object.values": "^1.1.1"
- },
- "peerDependencies": {
- "@types/classnames": "2.2.6",
- "@types/flux": "3.1.8",
- "@types/jquery": "3.3.10",
- "@types/react": "17.0.37",
- "@types/react-dom": "17.0.11",
- "@types/react-router-dom": "5.1.7",
- "jquery": "3.3.1",
- "react": "17.0.2",
- "react-dom": "17.0.2",
- "react-router-dom": "5.2.0"
- },
- "devDependencies": {
- "css-loader": "1.0.0",
- "webpack": "^4.44.2"
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ ============LICENSE_START=======================================================
- ~ ONAP : SDNR ODLUX
- ~ ================================================================================
- ~ Copyright (C) 2020 AT&T 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=======================================================
- ~
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.o-ran-sc.oam-controller.features.sdnr.odlux</groupId>
- <artifactId>sdnr-odlux-app-microwaveApp</artifactId>
- <version>1.7.0-SNAPSHOT</version>
- <packaging>jar</packaging>
-
- <name>SDNR ODLUX :: ${project.artifactId}</name>
- <licenses>
- <license>
- <name>Apache License, Version 2.0</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0</url>
- </license>
- </licenses>
-
- <properties>
- <maven.javadoc.skip>true</maven.javadoc.skip>
- </properties>
-
- <build>
- <resources>
- <resource>
- <directory>dist</directory>
- <targetPath>odlux</targetPath>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <artifactId>maven-clean-plugin</artifactId>
- <configuration>
- <filesets>
- <fileset>
- <directory>dist</directory>
- <followSymlinks>false</followSymlinks>
- </fileset>
- <fileset>
- <directory>node</directory>
- <followSymlinks>false</followSymlinks>
- </fileset>
- <fileset>
- <directory>node_modules</directory>
- <followSymlinks>false</followSymlinks>
- </fileset>
- <fileset>
- <directory>../node_modules</directory>
- <followSymlinks>false</followSymlinks>
- </fileset>
- <!-- eclipse bug build bin folder in basedir -->
- <fileset>
- <directory>bin</directory>
- <followSymlinks>false</followSymlinks>
- </fileset>
- </filesets>
- </configuration>
- </plugin>
- <plugin>
- <groupId>de.jacks-it-lab</groupId>
- <artifactId>frontend-maven-plugin</artifactId>
- <version>1.7.2</version>
- <executions>
- <execution>
- <id>install node and yarn</id>
- <goals>
- <goal>install-node-and-yarn</goal>
- </goals>
- <!-- optional: default phase is "generate-resources" -->
- <phase>initialize</phase>
- <configuration>
- <nodeVersion>v16.17.0</nodeVersion>
- <yarnVersion>v1.22.19</yarnVersion>
- </configuration>
- </execution>
- <execution>
- <id>yarn build</id>
- <goals>
- <goal>yarn</goal>
- </goals>
- <configuration>
- <arguments>run build</arguments>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <!-- <link rel="stylesheet" href="./vendor.css" > -->
- <title>Microwave App</title>
-</head>
-
-<body>
- <div id="app"></div>
- <script type="text/javascript" src="./require.js"></script>
- <script type="text/javascript" src="./config.js"></script>
- <script>
- // run the application
- require(["app","connectApp", "microwaveApp", "networkMapApp", "faultApp", "siteManagerApp" ], function (app, connectApp, microwaveApp,networkMapApp, faultApp, siteManagerApp) {
- connectApp.register();
- microwaveApp.register();
- networkMapApp.register();
- faultApp.register();
- siteManagerApp.register();
- app("./app.tsx").runApplication();
- });
- </script>
-</body>
-
-</html>
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { Action } from '../../../../../framework/src/flux/action';
-import { Dispatch } from '../../../../../framework/src/flux/store';
-
-import { Height } from '../model/lineOfSightHeight';
-import { LatLon } from '../model/lineOfSightLatLon';
-
-import { calculateMidPoint } from '../utils/lineOfSightMap';
-import { isNumber } from '../utils/lineOfSightMath';
-
-export class SetPassedInValuesAction extends Action {
- constructor(public start: LatLon, public end: LatLon, public center: LatLon, public heightA: Height | null, public heightB: Height | null) {
- super();
- }
-}
-
-export class SetReachableAction extends Action {
- constructor(public reachable: boolean | null) {
- super();
- }
-}
-
-export const SetPassedInValues = (values: (string | null)[]) => (dispatcher: Dispatch) => {
- const start: LatLon = { latitude: Number(values[0]), longitude: Number(values[1]) };
- const end: LatLon = { latitude: Number(values[2]), longitude: Number(values[3]) };
- const midpoint = calculateMidPoint(start.latitude, start.longitude, end.latitude, end.longitude);
- const center: LatLon = { latitude: midpoint.latitude, longitude: midpoint.longitude };
- const heightA: Height | null = isNumber(values[4]) && isNumber(values[5]) ? { amsl: +values[4]!, antennaHeight: +values[5]! } : null;
- const heightB: Height | null = isNumber(values[6]) && isNumber(values[7]) ? { amsl: +values[6]!, antennaHeight: +values[7]! } : null;
- dispatcher(new SetPassedInValuesAction(start, end, center, heightA, heightB));
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { Action } from '../../../../../framework/src/flux/action';
-
-import { Height } from '../model/lineOfSightHeight';
-import { LatLon } from '../model/lineOfSightLatLon';
-
-export class SetChartAction extends Action {
- constructor(public startPoint: LatLon, public endPoint: LatLon, public heightA: Height, public heightB: Height) {
- super();
- }
-}
-
-export class SetStartPointAction extends Action {
- constructor(public startPoint: LatLon | null) {
- super();
- }
-}
-
-export class SetEndpointAction extends Action {
- constructor(public endPoint: LatLon | null) {
- super();
- }
-}
-
-export class SetHeightA extends Action {
- constructor(public height: Height) {
- super();
- }
-}
-
-export class SetHeightB extends Action {
- constructor(public height: Height) {
- super();
- }
-}
-
-export class ClearSavedChartAction extends Action {
- // eslint-disable-next-line @typescript-eslint/no-useless-constructor
- constructor() {
- super();
- }
-}
-
-export class SetMapCenterAction extends Action {
- /**
- *
- */
- constructor(public point: LatLon, public zoom: number) {
- super();
-
- }
-}
\ No newline at end of file
+++ /dev/null
-<!-- highstreet technologies GmbH colour scheme \r
- Grey #565656\r
- LBlue #36A9E1\r
- DBlue #246DA2\r
- Green #003F2C / #006C4B\r
- Yellw #C8D400\r
- Red #D81036\r
--->\r
-\r
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 150 150" >\r
-\r
-<g stroke="none" stroke-width="1" fill="none" transform="scale(10,10)">\r
-\r
-<path fill="#565656" d="M 5 0 L 5 10 C 3 10 2 8 2 7 L 2 5.25 L 1.5 5.25 L 1.5 14 C 1 14 0 14 0 12.5 L 0 3 L 1.5 3 L 1.5 4.75 L 2 4.75 L 2 3 C 2 2 3 0 5 0 Z" ></path>\r
-\r
-<path fill="#006C4B" d="M 6 5 C 5.6 5 5.6 4.71 6 4.6 L 11 3 C 11.2 2.955 11.2 2.955 11 3.4 L 10.5 4.6 C 10.329 5 10.329 5 10.5 5 L 13 5 C 13.4 5 13.41 5.241 13 5.4 L 8 7 C 7.8 7.034 7.793 7.032 8 6.6 L 8.5 5.4 C 8.685 5.012 8.685 5.012 8.5 5 L 6 5 Z" ></path>\r
-\r
-</g>\r
-</svg>
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React, { FC } from 'react';
-
-import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
-import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { Paper, Typography } from '@mui/material';
-
-type ConnectionErrorPopupProps = { reachable: boolean | null };
-
-const ConnectionErrorPopup: FC<ConnectionErrorPopupProps> = (props) => {
-
- return (props.reachable != null && !props.reachable ?
- <Paper style={{ padding: 5, position: 'absolute', top: 160, width: 230, left: '40%', zIndex: 1 }}>
- <div style={{ display: 'flex', flexDirection: 'column' }}>
- <div style={{ 'alignSelf': 'center', marginBottom: 5 }}> <Typography> <FontAwesomeIcon icon={faExclamationTriangle} /> Connection Error</Typography></div>
- <Typography>Service unavailable</Typography>
- </div>
- </Paper> : null
- );
-};
-
-export default ConnectionErrorPopup;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React, { FC } from 'react';
-
-import * as d3 from 'd3';
-
-import { useD3 } from '../hooks/d3';
-import { GPSProfileResult } from '../model/lineOfSightGPSProfileResult';
-import { max } from '../utils/lineOfSightMath';
-
-type HeightMapProps = {
- data: GPSProfileResult[];
- dataMin: GPSProfileResult;
- dataMax: GPSProfileResult;
- width: number;
- height: number;
- heightPosA: number;
- heightPosB: number;
-};
-
-const HeightChart: FC<HeightMapProps> = (props) => {
- const { data, dataMin, dataMax, heightPosA, heightPosB } = props;
- let ref: React.RefObject<SVGSVGElement>;
-
- const drawSvg = () => {
- ref = useD3(
- (svg) => {
- const margin = 100;
- const width = Number(svg.attr('width')) - margin;
- const height = Number(svg.attr('height')) - margin;
-
- // Add X axis
- const x = d3.scaleBand()
- .range([0, width])
- .domain(data.map(d => (`${d.gps.latitude},${d.gps.latitude}`)))
- .padding(0.2);
-
- const maxHeight = max([dataMax.height, heightPosA, heightPosB], d => d);
-
- // Add Y axis
- const y = d3.scaleLinear()
- .domain([dataMin.height, maxHeight])
- .range([height, 0]);
-
- svg.append('g')
- .attr('transform', `translate(${margin / 2}, ${margin / 2})`)
- .call(d3.axisLeft(y));
-
- // Bars
- svg.selectAll('myBar')
- .data(data)
- .join('rect')
- .attr('transform', `translate(${margin / 2}, ${margin / 2})`)
- .attr('x', d => x(`${d.gps.latitude},${d.gps.latitude}`) || '')
- .attr('y', d => y(d.height))
- .attr('width', x.bandwidth())
- .attr('fill', '#69b3a2b0')
- .attr('height', d => height - y(d.height)); // always equal to 0
-
- const firstX = `${data[0].gps.latitude},${data[0].gps.latitude}`;
- const lastX = `${data[data.length - 1].gps.latitude},${data[data.length - 1].gps.latitude}`;
-
- //add line
- const x1 = x(firstX)!;
- const x2 = x(lastX)!;
-
- svg.append('line')
- .attr('transform', `translate(${margin / 2}, ${margin / 2})`)
- .attr('x1', x1)
- .attr('y1', y(props.heightPosA))
- .attr('x2', x2)
- .attr('y2', y(props.heightPosB))
-
- .style('stroke', '#88A')
- .attr('stroke-width', '3px');
-
- //append circle on start and end
-
- svg.append('circle')
- .attr('transform', `translate(${margin / 2}, ${margin / 2})`)
- .attr('cx', x1)
- .attr('cy', y(props.heightPosA))
- .attr('r', 10)
- .attr('stroke', '#223b53')
- .attr('fill', '#225ba3');
-
- svg.append('circle')
- .attr('transform', `translate(${margin / 2}, ${margin / 2})`)
- .attr('cx', x2)
- .attr('cy', y(props.heightPosB))
- .attr('r', 10)
- .attr('stroke', '#223b53')
- .attr('fill', '#225ba3');
- },
- [data],
- );
- };
-
- drawSvg();
-
- return (
- <svg ref={ref!} width={props.width} height={props.height} />
- );
-};
-
-export { HeightChart };
+++ /dev/null
-/* eslint-disable @typescript-eslint/no-shadow */
-/**
- * ============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 React, { FC, useEffect, useRef, useState } from 'react';
-import { RouteComponentProps, withRouter } from 'react-router-dom';
-
-import makeStyles from '@mui/styles/makeStyles';
-
-import maplibre from 'maplibre-gl';
-import 'maplibre-gl/dist/maplibre-gl.css';
-
-import { render } from 'react-dom';
-
-import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect';
-
-import { SetReachableAction } from '../actions/lineOfSightCommonActions';
-import { ClearSavedChartAction, SetEndpointAction, SetHeightA, SetHeightB, SetMapCenterAction, SetStartPointAction } from '../actions/lineOfSightMapActions';
-
-import { GPSProfileResult } from '../model/lineOfSightGPSProfileResult';
-import { Height } from '../model/lineOfSightHeight';
-import { LatLon } from '../model/lineOfSightLatLon';
-
-import { getGPSProfile } from '../service/lineOfSightHeightService';
-import { addBaseLayer, addBaseSource, addPoint, calculateMidPoint } from '../utils/lineOfSightMap';
-import { max, min } from '../utils/lineOfSightMath';
-
-import ConnectionErrorPopup from './lineOfSightConnectionErrorPoup';
-import { HeightChart } from './lineOfSightHeightChart';
-import MapContextMenu from './lineOfSightMapContextMenu';
-import MapInfo from './lineOfSightMapInfo';
-
-import { OSM_STYLE, URL_BASEPATH } from '../config';
-
-type MapProps = RouteComponentProps;
-
-const styles = makeStyles({
- chart: {
- position: 'absolute',
- top: 0,
- bottom: 0,
- left: 0,
- right: 0,
- },
-});
-
-let map: maplibregl.Map;
-
-const Map: FC<MapProps> = (props) => {
-
- const center = useSelectApplicationState(state => state.microwave.map.center);
- const zoom = useSelectApplicationState(state => state.microwave.map.zoom);
- const start = useSelectApplicationState(state => state.microwave.map.start);
- const end = useSelectApplicationState(state => state.microwave.map.end);
- const siteAHeight = useSelectApplicationState(state => state.microwave.map.heightA);
- const siteBHeight = useSelectApplicationState(state => state.microwave.map.heightB);
- const ready = useSelectApplicationState(state => state.microwave.map.ready);
-
- const dispatch = useApplicationDispatch();
- const clearChartAction = () => dispatch(new ClearSavedChartAction);
- const setMapPosition = (point: LatLon, zoom: number) => dispatch(new SetMapCenterAction(point, zoom));
- const setHeightStart = (height: Height) => dispatch(new SetHeightA(height));
- const setHeightEnd = (height: Height) => dispatch(new SetHeightB(height));
- const setStartPosition = (position: LatLon | null) => dispatch(new SetStartPointAction(position));
- const setEndPosition = (position: LatLon | null) => dispatch(new SetEndpointAction(position));
- const setReachable = (reachable: boolean | null) => dispatch(new SetReachableAction(reachable));
-
- const [data, setData] = useState<GPSProfileResult[] | number>(Number.NaN);
- const [dataMin, setDataMin] = useState<GPSProfileResult | undefined>();
- const [dataMax, setDataMax] = useState<GPSProfileResult | undefined>();
- const [isMapLoaded, setMapLoaded] = useState<boolean>(false);
-
- const mapRef = useRef<{ map: maplibregl.Map | null }>({ map: null });
- const mapContainerRef = useRef<HTMLDivElement>(null);
-
- const classes = styles();
-
- const heightA = siteAHeight !== null ? siteAHeight.amsl + siteAHeight.antennaHeight : 0;
- const heightB = siteBHeight !== null ? siteBHeight.amsl + siteBHeight.antennaHeight : 0;
-
- const handleResize = () => {
-
- if (map) {
- // wait a moment until resizing actually happened
- window.setTimeout(() => map.resize(), 500);
- }
- };
-
- useEffect(() => {
- window.addEventListener('menu-resized', handleResize);
- return () => {
- window.removeEventListener('menu-resized', handleResize);
- const center = mapRef.current.map?.getCenter();
- const mapZoom = mapRef.current.map?.getZoom();
- if (center) {
- setMapPosition({ latitude: center.lat, longitude: center.lng }, mapZoom!);
- }
- setReachable(null);
- };
-
- }, []);
-
-
-
- const zoomInOnLink = (start: LatLon, end: LatLon) => {
- const center = calculateMidPoint(start.latitude, start.longitude, end.latitude, end.longitude);
- const newBounds = new maplibre.LngLatBounds();
- const allValues = { center, start, end };
- Object.values(allValues).forEach(value => {
- if (value) {
- newBounds.extend([value.longitude, value.latitude]);
- }
- });
- //zooms in/out to accumulate bounding box
- map.fitBounds(newBounds, { padding: 20 });
- };
-
- const drawChart = () => {
- if (start && end) {
- addBaseSource(map, 'route');
- addBaseLayer(map, 'route');
- zoomInOnLink(start, end);
- const json = `{
- "type": "Feature",
- "properties": {},
- "geometry": {
- "type": "LineString",
- "coordinates": [
- [${start.longitude}, ${start.latitude}],
- [${end.longitude}, ${end.latitude}]
- ]}
- }`;
- (map.getSource('route') as maplibregl.GeoJSONSource).setData(JSON.parse(json));
- getGPSProfile({ latitude: start.latitude, longitude: start.longitude }, { latitude: end.latitude, longitude: end.longitude }).then(data => {
- if (Array.isArray(data)) {
- setDataMin(min(data, d => d.height));
- setDataMax(max(data, d => d.height));
- }
- setData(data);
- });
- } else if (start || end) {
- const point = start !== null ? start : end!;
- addBaseSource(map, 'route');
- addBaseLayer(map, 'route');
- addPoint(map, point);
- } else {
- //delete layers and source
- //used instead of clearing source data because it has better performance
- //(setting data to empty results in a noticeable lag of line being cleared)
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions
- mapRef.current.map?.getLayer('line') && mapRef.current.map?.removeLayer('line') &&
- mapRef.current.map?.removeLayer('points') && mapRef.current.map?.removeSource('route');
- }
- };
-
- const updateLosUrl = () => {
- if (start && end) {
- const locationPart = `lat1=${start.latitude}&lon1=${start.longitude}&lat2=${end.latitude}&lon2=${end.longitude}`;
- let heightPart = '';
- if (siteAHeight && siteBHeight) {
- heightPart = `&amslA=${siteAHeight.amsl}&antennaHeightA=${siteAHeight.antennaHeight}&amslB=${siteBHeight.amsl}&antennaHeightB=${siteBHeight.antennaHeight}`;
- }
- props.history.replace(`/${URL_BASEPATH}/los?${locationPart}${heightPart}`);
- } else if (!start && !end) {
- props.history.replace(`/${URL_BASEPATH}`);
- }
- };
-
- const updateHeightA = (value: number, value2: number) => {
- setHeightStart({ amsl: value, antennaHeight: value2 });
- };
-
- const updateHeightB = (value: number, value2: number) => {
- setHeightEnd({ amsl: value, antennaHeight: value2 });
- };
-
- const OnEndPosition = (position: maplibregl.LngLat) => {
- setEndPosition({ latitude: position.lat, longitude: position.lng });
- };
-
- const OnStartPosition = (position: maplibregl.LngLat) => {
- setStartPosition({ latitude: position.lat, longitude: position.lng });
- };
-
- const mapMoveEnd = () => {
- const mapZoom = Number(map.getZoom().toFixed(2));
- const lat = Number(map.getCenter().lat.toFixed(4));
- const lon = Number(map.getCenter().lng.toFixed(4));
- setMapPosition({ latitude: lat, longitude: lon }, mapZoom);
- };
-
- const setupMap = () => {
- let initialLat = center.latitude;
- let initialLon = center.longitude;
- let initialZoom = zoom;
-
- map = new maplibre.Map({
- container: mapContainerRef.current!,
- style: OSM_STYLE as any,
- center: [initialLon, initialLat],
- zoom: initialZoom,
- });
-
- mapRef.current.map = map;
-
- map.on('load', () => {
-
- map.setMaxZoom(18);
- setMapLoaded(true);
-
- //add source, layer
- addBaseSource(map, 'route');
- addBaseLayer(map, 'route');
-
- });
-
- let currentPopup: maplibregl.Popup | null = null;
- map.on('contextmenu', (e) => {
- if (currentPopup)
- currentPopup.remove();
- //change height if start/end changes
- const popupNode = document.createElement('div');
- render(
- <MapContextMenu pos={e.lngLat}
- onStart={(p) => { OnStartPosition(p); if (currentPopup) currentPopup.remove(); }}
- onEnd={(p) => { OnEndPosition(p); if (currentPopup) currentPopup.remove(); }}
- onHeightA={(p, p1) => updateHeightA(p, p1)}
- onHeightB={(p, p1) => updateHeightB(p, p1)} />,
- popupNode);
-
- currentPopup = new maplibre.Popup()
- .setLngLat(e.lngLat)
- .setDOMContent(popupNode)
- .addTo(map);
- });
- map.on('moveend', mapMoveEnd);
- };
-
- useEffect(() => {
- if (ready) {
- setupMap();
- }
- }, [ready]);
-
- useEffect(() => {
- if (ready && isMapLoaded) {
- drawChart();
- updateLosUrl();
- }
- }, [start, end, isMapLoaded]);
-
- return <>
- <div id="map" style={{ width: '100%', height: '100%', position: 'relative' }} ref={mapContainerRef} >
- <MapInfo minHeight={dataMin} maxHeight={dataMax} />
- <ConnectionErrorPopup reachable={ready} />
-
- {typeof data === 'object'
- ? (
- < div className={classes.chart} onClick={() => {
- setData(Number.NaN);
- setDataMax(undefined);
- setDataMin(undefined);
- clearChartAction();
- }}>
- <HeightChart heightPosA={heightA} heightPosB={heightB} width={mapContainerRef.current?.clientWidth!} height={mapContainerRef.current?.clientHeight!} data={data} dataMin={dataMin!} dataMax={dataMax!} />
- </div>
- )
- : null
- }
-
- </div>
- </>;
-};
-
-export default withRouter(Map);
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React, { FC, useEffect, useState } from 'react';
-
-import { Button, InputAdornment, TextField, Tooltip } from '@mui/material';
-import makeStyles from '@mui/styles/makeStyles';
-
-import { getGPSHeight } from '../service/lineOfSightHeightService';
-
-type MapContextMenuProps = {
- pos: maplibregl.LngLat;
- onStart: (pos: maplibregl.LngLat) => void;
- onEnd: (pos: maplibregl.LngLat) => void;
- onHeightA: (height: number, antennaHeight: number) => void;
- onHeightB: (height: number, antennaHeight: number) => void;
-};
-
-const styles = makeStyles({
- flexContainer: { display: 'flex', flexDirection: 'row' },
- textField: { width: 60 },
- button: { marginRight: 5, marginTop: 5, flexGrow: 2 },
-});
-
-const MapContextMenu: FC<MapContextMenuProps> = (props) => {
- const { pos, onStart, onEnd } = props;
- const [height, setHeight] = useState<number | undefined>(undefined);
- const [value1, setValue1] = useState<string>('');
- const [value2, setValue2] = useState<string>('');
- const classes = styles();
-
- useEffect(() => {
- getGPSHeight({ longitude: pos.lng, latitude: pos.lat }).then(setHeight);
- }, [pos.lat, pos.lng]);
-
- const handleChangeHeight = (e: React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>, id: 'heightA' | 'heightB') => {
- //sanitize non numbers
- const onlyNums = e.target.value.replace(/[^0-9]/g, '');
- if (id === 'heightA') {
- setValue1(onlyNums);
- } else {
- setValue2(onlyNums);
- }
- };
-
- return (
- <div>
- <div>Height: {height} m</div>
- <div>
- <div className={classes.flexContainer}>
- <Button color="inherit" className={classes.button} variant="contained" onClick={() => { onStart(pos); props.onHeightA(height!, +value1); }}>Start</Button>
- <Tooltip disableInteractive title="Please add the antenna height in meters above sea level.">
- <TextField variant="standard" className={classes.textField} value={value1} onChange={(e) => handleChangeHeight(e, 'heightA')} InputProps={{ endAdornment: <InputAdornment position="start">m</InputAdornment> }} />
- </Tooltip>
- </div>
- <div className={classes.flexContainer}>
- <Button color="inherit" className={classes.button} variant="contained" onClick={() => { onEnd(pos); props.onHeightB(height!, +value2); }}>End</Button>
- <Tooltip disableInteractive title="Please add the antenna height in meters above sea level.">
- <TextField variant="standard" className={classes.textField} value={value2} onChange={(e) => handleChangeHeight(e, 'heightB')} InputProps={{ endAdornment: <InputAdornment position="start">m</InputAdornment> }} />
- </Tooltip>
- </div>
- </div>
- </div>
- );
-};
-
-export default MapContextMenu;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React, { FC, useEffect, useState } from 'react';
-
-import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
-import { Accordion, AccordionDetails, AccordionSummary, Typography } from '@mui/material';
-import makeStyles from '@mui/styles/makeStyles';
-import { useSelectApplicationState } from '../../../../../framework/src/flux/connect';
-import { GPSProfileResult } from '../model/lineOfSightGPSProfileResult';
-import { calculateDistanceInMeter } from '../utils/lineOfSightMap';
-
-type MapInfoProps = {
- minHeight: GPSProfileResult | undefined;
- maxHeight: GPSProfileResult | undefined;
-};
-
-const styles = (props: any) => makeStyles({
- accordion: { padding: 5, position: 'absolute', top: 10, width: props.width, marginLeft: 10, zIndex: 1 },
- container: { flexDirection: 'column', marginLeft: 10, padding: 5 },
- caption: { width: '40%' },
- subTitleRow: { width: '60%' },
- titleRowElement: { width: '40%', fontWeight: 'bold' },
- secondRow: { width: '25%' },
- thirdRow: { width: '20%' },
-});
-
-const MapInfo: FC<MapInfoProps> = (props) => {
-
- const center = useSelectApplicationState(state => state.microwave.map.center);
- const zoom = useSelectApplicationState(state => state.microwave.map.zoom);
- const start = useSelectApplicationState(state => state.microwave.map.start);
- const end = useSelectApplicationState(state => state.microwave.map.end);
- const heightA = useSelectApplicationState(state => state.microwave.map.heightA);
- const heightB = useSelectApplicationState(state => state.microwave.map.heightB);
- const [expanded, setExpanded] = useState(false);
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
- const [width, setWidth] = useState(470);
- const [length, setLength] = useState<string | undefined>();
- const classes = styles({ width: width })();
- const { minHeight, maxHeight } = props;
-
- useEffect(() => {
- if (start && end) {
- setLength(calculateDistanceInMeter(start.latitude, start.longitude, end.latitude, end.longitude).toFixed(3));
- } else {
- setLength(undefined);
- }
- }, [start, end]);
-
- const handleChange = (event: any, isExpanded: boolean) => {
- setExpanded(isExpanded);
- };
-
- return <Accordion className={classes.accordion} expanded={expanded} onChange={handleChange}>
- <AccordionSummary
- expandIcon={<ExpandMoreIcon />}
- aria-controls="panel1a-content"
- id="panel1a-header">
- <Typography aria-label="map-info-accordion">Map Info</Typography>
- </AccordionSummary>
-
- <AccordionDetails aria-label="map-info-details" className={classes.container}>
- <Typography style={{ fontWeight: 'bold', flex: '1' }} >Map Center</Typography>
- <div >
- <div style={{ display: 'flex', flexDirection: 'row' }}>
- <Typography className={classes.caption}> Longitude</Typography><Typography>{center.longitude}</Typography></div>
- <div style={{ display: 'flex', flexDirection: 'row' }}>
- <Typography className={classes.caption}> Latitude</Typography><Typography>{center.latitude}</Typography></div>
- <div style={{ display: 'flex', flexDirection: 'row' }}>
- <Typography className={classes.caption}> Zoom</Typography><Typography> {zoom}</Typography></div>
- </div>
-
- <Typography style={{ fontWeight: 'bold', flex: '1', marginTop: 5 }} >Link</Typography>
- <div>
- <div style={{ display: 'flex', flexDirection: 'row', marginLeft: '38%' }}>
- <Typography className={classes.titleRowElement}> Start</Typography>
- <Typography className={classes.titleRowElement}> End</Typography>
- </div>
-
- <div style={{ display: 'flex', flexDirection: 'row' }}>
- <Typography className={classes.caption}> Longitude</Typography>
- <Typography className={classes.secondRow}> {start?.longitude.toFixed(3)}</Typography>
- <Typography className={classes.secondRow}> {end?.longitude.toFixed(3)}</Typography>
- </div>
-
- <div style={{ display: 'flex', flexDirection: 'row' }}>
- <Typography className={classes.caption}> Latitude</Typography>
- <Typography className={classes.secondRow}> {start?.latitude.toFixed(3)}</Typography>
- <Typography className={classes.secondRow}> {end?.latitude.toFixed(3)}</Typography>
- </div>
-
- <div style={{ display: 'flex', flexDirection: 'row' }}>
- <Typography className={classes.caption}> Meassured height [m]</Typography>
- <Typography className={classes.secondRow}> {heightA?.amsl}</Typography>
- <Typography className={classes.secondRow}> {heightB?.amsl}</Typography>
- </div>
-
- <div style={{ display: 'flex', flexDirection: 'row' }}>
- <Typography className={classes.caption}> Antenna height [m] </Typography>
- <Typography className={classes.secondRow}> {heightA?.antennaHeight}</Typography>
- <Typography className={classes.secondRow}> {heightB?.antennaHeight}</Typography>
- </div>
-
- <div style={{ display: 'flex', flexDirection: 'row' }}>
- <Typography className={classes.caption}> Length [m]</Typography>
- <Typography className={classes.secondRow}> {length}</Typography>
- </div>
-
- <div style={{ display: 'flex', flexDirection: 'row' }}>
- <Typography className={classes.caption}> Max height @ position </Typography>
- <Typography className={classes.thirdRow}> {maxHeight ? maxHeight.height + ' m' : ''}</Typography>
- <Typography className={classes.thirdRow}> {maxHeight?.gps.longitude.toFixed(3)}</Typography>
- <Typography className={classes.thirdRow}> {maxHeight?.gps.latitude.toFixed(3)}</Typography>
- </div>
-
- <div style={{ display: 'flex', flexDirection: 'row' }}>
- <Typography className={classes.caption}> Min height @ position</Typography>
- <Typography className={classes.thirdRow}> {minHeight ? minHeight.height + ' m' : ''}</Typography>
- <Typography className={classes.thirdRow}> {minHeight?.gps.longitude.toFixed(3)}</Typography>
- <Typography className={classes.thirdRow}> {minHeight?.gps.latitude.toFixed(3)}</Typography>
- </div>
-
- </div>
- </AccordionDetails>
- </Accordion>;
-};
-
-export default MapInfo;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-export const URL_BASEPATH = 'microwave/lineOfSightMap';
-
-export const TERRAIN_URL = '/terrain'; //http://10.20.11.249:5200 maybe? /terrain
-export const TILE_URL = '/tiles'; //http://tile.openstreetmap.org /tiles
-
-export const OSM_STYLE = {
- 'version': 8,
- 'sources': {
- 'raster-tiles': {
- 'type': 'raster',
- 'tiles': [
- TILE_URL + '/{z}/{x}/{y}.png',
- ],
- 'tileSize': 256,
- 'attribution':
- '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
- },
- },
- 'layers': [
- {
- 'id': 'simple-tiles',
- 'type': 'raster',
- 'source': 'raster-tiles',
- 'minZoom': 0,
- 'maxZoom': 18,
- },
- ],
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { IActionHandler } from '../../../../../framework/src/flux/action';
-
-import { SetPassedInValuesAction, SetReachableAction } from '../actions/lineOfSightCommonActions';
-import { ClearSavedChartAction, SetChartAction, SetEndpointAction, SetHeightA, SetHeightB, SetMapCenterAction, SetStartPointAction } from '../actions/lineOfSightMapActions';
-
-import { Height } from '../model/lineOfSightHeight';
-import { LatLon } from '../model/lineOfSightLatLon';
-
-
-export interface IMap {
- center: LatLon;
- zoom: number;
- start: LatLon | null;
- heightA: Height | null;
- end: LatLon | null;
- heightB: Height | null;
- ready: boolean | null;
-}
-
-const initialState: IMap = {
- center: { latitude: 52.4003, longitude: 13.0584 },
- zoom: 12,
- start: null,
- end: null,
- ready: null,
- heightA: null,
- heightB: null,
-
-};
-
-export const mapHandler: IActionHandler<IMap> = (state = initialState, action) => {
- if (action instanceof SetPassedInValuesAction) {
- state = { ...state, start: action.start, end: action.end, center: action.center, heightA: action.heightA, heightB: action.heightB };
- } else if (action instanceof SetReachableAction) {
- state = { ...state, ready: action.reachable };
-
- } else if (action instanceof SetChartAction) {
- state = { ...state, start: action.startPoint, end: action.endPoint, heightA: action.heightA, heightB: action.heightB };
- } else if (action instanceof SetStartPointAction) {
- state = { ...state, start: action.startPoint };
-
- } else if (action instanceof SetEndpointAction) {
- state = { ...state, end: action.endPoint };
-
- } else if (action instanceof SetHeightA) {
- state = { ...state, heightA: action.height };
-
- } else if (action instanceof SetHeightB) {
- state = { ...state, heightB: action.height };
-
- } else if (action instanceof ClearSavedChartAction) {
- state = { ...state, start: null, end: null, heightA: null, heightB: null };
- } else if (action instanceof SetMapCenterAction) {
- state = { ...state, zoom: action.zoom, center: action.point };
- }
-
- return state;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-/* eslint-disable react-hooks/exhaustive-deps */
-import { useEffect, useRef } from 'react';
-import type { DependencyList } from 'react';
-
-import * as d3 from 'd3';
-
-
-type SelectionType = d3.Selection<SVGSVGElement, d3.BaseType, null, undefined>;
-
-export const useD3 = (renderChartFn: (selection: SelectionType) => void, dependencies: DependencyList) => {
- const ref = useRef<SVGSVGElement>(null);
-
- useEffect(() => {
- if (ref.current) renderChartFn(d3.select(ref.current));
- return () => { };
- }, dependencies);
-
- return ref;
-}
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-export type GPSProfileResult = { height: number; gps: { latitude: number; longitude: number }; band: string; zone: number; easting: number; northing: number };
\ No newline at end of file
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-export type Height = {
- amsl: number;
- antennaHeight: number;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-export type LatLon = {
- latitude: number;
- longitude: number;
-};
-
-type LinkDetailLocation = {
- lon: number;
- lat: number;
- siteId: number;
- name: string | null;
- amslM: number | null;
- azimuthDeg: number | null;
- radioAntenna: {
- id: number;
- operationalParameters: {
- agl: number;
- };
- };
-};
-
-export type Link = {
- id: number;
- name: string;
- operator: string;
- siteA: LinkDetailLocation;
- siteB: LinkDetailLocation;
- type: string;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { TERRAIN_URL } from '../config';
-import { GPSProfileResult } from '../model/lineOfSightGPSProfileResult';
-import { LatLon } from '../model/lineOfSightLatLon';
-
-import { requestRest } from '../../../../../framework/src/services/restService';
-
-export const apiUrlBase = 'api/Query';
-
-export const getGPSProfile = async (start: LatLon, end: LatLon) => {
- const url = `${TERRAIN_URL}/${apiUrlBase}/GPSProfileRecords`;
-
- const result = await fetch(url, {
- method: 'POST',
- body: JSON.stringify({ start, end }),
- headers: {
- 'Content-Type': 'application/json',
- // 'Content-Type': 'application/x-www-form-urlencoded',
- },
- });
- if (result.ok) {
- const data = await result.json() as GPSProfileResult[];
- return data;
- }
- return Number.NaN;
-};
-
-export const getGPSHeight = async (gpsCoord: LatLon) => {
- const url = `${TERRAIN_URL}/${apiUrlBase}/GPSHeight`;
- const result = await fetch(url, {
- method: 'POST',
- body: JSON.stringify(gpsCoord),
- headers: {
- 'Content-Type': 'application/json',
- // 'Content-Type': 'application/x-www-form-urlencoded',
- },
- });
- if (result.ok) {
- const data = await result.json() as { height: number };
- return data.height;
- } else {
- return undefined;
- }
-};
-
-const LINK_DETAILS_URL = '/topology/linkcalculator';
-export const getLinkDetails = async (linkId: any) => {
- const result = requestRest<any>(LINK_DETAILS_URL + '/link/' + linkId);
- return result;
-};
-
+++ /dev/null
-body {
- margin: 0;
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
- 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
- sans-serif;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-}
-
-code {
- font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
- monospace;
-}
+++ /dev/null
-.mapboxgl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0);text-align:left}.mapboxgl-map:-webkit-full-screen{width:100%;height:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.mapboxgl-ctrl-top-left{top:0;left:0}.mapboxgl-ctrl-top-right{top:0;right:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{right:0;bottom:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{margin:10px 0 0 10px;float:left}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{margin:10px 10px 0 0;float:right}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{margin:0 0 10px 10px;float:left}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{margin:0 10px 10px 0;float:right}.mapboxgl-ctrl-group{border-radius:4px;background:#fff}.mapboxgl-ctrl-group:not(:empty){-moz-box-shadow:0 0 2px rgba(0,0,0,.1);-webkit-box-shadow:0 0 2px rgba(0,0,0,.1);box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl button::-moz-focus-inner{border:0;padding:0}.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:focus:only-child{border-radius:inherit}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{-webkit-animation:mapboxgl-spin 2s linear infinite;-moz-animation:mapboxgl-spin 2s infinite linear;-o-animation:mapboxgl-spin 2s infinite linear;-ms-animation:mapboxgl-spin 2s infinite linear;animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}}@-webkit-keyframes mapboxgl-spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@-moz-keyframes mapboxgl-spin{0%{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(1turn)}}@-o-keyframes mapboxgl-spin{0%{-o-transform:rotate(0deg)}to{-o-transform:rotate(1turn)}}@-ms-keyframes mapboxgl-spin{0%{-ms-transform:rotate(0deg)}to{-ms-transform:rotate(1turn)}}@keyframes mapboxgl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg opacity='.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg opacity='.9' fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E")}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{min-height:20px;padding:0;margin:10px;position:relative;background-color:#fff;border-radius:3px 12px 12px 3px}.mapboxgl-ctrl-attrib.mapboxgl-compact:hover{padding:2px 24px 2px 4px;visibility:visible;margin-top:6px}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:hover,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:hover{padding:2px 4px 2px 24px;border-radius:12px 3px 3px 12px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact:after{content:"";cursor:pointer;position:absolute;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;right:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;left:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;border:2px solid #333;border-top:#333;padding:0 5px;color:#333;box-sizing:border-box}.mapboxgl-popup{position:absolute;top:0;left:0;display:-webkit-flex;display:flex;will-change:transform;pointer-events:none}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{-webkit-flex-direction:column;flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{-webkit-flex-direction:column-reverse;flex-direction:column-reverse}.mapboxgl-popup-anchor-left{-webkit-flex-direction:row;flex-direction:row}.mapboxgl-popup-anchor-right{-webkit-flex-direction:row-reverse;flex-direction:row-reverse}.mapboxgl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-top:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-right:none;border-left-color:#fff}.mapboxgl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.mapboxgl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{position:absolute;top:0;left:0;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.mapboxgl-user-location-dot:before{content:"";position:absolute;-webkit-animation:mapboxgl-user-location-dot-pulse 2s infinite;-moz-animation:mapboxgl-user-location-dot-pulse 2s infinite;-ms-animation:mapboxgl-user-location-dot-pulse 2s infinite;animation:mapboxgl-user-location-dot-pulse 2s infinite}.mapboxgl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px rgba(0,0,0,.35)}@-webkit-keyframes mapboxgl-user-location-dot-pulse{0%{-webkit-transform:scale(1);opacity:1}70%{-webkit-transform:scale(3);opacity:0}to{-webkit-transform:scale(1);opacity:0}}@-ms-keyframes mapboxgl-user-location-dot-pulse{0%{-ms-transform:scale(1);opacity:1}70%{-ms-transform:scale(3);opacity:0}to{-ms-transform:scale(1);opacity:0}}@keyframes mapboxgl-user-location-dot-pulse{0%{transform:scale(1);opacity:1}70%{transform:scale(3);opacity:0}to{transform:scale(1);opacity:0}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:rgba(29,161,242,.2);width:1px;height:1px;border-radius:100%}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}@media print{.mapbox-improve-map{display:none}}
\ No newline at end of file
+++ /dev/null
-/* eslint-disable no-param-reassign */
-/**
- * ============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 { LatLon } from '../model/lineOfSightLatLon';
-
-export const addBaseSource = (map: maplibregl.Map, name: string) => {
- if (!map.getSource(name))
- map.addSource(name, {
- type: 'geojson',
- data: { type: 'FeatureCollection', features: [] },
- });
-};
-
-export const addPoint = (map: maplibregl.Map, point: LatLon) => {
- const json = `{
- "type": "Feature",
- "properties": {},
- "geometry": {
- "type": "Point",
- "coordinates":
- [${point.longitude}, ${point.latitude}]
- }
- }`;
- (map.getSource('route') as maplibregl.GeoJSONSource).setData(JSON.parse(json));
-};
-
-export const addBaseLayer = (map: maplibregl.Map, sourceName: string) => {
- if (!map.getLayer('line'))
- map.addLayer({
- 'id': 'line',
- 'type': 'line',
- 'source': sourceName,
- 'layout': {
- 'line-join': 'round',
- 'line-cap': 'round',
- },
- 'paint': {
- 'line-color': '#88A',
- 'line-width': 6,
- 'line-opacity': 0.75,
- },
- });
-
- if (!map.getLayer('points'))
- map.addLayer({
- id: 'points',
- type: 'circle',
- source: sourceName,
- paint: {
- 'circle-radius': 5,
- 'circle-color': '#223b53',
- 'circle-stroke-color': '#225ba3',
- 'circle-stroke-width': 3,
- 'circle-opacity': 0.5,
- },
- });
-};
-
-const degrees_to_radians = (degrees: number) => {
- return degrees * (Math.PI / 180);
-};
-
-const radians_to_degrees = (radians: number) => {
- var pi = Math.PI;
- return radians * (180 / pi);
-};
-
-//taken from https://www.movable-type.co.uk/scripts/latlong.html
-export const calculateMidPoint = (lat1: number, lon1: number, lat2: number, lon2: number): LatLon => {
- const dLon = degrees_to_radians(lon2 - lon1);
- //convert to radians
- lat1 = degrees_to_radians(lat1);
- lat2 = degrees_to_radians(lat2);
- lon1 = degrees_to_radians(lon1);
-
- const Bx = Math.cos(lat2) * Math.cos(dLon);
- const By = Math.cos(lat2) * Math.sin(dLon);
- const lat3 = Math.atan2(Math.sin(lat1) + Math.sin(lat2), Math.sqrt((Math.cos(lat1) + Bx) * (Math.cos(lat1) + Bx) + By * By));
- const lon3 = lon1 + Math.atan2(By, Math.cos(lat1) + Bx);
- const coordinate: LatLon = { latitude: radians_to_degrees(lat3), longitude: radians_to_degrees(lon3) };
- return coordinate;
-};
-
-function toRad(value: number) {
- return (value * Math.PI) / 180;
-}
-
-export const calculateDistanceInMeter = (lat1: number, lon1: number, lat2: number, lon2: number) => {
- const lonRad1 = toRad(lon1);
- const latRad1 = toRad(lat1);
- const lonRad2 = toRad(lon2);
- const latRad2 = toRad(lat2);
- const dLon = lonRad2 - lonRad1;
- const dLat = latRad2 - latRad1;
- const a = Math.pow(Math.sin(dLat / 2), 2) +
- Math.cos(latRad1) * Math.cos(latRad2) *
- Math.pow(Math.sin(dLon / 2), 2);
- const c = 2 * Math.asin(Math.sqrt(a));
-
- return 6378 * c;
-};
-
-
-
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-export const max = <T>(a: T[], p: (v: T) => Number) => a.reduce<T>((m, x) => p(m) > p(x) ? m : x, a[0]);
-export const min = <T>(a: T[], p: (v: T) => Number) => a.reduce<T>((m, x) => p(m) < p(x) ? m : x, a[0]);
-
-export const isNumber = (value: string | null) => {
- if (!value) {
- return false;
- } else {
- const num = Number(value);
- return !isNaN(num);
- }
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React, { FC } from 'react';
-import Map from '../components/lineOfSightMap';
-
-const LineOfSightMainView: FC = () => {
- return (
- <div className="App" style={{ height: '100%' }}>
- <Map />
- </div>
- );
-};
-
-export default LineOfSightMainView;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { AdaptiveModulationInput } from '../model/adaptiveModulationInput';
-import { Dispatch } from '../../../../../framework/src/flux/store';
-import { IApplicationStoreState } from '../../../../../framework/src/store/applicationStore';
-import dataService from '../service/dataService';
-import { Action } from '../../../../../framework/src/flux/action';
-import { AdaptiveModulationTable } from '../model/adaptiveModulationTable';
-
-
-export class UpdateAdaptiveModulationTableAction extends Action {
- constructor(public adaptiveModulationTableAtoB: AdaptiveModulationTable[] | null, public adaptiveModulationTableBtoA: AdaptiveModulationTable[] | null, public message: string, public status: number) {
- super();
- }
-}
-export class UpdateAdaptiveModulationProcessing extends Action {
- constructor(public processing: boolean) {
- super();
- }
-}
-
-export const adaptiveModulationInputCreator = () => async (dispatch: Dispatch, getState: () => IApplicationStoreState) => {
-
- const {
- microwave: {
- link: { polarization, linkId },
- radio: { band, txPowerA, txPowerB, radioIdSiteA, radioIdSiteB, modulationA, modulationB },
- atmosphere: { attenuationMethod, worstMonth, rainVal, rainMethod },
- antenna: { antennaIdSiteA, antennaIdSiteB, antennaHeightA, antennaHeightB },
- waveguide: { waveguideIdSiteA, waveguideIdSiteB, waveguideLengthACalculate, waveguideLengthBCalculate },
- bandPlan: { region },
- },
- } = getState();
-
- let adaptiveModulationInput: AdaptiveModulationInput = {
- linkId: 0,
- linkOperationalParameters: {
- bandKeyId: '0',
- bandplanKeyId:'',
- polarization: '',
- absorptionMethod: '',
- calculationPeriod: '',
- rainRate: 0,
- rainModel: '',
- },
- siteA: {
- radioModelId: 0,
- waveguideModelId: 0,
- radioAntennaModelId: 0,
- modulationType: '',
- transmissionPower: 0,
- waveguideLength: 0,
- agl: 0,
- },
- siteB: {
- radioModelId: 0,
- waveguideModelId: 0,
- radioAntennaModelId: 0,
- modulationType: '',
- transmissionPower: 0,
- waveguideLength: 0,
- agl: 0,
- },
- };
-
- // setting link attributes
- adaptiveModulationInput = {
- ...adaptiveModulationInput,
- linkId: linkId,
- linkOperationalParameters: {
- bandKeyId: band.keyId,
- bandplanKeyId: region.keyId,
- polarization: polarization!,
- absorptionMethod: attenuationMethod,
- calculationPeriod: worstMonth === true ? 'WORSTMONTH' : 'ANNUAL',
- rainRate: rainVal,
- rainModel: rainMethod,
- },
- };
- // setting site A attributes
- adaptiveModulationInput = {
- ...adaptiveModulationInput,
- siteA: {
- radioModelId: radioIdSiteA,
- waveguideModelId: waveguideIdSiteA,
- radioAntennaModelId: antennaIdSiteA,
- modulationType: modulationA,
- transmissionPower: txPowerA,
- waveguideLength: waveguideLengthACalculate,
- agl: antennaHeightA,
- },
- };
- // setting SiteB attributes
- adaptiveModulationInput = {
- ...adaptiveModulationInput,
- siteB: {
- radioModelId: radioIdSiteB,
- waveguideModelId: waveguideIdSiteB,
- radioAntennaModelId: antennaIdSiteB,
- modulationType: modulationB,
- transmissionPower: txPowerB,
- waveguideLength: waveguideLengthBCalculate,
- agl: antennaHeightB,
- },
- };
-
- const adaptivemodulationPromise = dataService.adaptiveModulationTable(adaptiveModulationInput);
-
- adaptivemodulationPromise.then((response ) => {
- dispatch(new UpdateAdaptiveModulationTableAction(response.data?.aToB!, response.data?.bToA!, response.message!, response.status));
- });
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { Antenna } from '../model/antenna';
-
-export class UpdateAntennaDBAction extends Action {
- constructor(public antenna: Antenna[]) {
- super();
- }
-}
-export class UpdateAntennaAction extends Action {
- constructor(public antennaA: Antenna | null, public antennaB: Antenna | null) {
- super();
- }
-}
-export class antennaMandatoryAction extends Action {
- constructor(public antennaMandatoryParameters: boolean) {
- super();
- }
-}
-
-
+++ /dev/null
-/**
- * ============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 UpdateRainValAction extends Action {
- constructor(public rainVal: number) {
- super();
- }
-}
-export class UpdateRainMethodAction extends Action {
- constructor(public rainMethod: string) {
- super();
- }
-}
-export class UpdateAttenuationMethodAction extends Action {
- constructor(public attenuationMethod: string) {
- super();
- }
-}
-export class UpdateWorstMonthAction extends Action {
- constructor(public worstMonth: boolean) {
- super();
- }
-}
-export class attenuationMandatoryParametersAction extends Action {
- constructor(public attenuationMandatoryParameters: boolean) {
- super();
- }
-}
+++ /dev/null
-/**
- * ============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 { Channel, ChannelTable, FrequencyPlan, RegionRegulator } from '../model/bandPlan';
-import { RadioBand } from '../model/topologyTypes';
-import { SaveChannel } from '../model/updateLink';
-import dataService from '../service/dataService';
-import { UpdateFrequencyPlanAction } from './linkAction';
-import { UpdateBandList } from './queryActions';
-
-
-export class UpdateRegionRegulatorAction extends Action {
- constructor(public region: RegionRegulator) {
- super();
- }
-}
-export class UpdateChannelListQueryAction extends Action {
- constructor(public channelList: Channel[]) {
- super();
- }
-}
-export class UpdateChannelListLoadingAction extends Action {
- constructor(public channelListLoading: boolean) {
- super();
- }
-}
-export class UpdateChannelListAction extends Action {
- constructor(public channels: ChannelTable[]) {
- super();
- }
-}
-export class ResetChannelTableAction extends Action {}
-
-export class UpdateFrequencyPlans extends Action {
- constructor(public siteAFrequencyPlan: FrequencyPlan[], public siteBFrequencyPlan: FrequencyPlan[]) {
- super();
- }
-}
-
-export const updateSavedChannels = (channels: SaveChannel[], allChannel: Channel[]) => async (dispatcher: Dispatch) => {
- let channelTable: ChannelTable[] = [];
-
-
- channels.forEach(x => {
- allChannel.forEach(y => {
- if (y.keyId === x.channelKeyId) {
- channelTable.push({
- name: y.name,
- bandwidthMHz: y.bandwidthMHz.bandwidthMHz,
- centerFrequencyHigh: y.centerFrequencyHigh,
- centerFrequencyLow: y.centerFrequencyLow,
- availability: y.availability.name,
- xPolCondition: y.xPolCondition.name,
- keyId: y.keyId,
- polarization: x.channelPolarizationEnum,
- });
- }
- },
- );
- });
- dispatcher(new UpdateChannelListAction(channelTable));
-};
-
-export const UpdateChannelQuery = (bandplanKeyId: string, bandKeyId: string) => async (dispatcher: Dispatch) => {
-
- dataService.channelQuery(bandplanKeyId, bandKeyId).then(result => {
- dispatcher(new UpdateChannelListQueryAction(result?.data!));
- dispatcher(new UpdateChannelListLoadingAction(false));
- });
-};
-
-
-
-export const getAllBands = (bandplanKeyId: string) => async (dispatcher: Dispatch) => {
- await dataService.bandListQuery(bandplanKeyId).then(result => {
- if (result.data) {
- let bandList: RadioBand[] = [];
- result.data.forEach(x => bandList.push(x));
- dispatcher(new UpdateBandList(bandList));
- }
- });
-};
-
-export const getFrequencyplans = (siteIdA: number, siteIdB: number, bandKeyId: string) => async (dispatcher: Dispatch) => {
- let siteAFrequencyPlan: FrequencyPlan[] = [];
- let siteBFrequencyPlan: FrequencyPlan[] = [];
-
- await dataService.frequencyPlanQuery(siteIdA).then(result => {
- siteAFrequencyPlan = result.data;
- });
- await dataService.frequencyPlanQuery(siteIdB).then(result => {
- siteBFrequencyPlan = result.data;
-
- });
- dispatcher(new UpdateFrequencyPlans(siteAFrequencyPlan, siteBFrequencyPlan));
- let frequencyPlanA: string = '';
- let frequencyPlanB: string = '';
- siteAFrequencyPlan.forEach(x => {
- if (x.band.keyId === bandKeyId) {
- frequencyPlanA = x.configuration;
- }
- });
- siteBFrequencyPlan.forEach(x => {
- if (x.band.keyId === bandKeyId) {
- frequencyPlanB = x.configuration;
- }
- });
- dispatcher(new UpdateFrequencyPlanAction(frequencyPlanA as 'HIGH' | 'LOW', frequencyPlanB as 'HIGH' | 'LOW'));
-};
-
+++ /dev/null
-/**
- * ============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 { TabId } from '../model/tabId';
-import { Action } from '../../../../../framework/src/flux/action';
-import { CalculationResult } from '../model/calculationResult';
-
-export class UpdateCalculationResultAction extends Action {
- constructor(public result: CalculationResult) {
- super();
- }
-}
-export class UpdateTabAction extends Action {
- constructor(public openTab: TabId) {
- super();
- }
-}
-
-
+++ /dev/null
-
-/**
- * ============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 UpdateLatitudeErrorAction extends Action {
- constructor(public error1: string | null, public error2: string | null) {
- super();
- }
-}
-export class UpdateLongitudeErrorAction extends Action {
- constructor(public error1: string | null, public error2: string | null) {
- super();
- }
-}
-export class UpdateFrequencyErrorAction extends Action {
- constructor(public error: string) {
- super();
- }
-}
-export class UpdateRainMethodErrorAction extends Action {
- constructor(public error: string) {
- super();
- }
-}
-export class UpdateAttenuationMethodErrorAction extends Action {
- constructor(public error: string) {
- super();
- }
-}
-export class FirstMandatoryCheckAction extends Action {
-}
-
-
-
-export const formValid = () => async (dispatcher: Dispatch, getState: () => IApplicationStoreState) => {
-
- const siteState = getState().microwave.site;
-
- const latitude1Error = siteState.lat1 === 0 ? 'Enter a number between -90 to 90' : null;
- const latitude2Error = siteState.lat2 === 0 ? 'Enter a number between -90 to 90' : null;
- const longitude1Error = siteState.lon1 === 0 ? 'Enter a number between -180 to 180' : null;
- const longitude2Error = siteState.lon2 === 0 ? 'Enter a number between -180 to 180' : null;
- const frequencyError = getState().microwave.radio.band.frequency === 0 ? 'Select a frequency' : '';
- const rainMethodError = getState().microwave.atmosphere.rainMethod === '0' ? 'Select the rain method' : '';
- const attenuationMethodError = getState().microwave.atmosphere.attenuationMethod === '0' ? 'Select the attenuation method' : '';
-
- dispatcher(new UpdateLatitudeErrorAction(latitude1Error, latitude2Error));
- dispatcher(new UpdateLongitudeErrorAction(longitude1Error, longitude2Error));
- dispatcher(new UpdateFrequencyErrorAction(frequencyError));
- dispatcher(new UpdateRainMethodErrorAction(rainMethodError));
- dispatcher(new UpdateAttenuationMethodErrorAction(attenuationMethodError));
-
- return latitude1Error === null && latitude2Error === null && longitude1Error === null && longitude2Error === null && frequencyError === '';
-};
-
+++ /dev/null
-/**
- * ============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 dataService from '../service/dataService';
-import { Dispatch } from '../../../../../framework/src/flux/store';
-import { IApplicationStoreState } from '../../../../../framework/src/store/applicationStore';
-import { UpdateDistanceAction } from './linkAction';
-import { CalculationResult } from '../model/calculationResult';
-import { UpdateCalculationResultAction } from './commonActions';
-
-export const calculateButtonAction = () => async (dispatch: Dispatch, getState: () => IApplicationStoreState) => {
-
- const {
- microwave: {
- site: { lat1, lon1, lat2, lon2 },
- link: { polarization, distance },
- radio: { band, txPowerA, txPowerB, thresholdBER3A, thresholdBER3B, radioMandatoryParameters, frequencyMandatoryParameters },
- atmosphere: { worstMonth, rainVal, attenuationMethod, rainMethod, attenuationMandatoryParameters },
- antenna: { antennaGainA, antennaGainB, antennaMandatoryParameters },
- waveguide: { waveguideMandatoryParameters, waveguideIdSiteA, waveguideIdSiteB, waveguideLengthACalculate, waveguideLengthBCalculate },
- },
- } = getState();
-
- let distanceInKm;
- // const autoDistance = await dataServices.updateAutoDistance(lat1, lon1, lat2, lon2);
-
- if (distance !== 0) {
- distanceInKm = distance;
- } else {
- distanceInKm = (await dataService.updateAutoDistance(lat1, lon1, lat2, lon2))!.distanceInKm;
- dispatch(new UpdateDistanceAction(distanceInKm));
- }
-
- let rainLoss;
- if (rainMethod === 'ITURP8377') {
- rainLoss = await dataService.rainAttenuation(lat1, lon1, lat2, lon2, band.keyId, polarization!, worstMonth);
- } else if (rainMethod === 'MANUAL') {
- if (rainVal !== 0) {
- rainLoss = await dataService.manualRain(rainVal, band.keyId, distanceInKm, polarization!);
- }
- }
- let linkBudget;
- let waveguideLoss;
- const freeSpaceLoss = await dataService.FSL(distanceInKm, band.keyId);
- const absorptionLoss = await dataService.AbsorptionAtt(lat1, lon1, lat2, lon2, band.keyId, worstMonth, attenuationMethod);
-
- waveguideLoss = await dataService.waveguideLoss(waveguideIdSiteA, waveguideIdSiteB, waveguideLengthACalculate, waveguideLengthBCalculate);
-
- if (antennaMandatoryParameters && radioMandatoryParameters && frequencyMandatoryParameters && attenuationMandatoryParameters && waveguideMandatoryParameters && waveguideLoss) {
- linkBudget = await dataService.linkBudget(lat1, lon1, lat2, lon2, band.keyId, attenuationMethod, polarization!, antennaGainA, antennaGainB, waveguideLoss.waveguideLossA, waveguideLoss.waveguideLossB, txPowerA!, txPowerB!, thresholdBER3A!, thresholdBER3B!);
- }
- let result = new CalculationResult();
- if (rainLoss && rainLoss.rainAttenuation) result.rainLoss = rainLoss;
- if (freeSpaceLoss) result.freeSpaceLoss = freeSpaceLoss;
- if (absorptionLoss && absorptionLoss.oxygenLoss && absorptionLoss.waterLoss) result.absorptionLoss = absorptionLoss;
- if (waveguideLoss) result.waveguideLoss = waveguideLoss;
- if (linkBudget && linkBudget.receivedPowerA && linkBudget.receivedPowerB ) result.linkBudget = linkBudget;
- if (result) dispatch(new UpdateCalculationResultAction(result));
-};
-
+++ /dev/null
-/**
- * ============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 UpdatePolAction extends Action {
- constructor(public polarization: 'HORIZONTAL' | 'VERTICAL' | null) {
- super();
- }
-}
-export class UpdateDistanceAction extends Action {
- constructor(public distance: number | null) {
- super();
- }
-}
-export class UpdateFrequencyPlanAction extends Action {
- constructor(public frequencyPlanA: 'HIGH' | 'LOW', public frequencyPlanB :'HIGH' | 'LOW' ) {
- super();
- }
-}
+++ /dev/null
-/**
- * ============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 { RegionRegulator } from '../model/bandPlan';
-import { ModelType, RadioBand } from '../model/topologyTypes';
-
-export class UpdateBandList extends Action {
- constructor(public bandList: RadioBand[]) {
- super();
- }
-}
-export class UpdateRegionRegulatorListAction extends Action {
- constructor(public regionRegulatorList : RegionRegulator[]) {
- super();
- }
-}
-export class UpdateModelTypesAction extends Action {
- constructor(public ModelTypes : ModelType[]) {
- super();
- }
-}
-
+++ /dev/null
-/**
- * ============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 dataService from '../service/dataService';
-import { Action } from '../../../../../framework/src/flux/action';
-import { Dispatch } from '../../../../../framework/src/flux/store';
-import { Radio, RadioEverything } from '../model/radio';
-import { Modulation } from '../model/modulation';
-
-import { Antenna } from '../model/antenna';
-import { Waveguide } from '../model/waveguide';
-import { FirstMandatoryCheckAction } from './errorAction';
-import { Link } from '../model/link';
-import { radioService } from '../service/processingService';
-
-export class UpdateFrequencyAction extends Action {
- constructor(public frequency: number) {
- super();
-
- }
-}
-export class UpdateTxPowerAction extends Action {
- constructor(public txPowerA: number | null, public txPowerB: number | null) {
- super();
- }
-}
-export class UpdateRxSensitivityAction extends Action {
- constructor(public thresholdBER3A: number | null, public thresholdBER6A: number | null, public thresholdBER3B: number | null, public thresholdBER6B: number | null) {
- super();
- }
-}
-export class UpdateRxPowerAction extends Action {
- constructor(public rxPowerA: number, public rxPowerB: number) {
- super();
- }
-}
-export class UpdateSomAction extends Action {
- constructor(public somA: number, public somB: number) {
- super();
- }
-}
-export class UpdateRadioListAction extends Action {
- constructor(public radioNameList: string[]) {
- super();
- }
-}
-
-export class UpdateRadioAction extends Action {
- constructor(public radioNameA: string | null, public radioNameB: string | null) {
- super();
- }
-}
-export class radioMandatoryParametersAction extends Action {
- constructor(public radioMandatoryParameters: boolean) {
- super();
- }
-}
-export class frequencyMandatoryParametersAction extends Action {
- constructor(public frequencyMandatoryParameters: boolean) {
- super();
- }
-}
-
-export class UpdateRadioParametersAction extends Action {
- constructor(public radioParameters: Radio[]) {
- super();
- }
-}
-export class radioBandwidthAction extends Action {
- constructor(public radioBandwidthA: number | null, public radioBandwidthB: number | null) {
- super();
- }
-}
-export class UpdateRadioIdAction extends Action {
- constructor(public radioIdSiteA: number | null, public radioIdSiteB: number | null) {
- super();
- }
-}
-
-export class UpdateModulationListAction extends Action {
- constructor(public modulationListA: string[] | null, public modulationListB: string[] | null) {
- super();
- }
-}
-export class UpdateModulationAction extends Action {
- constructor(public modulationA: string | null, public modulationB: string | null) {
- super();
- }
-}
-
-export class UpdateModulationParametersAction extends Action {
- constructor(public modulationParametersA: Modulation | null, public modulationParametersB: Modulation | null) {
- super();
- }
-}
-
-export class ResetAction extends Action {
-}
-export class UpdateDeviceListsOnBandChangeAction extends Action {
- constructor(
- public antennas: Antenna[],
- public radioList: Radio[],
- public waveguideList: Waveguide[]) {
- super();
- }
-}
-export class UpdateDevicesOnFirstLoad extends UpdateDeviceListsOnBandChangeAction {
- constructor(
- public antennas: Antenna[],
- public radioList: Radio[],
- public waveguideList: Waveguide[],
- public linkAttributes: Link ) {
- super(antennas, radioList, waveguideList);
- }
-}
-
-export class UpdateRadioEverything extends Action {
- constructor(public transport: RadioEverything) {
- super();
- }
-}
-export class UpdateTotalBandwidthAction extends Action {
- constructor(public totalBandwidthMHz: number) {
- super();
- }
-}
-
-export class UpdateEnabeldAdaptiveModulations extends Action {
- constructor(public enabledAdaptiveModulations: string[]) {
- super();
- }
-}
-export const updateFrequencyBand = (bandKeyId: string) => async (dispatcher: Dispatch) => {
- dispatcher( new ResetAction());
- dispatcher(new UpdateFrequencyAction(Number(bandKeyId.replace('$', ''))));
- dispatcher(new FirstMandatoryCheckAction());
-
-
- let radios: Radio[] = [];
- let antennas: Antenna[] = [];
- let waveguides: Waveguide[] = [];
- await dataService.getModels(bandKeyId, 'radio')!.then((x: Radio[]) => {
- radios = x;
- });
- await dataService.getModels(bandKeyId, 'radio-antenna')!.then((x: Antenna[]) => {
- antennas = x;
- });
- await dataService.getModels(bandKeyId, 'radio-to-antenna-link')!.then((x: Waveguide[]) => {
- waveguides = x;
- });
- dispatcher(new UpdateDeviceListsOnBandChangeAction(antennas, radios, waveguides));
-};
-export const revertAntennaRadioWaveguideattributes = () => async (dispatcher: Dispatch) => {
- dispatcher(new ResetAction());
-};
-export const updateRadioAttributes = (radioA: string | null, radioB: string | null, radioParameters: Radio[]) => async (dispatcher: Dispatch) => {
- dispatcher(new UpdateRadioAction(radioA, radioB));
- const radios: RadioEverything = await radioService(radioA, radioB, radioParameters);
- dispatcher(new UpdateRadioEverything(radios));
-};
-
-
+++ /dev/null
-/**
- * ============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 { Dispatch } from '../../../../../framework/src/flux/store';
-import { Action } from '../../../../../framework/src/flux/action';
-
-import { IApplicationStoreState } from '../../../../../framework/src/store/applicationStore';
-
-import dataService from '../service/dataService';
-import { SaveChannel, UpdateLink } from '../model/updateLink';
-
-
-
-export class linkSavedSuccessfulAction extends Action {
- constructor(public saved: any) {
- super();
- }
-}
-export class linkBeingSavedAction extends Action {
- constructor(public saving: boolean) {
- super();
- }
-}
-export const saveLinkCallAsync = () => async (dispatch: Dispatch, getState: () => IApplicationStoreState) => {
- dispatch(new linkBeingSavedAction(true));
- const {
- microwave: {
- link: { polarization },
- radio: { band, txPowerA, txPowerB, radioIdSiteA, radioIdSiteB, modulationA, modulationB, enabledAdaptiveModulations },
- atmosphere: { attenuationMethod, worstMonth, rainMethod, rainVal },
- antenna: { antennaIdSiteA, antennaIdSiteB, antennaHeightA, antennaHeightB },
- waveguide: { waveguideIdSiteA, waveguideIdSiteB, waveguideLengthACalculate, waveguideLengthBCalculate },
- query: { linkAttributes },
- bandPlan:{ region, savedChannels },
- },
- } = getState();
-
- let saveChannels: SaveChannel[] = [];
- savedChannels.map(x => {
- saveChannels.push({ channelKeyId: x.keyId, channelPolarizationEnum: x.polarization });
- });
-
- let link: UpdateLink = {
-
- siteA: { modulationType :modulationA,
- transmissionPower:txPowerA,
- waveguideLength:waveguideLengthACalculate,
- agl:antennaHeightA,
- radioModelId: radioIdSiteA,
- waveguideModelId:waveguideIdSiteA,
- radioAntennaModelId:antennaIdSiteA,
- enabledAdmModulations: enabledAdaptiveModulations,
- },
- siteB: { modulationType :modulationB,
- transmissionPower:txPowerB,
- waveguideLength:waveguideLengthBCalculate,
- agl:antennaHeightB,
- radioModelId: radioIdSiteB,
- waveguideModelId:waveguideIdSiteB,
- radioAntennaModelId:antennaIdSiteB,
- enabledAdmModulations: enabledAdaptiveModulations,
- },
- linkOperationalParameters: {
- bandKeyId: band.keyId,
- rainPolarity: polarization!,
- rainModel: rainMethod,
- rainRate: rainVal,
- absorptionMethod: attenuationMethod,
- calculationPeriod: worstMonth ? 'WORSTMONTH' : 'ANNUAL',
- bandplanKeyId: region.keyId,
- selectedChannelList: saveChannels,
- },
-
-
- };
-
- const callLinkPromise = (await dataService.saveLink(link as any, linkAttributes.id));
- dispatch(new linkSavedSuccessfulAction(callLinkPromise));
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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';
-
-
-
-//TODO: calculate distance if all lat/lons are set
-export class UpdateLatLonAction extends Action {
- constructor(
- public lat1: number,
- public lon1: number,
- public lat2: number,
- public lon2: number,
- ) {
- super();
-
- }
-}
-export class locationMandatoryAction extends Action {
- constructor(public locationMandatoryParameters: boolean) {
- super();
- }
-}
-
+++ /dev/null
-/**
- * ============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 isCalculationServerReachableAction extends Action {
- constructor(public reachable: boolean) {
- super();
- }
-}
-
-export class ResetFormAction extends Action {
-}
-
-export class UpdateRainMethodDisplayAction extends Action {
- constructor(public rainDisplay: boolean) {
- super();
- }
-}
-export class PluginDoneLoadingAction extends Action {
- constructor(public loadingComplete: boolean) {
- super();
- }
-}
+++ /dev/null
-/**
- * ============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 { Waveguide } from '../model/waveguide';
-import { Action } from '../../../../../framework/src/flux/action';
-
-export class UpdateWaveguideLossAction extends Action {
- constructor(public waveguideLossA: number, public waveguideLossB: number) {
- super();
- }
-}
-export class UpdatewaveguideListAction extends Action {
- constructor(public waveguideListName: string[]) {
- super();
- }
-}
-
-export class updateWaveguideNameAction extends Action {
- constructor(public waveguideNameA: string | null, public waveguideNameB: string | null) {
- super();
- }
-}
-export class waveguideMandatoryAction extends Action {
- constructor(public waveguideMandatoryParameters: boolean) {
- super();
- }
-}
-export class UpdateWaveguideIdAction extends Action {
- constructor(public waveguideIdSiteA: number | null, public waveguideIdSiteB: number | null) {
- super();
- }
-}
-export class updateWaveguideTypeAction extends Action {
- constructor(public waveguideTypeA: string | null, public waveguideTypeB: string | null) {
- super();
- }
-}
-export class UpdateWaveguideParametersAction extends Action {
- constructor(public waveguide: Waveguide[]) {
- super();
- }
-}
-export class UpdateNewWaveguideParametersAction extends Action {
- constructor(public waveguideParametersA: Waveguide | null, public waveguideParametersB: Waveguide | null) {
- super();
- }
-}
-
-
-
+++ /dev/null
-<!-- highstreet technologies GmbH colour scheme \r
- Grey #565656\r
- LBlue #36A9E1\r
- DBlue #246DA2\r
- Green #003F2C / #006C4B\r
- Yellw #C8D400\r
- Red #D81036\r
--->\r
-\r
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 150 150" >\r
-\r
-<g stroke="none" stroke-width="1" fill="none" transform="scale(10,10)">\r
-\r
-<path fill="#565656" d="M 5 0 L 5 10 C 3 10 2 8 2 7 L 2 5.25 L 1.5 5.25 L 1.5 14 C 1 14 0 14 0 12.5 L 0 3 L 1.5 3 L 1.5 4.75 L 2 4.75 L 2 3 C 2 2 3 0 5 0 Z" ></path>\r
-\r
-<path fill="#006C4B" d="M 6 5 C 5.6 5 5.6 4.71 6 4.6 L 11 3 C 11.2 2.955 11.2 2.955 11 3.4 L 10.5 4.6 C 10.329 5 10.329 5 10.5 5 L 13 5 C 13.4 5 13.41 5.241 13 5.4 L 8 7 C 7.8 7.034 7.793 7.032 8 6.6 L 8.5 5.4 C 8.685 5.012 8.685 5.012 8.5 5 L 6 5 Z" ></path>\r
-\r
-</g>\r
-</svg>
\ No newline at end of file
+++ /dev/null
-
-/**
- * ============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 React, { FC, useEffect, useState } from 'react';
-
-import CloseIcon from '@mui/icons-material/Close';
-import makeStyles from '@mui/styles/makeStyles';
-import { InputProps } from '@mui/material/Input';
-import Dialog from '@mui/material/Dialog';
-import DialogContentText from '@mui/material/DialogContentText';
-import DialogTitle from '@mui/material/DialogTitle';
-import DialogContent from '@mui/material/DialogContent';
-import DialogActions from '@mui/material/DialogActions';
-import IconButton from '@mui/material/IconButton';
-import Box from '@mui/material/Box';
-
-import MaterialTable, { ColumnType, MaterialTableCtorType } from '../../../../../framework/src/components/material-table';
-
-import { AdaptiveModulationTable } from '../model/adaptiveModulationTable';
-import { Modulation } from '../model/modulation';
-import Checkbox from '@mui/material/Checkbox';
-import Button from '@mui/material/Button';
-
-
-type PropTypes = InputProps & {
- style?: React.CSSProperties;
- open: boolean;
- close(): void;
- row: AdaptiveModulationTable[];
- direction: string;
- selectedElement: string[];
- updateModulation(data: string[]): void;
-};
-
-const ModulationTable = MaterialTable as MaterialTableCtorType<AdaptiveModulationTable>;
-const styles = makeStyles({
- closeIcon: {
- position: 'absolute',
- top: 0,
- right: 0,
- color: 'black',
- },
- closeButton: {
- marginTop: 20, position: 'absolute', top: '850px', right: '50px',
- },
- applyButton: {
- marginTop: 20, position: 'absolute', top: '850px', right: '160px',
- },
-});
-
-export const AdaptiveModulationDialog: FC<PropTypes> = ({ open, row, close, direction, selectedElement, updateModulation }) => {
- const [selectedElements, setSelectedElements] = useState<string[]>(selectedElement);
- const classes = styles();
-
- const onChange = (element: any) => {
- const data: { modulation: string; parameters: Modulation | null } = { modulation: element.target.value, parameters: null };
- setSelectedElements([element.target.value]);
-
- if (selectedElements.includes(data.modulation)) {
-
- setSelectedElements(selectedElements.filter((i) => i !== data.modulation));
-
- } else {
- var newData = [...selectedElements, data.modulation];
- setSelectedElements(newData);
-
- }
- };
-
- const onClose = () => {
- close();
- };
-
- const onSave = () => {
- updateModulation(selectedElements);
- close();
- };
- useEffect(() => {
- setSelectedElements(selectedElement);
- }, []);
-
- return (
- <div>
- <Dialog onClose={() => onClose()} open={open} fullWidth maxWidth={'lg'} >
- <DialogContent>
- <DialogContentText>
- Adaptive Modulation
- </DialogContentText>
- <DialogTitle>{direction}</DialogTitle>
-
- <DialogActions>
- <IconButton
- aria-label="close"
- className={classes.closeIcon}
- onClick={() => onClose()}
- size="large">
- <CloseIcon />
- </IconButton>
-
- </DialogActions>
-
- {row !== null ?
- <><ModulationTable allowHtmlHeader stickyHeader idProperty="modulation" tableId={`adaptive-modulation-${direction}`} title='Select adaptive modulations'
- defaultSortColumn='modulation' defaultSortOrder='desc' rows={row}
- columns={[
- { property: 'modulation', title: 'Supported Modulation', type: ColumnType.text, width: '20px' },
- {
- property: 'enabledModulation', type: ColumnType.custom, title: 'Enabled Modulation',
- customControl: ({ rowData }) => (<Checkbox color="secondary" checked={selectedElements.includes(rowData.modulation)}
- value={rowData.modulation} onClick={(e) => onChange(e)} />),
- },
- { property: 'dataRate', title: 'Data Rate (Mbit/s)', type: ColumnType.numeric },
- { property: 'receiverThresholdBER-3', title: 'Thrs BER 10<sup>-3</sup> (dBm)', type: ColumnType.numeric },
- { property: 'receiverThresholdBER-6', title: 'Thrs BER 10<sup>-6</sup> (dBm)', type: ColumnType.numeric },
- { property: 'receivedSignalLevel', title: 'RSL (dBm)', type: ColumnType.numeric },
- { property: 'linkMarginBER-3', title: 'Margin (dB)\n BER 10<sup>-3</sup>', type: ColumnType.numeric },
- { property: 'linkMarginBER-6', title: 'Margin (dB)\n BER 10<sup>-6</sup>', type: ColumnType.numeric },
- { property: 'txPowerMin', title: 'txPower\nMin(dBm)', type: ColumnType.numeric },
- { property: 'txPowerMax', title: 'txPower\nMax(dBm)', type: ColumnType.numeric },
- { property: 'rainAvailabilityBER-3', title: 'Rain Availability\n BER10<sup>-3</sup>', type: ColumnType.numeric },
- { property: 'rainAvailabilityBER-6', title: 'Rain Availability\n BER10<sup>-6</sup>', type: ColumnType.numeric },
- { property: 'multipathAvailabilityBER-3', title: 'multipath Fading\n BER10<sup>-3</sup>', type: ColumnType.numeric },
- { property: 'multipathAvailabilityBER-6', title: 'multipath Fading\n BER10<sup>-6</sup>', type: ColumnType.numeric },
- ]} />
- <Box>
- <Button variant="contained" color="primary" onClick={() => onClose()} className={classes.closeButton}>
- CANCEL
- </Button>
- <Button variant="contained" color="primary" onClick={() => onSave()} className={classes.applyButton}>
- SAVE
- </Button>
- </Box>
- </>
- : null
- }
- </DialogContent>
- </Dialog>
- </div >
- );
-};
-export default AdaptiveModulationDialog;
+++ /dev/null
-/**
- * ============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 React, { FC, useEffect } from 'react';
-
-import FormControl from '@mui/material/FormControl';
-import FormHelperText from '@mui/material/FormHelperText';
-import InputLabel from '@mui/material/InputLabel';
-import MenuItem from '@mui/material/MenuItem';
-import Select from '@mui/material/Select';
-import Stack from '@mui/material/Stack';
-import TextField from '@mui/material/TextField';
-import Typography from '@mui/material/Typography';
-import makeStyles from '@mui/styles/makeStyles';
-
-import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect';
-
-import { antennaMandatoryAction, UpdateAntennaAction } from '../actions/antennaActions';
-import { Antenna } from '../model/antenna';
-import { TextFieldwithAdornment } from './textFieldwithAdornment';
-
-
-
-const antennaStyles = makeStyles({
- column: {
- width: '220px',
- },
- container: {
- display: 'flex', flexDirection: 'column', width: 'column',
- },
- component: {
- flexDirection: 'row', justifyContent: 'space-around',
- },
-});
-
-const AntennaView: FC = (() => {
- const antennaDb = useSelectApplicationState(state => state.microwave.antenna.antenna);
- const eirpA = useSelectApplicationState(state => state.microwave.antenna.eirpA).toFixed(3);
- const eirpB = useSelectApplicationState(state => state.microwave.antenna.eirpB).toFixed(3);
- const antennaGainA = useSelectApplicationState(state => state.microwave.antenna.antennaGainA);
- const antennaGainB = useSelectApplicationState(state => state.microwave.antenna.antennaGainB);
- const aglA = useSelectApplicationState(state => state.microwave.antenna.antennaHeightA);
- const aglB = useSelectApplicationState(state => state.microwave.antenna.antennaHeightB);
- const lat1 = useSelectApplicationState(state => state.microwave.site.lat1);
- const lon1 = useSelectApplicationState(state => state.microwave.site.lon1);
- const lat2 = useSelectApplicationState(state => state.microwave.site.lat2);
- const lon2 = useSelectApplicationState(state => state.microwave.site.lon2);
- const antennaNameList = useSelectApplicationState(state => state.microwave.antenna.antennaNameList);
- const antennaModelA = useSelectApplicationState(state => state.microwave.antenna.antennaNameA);
- const antennaModelB = useSelectApplicationState(state => state.microwave.antenna.antennaNameB);
-
- const dispatch = useApplicationDispatch();
-
- const updateAntennaParameters = (antennaA: Antenna | null, antennaB: Antenna | null) => {
- dispatch(new UpdateAntennaAction(antennaA, antennaB));
- };
- const updateMandatoryParameters = (mandatoryParameters: boolean) => {
- dispatch(new antennaMandatoryAction(mandatoryParameters));
- };
-
- const classes = antennaStyles();
-
- const checkMandatoryParameters = () => {
- if (antennaModelA !== '0' && antennaModelB !== '0' && antennaGainA !== 0 && antennaGainB !== 0) {
- updateMandatoryParameters(true);
- } else {
- updateMandatoryParameters(false);
- }
- };
- const updateAntennaName = async (antennaA: string | null, antennaB: string | null) => {
- antennaDb.forEach(antenna => {
- if (antennaA === antenna.modelName) {
- updateAntennaParameters(antenna, null);
- }
- if (antenna.modelName === antennaB) {
- updateAntennaParameters(null, antenna);
- }
- });
-
- };
-
- useEffect(() => checkMandatoryParameters(), [antennaModelA, antennaModelB]);
-
- return (
- <div className={classes.container}>
- <Stack className={classes.component}>
- <Typography aria-label="site-a-label" variant="body1" >Site A</Typography>
- <Typography aria-label="site-b-label" variant="body1" >Site B</Typography>
-
- </Stack>
- <Stack className={classes.component}>
-
- <FormControl variant="standard" className={classes.column} >
- <InputLabel >--Antenna--</InputLabel>
- <Select variant="standard"
-
- id="antennaKeyA"
- aria-label="site-a-select-antenna"
- value={antennaModelA} // displayEmpty
- onChange={async (e) => {
- await updateAntennaName(e.target.value as string, null);
- }}
- inputProps={{ name: 'antenna', id: 'antenna' }}
- error={antennaModelA === ''}
- >
- <MenuItem value={'0'} disabled>--Select Antenna--</MenuItem>
- {antennaNameList.sort(function (a, b) { return Number(a) - Number(b); }).map(antenna =>
- (<MenuItem value={antenna} aria-label="site-a-antenna">{antenna}</MenuItem>))}
- </Select>
- {
- antennaModelA === '' && <FormHelperText error> *Required </FormHelperText>
- }
- </FormControl>
-
- <FormControl variant="standard" className={classes.column} >
- <InputLabel >--Antenna--</InputLabel>
- <Select variant="standard"
-
- id="antennaKeyB"
- aria-label="site-b-select-antenna"
- value={antennaModelB} // displayEmpty
- onChange={async (e) => {
- await updateAntennaName(null, e.target.value as string);
- }}
- inputProps={{ name: 'antenna', id: 'antenna' }}
- error={antennaModelB === ''}
- >
- <MenuItem value={'0'} disabled>--Select Antenna--</MenuItem>
- {antennaNameList.sort(function (a, b) { return Number(a) - Number(b); }).map(antenna =>
- (<MenuItem value={antenna} aria-label="site-b-antenna">{antenna}</MenuItem>))}
- </Select>
- {
- antennaModelB === '' && <FormHelperText error> *Required </FormHelperText>
- }
- </FormControl>
-
- </Stack>
- <Stack className={classes.component}>
-
- <TextFieldwithAdornment
- className={classes.column}
- aria-label="site-a-antenna-gain"
- label="Gain"
- errorText=" "
- andornmentUnit="dBi"
- error={false}
- disabled
- value={antennaGainA || 0}
- />
-
- <TextFieldwithAdornment
- className={classes.column}
- aria-label="site-b-antenna-gain"
- label="Gain"
- errorText=" "
- andornmentUnit="dBi"
- error={false}
- disabled
- value={antennaGainB || 0}
- />
-
- </Stack>
- <Stack className={classes.component}>
-
- <TextFieldwithAdornment
- aria-label="site-a-antenna-above-ground-level"
- className={classes.column}
- label="AGL"
- errorText=" "
- andornmentUnit="m"
- error={false}
- disabled
- value={aglA || 0}
- />
-
-
- <TextFieldwithAdornment
- aria-label="site-b-antenna-above-ground-level"
- className={classes.column}
- label="AGL"
- errorText=" "
- andornmentUnit="m"
- error={false}
- disabled
- value={aglB || 0}
- />
-
- </Stack>
- <Stack className={classes.component}>
-
- <TextField
- variant="standard"
- aria-label="site-a-antenna-latitude-longitude-dd"
- className={classes.column}
- label="Latitude/Longitude"
- error={false}
- disabled
- value={lat1 + ' , ' + lon1}
- />
- <TextField
- variant="standard"
- aria-label="site-b-antenna-latitude-longitude-dd"
- className={classes.column}
- label="Latitude/Longitude"
- error={false}
- disabled
- value={lat2 + ' , ' + lon2}
- />
-
- </Stack>
- <Stack className={classes.component}>
- <TextFieldwithAdornment
- className={classes.column}
- aria-label="site-a-effective-isotropic-radiated-power"
- label="EIRP"
- errorText=" "
- andornmentUnit="dBm"
- error={false}
- disabled
- value={eirpA}
- />
-
- <TextFieldwithAdornment
- className={classes.column}
- aria-label="site-b-effective-isotropic-radiated-power"
- label="EIRP"
- errorText=" "
- andornmentUnit="dBm"
- error={false}
- disabled
- value={eirpB}
- />
-
- </Stack>
- </div>
- );
-
-});
-AntennaView.displayName = 'Antenna';
-export default AntennaView;
\ No newline at end of file
+++ /dev/null
-
-/**
- * ============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 React, { FC, useEffect } from 'react';
-
-import FormControl from '@mui/material/FormControl';
-import FormControlLabel from '@mui/material/FormControlLabel';
-import FormHelperText from '@mui/material/FormHelperText';
-import Grid from '@mui/material/Grid';
-import InputLabel from '@mui/material/InputLabel';
-import MenuItem from '@mui/material/MenuItem';
-import Radio from '@mui/material/Radio';
-import RadioGroup from '@mui/material/RadioGroup';
-import Select from '@mui/material/Select';
-import Stack from '@mui/material/Stack';
-import makeStyles from '@mui/styles/makeStyles';
-
-
-import { attenuationMandatoryParametersAction, UpdateAttenuationMethodAction, UpdateRainMethodAction, UpdateRainValAction, UpdateWorstMonthAction } from '../actions/atmosphericLossAction';
-import { UpdatePolAction } from '../actions/linkAction';
-import { UpdateRainMethodDisplayAction } from '../actions/viewAction';
-import OutlinedDiv from './outlinedDiv';
-import { TextFieldwithAdornment } from './textFieldwithAdornment';
-import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect';
-
-
-const styles = makeStyles({
-
- stack: {
- display: 'flex',
- justifyContent: 'center',
- marginTop: '5',
- paddingTop: '15px',
- alignItems:'center',
- },
- grid: {
- display: 'flex',
- flexDirection: 'column',
- width: '500px',
- },
- formStyle: {
- paddingTop: '10px',
- width: '40%',
- },
- waterAbsorptionStyle: {
- display: 'flex',
- placeSelf: 'flex-end',
- width: '35%',
- paddingRight: '62px',
- },
- textFieldwithAdornment: {
- paddingTop: '10px',
- width: '80%',
- },
- insideGridStack: {
- display: 'flex',
- flexDirection: 'row',
- justifyContent: 'space-around',
- },
- centerColumn: {
- display: 'flex',
- justifyContent: 'center',
- marginTop: '5',
- },
-
-});
-
-const AttenuationView: FC = (() => {
- const classes = styles();
- const dispatch = useApplicationDispatch();
- const rainAtt = useSelectApplicationState(state => state.microwave.atmosphere.rainAtt);
- const rainVal = useSelectApplicationState(state => state.microwave.atmosphere.rainVal);
- const absorptionOxygen = useSelectApplicationState(state => state.microwave.atmosphere.absorptionOxygen);
- const absorptionWater = useSelectApplicationState(state => state.microwave.atmosphere.absorptionWater);
- const worstMonth = useSelectApplicationState(state => state.microwave.atmosphere.worstMonth);
- const rainMethod = useSelectApplicationState(state => state.microwave.atmosphere.rainMethod);
- const attenuationMethod = useSelectApplicationState(state => state.microwave.atmosphere.attenuationMethod);
- const rainDisplay = useSelectApplicationState(state => state.microwave.view.rainDisplay);
- const fsl = useSelectApplicationState(state => state.microwave.atmosphere.fsl);
- const polarization = useSelectApplicationState(state => state.microwave.link.polarization);
-
- const updateRainValue = async (rainRate: number) => dispatch(new UpdateRainValAction(rainRate));
- const updateRainMethod = (rainMethodSelect: string) => dispatch(new UpdateRainMethodAction(rainMethodSelect));
-
- const updateAttenuationMethod = (attenuationMethodSelect: string) => dispatch(new UpdateAttenuationMethodAction(attenuationMethodSelect));
- const updateRainMethodDisplay = (rainMethodDisplay: boolean) => dispatch(new UpdateRainMethodDisplayAction(rainMethodDisplay));
- const updateWorstMonth = (worstMonthSelect: string) => {
- if (worstMonthSelect === 'Annual') {
- dispatch(new UpdateWorstMonthAction(false));
- } else dispatch(new UpdateWorstMonthAction(true));
- };
- const updatePolarization = (polarizationSelect: 'HORIZONTAL' | 'VERTICAL' | null) => dispatch(new UpdatePolAction(polarizationSelect));
- const updateMandatoryParameters = (mandatoryParametersPresent: boolean) => dispatch(new attenuationMandatoryParametersAction(mandatoryParametersPresent));
-
-
- const checkMandatoryParameters = () => {
- let error: boolean = false;
- if (rainVal !== 0 && rainMethod.length > 0 && attenuationMethod.length > 0) {
- error = true;
- }
- if (rainVal === 0 && rainMethod === 'ITURP8377' && attenuationMethod.length > 0) {
- error = true;
- }
- updateMandatoryParameters(error);
- };
-
- useEffect(() => {
- checkMandatoryParameters();
- }, [rainVal, rainMethod, attenuationMethod]);
-
-
- const setRainValue = async (rainfall: number) => {
- await updateRainValue(rainfall);
- };
- const handleSelectChange = async (event: any) => {
- if (event.target.name === 'rainmethod') {
- await updateRainMethod(event.target.value as any);
- if (await event.target.value === 'ITURP8377') {
- updateRainMethodDisplay(false);
- } else {
- updateRainMethodDisplay(true);
- }
-
- } else if (event.target.name === 'absorptionmethod') {
- await updateAttenuationMethod(event.target.value as any);
- }
- };
-
- const onRadioSelect = (e: any) => {
-
- if (e.target.name === 'worstmonth') {
- updateWorstMonth(e.target.value);
- } else if (e.target.name === 'polarization') {
- updatePolarization(e.target.value);
- }
- };
-
-
-
- return (
- <div >
- <div className={classes.centerColumn} >
- <RadioGroup row aria-label="worstmonth-label" name="worstmonth" value={worstMonth === false ? 'Annual' : 'Worstmonth'}
- >
- <FormControlLabel aria-label="annual" value='Annual'
- control={<Radio color="secondary" />} label="Annual"
- onChange={onRadioSelect} />
- <FormControlLabel aria-label="worst-month" value="Worstmonth"
- control={<Radio color="secondary" />} label="Worst Month"
- onChange={onRadioSelect} />
- </RadioGroup>
- </div>
- <div className={classes.centerColumn} >
- <TextFieldwithAdornment
- label="FSL"
- errorText=" "
- aria-label="fspl-value"
- andornmentUnit="dB"
- error={false}
- disabled
- value={fsl.toFixed(3)}
- />
- </div>
- <Stack className={classes.stack}>
- <OutlinedDiv label='Rain'>
- <Grid container className={classes.grid}>
- <Stack className={classes.insideGridStack}>
- <FormControl variant="standard" className={classes.formStyle} >
- <InputLabel htmlFor="pass">--Rain Method--</InputLabel>
- <Select variant="standard"
- aria-label="rain-method"
- value={rainMethod} // displayEmpty
- onChange={(e) => {
- handleSelectChange(e);
- }}
- inputProps={{ name: 'rainmethod', id: 'rainmethod' }}
- error={rainMethod.length === 0}
- >
- <MenuItem value={''} aria-label="none-value" disabled>--Select Rain Method--</MenuItem>
- <MenuItem value={'ITURP8377'} aria-label="itur8377">ITU-R P.837-7</MenuItem>
- <MenuItem value={'MANUAL'} aria-label="manual-entry">Specific Rain</MenuItem>
- </Select>
- {rainMethod.length === 0 && <FormHelperText error> * Required </FormHelperText>}
- </FormControl>
- <RadioGroup className={classes.formStyle} aria-label="polarization-label" name="polarization" value={polarization!}
- >
- <FormControlLabel aria-label="polarization-horizontal"
- value='HORIZONTAL'
- control={<Radio color="secondary" />}
- label="Horizontal"
- onChange={onRadioSelect}
- />
- <FormControlLabel aria-label="polarization-vertical"
- value='VERTICAL'
- control={<Radio color="secondary" />}
- label="Vertical"
- onChange={onRadioSelect}
- />
- </RadioGroup>
- </Stack>
- <Stack className={classes.insideGridStack}>
- <TextFieldwithAdornment
- aria-label="rain-value"
- name='rainValue'
- type='number'
- className={classes.textFieldwithAdornment}
- label="rainFall"
- errorText={rainDisplay === true ? ' *Required ' : ''}
- andornmentUnit="mm/hr"
- inputProps={{ name: 'rainValue', id: 'rainValue' }}
- error={rainDisplay === true && rainVal === 0}
- disabled={rainDisplay === false ? true : false}
- onChange={async (e) => {
- await setRainValue(Number(e.target.value));
- }}
- value={rainVal}
- />
- <TextFieldwithAdornment
- label="Rain Loss"
- aria-label="rain-loss"
- className={classes.textFieldwithAdornment}
- errorText=" "
- andornmentUnit="dB"
- error={false}
- disabled
- value={rainAtt.toFixed(3)}
- />
- </Stack>
- </Grid>
- </OutlinedDiv>
- </Stack>
- <Stack className={classes.stack}>
- <OutlinedDiv label='Absorption' >
- <Grid container className={classes.grid}>
- <Stack className={classes.insideGridStack}>
- <FormControl variant="standard" className={classes.formStyle} >
- <InputLabel htmlFor="pass">--Absorption Method--</InputLabel>
- <Select variant="standard"
- aria-label="absorption-method"
- value={attenuationMethod && attenuationMethod} // displayEmpty
- onChange={(e) => {
- handleSelectChange(e);
- }}
- inputProps={{ name: 'absorptionmethod', id: 'absorptionmethod' }}
- error={attenuationMethod.length === 0}
- >
- <MenuItem value={''} aria-label="none-value" disabled>--Select Absorption Method--</MenuItem>
- <MenuItem value="ITURP67612" aria-label="iturp67612">ITU-R P.676-12</MenuItem>
- <MenuItem value="ITURP67611" aria-label="iturp67611">ITU-R P.676-11</MenuItem>
- <MenuItem value="ITURP67610" aria-label="iturp67610">ITU-R P.676-10</MenuItem>
- </Select>
- {(attenuationMethod.length === 0) && <FormHelperText error> * Required </FormHelperText>}
- </FormControl>
- <TextFieldwithAdornment
- label="Oxygen absorption"
- aria-label="absorption-oxygen-value"
- className={classes.textFieldwithAdornment}
- errorText=" "
- andornmentUnit="dB"
- error={false}
- disabled
- value={absorptionOxygen.toFixed(3)}
- />
- </Stack>
- <Stack className={classes.waterAbsorptionStyle}>
- <TextFieldwithAdornment
- label="water vapor absorption"
- aria-label="absorption-water-value"
- errorText=" "
- andornmentUnit="dB"
- error={false}
- disabled
- value={absorptionWater.toFixed(3)}
- />
- </Stack>
- </Grid>
- </OutlinedDiv>
- </Stack>
- </div>
- );
-});
-
-export default AttenuationView;
\ No newline at end of file
+++ /dev/null
-
-/**
- * ============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 React, { useEffect, FC } from 'react';
-
-import CloseIcon from '@mui/icons-material/Close';
-import makeStyles from '@mui/styles/makeStyles';
-import { InputProps } from '@mui/material/Input';
-import Dialog from '@mui/material/Dialog';
-import DialogContentText from '@mui/material/DialogContentText';
-import DialogTitle from '@mui/material/DialogTitle';
-import DialogContent from '@mui/material/DialogContent';
-import DialogActions from '@mui/material/DialogActions';
-import IconButton from '@mui/material/IconButton';
-import Box from '@mui/material/Box';
-import Stack from '@mui/material/Stack';
-import Button from '@mui/material/Button';
-import Checkbox from '@mui/material/Checkbox';
-import FormControl from '@mui/material/FormControl';
-import Select from '@mui/material/Select';
-import MenuItem from '@mui/material/MenuItem';
-import FormHelperText from '@mui/material/FormHelperText';
-import TextField from '@mui/material/TextField';
-
-import MaterialTable, { ColumnType, MaterialTableCtorType } from '../../../../../framework/src/components/material-table';
-import { ChannelTable } from '../model/bandPlan';
-import { TextFieldwithAdornment } from './textFieldwithAdornment';
-import ConnectionInfo from './connectionInfo';
-
-
-type PropTypes = InputProps & {
- style?: React.CSSProperties;
- linkId: number;
- open: boolean;
- close(): void;
- row: ChannelTable[];
- updatechannels(data: ChannelTable[], totalBandwidthMHz: number): void;
- frequencyPlanSiteA: 'HIGH' | 'LOW';
- frequencyPlanSiteB: 'HIGH' | 'LOW';
- band: number;
- selectedElementProp: ChannelTable[];
-};
-
-const ChannelSelectTable = MaterialTable as MaterialTableCtorType<ChannelTable>;
-const styles = makeStyles({
- closeIcon: {
- position: 'absolute',
- top: 0,
- right: 0,
- color: 'black',
- },
- closeButton: {
- marginTop: 10, position: 'absolute', top: '750px', right: '50px',
- },
- applyButton: {
- marginTop: 10, position: 'absolute', top: '750px', right: '160px',
- },
- tables: {
- height: '700px',
- },
- dialogContent: {
- height: '900px',
- },
- summary: {
- position: 'absolute', right: '160px',
- },
- error: {
- height: '200px',
- },
-});
-
-export const ChannelListDialog: FC<PropTypes> = ({ open, row, close, updatechannels, linkId, band, frequencyPlanSiteA, frequencyPlanSiteB, selectedElementProp }) => {
-
- const [polarizationAlert, setPolarizationAlert] = React.useState(false);
- const [selectedElements, setSelectedElements] = React.useState<ChannelTable[]>(selectedElementProp);
- const [totalBandwidthMHz, setTotalBandwidthMHz] = React.useState<number>(0);
-
- const classes = styles();
-
- const onChange = (tableRow: ChannelTable, checked: boolean) => {
-
- if (checked) {
- setSelectedElements(selectedElements.filter((x) => x.name !== tableRow.name));
- if (tableRow.polarization.length !== 0) {
- if (tableRow.polarization === 'XPOL') {
- setTotalBandwidthMHz(totalBandwidthMHz - 2 * tableRow.bandwidthMHz);
- } else setTotalBandwidthMHz(totalBandwidthMHz - tableRow.bandwidthMHz);
- }
-
-
- } else {
- tableRow.polarization = '';
- setSelectedElements([...selectedElements, tableRow]);
- // setTotalBandwidthMHz(totalBandwidthMHz + tableRow.bandwidthMHz);
- }
- };
-
- const onClose = () => {
- close();
- };
-
- const onSave = () => {
- let checker = false;
- selectedElements.forEach(channel => {
- if (channel.polarization === '') {
- checker = true;
- setPolarizationAlert(true);
- }
- });
- if (!checker) {
- setPolarizationAlert(false);
- updatechannels(selectedElements, totalBandwidthMHz);
- close();
- }
- };
-
-
- const setChannelPolarization = (tableRow: ChannelTable, polarization: 'HORIZONTAL' | 'VERTICAL' | 'XPOL' | '') => {
-
- if (tableRow.polarization === 'HORIZONTAL' || tableRow.polarization === 'VERTICAL') {
- if (polarization === 'XPOL') {
- setTotalBandwidthMHz(totalBandwidthMHz + tableRow.bandwidthMHz);
- } else setTotalBandwidthMHz(totalBandwidthMHz);
- } else if (tableRow.polarization === '') {
- if (polarization === 'XPOL') {
- setTotalBandwidthMHz(totalBandwidthMHz + 2 * tableRow.bandwidthMHz);
- } else {
- setTotalBandwidthMHz(totalBandwidthMHz + tableRow.bandwidthMHz);
- }
- } else if (polarization === 'XPOL') {
- setTotalBandwidthMHz(totalBandwidthMHz );
- } else {
- debugger;
- setTotalBandwidthMHz(totalBandwidthMHz - tableRow.bandwidthMHz);
- }
-
-
- tableRow.polarization = polarization;
- setSelectedElements(selectedElements.map(x => {
- if (x.keyId === tableRow.keyId) {
- return tableRow;
- } else return x;
- }));
- };
-
- useEffect(() => {
- let bandwidthList: number[] = [];
- row.forEach(x => {
- selectedElementProp.forEach(tableRow => {
- if (tableRow.keyId === x.keyId) {
- if (tableRow.polarization === 'XPOL') {
- bandwidthList.push(2 * x.bandwidthMHz);
- } else bandwidthList.push(x.bandwidthMHz);
- }
- });
- });
- row.map(eachRow => {
- selectedElements.forEach(selectedRow => {
- if (eachRow.keyId === selectedRow.keyId) {
- eachRow.polarization = selectedRow.polarization;
- }
- });
- });
- setTotalBandwidthMHz(bandwidthList.reduce((partialSum, a) => partialSum + a, 0));
- }, []);
-
-
-
- return (
- <>
- <Dialog onClose={() => onClose()} open={open} fullWidth maxWidth={'lg'} >
- <DialogContent className={classes.dialogContent}>
- <DialogContentText>
- Channel
- </DialogContentText>
-
- <div style={{ display: 'flex', flexDirection: 'row' }}>
- <DialogTitle>Channel Select for link : {linkId}</DialogTitle>
- <Stack className={classes.summary}>
- <TextField
- variant="standard"
- aria-label="site-b-channel"
- label="Channel"
- error={false}
- disabled
- value={selectedElements.map(x => x.name)}
- />
- <TextFieldwithAdornment
- label="Total Bandwidth"
- errorText=" "
- andornmentUnit="MHz"
- error={false}
- disabled
- value={totalBandwidthMHz}
- />
- </Stack>
- </div>
-
-
- <DialogActions>
- <IconButton
- aria-label="close"
- className={classes.closeIcon}
- onClick={() => onClose()}
- size="large">
- <CloseIcon />
- </IconButton>
- </DialogActions>
- {row !== null ?
- <>
- <Stack className={classes.tables}>
-
- <ChannelSelectTable allowHtmlHeader stickyHeader idProperty="name" tableId={`channel-list-${linkId}`} title={'Channels (' + band + ' GHz)'}
- defaultSortColumn='name' defaultSortOrder='desc' rows={row}
- columns={[
- { property: 'name', title: 'Channel', type: ColumnType.text, width: 5 },
- {
- property: 'enabledChannel', type: ColumnType.custom, title: 'Select Channel',
- customControl: ({ rowData }) => (<Checkbox color="secondary" checked={selectedElements.filter(i => i.name === rowData.name).length > 0}
- value={rowData.name} onClick={() => onChange(rowData, selectedElements.filter(i => i.name === rowData.name).length > 0)} />), width: 8,
- },
- { property: 'bandwidthMHz', title: 'Bandwidth (MHz)', type: ColumnType.numeric, width: 3 },
- { property: 'centerFrequencyHigh', title: 'Frequency ' + frequencyPlanSiteA + '(MHz)', type: ColumnType.numeric, width: 3 },
- { property: 'centerFrequencyLow', title: 'Frequency ' + frequencyPlanSiteB + '(MHz)', type: ColumnType.numeric, width: 3 },
- {
- property: 'polarization', type: ColumnType.custom, title: 'Polarization', customControl: ({ rowData }) => (
- <Stack>
- <FormControl>
- <Select variant="standard" value={rowData.polarization}
- onChange={(e) => { setChannelPolarization(rowData, e.target.value as 'HORIZONTAL' | 'VERTICAL' | 'XPOL' | ''); }}
- defaultValue={''}
- disabled={selectedElements.filter(i => i.name === rowData.name).length === 0}
- fullWidth
- error={selectedElements.filter(i => i.name === rowData.name).length > 0 && rowData.polarization.length === 0} >
- <MenuItem value={''} ></MenuItem>
- <MenuItem value={'HORIZONTAL'} >HORIZONTAL</MenuItem>
- <MenuItem value={'VERTICAL'} >VERTICAL</MenuItem>
- <MenuItem value={'XPOL'} >XPOL</MenuItem>
- </Select>
- {selectedElements.filter(i => i.name === rowData.name).length > 0 && rowData.polarization.length === 0 && <FormHelperText error> *Required </FormHelperText>}
- </FormControl>
- </Stack>
- ),
- },
- { property: 'availability', title: 'Availability', type: ColumnType.text, width: 3 },
- { property: 'xPolCondition', title: 'XPol', type: ColumnType.text, width: 3 },
- ]} />
-
- </Stack>
- <Box>
- <Button variant="contained" color="primary" onClick={() => onClose()} className={classes.closeButton}>
- CANCEL
- </Button>
- <Button variant="contained" color="primary" onClick={() => onSave()} className={classes.applyButton} >
- SAVE
- </Button>
- </Box>
- </>
-
- : null
-
- }
- </DialogContent>
-
- </Dialog>
-
- {
- polarizationAlert &&
- <Stack>
- <Dialog fullWidth maxWidth={'lg'} open={polarizationAlert} >
- <DialogContent className={classes.error}>
-
- <DialogActions>
- <IconButton
- aria-label="close"
- className={classes.closeIcon}
- onClick={() => setPolarizationAlert(false)}
- size="large">
- <CloseIcon />
- </IconButton>
- </DialogActions>
-
- <ConnectionInfo
- messageType={'Saving Error'}
- message={'Select a polarization'}
- reachable={!polarizationAlert}
- />
-
- </DialogContent>
- </Dialog>
- </Stack>
- }
-
-
-
-
- </>
- );
-};
-export default ChannelListDialog;
+++ /dev/null
-/**
- * ============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 React, { FC } from 'react';
-import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
-
-import makeStyles from '@mui/styles/makeStyles';
-import { InputProps } from '@mui/material/Input';
-import Paper from '@mui/material/Paper';
-import Typography from '@mui/material/Typography';
-
-
-type PropTypes = InputProps & {
- message : string;
- messageType: string;
- reachable: boolean;
-};
-const ConnectionInfo: FC<PropTypes> = (props : PropTypes) => {
- const connectionStyles = makeStyles({
- pasperStyle: {
- padding: 5, width: 230, position: 'absolute', top: '40%', left: '40%',
- },
- wrappingDiv: {
- display: 'flex', flexDirection: 'column',
- },
- componentDiv: {
- 'alignSelf': 'center', marginBottom: 5,
- },
- });
- const classes = connectionStyles();
- return (
- (props.reachable === false) ?
- <Paper className={classes.pasperStyle}>
- <div className={classes.wrappingDiv}>
- <div className={classes.componentDiv}>
- <Typography>
- <FontAwesomeIcon icon={faExclamationTriangle} />
- {props.messageType}
- </Typography>
- </div>
- <Typography> {props.message}</Typography>
- </div>
- </Paper> : null
-
- );
-};
-
-
-export default ConnectionInfo;
-
+++ /dev/null
-/**
- * ============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 React, { useEffect, FC, useState } from 'react';
-
-import makeStyles from '@mui/styles/makeStyles';
-import Stack from '@mui/material/Stack';
-import InputLabel from '@mui/material/InputLabel';
-import FormControl from '@mui/material/FormControl';
-import Select from '@mui/material/Select';
-import MenuItem from '@mui/material/MenuItem';
-import FormHelperText from '@mui/material/FormHelperText';
-import Grid from '@mui/material/Grid';
-import RadioGroup from '@mui/material/RadioGroup';
-import FormControlLabel from '@mui/material/FormControlLabel';
-import Radio from '@mui/material/Radio';
-import TextField from '@mui/material/TextField';
-import Box from '@mui/material/Box';
-import Button from '@mui/material/Button';
-import Dialog from '@mui/material/Dialog';
-import DialogContent from '@mui/material/DialogContent';
-import DialogContentText from '@mui/material/DialogContentText';
-import Paper from '@mui/material/Paper';
-import DialogActions from '@mui/material/DialogActions';
-import IconButton from '@mui/material/IconButton';
-import CloseIcon from '@mui/icons-material/Close';
-import CircularProgress from '@mui/material/CircularProgress';
-
-import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect';
-
-import { UpdateFrequencyPlanAction } from '../actions/linkAction';
-import { frequencyMandatoryParametersAction, ResetAction, updateFrequencyBand, UpdateTotalBandwidthAction } from '../actions/radioActions';
-import OutlinedDiv from './outlinedDiv';
-import { getAllBands, UpdateChannelQuery, UpdateChannelListLoadingAction, UpdateRegionRegulatorAction, UpdateChannelListAction } from '../actions/bandPlanAction';
-import { ChannelTable, RegionRegulator } from '../model/bandPlan';
-import ChannelListDialog from './channelListDialog';
-import ConnectionInfo from './connectionInfo';
-import { TextFieldwithAdornment } from './textFieldwithAdornment';
-
-const styles = makeStyles({
- fitContent: {
- width: 'fit-content',
- },
- column: {
- width: '220px',
- },
- container: {
- display: 'flex', flexDirection: 'column', width: 'column',
- },
- component: {
- flexDirection: 'row', justifyContent: 'space-around',
- },
- centerColumn: {
- display: 'flex',
- alignItems: 'center',
- marginTop: '5',
- },
- channelRow: {
- flexDirection: 'row', justifyContent: 'space-evenly',
- },
- loading: {
- position: 'absolute', top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', backgroundColor: 'rgba(255, 255, 255, 0.7)', zIndex: 9999,
-
- },
- closeIcon: {
- marginTop: 20, top: '-75px', right: '-40px',
- },
-});
-
-const FrequencyChannelView: FC = (() => {
- const [isOpenDialog, setOpenDialog] = useState(false);
- const band = useSelectApplicationState(state => state.microwave.radio.band);
- const frequencyPlanA = useSelectApplicationState(state => state.microwave.bandPlan.frequencyPlanA);
- const frequencyPlanB = useSelectApplicationState(state => state.microwave.bandPlan.frequencyPlanB);
- const bandList = useSelectApplicationState(state => state.microwave.bandPlan.bandList);
- const regionRegulatorList = useSelectApplicationState(state => state.microwave.bandPlan.regionRegulatorList);
- const regulator = useSelectApplicationState(state => state.microwave.bandPlan.region);
- const processing = useSelectApplicationState(state => state.microwave.bandPlan.channelListLoading);
- const linkId = useSelectApplicationState(state => state.microwave.link.linkId);
- const channelListQuery = useSelectApplicationState(state => state.microwave.bandPlan.channelListQuery);
- const allChannels = useSelectApplicationState(state => state.microwave.bandPlan.allChannels);
- const totalBandwidthMHz = useSelectApplicationState(state => state.microwave.radio.totalBandwidthMHz);
- const frequencyPlanProcessing = useSelectApplicationState(state => state.microwave.bandPlan.frequencyPlanProcessing);
- const savedChannels = useSelectApplicationState(state => state.microwave.bandPlan.savedChannels);
- const dispatch = useApplicationDispatch();
-
- const updateFrequency = (bandKeyId: string) => dispatch(updateFrequencyBand(bandKeyId));
- const updateFrequencyPlan = (planA: 'HIGH' | 'LOW', planB: 'HIGH' | 'LOW') => dispatch(new UpdateFrequencyPlanAction(planA, planB));
- const updateMandatoryParameters = (mandatoryParameters: boolean) => dispatch(new frequencyMandatoryParametersAction(mandatoryParameters));
- const updateRegion = (region: RegionRegulator) => {
- dispatch(new UpdateRegionRegulatorAction(region));
- dispatch(new ResetAction());
- };
- const getBandList = (bandplanKeyId: string) => dispatch(getAllBands(bandplanKeyId));
- const channelList = async (regionId: string, bandKeyId: string) => dispatch(UpdateChannelQuery(regionId, bandKeyId));
- const updatechannelsAndBandwidth = (channels: ChannelTable[], bandwidthMHz: number) => {
- dispatch(new UpdateChannelListAction(channels));
- dispatch(new UpdateTotalBandwidthAction(bandwidthMHz));
- };
- const updateChannelListLoading = (proccessing: boolean) => dispatch(new UpdateChannelListLoadingAction(proccessing));
-
- const classes = styles();
-
- const frequencyChange = async (frequency: number) => {
- if (frequency !== band.frequency) {
- bandList.forEach(x => {
- if (x.name === frequency.toString()) {
- updateFrequency(x.keyId);
- }
- });
-
- }
-
- };
- const regionChange = async (regionAsString: string) => {
- if (regionAsString !== regulator.name) {
- regionRegulatorList.forEach(async region => {
- if (regionAsString === region.name) {
- await updateRegion(region);
- getBandList(region.keyId);
- }
- });
- }
-
- };
- const onRadioSelect = (e: any) => {
- if (e.target.name === 'site-a-frequency-plan') {
- if (e.target.value === 'HIGH') {
- updateFrequencyPlan(e.target.value, 'LOW');
- } else {
- updateFrequencyPlan(e.target.value, 'HIGH');
- }
- } else if (e.target.name === 'site-b-frequency-plan') {
- if (e.target.value === 'HIGH') {
- updateFrequencyPlan('LOW', e.target.value);
- } else {
- updateFrequencyPlan('HIGH', e.target.value);
- }
- }
- };
-
-
- const checkMandatoryParameters = () => {
- if (band.frequency !== 0) {
- updateMandatoryParameters(true);
- } else {
- updateMandatoryParameters(false);
- }
- };
- const handleClickOpen = (show: boolean) => {
- setOpenDialog(show);
- };
- const getChannelList = async () => {
-
- bandList.forEach(x => {
- if (x.keyId === band.keyId) {
- channelList(regulator.keyId, band.keyId);
- }
- });
- handleClickOpen(true);
- };
- const handleDialogClose = () => {
- updateChannelListLoading(true);
- setOpenDialog(false);
-
- };
- const updatechannels = (selectedChannels: ChannelTable[], bandwidthMHz: number) => {
- updatechannelsAndBandwidth(selectedChannels, bandwidthMHz);
-
- };
- useEffect(() => {
- checkMandatoryParameters();
- }, [band.frequency]);
-
- return (
- <div>
- {frequencyPlanProcessing ?
- <Paper>
- <div className={classes.loading}>
- <CircularProgress style={{ color: '#2596be' }} />
- </div>
- </Paper>
- :
- <div className={classes.container}>
- <Stack className={classes.centerColumn}>
- <FormControl variant="standard" className={classes.column} >
- <InputLabel>--Region--</InputLabel>
- <Select variant="standard"
- id="region"
- aria-label="region-select"
- value={regulator.name}
- onChange={async (e) => {
- regionChange(e.target.value as string);
- }}
- error={band.frequency == 0}
- >
- <MenuItem value={''} disabled>--Select Region--</MenuItem>
- {regionRegulatorList.map(region => (<MenuItem value={region.name} aria-label='region-regulator'>{region.name}</MenuItem>))}
- </Select>
- {band.frequency == 0 && <FormHelperText error> *Required </FormHelperText>}
- </FormControl>
- </Stack>
- <Stack className={classes.centerColumn}>
- <FormControl variant="standard" className={classes.column} >
- <InputLabel>--Band (GHz) --</InputLabel>
- <Select variant="standard"
- id="frequencyKey"
- aria-label="frequency-select"
- value={band.frequency}
- onChange={async (e) => {
- await frequencyChange(e.target.value as number);
- }}
- error={band.frequency == 0}
- >
- <MenuItem value={'0'} disabled>--Select band--</MenuItem>
- {bandList.map(x => Number.parseFloat(x.name)).sort(function (a, b) { return Number(a) - Number(b); }).map(frequencyBand =>
- (<MenuItem value={frequencyBand} aria-label="frequency-band">{frequencyBand}</MenuItem>))}
- </Select>
- {band.frequency == 0 && <FormHelperText error> *Required </FormHelperText>}
- </FormControl>
- </Stack>
- <Stack className={classes.centerColumn}>
- <TextFieldwithAdornment
- aria-label="total-bandwidth"
- label="Total Bandwidth"
- errorText=" "
- andornmentUnit="MHz"
- error={false}
- disabled
- value={totalBandwidthMHz}
- />
- </Stack>
- <Stack className={classes.component}>
- <OutlinedDiv className={classes.fitContent} label="Frequency Plan" aria-label="site-a-frequency-plan" >
- <Grid container justifyContent="center" alignItems="center" >
- <RadioGroup row aria-label="site-a-frequency-plan-label" name="site-a-frequency-plan" value={frequencyPlanA}
- >
- <FormControlLabel value='HIGH' control={<Radio color="secondary" aria-label="site-a-frequency-plan-high" />} label="High" onChange={onRadioSelect} />
- <FormControlLabel value='LOW' control={<Radio color="secondary" aria-label="site-a-frequency-plan-low" />} label="Low" onChange={onRadioSelect} />
- </RadioGroup>
- </Grid>
- </OutlinedDiv>
- <OutlinedDiv className={classes.fitContent} label="Frequency Plan" aria-label="site-b-frequency-plan">
- <Grid container justifyContent="center" alignItems="center" >
- <RadioGroup row aria-label="site-b-frequency-plan-label" name="site-b-frequency-plan" value={frequencyPlanB}
- >
- <FormControlLabel value='HIGH' control={<Radio color="secondary" aria-label="site-b-frequency-plan-high" />} label="High" onChange={onRadioSelect} />
- <FormControlLabel value='LOW' control={<Radio color="secondary" aria-label="site-b-frequency-plan-low" />} label="Low" onChange={onRadioSelect} />
- </RadioGroup>
- </Grid>
- </OutlinedDiv>
- </Stack>
- <Stack className={classes.channelRow}>
- <TextField
- variant="standard"
- className={classes.fitContent}
- aria-label="site-a-channel"
- label="Channel"
- error={false}
- disabled
- value={savedChannels.map(x => x.polarization === 'XPOL' ? x.name + '[xpol]' : x.name)}
- />
- <Stack className={classes.centerColumn}>
- <Box textAlign='center' className={classes.fitContent}>
- <Button aria-label="select-channel-button" variant="contained"
- color="primary"
- name="selectChannel"
- onClick={getChannelList}
- >
- Select Channel
- </Button >
- </Box>
- </Stack>
- <TextField
- variant="standard"
- className={classes.fitContent}
- aria-label="site-b-channel"
- label="Channel"
- error={false}
- disabled
- value={savedChannels.map(x => x.polarization === 'XPOL' ? x.name + '[xpol]' : x.name)}
- />
- </Stack>
- <div>
- {isOpenDialog &&
- <>
- {processing ?
- <Stack className={classes.loading}>
- <Dialog onClose={handleDialogClose} open={isOpenDialog} fullWidth maxWidth={'lg'} >
- <DialogContent>
- <DialogContentText>
- Channel Select
- </DialogContentText>
- <DialogActions>
- <IconButton
- aria-label="close"
- className={classes.closeIcon}
- onClick={handleDialogClose}
- size="large">
- <CloseIcon />
- </IconButton>
- </DialogActions>
- <Paper>
- <div className={classes.loading}>
- <CircularProgress style={{ color: '#2596be' }} />
- <h3>Processing ...</h3>
- </div>
- </Paper>
- </DialogContent>
- </Dialog>
- </Stack>
- :
- <>
- {channelListQuery.length > 0 ?
- <Stack>
- <ChannelListDialog
- close={handleDialogClose}
- open={isOpenDialog}
- band={band.frequency}
- linkId={linkId}
- frequencyPlanSiteA={frequencyPlanA!}
- frequencyPlanSiteB={frequencyPlanB!}
- row={allChannels}
- selectedElementProp={savedChannels}
- updatechannels={updatechannels}
- />
- </Stack>
- :
- <div>
- <Dialog onClose={handleDialogClose} open={isOpenDialog} fullWidth maxWidth={'lg'} >
- <DialogContent>
- <DialogContentText>
- Channel
- </DialogContentText>
- <DialogActions>
- <IconButton
- aria-label="close"
- className={classes.closeIcon}
- onClick={handleDialogClose}
- size="large">
- <CloseIcon />
- </IconButton>
- </DialogActions>
- <Paper>
- <ConnectionInfo
- message={''}
- messageType={'Calculation Error'}
- reachable={channelListQuery.length === 0 }
- />
- </Paper>
- </DialogContent>
- </Dialog>
- </div>
-
- }
- </>
- }
- </>
- }
-
- </div >
- </div >
- }
- </div>
- );
-
-});
-FrequencyChannelView.displayName = 'Frequency';
-export default FrequencyChannelView;
-
-
+++ /dev/null
-/**
- * ============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 React, { FC, useEffect } from 'react';
-
-import { Loader } from '../../../../../framework/src/components/material-ui/loader';
-
-import { NavigateToApplication } from '../../../../../framework/src/actions/navigationActions';
-import { ColumnType, MaterialTable, MaterialTableCtorType } from '../../../../../framework/src/components/material-table';
-import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect';
-import { Link } from '../../lineOfSight/model/lineOfSightLatLon';
-import { getLinkDetails } from '../../lineOfSight/service/lineOfSightHeightService';
-import { createLinkTableActions, createLinkTableProperties } from '../handlers/linkTableHandler';
-import MenuItem from '@mui/material/MenuItem';
-import Typography from '@mui/material/Typography';
-
-
-
-const LinkTable = MaterialTable as MaterialTableCtorType<any>;
-
-
-let initialSorted = false;
-
-const LinkTableComponent: FC = (() => {
-
- const linkTableProperties = createLinkTableProperties(useSelectApplicationState(state => state));
- const loading = linkTableProperties.loading;
- const dispatch = useApplicationDispatch();
- const linkTableActions = createLinkTableActions(dispatch);
- const navigateToApplication = (applicationName: string, path?: string) => dispatch(new NavigateToApplication(applicationName, path));
-
- useEffect(() => {
- if (!initialSorted) {
- initialSorted = true;
- linkTableActions.onHandleRequestSort('id');
- } else {
- linkTableActions.onRefresh();
- }
- }, []);
-
- const getContextMenu = (rowData: any) => {
- return [
- <MenuItem aria-label={'calculate-link-button'} onClick={() => {
- navigateToApplication('microwave', `calculateLink/?linkId=${rowData.id}`);
- }}>
- <Typography>Calculate Link</Typography>
- </MenuItem>,
- <MenuItem aria-label={'lineOfSight-link-button'} onClick={async () => {
- await getLinkDetails(rowData.id).then((data: Link) => {
- let heightPart = `&amslA=${data.siteA.amslM}&antennaHeightA=${data.siteA.radioAntenna.operationalParameters.agl}&amslB=${data.siteB.amslM}&antennaHeightB=${data.siteB.radioAntenna.operationalParameters.agl}`;
- navigateToApplication('microwave', `lineOfSightMap/los?lat1=${data.siteA.lat}&lon1=${data.siteA.lon}&lat2=${data.siteB.lat}&lon2=${data.siteB.lon}${heightPart}`);
- });
- }}>
- <Typography>Line Of Sight</Typography>
- </MenuItem>,
- ];
- };
-
- return (
- <div style={{ position: 'relative' }}>
- <div
- style={{
- position: 'absolute',
- top: '50%',
- left: '50%',
- transform: 'translate(-50%, -50%)',
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
- height: '100%',
- flex: '1',
- zIndex: 9999,
- }}
- >
- {loading && (
- <div >
- <Loader />
- <h3>Loading...</h3>
- </div>
- )
- }
- </div>
- <LinkTable stickyHeader tableId="link-table" columns={[
- { property: 'id', title: 'Id', type: ColumnType.numeric },
- {
- property: 'siteA', title: 'SiteA', type: ColumnType.custom, customControl: ({ rowData }) => {
- return <>{rowData.siteA.id}</>;
- },
- },
- {
- property: 'siteB', title: 'SiteB', type: ColumnType.custom,
- customControl: ({ rowData }) => {
- return <>{rowData.siteB.id}</>;
- },
- },
- { property: 'operationalState', title: 'operational State', type: ColumnType.text },
- { property: 'operatorId', title: 'Operator Id', type: ColumnType.text },
- { property: 'lifecycleState', title: 'life Cycle State', type: ColumnType.text },
- ]}
- idProperty="id" {...linkTableActions} {...linkTableProperties}
- createContextMenu={(rowData) => {
- return getContextMenu(rowData);
- }} />
- </div>
- );
-});
-
-
-export default LinkTableComponent;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 * as React from 'react';
-
-import TextField from '@mui/material/TextField';
-import Typography from '@mui/material/Typography';
-import makeStyles from '@mui/styles/makeStyles';
-import Stack from '@mui/material/Stack';
-
-import { useSelectApplicationState } from '../../../../../framework/src/flux/connect';
-import { LatLonToDMS } from '../utils/geoConverter';
-
-import { TextFieldwithAdornment } from './textFieldwithAdornment';
-import ManualLocationEnter from './manualLocationEntr';
-
-const styles = makeStyles({
- column: {
- width: '220px',
- },
- container: {
- display: 'flex', flexDirection: 'column', width: 'column',
- },
- component: {
- flexDirection: 'row', justifyContent: 'space-around',
- },
- centerColumn: {
- display: 'flex',
- alignItems: 'center',
- marginTop: '5',
- },
-});
-
-
-const LocationView: React.FC = (() => {
- const linkId = useSelectApplicationState(state => state.microwave.link.linkId);
- const lat1 = useSelectApplicationState(state => state.microwave.site.lat1);
- const lon1 = useSelectApplicationState(state => state.microwave.site.lon1);
- const lat2 = useSelectApplicationState(state => state.microwave.site.lat2);
- const lon2 = useSelectApplicationState(state => state.microwave.site.lon2);
- const formView = useSelectApplicationState(state => state.microwave.view.formView);
- const siteA = useSelectApplicationState(state => state.microwave.site.siteNameA);
- const siteB = useSelectApplicationState(state => state.microwave.site.siteNameB);
- const distance = useSelectApplicationState(state => state.microwave.link.distance);
- const amslA = useSelectApplicationState(state => state.microwave.site.amslA);
- const amslB = useSelectApplicationState(state => state.microwave.site.amslB);
- const siteAId = useSelectApplicationState(state => state.microwave.site.siteIdA);
- const siteBId = useSelectApplicationState(state => state.microwave.site.siteIdB);
- const azimuthDegSiteA = useSelectApplicationState(state => state.microwave.site.azimuthA);
- const azimuthDegSiteB = useSelectApplicationState(state => state.microwave.site.azimuthB);
- const tiltDegSiteA = useSelectApplicationState(state => state.microwave.site.tiltDegA);
- const tiltDegSiteB = useSelectApplicationState(state => state.microwave.site.tiltDegB);
-
-
- const classes = styles();
-
- return (
- <>
-
- {!formView &&
- <ManualLocationEnter />
- }
- <div className={classes.container}>
- <Stack className={classes.centerColumn}>
- <TextField variant="standard" aria-label='linkid' disabled value={linkId} label="LinkID" className={classes.column} />
- </Stack>
-
- <Stack className={classes.component}>
- <Typography aria-label="site-a-label" variant="body1" >Site A</Typography>
-
- <Typography aria-label="site-b-label" variant="body1" >Site B</Typography>
- </Stack>
- <Stack className={classes.component}>
-
- <TextField variant="standard"
- aria-label="site-a-id-label"
- className={classes.column}
- label="Site ID"
- error={false}
- disabled
- value={siteAId}
- />
-
-
- <TextField variant="standard"
- aria-label="site-b-id-label"
- className={classes.column}
- label="Site ID"
- error={false}
- disabled
- value={siteBId}
- />
-
- </Stack>
- <Stack className={classes.component}>
-
- <TextField variant="standard"
- aria-label="site-a-name-label"
- className={classes.column}
- label="Site Name"
- error={false}
- disabled
- value={siteA}
- />
-
- <TextField variant="standard"
- aria-label="site-b-name-label"
- className={classes.column}
- label="Site Name"
- error={false}
- disabled
- value={siteB}
- />
-
- </Stack>
- <Stack className={classes.component}>
-
- <TextField variant="standard"
- aria-label="site-a-latitude-dms"
- className={classes.column}
- label="Latitude"
- error={false}
- disabled
- value={lat1 && LatLonToDMS(lat1, false)}
- />
-
-
- <TextField variant="standard"
- aria-label="site-b-latitude-dms"
- className={classes.column}
- label="Latitude"
- error={false}
- disabled
- value={lat2 && LatLonToDMS(lat2, false)}
- />
-
- </Stack>
- <Stack className={classes.component}>
-
- <TextField variant="standard"
- aria-label="site-a-longitude-dms"
- className={classes.column}
- label="Longitude"
- error={false}
- disabled
- value={lon1 && LatLonToDMS(lon1, true)}
- />
-
- <TextField variant="standard"
- aria-label="site-b-longitude-dms"
- className={classes.column}
- label="Longitude"
- error={false}
- disabled
- value={lon2 && LatLonToDMS(lon2, true)}
- />
-
- </Stack>
- <Stack className={classes.component}>
-
- <TextField variant="standard"
- className={classes.column}
- aria-label="site-a-azimuth"
- label="Azimuth"
- error={false}
- disabled
- value={azimuthDegSiteA && azimuthDegSiteA.toFixed(3)}
- />
-
- <TextField variant="standard"
- className={classes.column}
- aria-label="site-b-azimuth"
- label="Azimuth"
- error={false}
- disabled
- value={azimuthDegSiteB && azimuthDegSiteB.toFixed(3)}
- />
-
- </Stack>
- <Stack className={classes.component}>
-
- <TextField variant="standard"
- className={classes.column}
- aria-label="site-a-tilt"
- label="Tilt"
- error={false}
- disabled
- value={tiltDegSiteA && tiltDegSiteA.toFixed(3)}
- />
-
-
- <TextField variant="standard"
- className={classes.column}
- aria-label="site-b-tilt"
- label="Tilt"
- error={false}
- disabled
- value={tiltDegSiteB && tiltDegSiteB.toFixed(3)}
- />
-
- </Stack>
- <Stack className={classes.component}>
-
- <TextFieldwithAdornment
- className={classes.column}
- aria-label="site-a-amsl"
- label="AMSL"
- errorText=" "
- andornmentUnit="m"
- error={false}
- disabled
- value={amslA && amslA.toFixed(2)}
- />
-
-
- <TextFieldwithAdornment
- className={classes.column}
- aria-label="site-b-amsl"
- label="AMSL"
- errorText=" "
- andornmentUnit="m"
- error={false}
- disabled
- value={amslB && amslB.toFixed(2)}
- />
- </Stack>
- <Stack className={classes.centerColumn}>
- <TextFieldwithAdornment
- className={classes.centerColumn}
- errorText=""
- aria-label="distance"
- label="Distance"
- andornmentUnit="km"
- error={false}
- disabled
- value={distance.toFixed(3)}
- />
- </Stack>
-
- </div >
-
- </>
-
- );
-
-});
-export default LocationView;
+++ /dev/null
-
-/**
- * ============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 React, { useState } from 'react';
-
-import Stack from '@mui/material/Stack';
-import TextField from '@mui/material/TextField';
-import Typography from '@mui/material/Typography';
-import makeStyles from '@mui/styles/makeStyles';
-
-import { locationMandatoryAction, UpdateLatLonAction } from '../actions/siteAction';
-import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect';
-
-
-
-
-
-
-const styles = makeStyles({
- row: { flexDirection: 'column', display: 'flex', width: '60%', marginLeft: '10px' },
-});
-
-const ManualLocationEnter: React.FC = (() => {
-
- const [latitude1Error, setLatitude1Error] = useState('');
- const [latitude2Error, setLatitude2Error] = useState('');
- const [longitude1Error, setLongitude1Error] = useState('');
- const [longitude2Error, setLongitude2Error] = useState('');
-
- const lat1 = useSelectApplicationState(state => state.microwave.site.lat1);
- const lon1 = useSelectApplicationState(state => state.microwave.site.lon1);
- const lat2 = useSelectApplicationState(state => state.microwave.site.lat2);
- const lon2 = useSelectApplicationState(state => state.microwave.site.lon2);
- // const latitude1Error = useSelectApplicationState(state => state.microwave.error.latitude1Error);
- // const latitude2Error = useSelectApplicationState(state => state.microwave.error.latitude2Error);
- // const longitude1Error = useSelectApplicationState(state => state.microwave.error.longitude1Error);
- // const longitude2Error = useSelectApplicationState(state => state.microwave.error.longitude2Error);
- const loadingComplete = useSelectApplicationState(state => state.microwave.view.loadingComplete);
-
-
- const dispatch = useApplicationDispatch();
- const updateLatLon = (updateLat1: number, updateLon1: number, updateLat2: number, updateLon2: number) => dispatch(new UpdateLatLonAction(updateLat1, updateLon1, updateLat2, updateLon2));
- const updateMandatoryParameters = (mandatory: boolean) => dispatch(new locationMandatoryAction(mandatory));
-
- const classes = styles();
-
- const checkMandatoryParameters = () => {
- if (latitude1Error === '' && longitude1Error === '' && latitude1Error === '' && longitude1Error === '') {
- updateMandatoryParameters(true);
- } else updateMandatoryParameters(false);
- };
- React.useEffect(() => {
- checkMandatoryParameters();
- }, [loadingComplete]);
-
- const changeLatLon = (e: any) => {
-
- if (e.target.id == 'Lat1') {
- updateLatLon(e.target.value, lon1, lat2, lon2);
- }
- if (e.target.id == 'Lon1') {
- updateLatLon(lat1, e.target.value, lat2, lon2);
- }
- if (e.target.id == 'Lat2') {
- updateLatLon(lat1, lon1, e.target.value, lon2);
- }
- if (e.target.id == 'Lon2') {
- updateLatLon(lat1, e.target.value, lat2, e.target.value);
- }
- };
-
- const handleChange = (e: any) => {
-
- if (e.target.id === 'Lat1') {
- if (e.target.value > 90 || e.target.value < -90) {
- setLatitude1Error('Enter a number between -90 to 90');
- } else {
- changeLatLon(e);
- setLatitude1Error('');
- }
- } else if (e.target.id === 'Lat2') {
- if (e.target.value > 90 || e.target.value < -90) {
- setLatitude2Error('Enter a number between -90 to 90');
- } else {
- changeLatLon(e);
- setLatitude2Error('');
- }
- } else if (e.target.id === 'Lon1') {
- if (e.target.value > 180 || e.target.value < -180) {
- setLongitude1Error('Enter a number between -180 to 180');
- } else {
- changeLatLon(e);
- setLongitude1Error('');
- }
- } else if (e.target.id === 'Lon2') {
- if (e.target.value > 180 || e.target.value < -180) {
- setLongitude2Error('Enter a number between -180 to 180');
- } else {
- changeLatLon(e);
- setLongitude2Error('');
- }
- }
- checkMandatoryParameters();
- };
-
-
- return (
- <Stack className='GeoLocation'>
- <Stack >
- <Typography className='sideBySide' aria-label="site-a-label" variant="body1" >Site A</Typography>
- <Typography className='sideBySide' aria-label="site-b-label" variant="body1" >Site B</Typography>
- </Stack>
- <Stack >
- <Stack className={classes.row}>
- <TextField variant="standard" id="Lat1" inputProps={{ 'aria-label': 'site-a-latitude' }} label="Latitude" margin="dense" className='texFieldInput'
- helperText={latitude1Error || latitude1Error}
- error={latitude1Error.length > 0 || latitude1Error!.length > 0}
- onChange={(e: any) => {
- handleChange(e);
- }} />
- <TextField variant="standard" id="Lon1" inputProps={{ 'aria-label': 'site-a-longitude' }} label="longitude" margin="dense" className='texFieldInput'
- helperText={longitude1Error || longitude1Error}
- error={longitude1Error.length > 0 || longitude1Error!.length > 0}
- onChange={(e: any) => {
- handleChange(e);
- }} />
- </Stack>
- <Stack className={classes.row}>
-
- <TextField variant="standard" id="Lat2" inputProps={{ 'aria-label': 'site-b-latitude' }} label="Latitude" margin="dense" className='texFieldInput'
- helperText={latitude2Error || latitude2Error}
- error={latitude2Error.length > 0 || latitude2Error!.length > 0}
- onChange={(e: any) => {
- handleChange(e);
- }} />
- <TextField variant="standard" id="Lon2" label="longitude" margin="dense" className='texFieldInput'
- aria-label='site-b-longitude'
- helperText={longitude2Error || longitude2Error}
- error={longitude2Error.length > 0 || longitude2Error!.length > 0}
- onChange={(e: any) => {
- handleChange(e);
- }} />
-
- </Stack>
- </Stack>
- </Stack>
- );
-});
-export default ManualLocationEnter;
+++ /dev/null
-/**
- * ============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 React, { FC } from 'react';
-
-import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
-
-import Paper from '@mui/material/Paper';
-import Typography from '@mui/material/Typography';
-import { useSelectApplicationState } from '../../../../../framework/src/flux/connect';
-
-
-const MissingInformation: FC = (() => {
- const isCalculationServerReachable = useSelectApplicationState(state => state.microwave.view.reachable);
- const formView = useSelectApplicationState(state => state.microwave.view.formView);
- return (
- (isCalculationServerReachable && formView) ? <Paper style={{ padding: 5, width: 230, position: 'absolute', top: '40%', left: '40%' }}>
- <div style={{ display: 'flex', flexDirection: 'column' }}>
- <div style={{ 'alignSelf': 'center', marginBottom: 5 }}> <Typography> <FontAwesomeIcon icon={faExclamationTriangle} /> Link Information Missing</Typography></div>
-
- </div>
- </Paper> : null
-
- );
-});
-
-
-export default MissingInformation;
-
+++ /dev/null
-
-/**
- * ============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 React, { CSSProperties, FC } from 'react';
-
-import TextField from '@mui/material/TextField';
-import { InputProps } from '@mui/material/Input';
-
-type PropTypes = InputProps & {
- label: string;
- style?: CSSProperties;
-};
-
-const InputComponent : FC = ({ ...other }) => <div {...other} />;
-
-export const OutlinedDiv: FC<PropTypes> = ({ label, children, style }) => {
- return (
- <TextField
- variant="outlined"
- disabled
- label={label}
- style={style}
- multiline
- InputLabelProps={{ shrink: true }}
- inputProps={{ children: children }}
- InputProps={{
- inputComponent: InputComponent, style: { padding:'4px' },
- }}
- />
- );
-};
-export default OutlinedDiv;
+++ /dev/null
-
-/**
- * ============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 React, { FC, useEffect, useState } from 'react';
-
-import CloseIcon from '@mui/icons-material/Close';
-import Divider from '@mui/material/Divider';
-import makeStyles from '@mui/styles/makeStyles';
-import Stack from '@mui/material/Stack';
-import Typography from '@mui/material/Typography';
-import FormControl from '@mui/material/FormControl';
-import InputLabel from '@mui/material/InputLabel';
-import Select from '@mui/material/Select';
-import MenuItem from '@mui/material/MenuItem';
-import FormHelperText from '@mui/material/FormHelperText';
-import Box from '@mui/material/Box';
-import Button from '@mui/material/Button';
-import Dialog from '@mui/material/Dialog';
-import DialogContent from '@mui/material/DialogContent';
-import DialogContentText from '@mui/material/DialogContentText';
-import Paper from '@mui/material/Paper';
-import DialogActions from '@mui/material/DialogActions';
-import IconButton from '@mui/material/IconButton';
-
-
-
-import { adaptiveModulationInputCreator, UpdateAdaptiveModulationProcessing } from '../../linkCalculator/actions/adaptiveModulationAction';
-import { radioMandatoryParametersAction, UpdateEnabeldAdaptiveModulations, UpdateModulationAction, updateRadioAttributes, UpdateModulationParametersAction, UpdateTxPowerAction } from '../actions/radioActions';
-import { Modulation } from '../model/modulation';
-import AdaptiveModulationDialog from './adaptiveModulationDialog';
-import { Radio } from '../model/radio';
-import { isNumber } from '../utils/math';
-import { TextFieldwithAdornment } from './textFieldwithAdornment';
-import ConnectionInfo from './connectionInfo';
-import CircularProgress from '@mui/material/CircularProgress';
-import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect';
-
-
-
-
-
-
-
-
-
-
-
-
-
-const styles = makeStyles({
- modulationControl: { width: '230px' },
- adaptiveModulationButton: { paddingTop: '10px', width: '250px' },
- radioResultBox: { display: 'flex', flexDirection: 'row', justifyContent: 'space-around' },
- loading: {
- position: 'absolute', top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', backgroundColor: 'rgba(255, 255, 255, 0.7)', zIndex: 9999,
- },
- pasperStyle: {
- padding: 5, width: 230, position: 'absolute', top: '40%', left: '40%',
- },
- componentDiv: {
- 'alignSelf': 'center', marginBottom: 5,
- },
- wrappingDiv: {
- display: 'flex', flexDirection: 'column',
- },
- closeIcon: {
- marginTop: 20, top: '-75px', right: '-40px',
- },
- container: {
- display: 'flex', flexDirection: 'column', width: 'column',
- },
- component: {
- flexDirection: 'row', justifyContent: 'space-around',
- },
- textField: {
- width: '85%',
- },
- column: {
- width: '220px',
- },
-});
-
-const RadioView: FC = (() => {
- const [isOpenDialog, setOpenDialog] = useState(false);
- const [adaptiveModulationSite, setAdaptiveModulationSite] = useState('');
- const classes = styles();
- const radioNameList = useSelectApplicationState(state => state.microwave.radio.radioNameList);
- const rxPowerA = useSelectApplicationState(state => state.microwave.radio.rxPowerA);
- const rxPowerB = useSelectApplicationState(state => state.microwave.radio.rxPowerB);
- const systemOperatingMarginA = useSelectApplicationState(state => state.microwave.radio.systemOperatingMarginA);
- const systemOperatingMarginB = useSelectApplicationState(state => state.microwave.radio.systemOperatingMarginB);
- const radioModelA = useSelectApplicationState(state => state.microwave.radio.radioNameA);
- const radioModelB = useSelectApplicationState(state => state.microwave.radio.radioNameB);
- const radioTxPowerA = useSelectApplicationState(state => state.microwave.radio.txPowerA);
- const radioTxPowerB = useSelectApplicationState(state => state.microwave.radio.txPowerB);
- const radioParameters = useSelectApplicationState(state => state.microwave.radio.radioParameters);
- const radioBandwidthA = useSelectApplicationState(state => state.microwave.radio.radioBandwidthA);
- const radioBandwidthB = useSelectApplicationState(state => state.microwave.radio.radioBandwidthB);
- const modulationListA = useSelectApplicationState(state => state.microwave.radio.modulationListA);
- const modulationListB = useSelectApplicationState(state => state.microwave.radio.modulationListB);
- const radioModulationA = useSelectApplicationState(state => state.microwave.radio.modulationA);
- const radioModulationB = useSelectApplicationState(state => state.microwave.radio.modulationB);
- const modulationParametersA = useSelectApplicationState(state => state.microwave.radio.modulationParametersA);
- const modulationParametersB = useSelectApplicationState(state => state.microwave.radio.modulationParametersB);
- const adaptiveModulationTableBtoA = useSelectApplicationState(state => state.microwave.radio.adaptiveModulationTableBtoA);
- const adaptiveModulationTableAtoB = useSelectApplicationState(state => state.microwave.radio.adaptiveModulationTableAtoB);
- const enabledAdaptiveModulations = useSelectApplicationState(state => state.microwave.radio.enabledAdaptiveModulations);
- const rxThresholdBER3A = useSelectApplicationState(state => state.microwave.radio.thresholdBER3A);
- const rxThresholdBER6A = useSelectApplicationState(state => state.microwave.radio.thresholdBER6A);
- const rxThresholdBER3B = useSelectApplicationState(state => state.microwave.radio.thresholdBER3B);
- const rxThresholdBER6B = useSelectApplicationState(state => state.microwave.radio.thresholdBER6B);
- const processing = useSelectApplicationState(state => state.microwave.radio.processing);
- const admTableMessage = useSelectApplicationState(state => state.microwave.radio.admMessage);
- const admTableStatus = useSelectApplicationState(state => state.microwave.radio.admStatus);
- const radios = useSelectApplicationState(state => state.microwave.radio.radioParameters);
-
- const dispatch = useApplicationDispatch();
-
- const UpdateTxPower = async (txPowerA: number | null, txPowerB: number | null) => dispatch(new UpdateTxPowerAction(txPowerA, txPowerB));
- const updateRadio = async (radioA: string | null, radioB: string | null) => dispatch(updateRadioAttributes(radioA ? radioA : radioB, radioB ? radioB : radioA, radios));
- const updateMandatoryParameters = (parametersComplete: boolean) => dispatch(new radioMandatoryParametersAction(parametersComplete));
- const updateRadioModulation = async (modulationA: string | null, modulationB: string | null) => dispatch(new UpdateModulationAction(modulationA, modulationB));
- const updateModulationParameters = (newModulationParametersA: Modulation | null, newModulationParametersB: Modulation | null) => dispatch(new UpdateModulationParametersAction(newModulationParametersA, newModulationParametersB));
- const adaptiveModulation = async () => dispatch(adaptiveModulationInputCreator());
- const updateADMlist = (admList: any) => dispatch(new UpdateEnabeldAdaptiveModulations(admList.map((x: any) => x.modulation)));
- const resetAdapativeModulationTableProcessing = () => dispatch(new UpdateAdaptiveModulationProcessing(true));
- const handleClickOpen = (show: boolean) => {
- setOpenDialog(show);
- };
-
- const calculateAdaptiveModulation = async () => {
- handleClickOpen(true);
- await adaptiveModulation();
- };
-
- const checkMandatoryParameters = () => {
-
- if (radioModelA.length > 0 && radioModelB.length > 0) {
- if (radioModulationA.length > 0 && radioModulationB.length > 0) {
- if (isNumber(radioTxPowerA) || radioTxPowerA === 0) {
- if (isNumber(radioTxPowerB) || radioTxPowerB === 0) {
- if (Number(modulationParametersA?.txMax!)) {
- if (Number(modulationParametersB?.txMax!)) {
- updateMandatoryParameters(true);
- }
- }
- }
- } else updateMandatoryParameters(false);
- }
- }
- };
-
- useEffect(() => {
- checkMandatoryParameters();
- }, [radioModelA, radioModelB, radioModulationA, radioModulationB, radioTxPowerA, radioTxPowerB, modulationParametersA?.txMax, modulationParametersB?.txMax]);
-
-
-
- const handleDialogClose = () => {
- resetAdapativeModulationTableProcessing();
- setOpenDialog(false);
-
- };
-
- const setModulationParameters = (modulationA: string | null, modulationB: string | null) => {
- updateRadioModulation(modulationA, modulationB);
-
- radioParameters.forEach(async (element: Radio) => {
- if (radioModelA !== null && radioModelA === element.modelName) {
- Object.entries(element.operationalParameters?.modulations!).forEach((elementModulation) => {
- if (elementModulation[0] === modulationA) {
- updateModulationParameters(elementModulation[1] as any, null);
- }
- });
- }
- if (radioModelB !== null && radioModelB === element.modelName) {
- Object.entries(element.operationalParameters?.modulations!).forEach((elementModulation) => {
- if (elementModulation[0] === modulationB) {
- updateModulationParameters(null, elementModulation[1] as any);
- }
- });
- }
- });
- };
-
-
- const selectModulation = async (modulationA: string | null, modulationB: string | null) => {
- setModulationParameters(modulationA ? modulationA : modulationB, modulationB ? modulationB : modulationA);
- };
- const updateTxPower = async (txPowerA: number | null, txPowerB: number | null) => {
- await UpdateTxPower(txPowerA, txPowerB);
- };
-
- const updateADMModulation = (modulationList: string[]) => {
- let admList: { modulation: string; parameter: Modulation | null }[] = [];
- radioParameters.forEach(y => {
- if (y.modelName === radioModelA) {
- modulationList.forEach(modulation => {
- let entry: { modulation: string; parameter: Modulation | null } = { modulation: '', parameter: null };
- entry.modulation = modulation;
- const parameter: any = y.operationalParameters?.modulations!;
- if (parameter[modulation]) {
- entry.parameter = parameter[modulation];
- admList.push(entry);
- }
- });
- }
- });
- updateADMlist(admList);
- };
- return (
- <div className={classes.container}>
-
- <Stack className={classes.component} >
-
- <Typography aria-label="site-a-label" variant="body1" >Site A</Typography>
-
- <Typography aria-label="site-b-label" variant="body1" >Site B</Typography>
-
- </Stack>
- <Stack className={classes.component} >
-
- <FormControl variant="standard">
-
- <InputLabel>--Radio--</InputLabel>
- <Select variant="standard"
- className={classes.column}
- id="radioKeyA"
- aria-label="site-a-select-radio"
- value={radioModelA} // displayEmpty
-
- onChange={(e) => {
- updateRadio(e.target.value as string, null);
-
- }}
- inputProps={{ name: 'radio', id: 'radio' }}
- error={radioModelA === ''}
- >
- <MenuItem value={'0'} disabled>--Select Radio--</MenuItem>
- {radioNameList.sort(function (a, b) { return Number(a) - Number(b); }).map(radio =>
- (<MenuItem value={radio} aria-label="site-a-radio">{radio}</MenuItem>))}
- </Select>
- {
- radioModelA === '' && <FormHelperText error> *Required </FormHelperText>
- }
- </FormControl>
-
- <FormControl variant="standard" >
- <InputLabel >--Radio--</InputLabel>
- <Select variant="standard"
- className={classes.column}
- id="radioKeyB"
- aria-label="site-b-select-radio"
- value={radioModelB} // displayEmpty
- onChange={(e) => {
- updateRadio(null, e.target.value as string);
-
- }}
- inputProps={{ name: 'radio', id: 'radio' }}
- error={radioModelB === ''}
- >
- <MenuItem value={'0'} disabled>--Select Radio--</MenuItem>
- {radioNameList.sort(function (a, b) { return Number(a) - Number(b); }).map(radio =>
- (<MenuItem value={radio} aria-label="site-b-radio">{radio}</MenuItem>))}
- </Select>
- {
- radioModelB === '' && <FormHelperText error> *Required </FormHelperText>
- }
- </FormControl>
- </Stack>
- <Stack className={classes.component}>
-
- <TextFieldwithAdornment
- className={classes.column}
- aria-label="site-a-bandwidth"
- label="Bandwidth"
- errorText=" "
- andornmentUnit="MHz"
- error={false}
- disabled
- value={radioBandwidthA}
- />
-
- <TextFieldwithAdornment
- className={classes.column}
- aria-label="site-b-bandwidth"
- label="Bandwidth"
- errorText=" "
- andornmentUnit="MHz"
- error={false}
- disabled
- value={radioBandwidthB}
- />
-
- </Stack>
- <Stack className={classes.component}>
- <FormControl variant="standard" className={classes.modulationControl} >
-
- <InputLabel>--Reference Modulation--</InputLabel>
- <Select
- className={classes.column}
- variant="standard"
- id="modulationkey"
- aria-label="site-a-select-modulation"
- value={radioModulationA} // displayEmpty
- onChange={async (e) => {
- await selectModulation(e.target.value as string, null);
- }}
- inputProps={{ name: 'modulation', id: 'modulation' }}
- error={radioModulationA.length === 0}
- >
- <MenuItem value={'0'} disabled>--Reference Modulation--</MenuItem>
- {modulationListA.sort(function (a, b) { return Number(a) - Number(b); }).map(modulation =>
- (<MenuItem value={modulation} aria-label="site-a-modulation">{modulation}</MenuItem>))}
- </Select>
- {
- radioModulationA === '' && <FormHelperText error> *Required </FormHelperText>
- }
- </FormControl>
-
- <FormControl variant="standard" className={classes.modulationControl} >
- <InputLabel htmlFor="pass">--Reference Modulation--</InputLabel>
- <Select variant="standard"
- className={classes.column}
- id="modulationkey"
- aria-label="site-b-select-modulation"
- value={radioModulationB} // displayEmpty
- onChange={async (e) => {
- await selectModulation(null, e.target.value as string);
- }}
- inputProps={{ name: 'modulation', id: 'modulation' }}
- error={radioModulationB.length === 0}
- >
- <MenuItem value={'0'} disabled>--Reference Modulation---</MenuItem>
- {modulationListB.sort(function (a, b) { return Number(a) - Number(b); }).map(modulation =>
- (<MenuItem value={modulation} aria-label="site-b-modulation">{modulation}</MenuItem>))}
- </Select>
- {
- radioModulationB === '' && <FormHelperText error> *Required </FormHelperText>
- }
- </FormControl>
-
-
- </Stack>
- <Stack className={classes.component}>
- <Box textAlign='center' className={classes.adaptiveModulationButton}>
- <Button aria-label="site-a-adaptive-modulation-button" variant="contained"
- color="primary"
- name="adaptiveModulationSiteA"
- onClick={async () => {
- calculateAdaptiveModulation();
- setAdaptiveModulationSite('adaptiveModulationSiteA');
- }}
- >
- Adaptive Modulation
- </Button >
- </Box>
- <Box textAlign='center' className={classes.adaptiveModulationButton}>
- <Button aria-label="site-b-adaptive-modulation-button" variant="contained"
- color="primary"
- name="adaptiveModulationSiteB"
- onClick={async () => {
- calculateAdaptiveModulation();
- setAdaptiveModulationSite('adaptiveModulationSiteB');
- }}
- >
- Adaptive Modulation
- </Button >
- </Box>
- </Stack>
- <div>
- {isOpenDialog &&
- <>
- {processing ?
-
- <Stack>
- <Dialog onClose={handleDialogClose} open={isOpenDialog} fullWidth maxWidth={'lg'} >
- <DialogContent>
- <DialogContentText>
- Adaptive Modulation
- </DialogContentText>
- <DialogActions>
- <IconButton
- aria-label="close"
- className={classes.closeIcon}
- onClick={handleDialogClose}
- size="large">
- <CloseIcon />
- </IconButton>
- </DialogActions>
- <Paper>
- <div className={classes.loading}>
- <CircularProgress style={{ color: '#2596be' }} />
- <h3>Processing ...</h3>
- </div>
- </Paper>
- </DialogContent>
- </Dialog>
- </Stack>
- :
- <>
- {admTableStatus === 200 ?
-
- <Stack>
- <AdaptiveModulationDialog
- close={handleDialogClose}
- open={isOpenDialog}
- row={adaptiveModulationSite === 'adaptiveModulationSiteB' ? adaptiveModulationTableBtoA! : adaptiveModulationTableAtoB!}
- direction={adaptiveModulationSite === 'adaptiveModulationSiteB' ? 'Site B to A' : 'Site A to B'}
- selectedElement={enabledAdaptiveModulations}
- updateModulation={updateADMModulation}
- />
- </Stack>
-
- :
- <div>
- <Dialog onClose={handleDialogClose} open={isOpenDialog} fullWidth maxWidth={'lg'} >
- <DialogContent>
- <DialogContentText>
- Adaptive Modulation
- </DialogContentText>
- <DialogActions>
- <IconButton
- aria-label="close"
- className={classes.closeIcon}
- onClick={handleDialogClose}
- size="large">
- <CloseIcon />
- </IconButton>
- </DialogActions>
- <Paper>
- <ConnectionInfo
- message={admTableMessage}
- messageType={'Calculation Error'}
- reachable={admTableStatus === 200}
- />
- </Paper>
- </DialogContent>
- </Dialog>
- </div>
-
- }
- </>
- }
- </>
- }
-
- </div >
- <Stack className={classes.component}>
-
- <TextFieldwithAdornment
- className={classes.column}
- aria-label="site-a-radio-transmitted-power"
- label="Tx Power"
- errorText="*Required"
- andornmentUnit="dBm"
- error={radioTxPowerA == null}
- value={radioTxPowerA || 0} // 0 is to displayEmpty
- onChange={(e) => {
- updateTxPower(Number(e.target.value), null);
- }}
- />
- <TextFieldwithAdornment
- className={classes.column}
- aria-label="site-b-radio-transmitted-power"
- label="Tx Power"
- errorText="*Required"
- andornmentUnit="dBm"
- error={radioTxPowerB == null}
- value={radioTxPowerB || 0} //0 is to displayEmpty
- onChange={(e) => {
- updateTxPower(null, Number(e.target.value));
- }}
- />
- </Stack>
- <div className={classes.radioResultBox}>
- <div>
- <Stack className={classes.component}>
-
- <TextFieldwithAdornment
- className={classes.textField}
- aria-label="site-a-radio-receiver-threshold-ber3"
- label="Rx Threshold BER -3"
- errorText=" "
- disabled
- andornmentUnit="dBm"
- error={false}
- value={rxThresholdBER3A || 0}
- />
- <TextFieldwithAdornment
- className={classes.textField}
- aria-label="site-a-radio-receiver-threshold-ber6"
- label="Rx Threshold BER -6"
- errorText=" "
- disabled
- andornmentUnit="dBm"
- error={false}
- value={rxThresholdBER6A || 0}
- />
- </Stack>
- <Stack className={classes.component}>
- <TextFieldwithAdornment
- className={classes.textField}
- aria-label="site-a-received-signal-level"
- label="received-signal-level"
- errorText=" "
- andornmentUnit="dBm"
- error={false}
- disabled
- value={rxPowerA.toFixed(3)}
- />
-
- <TextFieldwithAdornment
- className={classes.textField}
- label="fade-margin"
- errorText=" "
- aria-label="uplink-fade-margin"
- andornmentUnit="dB"
- error={false}
- disabled
- value={systemOperatingMarginA.toFixed(3)}
- />
-
- </Stack>
- </div>
- <Divider orientation="vertical" flexItem style={{ marginRight: '20px' }} />
- <div>
- <Stack className={classes.component} >
-
- <TextFieldwithAdornment
- className={classes.textField}
- aria-label="site-b-radio-receiver-threshold-ber3"
- label="Rx Threshold BER -3"
- errorText=" "
- andornmentUnit="dBm"
- disabled
- error={false}
- value={rxThresholdBER3B || 0}
- />
- <TextFieldwithAdornment
- className={classes.textField}
- aria-label="site-b-radio-receiver-threshold-ber6"
- label="Rx Threshold BER -6"
- errorText=" "
- andornmentUnit="dBm"
- disabled
- error={false}
- value={rxThresholdBER6B || 0}
- />
-
- </Stack>
- <Stack className={classes.component} >
- <TextFieldwithAdornment
- className={classes.textField}
- aria-label="site-b-received-signal-level"
- label="received-signal-level"
- errorText=" "
- andornmentUnit="dBm"
- error={false}
- disabled
- value={rxPowerB.toFixed(3)}
- />
- <TextFieldwithAdornment
- className={classes.textField}
- aria-label="downlink-fade-margin"
- label="fade-margin"
- errorText=" "
- andornmentUnit="dB"
- error={false}
- disabled
- value={systemOperatingMarginB.toFixed(3)}
- />
- </Stack>
- </div>
- </div>
- </div >
-
- );
-
-});
-
-export default RadioView;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React, { FC } from 'react';
-
-import Input, { InputProps } from '@mui/material/Input';
-import FormControl from '@mui/material/FormControl';
-import InputLabel from '@mui/material/InputLabel';
-
-import FormHelperText from '@mui/material/FormHelperText';
-
-type TextFieldProps = InputProps & {
- label: string;
- andornmentUnit: string;
- error: boolean;
- errorText: string;
-
-};
-
-export const TextFieldwithAdornment : FC<TextFieldProps> = (props: TextFieldProps) => {
-
- const { id, label, errorText, error, style, andornmentUnit, ...otherProps } = props;
-
-
- return (
- <FormControl variant="standard" error={error} style={style}>
- <InputLabel htmlFor={id} >{label}</InputLabel>
- <Input type="number" id={id} inputProps={{ 'aria-label': label + '-input' }} endAdornment={andornmentUnit} {...otherProps} />
- <FormHelperText>{errorText}</FormHelperText>
- </FormControl>
- );
-};
\ No newline at end of file
+++ /dev/null
-
-/**
- * ============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 React, { FC, useEffect, useState } from 'react';
-
-import makeStyles from '@mui/styles/makeStyles';
-
-import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect';
-
-
-import { UpdateNewWaveguideParametersAction, waveguideMandatoryAction } from '../actions/waveguideActions';
-import { Waveguide } from '../model/waveguide';
-import { TextFieldwithAdornment } from './textFieldwithAdornment';
-import Stack from '@mui/material/Stack';
-import Typography from '@mui/material/Typography';
-import FormControl from '@mui/material/FormControl';
-import InputLabel from '@mui/material/InputLabel';
-import Select from '@mui/material/Select';
-import MenuItem from '@mui/material/MenuItem';
-import FormHelperText from '@mui/material/FormHelperText';
-import TextField from '@mui/material/TextField';
-
-
-
-
-const waveguideStyles = makeStyles({
- siteLabel: {
- marginTop: '10px',
- },
- column: {
- width: '220px',
- },
- container: {
- display: 'flex', flexDirection: 'column', width: 'column',
- },
- component: {
- flexDirection: 'row', justifyContent: 'space-around',
- },
-});
-
-
-
-
-const WaveguideView: FC = (() => {
- const [enterWaveguideLengthA, setEnterWaveguideLengthA] = useState(false);
- const [enterWaveguideLengthB, setEnterWaveguideLengthB] = useState(false);
-
- const waveguideLossA = useSelectApplicationState(state => state.microwave.waveguide.waveguideLossA);
- const waveguideLossB = useSelectApplicationState(state => state.microwave.waveguide.waveguideLossB);
- const waveguideSiteA = useSelectApplicationState(state => state.microwave.waveguide.waveguideNameA);
- const waveguideSiteB = useSelectApplicationState(state => state.microwave.waveguide.waveguideNameB);
- const waveguidelengthA = useSelectApplicationState(state => state.microwave.waveguide.waveguideLengthDisplayA);
- const waveguidelengthB = useSelectApplicationState(state => state.microwave.waveguide.waveguideLengthDisplayB);
- const waveguideTypeA = useSelectApplicationState(state => state.microwave.waveguide.waveguideTypeA);
- const waveguideTypeB = useSelectApplicationState(state => state.microwave.waveguide.waveguideTypeB);
- const waveguideParameters = useSelectApplicationState(state => state.microwave.waveguide.waveguideParameters);
- const waveguideLengthACalculate = useSelectApplicationState(state => state.microwave.waveguide.waveguideLengthACalculate);
- const waveguideLengthBCalculate = useSelectApplicationState(state => state.microwave.waveguide.waveguideLengthBCalculate);
- const waveguideNameList = useSelectApplicationState(state => state.microwave.waveguide.waveguideNameList);
-
- const dispatch = useApplicationDispatch();
-
- const updateMandatoryParameters = (mandatoryParameters: boolean) => dispatch(new waveguideMandatoryAction(mandatoryParameters));
- const updateWaveguideParameters = (waveguideParametersA: Waveguide | null, waveguideParametersB: Waveguide | null) => dispatch(new UpdateNewWaveguideParametersAction(waveguideParametersA, waveguideParametersB));
-
- const classes = waveguideStyles();
- const updateWaveguide = async (waveguideA: string | null, waveguideB: string | null) => {
- let waveguideAParameters: Waveguide;
- let waveguideBParameters: Waveguide;
-
- waveguideParameters.forEach(async (element: Waveguide) => {
- if (waveguideA !== null && waveguideA === element.modelName) {
-
- waveguideAParameters = element;
- await updateWaveguideParameters(waveguideAParameters, waveguideBParameters);
-
- if (element.operationalParameters?.type === 'rigid')
- setEnterWaveguideLengthA(false);
- else
- setEnterWaveguideLengthA(true);
- }
- if (waveguideB !== null && waveguideB === element.modelName) {
- waveguideBParameters = element;
- await updateWaveguideParameters(waveguideAParameters, waveguideBParameters);
-
- if (element.operationalParameters?.type === 'rigid') setEnterWaveguideLengthB(false);
- else {
- setEnterWaveguideLengthB(true);
- }
- }
- });
-
- };
-
- const onChangeWaveguideLength = async (waveguideLengthA: number | null, waveguideLengthB: number | null) => {
-
-
- let waveguideLengthAstate: number = waveguidelengthA;
- let waveguideLengthBstate: number = waveguidelengthB;
- let waveguideLengthACalculated = waveguideLengthACalculate;
- let waveguideLengthBCalculated = waveguideLengthBCalculate;
- if (waveguideLengthA && waveguideLengthA !== waveguideLengthAstate) {
-
- waveguideLengthAstate = waveguideLengthA;
- waveguideLengthACalculated = waveguideLengthA;
-
- }
- if (waveguideLengthB && waveguideLengthB !== waveguideLengthBstate) {
- waveguideLengthBstate = waveguideLengthB;
- waveguideLengthBCalculated = waveguideLengthB;
- }
- type Subset<Waveguide> = {
- [attr in keyof Waveguide]?: Waveguide[attr] extends object ? Subset<Waveguide[attr]> : Waveguide[attr];
- };
- type Nested<Waveguide> = {
- [value in keyof Subset<Waveguide>]?: Waveguide[value] extends object ? Nested<Waveguide[value]> : Subset<Waveguide[value]>;
- };
- let waveguideAParameters: Nested<Waveguide> | null = null;
- let waveguideBParameters: Nested<Waveguide> | null = null;
- waveguideParameters.forEach(x => {
- if (x.modelName === waveguideSiteA) {
-
- waveguideAParameters = { ...x, operationalParameters: { length: waveguideLengthAstate, type: x.operationalParameters?.type }, calculationParameters: { waveguideLength: waveguideLengthACalculated } };
-
- }
-
- if (x.modelName === waveguideSiteB) {
-
- waveguideBParameters = { ...x, operationalParameters: { length: waveguideLengthBstate, type: x.operationalParameters?.type }, calculationParameters: { waveguideLength: waveguideLengthBCalculated } };
-
- }
- });
-
- updateWaveguideParameters(waveguideAParameters, waveguideBParameters);
-
- };
-
- const checkMandatoryParameters = () => {
- if (waveguideTypeA === 'rigid') {
- if (waveguidelengthA !== 0) {
- updateMandatoryParameters(true);
- } else updateMandatoryParameters(false);
- }
- if (waveguideTypeB === 'rigid') {
- if (waveguidelengthB !== 0) {
- updateMandatoryParameters(true);
- } else updateMandatoryParameters(false);
- }
- if (waveguideTypeA === 'flexible_twistable') {
- if (waveguideTypeB === 'flexible_twistable') {
- updateMandatoryParameters(true);
- }
- }
- };
-
- useEffect(() => {
- checkMandatoryParameters();
-
- }, [waveguidelengthA, waveguidelengthB]);
-
- useEffect(() => {
- if (waveguideTypeA === 'rigid') {
- setEnterWaveguideLengthA(false);
- } else setEnterWaveguideLengthA(true);
- if (waveguideTypeB === 'rigid') {
- setEnterWaveguideLengthB(false);
- } else setEnterWaveguideLengthB(true);
- checkMandatoryParameters();
-
- }, [waveguideSiteA, waveguideSiteB]);
-
-
- return (
-
- <div className={classes.container}>
-
- <Stack className={classes.component}>
-
- <Typography className={classes.siteLabel} aria-label="site-a-label" variant="body1" >Site A</Typography>
- <Typography className={classes.siteLabel} aria-label="site-b-label" variant="body1" >Site B</Typography>
-
- </Stack>
-
- <Stack className={classes.component}>
- <FormControl variant="standard" className={classes.column} >
-
- <InputLabel htmlFor="pass">--Waveguide--</InputLabel>
- <Select variant="standard"
- id="waveguideKeyA"
- aria-label="site-a-select-waveguide"
- value={waveguideSiteA || '0'} // displayEmpty
- onChange={async (e) => {
- await updateWaveguide(e.target.value as string, null);
- }}
- inputProps={{ name: 'waveguide', id: 'waveguide' }}
- error={waveguideSiteA === ''}
- >
- <MenuItem value={'0'} disabled>--Select Waveguide--</MenuItem>
- {
- waveguideNameList.sort(function (a, b) { return Number(a) - Number(b); }).map(waveguide =>
- (<MenuItem value={waveguide} aria-label="site-a-waveguide">{waveguide}</MenuItem>))
- }
- </Select>
- {
- waveguideSiteA === '' && <FormHelperText error> *Required </FormHelperText>
- }
- </FormControl>
-
- <FormControl variant="standard" className={classes.column} >
-
- <InputLabel htmlFor="pass">--Waveguide--</InputLabel>
- <Select variant="standard"
- id="waveguideKeyA"
- aria-label="site-b-select-waveguide"
- value={waveguideSiteB || '0'} // displayEmpty
- onChange={async (e) => {
- await updateWaveguide(null, e.target.value as string);
-
-
- }}
- inputProps={{ name: 'waveguide', id: 'waveguide' }}
- error={waveguideSiteB === ''}
- >
- <MenuItem value={'0'} disabled>--Select Waveguide--</MenuItem>
- {waveguideNameList.sort(function (a, b) { return Number(a) - Number(b); }).map(waveguide =>
- (<MenuItem value={waveguide} aria-label="site-b-waveguide">{waveguide}</MenuItem>))}
- </Select>
- {
- waveguideSiteB === '' && <FormHelperText error> *Required </FormHelperText>
- }
- </FormControl>
- </Stack>
- <Stack className={classes.component}>
- <TextField variant="standard"
- aria-label="site-a-waveguide-type"
- className={classes.column}
- label="Waveguide Type"
- error={false}
- disabled
- value={waveguideTypeA}
- />
- <TextField variant="standard"
- aria-label="site-b-waveguide-type"
- className={classes.column}
- label="Waveguide Type"
- error={false}
- disabled
- value={waveguideTypeB}
- />
- </Stack>
- <Stack className={classes.component}>
- <TextFieldwithAdornment
- className={classes.column}
- aria-label="site-a-waveguide-length"
- label="waveguide-length"
- type='number'
- errorText={enterWaveguideLengthA === true ? ' *Required ' : ''}
- andornmentUnit="m"
- error={!enterWaveguideLengthA && waveguidelengthA === 0}
- disabled={enterWaveguideLengthA}
- value={waveguidelengthA || 0} //added || 0 to avoid input with adornment issue
- onChange={(e) => {
-
- onChangeWaveguideLength(Number(e.target.value), null);
- }}
- />
- <TextFieldwithAdornment
- className={classes.column}
- aria-label="site-b-waveguide-length"
- label="waveguide-length"
- type='number'
- errorText={enterWaveguideLengthB === true ? ' *Required ' : ''}
- andornmentUnit="m"
- error={!enterWaveguideLengthB && waveguidelengthB === 0}
- disabled={enterWaveguideLengthB}
- value={waveguidelengthB || 0}
- onChange={(e) => {
-
- onChangeWaveguideLength(null, Number(e.target.value));
- }}
- />
- </Stack>
- <Stack className={classes.component}>
- <TextFieldwithAdornment
- className={classes.column}
- aria-label="site-a-waveguide-loss"
- label="waveguide-loss"
- errorText=" "
- andornmentUnit="dB"
- error={false}
- disabled
- value={waveguideLossA}
- />
- <TextFieldwithAdornment
- className={classes.column}
- aria-label="site-b-waveguide-loss"
- label="waveguide-loss"
- errorText=" "
- andornmentUnit="dB"
- error={false}
- disabled
- value={waveguideLossB}
- />
-
- </Stack>
- </div>
-
- );
-
-});
-
-export default WaveguideView;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { IActionHandler } from '../../../../../framework/src/flux/action';
-import { antennaMandatoryAction, UpdateAntennaAction, UpdateAntennaDBAction } from '../actions/antennaActions';
-import { UpdateCalculationResultAction } from '../actions/commonActions';
-import { FirstMandatoryCheckAction } from '../actions/errorAction';
-import { ResetAction, UpdateDeviceListsOnBandChangeAction, UpdateDevicesOnFirstLoad } from '../actions/radioActions';
-import { ResetFormAction } from '../actions/viewAction';
-import { Antenna } from '../model/antenna';
-
-export type antennaState = {
- antenna: Antenna[];
- antennaIdSiteA: number;
- antennaIdSiteB: number;
- eirpA: number;
- eirpB: number;
- antennaGainA: number;
- antennaGainB: number;
- antennaNameA: string;
- antennaNameB: string;
- antennaNameList: string[];
- antennaMandatoryParameters: boolean;
- antennaHeightA: number;
- antennaHeightB: number;
-
-};
-
-const initialState: antennaState = {
- antennaIdSiteA: 0,
- antennaIdSiteB: 0,
- antenna: [],
- eirpA: 0,
- eirpB: 0,
- antennaGainA: 0,
- antennaGainB: 0,
- antennaNameA: '',
- antennaNameB: '',
- antennaNameList: [],
- antennaMandatoryParameters: true,
- antennaHeightA: 0,
- antennaHeightB: 0,
-
-};
-
-export const AntennaHandler: IActionHandler<antennaState> = (state = initialState, action) => {
- if (action instanceof UpdateAntennaAction) {
- if (action.antennaA && action.antennaA.operationalParameters) {
- state = { ...state, antennaNameA: action.antennaA.modelName, antennaGainA: action.antennaA.operationalParameters.gain, antennaIdSiteA: action.antennaA.id };
- }
- if (action.antennaB && action.antennaB.operationalParameters) {
- state = { ...state, antennaNameB: action.antennaB.modelName, antennaGainB: action.antennaB.operationalParameters.gain, antennaIdSiteB: action.antennaB.id };
- }
- } else if (action instanceof ResetFormAction) {
- state = Object.assign({}, initialState, { antennaMandatoryParameters: false });
- } else if (action instanceof UpdateAntennaDBAction) {
- state = Object.assign({}, state, { antenna: action.antenna, antennaNameList: action.antenna.map(x => { return x.modelName; }) });
- } else if (action instanceof FirstMandatoryCheckAction) {
- if (state.antennaNameA !== '' && state.antennaNameB !== '' && state.antennaGainA !== 0 && state.antennaGainB !== 0) {
- state = Object.assign({}, state, { ...state, antennaMandatoryParameters: true });
- } else state = Object.assign({}, state, { antennaMandatoryParameters: false });
- } else if (action instanceof antennaMandatoryAction) {
- state = Object.assign({}, state, { antennaMandatoryParameters: action.antennaMandatoryParameters });
- } else if (action instanceof ResetAction) {
- state = { ...state, antennaNameA: '', antennaNameB: '', antennaIdSiteA: 0, antennaIdSiteB: 0, antennaGainA: 0, antennaGainB: 0 };
- } else if (action instanceof UpdateDevicesOnFirstLoad) {
-
- state = { ...state, antennaNameList: action.antennas.map(e => e.modelName), antenna: action.antennas,
- antennaHeightA: action.linkAttributes.siteA.radioAntenna?.operationalParameters?.agl!,
- antennaHeightB: action.linkAttributes.siteB.radioAntenna?.operationalParameters?.agl! };
- action.antennas.map(antenna => {
-
- if (antenna.modelName === action.linkAttributes.siteA.radioAntenna?.modelName) {
- state = { ...state, antennaNameA: antenna.modelName, antennaGainA: antenna.operationalParameters?.gain!, antennaIdSiteA: antenna.id };
- }
- if (antenna.modelName === action.linkAttributes.siteB.radioAntenna?.modelName) {
- state = { ...state, antennaNameB: antenna.modelName, antennaGainB: antenna.operationalParameters?.gain!, antennaIdSiteB: antenna.id };
- }
- });
- } else if (action instanceof UpdateDeviceListsOnBandChangeAction) {
- state = { ...state, antennaNameList: action.antennas.map(e => e.modelName), antenna: action.antennas };
- } else if (action instanceof UpdateCalculationResultAction) {
- if (action.result.linkBudget) {
- state = Object.assign({}, state, { ...state, eirpA: action.result.linkBudget.eirpA, eirpB: action.result.linkBudget.eirpB });
- }
- }
-
- return state;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { IActionHandler } from '../../../../../framework/src/flux/action';
-import { attenuationMandatoryParametersAction, UpdateAttenuationMethodAction, UpdateRainMethodAction, UpdateRainValAction, UpdateWorstMonthAction } from '../actions/atmosphericLossAction';
-import { UpdateCalculationResultAction } from '../actions/commonActions';
-import { FirstMandatoryCheckAction } from '../actions/errorAction';
-import { UpdateDevicesOnFirstLoad } from '../actions/radioActions';
-import { ResetFormAction } from '../actions/viewAction';
-
-
-export type atmosphericLossState = {
- rainVal: number;
- rainAtt: number;
- absorptionWater: number;
- absorptionOxygen: number;
- month: string;
- fsl: number;
- rainMethod: string;
- attenuationMethod: string;
- worstMonth: boolean;
- attenuationMandatoryParameters: boolean;
-};
-
-const initialState: atmosphericLossState = {
- fsl: 0,
- rainVal: 0,
- rainAtt: 0,
- absorptionWater: 0,
- absorptionOxygen: 0,
- month: '',
- rainMethod: '',
- attenuationMethod: '',
- worstMonth: false,
- attenuationMandatoryParameters: true,
-
-};
-export const AtmosphericLossHandler: IActionHandler<atmosphericLossState> = (state = initialState, action) => {
-
- if (action instanceof UpdateRainValAction) {
- state = Object.assign({}, state, { rainVal: action.rainVal });
- } else if (action instanceof ResetFormAction) {
- state = Object.assign({}, initialState, { attenuationMandatoryParameters:false });
- } else if (action instanceof UpdateRainMethodAction) {
- state = Object.assign({}, state, { rainMethod: action.rainMethod, rainVal: 0, rainAtt: 0 });
- } else if (action instanceof UpdateAttenuationMethodAction) {
- state = Object.assign({}, state, { attenuationMethod: action.attenuationMethod, absorptionWater: 0, absorptionOxygen: 0 });
- } else if (action instanceof UpdateWorstMonthAction) {
- state = Object.assign({}, state, { worstMonth: action.worstMonth });
- } else if (action instanceof attenuationMandatoryParametersAction) {
- state = Object.assign({}, state, { attenuationMandatoryParameters: action.attenuationMandatoryParameters });
- } else if (action instanceof UpdateCalculationResultAction) {
- if (action.result.rainLoss) {
- state = Object.assign({}, state, { rainVal: action.result.rainLoss.rainFall.rainrate.toFixed(2), rainAtt: action.result.rainLoss.rainAttenuation, month: action.result.rainLoss.rainFall.period });
- }
- if (action.result.absorptionLoss) {
- state = Object.assign({}, state, { absorptionOxygen: action.result.absorptionLoss.oxygenLoss, absorptionWater: action.result.absorptionLoss.oxygenLoss });
- }
- if (action.result.freeSpaceLoss) {
- state = Object.assign({}, state, { fsl: action.result.freeSpaceLoss.fspl });
- }
- } else if (action instanceof UpdateDevicesOnFirstLoad) {
- state = Object.assign({}, state, {
- rainMethod: action.linkAttributes.operationalParameters.rainModel == null ? state.rainMethod : action.linkAttributes.operationalParameters.rainModel,
- attenuationMethod: action.linkAttributes.operationalParameters.absorptionMethod == null ? state.attenuationMethod : action.linkAttributes.operationalParameters.absorptionMethod,
- worstMonth: action.linkAttributes.operationalParameters.calculationPeriod === 'ANNUAL' ? false : true,
- });
-
- } else if (action instanceof FirstMandatoryCheckAction) {
- if (state.attenuationMethod !== '' && state.rainMethod !== '' ) {
- state = Object.assign({}, state, { attenuationMandatoryParameters : true });
- } else state = Object.assign({}, state, { attenuationMandatoryParameters : false });
- }
- return state;
-
-};
+++ /dev/null
-/**
- * ============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 { IActionHandler } from '../../../../../framework/src/flux/action';
-import { UpdateChannelListAction, UpdateChannelListLoadingAction, UpdateChannelListQueryAction, UpdateFrequencyPlans, UpdateRegionRegulatorAction, ResetChannelTableAction } from '../actions/bandPlanAction';
-import { UpdateFrequencyPlanAction } from '../actions/linkAction';
-import { UpdateBandList, UpdateRegionRegulatorListAction } from '../actions/queryActions';
-import { ResetAction, UpdateDevicesOnFirstLoad } from '../actions/radioActions';
-import { Channel, ChannelTable, FrequencyPlan, RegionRegulator } from '../model/bandPlan';
-import { RadioBand } from '../model/topologyTypes';
-
-
-
-export type bandPlanState = {
- region: RegionRegulator;
- channelListQuery: Channel[];
- bandList: RadioBand[];
- channelListLoading: boolean;
- regionRegulatorList: RegionRegulator[];
- allChannels: ChannelTable[];
- siteAFrequencyPlan: FrequencyPlan[];
- siteBFrequencyPlan: FrequencyPlan[];
- frequencyPlanA: 'HIGH' | 'LOW';
- frequencyPlanB: 'HIGH' | 'LOW';
- frequencyPlanProcessing: boolean;
- savedChannels: ChannelTable[] ;
-};
-
-const initialState: bandPlanState = {
- region: {
- name: '', keyId: '-1', country: '', regulatorName: '',
- },
- channelListQuery: [],
- bandList: [],
- channelListLoading: true,
- allChannels: [],
- regionRegulatorList: [],
- siteAFrequencyPlan: [],
- siteBFrequencyPlan: [],
- frequencyPlanA: 'HIGH',
- frequencyPlanB: 'LOW',
- frequencyPlanProcessing: true,
- savedChannels: [],
-};
-
-export const bandPlanHandler: IActionHandler<bandPlanState> = (state = initialState, action) => {
- if (action instanceof UpdateBandList) {
- state = Object.assign({}, state, { bandList: action.bandList });
- } else if (action instanceof UpdateRegionRegulatorListAction) {
- state = Object.assign({}, state, { regionRegulatorList: action.regionRegulatorList });
- } else if (action instanceof UpdateRegionRegulatorAction) {
- state = { ...state, region: action.region };
- }
- if (action instanceof UpdateChannelListQueryAction) {
- let table: ChannelTable[] = [];
-
- action.channelList.forEach(x => {
- table.push({
- name: x.name,
- bandwidthMHz: x.bandwidthMHz.bandwidthMHz,
- centerFrequencyHigh: x.centerFrequencyHigh,
- centerFrequencyLow: x.centerFrequencyLow,
- availability: x.availability.name,
- xPolCondition: x.xPolCondition.name,
- keyId: x.keyId,
- polarization: '',
- });
- });
-
- state = {
- ...state,
- channelListQuery: action.channelList!,
- allChannels: table,
- };
-
- } else if (action instanceof UpdateChannelListLoadingAction) {
- state = { ...state, channelListLoading: action.channelListLoading };
- } else if (action instanceof UpdateFrequencyPlanAction) {
- state = Object.assign({}, state, { frequencyPlanA: action.frequencyPlanA, frequencyPlanB: action.frequencyPlanB, frequencyPlanProcessing: false });
- } else if (action instanceof UpdateChannelListAction) {
-
- state = { ...state, savedChannels: action.channels };
- } else if (action instanceof ResetAction) {
- state = { ...state, savedChannels: [] };
- } else if (action instanceof UpdateDevicesOnFirstLoad) {
- state.regionRegulatorList.map(x => {
- if (x.keyId === action.linkAttributes.operationalParameters.bandplanKeyId) {
- state = { ...state, region: x };
- }
- });
- } else if (action instanceof UpdateFrequencyPlans) {
- state = { ...state, siteAFrequencyPlan: action.siteAFrequencyPlan, siteBFrequencyPlan: action.siteBFrequencyPlan };
- } else if (action instanceof ResetChannelTableAction) {
- state = { ...state, channelListQuery : [], allChannels : [] };
- }
-
- return state;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { UpdateAttenuationMethodErrorAction, UpdateFrequencyErrorAction, UpdateLatitudeErrorAction, UpdateLongitudeErrorAction, UpdateRainMethodErrorAction } from '../actions/errorAction';
-import { IActionHandler } from '../../../../../framework/src/flux/action';
-
-export type errorState = {
- latitude1Error: string | null;
- latitude2Error: string | null;
- longitude1Error: string | null;
- longitude2Error: string | null;
- frequencyError : string | null;
- rainMethodError: string | null;
- attenuationMethodError : string | null;
-};
-
-const initialState: errorState = {
- latitude1Error: '',
- latitude2Error: '',
- longitude1Error: '',
- longitude2Error: '',
- frequencyError : '',
- rainMethodError: '',
- attenuationMethodError : '',
-};
-
-export const ErrorHandler: IActionHandler<errorState> = (state = initialState, action) => {
- if (action instanceof UpdateLatitudeErrorAction) {
- state = Object.assign({}, state, { latitude1Error: action.error1, latitude2Error: action.error2 });
- } else if (action instanceof UpdateLongitudeErrorAction) {
- state = Object.assign({}, state, { longitude1Error: action.error1, longitude2Error: action.error2 });
- } else if (action instanceof UpdateFrequencyErrorAction) {
- state = Object.assign({}, state, { frequencyError: action.error });
- } else if (action instanceof UpdateRainMethodErrorAction) {
- state = Object.assign({}, state, { rainMethodError: action.error });
- } else if (action instanceof UpdateAttenuationMethodErrorAction) {
- state = Object.assign({}, state, { attenuationMethodError: action.error });
- }
-
- return state;
-};
+++ /dev/null
-/**
- * ============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 { IActionHandler } from '../../../../../framework/src/flux/action';
-import { UpdateDistanceAction, UpdatePolAction } from '../actions/linkAction';
-import { UpdateDevicesOnFirstLoad } from '../actions/radioActions';
-import { ResetFormAction } from '../actions/viewAction';
-
-
-export type linkState = {
-
- polarization: 'HORIZONTAL' | 'VERTICAL' | null;
- distance: number;
- linkId: number;
-};
-
-const initialState: linkState = {
-
- distance: 0,
- polarization: null,
- linkId:0,
-};
-
-export const LinkHandler: IActionHandler<linkState> = (state = initialState, action) => {
-
-
- if (action instanceof UpdateDistanceAction) {
- state = Object.assign({}, state, { distance: action.distance });
- } else if (action instanceof UpdatePolAction) {
- state = Object.assign({}, state, { polarization: action.polarization });
- } else if (action instanceof ResetFormAction) {
- state = Object.assign({}, initialState, {});
- } else if (action instanceof UpdateDevicesOnFirstLoad) {
- state = Object.assign({}, state, {
- distance: action.linkAttributes.lengthKm,
- polarization : action.linkAttributes.operationalParameters.rainPolarity,
- linkId: action.linkAttributes.id,
- });
- }
-
- return state;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { LinkDetails } from '../model/linkTable';
-export interface ILinkTableState extends IExternalTableState<LinkDetails> { }
-
-// create elastic search material data fetch handler
-const linkTableSearchHandler = createSearchDataHandler<LinkDetails>('microwave-link', true, { 'type': 'microwave' });
-
-export const {
- actionHandler: linkTableActionHandler,
- createActions: createLinkTableActions,
- createProperties: createLinkTableProperties,
- createPreActions: createLinkTablePreActions,
- reloadAction: linkTableReloadAction,
-
- // set value action, to change a value
-} = createExternal<LinkDetails>(linkTableSearchHandler, appState => appState.microwave.linkTable);
-
+++ /dev/null
-/**
- * ============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 { IActionHandler } from '../../../../../framework/src/flux/action';
-
-import { UpdateModelTypesAction } from '../actions/queryActions';
-import { UpdateDevicesOnFirstLoad } from '../actions/radioActions';
-import { linkBeingSavedAction, linkSavedSuccessfulAction } from '../actions/saveLinkAction';
-
-import { Link } from '../model/link';
-import { ModelType } from '../model/topologyTypes';
-
-export type queryState = {
-
- modelTypeList: string[];
- linkAttributes: Link;
- linkSave: any;
- modelTypes:ModelType[];
- savingComplete: boolean;
- linkSaving: boolean;
-};
-
-const initialState: queryState = {
-
- modelTypeList: [],
- linkAttributes: {
- id: 0, name: '', type: '', operator: '',
- lengthKm: 0,
- siteA: {
- lat: 0, lon: 0, id: 0, name: '', amslM: 0, azimuthDeg: 0, tiltDeg: 0,
- radioAntenna: { modelId: 0, id: 0, modelName: '', operationalParameters: { agl: 0 }, gainDb: 0, tiltDeg: 0 },
- radio: { id: 0, modelId: 0, modelName: '', operationalParameters: { transmissionPower: null, modulationType: '', enabledAdmModulations: [] } },
- waveguide: { modelId: 0, id: 0, modelName: '', type: '', lengthM: 0, lossDbPerM: 0, operationalParameters: { waveguideLength: 0 } },
-
- },
- siteB: {
- lat: 0, lon: 0, id: 0, name: '', amslM: 0, azimuthDeg: 0, tiltDeg: 0,
- radioAntenna: { id: 0, modelId: 0, modelName: '', operationalParameters: { agl: 0 }, gainDb: 0, tiltDeg: 0 },
- radio: { id: 0, modelId: 0, modelName: '', operationalParameters: { transmissionPower: null, modulationType: '', enabledAdmModulations: [] } },
- waveguide: { modelId: 0, id: 0, modelName: '', type: '', lengthM: 0, lossDbPerM: 0, operationalParameters: { waveguideLength: 0 } },
-
- },
- operationalParameters: { bandKeyId: '0', rainPolarity: '', rainModel: '', absorptionMethod: '', calculationPeriod: '', rainRate: 0, inheritedFrequencyPlanA:'', inheritedFrequencyPlanB:'', bandplanKeyId:'0', selectedChannelList:[] },
-
- },
- linkSave: [],
-
- modelTypes: [{
- name: '', id: -1, description: '',
- }],
- savingComplete: false,
- linkSaving: false,
-};
-
-export const QueryHandler: IActionHandler<queryState> = (state = initialState, action) => {
-
- if (action instanceof UpdateDevicesOnFirstLoad) {
- state = Object.assign({}, state, { linkAttributes: action.linkAttributes });
- } else if (action instanceof linkSavedSuccessfulAction) {
- state = Object.assign({}, state, { linkSave: action.saved, savingComplete: true, linkSaving: false });
- } else if (action instanceof UpdateModelTypesAction) {
- state = Object.assign({}, state, { modelTypes: action.ModelTypes });
- } else if (action instanceof linkBeingSavedAction) {
- state = Object.assign({}, state, { linkSaving: action.saving, savingComplete: false });
- }
-
- return state;
-};
+++ /dev/null
-/**
- * ============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 { IActionHandler } from '../../../../../framework/src/flux/action';
-import { AdaptiveModulationTable } from '../model/adaptiveModulationTable';
-import { UpdateCalculationResultAction } from '../actions/commonActions';
-import { FirstMandatoryCheckAction } from '../actions/errorAction';
-import {
- frequencyMandatoryParametersAction, radioBandwidthAction, radioMandatoryParametersAction, ResetAction,
- UpdateDeviceListsOnBandChangeAction, UpdateDevicesOnFirstLoad, UpdateEnabeldAdaptiveModulations,
- UpdateFrequencyAction, UpdateModulationAction, UpdateModulationListAction, UpdateRadioAction, UpdateRadioEverything, UpdateRadioIdAction,
- UpdateRadioListAction, UpdateRadioParametersAction, UpdateModulationParametersAction, UpdateRxPowerAction, UpdateRxSensitivityAction, UpdateSomAction,
- UpdateTxPowerAction,
- UpdateTotalBandwidthAction,
-} from '../actions/radioActions';
-import { Modulation } from '../model/modulation';
-import { Radio } from '../model/radio';
-import { ResetFormAction } from '../actions/viewAction';
-import { UpdateAdaptiveModulationProcessing, UpdateAdaptiveModulationTableAction } from '../actions/adaptiveModulationAction';
-
-export type radioState = {
- systemOperatingMarginA: number;
- systemOperatingMarginB: number;
- txPowerA: number;
- txPowerB: number;
- thresholdBER3A: number | null;
- thresholdBER6A: number | null;
- thresholdBER3B: number | null;
- thresholdBER6B: number | null;
- rxPowerA: number;
- rxPowerB: number;
- band: {
- frequency: number;
- keyId:string;
- };
- radioNameA: string;
- radioNameB: string;
- radioMandatoryParameters: boolean;
- frequencyMandatoryParameters: boolean;
- radioParameters: Radio[];
- radioBandwidthA: number;
- radioBandwidthB: number;
- modulationListA: string[];
- modulationListB: string[];
- radioNameList: string[];
- modulationA: string;
- modulationB: string;
- radioIdSiteA: number;
- radioIdSiteB: number;
- modulationParametersA: Modulation | null;
- modulationParametersB: Modulation | null;
- adaptiveModulationTableAtoB: AdaptiveModulationTable[] | null | undefined;
- adaptiveModulationTableBtoA: AdaptiveModulationTable[] | null | undefined;
- enabledAdaptiveModulations: string[];
- processing: boolean;
- admStatus: number;
- admMessage: string;
- totalBandwidthMHz: number;
-};
-
-const initialState: radioState = {
- systemOperatingMarginA: 0,
- systemOperatingMarginB: 0,
- txPowerA: 0,
- txPowerB: 0,
- thresholdBER3A: 0,
- thresholdBER6A: 0,
- thresholdBER3B: 0,
- thresholdBER6B: 0,
- radioNameList: [],
- rxPowerA: 0,
- rxPowerB: 0,
- band: {
- frequency: 0,
- keyId:'0',
- },
- radioNameA: '',
- radioNameB: '',
- radioMandatoryParameters: true,
- frequencyMandatoryParameters: true,
- radioParameters: [],
- radioBandwidthA: 0,
- radioBandwidthB: 0,
- modulationListA: [],
- modulationListB: [],
- modulationA: '',
- modulationB: '',
- radioIdSiteA: 0,
- radioIdSiteB: 0,
- modulationParametersA: {
- capE1: '',
- dfm56QAM: '',
- fktb: '',
- minDelay: '',
- minSigBw: '',
- minSigHt: '',
- modDsOffset: '',
- netFilterDf: '',
- nonMinDelay: '',
- nonMinSigBw: '',
- nonMinSigHt: '',
- rslDist: '',
- rslMin: '',
- rxMin: '',
- rxThr3BER: 0,
- rxThr6BER: 0,
- throughput: '',
- txMax: '',
- txMin: '',
- xpif: '',
- },
- modulationParametersB: {
- capE1: '',
- dfm56QAM: '',
- fktb: '',
- minDelay: '',
- minSigBw: '',
- minSigHt: '',
- modDsOffset: '',
- netFilterDf: '',
- nonMinDelay: '',
- nonMinSigBw: '',
- nonMinSigHt: '',
- rslDist: '',
- rslMin: '',
- rxMin: '',
- rxThr3BER: 0,
- rxThr6BER: 0,
- throughput: '',
- txMax: '',
- txMin: '',
- xpif: '',
- },
- adaptiveModulationTableAtoB: [],
- adaptiveModulationTableBtoA: [],
- enabledAdaptiveModulations: [],
- processing: true,
- admStatus: 0,
- admMessage: '',
- totalBandwidthMHz: 0,
-};
-
-
-export const RadioHandler: IActionHandler<radioState> = (state = initialState, action) => {
- if (action instanceof UpdateFrequencyAction) {
- state = Object.assign({}, state, { band:{ frequency: action.frequency, keyId: '$' + action.frequency.toString() } });
-
- } else if (action instanceof UpdateTxPowerAction) {
- state = Object.assign({}, state, { txPowerA: action.txPowerA || state.txPowerA, txPowerB: action.txPowerB || state.txPowerB });
- } else if (action instanceof UpdateRxSensitivityAction) {
- state = Object.assign({}, state, {
- thresholdBER3A: action.thresholdBER3A == null ? state.thresholdBER3A : action.thresholdBER3A,
- thresholdBER6A: action.thresholdBER6A == null ? state.thresholdBER6A : action.thresholdBER6A,
- thresholdBER3B: action.thresholdBER3B == null ? state.thresholdBER3B : action.thresholdBER3B,
- thresholdBER6B: action.thresholdBER6B == null ? state.thresholdBER6B : action.thresholdBER6B,
- });
- } else if (action instanceof UpdateRxPowerAction) {
- state = Object.assign({}, state, { rxPowerA: action.rxPowerA, rxPowerB: action.rxPowerB });
- } else if (action instanceof UpdateSomAction) {
- state = Object.assign({}, state, { systemOperatingMarginA: action.somA, systemOperatingMarginB: action.somB });
- } else if (action instanceof ResetFormAction) {
- state = Object.assign({}, initialState, { radioMandatoryParameters: false, frequencyMandatoryParameters: false });
- } else if (action instanceof UpdateRadioListAction) {
- state = Object.assign({}, state, { radioNameList: action.radioNameList });
- } else if (action instanceof UpdateRadioAction) {
- state = Object.assign({}, state, { radioNameA: action.radioNameA == null ? state.radioNameA : action.radioNameA, radioNameB: action.radioNameB == null ? state.radioNameB : action.radioNameB });
- } else if (action instanceof radioMandatoryParametersAction) {
- state = Object.assign({}, state, { radioMandatoryParameters: action.radioMandatoryParameters });
- } else if (action instanceof frequencyMandatoryParametersAction) {
- state = Object.assign({}, state, { frequencyMandatoryParameters: action.frequencyMandatoryParameters });
- } else if (action instanceof UpdateRadioParametersAction) {
- state = Object.assign({}, state, { radioParameters: action.radioParameters });
- } else if (action instanceof radioBandwidthAction) {
- state = Object.assign({}, state, { radioBandwidthA: action.radioBandwidthA == null ? state.radioBandwidthA : action.radioBandwidthA, radioBandwidthB: action.radioBandwidthB == null ? state.radioBandwidthB : action.radioBandwidthB });
- } else if (action instanceof UpdateModulationListAction) {
- state = Object.assign({}, state, { modulationListA: action.modulationListA == null ? state.modulationListA : action.modulationListA, modulationListB: action.modulationListB == null ? state.modulationListB : action.modulationListB });
- } else if (action instanceof UpdateModulationAction) {
- state = Object.assign({}, state, {
- modulationA: action.modulationA == null ? state.modulationA : action.modulationA,
- modulationB: action.modulationB == null ? state.modulationB : action.modulationB,
- enabledAdaptiveModulations: [action.modulationA],
- });
- } else if (action instanceof UpdateModulationParametersAction) {
- state = Object.assign({}, state, {
- modulationParametersA: action.modulationParametersA == null ? state.modulationParametersA : action.modulationParametersA,
- modulationParametersB: action.modulationParametersB == null ? state.modulationParametersB : action.modulationParametersB,
- txPowerA: action.modulationParametersA?.txMax || state.txPowerA, txPowerB: action.modulationParametersB?.txMax || state.txPowerB,
- thresholdBER3A: action.modulationParametersA?.rxThr3BER || state.thresholdBER3A, thresholdBER6A: action.modulationParametersA?.rxThr6BER || state.thresholdBER6A,
- thresholdBER3B: action.modulationParametersB?.rxThr3BER || state.thresholdBER3B, thresholdBER6B: action.modulationParametersB?.rxThr6BER || state.thresholdBER6B,
- });
- } else if (action instanceof UpdateRadioIdAction) {
- state = Object.assign({}, state, { radioIdSiteA: action.radioIdSiteA == null ? state.radioIdSiteA : action.radioIdSiteA, radioIdSiteB: action.radioIdSiteB == null ? state.radioIdSiteB : action.radioIdSiteB });
- } else if (action instanceof UpdateAdaptiveModulationTableAction) {
- state = Object.assign({}, state, { adaptiveModulationTableAtoB: action.adaptiveModulationTableAtoB, adaptiveModulationTableBtoA: action.adaptiveModulationTableBtoA, admMessage: action.message, admStatus: action.status, processing: false });
- } else if (action instanceof ResetAction) {
- state = {
- ...state, radioIdSiteA: 0, radioIdSiteB: 0, radioNameA: '', radioNameB: '', radioBandwidthA: 0,
- radioBandwidthB: 0, modulationA: '', modulationB: '', rxPowerA: 0, rxPowerB: 0, txPowerA: 0, txPowerB: 0, thresholdBER3A: 0,
- thresholdBER3B: 0, thresholdBER6A: 0, thresholdBER6B: 0, modulationListA: [], modulationListB: [], totalBandwidthMHz : 0,
- };
- } else if (action instanceof UpdateDevicesOnFirstLoad) {
- state = {
- ...state, band:{ frequency: Number(action.linkAttributes.operationalParameters.bandKeyId.replace('$', '')), keyId: action.linkAttributes.operationalParameters.bandKeyId },
- radioNameList: action.radioList.map(e => e.modelName),
- radioParameters: action.radioList,
- enabledAdaptiveModulations: action.linkAttributes.siteA.radio?.operationalParameters.enabledAdmModulations!,
- };
- action.radioList.map(radio => {
- if (radio.modelName === action.linkAttributes.siteA.radio?.modelName) {
- state = {
- ...state, radioNameA: radio.modelName,
- modulationListA: Object.keys(radio.operationalParameters?.modulations!),
- radioIdSiteA: radio.id,
- radioBandwidthA: Number(radio.operationalParameters?.bandwith),
- };
- if (action.linkAttributes.siteA.radio?.operationalParameters.modulationType) {
- Object.entries(radio.operationalParameters?.modulations!).map(modulationParameters => {
- if (modulationParameters[0] === action.linkAttributes.siteA.radio?.operationalParameters.modulationType) {
- const modulationParametersA: any = modulationParameters[1];
- state = {
- ...state,
- thresholdBER3A: modulationParametersA.rxThr3BER,
- thresholdBER6A: modulationParametersA.rxThr6BER,
- };
- }
- });
- }
- }
- if (radio.modelName === action.linkAttributes.siteB.radio?.modelName) {
- state = {
- ...state, radioNameB: radio.modelName,
- modulationListB: Object.keys(radio.operationalParameters?.modulations!),
- radioIdSiteB: radio.id,
- radioBandwidthB: Number(radio.operationalParameters?.bandwith),
- };
- if (action.linkAttributes.siteB.radio?.operationalParameters.modulationType) {
- Object.entries(radio.operationalParameters?.modulations!).map(modulationParameters => {
- if (modulationParameters[0] === action.linkAttributes.siteB.radio?.operationalParameters.modulationType) {
- const modulationParametersB: any = modulationParameters[1];
- state = {
- ...state,
- thresholdBER3B: modulationParametersB.rxThr3BER,
- thresholdBER6B: modulationParametersB.rxThr6BER,
- };
- }
- });
- }
- }
- });
- if (action.linkAttributes.siteA.radio?.operationalParameters?.modulationType) {
- state = {
- ...state,
- modulationA: action.linkAttributes.siteA.radio?.operationalParameters?.modulationType,
- txPowerA: action.linkAttributes.siteA.radio.operationalParameters.transmissionPower!,
- };
- }
- if (action.linkAttributes.siteB.radio?.operationalParameters?.modulationType) {
- state = {
- ...state,
- modulationB: action.linkAttributes.siteB.radio?.operationalParameters?.modulationType,
- txPowerB: action.linkAttributes.siteB.radio.operationalParameters.transmissionPower!,
- };
- }
- } else if (action instanceof UpdateCalculationResultAction) {
- if (action.result.linkBudget) {
- state = Object.assign({}, state, {
- systemOperatingMarginA: action.result.linkBudget.systemOperatingMarginA, systemOperatingMarginB: action.result.linkBudget.systemOperatingMarginB,
- rxPowerA: action.result.linkBudget.receivedPowerA, rxPowerB: action.result.linkBudget.receivedPowerB,
- });
- }
- } else if (action instanceof FirstMandatoryCheckAction) {
- if (state.band.frequency !== 0) {
- state = { ...state, frequencyMandatoryParameters: true };
- } else state = Object.assign({}, state, { frequencyMandatoryParameters: false });
- if (state.radioNameA !== '' && state.radioNameB !== '' && state.modulationA !== '' && state.modulationB !== '' && state.txPowerA !== null && state.txPowerB !== null) {
- state = { ...state, radioMandatoryParameters: true };
- } else state = Object.assign({}, state, { radioMandatoryParameters: false });
- } else if (action instanceof UpdateRadioEverything) {
- if (action.transport.operationalParametersA) {
- state = {
- ...state, radioBandwidthA: Number(action.transport.operationalParametersA?.bandwith),
- modulationListA: action.transport.modulationListA!,
- radioIdSiteA: action.transport.radioIdSiteA!,
- modulationA: initialState.modulationA,
- txPowerA: initialState.txPowerA,
- thresholdBER3A: initialState.thresholdBER3A,
- thresholdBER6A: initialState.thresholdBER6A,
- };
- }
- if (action.transport.operationalParametersB) {
- state = {
- ...state, radioBandwidthB: Number(action.transport.operationalParametersB?.bandwith),
- modulationListB: action.transport.modulationListB!,
- radioIdSiteB: action.transport.radioIdSiteB!,
- modulationB: initialState.modulationB,
- txPowerB: initialState.txPowerB,
- thresholdBER3B: initialState.thresholdBER3B,
- thresholdBER6B: initialState.thresholdBER6B,
- };
- }
- } else if (action instanceof UpdateDeviceListsOnBandChangeAction) {
- state = { ...state, radioNameList: action.radioList.map(e => e.modelName), radioParameters: action.radioList, txPowerA: 0, txPowerB: 0 };
- } else if (action instanceof UpdateEnabeldAdaptiveModulations) {
- state = { ...state, enabledAdaptiveModulations: action.enabledAdaptiveModulations };
- } else if (action instanceof UpdateAdaptiveModulationProcessing) {
- state = { ...state, processing: action.processing };
- } else if (action instanceof UpdateTotalBandwidthAction) {
- state = { ...state, totalBandwidthMHz: action.totalBandwidthMHz };
- }
-
- return state;
-};
+++ /dev/null
-/**
-* ============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 { combineActionHandler } from '../../../../../framework/src/flux/middleware';
-
-import { AntennaHandler, antennaState } from './antennaHandler';
-import { AtmosphericLossHandler, atmosphericLossState } from './atmosphericLossHandler';
-import { errorState } from './errorHandler';
-import { LinkHandler, linkState } from './linkHandler';
-import { QueryHandler, queryState } from './queryHandler';
-import { RadioHandler, radioState } from './radioHandler';
-import { SiteHandler, siteState } from './siteHandler';
-import { ViewHandler, viewState } from './viewHandler';
-import { WaveguideHandler, waveguideState } from './waveguideHandler';
-import { ErrorHandler } from './errorHandler';
-import { IActionHandler } from '../../../../../framework/src/flux/action';
-import { UpdateTabAction } from '../actions/commonActions';
-import { TabId } from '../model/tabId';
-import { ILinkTableState, linkTableActionHandler } from './linkTableHandler';
-import { IMap, mapHandler } from '../../lineOfSight/handlers/lineOfSightMapHandler';
-import { bandPlanHandler, bandPlanState } from './bandPlanHandler';
-
-interface IMicrowaveAppStateStore {
- antenna: antennaState;
- atmosphere: atmosphericLossState;
- link: linkState;
- radio: radioState;
- site: siteState;
- view: viewState;
- waveguide: waveguideState;
- query: queryState;
- error: errorState;
- currentTab: TabId;
- linkTable: ILinkTableState;
- bandPlan: bandPlanState;
- map: IMap;
-}
-
-
-declare module '../../../../../framework/src/store/applicationStore' {
- interface IApplicationStoreState {
- microwave: IMicrowaveAppStateStore;
- }
-}
-
-export const TabHandler: IActionHandler<TabId> = (state = 'linkTable', action) => {
- if (action instanceof UpdateTabAction) {
- state = action.openTab;
- }
- return state;
-};
-const appHandler = {
- antenna: AntennaHandler,
- atmosphere: AtmosphericLossHandler,
- link: LinkHandler,
- radio: RadioHandler,
- site: SiteHandler,
- view: ViewHandler,
- waveguide: WaveguideHandler,
- query: QueryHandler,
- error: ErrorHandler,
- currentTab: TabHandler,
- linkTable: linkTableActionHandler,
- map: mapHandler,
- bandPlan: bandPlanHandler,
-};
-
-export const RootHandler = combineActionHandler<IMicrowaveAppStateStore>(appHandler);
-export default RootHandler;
-
-
-
+++ /dev/null
-/**
- * ============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 { IActionHandler } from '../../../../../framework/src/flux/action';
-import { FirstMandatoryCheckAction } from '../actions/errorAction';
-import { UpdateDevicesOnFirstLoad } from '../actions/radioActions';
-import { locationMandatoryAction, UpdateLatLonAction } from '../actions/siteAction';
-import { ResetFormAction } from '../actions/viewAction';
-
-
-export type siteState = {
- lat1: number;
- lon1: number;
- lat2: number;
- lon2: number;
- siteIdA:number;
- siteIdB:number;
- locationMandatoryParameters: boolean;
- siteNameA: string;
- siteNameB: string;
- amslA: number;
- amslB: number;
- azimuthA: number;
- azimuthB: number;
- tiltDegA: number;
- tiltDegB: number;
-};
-
-const initialState: siteState = {
- lat1: 0,
- lon1: 0,
- lat2: 0,
- lon2: 0,
- siteIdA:0,
- siteIdB:0,
- locationMandatoryParameters: true,
- siteNameA: '',
- siteNameB: '',
- amslA: 0,
- amslB: 0,
- azimuthA: 0,
- azimuthB: 0,
- tiltDegA: 0,
- tiltDegB: 0,
-};
-
-export const SiteHandler: IActionHandler<siteState> = (state = initialState, action) => {
- if (action instanceof UpdateLatLonAction) {
- state = Object.assign({}, state, { lat1: action.lat1, lon1: action.lon1, lat2: action.lat2, lon2: action.lon2 });
- }
- if (action instanceof ResetFormAction) {
- state = Object.assign({}, initialState, { locationMandatoryParameters:false });
- } else if (action instanceof locationMandatoryAction) {
- state = Object.assign({}, state, { locationMandatoryParameters: action.locationMandatoryParameters });
- } else if (action instanceof UpdateDevicesOnFirstLoad) {
- state = Object.assign({}, state, {
- lat1: action.linkAttributes.siteA.lat, lon1: action.linkAttributes.siteA.lon,
- lat2: action.linkAttributes.siteB.lat, lon2: action.linkAttributes.siteB.lon,
- siteIdA: action.linkAttributes.siteA.id, siteIdB:action.linkAttributes.siteB.id,
- siteNameA:action.linkAttributes.siteA.name, siteNameB:action.linkAttributes.siteB.name,
- amslA : action.linkAttributes.siteA.amslM, amslB: action.linkAttributes.siteB.amslM,
- azimuthA : action.linkAttributes.siteA.azimuthDeg, azimuthB: action.linkAttributes.siteB.azimuthDeg,
- tiltDegA: action.linkAttributes.siteA.tiltDeg, tiltDegB: action.linkAttributes.siteB.tiltDeg,
- });
- } else if (action instanceof FirstMandatoryCheckAction) {
- if (state.lat1 !== 0 && state.lon1 !== 0 && state.lat2 !== 0 && state.lon2 !== 0) {
- state = Object.assign({}, state, { locationMandatoryParameters : true });
- } else state = Object.assign({}, state, { locationMandatoryParameters : false });
- }
-
- return state;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { IActionHandler } from '../../../../../framework/src/flux/action';
-import { UpdateDevicesOnFirstLoad } from '../actions/radioActions';
-import { isCalculationServerReachableAction, PluginDoneLoadingAction, ResetFormAction, UpdateRainMethodDisplayAction } from '../actions/viewAction';
-
-
-export type viewState = {
- formView: boolean;
- reachable: boolean;
- rainDisplay: boolean;
- loadingComplete : boolean;
- processing: boolean;
-};
-
-const initialState: viewState = {
- formView: true,
- reachable: true,
- rainDisplay: false,
- loadingComplete : false,
- processing : true,
-};
-
-export const ViewHandler: IActionHandler<viewState> = (state = initialState, action) => {
-
- if (action instanceof UpdateDevicesOnFirstLoad) {
- if (action.linkAttributes) {
- state = Object.assign({}, state, { formView: true });
- }
- } else if (action instanceof isCalculationServerReachableAction) {
- state = Object.assign({}, state, { reachable: action.reachable });
- } else if (action instanceof ResetFormAction) {
- state = Object.assign({}, state, { formView: false, processing : false });
- } else if (action instanceof UpdateRainMethodDisplayAction) {
- state = Object.assign({}, state, { rainDisplay: action.rainDisplay });
- } else if (action instanceof PluginDoneLoadingAction) {
- state = Object.assign({}, state, { loadingComplete: action.loadingComplete, processing: false });
- }
- return state;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { IActionHandler } from '../../../../../framework/src/flux/action';
-import { UpdateCalculationResultAction } from '../actions/commonActions';
-import { FirstMandatoryCheckAction } from '../actions/errorAction';
-import { ResetAction, UpdateDeviceListsOnBandChangeAction, UpdateDevicesOnFirstLoad } from '../actions/radioActions';
-import { ResetFormAction } from '../actions/viewAction';
-import { UpdateNewWaveguideParametersAction, UpdateWaveguideIdAction, UpdatewaveguideListAction,
- UpdateWaveguideLossAction, updateWaveguideNameAction, UpdateWaveguideParametersAction, updateWaveguideTypeAction, waveguideMandatoryAction } from '../actions/waveguideActions';
-import { Waveguide } from '../model/waveguide';
-
-
-export type waveguideState = {
- waveguideLossA: number;
- waveguideLossB: number;
- waveguideNameA: string | null;
- waveguideNameB: string | null;
- waveguideMandatoryParameters: boolean;
- waveguideLengthDisplayA: number;
- waveguideLengthDisplayB: number;
- waveguideTypeA: string;
- waveguideTypeB: string;
- waveguideIdSiteA: number;
- waveguideIdSiteB: number;
- waveguideParameters: Waveguide[];
- waveguideLengthACalculate: number ;
- waveguideLengthBCalculate: number ;
- waveguideNameList: string[];
-};
-
-const initialState: waveguideState = {
- waveguideLossA: 0,
- waveguideLossB: 0,
- waveguideNameA: '',
- waveguideNameB: '',
- waveguideMandatoryParameters: true,
- waveguideLengthDisplayA: 0,
- waveguideLengthDisplayB: 0,
- waveguideTypeA: '',
- waveguideTypeB: '',
- waveguideIdSiteA: 0,
- waveguideIdSiteB: 0,
- waveguideParameters: [],
- waveguideLengthACalculate: 0,
- waveguideLengthBCalculate: 0,
- waveguideNameList: [],
-
-};
-
-export const WaveguideHandler: IActionHandler<waveguideState> = (state = initialState, action) => {
- if (action instanceof UpdateWaveguideLossAction) {
- state = Object.assign({}, state, { waveguideLossA: action.waveguideLossA, waveguideLossB: action.waveguideLossB });
- } else if (action instanceof UpdatewaveguideListAction) {
- state = Object.assign({}, state, { waveguideList: action.waveguideListName });
- } else if (action instanceof updateWaveguideNameAction) {
- state = Object.assign({}, state, { waveguideNameA: action.waveguideNameA == null ? state.waveguideNameA : action.waveguideNameA, waveguideNameB: action.waveguideNameB == null ? state.waveguideNameB : action.waveguideNameB });
- } else if (action instanceof waveguideMandatoryAction) {
- state = Object.assign({}, state, { waveguideMandatoryParameters: action.waveguideMandatoryParameters });
- } else if (action instanceof UpdateWaveguideIdAction) {
- state = Object.assign({}, state, { waveguideIdSiteA: action.waveguideIdSiteA == null ? state.waveguideIdSiteA : action.waveguideIdSiteA, waveguideIdSiteB: action.waveguideIdSiteB == null ? state.waveguideIdSiteB : action.waveguideIdSiteB });
- } else if (action instanceof updateWaveguideTypeAction) {
- state = Object.assign({}, state, { waveguideTypeA: action.waveguideTypeA == null ? state.waveguideTypeA : action.waveguideTypeA, waveguideTypeB: action.waveguideTypeB == null ? state.waveguideTypeB : action.waveguideTypeB });
- } else if (action instanceof UpdateWaveguideParametersAction) {
- state = Object.assign({}, state, { waveguideParameters: action.waveguide });
- } else if (action instanceof ResetAction) {
- state = Object.assign({}, state, { waveguideIdSiteA: 0, waveguideIdSiteB: 0, waveguideNameA: '', waveguideNameB: '', waveguideLengthDisplayA: 0, waveguideLengthDisplayB: 0, waveguideLossA: 0, waveguideLossB: 0, waveguideTypeA: '', waveguideTypeB: '' });
- } else if (action instanceof UpdateDevicesOnFirstLoad) {
-
- state = { ...state, waveguideNameList: action.waveguideList.map(x => x.modelName), waveguideParameters: action.waveguideList };
- if (action.linkAttributes.siteA.waveguide?.operationalParameters) {
- state = { ...state, waveguideLengthACalculate : action.linkAttributes.siteA.waveguide?.operationalParameters.waveguideLength };
-
- }
- if (action.linkAttributes.siteB.waveguide?.operationalParameters) {
- state = { ...state, waveguideLengthBCalculate : action.linkAttributes.siteB.waveguide?.operationalParameters.waveguideLength };
- }
- action.waveguideList.forEach(element => {
-
- if (element.modelName === action.linkAttributes.siteA.waveguide?.modelName) {
- state = {
- ...state, waveguideTypeA: element.operationalParameters?.type!,
- waveguideNameA: element.modelName,
- waveguideIdSiteA: element.id,
- waveguideLengthDisplayA: element.operationalParameters?.length!,
-
- };
- if (element.operationalParameters?.type! === 'rigid') {
- state = { ...state, waveguideLengthDisplayA : action.linkAttributes.siteA.waveguide.operationalParameters?.waveguideLength === null ? element.operationalParameters?.length! : action.linkAttributes.siteA.waveguide.operationalParameters?.waveguideLength!,
- };
- } else {
- state = { ...state, waveguideLengthACalculate: -1,
- };
- }
- }
- if (element.modelName === action.linkAttributes.siteB.waveguide?.modelName) {
- state = {
- ...state,
- waveguideTypeB: element.operationalParameters?.type!,
- waveguideLengthDisplayB: element.operationalParameters?.length!,
- waveguideNameB: element.modelName,
- waveguideIdSiteB: element.id,
- };
- if (element.operationalParameters?.type! === 'rigid') {
- state = { ...state, waveguideLengthDisplayB : action.linkAttributes.siteB.waveguide.operationalParameters?.waveguideLength === null ? element.operationalParameters?.length! : action.linkAttributes.siteB.waveguide.operationalParameters?.waveguideLength!,
- };
- } else {
- state = { ...state, waveguideLengthBCalculate:-1,
- };
- }
- }
- });
- } else if (action instanceof UpdateDeviceListsOnBandChangeAction) {
- state = { ...state, waveguideNameList: action.waveguideList.map(e => e.modelName), waveguideParameters: action.waveguideList };
- } else if (action instanceof UpdateNewWaveguideParametersAction) {
- if (action.waveguideParametersA && action.waveguideParametersA.operationalParameters) {
-
- state = { ...state, waveguideNameA: action.waveguideParametersA?.modelName, waveguideIdSiteA: action.waveguideParametersA?.id,
- waveguideLengthDisplayA: action.waveguideParametersA?.operationalParameters.length, waveguideTypeA: action.waveguideParametersA.operationalParameters.type,
- waveguideLengthACalculate: action.waveguideParametersA.operationalParameters.type === 'rigid' ? action.waveguideParametersA.calculationParameters?.waveguideLength! : -1 };
- }
- if (action.waveguideParametersB && action.waveguideParametersB.operationalParameters) {
- state = { ...state, waveguideNameB: action.waveguideParametersB?.modelName, waveguideIdSiteB: action.waveguideParametersB?.id,
- waveguideLengthDisplayB: action.waveguideParametersB?.operationalParameters.length, waveguideTypeB: action.waveguideParametersB.operationalParameters.type,
- waveguideLengthBCalculate: action.waveguideParametersB.operationalParameters.type === 'rigid' ? action.waveguideParametersB.calculationParameters?.waveguideLength! : -1 };
- }
- } else if (action instanceof UpdateCalculationResultAction) {
- if (action.result.waveguideLoss) {
- state = Object.assign({}, state, { waveguideLossA: action.result.waveguideLoss.waveguideLossA, waveguideLossB: action.result.waveguideLoss.waveguideLossB });
- }
- } else if (action instanceof FirstMandatoryCheckAction) {
- if (state.waveguideNameA !== '' && state.waveguideNameB !== '' && state.waveguideLengthDisplayA !== 0 && state.waveguideLengthDisplayB !== 0) {
- state = Object.assign({}, state, { waveguideMandatoryParameters: true });
- } else state = Object.assign({}, state, { waveguideMandatoryParameters: false });
- } else if (action instanceof ResetFormAction) {
- state = { ...initialState, waveguideMandatoryParameters:false };
- }
- return state;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-export type AdaptiveModulationInput = {
- linkId: number;
- linkOperationalParameters: {
- bandKeyId: string;
- bandplanKeyId: string;
- polarization: string;
- absorptionMethod: string;
- calculationPeriod: string;
- rainRate: number;
- rainModel: string;
- };
- siteA: {
- radioModelId: number;
- waveguideModelId: number;
- radioAntennaModelId: number;
- modulationType: string;
- transmissionPower: number;
- waveguideLength: number | null;
- agl: number;
- };
- siteB: {
- radioModelId: number;
- waveguideModelId: number;
- radioAntennaModelId: number;
- modulationType: string;
- transmissionPower: number;
- waveguideLength: number | null;
- agl: number;
- };
-};
-
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-export type AdaptiveModulationResponse = {
- aToB: AdaptiveModulationTable[];
- bToA: AdaptiveModulationTable[];
-};
-export type AdaptiveModulationTable = {
- modulation: string;
- dataRate: number;
- 'receiverThresholdBER-3': number;
- 'receiverThresholdBER-6': number;
- receivedSignalLevel: number;
- 'linkMarginBER-3': number;
- 'linkMarginBER-6': number;
- 'txPowerMin':number;
- 'txPowerMax':number;
- 'rainAvailabilityBER-3': number;
- 'rainAvailabilityBER-6' : number;
- 'multipathAvailabilityBER-3': number;
- 'multipathAvailabilityBER-6' : number;
-};
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-export type Antenna = {
- modelId: number;
- id:number;
- modelName: string;
- type: {
- id: number;
- name: string;
- description: string;
- } | null;
- operationalParameters: AntennaOperationalParameters | null;
- calculationParameters : AntennaCalculationPrameters | null;
-};
-export type AntennaOperationalParameters = {
- style: string;
- xpol: string;
- band: number;
- diameter: string;
- agl: number;
- amsl:number;
- gain: number;
- xpd: string;
- ipi: string;
- fbRation: string;
-};
-export type AntennaCalculationPrameters = {
-
-};
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-export type RegionRegulator = {
- country: string;
- keyId: string;
- name: string;
- regulatorName: string;
-};
-
-// export type ChannelQuery = {
-// data: Channel[];
-// message?: string;
-// status: number;
-// };
-export type Channel = {
- keyId: string;
- number: number;
- name: string;
- channelSpacing: ChannelSpacing;
- bandwidthMHz: BandwidthMhz;
- centerFrequencyHigh: number;
- centerFrequencyLow: number;
- xPolCondition: XpolCondition;
- availability: Availability;
- description: string;
- polarization: 'HORIZONTAL' | 'VERTICAL' | 'XPOL' | '';
-};
-
-export type ChannelTable = {
- keyId: string;
- name: string;
- bandwidthMHz: number;
- centerFrequencyHigh: number;
- centerFrequencyLow: number;
- availability: string;
- xPolCondition: string;
- polarization: 'HORIZONTAL' | 'VERTICAL' | 'XPOL' | '';
-};
-export type ChannelSpacing = {
- id: number;
- name: string;
-};
-export type BandwidthMhz = {
- id: number;
- name: string;
- bandwidthMHz: number;
-};
-export type XpolCondition = {
- id: number;
- name: string;
-};
-export type Availability = {
- id: number;
- name: string;
-};
-
-export type FrequencyPlan = {
- configuration: string;
- id: number;
- siteId: number;
- band: {
- keyId: string;
- name: string;
- duplexspacingMHz: number;
- };
- status: string;
- comment: string;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { Absorption, FreeSpaceLoss, LinkBudget, RainLoss } from './topologyTypes';
-import { WaveguideLoss } from './waveguide';
-
-export class CalculationResult {
- rainLoss: RainLoss | undefined;
-
- freeSpaceLoss: FreeSpaceLoss | undefined;
-
- absorptionLoss: Absorption | undefined;
-
- waveguideLoss: WaveguideLoss | undefined;
-
- linkBudget: LinkBudget | undefined;
-
-}
\ No newline at end of file
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-
-
-type Site = {
- lon: number;
- lat: number;
- id: number;
- tiltDeg: number;
- name: string;
- amslM: number | null;
- radioAntenna: Antenna | null;
- azimuthDeg: number;
- radio: Radio | null;
- waveguide: Waveguide | null;
-
-};
-type LinkOperationalParameters = {
- rainPolarity: string;
- rainModel: string;
- rainRate: number;
- absorptionMethod:string;
- calculationPeriod: string;
- bandKeyId: string;
- bandplanKeyId: string;
- selectedChannelList: string[];
- inheritedFrequencyPlanA: 'INHERIT' | 'INVERTED' | '';
- inheritedFrequencyPlanB: 'INHERIT' | 'INVERTED' | '';
-};
-export type Link = {
- id: number;
- name: string;
- operator: string;
- lengthKm: number;
- type: string;
- siteA: Site;
- siteB: Site;
- operationalParameters : LinkOperationalParameters;
-};
-
-type Radio = {
- id: number;
- modelId: number;
- modelName : string;
- operationalParameters: {
- modulationType: string;
- transmissionPower: number | null;
- enabledAdmModulations : string[];
- };
-};
-
-type Antenna = {
- gainDb: number;
- id: number;
- modelId: number;
- modelName: string;
- tiltDeg: number;
- operationalParameters: {
- agl : number;
- };
-};
-
-type Waveguide = {
- id: number;
- modelId: number;
- modelName: string;
- lengthM: number;
- lossDbPerM: number;
- type: string;
- operationalParameters: {
- waveguideLength : number;
- };
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-
-export type LinkDetails = {
- administrativeState: string;
- deviceA: { id: number; nodeId: string; uuid: string };
- deviceB: { id: number; nodeId: string; uuid: string };
- id: number;
- labels: [];
- lifecycleState: string;
- name: string;
- operationalState: string;
- operatorId: string;
- siteA: {
- areaId: string;
- areaName: string;
- id: number;
- latitude: number;
- longitude: number;
- name: string;
- operatorId: string;
- uuid: string;
- };
- siteB: {
- areaId: string;
- areaName: string;
- id: number;
- latitude: number;
- longitude: number;
- name: string;
- operatorId: string;
- uuid: string;
- };
- type: string;
- uuid: string;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-export type Modulation = {
- capE1: string;
- dfm56QAM: string;
- fktb: string;
- minDelay: string;
- minSigBw: string;
- minSigHt: string;
- modDsOffset: string;
- netFilterDf: string;
- nonMinDelay: string;
- nonMinSigBw: string;
- nonMinSigHt: string;
- rslDist: string;
- rslMin: string;
- rxMin: string;
- rxThr3BER: number;
- rxThr6BER: number;
- throughput: string;
- txMax: string;
- txMin: string;
- xpif: string;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { Modulation } from './modulation';
-
-export type Radio = {
- id: number;
- modelId:number;
- modelName: string;
- type: {
- id: number;
- name: string;
- description: string;
- } | null;
- operationalParameters: RadioOperationalParameters | null;
- calculationParameters: RadioCalculationPrameters | null;
-};
-
-export type RadioOperationalParameters = {
- modulations: Modulation;
- C0I: string;
- band: string;
- bandwith: string;
- cir: string;
- eth: string;
- lagE1: string;
- lagEth: string;
- mpls: string;
- pdh: string;
- rxMax: string;
- sdh: string;
- xpic: string;
-};
-
-export type RadioEverything = {
- operationalParametersA : RadioOperationalParameters | null;
- operationalParametersB : RadioOperationalParameters | null;
- modulationListA: string[] | null;
- modulationListB: string[] | null;
- radioIdSiteA: number | null;
- radioIdSiteB: number | null;
-};
-
-export type RadioCalculationPrameters = {
- transmissionPower:number;
- referenceModulation:string;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-
-
-export type TabId = 'linkTable' | 'linkCalculation' | 'lineOfSight';
\ No newline at end of file
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-// export type TopologyTypes ={
-// rainLoss : RainLoss,
-// freeSpaceLoss: FreeSpaceLoss,
-// absorption : Absorption
-// }
-
-export type RainLoss = {
- rainAttenuation: number;
- rainFall: {
- rainrate: number;
- period: string;
- };
-};
-
-
-export type FreeSpaceLoss = {
- fspl: number;
-};
-
-export type Absorption = {
- oxygenLoss: number;
- waterLoss: number;
- totalAbsorptionLoss: number;
- period: string;
-};
-
-
-export type LinkBudget = {
- systemOperatingMarginA: number;
- systemOperatingMarginB: number;
- eirpA: number;
- eirpB: number;
- receivedPowerA: number;
- receivedPowerB: number;
-};
-
-export type Distance = {
- distanceInKm: number;
-};
-
-export type RadioBand = {
- keyId: string;
- name: string;
- duplexspacingMHz: number;
- centerFrequencyMHz: number;
-};
-
-export type Model = {
- modelId: number;
- id: number;
- modelName: string;
- operationalParameters: any;
- calculationParameters: any;
- type: { id: number; name: string; description: string };
- band: RadioBand;
-};
-
-export type ModelType = {
- id: number;
- name: string;
- description: string;
-};
-
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
- type Site = {
- modulationType: string;
- transmissionPower: number;
- waveguideLength: number | null;
- agl: number;
- radioModelId: number;
- waveguideModelId: number;
- radioAntennaModelId: number;
- enabledAdmModulations: string[];
-
- };
- type LinkOperationalParameters = {
- rainPolarity: string;
- rainModel: string;
- rainRate: number;
- absorptionMethod: string;
- calculationPeriod: string;
- bandKeyId: string;
- bandplanKeyId: string;
- selectedChannelList: SaveChannel[];
- };
-
-export type UpdateLink = {
- siteA: Site;
- siteB: Site;
- linkOperationalParameters: LinkOperationalParameters;
-};
-
-export type SaveChannel = {
- channelKeyId : string;
- channelPolarizationEnum: 'HORIZONTAL' | 'VERTICAL' | 'XPOL' | '';
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-export type Waveguide = {
- modelId: number;
- id: number;
- modelName: string;
- type: {
- id: number;
- name: string;
- description: string;
- } | null;
- operationalParameters: WaveguideOperationalParameters | null;
- calculationParameters: WaveguideCalculationPrameters | null;
-};
-export type WaveguideLoss = {
- waveguideLossPerMeter: number;
- waveguideLossdB: number;
- waveguideName: string;
- waveguideLength: number;
- waveguideType: string;
- waveguideLossA: number;
- waveguideLossB: number;
-
-};
-
-export type WaveguideOperationalParameters = {
- band: string;
- type: string;
- shape: string;
- length: number;
- loss: string;
-
-};
-
-export type WaveguideCalculationPrameters = {
- waveguideLength: number;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-
-// Put Button handler stuff, REST Calls
-import { requestRest, requestRestExt } from '../../../../../framework/src/services/restService';
-
-import { Link } from '../model/link';
-import { AdaptiveModulationInput } from '../model/adaptiveModulationInput';
-import { AdaptiveModulationResponse } from '../model/adaptiveModulationTable';
-import { Absorption, Distance, FreeSpaceLoss, LinkBudget, ModelType, RadioBand, RainLoss } from '../model/topologyTypes';
-import { WaveguideLoss } from '../model/waveguide';
-import { Channel } from '../model/bandPlan';
-
-const LINKCALCULATOR_BASE_URL = '/topology/linkcalculator';
-const MICROWAVE_URL = '/topology/microwave';
-const NETWORK_URL = MICROWAVE_URL + '/network';
-
-const dataService = {
- bandPlanRegulators : () => {
- return requestRest<any>((MICROWAVE_URL + '/bandplans/'));
- },
-
- getModels : (bandKeyId: string, modelTypeName: string) => {
- const result = requestRest<any>(LINKCALCULATOR_BASE_URL + '/query/modellist/' + modelTypeName + '/' + bandKeyId);
- return result;
- },
-
- rainAttenuation : (lat1: any, lon1: any, lat2: any, lon2: any, bandKeyId: string, polarization: string, worstmonth: boolean) => {
- if (!worstmonth) {
- const result = requestRest<RainLoss>(LINKCALCULATOR_BASE_URL + '/rain/' + lat1 + ',' + lon1 + ',' + lat2 + ',' + lon2 + '/' + bandKeyId + '/' + polarization.toUpperCase() + '/' + 'ANNUAL');
- return result;
- } else {
- const result = requestRest<RainLoss>(LINKCALCULATOR_BASE_URL + '/rain/' + lat1 + ',' + lon1 + ',' + lat2 + ',' + lon2 + '/' + bandKeyId + '/' + polarization.toUpperCase() + '/' + 'WORSTMONTH');
- return result;
- }
- },
-
- manualRain : (rainfall: number, bandKeyId: string, distance: number, polarization: string) => {
- const result = requestRest<RainLoss>(LINKCALCULATOR_BASE_URL + '/rain/' + '/manual/' + rainfall + '/' + bandKeyId + '/' + distance + '/' + polarization.toUpperCase());
- return result;
- },
-
-
- FSL : (distance: number, bandKeyId: string) => {
- const result = requestRest<FreeSpaceLoss>(LINKCALCULATOR_BASE_URL + '/fsl/' + distance + '/' + bandKeyId);
- return result;
- },
-
- AbsorptionAtt : (lat1: number, lon1: number, lat2: number, lon2: number, bandKeyId: string, worstmonth: boolean, absorptionMethod: string) => {
- if (!worstmonth) {
-
- const result = requestRest<Absorption>(LINKCALCULATOR_BASE_URL + '/absorption/annual/' + lat1 + ',' + lon1 + ',' + lat2 + ',' + lon2 + '/' + bandKeyId + '/' + absorptionMethod);
- return result;
- } else {
- const result = requestRest<Absorption>(LINKCALCULATOR_BASE_URL + '/absorption/annual/' + lat1 + ',' + lon1 + ',' + lat2 + ',' + lon2 + '/' + bandKeyId + '/' + absorptionMethod);
- return result;
- }
- },
-
- linkBudget : (lat1: number, lon1: number, lat2: number, lon2: number, bandKeyId: string, absorptionMethod: string,
- polarization: string, antennaGainA: number, antennaGainB: number, waveguideLossA: number, waveguideLossB: number, transmissionPowerA: number,
- transmissionPowerB: number, rxSensitivityA: number, rxSensitivityB: number) => {
-
- const url = LINKCALCULATOR_BASE_URL + '/linkbudget/' + lat1 + ',' + lon1 + ',' + lat2 + ',' + lon2 + '/' +
- absorptionMethod + '/' + polarization.toUpperCase() + '/' + antennaGainA + '/' + antennaGainB + '/' +
- waveguideLossA + '/' + waveguideLossB + '/' + transmissionPowerA + '/' + transmissionPowerB + '/' + rxSensitivityA + '/' + rxSensitivityB;
-
-
- const result = requestRest<LinkBudget>(url + '?bandKeyId=' + bandKeyId);
- return result;
- },
-
- updateAutoDistance : (lat1: number, lon1: number, lat2: number, lon2: number) => {
- const result = requestRest<Distance>(LINKCALCULATOR_BASE_URL + '/distance/' + lat1 + ',' + lon1 + ',' + lat2 + ',' + lon2);
- return result;
- },
-
- waveguideLoss : (waveguideIdSiteA: number, waveguideIdSiteB: number, waveguideLengthA: number, waveguideLengthB: number) => {
-
- const result = requestRest<WaveguideLoss>(LINKCALCULATOR_BASE_URL + '/waveguide/' + waveguideIdSiteA + '/' + waveguideIdSiteB + '/' + waveguideLengthA + '/' + waveguideLengthB);
- return result;
- },
-
- adaptiveModulationTable : async (adaptiveModulationInput: AdaptiveModulationInput) => {
- const result = requestRestExt<AdaptiveModulationResponse>(LINKCALCULATOR_BASE_URL + '/link/' + adaptiveModulationInput.linkId + '/calculate/', {
- method: 'POST', // or 'PUT'
- headers: {
- 'Content-Type': 'application/json',
- },
- body: JSON.stringify(adaptiveModulationInput),
- });
- return result;
- },
-
- bandListQuery : async (bandplanKeyId: string) => {
- const result = requestRestExt<RadioBand[]>(MICROWAVE_URL + '/bandplans/' + bandplanKeyId + '/bands');
- return result;
- },
-
- modelTypeListQuery : async () => {
- const result = requestRest<ModelType[]>(LINKCALCULATOR_BASE_URL + '/query/modeltypelist/');
- return result;
- },
-
- channelQuery : async (bandplanKeyId: string, bandKeyId: string) => {
-
- const response = await requestRestExt<Channel[]>(MICROWAVE_URL + '/bandplans/' + bandplanKeyId + '/bands/' + bandKeyId + '/channels');
- return response;
- },
-
- saveLink : async (link: Link, id: number) => {
- type Message = { 'message': string; saveFail: boolean };
- const response = await requestRestExt<Message>(LINKCALCULATOR_BASE_URL + '/link/' + id, {
- method: 'PUT',
- headers: {
- 'Content-Type': 'application/json',
- },
- body: JSON.stringify(link),
- });
-
- if (response.status === 200) {
- return response;
- } else {
- let message: Message = { message: '', saveFail: true };
- if (response.data?.message) {
- message.message = 'Save failed ' + response.data.message;
- return message;
- } else {
- message.message = 'Something went wrong ' + response.message;
- return message;
- }
-
- }
- },
-
- frequencyPlanQuery : (siteId: number) => {
- const result = requestRestExt<any>(NETWORK_URL + '/sites/' + siteId + '/frequencyplan');
- return result;
- },
-
-};
-export default dataService;
+++ /dev/null
-/**
- * ============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 { Model } from '../model/topologyTypes';
-import { Radio, RadioEverything, RadioOperationalParameters } from '../model/radio';
-import { Waveguide } from '../model/waveguide';
-import { Antenna } from '../model/antenna';
-
-export const getWaveguideList = (modelTypeList: Model[]) => {
- let waveguides: Waveguide[] = [];
-
- modelTypeList.forEach(modeltype => {
- if (modeltype.type?.name === 'radio-to-antenna-link') {
- waveguides.push(modeltype);
-
-
- }
- });
- return waveguides;
-};
-export const radioService = async (radioA: string | null, radioB: string | null, radios : Radio []) => {
- let operationalParametersA: RadioOperationalParameters | null = null;
- let operationalParametersB: RadioOperationalParameters | null = null;
- let modulationListA: string[] = [];
- let modulationListB: string[] = [];
- let radioIdSiteA: number | null = null;
- let radioIdSiteB: number | null = null;
-
- radios.forEach((element: Radio) => {
- if (radioA !== null && radioA === element.modelName) {
- operationalParametersA = element.operationalParameters;
-
- radioIdSiteA = element.id;
- Object.keys(operationalParametersA?.modulations!).forEach((modulation) => {
- if (modulation.endsWith('QAM') || modulation.endsWith('PSK')) {
- modulationListA.push(modulation);
- }
- });
- }
- });
- radios.forEach((element: Radio) => {
- if (radioB !== null && radioB === element.modelName) {
- operationalParametersB = element.operationalParameters;
- radioIdSiteB = element.id;
-
- Object.keys(operationalParametersB?.modulations!).forEach((modulation) => {
- if (modulation.endsWith('QAM') || modulation.endsWith('PSK')) {
- modulationListB.push(modulation);
- }
- });
- }
- });
- const transport: RadioEverything = { operationalParametersA, operationalParametersB, modulationListA, modulationListB, radioIdSiteA, radioIdSiteB };
- return transport;
-};
-export const getRadioList = (modelTypeList: Model[] | undefined | null) => {
-
- let radios: Radio[] = [];
- modelTypeList!.forEach(modeltype => {
- if (modeltype.type.name === 'radio') {
-
- radios.push(modeltype);
- }
- });
- return radios;
-};
-export const getAntennaList = (modelTypeList: Model[] | undefined | null) => {
- let antennas: Antenna[] = [];
-
- modelTypeList!.forEach(element => {
-
- if (element.type.name === 'radio-antenna') {
- antennas.push(element);
-
-
- }
- });
-
- return antennas;
-};
+++ /dev/null
-/**
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt odlux
- * =================================================================================================
- * Copyright (C) 2022 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 { Link } from '../model/link';
-
-export const check = (linktAttributes: Link):String => {
- if (!linktAttributes) {
- return 'Missing Link Attributes';
- }
- var missingParameter:string = '';
-
- const checkParameterNotExist = (val: number | null, message: string, description: string):string => {
- //Check for null, undefined and NaN
- return val == null || isNaN(val) ? message.concat(description + ':' + val) : message;
- };
- missingParameter = checkParameterNotExist(linktAttributes.siteA.amslM, missingParameter, ' A-amslM');
- missingParameter = checkParameterNotExist(linktAttributes.siteB.amslM, missingParameter, ' B-amslM');
- missingParameter = checkParameterNotExist(linktAttributes.siteA.lat, missingParameter, ' A-lat');
- missingParameter = checkParameterNotExist(linktAttributes.siteA.lon, missingParameter, ' A-lon');
- missingParameter = checkParameterNotExist(linktAttributes.siteB.lat, missingParameter, ' B-lat');
- missingParameter = checkParameterNotExist(linktAttributes.siteB.lon, missingParameter, ' B-lon');
-
- // for (var prop in linktAttributes.siteA.antenna) {
- // if (prop !== null) {
- // continue
- // } else return false
- // }
- // for (var prop in linktAttributes.siteB.antenna) {
- // if (prop !== null) {
- // continue
- // } else return false
- // }
- // for (var prop in linktAttributes.siteA.radio) {
- // if (prop !== null) {
- // continue
- // } else return false
- // }
- // for (var prop in linktAttributes.siteB.radio) {
- // if (prop !== null) {
- // continue
- // } else return false
- // }
- // for (var prop in linktAttributes.siteA.waveguide) {
- // if (prop !== null) {
- // continue
- // } else return false
- // }
- // for (var prop in linktAttributes.siteB.waveguide) {
- // if (prop !== null) {
- // continue
- // } else return false
- // }
-
- if (missingParameter === '') {
- return '';
- } else {
- missingParameter = 'Missing parameters: '.concat(missingParameter);
- console.log(missingParameter);
- return missingParameter;
- }
-};
\ No newline at end of file
+++ /dev/null
-
-/**
- * ============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==========================================================================
- */
-
-export const LatLonToDMS = (value: number, isLon: boolean) => {
- const absoluteValue = Math.abs(value);
- const d = Math.floor(absoluteValue);
- const m = Math.floor((absoluteValue - d) * 60);
- const s = (absoluteValue - d - m / 60) * 3600;
- const dms = `${d}° ${m}' ${s.toFixed(2)}"`;
-
- const sign = Math.sign(value);
-
- if (isLon) {
- return (sign === -1 || sign === -0) ? dms + ' W' : dms + ' E';
- } else {
- return (sign === -1 || sign === -0) ? dms + ' S' : dms + ' N';
- }
-};
\ No newline at end of file
+++ /dev/null
-
-/**
- * ============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==========================================================================
- */
-
-export const max = <T>(a: T[], p: (v: T) => Number) => a.reduce<T>((m, x) => p(m) > p(x) ? m : x, a[0]);
-export const min = <T>(a: T[], p: (v: T) => Number) => a.reduce<T>((m, x) => p(m) < p(x) ? m : x, a[0]);
-
-export const isNumber = (value: number | null) =>{
-
- if (!value) {
- return false;
- } else {
- return !Number.isNaN(value);
- }
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React, { FC, useState } from 'react';
-
-import Paper from '@mui/material/Paper';
-import Accordion from '@mui/material/Accordion';
-import Typography from '@mui/material/Typography';
-import AccordionSummary from '@mui/material/AccordionSummary';
-import FormHelperText from '@mui/material/FormHelperText';
-import AccordionDetails from '@mui/material/AccordionDetails';
-import Box from '@mui/material/Box';
-import Button from '@mui/material/Button';
-import { ExpandMoreOutlined } from '@mui/icons-material';
-import makeStyles from '@mui/styles/makeStyles';
-import CircularProgress from '@mui/material/CircularProgress';
-import Dialog from '@mui/material/Dialog';
-import DialogContent from '@mui/material/DialogContent';
-import DialogContentText from '@mui/material/DialogContentText';
-import Stack from '@mui/material/Stack';
-import DialogActions from '@mui/material/DialogActions';
-import IconButton from '@mui/material/IconButton';
-import CloseIcon from '@mui/icons-material/Close';
-
-
-import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect';
-import { saveLinkCallAsync } from '../actions/saveLinkAction';
-import { isCalculationServerReachableAction } from '../actions/viewAction';
-import ConnectionInfo from '../components/connectionInfo';
-import AntennaView from '../components/antenna';
-import AttenuationView from '../components/attenuations';
-import FrequencyChannelView from '../components/frequencyChannel';
-import LocationView from '../components/location';
-import RadioView from '../components/radio';
-import WaveguideView from '../components/waveguide';
-import MissingInformation from '../components/missingInformation';
-import { BASE_URL } from '../../pluginMicrowave';
-import { check } from '../utils/checkLink';
-import { calculateButtonAction } from '../actions/handleButtonAction';
-
-
-
-const styles = makeStyles({
- sectionMargin: {
- position: 'relative', background: 'rgb(187, 189, 191)', padding: '20px', overflow: 'auto',
- },
- loading: {
- position: 'absolute', top: 0, left: 0, width: '100%', height: '180px', display: 'flex', justifyContent: 'center', alignItems: 'center', backgroundColor: 'rgba(255, 255, 255, 0.7)', zIndex: 9999,
- },
- outerDiv: {
- paddingLeft: '15px', paddingRight: '15px', paddingTop: '0px', display: 'flex', flexDirection: 'column', flex: 1,
- },
- accordionTitle: {
- width: '33%', flexShrink: 0,
- },
- justifyCenter: {
- justifyContent: 'center',
- },
- calculateButton: {
- marginTop: 20, position: 'fixed', top: '150px', right: '70px',
- },
- saveButton: {
- marginTop: 20, position: 'fixed', top: '200px', right: '70px',
- },
- saveResponseOk: {
- marginTop: 65, position: 'fixed', top: '250px', right: '70px',
- },
- serverResponse: {
- marginTop: 65, position: 'fixed', top: '250px', right: '70px', color: 'red',
- },
- paper: {
- display: 'flex', flexDirection: 'row',
- },
- buttonBox: { width: '170px' },
- closeIcon: {
- marginTop: 20, top: '-75px', right: '-40px',
- },
-});
-
-const LinkCalculation: FC = (() => {
- const attenuationMandatoryParameters = useSelectApplicationState( state=> state.microwave.atmosphere.attenuationMandatoryParameters);
- const radioMandatoryParameters = useSelectApplicationState( state=> state.microwave.radio.radioMandatoryParameters);
- const waveguideMandatoryParameters = useSelectApplicationState(state=> state.microwave.waveguide.waveguideMandatoryParameters);
- const antennaMandatoryParameters = useSelectApplicationState( state=> state.microwave.antenna.antennaMandatoryParameters);
- const frequencyMandatoryParameters = useSelectApplicationState( state=> state.microwave.radio.frequencyMandatoryParameters);
- const locationMandatoryParameters = useSelectApplicationState( state=> state.microwave.site.locationMandatoryParameters);
- const linkAttributes = useSelectApplicationState( state=> state.microwave.query.linkAttributes);
- // const loadingComplete = useSelectApplicationState( state=> state.microwave.view.loadingComplete);
- const processing = useSelectApplicationState( state=> state.microwave.view.processing);
- // const formView = useSelectApplicationState( state=> state.microwave.view.formView);
- const reachable = useSelectApplicationState( state=> state.microwave.view.reachable);
- const save = useSelectApplicationState( state=> state.microwave.query.linkSave);
- const isCalculationServerReachable = useSelectApplicationState( state=> state.microwave.view.reachable);
- const savingComplete = useSelectApplicationState( state=> state.microwave.query.savingComplete);
- const linkSaving = useSelectApplicationState( state=> state.microwave.query.linkSaving);
-
- const [isFrequencyAccordionOpen, setFrequencyAccordionOpen] = useState(false);
- const [isAntennaAccordionOpen, setAntennaAccordionOpen] = useState(false);
- const [isWaveguideAccordionOpen, setWaveguideAccordionOpen] = useState(false);
- const [isRadioAccordionOpen, setRadioAccordionOpen] = useState(false);
- const [isOpenDialog, setOpenDialog] = useState(false);
- const dispatch = useApplicationDispatch();
-
- const UpdateConectivity = (serverReachable: boolean) => dispatch(new isCalculationServerReachableAction(serverReachable));
-
-
-
- const restCallsActionAsync = () => dispatch(calculateButtonAction());
- const saveCallsActionAsync = () => dispatch(saveLinkCallAsync());
-
- const classes = styles();
- const handleDialogClose = () => setOpenDialog(false);
-
- const handleButton = (e: any) => {
- if (e.target.value === 'CALCULATE') {
- restCallsActionAsync();
- }
- if (e.target.value === 'SAVE') {
- setOpenDialog(true);
- saveCallsActionAsync();
- }
- };
-
- React.useEffect(() => {
-
- }, []);
- React.useEffect(() => {
- fetch(BASE_URL + '/fsl/1/' + '$13')
- .then(res => { if (res.ok) { UpdateConectivity(true); } else { UpdateConectivity(false); } });
- }, []);
-
-
- return (
- <div className={classes.sectionMargin}>
- <Paper id="link-details-panel" aria-label="linkcalculator-panel" className={classes.paper} >
- <ConnectionInfo
- messageType={'Connection Error'}
- message={'Calculation data can not be loaded'}
- reachable={isCalculationServerReachable!}
- />
-
-
- {
- reachable &&
- <>
- {processing ?
- <Stack className={classes.loading}>
- <Dialog onClose={handleDialogClose} open={isOpenDialog} fullWidth maxWidth={'lg'} >
- <DialogContent>
- <DialogContentText>
- Channel Select
- </DialogContentText>
- <DialogActions>
- <IconButton
- aria-label="close"
- className={classes.closeIcon}
- onClick={handleDialogClose}
- size="large">
- <CloseIcon />
- </IconButton>
- </DialogActions>
- <Paper>
- <div className={classes.loading}>
- <CircularProgress style={{ color: '#2596be' }} />
- <h3>Processing ...</h3>
- </div>
- </Paper>
- </DialogContent>
- </Dialog>
- </Stack>
- :
- <>
- {(check(linkAttributes)) !== '' ?
- <MissingInformation /> :
- <div className={classes.outerDiv} >
-
- <Accordion aria-label="location-accordion" defaultExpanded>
- <AccordionSummary
- expandIcon={<ExpandMoreOutlined />}
- aria-label="location-panel-header"
- id="location-panel-header"
- >
- <Typography className={classes.accordionTitle} aria-label="location-panel-label">Location</Typography>
- {!locationMandatoryParameters &&
- < Typography >
- <FormHelperText error aria-label="location-panel-error"> * Required Fields Missing * </FormHelperText>
- </Typography>
- }
- </AccordionSummary>
- <AccordionDetails className={classes.justifyCenter} aria-label="location-panel-details" >
-
- <LocationView aria-label="location-view" />
- </AccordionDetails>
- </Accordion>
-
- <Accordion aria-label="frequeny-channel-accordion" expanded={isFrequencyAccordionOpen} onChange={() => setFrequencyAccordionOpen(!isFrequencyAccordionOpen)}>
- <AccordionSummary
- expandIcon={<ExpandMoreOutlined />}
- aria-label="frequeny-panel-header"
- id="frequency-header"
- >
- <Typography className={classes.accordionTitle} aria-label="frequency-panel-label">Frequency and Channel</Typography>
- {!frequencyMandatoryParameters &&
- < Typography >
- <FormHelperText error aria-label="frequency-panel-error"> * Required Fields Missing * </FormHelperText>
- </Typography>
- }
- </AccordionSummary>
- <AccordionDetails className={classes.justifyCenter} aria-label="frequency-panel-details" >
- {isFrequencyAccordionOpen &&
- <FrequencyChannelView aria-label="frequency-view" />
- }
- </AccordionDetails>
- </Accordion>
- <Accordion aria-label="antenna-accordion" expanded={isAntennaAccordionOpen} onChange={() => setAntennaAccordionOpen(!isAntennaAccordionOpen)}>
- <AccordionSummary
- expandIcon={<ExpandMoreOutlined />}
- aria-label="antenna-header"
- id="antenna-header"
- >
- <Typography className={classes.accordionTitle} aria-label="antenna-panel-label">Antenna</Typography>
- {!antennaMandatoryParameters &&
- < Typography >
- <FormHelperText error aria-label="antenna-panel-error"> * Required Fields Missing * </FormHelperText>
- </Typography>
- }
- </AccordionSummary>
- <AccordionDetails className={classes.justifyCenter} aria-label="antenna-panel-details" >
- <AntennaView aria-label="antenna-view" />
- </AccordionDetails>
- </Accordion>
- <Accordion aria-label="waveguide-accordion" expanded={isWaveguideAccordionOpen} onChange={() => setWaveguideAccordionOpen(!isWaveguideAccordionOpen)}>
- <AccordionSummary
- expandIcon={<ExpandMoreOutlined />}
- aria-label="waveguide-header"
- id="waveguide-header"
- >
- <Typography className={classes.accordionTitle} aria-label="waveguide-panel-label">Waveguide</Typography>
- {!waveguideMandatoryParameters &&
- < Typography >
- <FormHelperText error aria-label="waveguide-panel-error"> * Required Fields Missing * </FormHelperText>
- </Typography>
- }
- </AccordionSummary>
- <AccordionDetails className={classes.justifyCenter} aria-label="waveguide-panel-details" >
- <WaveguideView aria-label="waveguide-view" />
- </AccordionDetails>
- </Accordion>
- <Accordion aria-label="radio-accordion" expanded={isRadioAccordionOpen} onChange={() => setRadioAccordionOpen(!isRadioAccordionOpen)}>
- <AccordionSummary
- expandIcon={<ExpandMoreOutlined />}
- aria-label="radio-header"
- id="radio-header"
- >
- <Typography className={classes.accordionTitle} aria-label="radio-panel-label">Radio</Typography>
- {!radioMandatoryParameters &&
- < Typography >
- <FormHelperText error aria-label="radio-panel-error"> * Required Fields Missing * </FormHelperText>
- </Typography>
- }
- </AccordionSummary>
- <AccordionDetails className={classes.justifyCenter} aria-label="radio-panel-details" >
- <RadioView aria-label="radio-view" />
- </AccordionDetails>
- </Accordion>
- <Accordion aria-label="attenuation-accordion">
- <AccordionSummary
- expandIcon={<ExpandMoreOutlined />}
- aria-label="attenuation-header"
- id="attenuation-header"
- >
- <Typography className={classes.accordionTitle} aria-label="attenuation-panel-label">Attenuation</Typography>
- {!attenuationMandatoryParameters &&
- < Typography >
- <FormHelperText error aria-label="attenuation-panel-error"> * Required Fields Missing * </FormHelperText>
- </Typography>
- }
- </AccordionSummary>
- <AccordionDetails className={classes.justifyCenter} aria-label="attenuation-panel-details" >
- <AttenuationView aria-label="attenuation-view" />
-
- </AccordionDetails>
- </Accordion >
- </div>
- }
- <Box className={classes.buttonBox}>
- <Button className={classes.calculateButton} value='CALCULATE' aria-label="link-calculator-button" variant="contained" color="primary"
- onClick={handleButton}>
- Calculate Link
- </Button >
- <Button className={classes.saveButton} value='SAVE' aria-label="save-link-button" variant="contained" color="primary"
- onClick={handleButton}>
- Save Link
- </Button >
- <div>
- {isOpenDialog &&
-
- <>
- {
- linkSaving ?
-
- <Stack>
- <Dialog onClose={handleDialogClose} open={isOpenDialog} fullWidth maxWidth={'lg'} >
- <DialogContent>
- <DialogContentText>
- Save
- </DialogContentText>
- <DialogActions>
- <IconButton
- aria-label="close"
- className={classes.closeIcon}
- onClick={handleDialogClose}
- size="large">
- <CloseIcon />
- </IconButton>
- </DialogActions>
- <Paper>
- <div className={classes.loading}>
- <CircularProgress style={{ color: '#2596be' }} />
- <h3>Saving ...</h3>
- </div>
- </Paper>
- </DialogContent>
- </Dialog>
- </Stack>
-
- : <>
- {
- save.saveFail ?
- <Stack >
- <Dialog onClose={handleDialogClose} open={isOpenDialog} fullWidth maxWidth={'lg'} >
- <DialogContent>
- <Paper style={{ height: '200px' }}>
- <ConnectionInfo
- messageType={'Saving Error'}
- message={save.message}
- reachable={save.message === ''}
- style={{ backgroundColor: 'rgba(255, 255, 255, 0.7)', zIndex: 9999 }}
- />
- </Paper>
- </DialogContent>
- </Dialog>
- </Stack>
- : savingComplete &&
- save.status === 200 &&
- <Typography className={classes.saveResponseOk} variant="body1">Link Saved</Typography>
- }
- </>
- }
- </>
- }
- </div>
- </Box>
- </>
- }
- </>
- }
- </Paper >
- </div >
- );
-});
-
-export default LinkCalculation;
+++ /dev/null
-/**
- * ============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 React, { FC, useEffect, useState, SyntheticEvent } from 'react';
-import { RouteComponentProps, withRouter } from 'react-router-dom';
-
-import AppBar from '@mui/material/AppBar';
-import Tab from '@mui/material/Tab';
-import Tabs from '@mui/material/Tabs';
-
-import { NavigateToApplication } from '../../../../../framework/src/actions/navigationActions';
-import { useApplicationDispatch } from '../../../../../framework/src/flux/connect';
-
-import LineOfSightMainView from '../../lineOfSight/views/lineOfSightMain';
-import { TabId } from '../model/tabId';
-import LinkCalculation from './linkCalculation';
-import LinkTableComponent from '../components/linkTable';
-
-type mainComponentProps = RouteComponentProps & { activePanel: string };
-
-export const MainView: FC<mainComponentProps> = (props) => {
-
- const [panel, setPanel] = useState(props.activePanel);
- const dispatch = useApplicationDispatch();
- const navigateToApplication = (applicationName: string, path?: string) => dispatch(new NavigateToApplication(applicationName, path, ''));
-
- // const dispatch = useApplicationDispatch();
- // const updateTab =(value:TabId) => dispatch(new UpdateTabAction(value))
-
- const changeTab = (event: SyntheticEvent, value: TabId) => {
- setPanel(value);
- };
-
- const linkTableTab = () => {
- navigateToApplication('microwave', '');
- };
-
- const calculateLinkTab = () => {
- navigateToApplication('microwave', 'calculateLink');
- };
-
- const lineOfSightTab = () => {
- navigateToApplication('microwave', 'lineOfSightMap');
- };
-
- useEffect(() => {
- if (panel == null) {
- setPanel('linkTable');
- }
- }, []);
-
- return (
- <>
- <AppBar position="static" enableColorOnDark >
- <Tabs onChange={changeTab} value={panel} indicatorColor="secondary" textColor="inherit">
- <Tab label="links" value="linkTable" onClick={linkTableTab} />
- <Tab label="link calculation" value="linkCalculation" onClick={calculateLinkTab} />
- <Tab label="Line of Sight" value="lineOfSight" onClick={lineOfSightTab} />
- </Tabs>
- </AppBar>
- {panel === 'linkTable'
- ? <LinkTableComponent />
- : panel === 'linkCalculation'
- ? <LinkCalculation />
- : panel === 'lineOfSight'
- ? <LineOfSightMainView />
- : null
- }
- </>
- );
-};
-
-export default withRouter(MainView);
\ No newline at end of file
+++ /dev/null
-/**
-* ============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==========================================================================
-*/
-
-// app configuration and main entry point for the app
-
-import React, { FC } from 'react';
-import applicationManager from '../../../framework/src/services/applicationManager';
-import { requestRest } from '../../../framework/src/services/restService';
-
-import { Antenna } from './linkCalculator/model/antenna';
-import { Link } from './linkCalculator/model/link';
-import { Radio } from './linkCalculator/model/radio';
-import { ModelType } from './linkCalculator/model/topologyTypes';
-import { Waveguide } from './linkCalculator/model/waveguide';
-
-import { Redirect, Route, RouteComponentProps, Switch, useLocation, withRouter } from 'react-router-dom';
-import { useApplicationDispatch } from '../../../framework/src/flux/connect';
-import { SetPassedInValues, SetReachableAction } from './lineOfSight/actions/lineOfSightCommonActions';
-import { TERRAIN_URL, TILE_URL } from './lineOfSight/config';
-import { isNumber } from './lineOfSight/utils/lineOfSightMath';
-import { FirstMandatoryCheckAction } from './linkCalculator/actions/errorAction';
-import { UpdateModelTypesAction, UpdateRegionRegulatorListAction } from './linkCalculator/actions/queryActions';
-import { UpdateDevicesOnFirstLoad } from './linkCalculator/actions/radioActions';
-import { PluginDoneLoadingAction, ResetFormAction } from './linkCalculator/actions/viewAction';
-import RootHandler from './linkCalculator/handlers/rootHandler';
-import dataService from './linkCalculator/service/dataService';
-import MainView from './linkCalculator/views/mainView';
-import { Channel, RegionRegulator } from './linkCalculator/model/bandPlan';
-import { getAllBands, getFrequencyplans, updateSavedChannels } from './linkCalculator/actions/bandPlanAction';
-import { SaveChannel } from './linkCalculator/model/updateLink';
-
-const appIcon = require('./linkCalculator/assets/icons/microwaveAppIcon.svg'); // select app icon
-
-export const BASE_URL = '/topology/linkcalculator';
-
-
-
-
-
-const useQuery = () => {
- return new URLSearchParams(useLocation().search);
-};
-
-const MicrowaveRouteAdapter = ((props: RouteComponentProps<{ mountId?: string }>) => {
- const dispatch = useApplicationDispatch();
-
- const resetForm = () => dispatch(new ResetFormAction());
- const updateRegulatorList = (regionRegulatorList: RegionRegulator[]) => dispatch(new UpdateRegionRegulatorListAction(regionRegulatorList));
- const updateModelTypes = (modelTypes: ModelType[]) => dispatch(new UpdateModelTypesAction(modelTypes));
- const updateDevicesOnFirstLoad = async (antennas: Antenna[], radios: Radio[], waveguides: Waveguide[], linkAttributes: Link) => {
- dispatch(await new UpdateDevicesOnFirstLoad(antennas, radios, waveguides, linkAttributes));
- dispatch(new FirstMandatoryCheckAction());
- dispatch(new PluginDoneLoadingAction(true));
- dispatch(getAllBands(linkAttributes.operationalParameters.bandplanKeyId));
- dispatch(getFrequencyplans(linkAttributes.siteA.id, linkAttributes.siteB.id, linkAttributes.operationalParameters.bandKeyId));
-
- };
- const getSavedChannels = async (savedChannels: SaveChannel[], allChannels: Channel[]) => dispatch(updateSavedChannels(savedChannels, allChannels));
- let query = useQuery();
- // called when component finished mounting
-
- const extractLinkIDFromURL = (queryParam: URLSearchParams) => {
- return queryParam.get('linkId');
- };
-
- React.useEffect(() => {
- const linkId = extractLinkIDFromURL(query);
- const linkAttributes = requestRest<Link>(`${BASE_URL}/link/${linkId}`);
- const regulators = dataService.bandPlanRegulators();
-
-
- const modelTypeListQuery = dataService.modelTypeListQuery();
- const queryArray = [regulators, modelTypeListQuery, linkAttributes];
- if (linkId) {
- Promise.all(queryArray).then(async values => {
-
- let radios: Radio[] = [];
- let antennas: Antenna[] = [];
- let waveguides: Waveguide[] = [];
- await dataService.getModels(values[2].operationalParameters.bandKeyId, 'radio')!.then((x: Radio[]) => {
- radios = x;
- });
- await dataService.getModels(values[2].operationalParameters.bandKeyId, 'radio-antenna')!.then((x: Antenna[]) => {
- antennas = x;
- });
- await dataService.getModels(values[2].operationalParameters.bandKeyId, 'radio-to-antenna-link')!.then((x: Waveguide[]) => {
- waveguides = x;
- });
- updateRegulatorList(values[0]);
- updateModelTypes(values[1]);
-
- if (values[2].operationalParameters.selectedChannelList && values[2].operationalParameters.selectedChannelList.length > 0) {
- const channelQueryPromise = await dataService.channelQuery(values[2].operationalParameters.bandplanKeyId, values[2].operationalParameters.bandKeyId);
- if (channelQueryPromise.data) {
- getSavedChannels(values[2].operationalParameters.selectedChannelList, channelQueryPromise.data);
- }
- }
-
- updateDevicesOnFirstLoad(antennas, radios, waveguides, values[2]);
-
- });
- } else {
- resetForm();
- }
- }, []);
-
-
- React.useEffect(() => {
- if (props.location.pathname === '/microwave' && props.location.search.length == 0) {
- resetForm();
- }
- }, [props.location.pathname, props.location.search]);
-
- return (
- <MainView activePanel="linkCalculation" />
- );
-});
-
-type AppProps = RouteComponentProps;
-const LineOfSightApplicationRouteAdapter: FC<AppProps> = () => {
- const dispatch = useApplicationDispatch();
- const setPassedInValues = (values: (string | null)[]) => dispatch(SetPassedInValues(values));
- const setReachable = (reachable: boolean) => dispatch(new SetReachableAction(reachable));
- let query = useQuery();
-
- /***
- *
- * Checks if lat1, lon1, lat2, lon2 were passed in as url parameters
- */
- const areMandatoryParamsPresent = (queryParams: URLSearchParams) => {
- return isNumber(queryParams.get('lat1')) && isNumber(queryParams.get('lon1')) && isNumber(queryParams.get('lat2')) && isNumber(queryParams.get('lon2'));
- };
-
- const extractValuesFromURL = (queryParams: URLSearchParams) => {
- return [queryParams.get('lat1'), queryParams.get('lon1'), queryParams.get('lat2'), queryParams.get('lon2'), queryParams.get('amslA'), queryParams.get('antennaHeightA'), query.get('amslB'), queryParams.get('antennaHeightB')];
- };
-
- const extractAndDispatchUrlValues = () => {
- //if mandatory values aren't there, do nothing
- if (areMandatoryParamsPresent(query)) {
- const values = extractValuesFromURL(query);
- setPassedInValues(values);
- }
- };
-
- const tryCheckConnection = () => {
- const terrain = fetch(`${TERRAIN_URL}/`);
- const tiles = fetch(`${TILE_URL}/10/0/0.png`);
-
- Promise.all([terrain, tiles])
- .then((result) => {
- setReachable(result[0].ok && result[1].ok);
- })
- .catch(error => {
- console.error('services not reachable.');
- console.error(error);
- setReachable(false);
- });
- };
-
- // called when component finshed mounting
- React.useEffect(() => {
- extractAndDispatchUrlValues();
- //check tiles/terrain connectivity
- tryCheckConnection();
-
- }, []);
-
- return (
- <MainView activePanel='lineOfSight' />
- );
-};
-
-const App = withRouter((props: RouteComponentProps) => {
- props.history.action = 'POP';
- return (
- <Switch>
- <Route path={`${props.match.path}/calculateLink/:linkId`} component={MicrowaveRouteAdapter} />
- <Route path={`${props.match.path}/calculateLink`} component={MicrowaveRouteAdapter} />
- <Route path={`${props.match.path}/lineOfSightMap`} component={LineOfSightApplicationRouteAdapter} />
- <Route path={`${props.match.path}`} component={MainView} />
- <Redirect to={`${props.match.path}`} />
- </Switch>
- );
-});
-
-export function register() {
- applicationManager.registerApplication({
- name: 'microwave',
- icon: appIcon,
- rootActionHandler: RootHandler,
- rootComponent: App,
- menuEntry: 'Microwave',
- });
-}
-
-
-
+++ /dev/null
-{
- "extends": "../../tsconfig.json",
- "compilerOptions": {
- "outDir": "./dist",
- },
-}
+++ /dev/null
-/**
- * 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 proxyConf = require('../../proxy.conf');
-
-
-// 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: {
- microwaveApp: ["./pluginMicrowave.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"
- }]
- },
- {
- test: /\.css$/i,
- use: ["style-loader", "css-loader"],
- }, {
- //don't minify images
- test: /\.(png|gif|jpg|svg)$/,
- use: [{
- loader: 'url-loader',
- options: {
- limit: 10,
- name: './images/[name].[ext]'
- }
- }]
- }]
- },
-
- 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: proxyConf,
- }
- }];
-}
\ No newline at end of file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.o-ran-sc.oam-controller.parent</groupId>
+ <artifactId>oparent</artifactId>
+ <version>3.0.2-SNAPSHOT</version>
+ </parent>
+
<groupId>org.o-ran-sc.oam-controller.features.sdnr.odlux</groupId>
<artifactId>sdnr-odlux-app-minimumApp</artifactId>
<version>1.7.0-SNAPSHOT</version>
+++ /dev/null
-{
- "presets": [
- ["@babel/preset-react"],
- ["@babel/preset-env", {
- "targets": {
- "chrome": "66"
- },
- "spec": true,
- "loose": false,
- "modules": false,
- "debug": false,
- "useBuiltIns": "usage",
- "forceAllTransforms": true
- }]
- ],
- "plugins": []
-}
+++ /dev/null
-Copyright of icons is as followes:
-
-<!--
- * ============LICENSE_START========================================================================
- * apartment.png - Material Icons
- * =================================================================================================
- * Copyright (C) 2020 Google. 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==========================================================================
- */
- -->
-
-datacenter.png and lamp.png
-
-Taken from MS Word
-
-According to https://support.microsoft.com/en-us/office/insert-icons-in-microsoft-office-e2459f17-3996-4795-996e-b9a13486fa79 (date: October 9th, 2019)
-"These icons are free to use; there's no royalty or copyright."
-
-
\ No newline at end of file
+++ /dev/null
-declare const apartment: string;
-export default apartment;
\ No newline at end of file
+++ /dev/null
-declare const customize: string;
-export default customize;
\ No newline at end of file
+++ /dev/null
-declare const datacenter: string;
-export default datacenter;
\ No newline at end of file
+++ /dev/null
-declare const datacenterred: string;
-export default datacenterred;
\ No newline at end of file
+++ /dev/null
-declare const factory: string;
-export default factory;
\ No newline at end of file
+++ /dev/null
-declare const factoryRed: string;
-export default factoryRed;
\ No newline at end of file
+++ /dev/null
-declare const lamp: string;
-export default lamp;
\ No newline at end of file
+++ /dev/null
-declare const lampred: string;
-export default lampred;
\ No newline at end of file
+++ /dev/null
-{
- "name": "@odlux/transport-app",
- "version": "0.1.0",
- "description": "A react based modular UI to display event log 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": "Aijana Schumann",
- "license": "Apache-2.0",
- "dependencies": {
- "@fortawesome/free-solid-svg-icons": "5.6.3",
- "@fortawesome/react-fontawesome": "0.1.14",
- "@emotion/react": "^11.7.0",
- "@emotion/styled": "^11.6.0",
- "@mui/icons-material": "^5.2.0",
- "@mui/material": "^5.2.2",
- "@mui/styles": "^5.2.2",
- "@odlux/framework": "*",
- "history": "^4.9.0",
- "maplibre-gl": "^3.0.0",
- "object.values": "^1.1.1"
- },
- "peerDependencies": {
- "@types/classnames": "2.2.6",
- "@types/flux": "3.1.8",
- "@types/jquery": "3.3.10",
- "@types/react": "17.0.37",
- "@types/react-dom": "17.0.11",
- "@types/react-router-dom": "5.1.7",
- "jquery": "3.3.1",
- "react": "17.0.2",
- "react-dom": "17.0.2",
- "react-router-dom": "5.2.0",
- "react-split-pane": "0.1.92"
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ ============LICENSE_START=======================================================
- ~ ONAP : SDNR ODLUX
- ~ ================================================================================
- ~ Copyright (C) 2020 AT&T 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=======================================================
- ~
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.o-ran-sc.oam-controller.features.sdnr.odlux</groupId>
- <artifactId>sdnr-odlux-app-networkMapApp</artifactId>
- <version>1.7.0-SNAPSHOT</version>
- <packaging>jar</packaging>
-
- <name>SDNR ODLUX :: ${project.artifactId}</name>
- <licenses>
- <license>
- <name>Apache License, Version 2.0</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0</url>
- </license>
- </licenses>
-
-
- <build>
- <resources>
- <resource>
- <directory>dist</directory>
- <targetPath>odlux</targetPath>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <artifactId>maven-clean-plugin</artifactId>
- <configuration>
- <filesets>
- <fileset>
- <directory>dist</directory>
- <followSymlinks>false</followSymlinks>
- </fileset>
- <fileset>
- <directory>node</directory>
- <followSymlinks>false</followSymlinks>
- </fileset>
- <fileset>
- <directory>node_modules</directory>
- <followSymlinks>false</followSymlinks>
- </fileset>
- <fileset>
- <directory>../node_modules</directory>
- <followSymlinks>false</followSymlinks>
- </fileset>
- <!-- eclipse bug build bin folder in basedir -->
- <fileset>
- <directory>bin</directory>
- <followSymlinks>false</followSymlinks>
- </fileset>
- </filesets>
- </configuration>
- </plugin>
- <plugin>
- <groupId>de.jacks-it-lab</groupId>
- <artifactId>frontend-maven-plugin</artifactId>
- <version>1.7.2</version>
- <executions>
- <execution>
- <id>install node and yarn</id>
- <goals>
- <goal>install-node-and-yarn</goal>
- </goals>
- <!-- optional: default phase is "generate-resources" -->
- <phase>initialize</phase>
- <configuration>
- <nodeVersion>v16.17.0</nodeVersion>
- <yarnVersion>v1.22.19</yarnVersion>
- </configuration>
- </execution>
- <execution>
- <id>yarn build</id>
- <goals>
- <goal>yarn</goal>
- </goals>
- <configuration>
- <arguments>run build</arguments>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
+++ /dev/null
-/**
- * ============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 handleConnectionError = () => (dispatcher: Dispatch, getState: () => IApplicationStoreState) => {
- const { network: { connectivity: { isTopologyServerAvailable } } } = getState();
- if (isTopologyServerAvailable) {
- dispatcher(new IsTopologyServerReachableAction(false));
- }
-};
-
-export const handleConnectionChange = (newState: boolean) => (dispatcher: Dispatch, _getState: () => IApplicationStoreState) => {
- dispatcher(new IsTopologyServerReachableAction(newState));
-};
-
-export const setTileServerReachableAction = (isReachable: boolean) => (dispatcher: Dispatch, getState: () => IApplicationStoreState) => {
- const { network: { connectivity: { isTileServerAvailable } } } = getState();
- if (isReachable !== isTileServerAvailable) {
- dispatcher(new IsTileServerReachableAction(isReachable));
- }
-};
-
-export const setTopologyServerReachableAction = (isReachable: boolean) => (dispatcher: Dispatch, getState: () => IApplicationStoreState) => {
- const { network: { connectivity: { isTopologyServerAvailable } } } = getState();
- if (isReachable !== isTopologyServerAvailable) {
- dispatcher(new IsTopologyServerReachableAction(isReachable));
- }
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { requestRest } from '../../../../framework/src/services/restService';
-import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore';
-
-import { Link, Site, Device, Service } from '../model/topologyTypes';
-import { HistoryEntry } from '../model/historyEntry';
-import { NetworkElementConnection } from '../model/networkElementConnection';
-import { dataService } from '../services/dataService';
-import { highlightElementAction } from './mapActions';
-import { handleConnectionError } from './connectivityAction';
-
-import { SITEDOC_URL } from '../config';
-
-export class SelectElementAction extends Action {
- constructor(public data: Link | Site | Service) {
- super();
- }
-}
-
-export class ClearDetailsAction extends Action {
-}
-
-export class AddToHistoryAction extends Action {
- constructor(public entry: HistoryEntry) {
- super();
- }
-}
-
-export class ClearHistoryAction extends Action {
-}
-
-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 {
-}
-
-export class InitializeLoadedDevicesAction extends Action {
- constructor(public devices: Device[]) {
- super();
- }
-}
-
-export class IsSitedocReachableAction extends Action {
- constructor(public isReachable: boolean) {
- super();
- }
-}
-
-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) => {
-
- const { network: { details: { isBusyCheckingDeviceList } } } = getState();
-
- if (isBusyCheckingDeviceList) return;
- dispatcher(new IsBusyCheckingDeviceListAction(true));
-
- const ids: string[] = list
- .filter(el => el.name && el.name.length > 0)
- .map((device) => {
- return device.name;
- });
-
- const resultData = await dataService.getAdditionalInfoOnDevices(ids);
-
- if (resultData) {
- resultData.forEach((data: NetworkElementConnection) => {
-
- const index = list.findIndex(el => { return el.name === data.id; });
- if (index !== -1) {
- list[index].status = data.status;
- list[index].type = data['device-type'];
- }
- });
- }
-
- dispatcher(new FinishedLoadingDeviceListAction(list));
- dispatcher(new IsBusyCheckingDeviceListAction(false));
-};
-
-export const CheckSitedocReachability = () => async (dispatcher: Dispatch) => {
- requestRest<any>(SITEDOC_URL + '/app/versioninfo').then(response => {
- console.log(response);
- if (response) {
- dispatcher(new IsSitedocReachableAction(true));
- } else {
- dispatcher(new IsSitedocReachableAction(false));
- }
- });
-};
-
-export const LoadNetworkElementDetails = (type: string, id: string, zoomToElement = false) => async (dispatcher: Dispatch) => {
- const response = await dataService.getDetailsData(type, id);
- if (response !== null) {
- dispatcher(new SelectElementAction(response));
- dispatcher(highlightElementAction(response, zoomToElement));
- dispatcher(new ClearHistoryAction());
- } else {
- dispatcher(handleConnectionError());
- }
-};
-
+++ /dev/null
-/**
- * ============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 SetFilterValueAction extends Action {
- constructor(public value: string) {
- super();
- }
-}
\ No newline at end of file
+++ /dev/null
-/**
- * ============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';
-
-import { Coordinate } from '../model/coordinates';
-import { BoundingBox } from '../model/boundingBox';
-import { Link, Site, Service, isLink, isService, isSite } from '../model/topologyTypes';
-
-import { dataService } from '../services/dataService';
-import { URL_API } from '../config';
-import { updateMapLayers } from '../services/settingsService';
-import { calculateMidPoint } from '../utils/mapUtils';
-
-export class HighlightLinkAction extends Action {
- constructor(public link: Link) {
- super();
- }
-}
-
-export class HighlightSiteAction extends Action {
- constructor(public site: Site) {
- super();
- }
-}
-
-export class HighlightServiceAction extends Action {
- constructor(public service: Service) {
- super();
- }
-}
-
-export class RemoveHighlightingAction extends Action {
-}
-
-export class ZoomToSearchResultAction extends Action {
- constructor(public center: Coordinate, public start?: Coordinate, public end?: Coordinate, public zoom?: number) {
- super();
- }
-}
-
-export class ZoomToFinishedAction extends Action {
-}
-
-export class AddAlarmAction extends Action {
- constructor(public site: Site) {
- super();
- }
-}
-
-export class RemoveAlarmAction extends Action {
- constructor(public site: Site) {
- super();
- }
-}
-
-export class SetCoordinatesAction extends Action {
- constructor(public lat: string, public lon: string, public zoom: string) {
- super();
- }
-}
-
-export class SetStatistics extends Action {
- constructor(public siteCount: string, public linkCount: string, public serviceCount: string) {
- super();
- }
-}
-
-export class SetIconSwitchAction extends Action {
- constructor(public enable: boolean) {
- super();
- }
-}
-
-export class LayerChangedAction extends Action {
- constructor(public layerName: string, public displayed: boolean, public isBaseLayer: boolean) {
- super();
- }
-}
-
-export class UpdateLayersVisibilityAction extends Action {
- constructor(public layerVisibility: { [key: string]: boolean }) {
- super();
- }
-}
-
-export class LayersLoadedAction extends Action {
- constructor(public layers: string[]) {
- super();
- }
-}
-
-export class OpenLayersAction extends Action {
- constructor(public open: boolean) {
- super();
- }
-}
-
-export class OpenStatisticsAction extends Action {
- constructor(public open: boolean) {
- super();
- }
-}
-
-export const updateLayerAsyncAction = (layerName: string, displayed: boolean, isBaseLayer = true) => (dispatcher: Dispatch, getState: () => IApplicationStoreState) => {
- dispatcher(new LayerChangedAction(layerName, displayed, isBaseLayer));
-
- const { network: { map: { layersContainer } } } = getState();
- const newLayerSettings = layersContainer.elements.reduce((acc, layer) => {
- acc[layer.name] = layer.displayed;
- return acc;
- }, {} as { [key: string]: boolean });
-
- return updateMapLayers(newLayerSettings).then(() => true);
-};
-
-export const loadLayers = () => (dispatcher: Dispatch, getState: () => IApplicationStoreState) => {
- const currentLayers = getState().network.map.layersContainer.elements;
- return dataService.getLabels().then(res => {
- const data = (res || []).filter(i => i !== 'default');
- const filteredLayers = data.filter(i => !currentLayers.find(el => el.name == i));
- dispatcher(new LayersLoadedAction(filteredLayers));
- }).then(() => true);
-};
-
-// Not used as of right now
-export const findSiteToAlarm = (alarmedNodeId: string) => (dispatcher: Dispatch) => {
-
- fetch(URL_API + '/sites/devices/' + alarmedNodeId)
- .then(res => res.json())
- .then(result => {
- dispatcher(new AddAlarmAction(result));
- });
-};
-
-export const highlightElementAction = (data: Service | Link | Site, zoomToElement = false) => (dispatcher: Dispatch) => {
- if (isSite(data)) {
- dispatcher(new HighlightSiteAction(data));
- if (zoomToElement) {
- dispatcher(new ZoomToSearchResultAction(data.location));
- }
- } else if (isLink(data)) {
- dispatcher(new HighlightLinkAction(data));
- if (zoomToElement) {
- const midPoint = calculateMidPoint(data.siteA.lat, data.siteA.lon, data.siteB.lat, data.siteB.lon);
- const startPoint = { lat: data.siteA.lat, lon: data.siteA.lon };
- const endPoint = { lat: data.siteB.lat, lon: data.siteB.lon };
- dispatcher(new ZoomToSearchResultAction(midPoint, startPoint, endPoint));
- }
- } else if (isService(data)) {
- dispatcher(new HighlightServiceAction(data));
- if (zoomToElement) {
- const midPoint = calculateMidPoint(data.route[0].lat, data.route[0].lon, data.route[data.route.length - 1].lat, data.route[data.route.length - 1].lon);
- const startPoint = { lat: data.route[0].lat, lon: data.route[0].lon };
- const endPoint = { lat: data.route[data.route.length - 1].lat, lon: data.route[data.route.length - 1].lon };
- dispatcher(new ZoomToSearchResultAction(midPoint, startPoint, endPoint));
- }
- }
-};
-
-export const updateZoomAction = (zoom: string) => (dispatcher: Dispatch, getState: () => IApplicationStoreState) => {
- const { network: { map: { coordinates: { lat, lon } } } } = getState();
- dispatcher(new SetCoordinatesAction(lat, lon, zoom));
-};
-
-export const updateStatistics = (boundingBox: BoundingBox) => (dispatcher: Dispatch, getState: () => IApplicationStoreState) => {
-
- const { network: { map: { statistics: { links, sites, services } } } } = getState();
-
- dataService.getStatistics(boundingBox.west, boundingBox.south, boundingBox.east, boundingBox.north)
- .then(result => {
- if (result) {
- // do not dispatch if data didn't change
- if (result.links !== links || result.sites !== sites || result.services !== services) {
- dispatcher(new SetStatistics(result.sites, result.links, result.services));
- }
- }
- });
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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();
- }
-}
+++ /dev/null
-/**
- * ============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 } from '../model/settings';
-import { Action } from '../../../../framework/src/flux/action';
-import { Dispatch } from '../../../../framework/src/flux/store';
-import { getMapSettings, updateMapSettings } from '../services/settingsService';
-import { UpdateLayersVisibilityAction } from './mapActions';
-
-export class SetMapSettingsAction extends Action {
-
- constructor(public settings: NetworkMapSettings) {
- super();
- }
-}
-
-export class SetThemeSettingsAction extends Action {
-
- constructor(public settings: NetworkMapThemes) {
- super();
- }
-}
-
-export class SetBusyLoadingAction extends Action {
-
- constructor(public busy: boolean) {
- super();
-
- }
-}
-
-/**
- * An async action that loads the settings from the backend.
- * @returns void
- */
-export const getSettings = () => async (dispatch: Dispatch) => {
- dispatch(new SetBusyLoadingAction(true));
-
- getMapSettings().then(result => {
- if (result) {
- if (result.networkMap) {
- dispatch(new SetMapSettingsAction(result.networkMap));
- }
- if (result.networkMapThemes) {
- dispatch(new SetThemeSettingsAction(result.networkMapThemes));
- }
- if (result.networkMapLayers) {
- dispatch(new UpdateLayersVisibilityAction(result.networkMapLayers));
- }
- } else {
- console.warn('settings couldn\'t be loaded.');
- }
- dispatch(new SetBusyLoadingAction(false));
- });
-};
-
-/**
- * An async action that updates and saves the settings on the backend.
- * @param mapSettings The new settings.
- * @returns void
- */
-export const updateSettings = (mapSettings: NetworkMapSettings) => async (dispatcher: Dispatch) =>{
-
- const result = await updateMapSettings(mapSettings);
- dispatcher(new SetMapSettingsAction(mapSettings));
-
- if (!result) {
- console.warn('settings couldn\'t be saved.');
- }
-
-};
+++ /dev/null
-/**
- * ============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 { Action } from '../../../../framework/src/flux/action';
-import { Dispatch } from '../../../../framework/src/flux/store';
-
-import { SitedocOrderTask, UserListItem } from '../model/siteDocTypes';
-import { sitedocDataService } from '../services/sitedocDataService';
-
-export class SetAllUsersAction extends Action {
- constructor(public users: UserListItem[]) {
- super();
- }
-}
-
-export class SetTSSRAction extends Action {
- constructor(public isTSSR: boolean) {
- super();
- }
-}
-
-export class UpdateNoteAction extends Action {
- constructor(public note: string) {
- super();
- }
-}
-
-export class UpdateStateAction extends Action {
- constructor(public state: string) {
- super();
- }
-}
-
-export class UpdateTasks extends Action {
- constructor(public tasks: SitedocOrderTask[]) {
- super();
- }
-}
-
-export class ResetAction extends Action {
-
-}
-
-export class SelectUserAction extends Action {
- constructor(public user: string) {
- super();
- }
-}
-
-export class SetSiteExists extends Action {
- constructor(public exists: boolean) {
- super();
- }
-}
-
-export const getUsersAction = () => async (dispatcher: Dispatch) => {
- const users = await sitedocDataService.getAllUsers();
- dispatcher(new SetAllUsersAction(users));
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React, { FC, useEffect } from 'react';
-import { useLocation } from 'react-router-dom';
-
-import SplitPane from 'react-split-pane';
-import makeStyles from '@mui/styles/makeStyles';
-
-import { useApplicationDispatch, useSelectApplicationState } from '../../../framework/src/flux/connect';
-
-import { Map } from './components/map/map';
-import Details from './components/details/details';
-import { RemoveHighlightingAction, SetCoordinatesAction, updateZoomAction } from './actions/mapActions';
-import { ClearHistoryAction, LoadNetworkElementDetails } from './actions/detailsAction';
-
-const useQuery = () => {
- return new URLSearchParams(useLocation().search);
-};
-
-const useStyles = makeStyles({
- networkMap: {
- position: 'relative',
- flex: 1,
- height: '100%',
- },
- resizer: {
- background: '#000',
- opacity: 0.2,
- zIndex: 1,
- MozBoxSizing: 'border-box',
- WebkitBoxSizing: 'border-box',
- boxSizing: 'border-box',
- MozBackgroundClip: 'padding',
- WebkitBackgroundClip: 'padding',
- backgroundClip: 'padding-box',
-
- '&:hover': {
- WebkitTransition: 'all 2s ease',
- transition: 'all 2s ease',
- },
-
- '&.horizontal': {
- height: 11,
- margin: '-5px 0',
- borderTop: '5px solid rgba(255, 255, 255, 0)',
- borderBottom: '5px solid rgba(255, 255, 255, 0)',
- cursor: 'row-resize',
- width: '100%',
- },
-
- '&.horizontal:hover': {
- borderTop: '5px solid rgba(0, 0, 0, 0.5)',
- borderBottom: '5px solid rgba(0, 0, 0, 0.5)',
- },
-
- '&.vertical': {
- width: 11,
- margin: '0 -5px',
- borderLeft: '5px solid rgba(255, 255, 255, 0)',
- borderRight: '5px solid rgba(255, 255, 255, 0)',
- cursor: 'col-resize',
- },
-
- '&.vertical:hover': {
- borderLeft: '5px solid rgba(0, 0, 0, 0.5)',
- borderRight: '5px solid rgba(0, 0, 0, 0.5)',
- },
-
- '&.disabled': {
- cursor: 'not-allowed',
- },
-
- '&.disabled:hover': {
- borderColor: 'transparent',
- },
- },
-});
-
-const MainView: FC = () => {
-
- const query = useQuery();
-
- const [ newLatParam, newLonParam ] = query.get('center')?.split(',') ?? [];
- const newZoomParam = query.get('zoom');
-
- const newLat = newLatParam ? Number(newLatParam).toFixed(4) : undefined;
- const newLon = newLonParam ? Number(newLonParam).toFixed(4) : undefined;
- const newZoom = newZoomParam ? Number(newZoomParam).toFixed(2) : undefined;
-
- const newSiteId = query.get('siteId');
- const newLinkId = query.get('linkId');
- const newServiceId = query.get('serviceId');
-
- const { lat, lon, zoom } = useSelectApplicationState(state => state.network.map.coordinates);
- const selectedLink = useSelectApplicationState(state => state.network.map.selectedLink);
- const selectedSite = useSelectApplicationState(state => state.network.map.selectedSite);
- const selectedService = useSelectApplicationState(state => state.network.map.selectedService);
-
- const dispatch = useApplicationDispatch();
-
- useEffect(() => {
- const coordinateHasChanged = (newLat !== lat) || (newLon !== lon) || (newZoom !== zoom);
- const atLeastOneCoordinateIsDefined = newLat || newLon || newZoom;
-
- if (coordinateHasChanged && atLeastOneCoordinateIsDefined) {
- dispatch(new SetCoordinatesAction(newLat || lat, newLon || lon, newZoom || zoom));
- }
-
- const handleSelectedElement = async () => {
- // network element has changed
- if (!newSiteId && !newLinkId && !newServiceId) {
- dispatch(new ClearHistoryAction());
- dispatch(new RemoveHighlightingAction());
- return;
- } else if (newSiteId) {
- if (selectedSite?.properties.id !== Number(newSiteId) || coordinateHasChanged) {
- await dispatch(LoadNetworkElementDetails('site', newSiteId, !newLat && !newLon));
- }
- } else if (newLinkId) {
- if (selectedLink?.properties.id !== Number(newLinkId) || coordinateHasChanged) {
- await dispatch(LoadNetworkElementDetails('link', newLinkId, !newLat && !newLon));
- }
- } else if (newServiceId) {
- if (selectedService?.properties.id !== Number(newServiceId) || coordinateHasChanged) {
- await dispatch(LoadNetworkElementDetails('service', newServiceId, !newLat && !newLon));
- }
- }
-
- if (newZoom) {
- dispatch(updateZoomAction(newZoom));
- }
- };
-
- handleSelectedElement();
-
- }, [newLat, newLon, newZoom, newSiteId, newLinkId, newServiceId]);
-
- const styles = useStyles();
-
- return (
- <div className={styles.networkMap}>
- <SplitPane split="vertical" allowResize primary='second' resizerClassName={styles.resizer} minSize={200} pane2Style={{ display: 'flex' }}>
- <Map />
- <Details />
- </SplitPane>
- </div>
- );
-};
-
-export default MainView;
+++ /dev/null
-<!-- highstreet technologies GmbH colour scheme
- Grey #565656
- LBlue #36A9E1
- DBlue #246DA2
- Green #003F2C / #006C4B
- Yellw #C8D400
- Red #D81036
--->
-
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
-
-<g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)"
->
-
-<path fill="#565656" d="M2440 5114 c-14 -2 -59 -9 -100 -15 -103 -15 -263 -69 -373 -126
--227 -117 -434 -328 -552 -562 -45 -91 -98 -250 -116 -351 -21 -118 -17 -326
-10 -445 94 -432 375 -1147 830 -2113 144 -306 414 -852 421 -852 4 0 79 147
-167 328 652 1327 1039 2291 1104 2751 36 258 -47 580 -214 831 -63 95 -250
-282 -342 342 -143 92 -310 162 -469 194 -71 14 -319 27 -366 18z m252 -982
-c60 -26 126 -93 158 -157 35 -72 35 -198 0 -270 -31 -64 -92 -124 -155 -156
--41 -20 -65 -24 -135 -24 -100 0 -159 23 -225 90 -166 165 -102 448 119 527
-66 24 172 20 238 -10z"/>
-
-<path fill="#36A9E1" d="M 616 2395 C 632 2510 562 1951 480 1285 L 344 198 C 314 18 374 0 488 -6 L 2560 0 L 4647 0 C 4718 12 4832 18 4808 198 L 4510 2387 C 4491 2547 4363 2557 4254 2558 L 4028 2555 L 3975 2398 L 3922 2240 L 4139 2240 L 4307 420 L 850 420 L 985 2239 L 1196 2240 L 1142 2400 L 1088 2560 L 844 2559 C 740 2559 630 2544 616 2397 Z"/>
-</g>
-</svg>
+++ /dev/null
-/**
- * ============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 React, { useEffect, useRef, useState, ChangeEvent, MouseEvent } from 'react';
-
-import maplibregl from 'maplibre-gl';
-import 'maplibre-gl/dist/maplibre-gl.css';
-
-import makeStyles from '@mui/styles/makeStyles';
-import Typography from '@mui/material/Typography/Typography';
-import TextField from '@mui/material/TextField/TextField';
-import Grid from '@mui/material/Grid/Grid';
-import Slider from '@mui/material/Slider/Slider';
-import InputLabel from '@mui/material/InputLabel/InputLabel';
-import FormControlLabel from '@mui/material/FormControlLabel/FormControlLabel';
-import Button from '@mui/material/Button/Button';
-import MenuItem from '@mui/material/MenuItem/MenuItem';
-import Select from '@mui/material/Select/Select';
-import Switch from '@mui/material/Switch/Switch';
-
-import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect';
-import { requestRest } from '../../../../../framework/src/services/restService';
-import { IApplicationStoreState } from '../../../../../framework/src/store/applicationStore';
-import { SettingsComponentProps } from '../../../../../framework/src/models/settings';
-
-import { OSM_STYLE } from '../../config';
-import { updateSettings } from '../../actions/settingsAction';
-import { NetworkMapSettings } from '../../model/settings';
-import mapLayerService from '../../utils/mapLayers';
-
-import { ThemeEntry } from './themeElement';
-
-const defaultBoundingBox = '12.882544785787754,52.21421979821472,13.775455214211949,52.80406241672602';
-
-const useStyles = makeStyles({
- sectionMargin: {
- marginTop: '30px',
- marginBottom: '15px',
- },
- elementMargin: {
- marginLeft: '10px',
- },
- settingsTable: {
- display: 'flex', flexDirection: 'row', flexGrow: 1, height: '100%', position: 'relative',
- },
- settingsRow: {
- width: '60%', flexDirection: 'column', position: 'relative', marginRight: '15px',
- },
-});
-
-type NetworkMapSetupProps = SettingsComponentProps;
-
-const NetworkMapSetup = (props: NetworkMapSetupProps) => {
-
- const mapRef = useRef<maplibregl.Map>();
- const mapContainerRef = useRef<HTMLDivElement>(null);
-
- const mapSettings = useSelectApplicationState((state: IApplicationStoreState) => state.network.settings.mapSettings);
- const mapThemes = useSelectApplicationState((state: IApplicationStoreState) => state.network.settings.themes);
-
- const dispatch = useApplicationDispatch();
- const updateMapSettings = (newMapSettings: NetworkMapSettings) => dispatch(updateSettings(newMapSettings));
-
- const [opacity, setOpacity] = useState(Number(mapSettings?.tileOpacity) || 100);
- const [theme, setTheme] = useState(mapSettings?.styling?.theme || '');
- const [latitude, setLatitude] = useState<number>(Number(mapSettings?.startupPosition?.latitude) || 52.5);
- const [longitude, setLongitude] = useState<number>(Number(mapSettings?.startupPosition?.longitude) || 13.35);
- const [zoom, setZoom] = useState<number>(Number(mapSettings?.startupPosition?.zoom) || 10);
- const [areIconsEnabled, setEnableIcons] = useState<boolean>(mapSettings?.areIconsEnabled || true);
-
- // used to make opacity available within the map event-listeners
- // (hook state values are snapshotted at initialization and not updated afterwards / only updated inside other hooks, thus use a ref here)
- const myOpacityRef = useRef(opacity);
- const setOpacityState = (data: any) => {
- myOpacityRef.current = data;
- setOpacity(data);
- };
-
- const updateSampleData = () => {
- const map = mapRef.current;
- if (!map) {
- return;
- }
-
- // get data of bounding box from networkmap
-
- const links = requestRest<any>('/topology/network/links/geojson/' + defaultBoundingBox);
- const sites = requestRest<any>('/topology/network/sites/geojson/' + defaultBoundingBox);
-
- Promise.all([links, sites]).then(results => {
- if (map.getSource('lines')) {
- (map.getSource('lines') as maplibregl.GeoJSONSource).setData(results[0]);
- }
-
- if (map.getSource('points')) {
- (map.getSource('points') as maplibregl.GeoJSONSource).setData(results[1]);
- }
-
- if (map.getSource('selectedPoints')) {
- (map.getSource('selectedPoints') as maplibregl.GeoJSONSource).setData(results[1].features[0]);
- }
- });
- };
-
- const recenterMap = () => {
- const map = mapRef.current;
- if (map && !isNaN(latitude) && !isNaN(longitude) && !isNaN(zoom))
- map.flyTo({
- center: [
- longitude,
- latitude,
- ], zoom: zoom,
- essential: false,
- });
- };
-
- const setState = () => {
- const map = mapRef.current;
- if (!map) {
- return;
- }
-
- if (mapSettings?.styling) {
- setTheme(mapSettings.styling.theme);
- mapLayerService.changeTheme(map, mapSettings.styling.theme);
- }
-
- if (mapSettings?.areIconsEnabled !== undefined) {
- setEnableIcons(mapSettings!.areIconsEnabled);
- }
-
- const propOpacity = mapSettings?.tileOpacity;
- if (propOpacity) {
- setOpacityState(propOpacity);
- }
- };
-
- const styles = useStyles();
- const currentTheme = mapThemes.find(el => el.key === theme);
-
- useEffect(() => {
- mapLayerService.availableThemes = mapThemes;
- mapRef.current = new maplibregl.Map({
- container: mapContainerRef.current!,
- style: OSM_STYLE as any,
- center: [longitude, latitude],
- zoom: zoom,
- });
-
- mapRef.current.on('load', () => {
- mapLayerService.addBaseSources(mapRef.current!, null, null, null);
- if (mapSettings?.styling?.theme !== theme) {
- mapLayerService.addBaseLayers(mapRef.current!);
- } else {
- mapLayerService.addBaseLayers(mapRef.current!);
- }
- mapLayerService.changeMapOpacity(mapRef.current!, myOpacityRef.current);
- updateSampleData();
- });
-
- mapRef.current.on('moveend', () => {
- const center = mapRef.current!.getCenter();
- setZoom(Number(mapRef.current!.getZoom().toFixed(4)));
- setLatitude(Number(center.lat.toFixed(4)));
- setLongitude(Number(center.lng.toFixed(4)));
- });
-
- }, []);
-
- useEffect(() => {
- recenterMap();
- }, [latitude, longitude, zoom]);
-
- useEffect(() => {
- setState();
- }, [mapSettings]);
-
- const handleOpacityChange = (event: Event, newValue: number) => {
- setOpacity(newValue);
- mapLayerService.changeMapOpacity(mapRef.current!, newValue);
- };
-
- const handleShowIconsChange = (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>, newValue: boolean) => {
- setEnableIcons(newValue);
- };
-
- const handleChangeTheme = (e: any) => {
-
- const newTheme = e.target.value;
- setTheme(newTheme);
- mapLayerService.changeTheme(mapRef.current!, newTheme);
- };
-
- const handleCancel = (e: MouseEvent) => {
- e.preventDefault();
- props.onClose();
- };
-
- const handleSaveSettings = async (e: MouseEvent) => {
- e.preventDefault();
-
- const updatedSettings: NetworkMapSettings = {
- tileOpacity: opacity.toString(),
- styling: { theme: theme },
- areIconsEnabled: areIconsEnabled,
- startupPosition: {
- latitude: latitude.toString(),
- longitude: longitude.toString(),
- zoom: zoom.toString(),
- },
- };
-
- await updateMapSettings(updatedSettings);
- props.onClose();
- };
-
- /**
- * Style property names to readable text
- * @param text property name
- * @returns readable text
- */
- const styleText = (text: string) => {
- const textParts = text.split(/(?=[A-Z])/); //split on uppercase character
- const newText = textParts.join(' ');
- return newText.charAt(0).toUpperCase() + newText.slice(1);
- };
-
- return (
- <>
- <h3>Settings</h3>
- <div className={styles.settingsTable}>
- <div className={styles.settingsRow}>
- <Typography variant="body1" style={{ fontWeight: 'bold' }} gutterBottom>Startup Position</Typography>
- <div style={{ display: 'flex', flexDirection: 'row' }}>
- <TextField variant="standard" type="number" value={latitude} onChange={(e) => setLatitude(e.target.value as any)} style={{ marginLeft: 10 }} label="Latitude" />
- <TextField variant="standard" type="number" value={longitude} onChange={(e) => setLongitude(e.target.value as any)} style={{ marginLeft: 5 }} label="Longitude" />
- <TextField variant="standard" type="number" value={zoom} onChange={(e) => setZoom(e.target.value as any)} style={{ marginLeft: 5 }} label="Zoom" />
- </div>
-
- <Typography className={styles.sectionMargin} variant="body1" style={{ fontWeight: 'bold' }} gutterBottom>
- Tile Opacity
- </Typography>
- <Grid className={styles.elementMargin} container spacing={2} style={{ width: '50%' }}>
- <Grid item>0</Grid>
- <Grid item xs>
- <Slider color="secondary" min={0} max={100} value={opacity} onChange={handleOpacityChange} aria-labelledby="continuous-slider" />
- </Grid>
- <Grid item>100</Grid>
- </Grid>
-
- <Typography className={styles.sectionMargin} variant="body1" style={{ fontWeight: 'bold' }} gutterBottom>
- Display icons
- </Typography>
- <FormControlLabel style={{ padding: 5 }}
- value="end"
- control={<Switch color="secondary" checked={areIconsEnabled} onChange={handleShowIconsChange} />}
- label="Show icons"
- labelPlacement="end"
- />
- <Typography className={styles.sectionMargin} variant="body1" style={{ fontWeight: 'bold' }} gutterBottom>
- Style of properties
- </Typography>
- <InputLabel id="theme-select-label">Theme</InputLabel>
- <Select variant="standard"
- className={styles.elementMargin}
- value={theme}
- onChange={handleChangeTheme}
- labelId="theme-select-label"
- style={{ marginLeft: 10 }}>
- {
- mapThemes.map(el => (<MenuItem value={el.key}>{el.key}</MenuItem>))
- }
- </Select>
- {currentTheme &&
- <div style={{ marginLeft: 60 }}>
- {
- ['site', 'selectedSite', 'fiberLink', 'microwaveLink'].map(el => (
- <ThemeEntry key={el} text={styleText(el)} color={(currentTheme as any)[el]} />
- ))
- }
- </div>
- }
- <div className={styles.sectionMargin} style={{ position: 'absolute', right: 0, top: '60%' }}>
- <Button className={styles.elementMargin} variant="contained" color="inherit" onClick={handleCancel}>Cancel</Button>
- <Button className={styles.elementMargin} variant="contained" color="secondary" onClick={handleSaveSettings}>Save</Button>
- </div>
- </div>
- <div id="map" ref={mapContainerRef} style={{ width: '35%', height: '50%' }} />
- </div>
- </>
- );
-};
-
-NetworkMapSetup.displayName = 'NetworkMapSetup';
-
-export { NetworkMapSetup };
+++ /dev/null
-/**
- * ============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 React from 'react';
-import { Typography } from '@mui/material';
-
-type ThemeEntryProps = {
- color: string;
- text: string;
-};
-
-const ThemeEntry = (props: ThemeEntryProps) => {
- const circleStyle = {
- padding: 10,
- margin: 20,
- backgroundColor: props.color,
- borderRadius: '50%',
- width: 10,
- height: 10,
- left: 0,
- top: 0,
- };
-
- return <div style={{ display: 'flex', flexDirection: 'row' }}>
- <div style={circleStyle} />
- <Typography variant="body1" style={{ marginTop: 24 }}>{props.text}</Typography>
- </div>;
-
-};
-
-ThemeEntry.displayName = 'ThemeEntry';
-
-export { ThemeEntry };
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React, { FC, MouseEvent } from 'react';
-import Table from '@mui/material/Table';
-import TableBody from '@mui/material/TableBody';
-import TableCell from '@mui/material/TableCell';
-import TableHead from '@mui/material/TableHead';
-import TableRow from '@mui/material/TableRow';
-import Paper from '@mui/material/Paper';
-
-import Tooltip from '@mui/material/Tooltip';
-import Button from '@mui/material/Button';
-import makeStyles from '@mui/styles/makeStyles';
-
-const useStyles = makeStyles({
- denseTable: {
- borderRadius: '0px',
- },
- button: {
- margin: 0,
- padding: '6px 6px',
- minWidth: 'unset',
- },
-});
-
-type DenseTableProps = {
- actions?: boolean;
- headers: string[];
- height: number;
- hover: boolean;
- ariaLabelRow: string;
- ariaLabelColumn?: string[];
- verticalTable?: boolean;
- navigate?(applicationName: string, path?: string): void;
- onLinkClick?(id: string): void; data: any[];
- onClick?(id: string): void;
-};
-
-const DenseTable: FC<DenseTableProps> = (props) => {
- const {
- ariaLabelRow,
- data,
- headers,
- height,
- hover,
- ariaLabelColumn,
- onClick = () => undefined,
- navigate = () => undefined,
- verticalTable,
- } = props;
-
- const styles = useStyles();
-
- const handleClick = (event: MouseEvent<HTMLDivElement>, id: string) => {
- event.preventDefault();
- onClick(id);
- };
-
- return (
- <Paper className={styles.denseTable}>
- <div style={{ height: height, overflow: 'auto' }}>
- <Table padding="normal" stickyHeader size="small" aria-label="table" >
- <TableHead>
- <TableRow>
- {
- headers.map((tableHeader) => (<TableCell>{tableHeader}</TableCell>))
- }
- </TableRow>
- </TableHead>
- <TableBody>
- {data.map((row, index) => {
-
- const values = (typeof row === 'string' || row instanceof String) ? [row] : Object.keys(row).map(function (e) { return row[e]; });
-
- return (
- <TableRow aria-label={ariaLabelRow} key={index} hover={hover} onClick={e => handleClick(e, row.name)}>
- {
- values.map((value, i) => {
- if (value !== undefined) {
-
- if (!verticalTable) {
- const ariaLabel = ariaLabelColumn === undefined ? headers[i].toLowerCase() : ariaLabelColumn[i];
- if (ariaLabel.length > 0) {
- return <TableCell aria-label={ariaLabel}>{value}</TableCell>;
- } else {
- return <TableCell>{value}</TableCell>;
- }
- } else {
- // skip adding aria label to 'header' column
- if (i === 0) {
- return <TableCell>{value}</TableCell>;
- } else {
- const ariaLabel = props.ariaLabelColumn === undefined ? props.headers[index].toLowerCase() : props.ariaLabelColumn[index];
- return <TableCell aria-label={ariaLabel}>{value}</TableCell>;
- }
- }
- } else
- return null;
- })
- }
- {
- props.actions && <TableCell >
- <div style={{ display: 'flex' }}>
- <Tooltip disableInteractive title="Configure">
- <Button
- color="inherit"
- className={styles.button}
- aria-label="configuration-button"
- disabled={row.status !== 'Connected'}
- onClick={(e) => {
- e.preventDefault();
- e.stopPropagation();
- navigate('configuration', row.name);
- }}>C</Button>
- </Tooltip>
- <Tooltip disableInteractive title="Fault">
- <Button
- color="inherit"
- className={styles.button}
- aria-label="fault-button"
- disabled={row.status !== 'Connected'}
- onClick={(e) => {
- e.preventDefault();
- e.stopPropagation();
- navigate('fault', row.name);
- }}>F</Button>
- </Tooltip>
- </div>
- </TableCell>
- }
- </TableRow>);
- })
- }
- </TableBody>
- </Table>
- </div>
- </Paper>
- );
-};
-
-DenseTable.displayName = 'DenseTable';
-
-export default DenseTable;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React from 'react';
-
-import makeStyles from '@mui/styles/makeStyles';
-import Breadcrumbs from '@mui/material/Breadcrumbs';
-import LinkComponent from '@mui/material/Link';
-import Paper from '@mui/material/Paper';
-import Typography from '@mui/material/Typography';
-
-import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect';
-import { AddToHistoryAction, ClearHistoryAction, SelectElementAction } from '../../actions/detailsAction';
-import { highlightElementAction } from '../../actions/mapActions';
-
-import { HistoryEntry } from '../../model/historyEntry';
-import { Link, Site, Service, isService, isSite, isLink } from '../../model/topologyTypes';
-
-import detailsUtils from '../../utils/detailsUtils';
-
-import LinkDetails from './linkDetails';
-import ServiceDetails from './serviceDetails';
-import SiteDetails from './siteDetails';
-
-const useStyles = makeStyles({
- mapDetails: {
- background: '#bbbdbf',
- padding: '20px',
- alignSelf: 'stretch',
- flex: '1 1 0',
- },
- container: {
- marginLeft: '15px',
- marginTop: '5px',
- },
- message: {
- marginTop: '5px',
- },
-});
-
-const Details: React.FC = () => {
-
- const data = useSelectApplicationState(state => state.network.details.data);
- const breadcrumbs = useSelectApplicationState(state => state.network.details.history);
-
- const dispatch = useApplicationDispatch();
- const displayElement = (element: Site | Link | Service) => dispatch(new SelectElementAction(element));
- const highlightElementOnMap = (element: Link | Site | Service) => dispatch(highlightElementAction(element));
- const addHistory = (newEntry: HistoryEntry) => dispatch(new AddToHistoryAction(newEntry));
- const clearHistory = () => dispatch(new ClearHistoryAction());
-
- const [message, _setMessage] = React.useState('No data selected.');
-
- const onLinkClick = async (id: string) => {
- detailsUtils.loadData('link', id, (result) => {
- displayElement(result);
- highlightElementOnMap(result);
- addHistory({ id: data!.name, data: data! as any });
- });
- };
-
- const backClick = (e: any) => {
- displayElement(breadcrumbs[0].data);
- highlightElementOnMap(breadcrumbs[0].data);
- clearHistory();
- e.preventDefault();
- };
-
- const renderDetailPanel = (element: Site | Link | Service) => {
- if (isSite(element)) {
- return <SiteDetails site={element} onLinkClick={onLinkClick} />;
- } else if (isService(element)) {
- return <ServiceDetails service={element} />;
- } else if (isLink(element)) {
- return <LinkDetails link={element} />;
- }
- return null;
- };
-
- const panelId = data !== null ? (isSite(data) ? 'site-details-panel' : 'link-details-panel') : 'details-panel';
-
- const styles = useStyles();
-
- return (
- <div className={styles.mapDetails }>
- <Paper style={{ height: '100%' }} id={panelId} aria-label={panelId} >
- { breadcrumbs.length > 0
- ? (
- <Breadcrumbs className={styles.container} aria-label="breadcrumbs-navigation">
- <LinkComponent underline="hover" aria-label="parent-element" color="inherit" href="/" onClick={backClick}>
- {breadcrumbs[0].id}
- </LinkComponent>
- <LinkComponent underline="hover" aria-label="child-element" color="textSecondary">
- {data?.name}
- </LinkComponent>
- </Breadcrumbs>
- )
- : null
- }
- { data
- ? renderDetailPanel(data)
- : <Typography className={styles.message} aria-label="details-panel-alt-message" align="center" variant="body1">{message}</Typography>
- }
- </Paper>
- </div>);
-};
-
-Details.displayName = 'MapDetails';
-
-export default Details;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React from 'react';
-
-import { AppBar, Button, Tab, Tabs, TextField, Typography } from '@mui/material';
-
-import { useApplicationDispatch } from '../../../../../framework/src/flux/connect';
-import { AddErrorInfoAction } from '../../../../../framework/src/actions/errorActions';
-
-import { Link } from '../../model/topologyTypes';
-import { LatLonToDMS } from '../../utils/mapUtils';
-import DenseTable from '../denseTable';
-
-type MandatoryParametersLOS = { lat: number | null; lon: number | null; amsl: number | null; antennaHeight: number | null };
-
-type LinkProps = { link: Link };
-
-const LinkDetails: React.FC<LinkProps> = (props) => {
-
- const dispatch = useApplicationDispatch();
- const showErrorMessage = (message: string) => dispatch(new AddErrorInfoAction({ title: 'Problem', message: message }));
-
- const [height, setHeight] = React.useState(330);
-
- const handleResize = () => {
-
- // table does not adhere to flex-box dimensions, so set height explicit
-
- const el = document.getElementById('link-details-panel')?.getBoundingClientRect();
- const el2 = document.getElementById('link-site-details')?.getBoundingClientRect();
-
- if (el && el2) {
- if (props.link?.feature?.properties?.subType === 'microwave')
- setHeight(el!.height - el2!.y - 80);
- else
- setHeight(el!.height - el2!.y + 20);
- }
- };
-
- //on mount
- React.useEffect(() => {
- handleResize();
-
- //window.addEventListener("resize", handleResize);
- }, []);
-
- React.useEffect(() => {
- handleResize();
- }, [props.link]);
-
- const getEmptyProperties = (hint:string, data: any) => {
- const entries = Object.entries(data);
- const emptyProperties: string[] = entries.filter(propery => propery[1] === null || propery[1] === undefined).map(properties => hint + properties[0]);
- return emptyProperties;
- };
-
- const checkLOSMandatoryParameters = (checkObject: { siteA: MandatoryParametersLOS; siteB: MandatoryParametersLOS }) => {
-
- const emptyA = getEmptyProperties('SiteA:', checkObject.siteA);
- const emptyB = getEmptyProperties('SiteB:', checkObject.siteB);
- const emptyValues = [...new Set([...emptyA, ...emptyB])];
- return emptyValues;
- };
-
- const handleCalculateLinkClick = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
- e.preventDefault();
-
- const linkId = props.link.id;
- const baseUrl = window.location.pathname.split('#')[0];
- window.open(`${baseUrl}#/microwave/calculateLink/?linkId=${linkId}`);
- };
-
- const handleLineOfSightClick = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
- e.preventDefault();
-
- const siteA = props.link.siteA;
- const siteB = props.link.siteB;
-
- const checkObject = {
- siteA: { lat: siteA.lat, lon: siteA.lon, amsl: siteA.amsl, antennaHeight: siteA.antenna?.height },
- siteB: { lat: siteB.lat, lon: siteB.lon, amsl: siteB.amsl, antennaHeight: siteB.antenna?.height },
- };
-
- var emptyValues = checkLOSMandatoryParameters(checkObject);
-
- if (emptyValues.length === 0) {
-
- let heightPart = `&amslA=${siteA.amsl}&antennaHeightA=${siteA.antenna.height}&amslB=${siteB.amsl}&antennaHeightB=${siteB.antenna.height}`;
- const baseUrl = window.location.pathname.split('#')[0];
- window.open(`${baseUrl}#/microwave/lineofsightMap/los?lat1=${siteA.lat}&lon1=${siteA.lon}&lat2=${siteB.lat}&lon2=${siteB.lon}${heightPart}`);
- } else {
- showErrorMessage('Line of Sight App cannot be opened. Data is missing: ' + emptyValues);
- }
- };
-
- const amslAvailable = props.link.siteA.amsl && props.link.siteB.amsl;
-
- const data = [
- { name: 'Site Id', val1: props.link.siteA.siteId, val2: props.link.siteB.siteId },
- { name: 'Site Name', val1: props.link.siteA.siteName, val2: props.link.siteB.siteName },
- { name: 'Latitude', val1: LatLonToDMS(props.link.siteA.lat), val2: LatLonToDMS(props.link.siteB.lat) },
- { name: 'Longitude', val1: LatLonToDMS(props.link.siteA.lon, true), val2: LatLonToDMS(props.link.siteB.lon, true) },
- props.link?.feature?.properties?.subType == 'microwave' && amslAvailable !== null && { name: 'Amsl in m', val1: props.link.siteA.amsl, val2: props.link.siteB.amsl },
- props.link?.feature?.properties?.subType == 'microwave' && amslAvailable !== null && props.link.siteA.antenna !== null && { name: 'Antenna height in m', val1: props.link.siteA.antenna.height, val2: props.link.siteB.antenna.height },
- props.link.siteA.azimuth != null && props.link.siteB.azimuth != null && { name: 'Azimuth in °', val1: props.link.siteA.azimuth.toFixed(2), val2: props.link.siteB.azimuth.toFixed(2) },
- ];
-
- return (<div style={{ paddingLeft: '15px', paddingRight: '15px', paddingTop: '0px', display: 'flex', flexDirection: 'column' }}>
-
- <Typography style={{ marginTop: 35, marginBottom: 15 }} variant="h5" fontWeight={'bold'} aria-label="link-id">{props.link.id}</Typography>
- {
- props.link.name !== null ?
- <TextField variant="standard" inputProps={{ 'aria-label': 'name' }} disabled style={{ marginTop: '5px' }} value={props.link.name} label="Name" />
- : null
- }
- <TextField variant="standard" inputProps={{ 'aria-label': 'operator' }} disabled style={{ marginTop: '5px' }} value={props.link.operator.length > 0 ? props.link.operator : 'unknown'} label="Operator" />
- <TextField variant="standard" inputProps={{ 'aria-label': 'type' }} disabled style={{ marginTop: '5px' }} value={props.link?.feature?.properties?.layer} label="Layer" />
- <TextField variant="standard" inputProps={{ 'aria-label': 'distance-in-km' }} disabled style={{ marginTop: '5px' }} value={props.link.length.toFixed(2)} label="Distance in km" />
- {props.link.polarization ? <TextField variant="standard" inputProps={{ 'aria-label': 'polarization' }} disabled style={{ marginTop: '5px' }} value={props.link.polarization} label="Polarization" /> : null}
-
- <AppBar position="static" id="link-site-details" style={{ marginTop: '5px', background: '#f5f7fa' }}>
- <Tabs indicatorColor="secondary" textColor="inherit" value="links" aria-label="link-tabs">
- <Tab label="Site Details" aria-label="details-of-link-sites" value="links" />
- </Tabs>
- </AppBar>
- <DenseTable ariaLabelRow="site-information-table-entry" ariaLabelColumn={['site-name', 'latitude', 'longitude', 'azimuth']} verticalTable height={height} hover={false} headers={['', 'Site A', 'Site B']} data={data} />
- {
- props.link?.feature?.properties?.subType === 'microwave' && <>
- <Button style={{ marginTop: 20 }} aria-label="open-link-calculator-button" fullWidth variant="contained" color="primary" onClick={handleCalculateLinkClick}>Calculate link</Button>
- <Button style={{ marginTop: 20 }} aria-label="open-line-of-sight-app-button" fullWidth variant="contained" color="primary" onClick={handleLineOfSightClick}>Line of Sight</Button>
- </>
- }
- </div>);
-};
-
-export default LinkDetails;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React from 'react';
-
-import Typography from '@mui/material/Typography/Typography';
-import TextField from '@mui/material/TextField/TextField';
-
-import { Service } from '../../model/topologyTypes';
-
-type ServiceDetailsProps = { service: Service };
-
-const ServiceDetails: React.FC<ServiceDetailsProps> = (props) => {
-
- return (
- <div style={{ paddingLeft: '15px', paddingRight: '15px', paddingTop: '0px', display: 'flex', flexDirection: 'column' }}>
- <Typography style={{ marginTop: 35, marginBottom: 15 }} variant="h5" fontWeight={'bold'} aria-label="service-id">{props.service.id}</Typography>
- <TextField variant="standard" inputProps={{ 'aria-label': 'name' }} disabled style={{ marginTop: '5px' }} value={props.service.name} label="Name" />
- <TextField variant="standard" inputProps={{ 'aria-label': 'type' }} disabled style={{ marginTop: '5px' }} value={props.service?.feature?.properties.layer} label="Layer" />
- <TextField variant="standard" inputProps={{ 'aria-label': 'distance-in-km' }} disabled style={{ marginTop: '5px' }} value={props.service.length?.toFixed(2)} label="Distance in km" />
- {
- props.service.backupForServiceId &&
- <TextField variant="standard" inputProps={{ 'aria-label': 'backup-for-service-id' }} disabled style={{ marginTop: '5px' }} value={props.service.backupForServiceId} label="Backup for service (id)" />
- }
- <TextField variant="standard" inputProps={{ 'aria-label': 'created' }} disabled style={{ marginTop: '5px' }} value={props.service.created} label="Created" />
- <TextField variant="standard" inputProps={{ 'aria-label': 'modified' }} disabled style={{ marginTop: '5px' }} value={props.service.modified} label="Modified" />
- <TextField variant="standard" inputProps={{ 'aria-label': 'lifecycle-state' }} disabled style={{ marginTop: '5px' }} value={props.service.lifecycleState.toLowerCase()} label="Lifecyle State" />
- <TextField variant="standard" inputProps={{ 'aria-label': 'operational-state' }} disabled style={{ marginTop: '5px' }} value={props.service.operationalState.toLowerCase()} label="Operational State" />
- <TextField variant="standard" inputProps={{ 'aria-label': 'admin-state' }} disabled style={{ marginTop: '5px' }} value={props.service.administrativeState.toLowerCase()} label="Administrative State" />
- </div>);
-};
-
-export default ServiceDetails;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React from 'react';
-
-import LanOutlinedIcon from '@mui/icons-material/LanOutlined';
-import { AppBar, Button, IconButton, Tab, Tabs, TextField, Typography } from '@mui/material';
-
-import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect';
-import { NavigateToApplication } from '../../../../../framework/src/actions/navigationActions';
-import { requestRest } from '../../../../../framework/src/services/restService';
-
-import { CheckDeviceList, InitializeLoadedDevicesAction } from '../../actions/detailsAction';
-import { Address, Device, Site } from '../../model/topologyTypes';
-import StadokSite from '../../model/stadokSite';
-import { LatLonToDMS } from '../../utils/mapUtils';
-
-import DenseTable from '../denseTable';
-import StadokDetailsPopup from '../stadok/stadokDetailsPopup';
-
-const buildAddress = (address: Address) => {
- switch (address.country) {
- case 'de':
- return `${address.streetAndNr}, ${address.zipCode !== null ? address.zipCode : ''} ${address.city}`;
-
- case 'us':
- return `${address.streetAndNr}, ${address.city} ${address.zipCode !== null ? address.zipCode : ''}`;
-
- default:
- console.log('address formatting for country {' + address.country + '} not recognized, defaulting.');
- return `${address.streetAndNr}, ${address.zipCode !== null ? address.zipCode : ''} ${address.city}`;
- }
-};
-
-type PanelId = 'links' | 'nodes';
-type LinkRow = { name: string; azimuth?: string };
-type DeviceRow = { id: string; type: string; name: string; manufacturer: string; owner: string; status?: string; port: number[] };
-
-type SiteDetailProps = {
- site: Site;
- onLinkClick(id: string): void;
-};
-
-const SiteDetails: React.FC<SiteDetailProps> = (props) => {
-
- const updatedDevices = useSelectApplicationState(state => state.network.details.checkedDevices);
- const isSitedocReachable = useSelectApplicationState(state => state.network.details.isSitedocReachable);
-
- const dispatch = useApplicationDispatch();
- const initializeDevices = (devices: Device[]) => dispatch(new InitializeLoadedDevicesAction(devices));
- const loadDevices = async (networkElements: Device[]) => dispatch(CheckDeviceList(networkElements));
- const navigateToApplication = (applicationName: string, path?: string) => dispatch(new NavigateToApplication(applicationName, path, ''));
-
- const [value, setValue] = React.useState<PanelId>('links');
- const [height, setHeight] = React.useState(330);
- const [openPopup, setOpenPopup] = React.useState(false);
- const [staSite, setStaSite] = React.useState<StadokSite | null>(null);
-
- const hasFurtherInfo = props.site.furtherInformation !== null && props.site.furtherInformation.length > 0;
-
- const handleResize = () => {
- //table currently likes to overflow the available area -> force set a height to the container
- const el = document.getElementById('site-details-panel')?.getBoundingClientRect();
- const el2 = document.getElementById('site-tabs')?.getBoundingClientRect();
-
- if (el && el2) {
- if (!hasFurtherInfo) {
- setHeight(el!.height - el2!.y - 10);
- } else {
- setHeight(el!.height - el2!.y - 65);
- }
- }
- };
-
- //on mount
- React.useEffect(() => {
- handleResize();
- window.addEventListener('resize', () => { handleResize(); });
-
- return () => {
- window.removeEventListener('resize', () => { handleResize(); });
- };
- }, []);
-
- // on update
- React.useEffect(() => {
-
- if (props.site.devices !== null && props.site.devices.length > 0) {
-
- //TODO: why two?
- initializeDevices(props.site.devices);
- loadDevices(props.site.devices);
- }
- handleResize();
-
- }, [props.site]);
-
- const onHandleTabChange = (event: React.SyntheticEvent, newValue: PanelId) => {
- setValue(newValue);
- };
-
- const getFurtherInformation = (url: string) => {
-
- const request = requestRest<StadokSite>(url, { method: 'GET' });
- request.then(result => {
- if (result) {
- setStaSite(result);
- setOpenPopup(true);
- } else {
- console.error(result);
- }
- });
- };
-
- const closePopup = () => {
- setOpenPopup(false);
- };
-
- //prepare link table
-
- let hasAzimuth = false;
- const linkRows: LinkRow[] = props.site.links?.map(link => {
- if (link.azimuth !== null) {
- hasAzimuth = true;
- return { name: link.name, azimuth: link.azimuth.toFixed(2) };
- } else {
- return { name: link.name ? link.name : link.id.toString() };
- }
- });
-
- const linkTableHeader = hasAzimuth ? ['Link Name', 'Azimuth in °'] : ['Link Name'];
-
- //prepare device table
- const deviceRows: DeviceRow[] = updatedDevices?.map(device => {
- return {
- id: device.id,
- name: device.name,
- type: device.type ? device.type : 'unknown',
- status: (device.status?.length == 0 || device.status === undefined || device.status === null) ? 'Not Connected' : device.status,
- manufacturer: device.manufacturer,
- owner: device.owner,
- port: device.port,
- };
- });
-
- const addressString = props.site.address == null ? null : buildAddress(props.site.address);
-
- return (<div style={{ padding: '15px', display: 'flex', flexDirection: 'column', paddingTop: '0px', minWidth: 0, minHeight: 0 }}>
-
- <Typography style={{ marginTop: 35, marginBottom: 15 }} variant="h5" fontWeight={'bold'} aria-label="site-id">{props.site.id}</Typography>
- <div style={{ position: 'absolute', marginLeft: '100px', marginTop: '30px', right: '20', display: 'flex', zIndex: 1 }} >
- <IconButton aria-label={'site-manager-treeview-button'}
- onClick={() => {
- const baseUrl = window.location.pathname.split('#')[0];
- const siteId = props.site.id + '';
- const url = `${baseUrl}#/siteManager/treeview/${siteId}`;
- window.open(url);
- }}>
- <LanOutlinedIcon />
- </IconButton>
- </div>
- <TextField variant="standard" inputProps={{ 'aria-label': 'name' }} disabled={true} value={props.site.name !== null ? props.site.name : ' '} label="Name" />
- {
- props.site.operator !== '' && props.site.operator !== null ?
- <TextField variant="standard" inputProps={{ 'aria-label': 'operator' }} disabled={true} value={props.site.operator} label="Operator" /> :
- <TextField variant="standard" inputProps={{ 'aria-label': 'operator' }} disabled={true} value="Unknown" label="Operator" style={{ marginTop: '5px' }} />
- }
- {
- props.site?.feature?.properties?.layer !== undefined && props.site?.feature?.properties?.layer.length > 0 &&
- <TextField variant="standard" inputProps={{ 'aria-label': 'layer' }} disabled={true} value={props.site?.feature?.properties?.layer} label="Layer" style={{ marginTop: '5px' }} />
- }
- {
- addressString !== null &&
- <TextField variant="standard" inputProps={{ 'aria-label': 'address' }} disabled={true} value={addressString} label="Address" style={{ marginTop: '5px' }} />
- }
- {
- props.site.heightAmslInMeters !== undefined && props.site.heightAmslInMeters > 0 &&
- <TextField variant="standard" inputProps={{ 'aria-label': 'amsl-in-meters' }} disabled={true} value={props.site.heightAmslInMeters} label="AMSL in meters" style={{ marginTop: '5px' }} />
- }
- {
- props.site.antennaHeightAmslInMeters !== undefined && props.site.antennaHeightAmslInMeters > 0 &&
- <TextField variant="standard" inputProps={{ 'aria-label': 'antenna-above-ground-in-meters' }} disabled={true} value={props.site.antennaHeightAmslInMeters} label="Antenna above ground in meters" style={{ marginTop: '5px' }} />
- }
- <TextField variant="standard" inputProps={{ 'aria-label': 'latitude' }} style={{ marginTop: '5px' }} disabled={true} value={LatLonToDMS(props.site.location.lat)} label="Latitude" />
- <TextField variant="standard" inputProps={{ 'aria-label': 'longitude' }} style={{ marginTop: '5px' }} disabled={true} value={LatLonToDMS(props.site.location.lon, true)} label="Longitude" />
- <AppBar enableColorOnDark position="static" style={{ marginTop: '5px', background: '#f5f7fa' }}>
- <Tabs indicatorColor="secondary" textColor="inherit" id="site-tabs" value={value} onChange={onHandleTabChange} aria-label="tabs">
- <Tab label="Links" aria-label="site-links" value="links" />
- <Tab label="Nodes" aria-label="site-nodes" value="nodes" />
- </Tabs>
- </AppBar>
- {
- value === 'links' &&
- <>
- {
- props.site.links == null &&
- <Typography aria-label="no-links-available" variant="body1" style={{ marginTop: '10px' }}>No links available.</Typography>
- }
- {
- props.site.links?.length > 0 &&
- <DenseTable ariaLabelRow="available-links-table" ariaLabelColumn={['link-name', 'azimuth']} height={height} hover={true} headers={linkTableHeader} data={linkRows} onClick={props.onLinkClick} ></DenseTable>
- }
- </>
- }
- {
- value === 'nodes' &&
- <>
- {
- props.site.devices === null &&
- <Typography aria-label="no-nodes-avilable" variant="body1" style={{ marginTop: '10px' }}>No nodes available.</Typography>
- }
- {
- props.site.devices?.length > 0 && updatedDevices !== null &&
- <DenseTable
- ariaLabelRow="available-nodes-table"
- ariaLabelColumn={['id', 'name', 'type', 'status', 'manufacturer', 'owner', 'ports', 'actions']}
- navigate={navigateToApplication}
- height={height}
- hover={false}
- headers={['ID', 'Name', 'Type', 'Status', 'Manufacturer', 'Owner', 'Ports', 'Actions']}
- actions={true} data={deviceRows!} />
- }
- </>
- }
- {
- isSitedocReachable &&
- <>
- {
- hasFurtherInfo &&
- <Button style={{ marginTop: 20 }} aria-label="further-information-button" fullWidth variant="contained" color="primary" onClick={() => getFurtherInformation(props.site.furtherInformation)}>Further information available</Button>
- }
- </>
- }
- {
- staSite !== null && openPopup && <StadokDetailsPopup site={staSite} siteId={props.site.id} onClose={closePopup} />
- }
- </div>
- );
-};
-
-
-
-export default SiteDetails;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React from 'react';
-import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
-import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-
-import Paper from '@mui/material/Paper';
-import Typography from '@mui/material/Typography';
-import makeStyles from '@mui/styles/makeStyles';
-import Button from '@mui/material/Button';
-
-import { useSelectApplicationState, useApplicationDispatch } from '../../../../../framework/src/flux/connect';
-import { IsTileServerReachableAction, IsTopologyServerReachableAction } from '../../actions/connectivityAction';
-
-const useStyles = makeStyles({
- connectionInfo: {
- padding: 5,
- position: 'absolute',
- top: 160,
- width: 230,
- left: '40%',
- zIndex: 1,
- },
- container: {
- display: 'flex',
- flexDirection: 'column',
- },
- errorIcon:{
- 'alignSelf': 'center',
- marginBottom: 5,
- },
-});
-
-const ConnectionInfo: React.FC = () => {
-
- const dispatch = useApplicationDispatch();
-
- const isTopoServerReachable = useSelectApplicationState(state => state.network.connectivity.isTopologyServerAvailable);
- const isTileServerReachable = useSelectApplicationState(state => state.network.connectivity.isTileServerAvailable);
-
- const handleClose = () => {
- dispatch(new IsTopologyServerReachableAction(true));
- dispatch(new IsTileServerReachableAction(true));
- };
-
- const styles = useStyles();
-
- return ((!isTopoServerReachable || !isTileServerReachable) ?
- <Paper className={styles.connectionInfo}>
- <div aria-label="connection-error-map-not-displayed" className={styles.container}>
- <div className={styles.errorIcon}>
- <Typography> <FontAwesomeIcon icon={faExclamationTriangle} /> Connection Error</Typography>
- </div>
- {
- !isTileServerReachable
- ? <Typography variant="body1" aria-label="tiles-unavailable"> Tile data can't be loaded.</Typography>
- : null
- }
- {
- !isTopoServerReachable
- ? < Typography variant="body1" aria-label="network-data-unavailable"> Network data can't be loaded.</Typography>
- : null
- }
- <Button variant="contained" color="primary" aria-label="reload-map" onClick={handleClose}>Close</Button>
- </div>
- </Paper> : null
- );
-};
-
-ConnectionInfo.displayName = 'ConnectionInfo';
-
-export { ConnectionInfo };
\ No newline at end of file
+++ /dev/null
-import React, { FC, useEffect, useState } from 'react';
-import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect';
-
-import FilterIcon from '@mui/icons-material/FilterList';
-import makeStyles from '@mui/styles/makeStyles';
-
-import { SetFilterValueAction } from '../../actions/filterActions';
-import Paper from '@mui/material/Paper';
-import InputBase from '@mui/material/InputBase';
-import Divider from '@mui/material/Divider';
-import IconButton from '@mui/material/IconButton';
-
-const useStyles = makeStyles({
- filterBar: {
- padding: '2px 4px',
- position: 'absolute',
- display: 'flex',
- alignItems: 'center',
- top: 70,
- marginLeft: 5,
- width: 400,
- zIndex: 1,
- },
- input: {
- flex: 1,
- marginLeft: 5,
- },
- iconButton: {
- padding: 10,
- },
- divider: {
- height: 28,
- margin: 4,
- },
-});
-
-const FilterBar: FC = () => {
-
- const filterValue = useSelectApplicationState(state => state.network.filter.value);
-
- const dispatch = useApplicationDispatch();
- const onFilterChange = (value: string) => dispatch(new SetFilterValueAction(value));
-
- const [filterText, setFilterText] = useState(filterValue);
-
- useEffect(() => {
- setFilterText(filterValue);
- }, [filterValue]);
-
- const handleFilterApply = () => {
- onFilterChange(filterText);
- };
-
- const styles = useStyles();
-
- return (
- <Paper component="form" className={styles.filterBar}>
- <InputBase
- className={styles.input}
- placeholder="Enter filter term"
- inputProps={{ 'aria-label': 'networkmap-filterbar' }}
- value={filterText}
- onChange={e => setFilterText(e.target.value)}
- onKeyPress={(e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- e.stopPropagation();
- handleFilterApply();
- }
- }}
- readOnly={false}
- />
- <Divider className={styles.divider} orientation="vertical" />
- <IconButton
- type="button"
- className={styles.iconButton}
- aria-label="apply-button"
- onClick={handleFilterApply}
- size="large">
- <FilterIcon />
- </IconButton>
- </Paper>
- );
-};
-
-FilterBar.displayName = 'FilterBar';
-
-export { FilterBar };
+++ /dev/null
-/**
- * ============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 React, { useEffect } from 'react';
-import { FormControlLabel, Switch } from '@mui/material';
-
-import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect';
-
-import { SetIconSwitchAction } from '../../actions/mapActions';
-import { updateSettings } from '../../actions/settingsAction';
-import { NetworkMapSettings } from '../../model/settings';
-
-type IconSwitchProps = { visible: boolean };
-
-const IconSwitch: React.FC<IconSwitchProps> = (props) =>{
-
- const areIconsEnabled = useSelectApplicationState(state => state.network.map.allowIconSwitch);
- const settings = useSelectApplicationState(state => state.network.settings.mapSettings);
-
- const dispatch = useApplicationDispatch();
- const toggle = (enable:boolean) => dispatch(new SetIconSwitchAction(enable));
- const updateUserSettings = (mapSettings: NetworkMapSettings) => dispatch(updateSettings(mapSettings));
-
- //??? TODO: look into please
- //use ref to be available within map events
- const iconsEnabledRef = React.useRef(areIconsEnabled);
-
- const setIconsEnabled = (data: boolean) => {
- iconsEnabledRef.current = data;
- };
-
- const handleToggleChanged = () => {
- setIconsEnabled(!areIconsEnabled);
- toggle(!areIconsEnabled);
- };
-
- const handleDefaultValue = () => {
- const settingsIconsEnabled = settings?.areIconsEnabled;
- if (settingsIconsEnabled !== undefined) {
- setIconsEnabled(settingsIconsEnabled);
- toggle(settingsIconsEnabled);
- }
- };
-
- const saveSettings = (data: any) => {
- data.areIconsEnabled = iconsEnabledRef.current;
- updateUserSettings(data);
- };
-
- const saveChanges = () => {
- if (settings === null) {
- saveSettings({ networkMap:{} });
- } else if (settings && iconsEnabledRef.current !== settings.areIconsEnabled) {
- saveSettings(settings);
- }
- };
-
- window.onbeforeunload = () => { //called right before browser refreshes or some such
- saveChanges();
- };
-
- useEffect(()=>{
-
- handleDefaultValue();
- return () => { // executed on unmount
- saveChanges();
- };
- }, []);
-
- useEffect(()=>{
- handleDefaultValue();
- }, [settings?.areIconsEnabled]);
-
- return (
- props.visible ?
- <FormControlLabel style={{ padding: 5, position: 'absolute', top: 210, zIndex: 1 }}
- value="end"
- control={<Switch color="secondary" style={{ zIndex: 1 }} checked={areIconsEnabled} onChange={handleToggleChanged} />}
- label="Show icons"
- labelPlacement="end"
- /> : null);
-};
-
-IconSwitch.displayName = 'IconSwitch';
-
-export { IconSwitch } ;
\ No newline at end of file
+++ /dev/null
-/**
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt odlux
- * =================================================================================================
- * Copyright (C) 2022 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 React, { FC } from 'react';
-
-import Accordion from '@mui/material/Accordion';
-import AccordionSummary from '@mui/material/AccordionSummary';
-import AccordionDetails from '@mui/material/AccordionDetails';
-import Checkbox from '@mui/material/Checkbox';
-import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
-import FormGroup from '@mui/material/FormGroup';
-import FormControlLabel from '@mui/material/FormControlLabel';
-import Typography from '@mui/material/Typography';
-import makeStyles from '@mui/styles/makeStyles';
-
-import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect';
-
-import { loadLayers, OpenLayersAction, updateLayerAsyncAction } from '../../actions/mapActions';
-
-const useStyles = makeStyles({
- mapLayer: {
- position: 'absolute',
- display: 'flex',
- flexDirection: 'column',
- top: 323,
- width: 200,
- marginLeft: 5,
- zIndex: 1,
- },
- title:{
- fontWeight: 'bold',
- },
-});
-
-const MapLayer : FC = () => {
-
- const elements = useSelectApplicationState(state => state.network.map.layersContainer.elements);
- const isOpen = useSelectApplicationState(state => state.network.map.layersContainer.isOpen);
- const areFurtherLayersAvailable = useSelectApplicationState(state => state.network.map.layersContainer.areFurtherLayersAvailable);
-
- const dispatch = useApplicationDispatch();
- const updateLayer = (name: string, displayed: boolean) => dispatch(updateLayerAsyncAction(name, displayed, true));
- const loadMapLayers = () => dispatch(loadLayers());
- const open = (newOpenState: boolean) => dispatch(new OpenLayersAction(newOpenState));
-
- React.useEffect(() => {
- loadMapLayers();
- }, []);
-
- const classes = useStyles();
- return (
- <Accordion expanded={isOpen} onChange={() => open(!isOpen)} className={classes.mapLayer}>
- <AccordionSummary
- expandIcon={<ExpandMoreIcon />}
- aria-label="map-layer-accordion">
- <Typography className={classes.title} variant="body1">Layers</Typography>
- </AccordionSummary>
- <AccordionDetails aria-label="layer-accordion-details" style={{ 'marginTop': -15 }}>
- <FormGroup>
- {
- elements.map((el, i) => el.base
- ? <FormControlLabel
- aria-label={'layer-' + (i + 1)}
- key={i}
- control={
- <Checkbox
- color='secondary'
- checked={el.displayed}
- onChange={(e) => { updateLayer(el.name, e.target.checked); }}
- />
- }
- label={el.name}
- />
- : null,
- )
- }
- </FormGroup>
- {
- areFurtherLayersAvailable
- ? ( <>
- <Typography className={classes.title} variant="body1">Further Layers</Typography>
- <FormGroup>
- {
- elements.map((el, i) => !el.base
- ? <FormControlLabel
- aria-label={'layer-' + (i + 1)}
- key={i}
- control={
- <Checkbox color='secondary'
- checked={el.displayed}
- onChange={(e) => { updateLayer(el.name, e.target.checked); }}
- />
- }
- label={el.name}
- />
- : null,
- )
- }
- </FormGroup>
- </>)
- : null
- }
- </AccordionDetails>
- </Accordion>);
-};
-
-MapLayer.displayName = 'MapLayer';
-
-export default MapLayer;
+++ /dev/null
-/**
- * ============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 React, { FC, memo, useCallback, useEffect, useRef, useState } from 'react';
-import makeStyles from '@mui/styles/makeStyles';
-
-import maplibregl from 'maplibre-gl';
-import 'maplibre-gl/dist/maplibre-gl.css';
-
-import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect';
-import { handleConnectionChange, IsBusyCheckingConnectivityAction, setTileServerReachableAction, setTopologyServerReachableAction } from '../../actions/connectivityAction';
-import { LoadNetworkElementDetails } from '../../actions/detailsAction';
-import { loadLayers, SetCoordinatesAction, updateStatistics, ZoomToFinishedAction } from '../../actions/mapActions';
-import { OSM_STYLE, URL_API } from '../../config';
-import { BoundingBox } from '../../model/boundingBox';
-import { Coordinate, MapCoordinate } from '../../model/coordinates';
-import { Feature } from '../../model/topologyTypes';
-import { dataService } from '../../services/dataService';
-import { addImages } from '../../services/mapImagesService';
-import mapLayerService from '../../utils/mapLayers';
-import { getUniqueFeatures, increaseBoundingBox } from '../../utils/mapUtils';
-import { ConnectionInfo } from './connectionInfo';
-import { FilterBar } from './filterBar';
-import MapLayer from './layerSelection';
-import MapControl from './mapControl';
-import MapPopup from './mapPopup';
-import SearchBar from './searchBar';
-import Statistics from './statistics';
-
-const MAX_ZOOM = 18;
-const MIN_ZOOM = 0;
-
-const LogLevel = +(localStorage.getItem('log.odlux.mapComponent') || 0);
-
-const NetworkFilterObserver: FC<{ value: string; onDidUpdate: (val: string) => void }> = ({ value, onDidUpdate }) => {
- useEffect(() => {
- onDidUpdate(value);
- }, [value]);
- return null;
-};
-
-type MapSelectionPopup = {
- isOpen: boolean;
- elements: Feature[];
- type: string;
- position: {
- left: number;
- top: number;
- };
-} | null;
-
-let map: maplibregl.Map;
-let lastBoundingBox: maplibregl.LngLatBounds;
-
-const useStyles = makeStyles({
- map: {
- display: 'flex',
- position: 'relative',
- height: '100%',
- },
-});
-
-type MapContext = {
- furtherLayerNames: string[];
- areLayersLoaded: boolean;
- isLoadingInProgress: boolean;
- enqueuedBoundingBoxes: maplibregl.LngLatBounds[];
- isInitialLoadOfMap: boolean;
-};
-
-const Map: FC = memo(() => {
-
- const mapContext = useRef<MapContext>({
- furtherLayerNames: [],
- enqueuedBoundingBoxes: [],
- areLayersLoaded: false,
- isLoadingInProgress: false,
- isInitialLoadOfMap: false,
- });
-
- const networkFilter = useSelectApplicationState(state => state.network.filter);
- const selectedLink = useSelectApplicationState(state => state.network.map.selectedLink);
- const selectedSite = useSelectApplicationState(state => state.network.map.selectedSite);
- const selectedService = useSelectApplicationState(state => state.network.map.selectedService);
- const zoomToElement = useSelectApplicationState(state => state.network.map.zoomToElement);
-
- const { lat, lon, zoom } = useSelectApplicationState(state => state.network.map.coordinates);
-
- const isTopologyServerReachable = useSelectApplicationState(state => state.network.connectivity.isTopologyServerAvailable);
- const isTileServerReachable = useSelectApplicationState(state => state.network.connectivity.isTileServerAvailable);
- const isConnectivityCheckBusy = useSelectApplicationState(state => state.network.connectivity.isBusy);
- const showIcons = useSelectApplicationState(state => state.network.map.allowIconSwitch);
- const settings = useSelectApplicationState(state => state.network.settings);
- const layers = useSelectApplicationState(state => state.network.map.layersContainer.elements);
-
- const dispatch = useApplicationDispatch();
-
- const updateLayers = () => dispatch(loadLayers());
- const loadSelectedElement = (type: string, id: string) => dispatch(LoadNetworkElementDetails(type, id));
- const updateMapPosition = (pLat: string, pLon: string, pZoom: string) => dispatch(new SetCoordinatesAction(pLat, pLon, pZoom));
- const updateMapStatistics = (boundingBox: BoundingBox) => dispatch(updateStatistics(boundingBox));
- const setTileServerLoaded = (reachable: boolean) => dispatch(setTileServerReachableAction(reachable));
- const setTopologyServerLoaded = (reachable: boolean) => dispatch(setTopologyServerReachableAction(reachable));
- const connectionChanged = (newState: boolean) => dispatch(handleConnectionChange(newState));
- const setConnectivityCheck = (done: boolean) => dispatch(new IsBusyCheckingConnectivityAction(done));
- const zoomFinished = () => dispatch(new ZoomToFinishedAction());
-
- const mapContainerRef = React.useRef<HTMLDivElement>(null);
- const mapRef = React.useRef<maplibregl.Map>();
-
- const [bearing, setBearing] = useState(0);
- const [popup, setPopup] = useState<MapSelectionPopup>(null);
-
- const updateTheme = () => {
- mapLayerService.availableThemes = settings.themes;
- if (settings.mapSettings?.styling?.theme) {
- mapLayerService.selectedTheme = settings.mapSettings?.styling.theme;
- }
- };
-
- const updateOpacity = () => {
- if (settings.mapSettings && settings.mapSettings.tileOpacity) {
- mapLayerService.changeMapOpacity(map, Number(settings.mapSettings.tileOpacity));
- }
- };
-
- const loadGeoJsonAndAddToMapLayer = async (layer: string, url: string) => {
-
- //No actions used because the geojson data is only used and needed for the map
- //maybe move out into another map service
-
- const response = await dataService.getGeojsonData(url);
-
- if (response.status === 404 || response.status === 400) {
- return true;
- }
- if (response.status !== 200) {
- return false;
- }
- if (map.getSource(layer)) {
- (map.getSource(layer) as maplibregl.GeoJSONSource).setData(response.data);
- }
- return true;
-
- };
-
- /***
- * Load bounding box data and add it to the map
- */
- const loadBBoxDataAndAddToMap = useCallback(async (startLat: number, startLon: number, endLat: number, endLon: number) => {
-
- if (LogLevel > 3) {
- console.log(`MapComponent::loadBBoxDataAndAddToMap - lat: ${startLat}, lon: ${startLon}, lat2: ${endLat}, lon2: ${endLon}, networkFilter: ${networkFilter.value}`);
- }
-
- const servicesLoaded = loadGeoJsonAndAddToMapLayer('services', `${URL_API}/services/geojson/${startLat},${startLon},${endLat},${endLon}?filter=${encodeURIComponent(networkFilter.value)}`);
- const linksLoaded = loadGeoJsonAndAddToMapLayer('lines', `${URL_API}/links/geojson/${startLat},${startLon},${endLat},${endLon}?filter=${encodeURIComponent(networkFilter.value)}`);
- const sitesLoaded = loadGeoJsonAndAddToMapLayer('points', `${URL_API}/sites/geojson/${startLat},${startLon},${endLat},${endLon}?filter=${encodeURIComponent(networkFilter.value)}`);
-
- const results = await Promise.all([servicesLoaded, linksLoaded, sitesLoaded]);
-
- mapContext.current.isLoadingInProgress = false;
-
- const areGeojsonEndpointsReachable = (results[0] && results[1] && results[2]);
-
- if (isTopologyServerReachable !== areGeojsonEndpointsReachable) {
- connectionChanged(areGeojsonEndpointsReachable);
- }
-
- if (LogLevel > 3) {
- console.log(`MapComponent::loadBBoxDataAndAddToMap - loaded data for bbox: ${startLat},${startLon},${endLat},${endLon}`, results);
- }
-
- return results;
- }, [networkFilter.value]);
-
- const loadMapData = async (bbox: maplibregl.LngLatBounds, force = false) => {
-
- // Todo: (if we get the time) maybe split bounding box into smaller parts to increase loading speed
- // currently the entire bbox gets loaded (-> potentially huge load)
-
- if (LogLevel > 3) {
- console.log(`MapComponent::loadMapData - bbox: ${bbox.getNorth()}, ${bbox.getWest()}, ${bbox.getSouth()}, ${bbox.getEast()} : isLoadingInProgress: ${mapContext.current.isLoadingInProgress}`);
- }
-
- try {
- if (mapContext.current.isInitialLoadOfMap) {
- mapContext.current.isInitialLoadOfMap = false;
-
- await loadBBoxDataAndAddToMap(lastBoundingBox.getWest(), lastBoundingBox.getSouth(), lastBoundingBox.getEast(), lastBoundingBox.getNorth());
- } else {
- if (!mapContext.current.isLoadingInProgress) { // only load data if loading not in progress
- mapContext.current.isLoadingInProgress = true;
-
- // new bbox is bigger than old one
- if (bbox.contains(lastBoundingBox.getNorthEast()) && bbox.contains(lastBoundingBox.getSouthWest()) && lastBoundingBox !== bbox) { //if new bb is bigger than old one
-
- //calculate new boundingBox
- const increasedBoundingBox = increaseBoundingBox(map);
- lastBoundingBox = bbox;
- await loadBBoxDataAndAddToMap(increasedBoundingBox.west, increasedBoundingBox.south, increasedBoundingBox.east, increasedBoundingBox.north);
-
- } else if (!force && lastBoundingBox.contains(bbox.getNorthEast()) && lastBoundingBox.contains(bbox.getSouthWest())) { // last one contains new one
- // bbox is contained in last one, do nothing
- mapContext.current.isLoadingInProgress = false;
-
- } else { // bbox is not fully contained in old one, extend
-
- lastBoundingBox.extend(bbox);
- await loadBBoxDataAndAddToMap(lastBoundingBox.getWest(), lastBoundingBox.getSouth(), lastBoundingBox.getEast(), lastBoundingBox.getNorth());
- }
-
- mapContext.current.isLoadingInProgress = false;
-
- if (mapContext.current.enqueuedBoundingBoxes.length > 0) { // load last not loaded bounding box
- loadMapData(mapContext.current.enqueuedBoundingBoxes.pop()!);
- mapContext.current.enqueuedBoundingBoxes = [];
- }
- } else {
- mapContext.current.enqueuedBoundingBoxes.push(bbox);
- }
- }
- } catch (e) {
- mapContext.current.isLoadingInProgress = false;
- }
- };
-
- const isLayerVisible = (layer: string) => {
- const layerEl = layers.find(el => el.name === layer);
- return layerEl ? layerEl.displayed : false;
- };
-
- const changeSizeOfPoints = (newSize: number, displaySelectedPoints: boolean, overrideCircleStyle?: true) => {
- if (map.getLayer('points') && isLayerVisible('Sites')) {
- map.setPaintProperty('points', 'circle-radius', overrideCircleStyle ? newSize : [ 'match', ['get', 'xPonder'], 'true', 9, 7 ]);
- }
- };
-
- const changeSizeOfLines = (newSize: number) => {
- map.setPaintProperty('fibre-lines', 'line-width', newSize);
- map.setPaintProperty('microwave-lines', 'line-width', newSize);
- };
-
- const reduceSizeOfFeatures = () => {
- changeSizeOfPoints(2, false, true);
- if (map.getZoom() <= 4) {
- changeSizeOfLines(1);
- } else {
- changeSizeOfLines(2);
- }
- };
-
- const adjustPointStyle = (mapZoom: number) => {
- if (mapZoom > 11) {
- changeSizeOfPoints(7, true);
- } else if (mapZoom > 10) {
- changeSizeOfPoints(5, true);
- } else if (mapZoom > 9) {
- changeSizeOfPoints(3, true);
- } else {
- reduceSizeOfFeatures();
- }
- };
-
- /***
- * Show selection popup if multiple map elements (sites / links / ...) were clicked
- */
- const showSelectionPopup = (features: maplibregl.MapGeoJSONFeature[], type: 'site' | 'link', top: number, left: number) => {
- const elements: Feature[] = features.map(feature => {
- return {
- properties: feature.properties as any,
- geometry: feature.geometry as any,
- type: feature.type,
- };
- });
-
- setPopup({ isOpen: true, elements: elements, type: type, position: { left: left, top: top } });
- };
-
- const loadDetails = (feature: maplibregl.MapGeoJSONFeature[], type: 'site' | 'link', top: number, left: number) => {
- if (feature.length > 1) {
- showSelectionPopup(feature, type, top, left);
- } else {
- // load details data
- const id = feature[0].properties!.id;
- const typeOfFeature = feature[0].properties?.layer || 'site';
- loadSelectedElement(typeOfFeature, id);
- }
- };
-
- const handleResize = () => {
- if (map) {
- // wait a moment until resizing actually happened
- window.setTimeout(() => map.resize(), 500);
- }
- };
-
- const handleMapMove = () => {
- const mapZoom = map.getZoom();
- const boundingBox = map.getBounds();
- loadMapData(boundingBox);
- adjustPointStyle(mapZoom);
- };
-
- const handleMapClick = (e: any) => {
- const linkLayerNames = mapContext.current.furtherLayerNames.map(layer => layer + '-links');
- const serviceLayerNames = mapContext.current.furtherLayerNames.map(layer => layer + '-services');
-
- if (!map.getLayer('point-lamps')) { // data is shown as points
-
- const clickedLines = getUniqueFeatures(map.queryRenderedFeatures([[e.point.x - 5, e.point.y - 5],
- [e.point.x + 5, e.point.y + 5]], {
- layers: ['microwave-lines', 'fibre-lines', 'services', 'backup-services', ...linkLayerNames, ...serviceLayerNames],
- }), 'id');
-
- const clickedSites = getUniqueFeatures(map.queryRenderedFeatures([[e.point.x - 5, e.point.y - 5],
- [e.point.x + 5, e.point.y + 5]], {
- layers: ['points', ...mapContext.current.furtherLayerNames],
- }), 'id');
-
- if (clickedSites.length != 0) {
-
- loadDetails(clickedSites, 'site', e.point.x, e.point.y);
- } else if (clickedLines.length != 0) {
- loadDetails(clickedLines, 'link', e.point.x, e.point.y);
- }
-
- } else { // data is shown as icons
-
- const clickedSites = getUniqueFeatures(map.queryRenderedFeatures(e.point, { layers: ['point-lamps', 'point-building', 'point-data-center', 'point-factory', 'points', ...mapContext.current.furtherLayerNames] }), 'id');
- const clickedLines = getUniqueFeatures(map.queryRenderedFeatures([[e.point.x - 5, e.point.y - 5],
- [e.point.x + 5, e.point.y + 5]], {
- layers: ['microwave-lines', 'fibre-lines', 'services', 'backup-services', ...linkLayerNames, ...serviceLayerNames ],
- }), 'id');
-
- if (clickedSites.length > 0)
- loadDetails(clickedSites, 'site', e.point.x, e.point.y);
- else if (clickedLines.length != 0) {
- loadDetails(clickedLines, 'link', e.point.x, e.point.y);
- }
- }
- };
-
- const handleMapMoveEnd = () => {
-
- const boundingBox = map.getBounds();
- loadMapData(boundingBox);
-
- const mapZoom = map.getZoom().toFixed(2);
- const mapLat = map.getCenter().lat.toFixed(4);
- const mapLon = map.getCenter().lng.toFixed(4);
-
- if (LogLevel > 3) {
- console.log(`MapComponent::map move end - lat: ${mapLat} lon: ${mapLon} zoom: ${mapZoom}`);
- }
-
- if (lat !== mapLat || lon !== mapLon || zoom !== mapZoom) {
- updateMapPosition(mapLat, mapLon, mapZoom);
- updateMapStatistics(BoundingBox.createFromBoundingBox(map.getBounds()));
- }
-
- //switch icon layers if applicable
- mapLayerService.showIconLayers(map, showIcons);
- };
-
- const getAdditionalLayers = (pMap: maplibregl.Map) => {
-
- layers.forEach((el) => {
-
- if (!pMap.getLayer(el.name) && !el.base) { //base layers skipped ("points", "links", ... are added via addCommonLayers)
-
- mapContext.current.furtherLayerNames.push(el.name);
- }
- });
- };
-
- const isZoomValid = (pZoom: number) => !Number.isNaN(pZoom) && pZoom >= MIN_ZOOM && pZoom <= MAX_ZOOM;
-
- const areCoordinatesValid = (pLat: number, pLon: number) => {
-
- const isLatValid = !Number.isNaN(pLat) && pLat >= -90 && pLat <= 90;
- const isLonValid = !Number.isNaN(pLon) && pLon >= -180 && pLon <= 180;
-
- if (isLatValid && isLonValid) {
- return true;
- } else {
- return false;
- }
- };
-
- /**
- * Moves map to coordinates and zooms in / out
- * @param coordinates lat, lon, zoom
- */
- const moveMapToCoordinates = (pMap: maplibregl.Map, coordinates: MapCoordinate) => {
- if (LogLevel > 3) {
- console.log(`MapComponent::move map to coordinates - lat: ${coordinates.lat}, lon: ${coordinates.lon}, zoom: ${coordinates.zoom}`);
- }
-
- if (areCoordinatesValid(coordinates.lat, coordinates.lon)) {
- let newZoom = -1;
-
- if (isZoomValid(coordinates.zoom)) {
- newZoom = coordinates.zoom;
- }
-
- pMap?.flyTo({
- center: [
- coordinates.lon,
- coordinates.lat,
- ], zoom: newZoom !== -1 ? newZoom : newZoom,
- essential: true,
- });
- }
- };
-
- /**
- *
- * Moves map to include center, start and endpoint of a feature
- *
- * @param center
- * @param start
- * @param end
- */
- const centerMapOnFeature = (pMap: maplibregl.Map, center: Coordinate | null, start?: Coordinate, end?: Coordinate) => {
-
- let newBounds = new maplibregl.LngLatBounds();
- const allValues = { center, start, end };
- Object.values(allValues).forEach(value => {
- if (value) {
- newBounds.extend([value.lon, value.lat]);
- }
- });
-
- //zooms in/out to accommodate bounding box
- pMap?.fitBounds(newBounds, { padding: 20 });
- };
-
- const updateMapBasedOnLayers = (pMap: maplibregl.Map) => {
-
- layers.forEach(el => {
-
- //deactivate / activate layers
-
- if (el.name == 'Links') {
- pMap.setLayoutProperty('fibre-lines', 'visibility', el.displayed ? 'visible' : 'none');
- pMap.setLayoutProperty('microwave-lines', 'visibility', el.displayed ? 'visible' : 'none');
-
- } else if (el.name == 'Sites') {
- pMap.setLayoutProperty('points', 'visibility', el.displayed ? 'visible' : 'none');
-
- if (el.displayed) {
- const mapZoom = pMap.getZoom();
- adjustPointStyle(mapZoom);
- }
- } else if (el.name == 'Services') {
- pMap.setLayoutProperty('services', 'visibility', el.displayed ? 'visible' : 'none');
- } else if (pMap.getLayer(el.name)) {
-
- pMap.setLayoutProperty(el.name, 'visibility', el.displayed ? 'visible' : 'none');
- if (pMap.getLayer(el.name + '-links') && pMap.getLayer(el.name + '-services')) {
-
- pMap.setLayoutProperty(el.name + '-links', 'visibility', el.displayed ? 'visible' : 'none');
- pMap.setLayoutProperty(el.name + '-services', 'visibility', el.displayed ? 'visible' : 'none');
- }
- }
- });
- };
-
- const rearrangeLayers = (pMap: maplibregl.Map) => {
- pMap.moveLayer('services');
- pMap.moveLayer('selectedPoints');
- };
-
- const setupMap = () => {
-
- let initialLat = lat;
- let initialLon = lon;
- let initialZoom = zoom;
- mapContext.current.isInitialLoadOfMap = true;
-
- if (settings.mapSettings?.startupPosition) {
- if (settings.mapSettings.startupPosition.latitude) {
- initialLat = settings.mapSettings.startupPosition.latitude;
- }
-
- if (settings.mapSettings.startupPosition.longitude) {
- initialLon = settings.mapSettings.startupPosition.longitude;
- }
-
- if (settings.mapSettings.startupPosition.zoom) {
- initialZoom = settings.mapSettings.startupPosition.zoom;
- }
- }
-
- map = new maplibregl.Map({
- container: mapContainerRef.current!,
- style: OSM_STYLE as any,
- center: [Number(initialLon), Number(initialLat)],
- zoom: Number(initialZoom),
- });
-
- mapRef.current = map;
-
- map.on('load', () => {
-
- if (LogLevel > 3) {
- console.log('MapComponent::map loaded');
- }
-
- map.setMaxZoom(MAX_ZOOM);
- const bbox = map.getBounds();
-
- if (lastBoundingBox == null) {
- lastBoundingBox = bbox;
- }
-
- updateMapPosition(bbox.getCenter().lat.toFixed(4), bbox.getCenter().lng.toFixed(4), map.getZoom().toFixed(2));
- mapLayerService.addBaseSources(map, selectedSite, selectedLink, selectedService);
-
- //loading icons used in "icon switch" logic
- addImages(map, () => {
- if (map.getZoom() > 11 && showIcons) {
- mapLayerService.addIconLayers(map);
- } else {
- mapLayerService.addBaseLayers(map);
- if (map.getZoom() < 9) {
- reduceSizeOfFeatures();
- }
- }
- updateOpacity();
- if (!mapContext.current.areLayersLoaded) {
- mapContext.current.areLayersLoaded = true;
- getAdditionalLayers(map);
- mapLayerService.addLayersToMap(map, mapContext.current.furtherLayerNames);
- rearrangeLayers(map);
- }
- updateMapBasedOnLayers(map);
- });
-
- const boundingBox = map.getBounds();
- loadMapData(boundingBox);
- updateMapStatistics(BoundingBox.createFromBoundingBox(boundingBox));
- map.on('click', handleMapClick);
- map.on('move', handleMapMove);
- map.on('moveend', handleMapMoveEnd);
- map.on('rotate', (ev) => {
- const targetMap = ev.target;
- setBearing(targetMap.getBearing());
- });
- });
- };
-
- useEffect(() => {
-
- // resize the map, if menu gets collapsed
- window.addEventListener('menu-resized', handleResize);
-
- //pass themes to mapLayerService
- updateTheme();
-
- // try if connection to tile + topology server are available
- Promise.all([
- dataService.tryReachTileServer(),
- dataService.tryReachTopologyServer(),
- updateLayers(),
- ]).then(([tileServerReachableResult, topologyServerReachableResult]) => {
- setTileServerLoaded(tileServerReachableResult);
- setTopologyServerLoaded(topologyServerReachableResult);
-
- //both done
- setConnectivityCheck(false);
- });
-
- return () => {
- //unregister events
- window.removeEventListener('menu-resized', handleResize);
-
- if (mapRef.current) {
- mapRef.current.off('click', handleMapClick);
- mapRef.current.off('moveend', handleMapMoveEnd);
- mapRef.current.off('move', handleMapMove);
- }
-
- // will be checked again on next load
- setConnectivityCheck(true);
- };
- }, []);
-
- useEffect(() => {
- updateTheme();
- }, [settings]);
-
- // load map
- useEffect(() => {
-
- // if everything done loading/reachable, load map
- if (!isConnectivityCheckBusy && isTopologyServerReachable && isTileServerReachable && !settings.isLoadingData) {
-
- if (mapRef.current === undefined) {
- setupMap();
- } else
- if (mapRef.current.getContainer() !== mapContainerRef.current) {
- // reload map, because the current container (fresh div) doesn't hold the map and changing containers isn't supported
- mapRef.current.remove();
- setupMap();
- }
- }
- return () => {
- if (mapRef.current) {
- mapRef.current.remove();
- mapRef.current = undefined;
- }
- };
- }, [isConnectivityCheckBusy, isTopologyServerReachable, isTileServerReachable, settings.isLoadingData]);
-
- useEffect(() => {
- if (!mapRef.current) return;
-
- if (selectedSite !== null) {
-
- if (mapRef.current.getSource('selectedPoints')) {
- (mapRef.current.getSource('selectedLine') as maplibregl.GeoJSONSource).setData({ type: 'FeatureCollection', features: [] });
- (mapRef.current.getSource('selectedPoints') as maplibregl.GeoJSONSource).setData({ type: 'FeatureCollection', features: [selectedSite] });
- }
-
- if (mapRef.current.getLayer('point-lamps')) {
-
- //reset filters (remove earlier 'selected' (bigger) icons)
-
- mapRef.current.setFilter('point-lamps', ['==', 'type', 'street lamp']);
- mapRef.current.setFilter('point-data-center', ['==', 'type', 'data center']);
- mapRef.current.setFilter('point-building', ['==', 'type', 'high rise building']);
- mapRef.current.setFilter('point-factory', ['==', 'type', 'factory']);
- }
- } else if (selectedLink !== null) {
- if (mapRef.current.getLayer('point-lamps')) {
- mapRef.current.setFilter('point-lamps', ['==', 'type', 'street lamp']);
- mapRef.current.setFilter('point-data-center', ['==', 'type', 'data center']);
- mapRef.current.setFilter('point-building', ['==', 'type', 'high rise building']);
- mapRef.current.setFilter('point-factory', ['==', 'type', 'factory']);
- }
-
- if (mapRef.current.getSource('selectedLine')) {
- (mapRef.current.getSource('selectedPoints') as maplibregl.GeoJSONSource).setData({ type: 'FeatureCollection', features: [] });
- (mapRef.current.getSource('selectedLine') as maplibregl.GeoJSONSource).setData({ type: 'FeatureCollection', features: [selectedLink] });
- }
- } else if (selectedService !== null) {
- if (mapRef.current.getLayer('point-lamps')) {
- mapRef.current.setFilter('point-lamps', ['==', 'type', 'street lamp']);
- mapRef.current.setFilter('point-data-center', ['==', 'type', 'data center']);
- mapRef.current.setFilter('point-building', ['==', 'type', 'high rise building']);
- mapRef.current.setFilter('point-factory', ['==', 'type', 'factory']);
- }
-
- if (mapRef.current.getSource('selectedLine')) {
- (mapRef.current.getSource('selectedPoints') as maplibregl.GeoJSONSource).setData({ type: 'FeatureCollection', features: [] });
- (mapRef.current.getSource('selectedLine') as maplibregl.GeoJSONSource).setData({ type: 'FeatureCollection', features: [selectedService] });
- }
- } else if (selectedLink == null && selectedService == null && selectedSite == null) {
- //if nothing is selected, remove highlighting (happens after eg changing the details url / element not found)
- if (mapRef.current.getSource('selectedLine')) {
- (mapRef.current.getSource('selectedPoints') as maplibregl.GeoJSONSource).setData({ type: 'FeatureCollection', features: [] });
- (mapRef.current.getSource('selectedLine') as maplibregl.GeoJSONSource).setData({ type: 'FeatureCollection', features: [] });
- }
- }
-
- }, [selectedSite, selectedLink, selectedService]);
-
- useEffect(() => {
- if (!mapRef.current) return;
-
- if (mapRef.current?.getZoom() > 11) {
- mapLayerService.showIconLayers(map, showIcons);
- }
- }, [showIcons]);
-
- useEffect(() => {
- if (LogLevel > 3) {
- console.log(`MapComponent:: store state coordinates changed to: lat: ${lat} lon: ${lon} zoom: ${zoom}`);
- }
-
- if (!mapRef.current) {
- return;
- }
-
- const center = mapRef.current.getCenter();
- const isMapAtSamePosition = center.lat.toFixed(4) === lat && center.lng.toFixed(4) === lon && mapRef.current.getZoom().toFixed(2) === zoom;
-
- if (!isMapAtSamePosition) {
- moveMapToCoordinates(mapRef.current, { lat: Number(lat), lon: Number(lon), zoom: Number(zoom) });
- }
-
- }, [lat, lon, zoom]);
-
- useEffect(() => {
- if (!mapRef.current) return;
-
- if (zoomToElement) {
- centerMapOnFeature(mapRef.current, zoomToElement.center, zoomToElement.start, zoomToElement.end);
- mapRef.current.once('zoomend', () => { zoomFinished(); });
- }
- }, [zoomToElement]);
-
- useEffect(() => {
- if (!mapRef.current) return;
-
- if (!mapContext.current.areLayersLoaded) {
- mapContext.current.areLayersLoaded = true;
- getAdditionalLayers(mapRef.current);
- mapLayerService.addLayersToMap(mapRef.current, mapContext.current.furtherLayerNames);
- rearrangeLayers(mapRef.current);
- }
- updateMapBasedOnLayers(mapRef.current);
- }, [layers]);
-
- const handleZoomIn = () => {
- if (!map.isZooming())
- map.zoomIn();
- };
-
- const handleZoomOut = () => {
- if (!map.isZooming())
- map.zoomOut();
- };
-
- const handleAlignBearingNorth = () => {
- if (!map.isMoving())
- map.resetNorth();
- };
-
- const styles = useStyles();
-
- if (LogLevel > 3) {
- console.log(`MapComponent::render - lat: ${lat}, lon: ${lon}, zoom: ${zoom}, networkFilter: ${networkFilter.value}, showIcons: ${showIcons}`);
- }
-
- return (
- <>
- <NetworkFilterObserver value={networkFilter.value} onDidUpdate={() => {
- if (LogLevel > 3) {
- console.log(`MapComponent::render - networkFilter changed to ${networkFilter.value} ${mapRef.current}`);
- }
- if (!mapRef.current) {
- return;
- }
- const boundingBox = mapRef.current.getBounds();
- loadMapData(boundingBox, true);
- }} />
- {
- !settings.isLoadingData
- ? (
- <div aria-label="network-map" id="map" className={styles.map} ref={mapContainerRef} >
- {(popup && popup.isOpen)
- ? (<MapPopup {...popup} onClose={() => { setPopup(null); }} />)
- : null
- }
- <MapControl bearing={bearing} onZoomIn={handleZoomIn} onZoomOut={handleZoomOut} onAlignNorth={handleAlignBearingNorth} />
- <FilterBar />
- <SearchBar />
- <Statistics />
- <MapLayer />
- <ConnectionInfo />
- </div>
- )
- : (
- <div />
- )
- }
- </>
- );
-});
-
-Map.displayName = 'Map';
-
-export { Map };
+++ /dev/null
-/**
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt odlux
- * =================================================================================================
- * Copyright (C) 2022 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 React, { FC } from 'react';
-
-import { makeStyles } from '@mui/styles';
-import Paper from '@mui/material/Paper/Paper';
-import IconButton from '@mui/material/IconButton/IconButton';
-
-import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faCompass, faMinus, faPlus } from '@fortawesome/free-solid-svg-icons';
-
-type MapControlProps = {
- onZoomIn(): void;
- onZoomOut(): void;
- onAlignNorth(): void;
- bearing: number;
- align?: AllowedAlignment;
-};
-
-type AllowedAlignment = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
-
-const useStyles = makeStyles({
- mapControl: {
- zIndex: 2,
- borderRadius: 4,
- display: 'flex',
- flexDirection: 'column',
- position: 'absolute',
- },
- mapControlButton: {
- borderRadius: 0,
- height: 29,
- width: 29,
- },
- zoomIcon: {
- color: 'black',
- height: '15px',
- },
- biggerZoomIcon: {
- color: 'black',
- height: '17px',
- },
- borderBottom: {
- borderBottom: '1px solid lightgray',
- },
-});
-
-// created because normal zoom controls caused error (see: https://git-highstreet-technologies.com/highstreet/odlux/-/issues/367)
-
-const MapControl: FC<MapControlProps> = (props) => {
-
- const getAlignment = (align: AllowedAlignment | undefined) => {
- const defaultCss = { top: 0, right: 0, margin: '10px 10px 0 0' };
-
- if (!align) {
- return defaultCss;
- }
-
- let alignment: React.CSSProperties;
-
- switch (align) {
- case 'top-right':
- alignment = defaultCss;
- break;
- case 'top-left':
- alignment = { top: 0, left: 0, margin: '10px 0 0 10px' };
- break;
- case 'bottom-right':
- alignment = { bottom: 0, right: 0, margin: '0 10px 45px 0' };
- break;
- case 'bottom-left':
- alignment = { bottom: 0, left: 0, margin: '0 0 10px 10px' };
- break;
- }
-
- return alignment;
- };
-
- const positioning = getAlignment(props.align);
- const bearing = props.bearing - 44; //align icon towards north
-
- const classes = useStyles();
- return (
- <Paper className={classes.mapControl} style={positioning}>
- <IconButton aria-label="zoom-in-button" className={`${classes.mapControlButton} ${classes.borderBottom}`} onClick={props.onZoomIn}>
- <FontAwesomeIcon className={classes.zoomIcon} icon={faPlus} />
- </IconButton>
- <IconButton aria-label="zoom-out-button" className={`${classes.mapControlButton} ${classes.borderBottom}`} onClick={props.onZoomOut}>
- <FontAwesomeIcon className={classes.zoomIcon} icon={faMinus} />
- </IconButton>
- <IconButton aria-label="align-north-button" className={classes.mapControlButton} onClick={props.onAlignNorth}>
- <FontAwesomeIcon className={classes.biggerZoomIcon} style={{ 'transform': `rotate(${bearing}deg)` }} icon={faCompass} />
- </IconButton>
- </Paper>
- );
-};
-
-MapControl.displayName = 'MapControl';
-
-export default MapControl;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React, { FC, useState } from 'react';
-
-import Paper from '@mui/material/Paper';
-import Popover from '@mui/material/Popover';
-import Select from '@mui/material/Select';
-import Typography from '@mui/material/Typography';
-
-import { useApplicationDispatch } from '../../../../../framework/src/flux/connect';
-
-import { LoadNetworkElementDetails } from '../../actions/detailsAction';
-import { Feature } from '../../model/topologyTypes';
-
-type MapPopupProps = {
- elements: Feature[];
- type: string;
- position: { left: number; top: number };
- onClose(): void;
-};
-
-const MapPopup: FC<MapPopupProps> = (props) => {
- const { type, position, elements, onClose } = props;
-
- const dispatch = useApplicationDispatch();
-
- const [value, setValue] = useState('');
-
- const handleElementSelected = (event: any) => {
- setValue(event.target.value);
- const element = elements[event.target.value];
- const typeOfFeature = element?.properties?.layer || 'site';
- const id = element.properties.id;
- dispatch(LoadNetworkElementDetails(typeOfFeature, String(id)));
- onClose();
- };
-
- return (
- <Popover open={true} anchorEl={undefined} onClose={onClose} anchorReference="anchorPosition" anchorPosition={{ top: position.left, left: position.top }}>
- <Paper aria-label={'multiple-elements-selected'} style={{ padding: '15px' }}>
- <Typography variant="h5">{`Multiple ${type}s were selected`}</Typography>
- <Typography variant="body1">Please select one.</Typography>
- <Select variant="standard" aria-label={type + '-selection'} style={{ width: 300 }} onChange={handleElementSelected} value={value} native>
- <option aria-label="none-value" value={''} disabled>{type} ids</option>
- {
- elements.map((el, index) => (
- <option
- aria-label={String(el.properties.id)}
- key={String(el.properties.id)}
- value={index}>
- {el.properties.id}
- {(el.properties.subType !== 'null') ? ' - ' + el.properties.subType : ''}
- {(el.properties.polarization !== 'null' && el.properties.polarization !== 'NULL') ? ' - ' + el.properties.polarization : ''}
- </option>
- ))
- }
- </Select>
- </Paper>
- </Popover>
- );
-};
-
-MapPopup.displayName = 'MapPopup';
-
-export default MapPopup;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React, { FC } from 'react';
-
-import SearchIcon from '@mui/icons-material/Search';
-import Divider from '@mui/material/Divider/Divider';
-import IconButton from '@mui/material/IconButton/IconButton';
-import Paper from '@mui/material/Paper/Paper';
-import makeStyles from '@mui/styles/makeStyles';
-
-import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect';
-
-import { Coordinate } from '../../model/coordinates';
-import { Link, Site, Service, isLink, isService, isSite } from '../../model/topologyTypes';
-import { SearchResult } from '../../model/searchResult';
-
-import { SelectElementAction } from '../../actions/detailsAction';
-import { highlightElementAction, ZoomToSearchResultAction } from '../../actions/mapActions';
-import { SetSearchValueAction } from '../../actions/searchAction';
-
-import { dataService } from '../../services/dataService';
-import { calculateMidPoint } from '../../utils/mapUtils';
-
-import SearchResultDisplay from './searchResultDisplay';
-import InputBase from '@mui/material/InputBase/InputBase';
-import Popover from '@mui/material/Popover/Popover';
-import Typography from '@mui/material/Typography/Typography';
-
-const useStyles = makeStyles({
- searchBar: {
- padding: '2px 4px',
- position: 'absolute',
- display: 'flex',
- alignItems: 'center',
- top: 15,
- marginLeft: 5,
- width: 400,
- zIndex: 1,
- },
- input: {
- flex: 1,
- marginLeft: 5,
- },
- iconButton: {
- padding: 10,
- },
- divider: {
- height: 28,
- margin: 4,
- },
-});
-
-
-const SearchBar: FC = () => {
-
- const defaultSearchResult = { links: [], sites: [], services: [] };
-
- const searchTerm = useSelectApplicationState(state => state.network.search.value);
- const isTopoServerReachable = useSelectApplicationState(state => state.network.connectivity.isTopologyServerAvailable);
- const isTileServerReachable = useSelectApplicationState(state => state.network.connectivity.isTileServerAvailable);
-
- const dispatch = useApplicationDispatch();
- const selectElement = (site: Site | Link | Service) => dispatch(new SelectElementAction(site));
- const highlightElement = (data: Link | Site | Service) => dispatch(highlightElementAction(data));
- const setSearchTerm = (value: string) => dispatch(new SetSearchValueAction(value));
- const zoomToSearchResult = (center: Coordinate, start?: Coordinate, end?: Coordinate) => dispatch(new ZoomToSearchResultAction(center, start, end));
-
- const [anchorEl, setAnchorEl] = React.useState<any>(null);
- const [errorMessage, setErrorMessage] = React.useState('');
- const [searchResult, setSearchResults] = React.useState<SearchResult>(defaultSearchResult);
-
- const divRef: any = React.useRef();
-
- const handleSearchButtonClick = (e: any) => {
-
- setAnchorEl(null);
- if (searchTerm.length > 0) {
-
- const result = dataService.search(searchTerm);
- result.then((data: SearchResult) => {
-
- if ((data.links == null || data.links.length == 0) && (data.sites == null || data.sites.length == 0) && (data.services == null || data.services.length == 0)) {
- setAnchorEl(divRef.current);
- setSearchResults(defaultSearchResult);
- setErrorMessage('No element found.');
- // hide message after 3 sec
- window.setTimeout(() => { setAnchorEl(null); }, 3000);
- } else {
- setAnchorEl(divRef.current);
- setErrorMessage('');
- setSearchResults(data);
- }
- });
-
- e.preventDefault();
- }
- };
-
- const onSearchResultClick = (result: Site | Link | Service) => {
-
- selectElement(result);
- highlightElement(result);
-
- if (isSite(result)) {
-
- const center = { lat: result.location.lat, lon: result.location.lon };
- zoomToSearchResult(center);
-
- } else if (isLink(result)) {
-
- const midPoint = calculateMidPoint(result.siteA.lat, result.siteA.lon, result.siteB.lat, result.siteB.lon);
- const startPoint = { lat: result.siteA.lat, lon: result.siteA.lon };
- const endPoint = { lat: result.siteB.lat, lon: result.siteB.lon };
-
- zoomToSearchResult(midPoint, startPoint, endPoint);
- } else if (isService(result)) {
-
- const midPoint = calculateMidPoint(result.route[0].lat, result.route[0].lon, result.route[result.route.length - 1].lat, result.route[result.route.length - 1].lon);
- const startPoint = { lat: result.route[0].lat, lon: result.route[0].lon };
- const endPoint = { lat: result.route[result.route.length - 1].lat, lon: result.route[result.route.length - 1].lon };
-
- zoomToSearchResult(midPoint, startPoint, endPoint);
- }
- setAnchorEl(null);
- };
-
- const dataFound = searchResult.links && searchResult.links.length > 0 || searchResult.sites && searchResult.sites.length > 0 || searchResult.services && searchResult.services.length > 0;
- const reachable = isTopoServerReachable && isTileServerReachable;
- const open = Boolean(anchorEl);
-
- const styles = useStyles();
- return (
- <>
- <Paper ref={divRef} component="form" className={styles.searchBar}>
- <InputBase
- disabled={!reachable}
- className={styles.input}
- placeholder="Find sites, links or services by id or name"
- inputProps={{ 'aria-label': 'networkmap-searchbar' }}
- value={searchTerm}
- onChange={e => setSearchTerm(e.currentTarget.value)}
- />
- <Divider className={styles.divider} orientation="vertical" />
- <IconButton
- type="submit"
- className={styles.iconButton}
- aria-label="search-button"
- onClick={handleSearchButtonClick}
- size="large">
- <SearchIcon />
- </IconButton>
- </Paper>
- <Popover open={open} onClose={() => setAnchorEl(null)} anchorEl={anchorEl} anchorOrigin={{
- vertical: 'bottom',
- horizontal: 'left',
- }}>
- <Paper style={{ width: 380, padding: 10 }}>
- {
- errorMessage
- ? <Typography variant="body1">{errorMessage}</Typography>
- : null
- }
- {
- dataFound
- ? < SearchResultDisplay searchResult={searchResult} onResultClick={onSearchResultClick} />
- : null
- }
- </Paper>
- </Popover>
- </>
- );
-};
-
-SearchBar.displayName = 'SearchBar';
-
-export default SearchBar;
\ No newline at end of file
+++ /dev/null
-/**
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt odlux
- * =================================================================================================
- * Copyright (C) 2022 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 React, { FC } from 'react';
-
-import Typography from '@mui/material/Typography';
-
-import { Link, Site, Service, isLink } from '../../model/topologyTypes';
-import { SearchResult } from '../../model/searchResult';
-
-type SearchResultElement = Link | Service | Site;
-
-const createSearchDisplay = (elements: SearchResultElement[], title: string, onResultClick: (element: SearchResultElement) => void) => (
-
- elements && elements.length > 0
- ? (
- <>
- <Typography variant="body1">Found {title}</Typography>
- <div key={title} aria-label={`search-result-for-${title}`}>
- {elements.map((element, i) => {
- // type specific info
- const linkMessage = isLink(element)
- ? element.polarization
- : '';
- return (
- <Typography
- key={`${title}-${i}`}
- onClick={() => onResultClick(element)}
- style={{ marginLeft: '5px', cursor: 'pointer' }}
- variant="body1">
- {element.id} - {element.name ?? ''} {linkMessage} {element.feature?.properties?.layer}
- </Typography>
- );
- })}
- </div>
- </>
- ) : null
-);
-
-type SearchResultDisplayProps = {
- searchResult: SearchResult;
- onResultClick: (element: SearchResultElement) => void;
-};
-
-const SearchResultDisplay: FC<SearchResultDisplayProps> = (props) => {
- const { searchResult, onResultClick } = props;
-
- const displays = Object.keys(searchResult).map((el) => {
- const elements = (searchResult as any)[el];
- return createSearchDisplay(elements, el, onResultClick);
- });
-
- return <>{displays}</>;
-};
-
-SearchResultDisplay.displayName = 'SearchResultDisplay';
-
-export default SearchResultDisplay;
-
+++ /dev/null
-/**
- * ============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 React, { FC } from 'react';
-import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect';
-
-import Accordion from '@mui/material/Accordion';
-import AccordionSummary from '@mui/material/AccordionSummary';
-import AccordionDetails from '@mui/material/AccordionDetails';
-import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
-import InfoIcon from '@mui/icons-material/Info';
-import Tooltip from '@mui/material/Tooltip';
-import Typography from '@mui/material/Typography';
-
-import { OpenStatisticsAction } from '../../actions/mapActions';
-
-const Statistics: FC = () => {
-
- const linkCount = useSelectApplicationState(state => state.network.map.statistics.links);
- const siteCount = useSelectApplicationState(state => state.network.map.statistics.sites);
- const serviceCount = useSelectApplicationState(state => state.network.map.statistics.services);
- const isOpen = useSelectApplicationState(state => state.network.map.statistics.isOpen);
- const isTopoServerReachable = useSelectApplicationState(state => state.network.connectivity.isTopologyServerAvailable);
- const isTileServerReachable = useSelectApplicationState(state => state.network.connectivity.isTileServerAvailable);
-
- const dispatch = useApplicationDispatch();
- const openStatistics = (open: boolean) => dispatch(new OpenStatisticsAction(open));
-
- const reachable = isTopoServerReachable && isTileServerReachable;
-
- return (
- <Accordion expanded={isOpen} onChange={() => openStatistics(!isOpen)} style={{ position: 'absolute', display: 'flex', flexDirection: 'column', top: 140, width: 200, marginLeft: 5, zIndex: 1 }}>
- <AccordionSummary
- expandIcon={<ExpandMoreIcon />}
- aria-label="statistics-accordion">
- <div style={{ display: 'flex', flexDirection: 'row' }}>
- <Typography style={{ fontWeight: 'bold', flex: '1', color: reachable ? 'black' : 'lightgrey' }} >Statistics</Typography>
- <Tooltip disableInteractive style={{ marginLeft: 5 }} title="Gets updated when the map stops moving.">
- <InfoIcon fontSize="small" />
- </Tooltip>
- </div>
- </AccordionSummary>
- <AccordionDetails aria-label="statistics-accordion-details" style={{ 'marginTop': -15 }}>
- <Typography aria-label="site-count" style={{ color: reachable ? 'black' : 'lightgrey' }}>Sites: {siteCount}</Typography>
- <Typography aria-label="link-count" style={{ color: reachable ? 'black' : 'lightgrey' }}>Links: {linkCount}</Typography>
- <Typography aria-label="service-count" style={{ color: reachable ? 'black' : 'lightgrey' }}>Services: {serviceCount}</Typography>
- </AccordionDetails>
- </Accordion>
- );
-};
-
-Statistics.displayName = 'Statistics';
-
-export default Statistics;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React, { FC, SyntheticEvent, useEffect, useState } from 'react';
-
-import MuiDialogTitle from '@mui/material/DialogTitle';
-import { AppBar, Button, Dialog, DialogContent, IconButton, Tab, Tabs, TextField, Typography } from '@mui/material';
-import CloseIcon from '@mui/icons-material/Close';
-import { Theme } from '@mui/material/styles';
-import withStyles from '@mui/styles/withStyles';
-import createStyles from '@mui/styles/createStyles';
-import makeStyles from '@mui/styles/makeStyles';
-import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faFileAlt } from '@fortawesome/free-solid-svg-icons';
-
-import StadokSite from '../../model/stadokSite';
-import { LatLonToDMS } from '../../utils/mapUtils';
-import DenseTable from '../../components/denseTable';
-import { requestRest } from '../../../../../framework/src/services/restService';
-import { OrderToDisplay, StadokOrder } from '../../model/stadokOrder';
-import { SITEDOC_URL } from '../../config';
-
-const stadokImage = (siteId: string, imageName: string, className: string) => {
- const url = `${SITEDOC_URL}/site/${siteId}/files/${imageName}`;
- return <img aria-label="image" className={className} src={url} onClick={() => window.open(url)} />;
-};
-
-const styles = (theme: Theme) => createStyles({
- root: {
- margin: 0,
- padding: theme.spacing(2),
- },
- closeButton: {
- position: 'absolute',
- right: theme.spacing(1),
- top: theme.spacing(1),
- color: theme.palette.grey[500],
- },
-});
-
-const useStyles = makeStyles({
- largeImage:{ cursor:'pointer', width:300 },
- smallImage:{ cursor:'pointer', width: 50, marginTop:'10px', marginLeft:'10px' },
-});
-
-const DialogTitle = withStyles(styles)((props: any) => {
- const { children, classes, onClose, ...other } = props;
- return (
- <MuiDialogTitle className={classes.root} {...other}>
- <Typography variant="h6">{children}</Typography>
- {onClose ? (
- <IconButton
- aria-label="close"
- style={{ position: 'absolute', top:0, right:0, color: 'black' }}
- onClick={onClose}
- size="large">
- <CloseIcon />
- </IconButton>
- ) : null}
- </MuiDialogTitle>
- );
-});
-
-type StadokDetailsProps = { site: StadokSite; siteId: number; onClose(): void };
-
-const StadokDetailsPopup: FC<StadokDetailsProps> = (props) => {
-
- const [currentTab, setCurrentTab] = useState('devices');
- const [orders, setOrders] = useState<OrderToDisplay[] | null>(null);
- const [displayReport, setDisplayReport] = useState(false);
-
- // TODO: change and use stadok site report once api is changed
- const reportUrl = `${SITEDOC_URL}/site/${props.site.id}/files/${props.siteId}-report.xml`;
- const ordersUrl = `${SITEDOC_URL}/site/${props.site.id}/orders`;
-
- const classes = useStyles();
-
- useEffect(() => {
-
- requestRest<StadokOrder[]>(ordersUrl, { method: 'GET' }).then(result =>{
- if (result) {
- const orderList = result.map(order =>{
- return OrderToDisplay.parse(order);
- });
- setOrders(orderList);
-
- } else {
- setOrders([]);
- }
- });
-
- requestRest(reportUrl).then(res =>{
- if (res) {
- setDisplayReport(true);
- }
- });
-
- }, []);
-
-
- const getContacts = (site: StadokSite) =>{
- const contacts = [];
-
- if (site.createdBy) {
- contacts.push({ h: 'Site Creator', col1: site.createdBy.firstName, col2: site.createdBy.lastName, col3: site.createdBy.email, col4: site.createdBy.telephoneNumber });
- }
-
- if (site.contacts?.manager) {
- contacts.push({ h: 'Manager', col1: site.contacts.manager.firstName, col2: site.contacts.manager.lastName, col3: site.contacts.manager.email, col4: site.contacts.manager.telephoneNumber });
- }
-
- if (site.contacts?.owner) {
- contacts.push({ h: 'Owner', col1: site.contacts.owner.firstName, col2: site.contacts.owner.lastName, col3: site.contacts.owner.email, col4: site.contacts.owner.telephoneNumber });
- }
- return contacts;
- };
-
- const onClose = () =>{
- // setOpen(false);
- props.onClose();
- };
-
- //todo: use a set 'panelId' -> which values are allowed
- const handleTabChange = (event: SyntheticEvent, newValue: string) => {
- setCurrentTab(newValue);
- };
- const contacts = getContacts(props.site);
-
- const createOrderInfo = () => {
-
- if (orders == null) {
- return (<div style={{ height: 300 }}>
- <Typography variant="body1" style={{ marginTop: '10px' }}>
- Loading orders
- </Typography>
- </div>);
- } else if (orders.length === 0) {
- return (<div style={{ height: 300 }}>
- <Typography variant="body1" style={{ marginTop: '10px' }}>
- No orders available
- </Typography>
- </div>);
- } else {
- return <DenseTable data={orders} height={300} headers={['Person', 'State', 'Current Task']} hover={false} ariaLabelRow="activity-log-table" />;
- }
- };
-
- const displayImages = () => {
- if (props.site.images.length === 1) {
- return stadokImage(props.site.id, props.site.images[0], classes.largeImage);
- } else {
- return <>
- {
- stadokImage(props.site.id, props.site.images[0], classes.largeImage)
- }
- <div style={{ display: 'flex', flexDirection: 'row', flexWrap: 'wrap' }}>
-
- {
- props.site.images.length <= 5 ?
- props.site.images.slice(1, props.site.images.length).map(image =>
- stadokImage(props.site.id, image, classes.smallImage),
- )
- :
- <>
- {
- props.site.images.slice(1, 5).map(image =>
- stadokImage(props.site.id, image, classes.smallImage),
- )
- }
- </>
- }
- </div>
- </>;
- }
- };
-
- return (
- <Dialog aria-label="further-information-popup" onClose={onClose} fullWidth maxWidth="md" aria-labelledby="customized-dialog-title" open={true}>
- <DialogTitle id="customized-dialog-title" onClose={onClose}>
- {props.site.id}
- </DialogTitle>
- <DialogContent style={{ minWidth:'900px' }} dividers>
- <div style={{ display: 'flex', flexDirection: 'row', flexGrow: 1 }}>
- <div style={{ width: '60%', display:'flex', flexDirection: 'column' }}>
-
- <TextField variant="standard" inputProps={{ 'aria-label': 'updated-on' }} disabled={true} value={props.site.updatedOn} label="Updated on" style={{ marginTop: '5px' }} />
- {
- props.site.type != null && props.site.type.length > 0 &&
- <TextField variant="standard" inputProps={{ 'aria-label': 'type' }} disabled={true} value={props.site.type} label="Type" style={{ marginTop: '5px' }} />
- }
-
- <TextField
- variant="standard"
- inputProps={{ 'aria-label': 'address' }}
- disabled={true}
- value={`${props.site.address.streetAndNr}, ${props.site.address.zipCode != null ? props.site.address.zipCode : ''} ${props.site.address.city}`}
- label="Address"
- style={{ marginTop: '5px' }}
- />
-
- <TextField variant="standard" inputProps={{ 'aria-label': 'latitude' }} style={{ marginTop: '5px' }} disabled={true} value={LatLonToDMS(props.site.location.lat)} label="Latitude" />
- <TextField variant="standard" inputProps={{ 'aria-label': 'longitude' }} style={{ marginTop: '5px' }} disabled={true} value={LatLonToDMS(props.site.location.lon, true)} label="Longitude" />
- <AppBar enableColorOnDark position="static" style={{ marginTop: '5px', background: '#2E3B55' }}>
- <Tabs indicatorColor="secondary" textColor="inherit"
- id="site-tabs"
- variant="scrollable"
- scrollButtons
- value={currentTab}
- onChange={handleTabChange}
- aria-label="information-tabs"
- allowScrollButtonsMobile>
- <Tab label="Devices" value="devices" />
- <Tab label="Contacts" value="contacts" />
- <Tab label="Safety" value="safetyInfo" />
- <Tab label="Logs" value="logs" />
- <Tab label="Orders" value="orders" />
- </Tabs>
- </AppBar>
- {
- currentTab == 'devices' && (props.site.devices?.length > 0 ?
- <DenseTable data={props.site.devices} height={300} headers={['Device', 'Antenna']} hover={false} ariaLabelRow="devices-table" />
- :
- <div style={{ height:300 }}>
- <Typography variant="body1" style={{ marginTop: '10px' }}>
- No devices available
- </Typography>
- </div>)
- }
- {
- currentTab == 'contacts' && (contacts.length > 0 ?
- <DenseTable data={contacts} height={300} headers={['Person', 'Firstname', 'Lastname', 'Email', 'Phone No.']} hover={false} ariaLabelRow="contacts-table" ariaLabelColumn={['person', 'firstname', 'lastname', 'email', 'phoneno']} />
- :
- <div style={{ height:300 }}>
- <Typography variant="body1" style={{ marginTop: '10px' }}>
- No contacts available
- </Typography>
- </div>)
- }
- {
- currentTab == 'safetyInfo' && (props.site?.safetyNotices?.length > 0
- ? (
- <DenseTable data={props.site.safetyNotices} height={300} headers={['Note']} hover={false} ariaLabelRow="safety-info-table" />
- )
- : (
- <div style={{ height:300 }}>
- <Typography variant="body1" style={{ marginTop: '10px' }}>
- No safety notices applicable
- </Typography>
- </div>
- ))
- }
- {
- currentTab == 'logs' && (props.site?.logs?.length > 0
- ? (
- <DenseTable data={props.site.logs} height={300} headers={['Date', 'Person', 'Activity']} hover={false} ariaLabelRow="activity-log-table" />
- )
- : (
- <div style={{ height:300 }}>
- <Typography variant="body1" style={{ marginTop: '10px' }}>
- No activity log available
- </Typography>
- </div>
- )
- )
- }
-
- {
- currentTab === 'orders' && createOrderInfo()
- }
- </div>
- <div style={{ padding: '10px', display: 'flex', alignItems:'center', flexDirection:'column', justifyContent: 'start', width:'40%' }}>
- {
- props.site?.images?.length > 0
- ? displayImages()
- : (
- <Typography variant="body1" style={{ marginTop: '10px' }}>
- No images available
- </Typography>
- )
- }
- {
- displayReport &&
- <div style={{ marginTop:25 }}>
- <Button onClick={() => window.open(reportUrl)} aria-label="download-report-button">
- <FontAwesomeIcon color="black" icon={faFileAlt} size="3x" />
- </Button>
- <Typography variant="body1">TSS Report</Typography>
- </div>
- }
-
- </div>
- </div>
- </DialogContent>
- </Dialog>
- );
-
-};
-
-export default StadokDetailsPopup;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-export const URL_API = '/topology/network';
-export const SITEDOC_URL = '/sitedoc';
-export const URL_TILE_API = '/tiles';
-export const URL_BASEPATH = 'network';
-
-export const TERRAIN_URL = '/terrain'; //http://10.20.11.249:5200 maybe? /terrain
-export const TILE_URL = '/tiles'; //http://tile.openstreetmap.org /tiles
-
-export const ELECTROMAGNETC_FIELD = '/electromagnetic-field/';
-export const ANTENNA_MAP = '/electromagnetic-field/';
-
-export const OSM_STYLE = {
- 'version': 8,
- 'sources': {
- 'raster-tiles': {
- 'type': 'raster',
- 'tiles': [
- TILE_URL + '/{z}/{x}/{y}.png',
- ],
- 'tileSize': 256,
- 'attribution': '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
- },
- 'signal-level': {
- 'type': 'raster',
- 'tiles': [
- ELECTROMAGNETC_FIELD + '?bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:3857&transparent=true&width=256&height=256&layers=layers=campusos%3Abest_server_test',
- ],
- 'tileSize': 256,
- },
- 'antenna-map': {
- 'type': 'raster',
- 'tiles': [
- ELECTROMAGNETC_FIELD + '?bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:3857&transparent=true&width=256&height=256&layers=layers=campusos%3Asector_markers',
- ],
- 'tileSize': 256,
- },
- },
- 'layers': [
- {
- 'id': 'osm-map',
- 'type': 'raster',
- 'source': 'raster-tiles',
- 'minZoom': 0,
- 'maxZoom': 18,
- },
- {
- 'id': 'signal level',
- 'type': 'raster',
- 'source': 'signal-level',
- 'minZoom': 0,
- 'maxZoom': 18,
- 'background-opacity': 1,
- 'layout': {
- 'visibility': 'none',
- },
- },
- {
- 'id': 'antenna map',
- 'type': 'raster',
- 'source': 'antenna-map',
- 'minZoom': 0,
- 'maxZoom': 18,
- 'background-opacity': 1,
- 'layout': {
- 'visibility': 'none',
- },
- },
- ],
-};
-
-
+++ /dev/null
-/**
- * ============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 { IActionHandler } from '../../../../framework/src/flux/action';
-import { IsTopologyServerReachableAction, IsTileServerReachableAction, IsBusyCheckingConnectivityAction } from '../actions/connectivityAction';
-
-export type connectivityState = {
- isTopologyServerAvailable: boolean;
- isTileServerAvailable: boolean;
- isBusy: boolean;
-};
-
-const initialState: connectivityState = {
- isTopologyServerAvailable: true,
- isTileServerAvailable: true,
- isBusy: true,
-};
-
-export const ConnectivityHandler: IActionHandler<connectivityState> = (state = initialState, action) => {
-
- if (action instanceof IsTopologyServerReachableAction) {
- state = { ...state, isTopologyServerAvailable: action.reachable };
- } else if (action instanceof IsTileServerReachableAction) {
- state = { ...state, isTileServerAvailable: action.reachable };
- } else if (action instanceof IsBusyCheckingConnectivityAction) {
- state = { ...state, isBusy: action.isBusy };
- }
-
- return state;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { IActionHandler } from '../../../../framework/src/flux/action';
-
-import { HistoryEntry } from '../model/historyEntry';
-import { Link, Site, Device, Service } from '../model/topologyTypes';
-
-import {
- AddToHistoryAction,
- ClearHistoryAction,
- IsBusyCheckingDeviceListAction,
- FinishedLoadingDeviceListAction,
- ClearLoadedDevicesAction,
- ClearDetailsAction,
- InitializeLoadedDevicesAction,
- IsSitedocReachableAction,
- SelectElementAction,
-} from '../actions/detailsAction';
-
-export type DetailsStoreState = {
- data: Site | Link | Service | null;
- history: HistoryEntry[];
- isBusyCheckingDeviceList: boolean;
- checkedDevices: Device[];
- isSitedocReachable: boolean;
-};
-
-const initialState: DetailsStoreState = {
- data: null,
- history: [],
- isBusyCheckingDeviceList: false,
- checkedDevices: [],
- isSitedocReachable: false,
-};
-
-export const DetailsHandler: IActionHandler<DetailsStoreState> = (state = initialState, action) => {
- if (action instanceof SelectElementAction) {
- state = { ...state, data: action.data };
- } else if (action instanceof ClearDetailsAction) {
- state = { ...state, data: null };
- } else if (action instanceof AddToHistoryAction) {
- state = { ...state, history: [...state.history, action.entry] };
- } else if (action instanceof ClearHistoryAction) {
- state = { ...state, history: [] };
- } else if (action instanceof IsBusyCheckingDeviceListAction) {
- state = { ...state, isBusyCheckingDeviceList: action.isBusy };
- } else if (action instanceof FinishedLoadingDeviceListAction) {
- state = { ...state, checkedDevices: action.devices };
- } else if (action instanceof ClearLoadedDevicesAction) {
- state = { ...state, checkedDevices: [] };
- } else if (action instanceof InitializeLoadedDevicesAction) {
- state = { ...state, checkedDevices: action.devices };
- } else if (action instanceof IsSitedocReachableAction) {
- state = { ...state, isSitedocReachable: action.isReachable };
- }
- return state;
-};
-
+++ /dev/null
-/**
- * ============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 { IActionHandler } from '../../../../framework/src/flux/action';
-import { SetFilterValueAction } from '../actions/filterActions';
-
-export type FilterState = {
- value: string;
-};
-
-const initialState: FilterState = {
- value: '',
-};
-
-export const FilterHandler: IActionHandler<FilterState> = (state = initialState, action) => {
-
- if (action instanceof SetFilterValueAction) {
- state = {
- ...state,
- value: action.value,
- };
- }
-
- return state;
-};
-
+++ /dev/null
-/**
- * ============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 { createHashHistory } from 'history';
-import { Dispatch } from '../../../../framework/src/flux/store';
-import { MiddlewareArg } from '../../../../framework/src/flux/middleware';
-import { Action, IActionHandler } from '../../../../framework/src/flux/action';
-import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore';
-import { SelectElementAction } from '../actions/detailsAction';
-
-import {
- HighlightLinkAction,
- HighlightSiteAction,
- ZoomToSearchResultAction,
- AddAlarmAction,
- SetCoordinatesAction,
- SetStatistics,
- SetIconSwitchAction,
- RemoveHighlightingAction,
- ZoomToFinishedAction,
- LayerChangedAction,
- LayersLoadedAction,
- HighlightServiceAction,
- OpenLayersAction,
- OpenStatisticsAction,
- UpdateLayersVisibilityAction,
-} from '../actions/mapActions';
-
-import { Coordinate } from '../model/coordinates';
-import { Site, Link, Service, Feature, DetailsTypes, isService, isSite } from '../model/topologyTypes';
-
-import { URL_BASEPATH, OSM_STYLE } from '../config';
-
-const LogLevel = +(localStorage.getItem('log.odlux.networkMap.mapHandler') || 0);
-
-export type LayerItem = { name: string; displayed: boolean; base?: true };
-
-export type MapState = {
- selectedLink: Feature | null;
- selectedSite: Feature | null;
- selectedService: Feature | null;
- zoomToElement: {
- center: Coordinate | null;
- start: Coordinate | undefined;
- end: Coordinate | undefined;
- zoom: number | undefined;
- } | null;
- alarmElement: Feature | null;
- coordinates: {
- lat: string;
- lon: string;
- zoom: string;
- };
- statistics: {
- links: string;
- sites: string;
- services: string;
- isOpen: boolean;
- };
- allowIconSwitch: boolean;
- layersContainer: {
- isOpen: boolean;
- areFurtherLayersAvailable: boolean;
- elements: LayerItem[];
-
- };
-};
-
-const initialState: MapState = {
- selectedLink: null,
- selectedSite: null,
- selectedService: null,
- zoomToElement: null,
- alarmElement: null,
- coordinates: {
- lat: '52.5095',
- lon: '13.3290',
- zoom: '10',
- },
- statistics: {
- links: 'Not counted yet.',
- sites: 'Not counted yet.',
- services: 'Not counted yet.',
- isOpen: true,
- },
- allowIconSwitch: true,
- layersContainer: {
- isOpen: false,
- areFurtherLayersAvailable: false,
- elements: [
- ...OSM_STYLE.layers.map(layer => ({ name: layer.id, displayed: !layer?.layout?.visibility || layer?.layout?.visibility !== 'none', base: true }) as LayerItem),
- { name: 'Sites', displayed: true, base: true },
- { name: 'Links', displayed: true, base: true },
- { name: 'Services', displayed: true, base: true },
- ],
- },
-};
-
-export const MapHandler: IActionHandler<MapState> = (state = initialState, action: any) => {
- if (action instanceof HighlightLinkAction) {
- state = {
- ...state,
- selectedSite: null,
- selectedService: null,
- selectedLink: action.link.feature,
- };
- } else if (action instanceof HighlightSiteAction) {
- state = {
- ...state,
- selectedLink: null,
- selectedService: null,
- selectedSite: action.site.feature,
- };
- } else if (action instanceof HighlightServiceAction) {
- state = {
- ...state,
- selectedLink: null,
- selectedSite: null,
- selectedService: action.service.feature,
- };
- } else if (action instanceof ZoomToSearchResultAction) {
- state = {
- ...state,
- zoomToElement: {
- center: action.center,
- start: action.start,
- end: action.end,
- zoom: action.zoom,
- },
- };
- } else if (action instanceof ZoomToFinishedAction) {
- state = {
- ...state,
- zoomToElement: null,
- };
- } else if (action instanceof AddAlarmAction) {
- state = {
- ...state,
- alarmElement: action.site.feature,
- };
- } else if (action instanceof SetCoordinatesAction) {
- state = {
- ...state,
- coordinates: {
- lat: action.lat,
- lon: action.lon,
- zoom: action.zoom,
- },
- };
- } else if (action instanceof SetStatistics) {
- state = {
- ...state,
- statistics: {
- sites: action.siteCount,
- links: action.linkCount,
- services: action.serviceCount,
- isOpen: state.statistics.isOpen,
- },
- };
- } else if (action instanceof SetIconSwitchAction) {
- state = {
- ...state,
- allowIconSwitch: action.enable,
- };
- } else if (action instanceof RemoveHighlightingAction) {
- state = {
- ...state,
- selectedLink: null,
- selectedSite: null,
- selectedService: null,
- };
- } else if (action instanceof UpdateLayersVisibilityAction) {
- const newData = state.layersContainer.elements.map(el => (el.name in action.layerVisibility ? { ...el, displayed: action.layerVisibility[el.name] } : el));
- state = {
- ...state,
- layersContainer: {
- ...state.layersContainer,
- elements: newData,
- },
- };
- } else if (action instanceof LayerChangedAction) {
- const newData = state.layersContainer.elements.map(el => (el.name === action.layerName ? { ...el, displayed: action.displayed } : el));
- state = {
- ...state,
- layersContainer: {
- ...state.layersContainer,
- elements: newData,
- },
- };
- } else if (action instanceof LayersLoadedAction) {
- const data = state.layersContainer;
- const els: LayerItem[] = action.layers.map((e) => { return { name: e, displayed: false }; });
- data.elements.push(...els);
- if (els.length > 0) {
- data.areFurtherLayersAvailable = true;
- }
- state = {
- ...state,
- layersContainer: data,
- };
- } else if (action instanceof OpenLayersAction) {
- const data = state.layersContainer;
- data.isOpen = action.open;
- state = {
- ...state,
- layersContainer: data,
- };
- } else if (action instanceof OpenStatisticsAction) {
- const data = state.statistics;
- data.isOpen = action.open;
- state = {
- ...state,
- statistics: data,
- };
- }
-
- return state;
-};
-
-const history = createHashHistory();
-
-const getDetailIdentifier = (data: Link | Site | Service) => {
-
- if (isService(data)) {
- return DetailsTypes.service;
- } else if (isSite(data)) {
- return DetailsTypes.site;
- } else {
- return DetailsTypes.link;
- }
-};
-
-const getDetailsParameter = (data: Link | Site | Service | null) => {
- let details = '';
- if (data) {
- switch (getDetailIdentifier(data)) {
- case DetailsTypes.link:
- details = `linkId=${data.id}`;
- break;
- case DetailsTypes.site:
- details = `siteId=${data.id}`;
- break;
- case DetailsTypes.service:
- details = `serviceId=${data.id}`;
- break;
- }
- }
- return details;
-};
-
-const getCoordinatesParameter = (lat: string, lon: string, zoom: string) => {
- const centerParam = lat && lat ? `center=${lat},${lon}` : '';
- const zoomParam = zoom ? `zoom=${zoom}` : '';
- return [centerParam, zoomParam].filter(e => e).join('&');
-};
-
-export const MapMiddleware = (store: MiddlewareArg<IApplicationStoreState>) => (next: Dispatch) => <A extends Action>(action: A) => {
- if (action instanceof SetCoordinatesAction) {
-
- const {
- framework: {
- navigationState,
- },
- network: {
- details: {
- data,
- },
- },
- } = store.getState();
-
- const detailsParam = getDetailsParameter(data);
- const coordinatesParam = getCoordinatesParameter(action.lat, action.lon, action.zoom);
- const url = `/${URL_BASEPATH}?${[coordinatesParam, detailsParam].filter(e => e).join('&')}`;
- if (navigationState.pathname !== url) {
- history.replace(url);
- }
-
- if (LogLevel > 3) {
- console.log(`MapMiddleware::SetCoordinatesAction - lat: ${action.lat} lon: ${action.lon} zoom: ${action.zoom} data: ${data}`);
- }
-
- } else if (action instanceof SelectElementAction) {
- const {
- framework: {
- navigationState,
- },
- network: {
- map: {
- coordinates,
- },
- },
- } = store.getState();
-
-
- const detailsParam = getDetailsParameter(action.data);
- const coordinatesParam = getCoordinatesParameter(coordinates.lat, coordinates.lon, coordinates.zoom);
- const url = `/${URL_BASEPATH}?${[coordinatesParam, detailsParam].filter(e => e).join('&')}`;
-
- if (navigationState.pathname !== url) {
- window.setTimeout(() => history.replace(url));
- }
-
- if (LogLevel > 3) {
- console.log(`MapMiddleware::SelectElementAction - ne: ${action.data?.feature?.properties?.layer || 'side'} id: ${action.data.id} name: ${action.data.name} coordinates: ${coordinates.lat} ${coordinates.lon} ${coordinates.zoom}`);
- }
- }
- // let all actions pass
- return next(action);
-};
-
-
+++ /dev/null
-/**
- * ============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 { combineActionHandler } from '../../../../framework/src/flux/middleware';
-
-import { DetailsHandler, DetailsStoreState } from './detailsHandler';
-import { MapHandler, MapState } from './mapHandler';
-import { SearchHandler, searchState } from './searchHandler';
-import { connectivityState, ConnectivityHandler } from './connectivityHandler';
-import { SettingsHandler, SettingsState } from './settingsHandler';
-import { ManagementHandler, ManagementState } from './sitedocManagementHandler';
-import { FilterHandler, FilterState } from './filterHandler';
-
-export type INetworkAppStoreState = {
- details: DetailsStoreState;
- map: MapState;
- search: searchState;
- filter: FilterState;
- connectivity: connectivityState;
- settings: SettingsState;
- sitedocManagement: ManagementState;
-};
-
-declare module '../../../../framework/src/store/applicationStore' {
- interface IApplicationStoreState {
- network: INetworkAppStoreState;
- }
-}
-
-const appHandler = {
- details: DetailsHandler,
- map: MapHandler,
- search: SearchHandler,
- filter: FilterHandler,
- connectivity: ConnectivityHandler,
- settings: SettingsHandler,
- sitedocManagement: ManagementHandler,
-};
-
-export const networkmapRootHandler = combineActionHandler<INetworkAppStoreState>(appHandler);
-export default networkmapRootHandler;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { IActionHandler } from '../../../../framework/src/flux/action';
-import { SetSearchValueAction } from '../actions/searchAction';
-
-export type searchState = {
- value: string;
-};
-
-const initialState: searchState = {
- value: '',
-};
-
-export const SearchHandler: IActionHandler<searchState> = (state = initialState, action) => {
-
- if (action instanceof SetSearchValueAction) {
- state = { ...state, value: action.value };
- }
-
- return state;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { IActionHandler } from '../../../../framework/src/flux/action';
-import { NetworkMapSettings, ThemeElement } from '../model/settings';
-import { SetBusyLoadingAction, SetMapSettingsAction, SetThemeSettingsAction } from '../actions/settingsAction';
-
-export type SettingsState = {
- mapSettings: NetworkMapSettings | null;
- themes: ThemeElement[];
- isLoadingData: boolean;
-};
-
-const defaultThemes: ThemeElement[] = [
- {
- key: 'light',
- site: '#11b4da',
- selectedSite: '#116bda',
- fiberLink: '#1154d9',
- microwaveLink: '#039903',
- furtherLayers: {},
- },
- {
- key: 'dark',
- site: '#000000',
- selectedSite: '#6e6e6e',
- fiberLink: '#0a2a6b',
- microwaveLink: '#005200',
- furtherLayers: {},
- },
-];
-
-const initialState: SettingsState = {
- mapSettings: null,
- themes: defaultThemes,
- isLoadingData: true,
-};
-
-export const SettingsHandler: IActionHandler<SettingsState> = (state = initialState, action) => {
-
- if (action instanceof SetMapSettingsAction) {
- state = {
- ...state,
- mapSettings: action.settings,
- };
- } else if (action instanceof SetThemeSettingsAction) {
- state = {
- ...state,
- themes: action.settings.themes,
- };
- } else if (action instanceof SetBusyLoadingAction) {
- state = {
- ...state,
- isLoadingData: action.busy,
- };
- }
- return state;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { ResetAction, SelectUserAction, SetAllUsersAction, SetTSSRAction, UpdateNoteAction, UpdateStateAction, UpdateTasks } from '../actions/sitedocManagementAction';
-import { IActionHandler } from '../../../../framework/src/flux/action';
-import { SitedocOrderTask, UserListItem } from '../model/siteDocTypes';
-
-const emptyTask: SitedocOrderTask = { type: '', description: '', status: false };
-
-export type ManagementState = {
- users: UserListItem[];
- selectedUser: string;
- note: string;
- tasks: SitedocOrderTask[];
- isTSSR: boolean;
- state: string;
-};
-
-const initialState: ManagementState = {
- users:[],
- selectedUser: '',
- state: 'OPEN',
- note: '',
- tasks: [emptyTask],
- isTSSR: false,
-};
-
-export const ManagementHandler: IActionHandler<ManagementState> = (state = initialState, action) => {
- if (action instanceof SetAllUsersAction) {
- state = { ...state, users:action.users };
- } else if (action instanceof SelectUserAction) {
- state = { ...state, selectedUser: action.user };
- } else if (action instanceof SetTSSRAction) {
- state = { ...state, isTSSR: action.isTSSR };
- } else if (action instanceof UpdateNoteAction) {
- state = { ...state, note:action.note };
- } else if (action instanceof UpdateStateAction) {
- state = { ...state, state: action.state };
- } else if (action instanceof UpdateTasks) {
- state = { ...state, tasks: action.tasks };
- } else if ( action instanceof ResetAction) {
- state = { ...state, tasks: [emptyTask], selectedUser:'', note: '', isTSSR:false };
- }
- return state;
-};
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <!-- <link rel="stylesheet" href="./vendor.css" > -->
- <title>Networkmap App</title>
-</head>
-
-<body>
- <div id="app"></div>
- <script type="text/javascript" src="./require.js"></script>
- <script type="text/javascript" src="./config.js"></script>
-
- <script>
- // run the application
- require(["app","connectApp","faultApp", "networkMapApp", "siteManagerApp", "microwaveApp"], function (app, connectApp, faultApp, networkMapApp, siteManagerApp, microwaveApp) {
- connectApp.register();
- faultApp.register();
- networkMapApp.register();
- siteManagerApp.register();
- microwaveApp.register();
- app("./app.tsx").runApplication();
- });
- </script>
-</body>
-
-</html>
\ No newline at end of file
+++ /dev/null
-/* eslint-disable no-underscore-dangle */
-/**
- * ============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==========================================================================
- */
-
-/***
- * Custom bounding box, holds a rectangular area spanned open by lat-lon coordinate pairs
- */
-export class BoundingBox {
-
- private _south: number;
-
- private _west: number;
-
- private _north: number;
-
- private _east: number;
-
- get south(): number {
- return this._south;
- }
-
- get west():number {
- return this._west;
- }
-
- get north():number {
- return this._north;
- }
-
- get east():number {
- return this._east;
- }
-
- public static createFromBoundingBox = (mapboxBoundingBox: maplibregl.LngLatBounds) => {
- const bbox = new BoundingBox();
- bbox._south = mapboxBoundingBox.getSouth();
- bbox._east = mapboxBoundingBox.getEast();
- bbox._north = mapboxBoundingBox.getNorth();
- bbox._west = mapboxBoundingBox.getWest();
- return bbox;
- };
-
- public static createFromNumbers = (west: number, south: number, east: number, north: number) => {
- const bbox = new BoundingBox();
- bbox._south = south;
- bbox._west = west;
- bbox._north = north;
- bbox._east = east;
- return bbox;
- };
-
-}
\ No newline at end of file
+++ /dev/null
-/**
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt odlux
- * =================================================================================================
- * Copyright (C) 2022 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 Coordinate = {
- lat: number;
- lon: number;
-};
-
-export type MapCoordinate = {
- lat: number;
- lon: number;
- zoom: number;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-export type ElementCount = {
- sites: string;
- links: string;
- services: string;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { Link, Site } from './topologyTypes';
-
-export type HistoryEntry = {
- id: string;
- data: Site | Link;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-export type NetworkElementConnection = {
- id?: string;
- nodeId: string;
- isRequired: boolean;
- host: string;
- port: number;
- username?: string;
- password?: string;
- tlsKey?: string;
- status?: 'Connected' | 'mounted' | 'unmounted' | 'Connecting' | 'Disconnected' | 'idle';
- ['device-type']?: string;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { Link, Site, Service } from './topologyTypes';
-
-export type SearchResult = {
- links: Link[];
- sites: Site[];
- services: Service[];
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { CirclePaintProps, LinePaintProps } from '../utils/mapUtils';
-
-export type NetworkMapSettings = {
- startupPosition: {
- latitude?: string;
- longitude?: string;
- zoom?: string;
- };
- tileOpacity: string;
- areIconsEnabled: boolean;
- styling: {
- theme: string;
- };
-};
-
-export type ThemeElement = {
- key: string;
- site: string;
- selectedSite: string;
- microwaveLink: string;
- fiberLink: string;
- furtherLayers: {
- [key: string]: {
- site?: Partial<CirclePaintProps>;
- link?: Partial<LinePaintProps>;
- service?: Partial<LinePaintProps>;
- };
- };
-};
-
-export type NetworkMapThemes = {
- themes: ThemeElement[];
-};
-
-export type NetworkSettings = NetworkMapSettings & NetworkMapThemes;
\ No newline at end of file
+++ /dev/null
-/**
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt odlux
- * =================================================================================================
- * Copyright (C) 2022 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 UserListItem = {
- userName: string;
- firstName: string;
- lastName: string;
-};
-
-export type RegisterUser = {
-
- firstName: string;
- familyName: string;
- email: string;
- username: string;
- password: string;
- telephoneNr: string;
- role: 'ANDROID';
-};
-
-export type SitedocOrder = {
- siteId: string;
- assignedUser: string;
- date: string; //in UTC
- state: SitedocOrderTypes;
- tasks: SitedocOrderTask[];
- note: string;
- isTssr: boolean;
-};
-
-export type SitedocOrderTypes = 'OPEN' | 'UPDATE' | 'DELETE';
-
-export type SitedocOrderTask = {
- type: string;
- description: string;
- status: false;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-export type StadokOrder = {
- date: Date;
- assignedUser: string;
- state: string; //todo: type restrict
- tasks: Task[];
-};
-
-export class OrderToDisplay {
- static parse = (stadokOrder: StadokOrder) =>{
- let order = new OrderToDisplay();
- order.assignedUser = stadokOrder.assignedUser;
- order.state = stadokOrder.state;
-
- const firstOpenTask = stadokOrder.tasks.find(task => !task.status);
-
- if (firstOpenTask) {
- order.currentTask = firstOpenTask.description;
- } else {
- order.currentTask = 'No task description available';
- }
-
- return order;
- };
-
- state: string;
-
- assignedUser: string;
-
- currentTask: string;
-
-}
-
-type Task = {
- type: string;
- description: string;
- status: boolean;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { Address } from './topologyTypes';
-
-type StadokSite = {
- id: string;
- createdBy: Contact;
- updatedOn: Date;
- location: { lat: number; lon: number };
- address: Address;
- contacts: { manager: Contact; owner: Contact };
- safetyNotices: string[];
- images: string[];
- type: string;
- devices: Device[];
- logs: Log[];
-};
-
-type Contact = {
- firstName: string;
- lastName: string;
- email: string;
- telephoneNumber: string;
-};
-type Log = {
- date: Date; //string?
- person: string;
- entry: string;
-};
-
-type Device = {
- 'device': string;
- 'antenna': string;
-};
-
-export default StadokSite;
\ No newline at end of file
+++ /dev/null
-/**
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt odlux
- * =================================================================================================
- * Copyright (C) 2022 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 { Coordinate } from './coordinates';
-
-type Point = {
- type: 'Point';
- coordinates: number[];
-};
-
-type LineString = {
- type: 'LineString';
- coordinates: number[][];
-};
-
-export type Geometry = Point | LineString;
-
-export type Feature = {
- type: 'Feature';
- properties: {
- id: number;
- subType?: string;
- layer?: string;
- labels?: string[];
- xPonder?: boolean;
- polarization?: string;
- };
- geometry: Geometry;
-};
-
-export type Address = {
- streetAndNr: string;
- city: string;
- zipCode: string | null;
- country: string;
-};
-
-export type Service = {
- id: number;
- name: string;
- backupForServiceId: number | null;
- lifecycleState: string;
- administrativeState: string;
- operationalState: string;
- created: string;
- modified: string;
- route: Coordinate[];
- length: number;
- feature: Feature;
-};
-
-export type Site = {
- id: number;
- uuid: string;
- name: string;
- address: Address;
- heightAmslInMeters?: number; //AboveGroundLevel
- antennaHeightAmslInMeters?: number;
- operator: string;
- location:{ lon: number; lat: number };
- devices: Device[];
- links: {
- id: number;
- name: string;
- azimuth: number | null;
- }[];
- furtherInformation: string;
- feature: Feature;
-};
-
-export type Device = {
- id: string;
- type?: string;
- name: string;
- manufacturer: string;
- owner: string;
- status?: string;
- port: number[];
-};
-
-type Antenna = {
- id: string;
- name: string;
- height: number;
- gain: number;
-};
-
-type LinkDetailLocation = {
- lon: number;
- lat: number;
- siteId: number;
- siteName: string | null;
- amsl: number | null;
- azimuth: number | null;
- antenna: Antenna;
- radio: {
- id: number;
- name: string;
- };
- waveguide: {
- id: number;
- name: string;
- };
-};
-
-export type Link = {
- id: number;
- uuid: string;
- name: string;
- operator: string;
- length: number;
- polarization: string;
- frequency: number | null;
- siteA: LinkDetailLocation;
- siteB: LinkDetailLocation;
- feature: Feature;
-};
-
-export enum DetailsTypes {
- service = 'service',
- site = 'site',
- link = 'link',
-}
-
-export const isSite = (data: Link | Site | Service): data is Site => data.feature.properties.layer === DetailsTypes.site;
-
-export const isLink = (data: Link | Site | Service): data is Link => data.feature.properties.layer === DetailsTypes.link;
-
-export const isService = (data: Link | Site | Service): data is Service => data.feature.properties.layer === DetailsTypes.service;
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-// app configuration and main entry point for the app
-
-import React from 'react';
-
-import { useApplicationDispatch } from '../../../framework/src/flux/connect';
-import applicationManager from '../../../framework/src/services/applicationManager';
-
-import { addMapMessageListener } from '../../../lib/broadcast/mapChannel';
-import { URL_BASEPATH } from './config';
-
-import { CheckSitedocReachability } from './actions/detailsAction';
-import { SetFilterValueAction } from './actions/filterActions';
-import { getSettings } from './actions/settingsAction';
-
-import { NetworkMapSetup } from './components/customize/networkMapSetup';
-
-import { networkmapRootHandler } from './handlers/rootHandler';
-import { MapMiddleware } from './handlers/mapHandler';
-
-import MainView from './app';
-
-const appIcon = require('./assets/icons/networkMapAppIcon.svg'); // select app icon
-
-const NetworkMapApp = () => {
-
- const dispatch = useApplicationDispatch();
- const tryReachSitedocServer = () => dispatch(CheckSitedocReachability());
-
- React.useLayoutEffect(() => {
- tryReachSitedocServer();
- }, []);
-
- return (
- <MainView />
- );
-};
-
-NetworkMapApp.displayName = 'NetworkMapApp';
-
-export const register = async () => {
- const appApi = applicationManager.registerApplication({
- name: URL_BASEPATH, // used as name of state as well
- icon: appIcon,
- middlewares: [MapMiddleware],
- rootActionHandler: networkmapRootHandler,
- rootComponent: NetworkMapApp,
- settingsElement: NetworkMapSetup,
- menuEntry: 'Network Map',
- });
-
- addMapMessageListener('setFilter', (filter) => {
- const store = appApi && appApi.applicationStore;
- store?.dispatch(new SetFilterValueAction(filter));
- });
-
- await appApi.applicationStoreInitialized;
- await appApi.applicationStore?.dispatch(getSettings());
-};
+++ /dev/null
-/**
- * ============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 { requestRest, requestRestExt } from '../../../../framework/src/services/restService';
-import { Result } from '../../../../framework/src/models';
-
-import { NetworkElementConnection } from '../model/networkElementConnection';
-import { URL_API, URL_TILE_API } from '../config';
-import { ElementCount } from '../model/count';
-import { SearchResult } from '../model/searchResult';
-
-class DataService {
-
- tryReachTileServer = async () => {
-
- try {
-
- const tiles = await fetch(URL_TILE_API + '/10/0/0.png');
- if (tiles.status == 200) {
- return true;
- } else {
- console.error(tiles);
- return false;
- }
- } catch (error) {
- console.error(error);
- return false;
-
- }
- };
-
- tryReachTopologyServer = async () => {
- const response = await requestRestExt<any>(URL_API + '/info/count/all');
-
- if (response.status == 200) {
- return true;
- } else {
- console.error(response.message);
- return false;
- }
-
- };
-
- getGeojsonData = async (url: string) => {
-
- const result = await requestRestExt<any>(url);
- return result;
-
- };
-
- getDetailsData = async (type: string, id: string) => {
-
- const response = await requestRestExt<any>(`${URL_API}/${type}s/${id}`);
- if (response.status == 200) {
- return response.data;
- } else {
- console.error(response.message);
- return null;
- }
- };
-
- search = (searchTerm: string) => {
- const data = { searchTerm };
- return requestRest<SearchResult>(`${URL_API}/search`, { method: 'POST', body: JSON.stringify(data) });
- };
-
- /**
- * Get status and type of devices, if possible
- */
- getAdditionalInfoOnDevices = async (ids: string[]) => {
-
- const path = 'rests/operations/data-provider:read-network-element-connection-list';
-
- const query = {
- 'data-provider:input': {
- 'filter': [{
- 'property': 'id',
- 'filtervalues': ids,
- }],
- 'pagination': {
- 'size': ids.length,
- 'page': 1,
- },
- },
- };
-
- if (ids.length > 0) {
- const result = await requestRest<Result<NetworkElementConnection>>(path, { method: 'POST', body: JSON.stringify(query) });
- const resultData = result && result['data-provider:output'] && result['data-provider:output'].data;
- return resultData;
- } else {
- return null;
- }
- };
-
- getLabels = () => requestRest<string[]>(`${URL_API}/labels`);
-
- getStatistics = (bbWest: number, bbSouth: number, bbEast: number, bbNorth: number) =>
- requestRest<ElementCount>(`${URL_API}/info/count/${bbWest},${bbSouth},${bbEast},${bbNorth}`);
-
-}
-
-export const dataService = new DataService();
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 maplibregl from 'maplibre-gl';
-
-import apartment from '../../icons/apartment.png';
-import dataCenter from '../../icons/datacenter.png';
-import factory from '../../icons/factory.png';
-import lamp from '../../icons/lamp.png';
-import dataCenterRed from '../../icons/datacenterred.png';
-import factoryRed from '../../icons/factoryred.png';
-import lampRed from '../../icons/lampred.png';
-
-
-type ImagesLoaded = (allImagesLoaded: boolean) => void;
-
-export const ImagesMap: { name: string; url: string }[] = [
- { name: 'data-center', url: dataCenter },
- { name: 'house', url: apartment },
- { name: 'factory', url: factory },
- { name: 'lamp', url: lamp },
- { name: 'data-center-red', url: dataCenterRed },
- { name: 'factory-red', url: factoryRed },
- { name: 'lamp-red', url: lampRed },
-];
-
-export const addImages = (map: maplibregl.Map, callback?: ImagesLoaded) => {
- ImagesMap.forEach(image => {
- map.loadImage(
- image.url,
- (error: any, img: any) => {
- if (error) throw error;
- map.addImage(image.name, img);
-
- // continue if all images are loaded
- if (callback && ImagesMap.every(({ name }) => map.hasImage(name))) {
- callback(true);
- }
- });
- });
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 } from '../model/settings';
-import { getUserData, saveUserData } from '../../../../framework/src/services/userdataService';
-
-
-const getMapSettings = () => getUserData<{
- networkMap?: NetworkMapSettings;
- networkMapThemes?: NetworkMapThemes;
- networkMapLayers?: { [key: string]: boolean };
-}>();
-
-const getMapThemes = () => getUserData<NetworkMapThemes>('/networkMapThemes');
-
-const updateMapSettings = (newElement: NetworkMapSettings) => saveUserData<NetworkMapSettings>('/networkMap', JSON.stringify(newElement));
-
-const updateMapLayers = (layerVisibility: { [key: string]: boolean }) => saveUserData<{ [key: string]: boolean }>('/networkMapLayers', JSON.stringify(layerVisibility));
-
-export {
- getMapSettings,
- getMapThemes,
- updateMapSettings,
- updateMapLayers,
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { requestRest, requestRestExt } from '../../../../framework/src/services/restService';
-
-import { Site } from '../model/topologyTypes';
-import { RegisterUser, SitedocOrder, UserListItem } from '../model/siteDocTypes';
-
-const BASE_URL = '/sitedoc';
-
-type Message = {
- message: string;
-};
-
-class SitedocService {
-
- createOrder = async (order: SitedocOrder) => {
-
- const result = await requestRestExt<Message>(BASE_URL + '/order/create', { method: 'POST', body: JSON.stringify(order) });
-
- if (result.status === 200) {
- return { message: result.data!.message, error: false };
- } else {
-
- const message = { message: '', error: true };
-
- if (result.data) {
- message.message = 'Creation failed. Reason: ' + result.data.message;
- return message;
- } else {
- message.message = 'Something went wrong...';
- return message;
- }
- }
- };
-
- createUser = (user: RegisterUser) => requestRest<Message>(BASE_URL + '/user/register', { method: 'POST', body: JSON.stringify(user) });
-
- getSiteIfExists = (siteId: string) => requestRest<Site>('/topology/network/sites/' + siteId);
-
- getAllUsers = async () => {
-
- const result = await requestRest<UserListItem[]>(BASE_URL + '/users/android');
-
- if (result) {
- return result;
- } else {
- return [];
- }
-
- };
-}
-
-const sitedocDataService = new SitedocService();
-export { sitedocDataService };
\ No newline at end of file
+++ /dev/null
-body {
- margin: 0;
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
- 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
- sans-serif;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-}
-
-code {
- font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
- monospace;
-}
+++ /dev/null
-.mapboxgl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0);text-align:left}.mapboxgl-map:-webkit-full-screen{width:100%;height:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.mapboxgl-ctrl-top-left{top:0;left:0}.mapboxgl-ctrl-top-right{top:0;right:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{right:0;bottom:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{margin:10px 0 0 10px;float:left}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{margin:10px 10px 0 0;float:right}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{margin:0 0 10px 10px;float:left}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{margin:0 10px 10px 0;float:right}.mapboxgl-ctrl-group{border-radius:4px;background:#fff}.mapboxgl-ctrl-group:not(:empty){-moz-box-shadow:0 0 2px rgba(0,0,0,.1);-webkit-box-shadow:0 0 2px rgba(0,0,0,.1);box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl button::-moz-focus-inner{border:0;padding:0}.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:focus:only-child{border-radius:inherit}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{-webkit-animation:mapboxgl-spin 2s linear infinite;-moz-animation:mapboxgl-spin 2s infinite linear;-o-animation:mapboxgl-spin 2s infinite linear;-ms-animation:mapboxgl-spin 2s infinite linear;animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}}@-webkit-keyframes mapboxgl-spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@-moz-keyframes mapboxgl-spin{0%{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(1turn)}}@-o-keyframes mapboxgl-spin{0%{-o-transform:rotate(0deg)}to{-o-transform:rotate(1turn)}}@-ms-keyframes mapboxgl-spin{0%{-ms-transform:rotate(0deg)}to{-ms-transform:rotate(1turn)}}@keyframes mapboxgl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg opacity='.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg opacity='.9' fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E")}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{min-height:20px;padding:0;margin:10px;position:relative;background-color:#fff;border-radius:3px 12px 12px 3px}.mapboxgl-ctrl-attrib.mapboxgl-compact:hover{padding:2px 24px 2px 4px;visibility:visible;margin-top:6px}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:hover,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:hover{padding:2px 4px 2px 24px;border-radius:12px 3px 3px 12px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact:after{content:"";cursor:pointer;position:absolute;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;right:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;left:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;border:2px solid #333;border-top:#333;padding:0 5px;color:#333;box-sizing:border-box}.mapboxgl-popup{position:absolute;top:0;left:0;display:-webkit-flex;display:flex;will-change:transform;pointer-events:none}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{-webkit-flex-direction:column;flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{-webkit-flex-direction:column-reverse;flex-direction:column-reverse}.mapboxgl-popup-anchor-left{-webkit-flex-direction:row;flex-direction:row}.mapboxgl-popup-anchor-right{-webkit-flex-direction:row-reverse;flex-direction:row-reverse}.mapboxgl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-top:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-right:none;border-left-color:#fff}.mapboxgl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.mapboxgl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{position:absolute;top:0;left:0;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.mapboxgl-user-location-dot:before{content:"";position:absolute;-webkit-animation:mapboxgl-user-location-dot-pulse 2s infinite;-moz-animation:mapboxgl-user-location-dot-pulse 2s infinite;-ms-animation:mapboxgl-user-location-dot-pulse 2s infinite;animation:mapboxgl-user-location-dot-pulse 2s infinite}.mapboxgl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px rgba(0,0,0,.35)}@-webkit-keyframes mapboxgl-user-location-dot-pulse{0%{-webkit-transform:scale(1);opacity:1}70%{-webkit-transform:scale(3);opacity:0}to{-webkit-transform:scale(1);opacity:0}}@-ms-keyframes mapboxgl-user-location-dot-pulse{0%{-ms-transform:scale(1);opacity:1}70%{-ms-transform:scale(3);opacity:0}to{-ms-transform:scale(1);opacity:0}}@keyframes mapboxgl-user-location-dot-pulse{0%{transform:scale(1);opacity:1}70%{transform:scale(3);opacity:0}to{transform:scale(1);opacity:0}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:rgba(29,161,242,.2);width:1px;height:1px;border-radius:100%}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}@media print{.mapbox-improve-map{display:none}}
\ No newline at end of file
+++ /dev/null
-import { dataService } from '../services/dataService';
-import { DetailsTypes, isLink, isService, isSite } from '../model/topologyTypes';
-
-type DetailsDataUrl = {
- type: string;
- id: string;
-} | null;
-
-class DetailsUtils {
-
- errorCallback: any;
-
- public setLoadDataError = (callback: (data: any) => void) => {
- this.errorCallback = callback;
- };
-
- public isLoadNeeded = (detailsData: DetailsDataUrl, currentId: number | undefined, currentData: any) => {
-
- if (!detailsData)
- return false;
-
- return (currentId?.toString() !== detailsData.id ||
- detailsData.type == DetailsTypes.site && !isSite(currentData) ||
- detailsData.type == DetailsTypes.link && !isLink(currentData) ||
- detailsData.type == DetailsTypes.service && !isService(currentData)
- );
- };
-
- public isTypeAllowed = (type: string) => {
- return type == DetailsTypes.site || type == DetailsTypes.link || type == DetailsTypes.service;
- };
-
- public loadData = (type: string, id: string, callback: (data: any) => void) => {
-
- dataService.getDetailsData(type, id)
- .then(res => {
- if (res !== null)
- callback(res);
- else
- this.errorCallback(id);
- });
- };
-
-}
-
-const detailsUtils = new DetailsUtils();
-
-export default detailsUtils;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { Feature } from '../model/topologyTypes';
-import { ThemeElement } from '../model/settings';
-import { CirclePaintProps, LinePaintProps } from './mapUtils';
-
-class MapLayerService {
-
- availableThemes: ThemeElement[];
-
- selectedTheme: string | null = null;
-
- iconLayersActive = false;
-
- public addBaseSources = (map: maplibregl.Map, selectedPoint: Feature | null, selectedLine: Feature | null, selectedService: Feature | null) => {
-
- // make sure the sources don't already exist
- // (if the networkmap app gets opened quickly within short time periods, the prior sources might not be fully removed)
-
- if (!map.getSource('lines')) {
- map.addSource('lines', {
- type: 'geojson',
- data: { type: 'FeatureCollection', features: [] },
- });
- }
-
- if (!map.getSource('services')) {
-
- map.addSource('services', {
- type: 'geojson',
- data: { type: 'FeatureCollection', features: [] },
- });
- }
-
- if (!map.getSource('selectedLine')) {
-
- const selectedElement = selectedLine || selectedService;
- const features = selectedElement !== null ? [selectedElement] : [];
- map.addSource('selectedLine', {
- type: 'geojson',
- data: { type: 'FeatureCollection', features: features },
- });
- }
-
- if (!map.getSource('points')) {
- map.addSource('points', {
- type: 'geojson',
- data: { type: 'FeatureCollection', features: [] },
- });
- }
-
- if (!map.getSource('selectedPoints')) {
- const selectedPointFeature = selectedPoint !== null ? [selectedPoint] : [];
- map.addSource('selectedPoints', {
- type: 'geojson',
- data: { type: 'FeatureCollection', features: selectedPointFeature },
-
- });
- }
- };
-
- public addCircleLayer = (map: maplibregl.Map, id: string, source: string, paint: CirclePaintProps, filter: any) => {
-
- map.addLayer({
- id: id,
- source,
- type: 'circle',
- paint,
- filter,
- });
- };
-
- public addLineLayer = (map: maplibregl.Map, id: string, source: string, paint: LinePaintProps, filter: any, isDashed?: boolean) => {
-
- const layer: any = {
- id: id,
- type: 'line',
- source,
- layout: {
- 'line-join': 'round',
- 'line-cap': 'round',
- },
- paint,
- filter,
- };
-
- if (isDashed) {
- layer.paint['line-dasharray'] = [2, 1];
- }
-
- map.addLayer(layer);
- };
-
- public addBaseLayers = (map: maplibregl.Map) => {
-
- this.addCommonLayers(map);
- };
-
- public addIconLayers = (map: maplibregl.Map) => {
-
- this.iconLayersActive = true;
- this.addCommonLayers(map);
- this.createIconLayers(map);
- };
-
- public removeBaseLayers = (map: maplibregl.Map) => {
-
- map.removeLayer('points');
- map.removeLayer('lines');
- map.removeLayer('services');
- map.removeLayer('selectedPoints');
- map.removeLayer('selectedLine');
- map.removeLayer('selectedServices');
- };
-
- public showIconLayers = (map: maplibregl.Map, show: boolean) => {
-
- const zoom = map.getZoom();
- if (show) {
- if (zoom > 11) {
- if (!this.iconLayersActive) {
- this.iconLayersActive = true;
- if (map.getLayer('points') !== undefined && map.getLayer('point-lamps') === undefined) {
- this.createIconLayers(map);
- }
- }
- } else {
- if (this.iconLayersActive)
- this.swapLayersBack(map);
- }
- } else {
- if (this.iconLayersActive)
- this.swapLayersBack(map);
- }
- };
-
- public swapLayersBack = (map: maplibregl.Map) => {
- this.iconLayersActive = false;
- this.removeIconLayers(map);
-
- if (map.getLayer('selectedPoints')) {
- map.setFilter('selectedPoints', null);
- }
-
- if (map.getLayer('points')) {
- map.setFilter('points', null);
- }
- };
-
- public changeMapOpacity = (map: maplibregl.Map, newValue: number) => {
- const newOpacity = newValue / 100;
- if (map) {
- const tiles = map.getStyle().layers?.filter(el => el.id.includes('tiles'));
- tiles?.forEach(layer => {
- if (layer.type === 'symbol') {
- map.setPaintProperty(layer.id, 'icon-opacity', newOpacity);
- map.setPaintProperty(layer.id, 'text-opacity', newOpacity);
- } else {
- map.setPaintProperty(layer.id, `${layer.type}-opacity`, newOpacity);
- }
- });
- }
- };
-
- public changeTheme = (map: maplibregl.Map, themeName: string) => {
- this.selectedTheme = themeName;
- const theme = this.pickTheme();
- if (theme && map.loaded()) {
- map.setPaintProperty('points', 'circle-color', theme.site);
- map.setPaintProperty('selectedPoints', 'circle-color', theme.selectedSite);
- map.setPaintProperty('microwave-lines', 'line-color', theme.microwaveLink);
- map.setPaintProperty('fibre-lines', 'line-color', theme.fiberLink);
-
- }
- };
-
- public addLayersToMap(pMap: maplibregl.Map, furtherLayerNames: string[]) {
- const theme = this.pickTheme();
- const furtherLayersTheme = theme?.furtherLayers || {};
- furtherLayerNames.forEach(el => {
- const layerTheme = furtherLayersTheme[el] ;
- const sitePaint: CirclePaintProps = {
- 'circle-color': '#8F00FF',
- 'circle-radius': 6,
- ...layerTheme?.site ?? {},
- };
-
- const linksPaint: LinePaintProps = {
- 'line-color': '#8F00FF',
- 'line-width': 2,
- ...layerTheme?.link ?? {},
- };
-
- const servicesPaint: LinePaintProps = {
- 'line-color': '#8F00FF',
- 'line-width': 2,
- ...layerTheme?.service ?? {},
- };
-
- this.addCircleLayer(pMap, el, 'points', sitePaint, ['in', el, ['get', 'labels']]);
- this.addLineLayer(pMap, `${el}-links`, 'lines', linksPaint, ['in', el, ['get', 'labels']]);
- this.addLineLayer(pMap, `${el}-services`, 'services', servicesPaint, ['in', el, ['get', 'labels']]);
- });
- }
-
- private createIconLayers = (map: maplibregl.Map) => {
- //set filter to it!
- map.setFilter('points');
- map.setFilter('selectedPoints');
- };
-
- private addCommonLayers = (map: maplibregl.Map, themeSettings?: ThemeElement) => {
-
- const theme = !themeSettings ? this.pickTheme() : themeSettings;
- this.addLineLayer(map, 'microwave-lines', 'lines', { 'line-color': theme.microwaveLink, 'line-width': 2 }, ['all', ['==', 'layer', 'link'], ['==', 'subType', 'microwave']]);
- this.addLineLayer(map, 'fibre-lines', 'lines', { 'line-color': theme.fiberLink, 'line-width': 2 }, ['all', ['==', 'layer', 'link'], ['==', 'subType', 'fibre']]);
-
- this.addLineLayer(map, 'services', 'services', { 'line-color': '#FF0000', 'line-width': 2 }, ['all', ['==', 'layer', 'service'], ['==', 'isBackup', false ]]);
- this.addLineLayer(map, 'backup-services', 'services', { 'line-color': '#FF0000', 'line-width': 2 }, ['all', ['==', 'layer', 'service'], ['==', 'isBackup', true ]], true);
-
- this.addLineLayer(map, 'selectedLineMicrowave', 'selectedLine', { 'line-color': theme.microwaveLink, 'line-width': 4 }, ['all', ['==', 'layer', 'link'], ['==', 'subType', 'microwave']]);
- this.addLineLayer(map, 'selectedLineFibre', 'selectedLine', { 'line-color': theme.fiberLink, 'line-width': 4 }, ['all', ['==', 'layer', 'link'], ['==', 'subType', 'fibre']]);
- this.addLineLayer(map, 'selectedServices', 'selectedLine', { 'line-color': '#FF0000', 'line-width': 4 }, ['==', 'layer', 'service']);
-
- // this.addCircleLayer(map, 'points', 'points', { 'circle-color': theme.site, 'circle-radius': [ 'match', ['get', 'xPonder'], 'true', 9, 7 ], 'circle-stroke-width': 1, 'circle-stroke-color':'#fff' }, ['==', 'layer', 'site']);
- this.addCircleLayer(map, 'points', 'points', { 'circle-color': theme.site, 'circle-radius': 7, 'circle-stroke-width': 1, 'circle-stroke-color':'#fff' }, ['==', 'layer', 'site']);
- this.addCircleLayer(map, 'selectedPoints', 'selectedPoints', { 'circle-color': theme.selectedSite, 'circle-radius': 9, 'circle-stroke-width': 1, 'circle-stroke-color': '#fff' }, ['==', 'layer', 'size']);
- };
-
- /**
- * Pick the correct theme based on user selection
- */
- private pickTheme = () => {
- if (this.selectedTheme !== null) {
- const result = this.availableThemes.find(el => el.key === this.selectedTheme);
- if (result)
- return result;
- }
-
- return this.availableThemes[0];
- };
-
- private removeIconLayers = (map: maplibregl.Map) => {
-
- map.removeLayer('point-building');
- map.removeLayer('point-lamps');
- map.removeLayer('point-data-center');
- map.removeLayer('point-factory');
- map.removeLayer('select-point-data-center');
- map.removeLayer('select-point-buildings');
- map.removeLayer('select-point-lamps');
- map.removeLayer('select-point-factory');
- };
-
-}
-
-const mapLayerService = new MapLayerService();
-export default mapLayerService;
-
+++ /dev/null
-/**
- * ============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 type { CircleLayerSpecification, LineLayerSpecification, Map, MapGeoJSONFeature } from 'maplibre-gl';
-
-export type CirclePaintProps = CircleLayerSpecification['paint'];
-export type CircleLayoutProps = CircleLayerSpecification['layout'];
-
-export type LinePaintProps = LineLayerSpecification['paint'];
-export type LineLayoutProps = LineLayerSpecification['layout'];
-
-import { BoundingBox } from '../model/boundingBox';
-
-const EARTHRADIUSM = 6378137;
-
-const degrees_to_radians = (degrees: number) => {
- return degrees * (Math.PI / 180);
-};
-
-const checkLatitude = (lat: number) => {
-
- if (lat > 90)
- return 90;
- else if (lat < -90)
- return -90;
- else
- return lat;
-
-};
-
-const checkLongitude = (lon: number) => {
- if (lon > 180)
- return 180;
- else if (lon < -180)
- return -180;
- else
- return lon;
-};
-
-const radians_to_degrees = (radians: number) => {
- var pi = Math.PI;
- return radians * (180 / pi);
-};
-
-export const addDistance = (south: number, west: number, north: number, east: number, distanceKm: number): BoundingBox => {
-
- const distanceInM = distanceKm * 1000;
-
- const dLat = distanceInM / EARTHRADIUSM;
- const dLon = distanceInM / (EARTHRADIUSM * Math.cos(Math.PI * (north + south) / 360));
-
- const latOffset = dLat * 180 / Math.PI;
- const lonOffset = dLon * 180 / Math.PI;
-
- const newEast = checkLongitude(east + lonOffset);
- const newWest = checkLongitude(west - lonOffset);
- const newNorth = checkLatitude(north + latOffset);
- const newSouth = checkLatitude(south - latOffset);
-
- return BoundingBox.createFromNumbers(newWest, newSouth, newEast, newNorth);
-
-};
-
-export const increaseBoundingBox = (map: Map) => {
-
- const bbox = map.getBounds();
-
- const distance = map.getCenter().distanceTo(bbox.getNorthEast()); // radius of visible area (center -> corner) (in meters)
-
- //calculate new boundingBox
- const increasedBoundingBox = addDistance(bbox.getSouth(), bbox.getWest(), bbox.getNorth(), bbox.getEast(), (distance / 1000) / 2);
- return increasedBoundingBox;
-};
-
-
-//taken from https://www.movable-type.co.uk/scripts/latlong.html
-export const calculateMidPoint = (latStart: number, lonStart: number, latEnd: number, lonEnd: number) => {
-
- const dLon = degrees_to_radians(lonEnd - lonStart);
-
- //convert to radians
- const lat1 = degrees_to_radians(latStart);
- const lat2 = degrees_to_radians(latEnd);
- const lon1 = degrees_to_radians(lonStart);
-
- const Bx = Math.cos(lat2) * Math.cos(dLon);
- const By = Math.cos(lat2) * Math.sin(dLon);
- const lat3 = Math.atan2(Math.sin(lat1) + Math.sin(lat2), Math.sqrt((Math.cos(lat1) + Bx) * (Math.cos(lat1) + Bx) + By * By));
- const lon3 = lon1 + Math.atan2(By, Math.cos(lat1) + Bx);
-
- const result = { lat: radians_to_degrees(lat3), lon: radians_to_degrees(lon3) };
-
- return result;
-};
-
-
-export const LatLonToDMS = (value: number, isLon: boolean = false) => {
- const absoluteValue = Math.abs(value);
- const d = Math.floor(absoluteValue);
- const m = Math.floor((absoluteValue - d) * 60);
- const s = (absoluteValue - d - m / 60) * 3600;
- const dms = `${d}° ${m}' ${s.toFixed(2)}"`;
-
- const sign = Math.sign(value);
-
- if (isLon) {
- return (sign === -1 || sign === -0) ? dms + ' W' : dms + ' E';
- } else {
- return (sign === -1 || sign === -0) ? dms + ' S' : dms + ' N';
- }
-};
-
-// Because features come from tiled vector data, feature geometries may be split
-// or duplicated across tile boundaries and, as a result, features may appear
-// multiple times in query results.
-
-//taken from https://docs.mapbox.com/mapbox-gl-js/example/filter-features-within-map-view/
-
-export const getUniqueFeatures = (array: MapGeoJSONFeature[], comparatorProperty: string) => {
- var existingFeatureKeys: any = {};
-
- var uniqueFeatures = array.filter(function (el) {
- if (existingFeatureKeys[el.properties![comparatorProperty]]) {
- return false;
- } else {
- existingFeatureKeys[el.properties![comparatorProperty]] = true;
- return true;
- }
- });
-
- return uniqueFeatures;
-};
-
+++ /dev/null
-{
- "extends": "../../tsconfig.json",
- "compilerOptions": {
- "outDir": "./dist",
- },
-}
+++ /dev/null
-/**
- * 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 proxyConf = require('../../proxy.conf');
-
-// 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: {
- networkMapApp: ["./pluginTransport.tsx"]
- },
-
- devtool: env === "release" ? false : "source-map",
-
- resolve: {
- extensions: [".ts", ".tsx", ".js", ".jsx"]
- },
-
- output: {
- path: distPath,
- filename: "[name].js",
- library: "networkMapApp",
- 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"
- }]
- },
- {
- test: /\.(png|gif|jpg|svg)$/,
- use: [{
- loader: 'url-loader',
- options: {
- limit: 10000,
- name: './icons/[hash].[ext]'
- }
- }]
- },
- {
- test: /\.css$/i,
- use: ["style-loader", "css-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: proxyConf,
- }
- }];
-}
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.o-ran-sc.oam-controller.parent</groupId>
+ <artifactId>oparent</artifactId>
+ <version>3.0.2-SNAPSHOT</version>
+ </parent>
+
<groupId>org.o-ran-sc.oam-controller.features.sdnr.odlux</groupId>
<artifactId>sdnr-odlux-app-performanceHistoryApp</artifactId>
<version>1.7.0-SNAPSHOT</version>
+++ /dev/null
-{
- "presets": [
- ["@babel/preset-react"],
- ["@babel/preset-env", {
- "targets": {
- "chrome": "66"
- },
- "spec": true,
- "loose": false,
- "modules": false,
- "debug": false,
- "useBuiltIns": "usage",
- "forceAllTransforms": true
- }]
- ],
- "plugins": []
-}
+++ /dev/null
-{
- "name": "@odlux/sitemanager-app",
- "version": "0.1.0",
- "description": "A react based modular UI to display network siteManager data from a database.",
- "main": "index.js",
- "scripts": {
- "start": "webpack-dev-server --env debug",
- "build": "webpack --env release --config webpack.config.js",
- "build:dev": "webpack --env debug --config webpack.config.js"
- },
- "repository": {
- "type": "git",
- "url": "https://git.mfico.de/highstreet-technologies/odlux.git"
- },
- "keywords": [
- "reactjs",
- "redux",
- "ui",
- "framework"
- ],
- "author": "Sai Neetha Phulmali",
- "license": "Apache-2.0",
- "dependencies": {
- "@emotion/react": "^11.7.0",
- "@emotion/styled": "^11.6.0",
- "@fortawesome/fontawesome-svg-core": "1.2.35",
- "@fortawesome/free-solid-svg-icons": "5.6.3",
- "@fortawesome/react-fontawesome": "0.1.14",
- "@mui/icons-material": "^5.2.0",
- "@mui/lab": "^5.0.0-alpha.58",
- "@mui/material": "^5.2.2",
- "@mui/styles": "^5.2.2",
- "@odlux/framework": "*",
- "clsx": "^1.2.1"
- },
- "peerDependencies": {
- "@types/classnames": "2.2.6",
- "@types/flux": "3.1.8",
- "@types/jquery": "3.3.10",
- "@types/react": "17.0.37",
- "@types/react-dom": "17.0.11",
- "@types/react-router-dom": "5.1.7",
- "jquery": "3.3.1",
- "react": "17.0.2",
- "react-dom": "17.0.2",
- "react-router-dom": "5.2.0"
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ ============LICENSE_START=======================================================
- ~ ONAP : SDNR ODLUX
- ~ ================================================================================
- ~ Copyright (C) 2020 AT&T 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=======================================================
- ~
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.o-ran-sc.oam-controller.features.sdnr.odlux</groupId>
- <artifactId>sdnr-odlux-app-siteManagerApp</artifactId>
- <version>1.7.0-SNAPSHOT</version>
- <packaging>jar</packaging>
-
- <name>SDNR ODLUX :: ${project.artifactId}</name>
- <licenses>
- <license>
- <name>Apache License, Version 2.0</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0</url>
- </license>
- </licenses>
-
-
- <build>
- <resources>
- <resource>
- <directory>dist</directory>
- <targetPath>odlux</targetPath>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <artifactId>maven-clean-plugin</artifactId>
- <configuration>
- <filesets>
- <fileset>
- <directory>dist</directory>
- <followSymlinks>false</followSymlinks>
- </fileset>
- <fileset>
- <directory>node</directory>
- <followSymlinks>false</followSymlinks>
- </fileset>
- <fileset>
- <directory>node_modules</directory>
- <followSymlinks>false</followSymlinks>
- </fileset>
- <fileset>
- <directory>../node_modules</directory>
- <followSymlinks>false</followSymlinks>
- </fileset>
- <!-- eclipse bug build bin folder in basedir -->
- <fileset>
- <directory>bin</directory>
- <followSymlinks>false</followSymlinks>
- </fileset>
- </filesets>
- </configuration>
- </plugin>
- <plugin>
- <groupId>de.jacks-it-lab</groupId>
- <artifactId>frontend-maven-plugin</artifactId>
- <version>1.7.2</version>
- <executions>
- <execution>
- <id>install node and yarn</id>
- <goals>
- <goal>install-node-and-yarn</goal>
- </goals>
- <!-- optional: default phase is "generate-resources" -->
- <phase>initialize</phase>
- <configuration>
- <nodeVersion>v16.17.0</nodeVersion>
- <yarnVersion>v1.22.19</yarnVersion>
- </configuration>
- </execution>
- <execution>
- <id>yarn build</id>
- <goals>
- <goal>yarn</goal>
- </goals>
- <configuration>
- <arguments>run build</arguments>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
+++ /dev/null
-/**
- * ============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 { requestRest } from '../../../../framework/src/services/restService';
-import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore';
-
-import { SITEDOC_URL } from '../config';
-import { HistoryEntry } from '../models/historyEntry';
-import { link } from '../models/link';
-import { NetworkElementConnection } from '../models/networkElementConnection';
-import { Device, Site } from '../models/site';
-import { Service } from '../models/topologyTypes';
-import dataService from '../services/dataService';
-
-
-export class SelectElementAction extends Action {
- constructor(public data: link | Site | Service) {
- super();
- }
-}
-
-export class ClearDetailsAction extends Action { }
-
-export class AddToHistoryAction extends Action {
- constructor(public entry: HistoryEntry) {
- super();
- }
-}
-
-export class ClearHistoryAction extends Action { }
-
-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 { }
-
-export class InitializeLoadedDevicesAction extends Action {
- constructor(public devices: Device[]) {
- super();
- }
-}
-
-export class IsSitedocReachableAction extends Action {
- constructor(public isReachable: boolean) {
- super();
- }
-}
-
-export const UpdateDetailsView = (nodeId: string) => (dispatcher: Dispatch, getState: () => IApplicationStoreState) => {
- const { siteManager: { 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) => {
- const { siteManager: { details: { isBusyCheckingDeviceList } } } = getState();
- if (isBusyCheckingDeviceList) return;
- dispatcher(new IsBusyCheckingDeviceListAction(true));
- const ids: string[] = list
- .filter(el => el.name && el.name.length > 0)
- .map((device) => {
- return device.name;
- });
-
- const resultData = await dataService.getAdditionalInfoOnDevices(ids);
- if (resultData) {
- resultData.forEach((data: NetworkElementConnection) => {
- const index = list.findIndex(el => { return el.name === data.id; });
- if (index !== -1) {
- list[index].status = data.status;
- list[index].type = data['device-type'];
- }
- });
- }
- dispatcher(new FinishedLoadingDeviceListAction(list));
- dispatcher(new IsBusyCheckingDeviceListAction(false));
-};
-
-export const checkSiteDockReachability = () => async (dispatcher: Dispatch) => {
- 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
+++ /dev/null
-/**
- * ============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 { PanelId } from '../models/panelId';
-
-
-export class SetPanelAction extends Action {
- constructor(public panelId: PanelId) {
- super();
- }
-}
-
-export const setPanelAction = (panelId: PanelId) => {
- return new SetPanelAction(panelId);
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { SearchSiteIdResult } from '../models/siteManager';
-import siteManagerService from '../services/siteManagerService';
-
-export class SearchValueAction extends Action {
- constructor(public siteId: string, public categoryName?: string) {
- super();
- }
-}
-
-export class SetBusyAction extends Action {
- constructor(public busy: boolean) {
- super();
- }
-}
-
-
-/**
- * Get searchTreeBySiteIdOrName
- */
-export class BaseAction extends Action { }
-
-export class LoadTreeSiteSearchBySiteIdOrNameAction extends BaseAction { }
-
-export class AllTreeSiteSearchBySiteIdOrNameLoadedAction extends BaseAction {
- constructor(public searchResult: SearchSiteIdResult) {
- super();
- }
-}
-
-export const loadTreeSiteSearchBySiteIdOrNameAsync = (searchValue: string) => async (dispatch: Dispatch) => {
- dispatch(new LoadTreeSiteSearchBySiteIdOrNameAction());
- const searchResult: SearchSiteIdResult = (await siteManagerService.getSearchSiteIDTrail(searchValue));
- dispatch(new AllTreeSiteSearchBySiteIdOrNameLoadedAction(searchResult));
- return searchResult;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { Bands, SiteConfigurationFreqPlan, SiteManagerAreas, SiteManagerCategories, SiteManagerCategoryItems, Sites, SitesListResult } from '../models/siteManager';
-import siteManagerService from '../services/siteManagerService';
-
-export class BaseAction extends Action { }
-
-export class SetBusyAction extends Action {
- constructor(public busy: boolean) {
- super();
- }
-}
-
-/**
- * Get countries
- */
-export class LoadAllCountriesAction extends BaseAction { }
-
-export class AllCountriesLoadedAction extends BaseAction {
- constructor(public countriesList: SiteManagerAreas[] | null) {
- super();
-
- }
-}
-
-export const loadAllCountriesAsync = () => async (dispatch: Dispatch) => {
- dispatch(new LoadAllCountriesAction());
- const countries: SiteManagerAreas[] = (await siteManagerService.getCountries()) || [];
- dispatch(new AllCountriesLoadedAction(countries));
- return countries;
-};
-
-/**
- * Get areaByAreaId
- */
-export class LoadAllAreasByAreaIdAction extends BaseAction { }
-
-export class AllAreasByAreaIdLoadedAction extends BaseAction {
- constructor(public areaList: SiteManagerAreas[] | null) {
- super();
-
- }
-}
-
-export const loadAllAreasByAreaIdAsync = (areaId: string) => async (dispatch: Dispatch) => {
- dispatch(new LoadAllAreasByAreaIdAction());
- const areas: SiteManagerAreas[] = (await siteManagerService.getAreasByAreaId(areaId)) || [];
- dispatch(new AllAreasByAreaIdLoadedAction(areas));
- return areas;
-};
-
-/**
- * Get sitesByAreaId
- */
-export class LoadAllSitesByAreaIdAction extends BaseAction { }
-
-export class AllSitesByAreaIdLoadedAction extends BaseAction {
- constructor(public sitesList: SitesListResult) {
- super();
-
- }
-}
-
-export const loadAllSitesByAreaIdAsync = (areaId: string) => async (dispatch: Dispatch) => {
- dispatch(new LoadAllSitesByAreaIdAction());
- const sites: SitesListResult = (await siteManagerService.getSitesByAreaId(areaId));
- dispatch(new AllSitesByAreaIdLoadedAction(sites));
- return sites;
-};
-
-
-/**
- * Get CategoriesBySiteId
- */
-export class LoadAllCategoriesBySiteIdAction extends BaseAction { }
-
-export class AllCategoriesBySiteIdALoadedAction extends BaseAction {
- constructor(public categoryList: SiteManagerCategories[] | null) {
- super();
-
- }
-}
-
-export const loadAllCategoriesBySiteIdAsync = (areaId: string) => async (dispatch: Dispatch) => {
- dispatch(new LoadAllCategoriesBySiteIdAction());
- const categories: SiteManagerCategories[] = (await siteManagerService.getCategoriesBySiteId(areaId)) || [];
- dispatch(new AllCategoriesBySiteIdALoadedAction(categories));
- return categories;
-};
-
-/**
- * Get SiteDetailsBySiteId
- */
-export class LoadAllSiteBySiteIdAction extends BaseAction { }
-
-export class AllSiteBySiteIdALoadedAction extends BaseAction {
- constructor(public siteDetails: Sites | null) {
- super();
- }
-}
-
-export const loadAllSiteBySiteIdAsync = (siteId: string) => async (dispatch: Dispatch) => {
- dispatch(new LoadAllSiteBySiteIdAction());
- const siteDetails: Sites = (await siteManagerService.getSiteBySiteId(siteId)) || [];
- dispatch(new AllSiteBySiteIdALoadedAction(siteDetails));
- return siteDetails;
-};
-
-/**
- * Get CategoryItemsBySiteIdAndCategoryName
- */
-export class LoadAllCategoryItemsBySiteIdAction extends BaseAction { }
-
-export class AllCategoryItemsBySiteIdALoadedAction extends BaseAction {
- constructor(public categoryItemList: SiteManagerCategoryItems | null) {
- super();
- }
-}
-
-export const loadAllCategoryItemsBySiteIdAsync = (siteId: string, categoryName: string) => async (dispatch: Dispatch) => {
- dispatch(new LoadAllCategoryItemsBySiteIdAction());
- const categoryItemList: SiteManagerCategoryItems = (await siteManagerService.getCategoryItemsBySiteIdAndCategoryName(siteId, categoryName)) || [];
- dispatch(new AllCategoryItemsBySiteIdALoadedAction(categoryItemList));
- return categoryItemList;
-};
-
-/**
- * Get Site frequency plan
- */
-export class LoadAllFrequencyPlanBySiteIdAction extends BaseAction { }
-
-export class AllFrequencyPlanBySiteIdALoadedAction extends BaseAction {
- constructor(public freqPlanList: SiteConfigurationFreqPlan[]) {
- super();
- }
-}
-
-export const loadAllFrequencyPlanBySiteIdAsync = (siteId: string) => async (dispatch: Dispatch) => {
- dispatch(new LoadAllFrequencyPlanBySiteIdAction());
- try {
- const freqPlan: SiteConfigurationFreqPlan[] = await siteManagerService.getSitesFrequencyPlan(siteId);
- dispatch(new AllFrequencyPlanBySiteIdALoadedAction(freqPlan));
- return freqPlan;
- } catch (error) {
- console.error('Error fetching site frequency plan:', error);
- return [];
- }
-};
-
-/**
- * Get Available Frequency bands
- */
-export class LoadAllAvailableBandsAction extends BaseAction { }
-
-export class AllAvailableBandsALoadedAction extends BaseAction {
- constructor(public bandsList: Bands[]) {
- super();
- }
-}
-
-export const loadAllAvailableBandsAsync = () => async (dispatch: Dispatch) => {
- dispatch(new LoadAllAvailableBandsAction());
- try {
- const bands: Bands[] = await siteManagerService.getAvailableBands();
- dispatch(new AllAvailableBandsALoadedAction(bands));
- return bands;
- } catch (error) {
- console.error('Error fetching bands:', error);
- return [];
- }
-};
-
-/**
- * Get All Available Site Types
- */
-export class LoadAllAvailableSiteTypesAction extends BaseAction { }
-
-export class AllAvailableSiteTypesLoadedAction extends BaseAction {
- constructor(public siteTypesList: String[]) {
- super();
- }
-}
-
-export const loadAllAvailableSiteTypesAsync = () => async (dispatch: Dispatch) => {
- dispatch(new LoadAllAvailableSiteTypesAction());
- try {
- const siteTypes: String[] = await siteManagerService.getAvailableSiteTypes();
- dispatch(new AllAvailableSiteTypesLoadedAction(siteTypes));
- return siteTypes;
- } catch (error) {
- console.error('Error fetching site types:', error);
- return [];
- }
-};
-
+++ /dev/null
-/**
- * ============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 { Action } from '../../../../framework/src/flux/action';
-import { Dispatch } from '../../../../framework/src/flux/store';
-
-import { SitedocOrderTask, UserListItem } from '../models/siteDocTypes';
-import sitedocDataService from '../services/sitedocDataService';
-
-
-export class SetAllUsersAction extends Action {
- constructor(public users: UserListItem[]) {
- super();
- }
-}
-
-export class SetTSSRAction extends Action {
- constructor(public isTSSR: boolean) {
- super();
- }
-}
-
-export class UpdateNoteAction extends Action {
- constructor(public note: string) {
- super();
- }
-}
-
-export class UpdateStateAction extends Action {
- constructor(public state: string) {
- super();
- }
-}
-
-export class UpdateTasks extends Action {
- constructor(public tasks: SitedocOrderTask[]) {
- super();
- }
-}
-
-export class ResetAction extends Action { }
-
-export class SelectUserAction extends Action {
- constructor(public user: string) {
- super();
- }
-}
-
-export class SetSiteExists extends Action {
- constructor(public exists: boolean) {
- super();
- }
-}
-
-export const getUsersAction = async (dispatcher: Dispatch) => {
- const users = await sitedocDataService.getAllUsers();
- dispatcher(new SetAllUsersAction(users));
-};
-
-
-export class BaseAction extends Action { }
-
-export class LoadAllSiteDetailsBySiteIdAction extends BaseAction { }
-
-export class AllSiteDetailsBySiteIdALoadedAction extends BaseAction {
- constructor(public siteDetailsList: any | null) {
- super();
- }
-}
-
-export const loadAllSiteDetailsBySiteIdAsync = (siteId: string) => async (dispatch: Dispatch) => {
- dispatch(new LoadAllSiteDetailsBySiteIdAction());
- const siteDetailsList: any = (await sitedocDataService.getSiteDetails(siteId));
- dispatch(new AllSiteDetailsBySiteIdALoadedAction(siteDetailsList));
- return siteDetailsList;
-};
-
-
+++ /dev/null
-<!-- highstreet technologies GmbH colour scheme \r
- Grey #565656\r
- LBlue #36A9E1\r
- DBlue #246DA2\r
- Green #003F2C / #006C4B\r
- Yellw #C8D400\r
- Red #D81036\r
--->\r
-\r
-<svg version="1.1" viewBox="13 0 76 76" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\r
-\r
-<g>\r
-<path fill="#565656" d="M52.7,19.1H19.9v53.2h32.8V19.1z M34.7,62.2h-3.4v-6.2h3.4V62.2z M34.7,49.7h-3.4v-6.2h3.4V49.7z M34.7,37.3h-3.4v-6.2h3.4 V37.3z M45,62.2h-3.4v-6.2H45V62.2z M45,49.7h-3.4v-6.2H45V49.7z M45,37.3h-3.4v-6.2H45V37.3z"/>\r
-\r
-<path fill="#565656" d="M75.2,65.6V40.9l-19.7,0v31.4h13C72.2,72.3,75.2,69.3,75.2,65.6z M67.6,62.3H61V59h6.6V62.3z M67.6,54H61v-3.4h6.6V54z"/>\r
-</g>\r
-\r
-<g transform="translate(20,-33) scale(0.03,0.03)">\r
-<!--path fill="#565656" d="M 1077 1826 C 1028 1808 1013 1794 989 1749 C 968 1706 965 1665 980 1624 L 745 859 L 512 144 C 491 54 520 53 525 53 L 708 50 L 745 178 L 782 290 L 1130 290 L 1478 290 L 1520 166 L 1561 42 L 1729 42 C 1746 43 1762 43 1741 132 L 1516 858 C 1302 1499 1271 1601 1280 1624 C 1296 1667 1292 1712 1267 1754 C 1229 1822 1149 1852 1077 1826 Z M 1195 1144 C 1228 1042 1256 952 1258 944 C 1261 932 1239 930 1130 930 C 1021 930 999 932 1002 944 C 1011 984 1126 1329 1130 1329 C 1133 1329 1162 1246 1195 1144 Z M 1371 615 C 1390 557 1404 508 1402 505 C 1395 499 865 499 858 505 C 856 508 870 557 889 615 L 925 720 L 1130 720 L 1335 720 L 1371 615 Z"/!-->\r
-\r
-<!--path fill="#006C4B" d="M471 2219 c-64 -80 -133 -212 -161 -309 -31 -107 -38 -289 -15 -401\r
-29 -146 119 -324 204 -404 l31 -29 70 69 c39 38 70 73 70 78 0 5 -16 28 -36\r
-50 -51 60 -112 189 -130 277 -20 94 -14 219 16 315 28 89 47 126 106 204 l47\r
-63 -75 75 -75 75 -52 -63z"/!-->\r
-\r
-<path fill="#006C4B" d="M1660 2205 l-73 -73 48 -64 c115 -152 158 -340 120 -523 -17 -83 -79\r
--214 -129 -272 -20 -22 -36 -45 -36 -50 0 -5 31 -40 70 -78 l70 -69 31 29 c46\r
-43 122 163 157 247 48 116 65 221 59 362 -8 186 -62 337 -171 482 -70 94 -62\r
-93 -146 9z"/>\r
-\r
-<!--path fill="#006C4B" d="M712 2007 c-75 -93 -112 -203 -112 -332 0 -129 44 -252 120 -337 l35\r
--39 73 74 74 74 -31 44 c-43 58 -65 138 -58 209 5 64 37 143 69 178 l22 23\r
--74 74 c-41 41 -77 75 -80 74 -3 0 -20 -19 -38 -42z"/!-->\r
-\r
-<path fill="#006C4B" d="M1430 1975 l-74 -74 22 -23 c32 -35 64 -114 69 -178 7 -71 -15 -151\r
--58 -209 l-31 -44 74 -74 73 -74 37 41 c75 84 118 205 118 335 0 96 -20 178\r
--61 254 -25 47 -81 121 -92 121 -1 0 -36 -34 -77 -75z"/>\r
-\r
-</g>\r
-</svg>
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React from 'react';
-
-import { Button, Checkbox, FormControl, FormControlLabel, FormGroup, FormHelperText, InputLabel, MenuItem, Select, TextField, Typography } from '@mui/material';
-import Dialog from '@mui/material/Dialog';
-import DialogActions from '@mui/material/DialogActions';
-import DialogContent from '@mui/material/DialogContent';
-import DialogTitle from '@mui/material/DialogTitle';
-import { RouteComponentProps, withRouter } from 'react-router-dom';
-
-import { useApplicationDispatch, useSelectApplicationState } from '../../../../framework/src/flux/connect';
-import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore';
-
-import { ResetAction, SelectUserAction, SetTSSRAction, UpdateNoteAction, UpdateTasks } from '../actions/sitedocManagementAction';
-import { SitedocOrder, SitedocOrderTask } from '../models/siteDocTypes';
-import sitedocDataService from '../services/sitedocDataService';
-import OrderTask from './orderTask';
-
-type orderProps = RouteComponentProps & {
- siteId: string;
- onClose: (siteId: string) => void;
- onError: () => void;
-};
-
-const NewOrder = (props: orderProps) => {
- const users = useSelectApplicationState((state: IApplicationStoreState) => state.siteManager.sitedocManagement.users);
- const selectedUser = useSelectApplicationState((state: IApplicationStoreState) => state.siteManager.sitedocManagement.selectedUser);
- const isTssr = useSelectApplicationState((state: IApplicationStoreState) => state.siteManager.sitedocManagement.isTSSR);
- const tasks = useSelectApplicationState((state: IApplicationStoreState) => state.siteManager.sitedocManagement.tasks);
- const note = useSelectApplicationState((state: IApplicationStoreState) => state.siteManager.sitedocManagement.note);
- const site = useSelectApplicationState((state: IApplicationStoreState) => state.siteManager.details.data);
-
- const dispatch = useApplicationDispatch();
- const selectUserAction = (user: string) => dispatch(new SelectUserAction(user));
- const checkTSSR = (value: boolean) => dispatch(new SetTSSRAction(value));
- const updateNote = (noteUpdate: string) => dispatch(new UpdateNoteAction(noteUpdate));
- const setTasks = (addTasks: SitedocOrderTask[]) => dispatch(new UpdateTasks(addTasks));
- const reset = () => dispatch(new ResetAction());
-
- const emptyTask: SitedocOrderTask = { type: '', description: '', completed: false };
- const [isUsernameEmpty, setUsernameEmpty] = React.useState(false);
- const [areTasksEmpty, setTasksEmpty] = React.useState<{ error: boolean }[]>([]);
- const [orderInfoMessage, setOrderInfoMessage] = React.useState<{ message: string; error: boolean }>({ message: '', error: false });
- const splitSiteIdSelected = props.siteId.toString();
- let siteIdSelectedToCreateOrder = splitSiteIdSelected.split('#')[0];
-
- React.useEffect(() => {
- const taskErrors = tasks.map(() => { return { error: false }; });
- setTasksEmpty(taskErrors);
- }, []);
-
- const addTaskButtonClicked = (e: any) => {
- e.preventDefault();
- setTasks([...tasks, emptyTask]);
- setTasksEmpty([...areTasksEmpty, { error: false }]);
- };
-
- const update = (property: string, index: number, newValue: string) => {
- let items = [...tasks];
- let item = { ...items[index] } as any;
- item[property] = newValue;
- items[index] = item;
- setTasks(items);
- //clean error
- if (items[index].description.length > 0 && items[index].type.length > 0) {
- let errors = [...areTasksEmpty];
- errors[index] = { error: false };
- setTasksEmpty(errors);
- }
- };
-
- const updateTaskType = (index: number, value: string) => {
- update('type', index, value);
- };
-
- const updateTaskDescription = (index: number, value: string) => {
- update('description', index, value);
- };
-
- const onReset = () => {
- reset();
- };
-
- const checkTasks = (orderTasks: SitedocOrderTask[]) => {
- let empty: number[] = [];
- orderTasks.forEach((el, i) => {
- if (el.description.length == 0 || el.type.length == 0)
- empty.push(i);
- });
-
- return empty;
- };
-
- const createOrder = () => {
- const emptyTasks = checkTasks(tasks);
- let areParamsEmpty = false;
- if (selectedUser.length == 0) {
- setUsernameEmpty(true);
- areParamsEmpty = true;
- }
-
- if (emptyTasks.length > 0) {
- let orderTasks = areTasksEmpty;
- //clean errors
- orderTasks = tasks.map(() => { return { error: false }; });
- //set errors
- emptyTasks.forEach(el => {
- orderTasks[el] = { error: true };
- });
- setTasksEmpty(orderTasks);
- areParamsEmpty = true;
- }
-
- if (!areParamsEmpty) {
- setUsernameEmpty(false);
- setTasksEmpty([]);
- //remove possible milliseconds
- const datetime = new Date().toJSON().split('.')[0] + 'Z';
- let newOrder: SitedocOrder = {
- tasks: tasks,
- state: 'OPEN',
- assignedUser: selectedUser,
- reportFile: '',
- note: note,
- date: datetime,
- isTssr: isTssr,
- };
- sitedocDataService.createOrder(newOrder, siteIdSelectedToCreateOrder)
- .then((res) => {
- //display message
- if (!res.serverError) {
- setOrderInfoMessage(res);
- }
- });
- }
- };
-
- const onClose = (siteId: string) => {
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions
- props.onClose && props.onClose(siteId);
- };
-
- const onError = () => {
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions
- props.onError && props.onError();
- };
-
- const name = site?.name;
-
- return <>
- <Dialog fullWidth open={true} >
- <DialogTitle>TSS-Report Order</DialogTitle>
- <DialogContent>
- <div>
- <span>Create order for site</span> <span>{siteIdSelectedToCreateOrder}</span><span>{name && name.length > 0 && ' | ' + name}</span>
- <FormControl style={{ marginTop: '20px' }} fullWidth variant='standard' error={isUsernameEmpty}>
- <InputLabel id='assign-user-label-siteManager'>Assign to User</InputLabel>
- <Select
- variant='standard'
- fullWidth
- labelId='assign-user-label-siteManager'
- aria-label='assign-user'
- value={selectedUser}
- onChange={(e) => { selectUserAction(e.target.value as string); setUsernameEmpty(false); }}
- label='Assign to User'>
- {
- users.map((el) => {
- return <MenuItem aria-label={el.userName} value={el.userName}>{`${el.lastName}, ${el.firstName}`}</MenuItem>;
- })
- }
- </Select>
- {
- isUsernameEmpty && <FormHelperText>User cannot be empty</FormHelperText>
- }
- </FormControl>
- <FormGroup style={{ marginTop: '20px' }} >
- <FormControlLabel control={<Checkbox aria-label='site-manager-isTSSRCheckbox' color='secondary' checked={isTssr}
- onChange={() => checkTSSR(!isTssr)} />} label='Is TSSR' />
- </FormGroup>
-
- <div>
- {
- tasks.map((el, index) => {
- return <OrderTask error={areTasksEmpty[index]?.error} value={el} onDescUpdate={(e) => { updateTaskDescription(index, e); }}
- onTypeUpdate={(e) => { updateTaskType(index, e); }} />;
- })
- }
- <DialogActions>
- <Button onClick={addTaskButtonClicked} aria-label='add-new-task' component='span' color='secondary'>
- ADD TASK
- </Button>
- </DialogActions>
- <TextField
- aria-label='add-note'
- variant='standard'
- multiline
- fullWidth
- value={note}
- onChange={e => { updateNote(e.target.value as string); }}
- label='Add Note' ></TextField>
- </div>
- <div style={{ marginTop: '20px' }} >
- {
- orderInfoMessage.message.length > 0 && (!orderInfoMessage.error) &&
- <Typography aria-label='site-manager-order-creation-message' style={{ marginTop: 10 }} color={'green'}
- variant='body1'>{orderInfoMessage.message}</Typography>
- }
- {
- orderInfoMessage.message.length > 0 && orderInfoMessage.error &&
- <>
- <Dialog open={true}>
- <DialogTitle>Error in Order Creation </DialogTitle>
- <DialogContent aria-label='site-manager-order-creation-error-message' > {orderInfoMessage.message}
- </DialogContent>
- <DialogActions>
- <Button color='secondary' onClick={onError}>OK</Button>
- </DialogActions>
- </Dialog>
- </>
- }
- </div>
- </div>
- </DialogContent>
- <DialogActions style={{ marginTop: '30px' }} >
- <Button aria-label='create-order-button' color='secondary' onClick={e => { e.preventDefault(); createOrder(); }}>CREATE ORDER</Button>
- <Button aria-label='reset-button' color='secondary' onClick={e => { e.preventDefault(); onReset(); }} >RESET</Button>
- <Button aria-label='close-button' color='secondary' onClick={e => { e.preventDefault(); onClose(siteIdSelectedToCreateOrder); }}>CLOSE</Button>
- </DialogActions>
- </Dialog>
- </>;
-};
-
-const CreateNewOrder = withRouter(NewOrder);
-
-export default CreateNewOrder;
+++ /dev/null
-/**
- * ============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 React, { FC, MouseEvent } from 'react';
-
-import Paper from '@mui/material/Paper';
-import Table from '@mui/material/Table';
-import TableBody from '@mui/material/TableBody';
-import TableCell from '@mui/material/TableCell';
-import TableHead from '@mui/material/TableHead';
-import TableRow from '@mui/material/TableRow';
-import makeStyles from '@mui/styles/makeStyles';
-
-const useStyles = makeStyles({
- denseTable: {
- borderRadius: '0px',
- },
- button: {
- margin: 0,
- padding: '6px 6px',
- minWidth: 'unset',
- },
-});
-
-type DenseTableProps = {
- actions?: boolean;
- headers: string[];
- height: number;
- hover: boolean;
- ariaLabelRow: string;
- ariaLabelColumn?: string[];
- verticalTable?: boolean;
- onLinkClick?(id: string): void; data: any[];
- onClick?(id: string): void;
-};
-
-const DenseTable: FC<DenseTableProps> = (props) => {
- const {
- ariaLabelRow,
- data,
- headers,
- height,
- hover,
- ariaLabelColumn,
- onClick = () => undefined,
- verticalTable,
- } = props;
-
- const styles = useStyles();
-
- const handleClick = (event: MouseEvent<HTMLDivElement>, id: string) => {
- event.preventDefault();
- onClick(id);
- };
-
- return (
- <Paper className={styles.denseTable}>
- <div style={{ height: height, overflow: 'auto' }}>
- <Table padding="normal" stickyHeader aria-label="table" >
- <TableHead color='#fafafa' >
- <TableRow>
- {
- headers.map((tableHeader) => (<TableCell>{tableHeader}</TableCell>))
- }
- </TableRow>
- </TableHead>
- <TableBody>
- {data.map((row, index) => {
-
- const values = (typeof row === 'string' || row instanceof String) ? [row] : Object.keys(row).map(function (e) { return row[e]; });
-
- return (
- <TableRow aria-label={ariaLabelRow} key={index} hover={hover} onClick={e => handleClick(e, row.name)}>
- {
- values.map((value, i) => {
- if (value !== undefined) {
-
- if (!verticalTable) {
- const ariaLabel = ariaLabelColumn === undefined ? headers[i].toLowerCase() : ariaLabelColumn[i];
- if (ariaLabel.length > 0) {
- return <TableCell aria-label={ariaLabel}>{value}</TableCell>;
- } else {
- return <TableCell>{value}</TableCell>;
- }
- } else {
- // skip adding aria label to 'header' column
- if (i === 0) {
- return <TableCell>{value}</TableCell>;
- } else {
- const ariaLabel = props.ariaLabelColumn === undefined ? props.headers[index].toLowerCase() : props.ariaLabelColumn[index];
- return <TableCell aria-label={ariaLabel}>{value}</TableCell>;
- }
- }
- } else
- return null;
- })
- }
- </TableRow>);
- })
- }
- </TableBody>
- </Table>
- </div>
- </Paper>
- );
-};
-
-DenseTable.displayName = 'DenseTable';
-
-export default DenseTable;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React, { useEffect } from 'react';
-import { ColumnType, MaterialTable, MaterialTableCtorType } from '../../../../framework/src/components/material-table';
-import { useApplicationDispatch, useSelectApplicationState } from '../../../../framework/src/flux/connect';
-import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore';
-import { createDeviceTableActions, createDeviceTablePreActions, createDeviceTableProperties } from '../handlers/deviceTableHandler';
-
-const DeviceTable = MaterialTable as MaterialTableCtorType<any>;
-
-type DeviceTableComponentProps = {
- preFilterType: {
- id: string;
- };
-};
-
-const DeviceTableComponent: React.FC<DeviceTableComponentProps> = (props) => {
-
- const deviceTableProperties = useSelectApplicationState((state: IApplicationStoreState) => createDeviceTableProperties(state));
-
- const dispatch = useApplicationDispatch();
- const deviceTableActions = createDeviceTableActions(dispatch);
- const deviceTablePreActions = createDeviceTablePreActions(dispatch);
-
- useEffect(() => {
- const tablePreFilter = {
- 'siteId': props.preFilterType.id,
- };
- deviceTableActions.onClearFilters();
- deviceTablePreActions.onPreFilterChanged(tablePreFilter);
- }, [props.preFilterType.id]);
-
-
- return (
- <>
- <DeviceTable stickyHeader tableId='device-table' columns={[
- { property: 'nodeId', title: 'Node ID', type: ColumnType.text },
- { property: 'id', title: 'Id', type: ColumnType.numeric },
- { property: 'areaId', title: 'Area Id', type: ColumnType.text },
- { property: 'areaName', title: 'Area Name', type: ColumnType.text },
- { property: 'siteId', title: 'Site ID', type: ColumnType.text },
- { property: 'siteName', title: 'Site Name', type: ColumnType.text },
- ]} idProperty='id' {...deviceTableActions} {...deviceTableProperties} >
- </DeviceTable>
- </>
- );
-};
-
-export const DeviceTableView = DeviceTableComponent;
-export default DeviceTableView;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React, { useEffect } from 'react';
-
-import { MaterialTable, MaterialTableCtorType, ColumnType } from '../../../../framework/src/components/material-table';
-import { useApplicationDispatch, useSelectApplicationState } from '../../../../framework/src/flux/connect';
-import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore';
-import { createLinkTableActions, createLinkTablePreActions, createLinkTableProperties } from '../handlers/linkTableHandler';
-
-const LinkTable = MaterialTable as MaterialTableCtorType<any>;
-
-type LinkTableComponentProps = {
- preFilterType: {
- id: string;
- type: string;
- };
-};
-
-const LinkTableView: React.FC<LinkTableComponentProps> = (props) => {
- const linkTableProperties = useSelectApplicationState((state: IApplicationStoreState) => createLinkTableProperties(state));
-
- const dispatch = useApplicationDispatch();
- const linkTableActions = createLinkTableActions(dispatch);
- const linkTablePreActions = createLinkTablePreActions(dispatch);
-
- useEffect(() => {
- const tablePreFilter = {
- 'siteId': props.preFilterType.id,
- type: props.preFilterType.type,
- };
- linkTableActions.onClearFilters();
- linkTablePreActions.onPreFilterChanged(tablePreFilter);
- }, [props.preFilterType.id, props.preFilterType.type]);
-
- return (
- <>
- <LinkTable stickyHeader tableId='link-table' columns={[
- { property: 'id', title: 'Id', type: ColumnType.numeric },
- { property: 'type', title: 'Link Type', type: ColumnType.text },
- {
- property: 'siteA', title: 'SiteA', type: ColumnType.custom, customControl: ({ rowData }) => {
- return (
- <div>
- {rowData.siteA.id}
- </div>
- );
- },
- },
- {
- property: 'siteB', title: 'SiteB', type: ColumnType.custom, customControl: ({ rowData }) => {
- return (
- <div>
- {rowData.siteB.id}
- </div>
- );
- },
- },
- { property: 'operationalState', title: 'operational State', type: ColumnType.text },
- { property: 'operatorId', title: 'Operator Id', type: ColumnType.text },
- { property: 'lifecycleState', title: 'life Cycle State', type: ColumnType.text },
- ]} idProperty='id' {...linkTableActions} {...linkTableProperties} >
- </LinkTable>
- </>
- );
-};
-
-export default LinkTableView;
+++ /dev/null
-/**
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt odlux
- * =================================================================================================
- * Copyright (C) 2022 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 { DialogContentText } from '@mui/material';
-import Button from '@mui/material/Button';
-import Dialog from '@mui/material/Dialog';
-import DialogActions from '@mui/material/DialogActions';
-import DialogContent from '@mui/material/DialogContent';
-
-type MessageDialogComponentProps = {
- dialogMessage: string;
- isFromSearch: boolean;
- onClose: (event: React.SyntheticEvent, isFromSearch: boolean) => void;
- openDialog: boolean;
- setOpenDialog: any;
-};
-
-export const MessageDialog = (props: MessageDialogComponentProps) => {
- const handleDialogClose = (event: React.SyntheticEvent) => {
- props.setOpenDialog(false);
- props.onClose(event, props.isFromSearch);
- };
-
- return (
- <Dialog open={props.openDialog} onClose={handleDialogClose}>
- <DialogContent>
- <DialogContentText id='alert-dialog-description'>
- Server Error: {props.dialogMessage}
- </DialogContentText>
- <Button style={{ marginTop: '20px' }} variant='contained' color='primary'
- onClick={handleDialogClose}>Ok</Button>
- </DialogContent>
- <DialogActions>
- </DialogActions>
- </Dialog>
- );
-};
+++ /dev/null
-/**
- * ============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 * as React from 'react';
-import { FormControl, FormHelperText, InputLabel, MenuItem, Select, Stack, TextField } from '@mui/material';
-
-import { SitedocOrderTask } from '../models/siteDocTypes';
-
-type taskProps = { value: SitedocOrderTask; onDescUpdate(val: string): void; onTypeUpdate(val: string): void; error: boolean };
-
-const Task = (props: taskProps) => {
- const [orderTypes] = React.useState(['UPDATE', 'DELETE']);
-
- return <>
- <Stack style={{ marginBottom: '15px' }}>
- <FormControl style={{ marginTop: '20px', marginBottom: '20px' }} fullWidth variant='standard' error={props.error}>
- <InputLabel id='task-type-label-site-manager'>Task Type</InputLabel>
- <Select
- fullWidth
- aria-label='select-task-type'
- variant='standard'
- labelId='task-type-label-site-manager'
- label={'Task Type'}
- value={props.value.type}
- onChange={(e) => { props.onTypeUpdate(e.target.value as string); }}>
- <MenuItem aria-label='none-value' value={''}>None</MenuItem>
- {
- orderTypes.map(el => {
- return <MenuItem aria-label={el} value={el}>{el}</MenuItem>;
- })
- }
- </Select>
- </FormControl>
- <TextField fullWidth aria-label='task-description' error={props.error} multiline variant='standard' label={'Task Description'}
- value={props.value.description} onChange={e => { props.onDescUpdate(e.target.value); }}></TextField>
- {
- props.error && <FormHelperText error={props.error}>Cannot be empty</FormHelperText>
- }
- </Stack>
- </>;
-};
-
-const OrderTask = Task;
-
-export default OrderTask;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React, { useState } from 'react';
-
-import { faDownload } from '@fortawesome/free-solid-svg-icons';
-import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import IconButton from '@mui/material/IconButton';
-import makeStyles from '@mui/styles/makeStyles';
-
-import { ColumnType, MaterialTable, MaterialTableCtorType } from '../../../../framework/src/components/material-table';
-
-const useStyles = makeStyles({
- root: {
- '&:hover': {
- color: 'blue',
- },
- },
- previewImage: {
- cursor: 'pointer',
- height: 120,
- width: 120,
- marginTop: '10px',
- marginLeft: '10px',
- },
-});
-
-const Pictures = MaterialTable as MaterialTableCtorType<any>;
-
-type PicturesComponentProps = {
- item: {
- name: string;
- url: string;
- 'last-update': string;
- }[];
-};
-
-type SiteManagerPicturesComponentProps = PicturesComponentProps;
-
-const PicturesViewComponent: React.FC<SiteManagerPicturesComponentProps> = (props: SiteManagerPicturesComponentProps) => {
- const [item] = useState(props.item);
-
- const classes = useStyles();
-
- const downloadPicture = (url: string) => {
- let fileName = url.substring(
- url.lastIndexOf('/') + 1,
- url.lastIndexOf('.'),
- );
- fetch(url)
- .then(response => {
- response.arrayBuffer().then(function (buffer) {
- const reportUrl = window.URL.createObjectURL(new Blob([buffer]));
- const link = document.createElement('a');
- link.href = reportUrl;
- link.setAttribute('download', fileName + '.jpg');
- document.body.appendChild(link);
- link.click();
- });
- })
- .catch(() => alert('oh no! something went wrong'));
- };
-
- return (
- <>
- <Pictures stickyHeader tableId='device-table' columns={[
- {
- property: 'name', title: 'Name', type: ColumnType.custom, customControl: ({ rowData }) => {
- if (rowData.url === '') {
- return (<>{rowData.name} </>);
- } else {
- return (<a href={rowData.url} target='_blank' > {rowData.name} </a>);
- }
- },
- },
- {
- property: 'preview', title: 'Photo Preview', type: ColumnType.custom, customControl: ({ rowData }) => {
- return <img className={classes.previewImage} src={rowData.url} alt="Preview" />;
- },
- },
- {
- property: 'url', title: 'Action', type: ColumnType.custom, customControl: ({ rowData }) => {
- if (rowData.url === '') {
- return (<IconButton disabled> <FontAwesomeIcon icon={faDownload} /> </IconButton>);
- } else {
- return (
- <FontAwesomeIcon icon={faDownload} className={classes.root} onClick={(event) => { event.stopPropagation(); downloadPicture(rowData.url); }} />
- );
- }
- },
- },
- ]} idProperty='id' rows={item} >
- </Pictures>
- </>
- );
-};
-
-export const PicturesView = PicturesViewComponent;
-export default PicturesView;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React from 'react';
-
-import Button from '@mui/material/Button';
-import Dialog from '@mui/material/Dialog';
-import DialogActions from '@mui/material/DialogActions';
-import DialogContent from '@mui/material/DialogContent';
-import DialogContentText from '@mui/material/DialogContentText';
-import DialogTitle from '@mui/material/DialogTitle';
-
-import { useApplicationDispatch } from '../../../../framework/src/flux/connect';
-
-import { siteTableReloadAction } from '../handlers/siteTableHandler';
-
-export enum RefreshSiteTableDialogMode {
- None = 'none',
- RefreshSiteTableTable = 'RefreshSiteTableTable',
-}
-
-type DialogSettings = {
- dialogTitle: string;
- dialogDescription: string;
- applyButtonText: string;
- cancelButtonText: string;
- enableMountIdEditor: boolean;
- enableUsernameEditor: boolean;
- enableExtendedEditor: boolean;
-};
-
-const settings: { [key: string]: DialogSettings } = {
- [RefreshSiteTableDialogMode.None]: {
- dialogTitle: '',
- dialogDescription: '',
- applyButtonText: '',
- cancelButtonText: '',
- enableMountIdEditor: false,
- enableUsernameEditor: false,
- enableExtendedEditor: false,
- },
- [RefreshSiteTableDialogMode.RefreshSiteTableTable]: {
- dialogTitle: 'Do you want to refresh the Site table?',
- dialogDescription: '',
- applyButtonText: 'Yes',
- cancelButtonText: 'Cancel',
- enableMountIdEditor: true,
- enableUsernameEditor: true,
- enableExtendedEditor: true,
- },
-};
-
-type RefreshSiteTableDialogComponentProps = {
- mode: RefreshSiteTableDialogMode;
- onClose: () => void;
-};
-
-const RefreshSiteTableDialogComponent: React.FC<RefreshSiteTableDialogComponentProps> = (props) => {
-
- const dispatch = useApplicationDispatch();
- const refreshSiteTable = () => dispatch(siteTableReloadAction);
-
- const setting = settings[props.mode];
- const onRefresh = () => {
- refreshSiteTable();
- props.onClose();
- };
-
- const onCancel = () => {
- props.onClose();
- };
-
- return (
- <Dialog open={props.mode !== RefreshSiteTableDialogMode.None}>
- <DialogTitle id='form-dialog-title' aria-label={`${setting.dialogTitle.replace(/ /g, '-').toLowerCase()}-dialog`}>{setting.dialogTitle}</DialogTitle>
- <DialogContent>
- <DialogContentText>
- {setting.dialogDescription}
- </DialogContentText>
- </DialogContent>
- <DialogActions>
- <Button aria-label='dialog-confirm-button' onClick={onRefresh} color='inherit' > {setting.applyButtonText} </Button>
- <Button aria-label='dialog-cancel-button' onClick={onCancel} color='secondary'> {setting.cancelButtonText} </Button>
- </DialogActions>
- </Dialog>
- );
-};
-
-export const RefreshSiteTableDialog = RefreshSiteTableDialogComponent;
-export default RefreshSiteTableDialog;
+++ /dev/null
-/**
- * ============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 React, { FC, SyntheticEvent, useEffect, useState } from 'react';
-
-import { AppBar, Tab, Tabs, Typography } from '@mui/material';
-
-import StadokSite from '../models/stadokSite';
-import DenseTable from './denseTable';
-
-type StadokDetailsProps = { siteId: string };
-
-const SiteAdditionalInformation: FC<StadokDetailsProps> = (props) => {
-
- const [currentTab, setCurrentTab] = useState('contacts');
- const [data, setData] = useState<StadokSite | null>(null);
-
- useEffect(() => {
- const fetchData = async (siteId: string) => {
- const response = await fetch('/sitedoc/site/' + siteId);
- const result = await response.json();
- setData(result);
- };
-
- fetchData(props.siteId);
- }, [props.siteId]);
-
-
- const getContacts = (site: StadokSite | null) => {
- const contacts = [];
- if (site?.createdBy) {
- contacts.push({
- h: 'Site Creator', col1: site?.createdBy.firstName, col2: site?.createdBy.lastName,
- col3: site?.createdBy.email, col4: site?.createdBy.telephoneNumber,
- });
- }
- if (site?.contacts?.manager) {
- contacts.push({
- h: 'Manager', col1: site?.contacts.manager.firstName, col2: site?.contacts.manager.lastName,
- col3: site?.contacts.manager.email, col4: site?.contacts.manager.telephoneNumber,
- });
- }
- if (site?.contacts?.owner) {
- contacts.push({
- h: 'Owner', col1: site?.contacts.owner.firstName, col2: site?.contacts.owner.lastName,
- col3: site?.contacts.owner.email, col4: site?.contacts.owner.telephoneNumber,
- });
- }
- return contacts;
- };
-
- const handleTabChange = (event: SyntheticEvent, newValue: string) => {
- setCurrentTab(newValue);
- };
- const contacts = getContacts(data);
-
-
- return (
- <div style={{ display: 'flex', flexDirection: 'row', flexGrow: 1 }}>
- <div style={{ width: '100%', display: 'flex', flexDirection: 'column' }}>
- <AppBar enableColorOnDark position="static" style={{ marginTop: '5px', background: 'white' }}>
- <Tabs indicatorColor="secondary" textColor="inherit"
- id="site-tabs"
- variant="scrollable"
- scrollButtons
- value={currentTab}
- onChange={handleTabChange}
- aria-label="information-tabs"
- allowScrollButtonsMobile>
- <Tab label="Contacts" value="contacts" />
- <Tab label="Safety" value="safetyInfo" />
- <Tab label="Logs" value="logs" />
- </Tabs>
- </AppBar>
- {
- currentTab == 'contacts' && (contacts.length > 0 ?
- <DenseTable data={contacts} height={300} headers={['Person', 'FirstName', 'LastName', 'Email', 'Phone No.']} hover={false}
- ariaLabelRow="contacts-table" ariaLabelColumn={['person', 'firstName', 'lastName', 'email', 'phoneNo']} />
- :
- <div style={{ height: 300 }}>
- <Typography variant="body1" style={{ marginTop: '10px' }}>
- No contacts available
- </Typography>
- </div>)
- }
- {
- currentTab == 'safetyInfo' && (data && data?.safetyNotices?.length > 0
- ? (
- <DenseTable data={data?.safetyNotices} height={300} headers={['Note']} hover={false} ariaLabelRow="safety-info-table" />
- )
- : (
- <div style={{ height: 300 }}>
- <Typography variant="body1" style={{ marginTop: '10px' }}>
- No safety notices applicable
- </Typography>
- </div>
- ))
- }
- {
- currentTab == 'logs' && (data && data?.logs?.length > 0
- ? (
- <DenseTable data={data?.logs} height={300} headers={['Date', 'Person', 'Activity']} hover={false} ariaLabelRow="activity-log-table" />
- )
- : (
- <div style={{ height: 300 }}>
- <Typography variant="body1" style={{ marginTop: '10px' }}>
- No activity log available
- </Typography>
- </div>
- )
- )
- }
- </div>
- </div>
-
-
- );
-
-};
-
-export default SiteAdditionalInformation;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React, { useEffect, useState } from 'react';
-
-import AddIcon from '@mui/icons-material/Add';
-import { Button, Dialog, DialogActions, DialogContent, DialogContentText, FormControl, InputLabel, MenuItem, Select, TextField, Typography } from '@mui/material';
-import CircularProgress from '@mui/material/CircularProgress';
-
-import { ColumnType, MaterialTable, MaterialTableCtorType } from '../../../../framework/src/components/material-table';
-import { useApplicationDispatch } from '../../../../framework/src/flux/connect';
-
-import { loadAllAvailableBandsAsync, loadAllFrequencyPlanBySiteIdAsync } from '../actions/siteManagerTreeActions';
-import { addEditSiteConfig } from '../models/siteManager';
-import siteManagerService from '../services/siteManagerService';
-
-const SiteConfiguration = MaterialTable as MaterialTableCtorType<any>;
-
-
-type SiteConfigurationProps = {
- siteId: string;
-};
-
-interface SiteConfigTableData {
- band: string;
- bandId: number;
- status: string;
- configuration: string;
- comment: string;
-}
-
-interface AvailableBands {
- keyId: number;
- name: string;
- duplexSpacingMhz: number;
-}
-
-const SiteConfigurationComponent: React.FC<SiteConfigurationProps> = (props: SiteConfigurationProps) => {
-
- const dispatch = useApplicationDispatch();
- const getSiteFrequencyPlan = async (siteId: string) => dispatch(loadAllFrequencyPlanBySiteIdAsync(siteId));
- const getAllAvailableBands = async () => dispatch(loadAllAvailableBandsAsync());
-
- const [siteConfigTableData, setSiteConfigTableData] = useState<SiteConfigTableData[]>([]);
- const [bandsTableData, setBandsTableData] = useState<AvailableBands[]>([]);
- const [openEditConfigDialog, setOpenEditConfigDialog] = useState(false);
- const [config, setConfig] = useState('HIGH');
- const [comment, setComment] = useState('');
- const [rowData, setRowData] = useState<SiteConfigTableData>();
- const [refreshTable, setRefreshTable] = useState(false);
- const [shouldRefreshTable, setShouldRefreshTable] = useState(false);
- const [saveInfoMessage, setSaveInfoMessage] = useState<{ message: string; error: boolean }>({ message: '', error: false });
- const [isDialogClosed, setIsDialogClosed] = useState(false);
- const [openAddConfigDialog, setOpenAddConfigDialog] = useState(false);
- const [bandId, setBandId] = useState<string | undefined>(undefined);
- const [openDeleteConfigDialog, setOpenDeleteConfigDialog] = useState(false);
- const [isLoading, setIsLoading] = useState(false);
-
- const fetchSiteFrequencyPlan = async () => {
- setIsLoading(true);
- try {
- const data: any = await getSiteFrequencyPlan(props.siteId);
- const tableData: SiteConfigTableData[] = data.map((row: any) => ({
- band: row.band.name,
- bandId: row.band.keyId,
- status: row.status,
- configuration: row.configuration,
- comment: row.comment || '',
- }));
- setSiteConfigTableData(tableData);
- } catch (error) {
- console.error('Error fetching site frequency plan:', error);
- } finally {
- setIsLoading(false);
- }
- };
-
- const fetchAllAvailableBands = async () => {
- try {
- const data: any = await getAllAvailableBands();
- const tableData: AvailableBands[] = data.map((row: any) => ({
- keyId: row.keyId,
- name: row.name,
- duplexSpacingMhz: row.duplexSpacingMhz,
- }));
- setBandsTableData(tableData);
- } catch (error) {
- console.error('Error fetching available bands:', error);
- }
- };
-
- useEffect(() => {
- fetchSiteFrequencyPlan();
- fetchAllAvailableBands();
- setSaveInfoMessage({ message: '', error: false });
- if (shouldRefreshTable) {
- setShouldRefreshTable(false);
- setRefreshTable((prevValue) => !prevValue);
- }
- }, [props.siteId, shouldRefreshTable]);
-
- const onOpenAddSiteConfigDialog = () => {
- setOpenAddConfigDialog(true);
- setBandId(undefined);
- setComment('');
- };
-
- const onOpenEditSiteConfigDialog = (event: React.MouseEvent<HTMLElement>, element: SiteConfigTableData) => {
- if (!openEditConfigDialog) {
- setOpenEditConfigDialog(true);
- setComment('');
- setConfig(element.configuration);
- setRowData(element);
- }
- };
- const onOpenDeleteSiteConfigDialog = (event: React.MouseEvent<HTMLElement>, element: SiteConfigTableData) => {
- if (!openDeleteConfigDialog) {
- setOpenDeleteConfigDialog(true);
- setRowData(element);
- }
- };
-
- const saveEditConfig = (bandid: string, siteId: string) => {
- let modifiedConfig: addEditSiteConfig = {
- configuration: config,
- comment: comment,
- };
- siteManagerService.saveSiteConfiguration(modifiedConfig, bandid, siteId).then((result) => {
- if (!result.error) {
- setOpenEditConfigDialog(false);
- setIsDialogClosed(true);
- } else {
- setSaveInfoMessage(result);
- }
- });
- };
-
- const addConfig = (bandid: string, siteId: string) => {
- let addedConfig: addEditSiteConfig = {
- configuration: config,
- comment: comment,
- };
- if (bandId !== undefined) {
- siteManagerService.createSiteConfiguration(addedConfig, bandid, siteId).then((result) => {
- if (!result.error) {
- setOpenAddConfigDialog(false);
- setIsDialogClosed(true);
- } else {
- setSaveInfoMessage(result);
- }
- });
- }
- };
- const deleteConfig = (bandid: string, siteId: string) => {
- siteManagerService.deleteSiteConfiguration(bandid, siteId).then((result) => {
- if (!result.error) {
- setOpenDeleteConfigDialog(false);
- setIsDialogClosed(true);
- } else {
- setSaveInfoMessage(result);
- }
- });
- };
-
- const handleCloseEditDialog = () => {
- setOpenEditConfigDialog(false);
- setSaveInfoMessage({ message: '', error: false });
- };
-
- const handleCloseAddDialog = () => {
- setOpenAddConfigDialog(false);
- setSaveInfoMessage({ message: '', error: false });
- };
-
- const handleCloseDeleteDialog = () => {
- setOpenDeleteConfigDialog(false);
- setSaveInfoMessage({ message: '', error: false });
- };
-
- const addSiteConfigurationAction = {
- icon: AddIcon,
- tooltip: 'Add Site Configuration',
- ariaLabel: 'add-site-configuration',
- onClick: onOpenAddSiteConfigDialog,
- };
-
- const getContextMenu = (row: SiteConfigTableData) => {
- return [
- <>
- <MenuItem aria-label={'edit-site-config'} onClick={(event) => onOpenEditSiteConfigDialog(event, row)}>
- <Typography>Edit Config</Typography>
- </MenuItem>,
- <MenuItem aria-label={'edit-site-config'} onClick={(event) => onOpenDeleteSiteConfigDialog(event, row)}>
- <Typography>Delete Config</Typography>
- </MenuItem></>,
- ];
- };
-
- useEffect(() => {
- if (isDialogClosed) {
- setShouldRefreshTable(true);
- setIsDialogClosed(false);
- }
- }, [isDialogClosed]);
-
- return (
- <>
- {isLoading && (
- <div style={{
- position: 'absolute', top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center',
- backgroundColor: 'rgba(255, 255, 255, 0.7)', zIndex: 9999,
- }}>
- <CircularProgress style={{ color: '#2596be' }} />
- </div>
- )}
- <SiteConfiguration key={refreshTable.toString()} stickyHeader tableId='device-table' customActionButtons={[addSiteConfigurationAction]}
- columns={[
- { property: 'band', title: 'Band', type: ColumnType.text },
- { property: 'status', title: 'Status', type: ColumnType.text },
- { property: 'configuration', title: 'High/Low Config', type: ColumnType.text },
- { property: 'comment', title: 'Comments', type: ColumnType.text },
- ]}
- idProperty='id' rows={siteConfigTableData} asynchronus
- createContextMenu={(selectedRowData) => {
- return getContextMenu(selectedRowData);
- }}
- />
- <Dialog fullWidth open={openEditConfigDialog}>
- <DialogContent>
- <DialogContentText>
- {'Edit Configuration for the band ' + rowData?.band}
- </DialogContentText>
- <FormControl variant='standard' fullWidth>
- <InputLabel htmlFor='active'>Configuration</InputLabel>
- <Select disabled={rowData?.status != 'VACANT'} style={{ marginTop: '30px' }} variant='standard' aria-label='site-config-selection' value={config}
- onChange={(event) => { setConfig(event.target.value as string); }} inputProps={{ name: 'config', id: 'config' }} fullWidth >
- <MenuItem value={'HIGH'} aria-label='true'> HIGH </MenuItem>
- <MenuItem value={'LOW'} aria-label='false'> LOW </MenuItem>
- </Select>
- <TextField style={{ marginTop: '30px' }} variant='standard' spellCheck={false} margin='dense' value={comment}
- onChange={(event) => { setComment(event.target.value); }} id='edit-comment' label='Comment' aria-label='edit-comment'
- type='text' fullWidth />
- </FormControl>
- </DialogContent>
- <DialogActions style={{ marginTop: '30px' }}>
- <Button aria-label='save-site-config-button' color='secondary'
- onClick={(e) => { e.preventDefault(); saveEditConfig(rowData?.bandId + '', props.siteId); }} > SAVE </Button>
- <Button aria-label='close-site-config-button' color='secondary'
- onClick={(e) => { e.preventDefault(); handleCloseEditDialog(); }} > CLOSE </Button>
- </DialogActions>
-
- <div style={{ marginTop: '10px' }}>
- {saveInfoMessage.message.length > 0 && !saveInfoMessage.error && (
- <Typography aria-label='site-manager-order-creation-message' style={{ marginLeft: 10, marginBottom: 10 }}
- color={'green'} variant='body1' > {saveInfoMessage.message} </Typography>
- )}
- {saveInfoMessage.message.length > 0 && saveInfoMessage.error && (
- <Typography aria-label='site-manager-order-creation-message' style={{ marginLeft: 10, marginBottom: 10 }}
- color={'red'} variant='body1'> {'Save Failed - ' + saveInfoMessage.message} </Typography>
- )}
- </div>
- </Dialog>
- <Dialog fullWidth open={openAddConfigDialog}>
- <DialogContent>
- <DialogContentText>{'Add Configuration for the Site'}</DialogContentText>
- <FormControl variant="standard" fullWidth>
- <InputLabel htmlFor="band">Band</InputLabel>
- <Select style={{ marginTop: '30px' }} variant="standard" aria-label="site-band-selection" value={bandId || ''}
- onChange={(event) => {
- const selectedBandId = event.target.value;
- setBandId(selectedBandId);
- }}
- inputProps={{ name: 'band', keyId: 'bandKeyId' }} fullWidth >
- {bandsTableData.map((band) => (
- <MenuItem key={band.keyId} value={band.keyId}>
- {band.name}
- </MenuItem>
- ))}
- </Select>
- </FormControl>
- <FormControl variant="standard" fullWidth>
- <InputLabel htmlFor="active">Configuration</InputLabel>
- <Select style={{ marginTop: '30px' }} variant="standard" aria-label="site-config-selection" value={config}
- onChange={(event) => {
- setConfig(event.target.value as string);
- }}
- inputProps={{ name: 'config', id: 'config' }} >
- <MenuItem value="HIGH">HIGH</MenuItem>
- <MenuItem value="LOW">LOW</MenuItem>
- </Select>
- <TextField style={{ marginTop: '30px' }} variant='standard' spellCheck={false} margin='dense' value={comment}
- onChange={(event) => { setComment(event.target.value); }} id='addConfig-comment' label='Comment' aria-label='addConfig-comment'
- type='text' fullWidth />
- </FormControl>
- </DialogContent>
- <DialogActions>
- <Button variant="contained" color="primary"
- onClick={() => {
- const selectedBand = bandsTableData.find((band) => band.keyId + '' === bandId);
- if (selectedBand) {
- addConfig(selectedBand.keyId.toString(), props.siteId);
- }
- }} > Save </Button>
- <Button variant="outlined" color="secondary" onClick={handleCloseAddDialog} > CLOSE </Button>
- </DialogActions>
- <div style={{ marginTop: '10px' }}>
- {saveInfoMessage.message.length > 0 && !saveInfoMessage.error && (
- <Typography aria-label='site-manager-order-creation-message' style={{ marginLeft: 10, marginBottom: 10 }}
- color={'green'} variant='body1' > {saveInfoMessage.message} </Typography>
- )}
- {saveInfoMessage.message.length > 0 && saveInfoMessage.error && (
- <Typography aria-label='site-manager-order-creation-message' style={{ marginLeft: 10, marginBottom: 10 }}
- color={'red'} variant='body1'> {'Save Failed - ' + saveInfoMessage.message} </Typography>
- )}
- </div>
- </Dialog>
- <Dialog fullWidth open={openDeleteConfigDialog}>
- <DialogContent>
- <DialogContentText>{'Delete Frequency Plan from the Site'}</DialogContentText>
- {'Do you really want to remove this configuration for band:' + rowData?.band}
- </DialogContent>
- <DialogActions style={{ marginTop: '30px' }}>
- <Button aria-label='delete-site-config-button' color='secondary'
- onClick={(e) => { e.preventDefault(); deleteConfig(rowData?.bandId + '', props.siteId); }} > DELETE </Button>
- <Button aria-label='close-delete-config-button' color='secondary'
- onClick={(e) => { e.preventDefault(); handleCloseDeleteDialog(); }} > CLOSE </Button>
- </DialogActions>
- <div style={{ marginTop: '10px' }}>
- {saveInfoMessage.message.length > 0 && !saveInfoMessage.error && (
- <Typography aria-label='site-manager-order-creation-message' style={{ marginLeft: 10, marginBottom: 10 }}
- color={'green'} variant='body1' > {saveInfoMessage.message} </Typography>
- )}
- {saveInfoMessage.message.length > 0 && saveInfoMessage.error && (
- <Typography aria-label='site-manager-order-creation-message' style={{ marginLeft: 10, marginBottom: 10 }}
- color={'red'} variant='body1'> {'Save Failed - ' + saveInfoMessage.message} </Typography>
- )}
- </div>
- </Dialog>
- </>
- );
-};
-
-export default SiteConfigurationComponent;
+++ /dev/null
-import React, { useState } from 'react';
-
-import CancelIcon from '@mui/icons-material/Cancel';
-import EditIcon from '@mui/icons-material/Edit';
-import SaveIcon from '@mui/icons-material/Save';
-import { FormControl, InputLabel, MenuItem, Select, Typography } from '@mui/material';
-import IconButton from '@mui/material/IconButton';
-import TextField from '@mui/material/TextField';
-import makeStyles from '@mui/styles/makeStyles';
-
-import { useApplicationDispatch } from '../../../../framework/src/flux/connect';
-
-import { loadAllAvailableSiteTypesAsync } from '../actions/siteManagerTreeActions';
-import { Sites } from '../models/siteManager';
-import siteManagerService from '../services/siteManagerService';
-
-const useStyles = makeStyles({
- formContainer: {
- position: 'relative',
- paddingRight: '48px',
- },
- iconContainer: {
- position: 'absolute',
- top: '8px',
- right: '0',
- display: 'flex',
- zIndex: 1,
- },
-});
-
-type Address = {
- streetAndNr: string;
- city: string;
- zipCode: string;
- country: string;
-};
-
-type Location = {
- lon: string;
- lat: string;
-};
-
-interface AvailableSiteTypes {
- keyId: number;
- type: string;
-}
-
-type SiteDetailsProps = {
- siteDetails: {
- id: string;
- uuid: string;
- name: string;
- amslInMeters: string;
- type: string;
- 'area-id': string;
- 'item-count': number;
- address: Address;
- operator: string;
- location: Location;
- [key: string]: any;
- };
-};
-
-const SiteDetailsAccordion: React.FC<SiteDetailsProps> = (props: SiteDetailsProps) => {
- const classes = useStyles();
- const dispatch = useApplicationDispatch();
- const getAllAvailableSiteTypes = async () => dispatch(loadAllAvailableSiteTypesAsync());
-
- const [formState, setFormState] = useState<Sites>(props.siteDetails);
- const [siteTypesData, setSiteTypesData] = useState<AvailableSiteTypes[]>([]);
- const [isEditing, setIsEditing] = useState(false);
- const [saveInfoMessage, setSaveInfoMessage] = React.useState<{ message: string; error: boolean }>({ message: '', error: false });
-
- const handleInputChange = (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
- const { name, value } = event.target;
-
- setFormState((prevFormData) => ({
- ...prevFormData,
- [name]: value,
- }));
- };
-
- const handleNestedInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {
- const { name, value } = event.target;
- const [parent, key] = name.split('.');
-
- setFormState((prevFormData) => ({
- ...prevFormData,
- [parent]: {
- ...(prevFormData[parent as keyof Sites] as object),
- [key]: value,
- },
- }));
-
- };
-
- const handleEditClick = () => {
- setIsEditing(true);
- setSaveInfoMessage({ message: '', error: false });
- };
-
- const handleCancelClick = () => {
- setFormState(props.siteDetails);
- setIsEditing(false);
- };
-
- const handleSubmit = () => {
- const editedFields: Sites = Object.keys(formState).reduce<any>((acc, key) => {
- if (formState[key as keyof Sites] !== props.siteDetails[key as keyof Sites]) {
- acc[key as keyof Sites] = formState[key as keyof Sites];
- }
- return acc;
- }, {});
- siteManagerService.saveModifiedSiteDetails(editedFields, formState.id).then((result) => {
- setSaveInfoMessage(result);
- });
- setIsEditing(false);
- };
-
- const fetchAllAvailableSiteTypes = async () => {
- try {
- const data: any = await getAllAvailableSiteTypes();
- const tableData: any[] = data.map((row: any) => ({
- type: row,
- }));
- setSiteTypesData(tableData);
- } catch (error) {
- console.error('Error fetching all Site types:', error);
- }
- };
-
- React.useEffect(() => {
- setFormState(props.siteDetails);
- fetchAllAvailableSiteTypes();
- setSaveInfoMessage({ message: '', error: false });
- }, [props.siteDetails]);
-
- return (
- <>
- <div className={classes.formContainer}>
- <TextField label="Site Name" aria-label='site-details-site-name' variant="standard" name="name" fullWidth value={formState.name}
- onChange={handleInputChange} InputProps={{ readOnly: !isEditing }} /> <br />
- <TextField label="SiteID" aria-label='site-details-site-id' variant="standard" name="id" type="email" fullWidth value={formState.id}
- onChange={handleInputChange} InputProps={{ readOnly: !isEditing }} disabled={isEditing} /> <br />
- <TextField label="UUID" aria-label='site-details-site-uuid' variant="standard" fullWidth name="uuid" value={formState.uuid}
- onChange={handleInputChange} InputProps={{ readOnly: !isEditing }} disabled={isEditing} /> <br />
- <TextField label="Latitude" aria-label='site-details-latitude' variant="standard" name="location.lat" fullWidth
- value={formState.location ? formState.location.lat : ''} onChange={handleNestedInputChange} InputProps={{ readOnly: !isEditing }} /> <br />
- <TextField label="Longitude" aria-label='site-details-longitude' variant="standard" name="location.lon" fullWidth
- value={formState.location ? formState.location.lon : ''} onChange={handleNestedInputChange} InputProps={{ readOnly: !isEditing }} /> <br />
- <TextField label="Street & Number" aria-label='site-details-site-addr-street' variant="standard" name="address.streetAndNr" fullWidth
- value={formState.address ? formState.address.streetAndNr : ''} onChange={handleNestedInputChange} InputProps={{ readOnly: !isEditing }} /><br />
- <TextField label="Zip Code" aria-label='site-details-site-addr-zip' variant="standard" name="address.zipCode" fullWidth
- value={formState.address ? formState.address.zipCode : ''} onChange={handleNestedInputChange} InputProps={{ readOnly: !isEditing }} /> <br />
- <TextField label="City" aria-label='site-details-site-addr-city' variant="standard" name="address.city" fullWidth
- value={formState.address ? formState.address.city : ''} onChange={handleNestedInputChange}
- InputProps={{ readOnly: !isEditing }} /> <br />
- <TextField label="Country" aria-label='site-details-addr-country' variant="standard" name="address.country" fullWidth
- value={formState.address ? formState.address.country : ''} onChange={handleNestedInputChange}
- InputProps={{ readOnly: !isEditing }} /> <br />
- <TextField label="amslInMeters" aria-label='site-details-site-amsl' variant="standard" name="amslInMeters" fullWidth
- value={formState.amslInMeters} onChange={handleInputChange}
- InputProps={{ readOnly: !isEditing }} /> <br />
- <FormControl variant="standard" fullWidth>
- <InputLabel htmlFor="siteType">type</InputLabel>
- <Select style={{ marginTop: '30px' }} variant="standard" aria-label="site-details-site-type-selection" value={formState.type || ''}
- inputProps={{ readOnly: !isEditing }}
- onChange={(event) => {
- event.preventDefault();
- const selectedSiteType = event.target.value;
- setFormState({ ...formState, type: selectedSiteType });
- }} fullWidth >
- {siteTypesData.map((rows) => (
- <MenuItem key={rows.keyId} value={rows.type}>
- {rows.type}
- </MenuItem>
- ))}
- </Select>
- </FormControl>
- <TextField label="Operator" aria-label='site-details-site-operator' variant="standard" name="operator" fullWidth disabled={isEditing}
- value={formState.operator} onChange={handleInputChange}
- InputProps={{ readOnly: !isEditing }} /> <br />
-
- {isEditing ? (
- <div className={classes.iconContainer}>
- <IconButton onClick={e => { e.preventDefault(); handleSubmit(); }}>
- <SaveIcon />
- </IconButton>
- <IconButton onClick={handleCancelClick}>
- <CancelIcon />
- </IconButton>
- </div>
- ) : (
- <IconButton onClick={handleEditClick} className={classes.iconContainer}>
- <EditIcon />
- </IconButton>
- )}
-
- <div style={{ marginTop: '20px' }} >
- {
- saveInfoMessage.message.length > 0 && (!saveInfoMessage.error) &&
- <Typography aria-label='site-manager-order-creation-message' style={{ marginTop: 10 }} color={'green'}
- variant='body1'>{saveInfoMessage.message}</Typography>
- }
- {
- saveInfoMessage.message.length > 0 && saveInfoMessage.error &&
- <Typography aria-label='site-manager-order-creation-message' style={{ marginTop: 10 }} color={'red'}
- variant='body1'>{'Save Failed - ' + saveInfoMessage.message}</Typography>
- }
- </div>
- </div>
- </>
- );
-};
-
-export default SiteDetailsAccordion;
+++ /dev/null
-/**
- * ============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 React, { useRef } from 'react';
-
-import SearchIcon from '@mui/icons-material/Search';
-import SettingsBackupRestoreIcon from '@mui/icons-material/SettingsBackupRestore';
-import { Divider, IconButton, InputBase, Paper } from '@mui/material';
-import makeStyles from '@mui/styles/makeStyles';
-
-import { NavigateToApplication } from '../../../../framework/src/actions/navigationActions';
-import { useApplicationDispatch, useSelectApplicationState } from '../../../../framework/src/flux/connect';
-import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore';
-
-import { SearchValueAction } from '../actions/siteManagerSiteSearchAction';
-
-const styles = makeStyles({
- root: {
- padding: '5px',
- display: 'flex',
- alignItems: 'center',
- flexDirection: 'row',
- width: '70%',
- zIndex: 1,
- },
- input: {
- flex: 1,
- marginLeft: 5,
- },
- iconButton: {
- padding: 10,
- },
- divider: {
- height: 28,
- margin: 4,
- },
-});
-interface SearchProps {
- handleRefresh: (event: React.SyntheticEvent) => void;
- handleSearch: (event: React.SyntheticEvent, searchValue: string, searchCategoryName?: string) => void;
-}
-
-type SiteManagerSiteSearchProps = SearchProps;
-
-const SiteManagerSiteSearch: React.FunctionComponent<SiteManagerSiteSearchProps> = (props) => {
- const classes = styles();
- const buttonRef = useRef<HTMLButtonElement>(null);
- const searchTerm = useSelectApplicationState((state: IApplicationStoreState) => state.siteManager.searchSite.siteId);
- const searchCategoryName = useSelectApplicationState((state: IApplicationStoreState) => state.siteManager.searchSite.categoryName);
-
- const dispatch = useApplicationDispatch();
- const setSearchTerm = (siteId: string, categoryName?: string) => dispatch(new SearchValueAction(siteId, categoryName));
- const navigateToApplication = (applicationName: string, path?: string) => dispatch(new NavigateToApplication(applicationName, path));
-
-
- React.useEffect(() => {
- if (buttonRef.current) {
- buttonRef.current.click();
- }
- }, []);
-
-
- const handleClick = async (event: React.SyntheticEvent) => {
- event.preventDefault();
- if (searchCategoryName && searchCategoryName.length > 0) {
- navigateToApplication('siteManager', 'treeview/' + searchTerm + '/' + searchCategoryName);
- if (searchTerm.length > 0) {
- await props.handleSearch(event, searchTerm, searchCategoryName);
- }
- } else {
- navigateToApplication('siteManager', 'treeview/' + searchTerm);
- if (searchTerm.length > 0) {
- await props.handleSearch(event, searchTerm);
- }
- }
- };
-
- const handleRefresh = async (event: React.SyntheticEvent) => {
- setSearchTerm('');
- await props.handleRefresh(event);
- event.preventDefault();
- };
-
- return <>
- <Paper component='form' className={classes.root}>
- <InputBase
- className={classes.input}
- placeholder='Find sites by ID or Name'
- inputProps={{ 'aria-label': 'site-manager-searchBar' }}
- value={searchTerm}
- onChange={e => setSearchTerm(e.currentTarget.value)}
- />
- <Divider className={classes.divider} orientation='vertical' />
- <IconButton ref={buttonRef}
- type='submit'
- className={classes.iconButton}
- aria-label='site-manager-siteSearch-button'
- onClick={handleClick}
- size='large'>
- <SearchIcon />
- </IconButton>
- <Divider className={classes.divider} orientation='vertical' />
- <IconButton
- type='submit'
- className={classes.iconButton}
- aria-label='site-manager-restore-button'
- onClick={handleRefresh}
- size='large'>
- <SettingsBackupRestoreIcon />
- </IconButton>
- </Paper>
- </>;
-};
-
-export default SiteManagerSiteSearch;
\ No newline at end of file
+++ /dev/null
-/**
-* ============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 React, { useEffect, useRef, useState } from 'react';
-
-import { ExpandMoreOutlined } from '@mui/icons-material';
-import { default as SiteMap } from '@mui/icons-material/Map';
-import TreeItem, { treeItemClasses, TreeItemProps } from '@mui/lab/TreeItem';
-import TreeView from '@mui/lab/TreeView';
-import { Accordion, AccordionDetails, AccordionSummary, Button, IconButton, Paper, Typography } from '@mui/material';
-import CircularProgress from '@mui/material/CircularProgress';
-import Collapse from '@mui/material/Collapse';
-import { alpha, styled } from '@mui/material/styles';
-import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon';
-import { TransitionProps } from '@mui/material/transitions';
-import { makeStyles } from '@mui/styles';
-import { useApplicationDispatch, useSelectApplicationState } from '../../../../framework/src/flux/connect';
-import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore';
-
-import { loadAllSiteDetailsBySiteIdAsync } from '../actions/sitedocManagementAction';
-import { loadTreeSiteSearchBySiteIdOrNameAsync } from '../actions/siteManagerSiteSearchAction';
-import {
- loadAllAreasByAreaIdAsync, loadAllCategoriesBySiteIdAsync, loadAllCategoryItemsBySiteIdAsync,
- loadAllCountriesAsync, loadAllSiteBySiteIdAsync, loadAllSitesByAreaIdAsync,
-} from '../actions/siteManagerTreeActions';
-import SiteManagerSiteSearch from '../components/siteManagerSiteSearch';
-import {
- ITreeViewItem, SiteManagerAreas, SiteManagerCategories, SiteManagerCategoryItems,
- SiteManagerSiteOrderItemsDetails, Sites,
-} from '../models/siteManager';
-import CreateOrderView from '../views/OrderCreation';
-import DeviceTableView from './deviceTable';
-import LinkTableView from './linkTable';
-import { MessageDialog } from './messageDialog';
-import PicturesView from './picturesTable';
-import SiteAdditionalInformation from './siteAdditionalInformation';
-import SiteConfigurationComponent from './siteConfiguration';
-import SiteDetailsAccordion from './siteDetails';
-import SiteOrdersView from './siteOrdersTable';
-import { CustomContent } from './treeItem';
-import TSSReportsView from './tssReportsTable';
-
-const styles = makeStyles({
- root: {
- flex: '1 0 0%',
- display: 'flex',
- flexDirection: 'row',
- },
- iconButton: {
- padding: 10,
- },
- paperTreeView: {
- width: '50%',
- padding: '5px',
- display: 'flex',
- flexDirection: 'column',
- zIndex: 1,
- },
- paperDisplayView: {
- position: 'relative',
- width: '100%',
- padding: '5px',
- display: 'flex',
- flexDirection: 'column',
- zIndex: 1,
- },
- searchParentDiv: {
- padding: '5px',
- display: 'flex',
- flexDirection: 'row',
- position: 'relative',
- },
- emptyDiv: {
- width: '30%',
- },
- tree: {
- height: '700px',
- flexGrow: 1,
- maxWidth: '600px',
- overflowY: 'auto',
- overflowX: 'auto',
- },
- table: {
- borderTopWidth: 3,
- borderBottomWidth: 3,
- borderColor: 'grey',
- borderStyle: 'solid',
- top: '15px',
- width: '100%',
- padding: '15px',
- 'bordercollapse': 'collapse',
- 'paddingbottom': '12px',
- 'text-align': 'left',
- 'color': 'black',
- },
- tableDetails: {
- border: '1px solid black',
- padding: '5px',
- },
- selectedSearchNode: {
- backgroundColor: '#D0CDCD',
- },
- normalNode: {
- },
- accordionTitle: {
- width: '33%', flexShrink: 0,
- },
- iconContainer: {
- position: 'absolute',
- top: '50px',
- right: '0',
- display: 'flex',
- zIndex: 1,
- },
- loadingSpinnerDisplayView: {
- position: 'absolute',
- top: 0,
- left: 0,
- marginTop: '50px',
- width: '100%',
- height: '100%',
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
- backgroundColor: 'rgba(255, 255, 255, 0.7)',
- zIndex: 9999,
- },
- loadingSpinnerTreeView: {
- position: 'absolute',
- top: 0,
- left: 0,
- marginTop: '350px',
- width: '100%',
- height: '100%',
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
- backgroundColor: 'rgba(255, 255, 255, 0.7)',
- zIndex: 9999,
- },
-});
-interface CategoryIdMap {
- [index: string]: ITreeViewItem;
-}
-
-type SiteManagerTreeviewComponentState = {
- nodes: ITreeViewItem[];
- expanded: string[];
- selected: string;
- parentChildMap: Map<string, string>;
- selectedSite: Sites;
- isSite: boolean;
- isCategory: boolean;
- isCategoryExpanded: boolean;
- sitesList: string[];
- treeItemName: string;
- siteManagerCategoryItems: SiteManagerCategoryItems;
- siteManagerSiteOrderItems: SiteManagerSiteOrderItemsDetails;
- categoryList: string[];
- categoryIdMap: CategoryIdMap;
- selectedCategoryLinkType: string;
- searchLeafParent: string[];
- selectedSearchItem: string;
- siteId: string;
- isDialogOpen: boolean;
- openDialog: boolean;
- dialogMessage: string;
- isFromSearch: boolean;
- isFocused: boolean;
- isReady: boolean;
- isLoadingTreeView: boolean;
- isLoadingDisplayView: boolean;
- searchSiteSelected: ITreeViewItem;
-};
-
-function MinusSquare(props: SvgIconProps) {
- return (
- <SvgIcon fontSize='inherit' style={{ width: 14, height: 14 }} {...props}>
- <path d="M22.047 22.074v0 0-20.147 0h-20.12v0 20.147 0h20.12zM22.047 24h-20.12q-.803 0-1.365-.562t-.562-1.365v-20.147q0
--.776.562-1.351t1.365-.575h20.147q.776 0 1.351.575t.575 1.351v20.147q0 .803-.575 1.365t-1.378.562v0zM17.873 11.023h-11.826q
--.375 0-.669.281t-.294.682v0q0 .401.294 .682t.669.281h11.826q.375 0 .669-.281t.294-.682v0q0-.401-.294-.682t-.669-.281z" />
- </SvgIcon>
- );
-}
-
-function PlusSquare(props: SvgIconProps) {
- return (
- <SvgIcon fontSize='inherit' style={{ width: 14, height: 14 }} {...props}>
- <path d="M22.047 22.074v0 0-20.147 0h-20.12v0 20.147 0h20.12zM22.047 24h-20.12q-.803 0-1.365-.562t-.562
--1.365v-20.147q0-.776.562-1.351t1.365-.575h20.147q.776 0 1.351.575t.575 1.351v20.147q0 .803-.575 1.365t
--1.378.562v0zM17.873 12.977h-4.923v4.896q0 .401-.281.682t-.682.281v0q-.375 0-.669-.281t-.294-.682v-4.896h-4.923q-.401 0-.682
--.294t-.281-.669v0q0-.401.281-.682t.682-.281h4.923v-4.896q0-.401.294-.682t.669-.281v0q.401 0 .682.281t.281.682v4.896h4.923q.401 0 .682.281t.281.682v0q0 .375
--.281.669t-.682.294z" />
- </SvgIcon>
- );
-}
-
-function CloseSquare(props: SvgIconProps) {
- return (
- <SvgIcon
- className='close'
- fontSize='inherit'
- style={{ width: 14, height: 14 }}
- {...props}
- >
- <path d="M17.485 17.512q-.281.281-.682.281t-.696-.268l-4.12-4.147-4.12 4.147q-.294.268-.696.268t-.682-.281-.281-.682.294
--.669l4.12-4.147-4.12-4.147q-.294-.268-.294-.669t.281-.682.682-.281.696 .268l4.12 4.147 4.12-4.147q.294-.268.696
--.268t.682.281 .281.669-.294.682l-4.12 4.147 4.12 4.147q.294.268 .294.669t-.281.682zM22.047 22.074v0 0
--20.147 0h-20.12v0 20.147 0h20.12zM22.047 24h-20.12q-.803 0-1.365-.562t-.562-1.365v-20.147q0-.776.562-1.351t1.365
--.575h20.147q.776 0 1.351.575t.575 1.351v20.147q0 .803-.575 1.365t-1.378.562v0z" />
- </SvgIcon>
- );
-}
-
-function TransitionComponent(props: TransitionProps) {
- return (
- <Collapse {...props} />
- );
-}
-
-const StyledTreeItem = styled((props: TreeItemProps) => (
- <TreeItem ContentComponent={CustomContent} {...props} TransitionComponent={TransitionComponent} />
-))(({ theme }) => ({
- [`& .${treeItemClasses.iconContainer}`]: {
- '& .close': {
- opacity: 0.3,
- },
- },
- [`& .${treeItemClasses.group}`]: {
- marginLeft: 15,
- paddingLeft: 18,
- borderLeft: `1px dashed ${alpha(theme.palette.text.primary, 0.4)}`,
- },
- [`& .${treeItemClasses.selected}`]: {
- backgroundColor: '#D0CDCD !important',
- },
-}));
-
-const SiteManagerTreeViewComponent: React.FC = () => {
- useSelectApplicationState((state: IApplicationStoreState) => state.siteManager);
- const dispatch = useApplicationDispatch();
- const getCountryList = async () => dispatch(loadAllCountriesAsync());
- const getAreaList = async (areaId: string) => dispatch(loadAllAreasByAreaIdAsync(areaId));
- const getSiteList = async (areaId: string) => dispatch(loadAllSitesByAreaIdAsync(areaId));
- const getCategoryList = async (siteId: string) => dispatch(loadAllCategoriesBySiteIdAsync(siteId));
- const getSiteDetailsBySiteId = async (siteId: string) => dispatch(loadAllSiteBySiteIdAsync(siteId));
- const getCategoryItemsBySiteId = async (siteId: string, categoryName: string) => dispatch(loadAllCategoryItemsBySiteIdAsync(siteId, categoryName));
- const getSiteDetailsWithContactsBySiteId = async (siteId: string) => dispatch(loadAllSiteDetailsBySiteIdAsync(siteId));
- const searchSiteIdTrail = async (searchValue: string) => dispatch(loadTreeSiteSearchBySiteIdOrNameAsync(searchValue));
-
- const [state, setState] = useState<SiteManagerTreeviewComponentState>({
- nodes: [],
- parentChildMap: new Map<string, string>(),
- selectedSite: {
- id: '',
- uuid: '',
- name: '',
- amslInMeters: '',
- type: '',
- 'area-id': '',
- 'item-count': 0,
- address: {
- streetAndNr: '',
- city: '',
- zipCode: '',
- country: '',
- },
- operator: '',
- location: {
- lon: '',
- lat: '',
- },
- },
- expanded: [],
- selected: '',
- isSite: false,
- isCategory: false,
- isCategoryExpanded: false,
- sitesList: [],
- treeItemName: '',
- siteManagerCategoryItems: [{
- name: '',
- url: '',
- 'last-update': '',
- }],
- siteManagerSiteOrderItems: [{
- assignedUser: '',
- state: '',
- note: '',
- tasks: [{
- type: '',
- description: '',
- completed: false,
- }],
- }],
- categoryList: [],
- categoryIdMap: {},
- selectedCategoryLinkType: '',
- searchLeafParent: [],
- selectedSearchItem: '',
- siteId: '',
- isDialogOpen: false,
- openDialog: false,
- dialogMessage: '',
- isFromSearch: false,
- isFocused: false,
- isReady: false,
- isLoadingTreeView: false,
- isLoadingDisplayView: false,
- searchSiteSelected: {
- id: '',
- areaCount: 0,
- isCategory: false,
- isNodeSelected: false,
- isSite: false,
- name: '',
- parentId: '',
- siteCount: 0,
- },
- });
-
- const treeRef = useRef<HTMLUListElement>(null);
- const categoriesWithDownloadOption = ['mtssr', 'order', 'Pictures'];
- const categoriesForTables = ['microwave', 'node', 'fibre'];
- const classes = styles();
- const MAX_SITES_COUNT = 100;
-
- const categoriesIdDisplayNameMap = new Map<string, string>([
- ['order', 'Site Orders'],
- ['mtssr', 'TSS-Reports'],
- ['Pictures', 'Photos'],
- ['node', 'Nodes'],
- ['fibre', 'Optical Links'],
- ['microwave', 'MW Links'],
- ]);
-
- const categoriesDisplayNameIdMap = new Map<string, string>([
- ['Site Orders', 'order'],
- ['TSS-Reports', 'mtssr'],
- ['Photos', 'Pictures'],
- ['Nodes', 'node'],
- ['Optical Links', 'fibre'],
- ['MW Links', 'microwave'],
- ]);
-
- /**
- * Function to get the reverse trail of parents to help find the right trail
- * to append or identify the parent for a child/the children
- */
- const getTrail = (nodeId: string, trail: string[]) => {
- trail.push(nodeId);
- if (state.parentChildMap.has(nodeId.toString())) {
- const superParentId = state.parentChildMap.get(nodeId.toString()) + '';
- getTrail(superParentId, trail);
- }
- };
-
- /**
- * Function to add the sites to a given area
- */
- const addSiteToLeafArea = (nodes: ITreeViewItem[], site: ITreeViewItem) => {
- for (let iter = 0; iter < nodes.length; iter++) {
- const node = nodes[iter];
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions
- node.children ? node.children : node.children = [];
- if (node.id === site.parentId) {
- node.children.push(site);
- state.parentChildMap.set(site.id.toString(), node.id.toString());
- break;
- } else {
- addSiteToLeafArea(node.children, site);
- }
- }
- };
-
- /**
- * Add tree items of sites under area
- */
- const addTreeItemSites = (parentId: string, sites: Sites[]) => {
- const maxSize = sites.length <= MAX_SITES_COUNT ? sites.length : MAX_SITES_COUNT;
- const siteCountTotal = sites.length;
- if (sites.length > MAX_SITES_COUNT) {
- window.alert(`There are ${siteCountTotal} sites in this area, showing just ${MAX_SITES_COUNT} sites`);
- }
- const nodes: ITreeViewItem[] = [];
- for (var iter = 0; iter < maxSize; iter++) {
- const site = sites[iter];
- let node: ITreeViewItem = {
- id: site.id.toString(),
- name: site.id,
- isSite: true,
- isCategory: false,
- parentId: parentId,
- siteCount: site['item-count'],
- areaCount: 0,
- isNodeSelected: false,
- };
- state.sitesList.push(site.id.toString());
- state.parentChildMap.set(node.id.toString(), node.parentId.toString());
- nodes.push(node);
- }
- return nodes;
- };
-
- /**
- * Add categories to site in the tree items
- */
- const addTreeItemCategories = (siteId: string, categories: SiteManagerCategories[]) => {
- const nodes: ITreeViewItem[] = categories.map(category => {
- const categoryId: string = category.id;
- const categoryName: string = categoriesIdDisplayNameMap.get(category.id) + '';
- let node: ITreeViewItem = {
- id: siteId + '#' + categoryId,
- name: categoryName,
- isSite: false,
- isCategory: true,
- parentId: siteId,
- siteCount: 0,
- areaCount: 0,
- isNodeSelected: false,
- };
- state.categoryIdMap[node.id] = node;
- state.categoryList.push(node.id);
- state.parentChildMap.set(node.id.toString(), siteId.toString());
- return node;
- });
- return nodes;
- };
-
- /**
- * Add tree items of areas under area
- */
- const addTreeItemAreas = (areas: SiteManagerAreas[], isSearch?: boolean,
- selectedSite?: string, searchValue?: string): ITreeViewItem[] => {
- const nodes: ITreeViewItem[] = areas.map(area => {
- let node: ITreeViewItem = {
- id: area.id.toString(),
- name: area.name,
- isSite: false,
- isCategory: false,
- treeLevel: area['tree-level'],
- parentId: area['parent-id'] + '',
- areaCount: area['area-count'] ? area['area-count'] : 0,
- siteCount: area['site-count'] ? area['site-count'] : 0,
- siteLevel: area['site-level'],
- isNodeSelected: false,
- };
- if (area['parent-id']) {
- state.parentChildMap.set(node.id.toString(), node.parentId.toString());
- }
- if (isSearch) {
- state.expanded.push(area.id.toString());
- // eslint-disable-next-line no-param-reassign
- selectedSite = area.id == searchValue ? area.id.toString() : '';
- if (area.areas) {
- node.children = addTreeItemAreas(area.areas, isSearch, selectedSite, searchValue);
- } else {
- state.searchLeafParent.push(area.id.toString());
- }
- }
- return node;
- });
- return nodes;
- };
-
- const setOpenDialog = async (openDialog: boolean, dialogMessage: string, isFromSearch: boolean) => {
- setState({
- ...state,
- openDialog: openDialog,
- dialogMessage: dialogMessage,
- isFromSearch: isFromSearch,
- });
- };
-
- /**
- * Function to append children to the right parent node by navigating through the tree list
- */
- const appendChildrenToParentObject = async (nodes: ITreeViewItem[], trail: string[], forceUpdateChildren: boolean) => {
- const searchId = trail.pop();
- if (searchId === undefined)
- return nodes;
- for (let i = 0; i < nodes.length; i++) {
- const node = nodes[i];
- if ((node.id.toString()) == searchId) {
- if (node.isSite && forceUpdateChildren) {
- node.children = [];
- }
- const children = node.children ? node.children : [];
- if (children.length > 0) {
- await appendChildrenToParentObject(children, trail, forceUpdateChildren);
- } else {
- if (node.siteLevel && node.areaCount == 0) {
- await getSiteList(searchId).then((sitesList: any) => {
- if (sitesList.isError) {
- setOpenDialog(true, sitesList.errorMessage, false);
- return;
- }
- const childNodes = addTreeItemSites(searchId, sitesList.sites);
- node.children = childNodes;
- });
- } else if (node.isSite) {
- await getCategoryList(searchId).then((categories: any) => {
- const childNodes = addTreeItemCategories(searchId, categories);
- node.children = childNodes;
- });
- } else if (!node.isCategory) {
- await getAreaList(searchId).then((areas: any) => {
- const childNodes = addTreeItemAreas(areas);
- node.children = childNodes;
- });
- }
- }
- break;
- }
- }
- return nodes;
- };
-
- /**
- * Function to expand or collapse tree item
- * If child items are not loaded, it calls the async function to load the child items
- */
- const toggleTreeItems = async (nodeId: string, expanded: boolean) => {
- const strNodeId: string = nodeId.toString();
- const trail: string[] = [];
- if (expanded) {
- const expandedTree = state.expanded.filter(item => item !== strNodeId);
- setState({
- ...state,
- expanded: expandedTree,
- isFocused: false,
- });
- return;
- }
- getTrail(strNodeId, trail);
- await appendChildrenToParentObject(state.nodes, trail, false).then((nodes) => {
- setState({
- ...state,
- nodes: nodes,
- isFocused: false,
- });
- state.expanded.push(strNodeId);
- });
- };
-
- /**
- * Clear selected item during search
- */
- const clearSelection = async (nodes: ITreeViewItem[], trail: string[], selectedItem: string) => {
- const searchId = trail.pop();
- if (searchId === undefined)
- return;
- for (let i = 0; i < nodes.length; i++) {
- const node = nodes[i];
- if (node.id === searchId) {
- if (searchId == selectedItem) {
- setState({
- ...state,
- selectedSearchItem: '',
- isFocused: false,
- });
- node.isNodeSelected = false;
- return;
- }
- const children = node.children ? node.children : [];
- if (children.length > 0) {
- clearSelection(children, trail, selectedItem);
- }
- return;
- }
- }
- };
-
- /**
- * Function to retrieve the details of site or category on click of the tree item
- */
- const retrieveDetails = async (siteId: string, isCallFromSearch: boolean) => {
- const selectedSearchItem = state.selectedSearchItem + '';
- if (!isCallFromSearch && (selectedSearchItem.length > 0)) {
- const trail: string[] = [];
- getTrail(state.selectedSearchItem, trail);
- await clearSelection(state.nodes, trail, state.selectedSearchItem);
- }
- const returnedSiteValue = state.sitesList.find(site => site.toString() == siteId.toString());
- if (returnedSiteValue && state.selectedSite.id != returnedSiteValue) {
- const trail: string[] = [];
- getTrail(siteId + '', trail);
- await appendChildrenToParentObject(state.nodes, trail, true).then((nodes) => {
- setState({ ...state, nodes: nodes });
- state.expanded.push(siteId + '');
- });
- await getSiteDetailsBySiteId(siteId).then((site: any) => {
- setState({
- ...state,
- selectedSite: site,
- isSite: true,
- isCategory: false,
- isCategoryExpanded: false,
- isLoadingDisplayView: false,
- treeItemName: site.name,
- selected: site.id,
- });
- });
- } else if (state.selectedSite.id == returnedSiteValue) {
- } else {
- const returnedCategoryValue = state.categoryList.find((category) => category === siteId);
- if (returnedCategoryValue) {
- const ids = siteId.split('#');
- if (state.selectedSite.id != ids[0]) {
- await getSiteDetailsBySiteId(ids[0]).then((site: any) => {
- setState({
- ...state,
- selectedSite: site,
- isSite: true,
- isLoadingDisplayView: false,
- treeItemName: site.name,
- });
- });
- const trail: string[] = [];
- getTrail(siteId + '', trail);
- appendChildrenToParentObject(state.nodes, trail, true).then((nodes) => {
- setState({ ...state, nodes: nodes });
- state.expanded.push(siteId + '');
- });
- }
- if (categoriesWithDownloadOption.includes(ids[1])) {
- await getCategoryItemsBySiteId(ids[0], ids[1]).then(async (categoryItems: any) => {
- const categoryName = categoriesIdDisplayNameMap.get(ids[1]) + '';
- if (categoryName.includes('Site Orders')) {
- await getSiteDetailsWithContactsBySiteId(siteId).then((siteOrderItems: any) => {
- setState({
- ...state,
- isCategory: true,
- isCategoryExpanded: true,
- siteManagerCategoryItems: categoryItems,
- siteManagerSiteOrderItems: siteOrderItems,
- treeItemName: categoryName,
- selected: siteId,
- selectedCategoryLinkType: '',
- });
- });
- } else {
- setState({
- ...state,
- isCategory: true,
- isCategoryExpanded: true,
- siteManagerCategoryItems: categoryItems,
- treeItemName: categoryName,
- selected: siteId,
- selectedCategoryLinkType: '',
- });
- }
- });
- } else if (categoriesForTables.includes(ids[1])) {
- // const selectedCategory = state.categoryIdMap[siteId];
- const categoryName = categoriesIdDisplayNameMap.get(ids[1]) + '';
- setState({
- ...state,
- isCategory: true,
- isCategoryExpanded: true,
- treeItemName: categoryName,
- selected: siteId,
- selectedCategoryLinkType: ids[1] ? ids[1] : '',
- });
- }
- } else {
- setState({
- ...state,
- selectedSite: {
- id: '',
- uuid: '',
- name: '',
- amslInMeters: '',
- type: '',
- 'area-id': '',
- 'item-count': 0,
- address: {
- streetAndNr: '',
- city: '',
- zipCode: '',
- country: '',
- },
- operator: '',
- location: {
- lon: '',
- lat: '',
- },
- },
- isSite: false,
- isCategory: false,
- isCategoryExpanded: false,
- siteManagerCategoryItems: [{
- name: '',
- url: '',
- 'last-update': '',
- }],
- treeItemName: '',
- selected: '',
- selectedSearchItem: '',
- selectedCategoryLinkType: '',
- isFocused: false,
- isReady: false,
- isLoadingDisplayView: false,
- });
- }
- }
- };
-
- /**
- * Function to render the expandable tree item or leaf tree item
- */
- const renderChildren = (node: ITreeViewItem) => {
- const strNodeId = node.id.toString();
- return node.isCategory || node.isSite && node.siteCount == 0 || node.siteLevel && node.siteCount == 0 ||
- !node.isSite && !node.siteLevel && node.areaCount == 0 ?
- (
- <StyledTreeItem className={'node-id-selector-' + strNodeId} key={strNodeId} nodeId={strNodeId} label={node.name}
- ContentProps={{
- toggleTreeItems: toggleTreeItems,
- retrieveDetails: retrieveDetails,
- isNodeSelected: node.isNodeSelected,
- } as any}
- expandIcon={<PlusSquare />} endIcon={<CloseSquare />} >
- {Array.isArray(node.children)
- ? node.children.map((child) => renderChildren(child))
- : null}
- </StyledTreeItem>
- )
- : (
- <StyledTreeItem className={'node-id-selector-' + strNodeId} key={strNodeId} nodeId={strNodeId} label={node.name}
- ContentProps={{
- toggleTreeItems: toggleTreeItems,
- retrieveDetails: retrieveDetails,
- isNodeSelected: node.isNodeSelected,
- } as any}
- expandIcon={<PlusSquare />} endIcon={<PlusSquare />}>
- {Array.isArray(node.children)
- ? node.children.map((child) => renderChildren(child))
- : null}
- </StyledTreeItem>
- );
- };
-
- /**
- * Function to scroll and Focus on the searched item on click of search
- */
- const scrollAndFocus = (searchValue: string) => {
- if (state.isReady && searchValue && searchValue !== '') {
- const matchingNode = treeRef.current?.querySelector(`[id="site-manager-treeview-${searchValue}"]`);
- if (matchingNode) {
- state.isFocused = true;
- state.isReady = false;
- matchingNode.scrollIntoView({ behavior: 'smooth', block: 'center' });
- }
- }
- };
-
- /**
- * Function to handle on click of search
- */
- const handleSearch = async (event: React.SyntheticEvent, searchValue: string, searchCategoryName?: string) => {
- event.preventDefault();
- setState((prevState) => ({
- ...prevState,
- nodes: [],
- parentChildMap: new Map<string, string>(),
- selectedSite: {
- id: '',
- uuid: '',
- name: '',
- amslInMeters: '',
- type: '',
- 'area-id': '',
- 'item-count': 0,
- address: {
- streetAndNr: '',
- city: '',
- zipCode: '',
- country: '',
- },
- operator: '',
- location: {
- lon: '',
- lat: '',
- },
- },
- expanded: [],
- selected: '',
- isSite: false,
- isCategory: false,
- isCategoryExpanded: false,
- searchLeafParent: [],
- treeItemName: '',
- categoryIdMap: {},
- selectedCategoryLinkType: '',
- selectedSearchItem: '',
- siteId: '',
- isDialogOpen: false,
- isFocused: false,
- isReady: false,
- isLoadingTreeView: true,
- searchSiteSelected: {
- id: '',
- areaCount: 0,
- isCategory: false,
- isNodeSelected: false,
- isSite: false,
- name: '',
- parentId: '',
- siteCount: 0,
- },
- }));
- await searchSiteIdTrail(searchValue).then(async (searchResult: any) => {
- if (searchResult.isError) {
- // alert(searchResult.errorMessage);
- setOpenDialog(true, searchResult.errorMessage, true);
- return;
- }
- let selected: string = '';
- let selectedSearchItem = '';
- const areas = searchResult.areas ? searchResult.areas : [];
- const nodes = await addTreeItemAreas(areas, true, selected, searchValue);
- const sites = searchResult.sites ? searchResult.sites : [];
- let searchSiteSelected = state.searchSiteSelected;
- if (sites.length > 0) {
- let sitesCount = sites.length;
- if (sites.length > MAX_SITES_COUNT) {
- window.alert('There are more than 100 Sites in this area of searched site, showing first 100');
- sitesCount = MAX_SITES_COUNT;
- }
- for (let iter = 0; iter < sitesCount; iter++) {
- const siteItr = sites[iter];
- let isNodeSelected = false;
- if (siteItr.id == searchValue) {
- selected = siteItr.id;
- selectedSearchItem = siteItr.id;
- isNodeSelected = true;
- }
- if (siteItr.name) {
- if (siteItr.name.toUpperCase() == searchValue.toUpperCase()) {
- selected = siteItr.id;
- selectedSearchItem = siteItr.id;
- isNodeSelected = true;
- }
- }
- const site: ITreeViewItem = {
- id: siteItr.id,
- name: siteItr.id,
- isSite: true,
- isCategory: false,
- parentId: siteItr['area-id'],
- siteCount: siteItr['item-count'],
- areaCount: 0,
- isNodeSelected: isNodeSelected,
- };
- if (isNodeSelected)
- searchSiteSelected = site;
- state.sitesList.push(site.id);
- addSiteToLeafArea(nodes, site);
- }
- }
- state.nodes = nodes;
- state.selected = selected;
- state.selectedSearchItem = selectedSearchItem;
- state.isReady = true;
- state.isLoadingTreeView = false;
- state.isLoadingDisplayView = true;
- state.searchSiteSelected = searchSiteSelected;
- });
- await retrieveDetails(state.selected, true);
- if (searchCategoryName && categoriesDisplayNameIdMap.get(searchCategoryName)) {
- const categoryId = state.selected + '#' + categoriesDisplayNameIdMap.get(searchCategoryName);
- setState((prevState) => ({
- ...prevState,
- selected: categoryId,
- }));
- await retrieveDetails(categoryId, true);
- state.searchSiteSelected.isNodeSelected = false;
- state.categoryIdMap[categoryId].isNodeSelected = true;
- await scrollAndFocus(categoryId);
- }
- scrollAndFocus(state.selectedSearchItem);
- };
-
- /**
- * Function to refresh the site manager view to its initial state
- */
- const handleRefresh = async () => {
- setState({
- ...state,
- nodes: [],
- parentChildMap: new Map<string, string>(),
- expanded: [],
- selected: '',
- isSite: false,
- isCategory: false,
- isCategoryExpanded: false,
- sitesList: [],
- categoryList: [],
- categoryIdMap: {},
- selectedSite: {
- id: '',
- uuid: '',
- name: '',
- amslInMeters: '',
- type: '',
- 'area-id': '',
- 'item-count': 0,
- address: {
- streetAndNr: '',
- city: '',
- zipCode: '',
- country: '',
- },
- operator: '',
- location: {
- lon: '',
- lat: '',
- },
- },
- siteManagerCategoryItems: [{
- name: '',
- url: '',
- 'last-update': '',
- }],
- searchLeafParent: [],
- treeItemName: '',
- selectedCategoryLinkType: '',
- siteId: '',
- isDialogOpen: false,
- openDialog: false,
- dialogMessage: '',
- isFromSearch: false,
- isFocused: false,
- isReady: false,
- });
- await getCountryList().then((countries: any) => {
- const nodes = addTreeItemAreas(countries);
- setState({
- ...state,
- nodes: nodes,
- isFocused: false,
- });
- });
- };
-
- /**
- * Function to open the Create TSS report dialog on click of the button in Site Actions category
- */
- const onOpenCreateTSSReportOrderDialog = () => {
- setState({
- ...state,
- isDialogOpen: true,
- });
- };
- /**
- * Function to open the Close Create TSS report dialog in Site Actions category
- */
- const onCloseCreateTSSReportOrderDialog = async () => {
- const siteIdItem = state.selected.toString();
- const selectedSiteId = siteIdItem.split('#')[0] + '';
- const trail: string[] = [];
- getTrail(selectedSiteId, trail);
- await appendChildrenToParentObject(state.nodes, trail, true).then((nodes) => {
- setState({ ...state, nodes: nodes });
- state.expanded.push(selectedSiteId);
- });
- setState({
- ...state,
- siteId: '',
- isDialogOpen: false,
- });
- };
-
- const handleOnCloseOfDialog = (event: React.SyntheticEvent, isFromSearch: boolean) => {
- setOpenDialog(false, '', isFromSearch);
- if (isFromSearch)
- handleRefresh();
- };
-
- const onError = () => {
- setState({
- ...state,
- siteId: '',
- isDialogOpen: false,
- });
- };
-
- /**
- * On initial load/mount of site manager application
- */
- useEffect(() => {
- const fetchData = async () => {
- try {
- const countries: any = await getCountryList();
- const nodes = addTreeItemAreas(countries);
- setState(prevState => ({
- ...prevState,
- nodes: nodes,
- isFocused: false,
- }));
- } catch (error) {
- }
- };
- fetchData();
- }, []);
-
- return (
- <div>
- <div className={classes.root}>
- <Paper className={classes.paperTreeView}>
- <div className={classes.searchParentDiv}>
- <div className={classes.emptyDiv}></div>
- {state.isLoadingTreeView && (
- <div className={classes.loadingSpinnerTreeView}>
- <CircularProgress style={{ color: '#2596be' }} />
- </div>
- )}
- <SiteManagerSiteSearch
- handleRefresh={handleRefresh}
- handleSearch={handleSearch}
- />
- </div>
- <div style={{ display: 'contents' }}>
- {state.selected.length > 0 ?
- <TreeView
- ref={treeRef}
- className={classes.tree}
- id="site-manager-treeview"
- aria-label="controlled"
- defaultCollapseIcon={<MinusSquare />}
- defaultExpandIcon={<PlusSquare />}
- defaultEndIcon={<CloseSquare />}
- defaultExpanded={state.expanded}
- expanded={state.expanded}
- >
- {state.nodes.map((item) => renderChildren(item))}
- </TreeView>
- : <TreeView
- ref={treeRef}
- className={classes.tree}
- id="site-manager-treeview"
- aria-label="controlled"
- defaultCollapseIcon={<MinusSquare />}
- defaultExpandIcon={<PlusSquare />}
- defaultEndIcon={<CloseSquare />}
- defaultExpanded={state.expanded}
- expanded={state.expanded}
- >
- {state.nodes.map((item) => renderChildren(item))}
- </TreeView>
- }
- </div>
- </Paper>
- <Paper className={classes.paperDisplayView}>
- <div>
- {state.isLoadingDisplayView ? (
- <div className={classes.loadingSpinnerDisplayView}>
- <CircularProgress style={{ color: '#2596be' }} />
- </div>
- ) : (
- <>
- {state.isSite ?
- <div>
- <Accordion aria-label="site-details-accordion" defaultExpanded>
- <AccordionSummary
- expandIcon={<ExpandMoreOutlined />}
- aria-label="site-details-panel-header"
- id="site-detail-panel-header"
- >
- <Typography className={classes.accordionTitle} aria-label="site-details-panel-label">Site Details</Typography>
- </AccordionSummary>
- <AccordionDetails aria-label="site-details-panel-details">
- <div className={classes.iconContainer}>
- <IconButton
- aria-label={'treeview-show-on-map-button'}
- onClick={() => {
- const networkMapBaseUrl = window.location.pathname.split('#')[0];
- const siteId = state.selectedSite.id + '';
- const url = `${networkMapBaseUrl}#/network?siteId=${siteId}`;
- window.open(url);
- }}
- >
- <SiteMap />
- </IconButton>
- </div>
- <SiteDetailsAccordion siteDetails={state.selectedSite} />
- </AccordionDetails>
- </Accordion>
- <Accordion aria-label="site-configuration-accordion">
- <AccordionSummary
- expandIcon={<ExpandMoreOutlined />}
- aria-label="site-configuration-panel-header"
- id="site-detail-panel-header"
- >
- <Typography className={classes.accordionTitle} aria-label="site-configuration-panel-label">Site Configuration</Typography>
- </AccordionSummary>
- <AccordionDetails aria-label="site-details-panel-details">
- <SiteConfigurationComponent siteId={state.selectedSite.id} />
- </AccordionDetails>
- </Accordion>
- <Accordion aria-label="site-actions-accordion">
- <AccordionSummary
- expandIcon={<ExpandMoreOutlined />}
- aria-label="site-action-panel-header"
- id="site-detail-panel-header"
- >
- <Typography className={classes.accordionTitle} aria-label="site-actions-panel-label">Site Actions</Typography>
- </AccordionSummary>
- <AccordionDetails aria-label="site-actions-panel-details">
- <div>
- <Button
- onClick={() => onOpenCreateTSSReportOrderDialog()}
- aria-label='create-TSS-report-button' variant='contained' color='primary'
- >
- Create TSS-report Order
- </Button>
- </div>
- </AccordionDetails>
- </Accordion>
- <Accordion aria-label="site-additional-information-accordion">
- <AccordionSummary
- expandIcon={<ExpandMoreOutlined />}
- aria-label="site-additional-information-panel-header"
- id="site-additional-information-panel-header"
- >
- <Typography className={classes.accordionTitle} aria-label="site-additional-information-panel-label">Site Additional Information</Typography>
- </AccordionSummary>
- <AccordionDetails aria-label="site-additional-information-panel-details">
- <SiteAdditionalInformation siteId={state.selectedSite.id} />
- </AccordionDetails>
- </Accordion>
- </div>
- : <></>}
- {state.isCategory ?
- <Accordion aria-label="links-accordion" defaultExpanded>
- <AccordionSummary
- expandIcon={<ExpandMoreOutlined />}
- aria-label="links-panel-header"
- id="location-panel-header"
- >
- <Typography className={classes.accordionTitle} aria-label="links-panel-label">Category Details</Typography>
- </AccordionSummary>
- <AccordionDetails aria-label="links-panel-details">
- <table className={classes.table}>
- <tbody>
- <tr>
- <th colSpan={2}>{state.treeItemName}</th>
- </tr>
- <tr className={classes.tableDetails}>
- <td className={classes.tableDetails}>
- <>
- {state.treeItemName.includes('TSS') ?
- <TSSReportsView item={state.siteManagerCategoryItems} />
- : state.treeItemName.includes('Site Orders') ?
- <SiteOrdersView siteOrderItems={state.siteManagerCategoryItems} siteOrderItemDetails={state.siteManagerSiteOrderItems} />
- : state.treeItemName.includes('Photos') ?
- <PicturesView item={state.siteManagerCategoryItems} />
- : state.treeItemName.includes('Links') ?
- <LinkTableView preFilterType={{ id: state.selectedSite.id, type: state.selectedCategoryLinkType }} />
- : state.treeItemName === 'Nodes' ?
- <DeviceTableView preFilterType={{ id: state.selectedSite.id }} />
- : <></>
- }
- </>
- </td>
- </tr>
- </tbody>
- </table>
- </AccordionDetails>
- </Accordion>
- : <></>}
- </>
- )}
- </div>
- </Paper>
- {state.isDialogOpen ? (
- <CreateOrderView
- siteId={state.selected}
- onClose={onCloseCreateTSSReportOrderDialog}
- onError={onError}
- />
- ) : <></>}
- <MessageDialog
- openDialog={state.openDialog}
- setOpenDialog={(value: any) => setState({ ...state, openDialog: value })}
- dialogMessage={state.dialogMessage}
- onClose={handleOnCloseOfDialog}
- isFromSearch={state.isFromSearch}
- />
- </div>
- </div>
- );
-};
-
-export const SiteManagerTreeView = SiteManagerTreeViewComponent;
-export default SiteManagerTreeView;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React, { useEffect, useState } from 'react';
-
-import { faDownload } from '@fortawesome/free-solid-svg-icons';
-import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import IconButton from '@mui/material/IconButton';
-import makeStyles from '@mui/styles/makeStyles';
-
-import { ColumnType, MaterialTable, MaterialTableCtorType } from '../../../../framework/src/components/material-table';
-
-import { SiteManagerCategoryItems, SiteManagerSiteOrderItemsDetails } from '../models/siteManager';
-
-const styles = makeStyles({
- root: {
- '&:hover': {
- color: 'blue',
- },
- },
-});
-
-const SiteOrders = MaterialTable as MaterialTableCtorType<any>;
-
-type joinSiteOrdersDetailsResult = {
- name: string | undefined;
- url: string;
- assignedUser: string;
- state: string;
- note: string;
- type: string;
- description: string;
- completed: boolean;
-};
-
-type SiteOrdersComponentProps = {
- siteOrderItems: SiteManagerCategoryItems;
- siteOrderItemDetails: SiteManagerSiteOrderItemsDetails;
-};
-
-const SiteOrdersViewComponent: React.FC<SiteOrdersComponentProps> = (props) => {
- const [siteOrdersTableData, setSiteOrdersTableData] = useState<joinSiteOrdersDetailsResult[]>([]);
- const [isLoaded, setIsLoaded] = useState<boolean>(false);
- const classes = styles();
-
- const downloadSiteOrdersReport = (url: string) => {
- let fileName = url.substring(
- url.lastIndexOf('/') + 1,
- url.lastIndexOf('.'),
- );
- fetch(url)
- .then(resp => resp.blob())
- .then(blob => {
- const reportUrl = window.URL.createObjectURL(blob);
- const a = document.createElement('a');
- a.style.display = 'none';
- a.href = reportUrl;
- a.download = fileName;
- document.body.appendChild(a);
- a.click();
- window.URL.revokeObjectURL(reportUrl);
- alert('Report has downloaded!');
- })
- .catch(() => alert('oh no! something went wrong'));
- };
-
- const joinColumns = () => {
- let siteOrdersItemList = props.siteOrderItems;
- let siteOrdersDetailsList = props.siteOrderItemDetails;
- let updatedSiteOrdersTableData: joinSiteOrdersDetailsResult[] = [];
-
- siteOrdersItemList.forEach(siteOrder => {
- const name = siteOrder.name;
- const userName = name.substring(name.lastIndexOf('-') + 1);
- let indexDetails = 0;
- for (; indexDetails < siteOrdersDetailsList.length; indexDetails++) {
- const detail = siteOrdersDetailsList[indexDetails];
- if (userName === detail.assignedUser) {
- updatedSiteOrdersTableData.push({
- name: name,
- url: siteOrder.url,
- assignedUser: userName,
- state: detail.state,
- note: detail.note,
- type: detail.tasks[0]?.type,
- description: detail.tasks[0]?.description,
- completed: detail.tasks[0]?.completed,
- });
- break;
- }
- }
- siteOrdersDetailsList.splice(indexDetails, 1);
- });
- siteOrdersItemList.splice(0, siteOrdersItemList.length);
- setSiteOrdersTableData(updatedSiteOrdersTableData);
- setIsLoaded(true);
- };
-
- useEffect(() => {
- if (!isLoaded) {
- joinColumns();
- }
- }, [props.siteOrderItems, props.siteOrderItemDetails, isLoaded]);
-
- return (
- <>
- {isLoaded ? (
- <SiteOrders stickyHeader tableId='device-table' columns={[
- {
- property: 'name', title: 'Name', type: ColumnType.custom, customControl: ({ rowData }) => {
- if (rowData.url === '') {
- return (<>{rowData.name}</>);
- } else {
- return (<a href={rowData.url} target='_blank' > {rowData.name} </a>);
- }
- },
- },
- { property: 'state', title: 'State', type: ColumnType.text },
- { property: 'description', title: 'Current Task', type: ColumnType.text },
- {
- property: 'url', title: 'Action', type: ColumnType.custom, customControl: ({ rowData }) => {
- if (rowData.url === '') {
- return (<IconButton disabled> <FontAwesomeIcon icon={faDownload} /> </IconButton>);
- } else {
- return (
- <FontAwesomeIcon icon={faDownload} className={classes.root} onClick={(event) => { event.stopPropagation(); downloadSiteOrdersReport(rowData.url); }} />
- );
- }
- },
- },
- ]} idProperty='id' rows={siteOrdersTableData} >
- </SiteOrders>) : (
- <div>Loading...</div>
- )}
- </>
- );
-};
-
-
-export const SiteOrdersView = SiteOrdersViewComponent;
-export default SiteOrdersView;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React, { useEffect, useState } from 'react';
-
-import Map from '@mui/icons-material/Map';
-import Refresh from '@mui/icons-material/Refresh';
-import { Divider, MenuItem, Typography } from '@mui/material';
-
-import { NavigateToApplication } from '../../../../framework/src/actions/navigationActions';
-import { ColumnType, MaterialTable, MaterialTableCtorType } from '../../../../framework/src/components/material-table';
-import { useSelectApplicationState, useApplicationDispatch } from '../../../../framework/src/flux/connect';
-import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore';
-
-import { SearchValueAction } from '../actions/siteManagerSiteSearchAction';
-import { createSiteTableActions, createSiteTableProperties } from '../handlers/siteTableHandler';
-import { SiteDetails } from '../models/siteDetails';
-import RefreshSiteTableDialog, { RefreshSiteTableDialogMode } from './refreshSiteTableDialog';
-
-
-const SiteTable = MaterialTable as MaterialTableCtorType<SiteDetails>;
-
-let initialSorted = false;
-
-const SiteTableComponent: React.FC = () => {
- const siteTableProperties = useSelectApplicationState((state: IApplicationStoreState) => createSiteTableProperties(state));
-
- const dispatch = useApplicationDispatch();
- const siteTableActions = createSiteTableActions(dispatch);
- const navigateToApplication = (applicationName: string, path?: string) => dispatch(new NavigateToApplication(applicationName, path));
-
- const [refreshSiteTableEditorMode, setRefreshSiteTableEditorMode] = useState<RefreshSiteTableDialogMode>(RefreshSiteTableDialogMode.None);
-
- const setSearchTerm = (event: React.SyntheticEvent, value: string) => dispatch(new SearchValueAction(value));
-
- const getContextMenu = (rowData: SiteDetails) => {
- return [
- <MenuItem aria-label={'inventory-button'} onClick={(event: React.SyntheticEvent) => {
- navigateToApplication('siteManager', '/treeview/' + rowData.id);
- setSearchTerm(event, rowData.id + '');
- }}>
- <Typography>View in Treeview</Typography>
- </MenuItem>,
- <Divider />,
- <MenuItem aria-label={'show-on-map-button'} onClick={() => {
- const siteId = rowData.id;
- const baseUrl = window.location.pathname.split('#')[0];
- const url = `${baseUrl}#/network?siteId=${siteId}`;
- window.open(url);
- }}>
- <Typography>Show on Map</Typography>
- </MenuItem>,
- ];
- };
-
- useEffect(() => {
- if (!initialSorted) {
- initialSorted = true;
- siteTableActions.onHandleExplicitRequestSort('id', 'asc');
- } else {
- siteTableActions.onRefresh();
- }
- }, []);
-
- const refreshSiteTableAction = [{
- icon: Refresh, tooltip: 'Refresh Site Table', ariaLabel: 'refresh', onClick: () => {
- setRefreshSiteTableEditorMode(RefreshSiteTableDialogMode.RefreshSiteTableTable);
- },
- },
- ...siteTableProperties.showFilter ? [{
- icon: Map, tooltip: 'Show on map', ariaLabel: 'showOnMap', onClick: async () => {
- const siteId = siteTableProperties.rows[0].id;
- const baseUrl = window.location.pathname.split('#')[0];
- const url = `${baseUrl}#/network?siteId=${siteId}`;
- window.open(url);
- },
- }] : [],
- ];
-
- return (
- <>
- <SiteTable stickyHeader tableId='site-table' customActionButtons={refreshSiteTableAction} columns={[
- { property: 'id', title: 'Site Id', type: ColumnType.numeric },
- { property: 'name', title: 'Site Name', type: ColumnType.text },
- { property: 'areaName', title: 'Area Name', type: ColumnType.text },
- { property: 'operationalState', title: 'operational State', type: ColumnType.text },
- { property: 'operatorId', title: 'Operator Id', type: ColumnType.text },
- { property: 'lifecycleState', title: 'life Cycle State', type: ColumnType.text },
- { property: 'forecastEnabled', title: 'Forecast Enabled', type: ColumnType.boolean },
- { property: 'alarmState', title: 'Alarm State', type: ColumnType.text },
- { property: 'latitude', title: 'Latitude', type: ColumnType.numeric },
- { property: 'longitude', title: 'Longitude', type: ColumnType.numeric },
- ]} idProperty='id' {...siteTableActions} {...siteTableProperties}
- createContextMenu={rowData => {
- return getContextMenu(rowData);
- }} >
- </SiteTable>
- <RefreshSiteTableDialog
- mode={refreshSiteTableEditorMode}
- onClose={() => setRefreshSiteTableEditorMode(RefreshSiteTableDialogMode.None)}
- />
- </>
- );
-};
-
-export const SiteTableView = SiteTableComponent;
-export default SiteTableView;
\ No newline at end of file
+++ /dev/null
-/* eslint-disable react/prop-types */
-/**
- * ============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 React from 'react';
-import { TreeItemContentProps, useTreeItem } from '@mui/lab/TreeItem';
-import Typography from '@mui/material/Typography';
-import clsx from 'clsx';
-import { useSelectApplicationState } from '../../../../framework/src/flux/connect';
-import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore';
-
-type TreeItemComponentProps = TreeItemContentProps;
-
-interface CustomContentProps extends TreeItemComponentProps {
- toggleTreeItems: (nodeId: string, expanded: boolean) => Promise<any>;
- retrieveDetails: (siteId: string, isCallFromSearch: boolean) => void;
- isNodeSelected: boolean;
-}
-
-// Custom TreeItem content
-export const CustomContent = React.forwardRef<any>(function CustomContent(
- props: CustomContentProps,
- ref,
-) {
- const {
- classes,
- className,
- label,
- nodeId,
- icon: iconProp,
- expansionIcon,
- displayIcon,
- toggleTreeItems,
- retrieveDetails,
- isNodeSelected,
-
- } = props;
-
- const {
- disabled,
- expanded,
- selected,
- focused,
- handleExpansion,
- handleSelection,
- preventSelection,
- } = useTreeItem(nodeId);
- useSelectApplicationState((state: IApplicationStoreState) => state.siteManager);
-
- const icon = iconProp || expansionIcon || displayIcon;
-
- const handleMouseDown = (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
- preventSelection(event);
- };
-
- const handleExpansionClick = async (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
- await toggleTreeItems(nodeId, expanded).then(() => {
- handleExpansion(event);
- });
- handleExpansion(event);
- };
-
- const handleSelectionClick = (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
- retrieveDetails(nodeId, false);
- handleSelection(event);
- };
-
- return (
- <div
- className={clsx(className, classes.root, {
- [classes.expanded]: expanded,
- [classes.selected]: isNodeSelected || selected,
- [classes.focused]: isNodeSelected || focused,
- [classes.disabled]: disabled,
- })}
- onMouseDown={handleMouseDown}
- ref={ref as React.RefObject<HTMLDivElement>}
- >
- <div onClick={handleExpansionClick} className={classes.iconContainer}>
- {icon}
- </div>
- <Typography
- onClick={handleSelectionClick}
- component='div'
- className={classes.label}
- >
- <div onClick={handleExpansionClick}>{label}</div>
- </Typography>
- </div>
- );
-});
-
+++ /dev/null
-/**
- * ============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 React, { useState } from 'react';
-
-import { faDownload } from '@fortawesome/free-solid-svg-icons';
-import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import IconButton from '@mui/material/IconButton';
-import makeStyles from '@mui/styles/makeStyles';
-
-import { ColumnType, MaterialTable, MaterialTableCtorType } from '../../../../framework/src/components/material-table';
-
-const styles = makeStyles({
- root: {
- '&:hover': {
- color: 'blue',
- },
- },
-});
-
-const TSSReports = MaterialTable as MaterialTableCtorType<any>;
-
-type TSSReportsComponentProps = {
- item: {
- name: string;
- url: string;
- 'last-update': string;
- }[];
-};
-
-const TSSReportsComponent: React.FC<TSSReportsComponentProps> = (props) => {
- const [item] = useState(props.item);
-
- const classes = styles();
-
- const downloadTSSReport = (url: string) => {
- let fileName = url.substring(
- url.lastIndexOf('/') + 1,
- );
- fetch(url)
- .then(resp => resp.blob())
- .then(blob => {
- const reportUrl = window.URL.createObjectURL(blob);
- const link = document.createElement('a');
- link.style.display = 'none';
- link.href = reportUrl;
- link.setAttribute('download', fileName);
- document.body.appendChild(link);
- link.click();
- window.URL.revokeObjectURL(reportUrl);
- alert('Report has downloaded!');
- })
- .catch(() => alert('oh no! something went wrong'));
- };
-
- return (
- <>
- <TSSReports stickyHeader tableId='device-table' columns={[
- {
- property: 'name', title: 'Name', type: ColumnType.custom, customControl: ({ rowData }) => {
- if (rowData.url === '') {
- return (<>{rowData.name}</>);
- } else {
- return (<a href={rowData.url} target='_blank' > {rowData.name} </a>);
- }
- },
- },
- {
- property: 'url', title: 'Action', type: ColumnType.custom, customControl: ({ rowData }) => {
- if (rowData.url === '') {
- return (<IconButton disabled> <FontAwesomeIcon icon={faDownload} /> </IconButton>);
- } else {
- return (
- <FontAwesomeIcon icon={faDownload} className={classes.root} onClick={(event) => { event.stopPropagation(); downloadTSSReport(rowData.url); }} />
- );
- }
- },
- },
- ]} idProperty='id' rows={item} >
- </TSSReports>
- </>
- );
-};
-
-export const TSSReportsView = TSSReportsComponent;
-export default TSSReportsView;
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-export const URL_API = '/topology/network';
-export const SITEDOC_URL = '/sitedoc';
-export const URL_TILE_API = '/tiles'; // http://tile.openstreetmap.org can be used for local testing, never commit with tile url changed! /tiles
-
-
-export const OSM_STYLE = {
- 'version': 8,
- 'sources': {
- 'raster-tiles': {
- 'type': 'raster',
- 'tiles': [
- URL_TILE_API + '/{z}/{x}/{y}.png',
- ],
- 'tileSize': 256,
- 'attribution':
- '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
- },
- },
- 'layers': [
- {
- 'id': 'simple-tiles',
- 'type': 'raster',
- 'source': 'raster-tiles',
- 'minZoom': 0,
- 'maxZoom': 18,
- },
- ],
-};
-
-export const URL_BASEPATH = 'network';
-
-
+++ /dev/null
-/* eslint-disable @typescript-eslint/default-param-last */
-/* eslint-disable no-param-reassign */
-/**
- * ============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 { IActionHandler } from '../../../../framework/src/flux/action';
-
-import {
- AddToHistoryAction, ClearDetailsAction, ClearHistoryAction, ClearLoadedDevicesAction, FinishedLoadingDeviceListAction, InitializeLoadedDevicesAction,
- IsBusyCheckingDeviceListAction, IsSitedocReachableAction, SelectElementAction,
-} from '../actions/detailsAction';
-import { HistoryEntry } from '../models/historyEntry';
-import { link } from '../models/link';
-import { Device, Site } from '../models/site';
-import { Service } from '../models/topologyTypes';
-
-export type DetailsStoreState = {
- data: Site | link | Service | null;
- history: HistoryEntry[];
- isBusyCheckingDeviceList: boolean;
- checkedDevices: Device[];
- isSitedocReachable: boolean;
-};
-
-const initialState: DetailsStoreState = {
- data: null,
- history: [],
- isBusyCheckingDeviceList: false,
- checkedDevices: [],
- isSitedocReachable: false,
-};
-
-export const DetailsReducer: IActionHandler<DetailsStoreState> = (state = initialState, action) => {
- if (action instanceof SelectElementAction) {
- state = Object.assign({}, state, { data: action.data });
- } else if (action instanceof ClearDetailsAction) {
- state = Object.assign({}, state, { data: null });
- } else if (action instanceof AddToHistoryAction) {
- state = Object.assign({}, state, { history: [...state.history, action.entry] });
- } else if (action instanceof ClearHistoryAction) {
- state = Object.assign({}, state, { history: [] });
- } else if (action instanceof IsBusyCheckingDeviceListAction) {
- state = Object.assign({}, state, { isBusyCheckingDeviceList: action.isBusy });
- } else if (action instanceof FinishedLoadingDeviceListAction) {
- state = Object.assign({}, state, { checkedDevices: action.devices });
- } else if (action instanceof ClearLoadedDevicesAction) {
- state = Object.assign({}, state, { checkedDevices: [] });
- } else if (action instanceof InitializeLoadedDevicesAction) {
- state = Object.assign({}, state, { checkedDevices: action.devices });
- } else if (action instanceof IsSitedocReachableAction) {
- state = Object.assign({}, state, { isSitedocReachable: action.isReachable });
- }
- return state;
-};
-
+++ /dev/null
-/**
- * ============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 { DeviceDetails } from '../models/siteManager';
-
-export interface IDeviceTableState extends IExternalTableState<DeviceDetails> { }
-
-// create elastic search material data fetch handler
-const deviceTableSearchHandler = createSearchDataHandler<DeviceDetails>('device', true);
-
-export const {
- actionHandler: deviceTableActionHandler,
- createActions: createDeviceTableActions,
- createProperties: createDeviceTableProperties,
- createPreActions: createDeviceTablePreActions,
- reloadAction: deviceTableReloadAction,
-
- // set value action, to change a value
-} = createExternal<DeviceDetails>(deviceTableSearchHandler, appState => appState.siteManager.deviceTable);
-
+++ /dev/null
-/**
- * ============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 { LinkDetails } from '../models/siteManager';
-
-export interface ILinkTableState extends IExternalTableState<LinkDetails> { }
-
-// create elastic search material data fetch handler
-const linkTableSearchHandler = createSearchDataHandler<LinkDetails>('link', true);
-
-export const {
- actionHandler: linkTableActionHandler,
- createActions: createLinkTableActions,
- createProperties: createLinkTableProperties,
- createPreActions: createLinkTablePreActions,
- reloadAction: linkTableReloadAction,
-
- // set value action, to change a value
-} = createExternal<LinkDetails>(linkTableSearchHandler, appState => appState.siteManager.linkTable);
-
+++ /dev/null
-/**
-* ============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 { combineActionHandler } from '../../../../framework/src/flux/middleware';
-
-import { SetPanelAction } from '../actions/panelActions';
-import { SearchValueAction } from '../actions/siteManagerSiteSearchAction';
-import { PanelId } from '../models/panelId';
-import { DetailsReducer, DetailsStoreState } from './detailsReducer';
-import { deviceTableActionHandler, IDeviceTableState } from './deviceTableHandler';
-import { ILinkTableState, linkTableActionHandler } from './linkTableHandler';
-import { ManagementHandler, ManagementState } from './sitedocManagementHandler';
-import { siteManagerSiteSearchHandler } from './siteManagerSiteSearchHandler';
-import { areasActionHandler, IAreasState } from './siteManagerTreeHandler';
-import { ISiteTableState, siteTableActionHandler } from './siteTableHandler';
-
-export interface ISiteManagerAppStoreState {
- siteManagerTree: IAreasState;
- searchSite: SearchValueAction;
- sitedocManagement: ManagementState;
- details: DetailsStoreState;
- currentOpenPanel: PanelId;
- siteTable: ISiteTableState;
- linkTable: ILinkTableState;
- deviceTable: IDeviceTableState;
-}
-
-const currentOpenPanelHandler: IActionHandler<PanelId> = (state = null, action) => {
- if (action instanceof SetPanelAction) {
- state = action.panelId;
- }
- return state;
-};
-
-
-
-declare module '../../../../framework/src/store/applicationStore' {
- interface IApplicationStoreState {
- siteManager: ISiteManagerAppStoreState;
- }
-}
-
-const actionHandlers = {
- siteManagerTree: areasActionHandler,
- searchSite: siteManagerSiteSearchHandler,
- sitedocManagement: ManagementHandler,
- details: DetailsReducer,
- currentOpenPanel: currentOpenPanelHandler,
- siteTable: siteTableActionHandler,
- linkTable: linkTableActionHandler,
- deviceTable: deviceTableActionHandler,
-};
-
-export const siteManagerAppRootHandler = combineActionHandler<ISiteManagerAppStoreState>(actionHandlers);
-export default siteManagerAppRootHandler;
-
+++ /dev/null
-/**
- * ============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 { IActionHandler } from '../../../../framework/src/flux/action';
-
-import { AllTreeSiteSearchBySiteIdOrNameLoadedAction, LoadTreeSiteSearchBySiteIdOrNameAction, SearchValueAction, SetBusyAction }
- from '../actions/siteManagerSiteSearchAction';
-import { SearchSiteIdResult } from '../models/siteManager';
-
-export type searchState = {
- siteId: string;
- categoryName: string;
- searchValue: SearchSiteIdResult;
- busy: boolean;
- isLoadingData: boolean;
-};
-
-const initialState: searchState = {
- siteId: '',
- categoryName: '',
- searchValue: {
- areas: [],
- sites: [],
- isError: false,
- errorMessage: '',
- },
- busy: false,
- isLoadingData: true,
-};
-
-export const siteManagerSiteSearchHandler: IActionHandler<searchState> = (state = initialState, action) => {
- if (action instanceof SearchValueAction) {
- state = Object.assign({}, state, { siteId: action.siteId, categoryName: action.categoryName });
- } else if (action instanceof LoadTreeSiteSearchBySiteIdOrNameAction) {
- state = {
- ...state,
- busy: true,
- };
- } else if (action instanceof AllTreeSiteSearchBySiteIdOrNameLoadedAction) {
- if (action.searchResult) {
- state = {
- ...state,
- searchValue: {
- areas: action.searchResult.areas,
- sites: action.searchResult.sites,
- isError: action.searchResult.isError,
- errorMessage: action.searchResult.errorMessage,
- },
- busy: false,
- };
- }
- } else if (action instanceof SetBusyAction) {
- state = {
- ...state,
- isLoadingData: action.busy,
- };
- }
- return state;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { IActionHandler } from '../../../../framework/src/flux/action';
-
-import {
- AllAreasByAreaIdLoadedAction, AllCategoriesBySiteIdALoadedAction, AllCategoryItemsBySiteIdALoadedAction,
- AllCountriesLoadedAction, AllSiteBySiteIdALoadedAction, AllSitesByAreaIdLoadedAction, LoadAllAreasByAreaIdAction,
- LoadAllCategoriesBySiteIdAction, LoadAllCategoryItemsBySiteIdAction, LoadAllCountriesAction, LoadAllSiteBySiteIdAction,
- LoadAllSitesByAreaIdAction, SetBusyAction, LoadAllFrequencyPlanBySiteIdAction, AllFrequencyPlanBySiteIdALoadedAction,
- LoadAllAvailableBandsAction, AllAvailableBandsALoadedAction,
-} from '../actions/siteManagerTreeActions';
-import { LinkDetails, SiteManagerAreas, SiteManagerCategories, SiteManagerCategoryItems, SitesListResult } from '../models/siteManager';
-import { Site } from '../models/siteSearch';
-
-export interface IAreasState {
- countryList: SiteManagerAreas[];
- areaList: SiteManagerAreas[];
- sitesList: SitesListResult;
- categoryList: SiteManagerCategories[];
- frequencyPlan: any[];
- bands: any[];
- siteDetails: Site;
- categoryItems: SiteManagerCategoryItems;
- linksList: LinkDetails[];
- busy: boolean;
- isLoadingData: boolean;
-}
-
-const areasStateInit: IAreasState = {
- countryList: [],
- areaList: [],
- sitesList: {
- sites: [],
- isError: false,
- errorMessage: '',
- },
- categoryList: [],
- frequencyPlan: [],
- bands: [],
- siteDetails: {
- id: '',
- uuid: '',
- name: '',
- 'area-id': '',
- 'item-count': 0,
- address: {
- streetAndNr: '',
- city: '',
- zipCode: '',
- country: '',
- },
- operator: '',
- location: {
- lon: '',
- lat: '',
- },
- },
- categoryItems: [{
- name: '',
- url: '',
- 'last-update': '',
- }],
- linksList: [],
- busy: false,
- isLoadingData: true,
-};
-
-export const areasActionHandler: IActionHandler<IAreasState> = (state = areasStateInit, action) => {
- if (action instanceof LoadAllCountriesAction) {
- state = {
- ...state,
- busy: true,
- };
- } else if (action instanceof AllCountriesLoadedAction) {
- if (action.countriesList) {
- state = {
- ...state,
- countryList: action.countriesList,
- busy: true,
- };
- }
- } else if (action instanceof LoadAllAreasByAreaIdAction) {
- state = {
- ...state,
- busy: true,
- };
- } else if (action instanceof AllAreasByAreaIdLoadedAction) {
- if (action.areaList) {
- state = {
- ...state,
- areaList: action.areaList,
- busy: true,
- };
- }
- } else if (action instanceof LoadAllSitesByAreaIdAction) {
- state = {
- ...state,
- busy: true,
- };
- } else if (action instanceof AllSitesByAreaIdLoadedAction) {
- if (action.sitesList) {
- state = {
- ...state,
- sitesList: action.sitesList,
- busy: true,
- };
- }
- } else if (action instanceof LoadAllCategoriesBySiteIdAction) {
- state = {
- ...state,
- busy: true,
- };
- } else if (action instanceof AllCategoriesBySiteIdALoadedAction) {
- if (action.categoryList) {
- state = {
- ...state,
- categoryList: action.categoryList,
- busy: true,
- };
- }
- } else if (action instanceof LoadAllFrequencyPlanBySiteIdAction) {
- state = {
- ...state,
- busy: true,
- };
- } else if (action instanceof AllFrequencyPlanBySiteIdALoadedAction) {
- if (action.freqPlanList) {
- state = {
- ...state,
- frequencyPlan: action.freqPlanList,
- busy: true,
- };
- }
- } else if (action instanceof LoadAllAvailableBandsAction) {
- state = {
- ...state,
- busy: true,
- };
- } else if (action instanceof AllAvailableBandsALoadedAction) {
- if (action.bandsList) {
- state = {
- ...state,
- bands: action.bandsList,
- busy: true,
- };
- }
- } else if (action instanceof LoadAllSiteBySiteIdAction) {
- state = {
- ...state,
- busy: true,
- };
- } else if (action instanceof AllSiteBySiteIdALoadedAction) {
- if (action.siteDetails) {
- state = {
- ...state,
- siteDetails: {
- id: action.siteDetails.id,
- name: action.siteDetails.name,
- uuid: action.siteDetails.uuid,
- 'area-id': action.siteDetails['area-id'],
- 'item-count': action.siteDetails['item-count'],
- address: {
- streetAndNr: action.siteDetails.address ? action.siteDetails.address.streetAndNr : '',
- city: action.siteDetails.address ? action.siteDetails.address.city : '',
- zipCode: action.siteDetails.address ? action.siteDetails.address.zipCode : '',
- country: action.siteDetails.address ? action.siteDetails.address.country : '',
- },
- operator: action.siteDetails.operator,
- location: {
- lon: action.siteDetails.location ? action.siteDetails.location.lon : '',
- lat: action.siteDetails.location ? action.siteDetails.location.lat : '',
- },
- },
- busy: true,
- };
- }
- } else if (action instanceof LoadAllCategoryItemsBySiteIdAction) {
- state = {
- ...state,
- busy: true,
- };
- } else if (action instanceof AllCategoryItemsBySiteIdALoadedAction) {
- if (action.categoryItemList) {
- state = {
- ...state,
- categoryItems: [{
- name: action.categoryItemList[0].name,
- url: action.categoryItemList[0].url,
- 'last-update': action.categoryItemList[0]['last-update'],
- }],
- busy: true,
- };
- }
- } else if (action instanceof SetBusyAction) {
- state = {
- ...state,
- isLoadingData: action.busy,
- };
- }
-
- return state;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { SiteDetails } from '../models/siteDetails';
-
-export interface ISiteTableState extends IExternalTableState<SiteDetails> { }
-
-// create elastic search material data fetch handler
-const siteTableSearchHandler = createSearchDataHandler<SiteDetails>('site', true);
-
-export const {
- actionHandler: siteTableActionHandler,
- createActions: createSiteTableActions,
- createProperties: createSiteTableProperties,
- reloadAction: siteTableReloadAction,
-
- // set value action, to change a value
-} = createExternal<SiteDetails>(siteTableSearchHandler, appState => appState.siteManager.siteTable);
-
+++ /dev/null
-/**
- * ============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 { IActionHandler } from '../../../../framework/src/flux/action';
-
-import { ResetAction, SelectUserAction, SetAllUsersAction, SetTSSRAction, UpdateNoteAction, UpdateStateAction, UpdateTasks } from '../actions/sitedocManagementAction';
-import { SitedocOrderTask, UserListItem } from '../models/siteDocTypes';
-
-const emptyTask: SitedocOrderTask = { type: '', description: '', completed: false };
-
-
-export type ManagementState = {
- users: UserListItem[];
- selectedUser: string;
- note: string;
- tasks: SitedocOrderTask[];
- isTSSR: boolean;
- state: string;
-};
-
-const initialState: ManagementState = {
- users: [],
- selectedUser: '',
- state: 'OPEN',
- note: '',
- tasks: [emptyTask],
- isTSSR: false,
-};
-
-export const ManagementHandler: IActionHandler<ManagementState> = (state = initialState, action) => {
- if (action instanceof SetAllUsersAction) {
- state = { ...state, users: action.users };
- } else if (action instanceof SelectUserAction) {
- state = { ...state, selectedUser: action.user };
- } else if (action instanceof SetTSSRAction) {
- state = { ...state, isTSSR: action.isTSSR };
- } else if (action instanceof UpdateNoteAction) {
- state = { ...state, note: action.note };
- } else if (action instanceof UpdateStateAction) {
- state = { ...state, state: action.state };
- } else if (action instanceof UpdateTasks) {
- state = { ...state, tasks: action.tasks };
- } else if (action instanceof ResetAction) {
- state = { ...state, tasks: [emptyTask], selectedUser: '', note: '', isTSSR: false };
- }
- return state;
-};
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <!-- <link rel="stylesheet" href="./vendor.css" > -->
- <title>SiteManager App</title>
-</head>
-
-<body>
- <div id="app"></div>
- <script type="text/javascript" src="./require.js"></script>
- <script type="text/javascript" src="./config.js"></script>
-
- <script>
- // run the application
- require(["app", "connectApp", "faultApp", "networkMapApp", "siteManagerApp",],
- function (app, connectApp,faultApp, networkMapApp, siteManagerApp) {
- connectApp.register();
- faultApp.register();
- networkMapApp.register();
- siteManagerApp.register();
- app("./app.tsx").runApplication();
- });
- </script>
-</body>
-
-</html>
\ No newline at end of file
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-export type elementCount = { sites: string; links: string; services: string };
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { link } from './link';
-import { Site } from './site';
-
-export type HistoryEntry = { id: string; data: Site | link };
\ No newline at end of file
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-type Antenna = {
- id: string;
- name: string;
- height: number;
- gain: number;
-};
-
-type LinkDetailLocation = {
- lon: number;
- lat: number;
- siteId: number;
- siteName: string | null;
- amsl: number | null;
- azimuth: number | null;
- antenna: Antenna;
- radio: { id: number; name: string };
- waveguide: { id: number; name: string };
-};
-
-export type link = {
- id: number;
- uuid: string;
- name: string;
- operator: string;
- length: number;
- polarization: string;
- type: string;
- frequency: number | null;
- siteA: LinkDetailLocation;
- siteB: LinkDetailLocation;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-export type NetworkElementConnection = {
- id?: string;
- nodeId: string;
- isRequired: boolean;
- host: string;
- port: number;
- username?: string;
- password?: string;
- tlsKey?: string;
- status?: 'Connected' | 'mounted' | 'unmounted' | 'Connecting' | 'Disconnected' | 'idle';
- ['device-type']?: string;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-export type PanelId = null | 'TreeView' | 'SiteTable';
\ No newline at end of file
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-export type Site = {
- id: number;
- uuid: string;
- name: string;
- address: Address;
- heightAmslInMeters?: number; //AboveGroundLevel
- antennaHeightAmslInMeters?: number;
- type?: string;
- operator: string;
- location: { lon: number; lat: number };
- devices: Device[];
- links: { id: number; name: string; azimuth: number | null }[];
- furtherInformation: string;
-};
-
-export type Address = {
- streetAndNr: string;
- city: string;
- zipCode: string | null;
- country: string;
-};
-
-export type Device = {
- id: string;
- type?: string;
- name: string;
- manufacturer: string;
- owner: string;
- status?: string;
- port: number[];
-}
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 SiteDetails = {
- administrativeState: string;
- alarmState: string;
- areaId: string;
- areaName: string;
- forecastEnabled: boolean;
- id: number;
- labels: [];
- latitude: number;
- lifecycleState: string;
- longitude: number;
- name: string;
- operationalState: string;
- operatorId: string;
- uuid: string;
-};
-
+++ /dev/null
-/**
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt odlux
- * =================================================================================================
- * Copyright (C) 2022 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 UserListItem = {
- userName: string;
- firstName: string;
- lastName: string;
-};
-
-export type RegisterUser = {
- firstName: string;
- familyName: string;
- email: string;
- username: string;
- password: string;
- telephoneNr: string;
- role: 'ANDROID';
-};
-
-export type SitedocOrder = {
- reportFile: string;
- assignedUser: string;
- date: string; //in UTC
- state: SitedocOrderTypes;
- tasks: SitedocOrderTask[];
- note: string;
- isTssr: boolean;
-};
-
-export type SitedocOrderTypes = 'OPEN' | 'UPDATE' | 'DELETE';
-
-export type SitedocOrderTask = {
- type: string;
- description: string;
- completed: false;
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-export type SiteManagerAreas = {
- id: string;
- name: string;
- 'tree-level': number;
- 'parent-id'?: string;
- 'area-count'?: number;
- 'site-count'?: number;
- 'site-level'?: boolean;
- 'areas'?: SiteManagerAreas[];
-};
-
-export interface ITreeViewItem {
- id: string;
- name: string;
- isSite: boolean;
- isCategory: boolean;
- parentId: string;
- areaCount: number;
- siteCount: number;
- isNodeSelected: boolean;
- uuid?: number;
- treeLevel?: number;
- siteLevel?: boolean;
- url?: string;
- linkType?: string;
- children?: ITreeViewItem[];
-}
-
-export type Sites = {
- id: string;
- uuid: string;
- name: string;
- amslInMeters: string;
- type: string;
- 'area-id': string;
- 'item-count': number;
- address: {
- streetAndNr: string;
- city: string;
- zipCode: string;
- country: string;
- };
- operator: string;
- location: {
- lon: string;
- lat: string;
- };
-};
-
-export interface SearchSiteIdResult {
- areas: SiteManagerAreas[];
- sites: Sites[];
- isError: boolean;
- errorMessage: string;
-}
-
-export interface SitesListResult {
- sites: Sites[];
- isError: boolean;
- errorMessage: string;
-}
-
-export type SiteManagerCategories = {
- id: string;
- name: string;
- url: string;
- 'link-type': string;
-};
-
-export type SiteManagerCategoryItems = {
- name: string;
- url: string;
- 'last-update': string;
-}[];
-
-export type SiteManagerSiteOrderItemsDetails = {
- assignedUser: string;
- state: string;
- note: string;
- tasks: {
- type: string;
- description: string;
- completed: boolean;
- }[];
-}[];
-
-export type LinkDetails = {
- administrativeState: string;
- deviceA: { id: number; nodeId: string; uuid: string };
- deviceB: { id: number; nodeId: string; uuid: string };
- id: number;
- labels: [];
- lifecycleState: string;
- name: string;
- operationalState: string;
- operatorId: string;
- siteA: {
- areaId: string;
- areaName: string;
- id: number;
- latitude: number;
- longitude: number;
- name: string;
- operatorId: string;
- uuid: string;
- };
- siteB: {
- areaId: string;
- areaName: string;
- id: number;
- latitude: number;
- longitude: number;
- name: string;
- operatorId: string;
- uuid: string;
- };
- type: string;
- uuid: string;
-};
-
-export type DeviceDetails = {
- areaId: string;
- areaName: string;
- calculationParameters: string;
- id: number;
- manufacturerId: number;
- manufacturerName: string;
- modelId: number;
- modelName: string;
- nodeId: string;
- operationalParameters: string;
- siteId: number;
- siteName: string;
- uuid: string;
-};
-
-export type SiteConfigurationFreqPlan = [
- {
- id: number;
- siteId: number;
- band: {
- id: number;
- name: string;
- duplexspacingMhz: number;
- };
- status: string;
- configuration: string;
- comment: string;
- },
-];
-
-export type addEditSiteConfig = {
- configuration: string;
- comment: string;
-};
-
-
-export type Bands = [
- {
- id: number;
- name: string;
- duplexspacingMhz: number;
- },
-];
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-
-export type Site = {
- id: string;
- uuid: string;
- name: string;
- 'area-id': string;
- 'item-count': number;
- address: {
- streetAndNr: string;
- city: string;
- zipCode: string;
- country: string;
- };
- operator: string;
- location: {
- lon: string;
- lat: string;
- };
-};
-
-export type SearchResult = {
- sites: Site[];
-};
\ No newline at end of file
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-
-export type Address = {
- streetAndNr: string;
- city: string;
- zipCode: string | null;
- country: string;
-};
-
-type StadokSite = {
- id: string;
- createdBy: Contact;
- updatedOn: Date;
- location: { lat: number; lon: number };
- address: Address;
- contacts: { manager: Contact; owner: Contact };
- safetyNotices: string[];
- images: string[];
- type: string;
- devices: Device[];
- logs: Log[];
-};
-
-type Contact = {
- firstName: string;
- lastName: string;
- email: string;
- telephoneNumber: string;
-};
-type Log = {
- date: Date; //string?
- person: string;
- entry: string;
-};
-
-type Device = {
- 'device': string;
- 'antenna': string;
-};
-
-export default StadokSite;
\ No newline at end of file
+++ /dev/null
-type Route = { lat: number; lon: number };
-
-export type Service = {
- 'id': number;
- 'name': string;
- 'type': string;
- 'backupForServiceId': number | null;
- 'lifecycleState': string;
- 'administrativeState': string;
- 'operationalState': string;
- 'created': string;
- 'modified': string;
- 'route': Route[];
- 'length': number;
-};
\ No newline at end of file
+++ /dev/null
-/**
-* ============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 React from 'react';
-import { Redirect, Route, RouteComponentProps, Switch, withRouter } from 'react-router-dom';
-
-import { useApplicationDispatch } from '../../../framework/src/flux/connect';
-import applicationManager from '../../../framework/src/services/applicationManager';
-
-import { loadTreeSiteSearchBySiteIdOrNameAsync, SearchValueAction } from './actions/siteManagerSiteSearchAction';
-import siteManagerAppRootHandler from './handlers/siteManagerAppRootHandler';
-import SiteManager from './views/siteManager';
-
-const appIcon = require('./assets/icons/siteManagerAppIcon.svg'); // select app icon
-
-let currentSearchSiteId: string | undefined = undefined;
-let currentSearchCategoryName: string | undefined = undefined;
-
-interface SearchProps {
- handleRefresh: (event: React.SyntheticEvent) => void;
- handleSearch: (event: React.SyntheticEvent, searchValue: string) => void;
-}
-
-const SiteManagerTableApplicationRouteAdapter = ((props: SearchProps & RouteComponentProps<{
- searchSiteId?: string; searchCategoryName?: string;
-}>) => {
-
- const dispatch = useApplicationDispatch();
- const setSearchTerm = (siteId: string, categoryName?: string) => dispatch(new SearchValueAction(siteId, categoryName));
- const searchSiteIdTrail = async (searchValue: string) => dispatch(loadTreeSiteSearchBySiteIdOrNameAsync(searchValue));
-
- if (currentSearchCategoryName !== props.match.params.searchCategoryName) {
- currentSearchCategoryName = props.match.params.searchCategoryName || undefined;
- if (currentSearchCategoryName && currentSearchSiteId !== props.match.params.searchSiteId) {
- currentSearchSiteId = props.match.params.searchSiteId || undefined;
- if (currentSearchSiteId) {
- setSearchTerm(currentSearchSiteId, currentSearchCategoryName);
- searchSiteIdTrail(currentSearchSiteId);
- }
- }
- } else {
- if (currentSearchSiteId !== props.match.params.searchSiteId) {
- currentSearchSiteId = props.match.params.searchSiteId || undefined;
- if (currentSearchSiteId) {
- setSearchTerm(currentSearchSiteId);
- searchSiteIdTrail(currentSearchSiteId);
- }
- }
- }
- return (
- <SiteManager activePanel='TreeView' />
- );
-});
-
-const App = withRouter((props: RouteComponentProps) => (
- <Switch>
- <Route exact path={`${props.match.path}/treeview/:searchSiteId/:searchCategoryName`} component={SiteManagerTableApplicationRouteAdapter} />
- <Route path={`${props.match.path}/treeview/:searchSiteId`} component={SiteManagerTableApplicationRouteAdapter} />
- <Route path={`${props.match.path}/treeview`} component={SiteManagerTableApplicationRouteAdapter} />
- <Route path={`${props.match.path}`} component={SiteManager} />
- <Redirect to={`${props.match.path}`} />
- </Switch>
-));
-
-export function register() {
- applicationManager.registerApplication({
- name: 'siteManager',
- icon: appIcon,
- rootActionHandler: siteManagerAppRootHandler,
- rootComponent: App,
- menuEntry: 'Site Manager',
- });
-}
-
+++ /dev/null
-/**
- * ============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 { Result } from '../../../../framework/src/models';
-import { requestRest } from '../../../../framework/src/services/restService';
-
-import { NetworkElementConnection } from '../models/networkElementConnection';
-
-const dataService = {
- getAdditionalInfoOnDevices: async (ids: string[]) => {
- const path = 'rests/operations/data-provider:read-network-element-connection-list';
- const query = {
- 'data-provider:input': {
- 'filter': [{
- 'property': 'id',
- 'filtervalues': ids,
- }],
- 'pagination': {
- 'size': ids.length,
- 'page': 1,
- },
- },
- };
- if (ids.length > 0) {
- const result = await requestRest<Result<NetworkElementConnection>>(
- path,
- { method: 'POST', body: JSON.stringify(query) },
- );
- const resultData = result && result['data-provider:output'] && result['data-provider:output'].data;
- return resultData;
- } else {
- return null;
- }
- },
-};
-
-export default dataService;
\ No newline at end of file
+++ /dev/null
-import { IExternalTableState } from '../../../../framework/src/components/material-table/utilities';
-import { requestRest } from '../../../../framework/src/services/restService';
-import { SiteDetails } from '../models/siteDetails';
-
-const filterKeysUrl = '/topology/network/filters/keys';
-
-type FilterKey = {
- key: string;
- reference: string;
- type: string;
- label: string | null;
-};
-
-let filterMapping: { [table: string]: { [column: string]: { key: string; type: string } } };
-
-const getFieldMapping = async () => {
- if (filterMapping) {
- return filterMapping;
- }
-
- const response = await requestRest<FilterKey[]>(filterKeysUrl);
- if (!response) {
- throw new Error('No filter mapping found');
- }
-
- filterMapping = {};
- response.forEach(key => {
- const parts = key.reference.split('.');
- const table = parts[0];
- const column = parts[1];
-
- if (!filterMapping[table]) {
- filterMapping[table] = {};
- }
- filterMapping[table][column] = { key: key.key, type: key.type };
- });
-
- return filterMapping;
-};
-
-const createMapFilter = async (tableName: string, tableState: IExternalTableState<SiteDetails>) => {
- const mapping = await getFieldMapping();
-
- return Object.keys(tableState.filter).map(key => {
- const column = mapping[tableName] && mapping[tableName][key];
- const value = tableState.filter[key] && tableState.filter[key].trim();
- if (!column || !value) {
- return null;
- }
- return value.match(/^[<>]/i)
- ? `${column.key}${value}`
- : column.type === 'string'
- ? value.includes('\'')
- ? `${column.key}='${value}'`
- : `${column.key}='${value}'`
- : `${column.key}=${value}`;
-
- }).filter(filter => filter !== null).join(' AND ');
-
-};
-
-export { createMapFilter };
+++ /dev/null
-/**
- * ============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 { requestRestExt } from '../../../../framework/src/services/restService';
-
-import {
- SearchSiteIdResult, SiteConfigurationFreqPlan, SiteManagerAreas, SiteManagerCategories, SiteManagerCategoryItems,
- Sites, SitesListResult, addEditSiteConfig, Bands,
-} from '../models/siteManager';
-
-/**
- * Represents a web api accessor service for all entries related actions.
- */
-
-const URL_SITE_MANAGER = '/topology/site-manager';
-
-const URL_MICROWAVE = '/topology/microwave';
-
-const siteManagerService = {
- getCountries: async (): Promise<SiteManagerAreas[]> => {
- return fetch(`${URL_SITE_MANAGER}/areas`)
- .then(res => res.json())
- .then(result => {
- return result;
- });
- },
-
- getAreasByAreaId: async (areaId: string): Promise<SiteManagerAreas[]> => {
- return fetch(`${URL_SITE_MANAGER}/areas/${areaId}/areas`)
- .then(res => res.json())
- .then(result => {
- return result;
- });
- },
-
- getSitesByAreaId: async (areaId: string): Promise<SitesListResult> => {
- const requestHeaders: HeadersInit = new Headers();
- requestHeaders.set('Content-Type', 'application/json');
- requestHeaders.set('Accept', 'application/json');
-
- return fetch(`${URL_SITE_MANAGER}/areas/${areaId}/sites`, {
- method: 'GET',
- headers: requestHeaders,
- })
- .then(response => {
- if (!response.ok) {
- // eslint-disable-next-line @typescript-eslint/no-throw-literal
- throw response;
- }
- return response.json();
- })
- .then(response => {
- const returnResponse: SitesListResult = {
- sites: response ? response : [],
- isError: false,
- errorMessage: '',
- };
- return returnResponse;
- }).catch(error => {
- return error.json().then((errorMessage: any) => {
- const returnResponse: SitesListResult = {
- sites: [],
- isError: true,
- errorMessage: errorMessage.message,
- };
- return returnResponse;
- });
- });
- },
-
- getSiteBySiteId: async (siteId: string): Promise<Sites> => {
- const requestHeaders: HeadersInit = new Headers();
- requestHeaders.set('Content-Type', 'application/json');
- requestHeaders.set('Accept', 'application/json');
-
- return fetch(`${URL_SITE_MANAGER}/sites/${siteId}`, {
- method: 'GET',
- headers: requestHeaders,
- })
- .then(res => res.json())
- .then(result => {
- return result;
- }).catch(error => {
- console.log('Error: ', error);
- });
- },
-
- getCategoriesBySiteId: async (siteId: string): Promise<SiteManagerCategories[]> => {
- return fetch(`${URL_SITE_MANAGER}/sites/${siteId}/categories`)
- .then(res => res.json())
- .then(result => {
- return result;
- });
- },
-
- getCategoryItemsBySiteIdAndCategoryName: async (siteId: string, categoryName: string): Promise<SiteManagerCategoryItems> => {
- return fetch(`${URL_SITE_MANAGER}/sites/${siteId}/categories/${categoryName}/items`)
- .then(res => res.json())
- .then(result => {
- return result;
- }).catch(() => {
- // TODO comment the below code - testing
- const value: SiteManagerCategoryItems = [{
- name: categoryName,
- url: 'No url found',
- 'last-update': 'today',
- }];
- return value;
- });
- },
-
- getSearchSiteIDTrail: async (siteId: string): Promise<SearchSiteIdResult> => {
- const data = { query: siteId, showBesideItems: true };
-
- const requestHeaders: HeadersInit = new Headers();
- requestHeaders.set('Content-Type', 'application/json');
- requestHeaders.set('Accept', 'application/json');
-
- return fetch(`${URL_SITE_MANAGER}/search`, {
- method: 'POST',
- headers: requestHeaders,
- body: JSON.stringify(data),
- })
- .then(response => {
- if (!response.ok) {
- // eslint-disable-next-line @typescript-eslint/no-throw-literal
- throw response;
- }
- return response.json();
- })
- .then(response => {
- const returnResponse: SearchSiteIdResult = {
- areas: response.areas ? response.areas : [],
- sites: response.sites ? response.sites : [],
- isError: false,
- errorMessage: '',
- };
- return returnResponse;
- }).catch(error => {
- return error.json().then((errorMessage: any) => {
- const returnResponse: SearchSiteIdResult = {
- areas: [],
- sites: [],
- isError: true,
- errorMessage: errorMessage.message,
- };
- return returnResponse;
- });
- });
- },
-
- saveModifiedSiteDetails: async (siteDetails: Sites, siteId: string) => {
- type Message = { 'message': string };
- const response = await requestRestExt<Message>(URL_SITE_MANAGER + `/sites/${siteId}`, {
- method: 'PUT',
- body: JSON.stringify(siteDetails),
- });
- if (response.status == 200) {
- return { message: 'Save Successful', error: false, serverError: false };
- } else {
- let message = { message: '', error: true, serverError: true };
- if (response.data?.message) {
- message.serverError = (response.status == 400) ? true : false;
- message.message = 'Save failed: ' + response.data ? response.data.message : 'unknown';
- return message;
- } else {
- message.serverError = true;
- message.message = 'Something went wrong ' + response.message;
- return message;
- }
- }
- },
-
- getSitesFrequencyPlan: async (siteId: string): Promise<SiteConfigurationFreqPlan[]> => {
- const response = await fetch(`${URL_MICROWAVE}/network/sites/${siteId}/frequencyplan`);
- const result = await response.json();
- return result as SiteConfigurationFreqPlan[];
- },
-
- getAvailableBands: async (): Promise<Bands[]> => {
- const response = await fetch(`${URL_MICROWAVE}/bands`);
- const result = await response.json();
- return result as Bands[];
- },
-
- getAvailableSiteTypes: async (): Promise<string[]> => {
- const response = await fetch(`${URL_SITE_MANAGER}/site-types`);
- const data = await response.json();
- const filteredData = data.filter((item: string | null) => item !== null && item !== '');
- return filteredData as string[];
- },
-
- saveSiteConfiguration: async (modifiedConfig: addEditSiteConfig, bandId: string, siteId: string) => {
- type Message = { 'message': string };
- const response = await requestRestExt<Message>(`${URL_MICROWAVE}/network/sites/${siteId}/frequencyplan/${bandId}`, {
- method: 'PUT',
- body: JSON.stringify(modifiedConfig),
- });
- if (response.status == 200) {
- return { message: 'Save Successful', error: false, serverError: false };
- } else {
- let message = { message: '', error: true, serverError: true };
- if (response.data?.message) {
- message.serverError = (response.status == 400) ? true : false;
- message.message = 'Save failed: ' + response.data ? response.data.message : 'unknown';
- return message;
- } else {
- message.serverError = true;
- message.message = 'Something went wrong ' + response.message;
- return message;
- }
- }
- },
-
- createSiteConfiguration: async (newConfig: addEditSiteConfig, bandId: string, siteId: string) => {
- type Message = { 'message': string };
- const response = await requestRestExt<Message>(`${URL_MICROWAVE}/network/sites/${siteId}/frequencyplan/${bandId}`, {
- method: 'POST',
- body: JSON.stringify(newConfig),
- });
- if (response.status == 200) {
- return { message: 'Save Successful', error: false, serverError: false };
- } else {
- let message = { message: '', error: true, serverError: true };
- if (response.data?.message) {
- message.serverError = (response.status == 400) ? true : false;
- message.message = 'Save failed: ' + response.data ? response.data.message : 'unknown';
- return message;
- } else {
- message.serverError = true;
- message.message = 'Something went wrong ' + response.message;
- return message;
- }
- }
- },
-
- deleteSiteConfiguration: async (bandId: string, siteId: string) => {
- type Message = { 'message': string };
- const response = await requestRestExt<Message>(`${URL_MICROWAVE}/network/sites/${siteId}/frequencyplan/${bandId}`, {
- method: 'DELETE',
- });
- if (response.status == 200) {
- return { message: 'Delete Successful', error: false, serverError: false };
- } else {
- let message = { message: '', error: true, serverError: true };
- if (response.data?.message) {
- message.serverError = (response.status == 400) ? true : false;
- message.message = 'Delete failed: ' + response.data ? response.data.message : 'unknown';
- return message;
- } else {
- message.serverError = true;
- message.message = 'Something went wrong ' + response.message;
- return message;
- }
- }
- },
-};
-
-export default siteManagerService;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { requestRest, requestRestExt } from '../../../../framework/src/services/restService';
-
-import { Site } from '../models/site';
-import { SitedocOrder, UserListItem } from '../models/siteDocTypes';
-import { SiteManagerSiteOrderItemsDetails } from '../models/siteManager';
-
-const BASE_URL = '/sitedoc';
-
-type Message = { 'message': string };
-
-const sitedocDataService = {
- createOrder: async (order: SitedocOrder, siteId: string) => {
- const result = await requestRestExt<Message>(BASE_URL + `/site/${siteId}/order`, { method: 'POST', body: JSON.stringify(order) });
- if (result.status === 200) {
- return { message: 'Order Created', error: false, serverError: false };
- } else {
- let message = { message: '', error: true, serverError: false };
- if (result.data) {
- message.message = 'Creation failed: ' + result.data ? result.data.message : 'unknown';
- return message;
- } else {
- message.serverError = (result.status === 403) ? true : false;
- message.message = 'Something went wrong... ' + result.message;
- return message;
- }
- }
- },
-
- getSiteIfExists: async (siteId: string) => {
- return requestRest<Site>('/topology/network/sites/' + siteId);
- },
-
- getAllUsers: async () => {
- const result = await requestRest<UserListItem[]>(BASE_URL + '/users/android');
- if (result) {
- return result;
- } else {
- return [];
- }
- },
-
- getSiteDetails: async (siteId: string): Promise<SiteManagerSiteOrderItemsDetails> => {
- const selectedSiteId = siteId.split('#')[0] + '';
- return fetch(`${BASE_URL}/site/${selectedSiteId}/orders`)
- .then(res => res.json())
- .then(result => {
- return result;
- }).catch(() => {
- const value: SiteManagerSiteOrderItemsDetails = [{
- assignedUser: '',
- state: '',
- note: '',
- tasks: [{
- type: '',
- description: '',
- completed: false,
- }],
- }];
- return value;
- });
- },
-};
-
-export default sitedocDataService;
+++ /dev/null
-/* eslint-disable @typescript-eslint/no-unused-expressions */
-/**
- * ============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 React from 'react';
-import { RouteComponentProps, withRouter } from 'react-router-dom';
-
-import { useApplicationDispatch } from '../../../../framework/src/flux/connect';
-
-import { SelectElementAction } from '../actions/detailsAction';
-import { getUsersAction } from '../actions/sitedocManagementAction';
-import CreateNewOrder from '../components/createNewOrder';
-import { Site } from '../models/site';
-import sitedocDataService from '../services/sitedocDataService';
-
-type orderProps = RouteComponentProps & {
- siteId: string;
- onClose: (siteId: string) => void;
- onError: () => void;
-};
-
-const OrderCreation = (props: orderProps) => {
- const dispatch = useApplicationDispatch();
- const getUsersActions = () => dispatch(getUsersAction);
- const selectSite = (site: Site) => dispatch(new SelectElementAction(site));
-
- const [showForm, setShowForm] = React.useState(true);
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
- const [siteInfo, setSiteInfo] = React.useState('');
- //on mount
- React.useEffect(() => {
- getUsersActions();
- if (props.siteId) {
- setShowForm(true);
- } else {
- setShowForm(false);
- sitedocDataService.getSiteIfExists(props.siteId).then(res => {
- if (res) {
- selectSite(res);
- setShowForm(true);
- } else {
- setSiteInfo('Site not found.');
- }
- });
- }
- }, []);
-
- const onCancel = (siteId: string) => {
- props.onClose && props.onClose(siteId);
- };
-
- const onError = () => {
- props.onError && props.onError();
- };
-
- return <>
- {
- (props.siteId === null) ?
- <div>Check if site exists...</div>
- :
- !showForm
- ? <div>
- <div>Site does not exist</div>
- </div>
- : <CreateNewOrder siteId={props.siteId} onClose={onCancel} onError={onError} />
- }
- </>;
-};
-
-const CreateOrderView = withRouter(OrderCreation);
-
-export default CreateOrderView;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React, { useState } from 'react';
-
-import { AppBar, Tab, Tabs } from '@mui/material';
-import { RouteComponentProps, withRouter } from 'react-router-dom';
-
-import { NavigateToApplication } from '../../../../framework/src/actions/navigationActions';
-import { useApplicationDispatch } from '../../../../framework/src/flux/connect';
-
-import { SearchValueAction } from '../actions/siteManagerSiteSearchAction';
-import { SiteManagerTreeView } from '../components/siteManagerTreeview';
-import { SiteTableView } from '../components/siteTable';
-
-
-type TabId = 'SiteTable' | 'TreeView';
-
-type DashboardComponentProps = RouteComponentProps & { activePanel: string };
-const scrollbar = { overflow: 'auto' };
-
-const SiteManagerComponent = (props: DashboardComponentProps) => {
- const [activeTab, setActiveTab] = useState(props.activePanel);
- const dispatch = useApplicationDispatch();
- const navigateToApplication = (applicationName: string, path?: string) => dispatch(new NavigateToApplication(applicationName, path, ''));
- const setSearchTerm = (value: string) => dispatch(new SearchValueAction(value));
-
- React.useEffect(() => {
- if (activeTab == null) {
- setActiveTab('SiteTable');
- }
- }, []);
-
- const onHandleTabChange = (event: React.SyntheticEvent, value: TabId) => {
- setActiveTab(value);
- };
-
- const siteTableTab = () => {
- setSearchTerm('');
- return navigateToApplication('siteManager', '');
- };
-
- const treeViewTab = () => {
- return navigateToApplication('siteManager', 'treeview');
- };
-
- return (
- <>
- <AppBar enableColorOnDark position='static'>
- <Tabs indicatorColor='secondary' textColor='inherit' value={activeTab} onChange={onHandleTabChange} aria-label='site-manager-app-tabs'>
- <Tab aria-label='site-manager-table-view-tab' label='Sites' value='SiteTable' onClick={siteTableTab} />
- <Tab aria-label='site-manager-treeview-tab' label='Tree View' value='TreeView' onClick={treeViewTab} />
- </Tabs>
- </AppBar>
- {activeTab === 'SiteTable'
- ? <div style={scrollbar} aria-label='site-manager-table-view' id='siteManagerTableView' >
- <SiteTableView />
- </div>
- : activeTab === 'TreeView'
- ? <div style={scrollbar} aria-label='site-manager-treeview' id='siteManagerTreeview' >
- <SiteManagerTreeView />
- </div>
- : null}
- </>
- );
-};
-
-
-export const SiteManager = withRouter(SiteManagerComponent);
-export default SiteManager;
-
+++ /dev/null
-{
- "compilerOptions": {
- "baseUrl": "./src",
- "outDir": "./dist",
- "sourceMap": true,
- "forceConsistentCasingInFileNames": true,
- "allowSyntheticDefaultImports": true,
- "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"
- ]
-}
+++ /dev/null
-/**
- * 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 proxyConf = require('../../proxy.conf');
-
-// 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: {
- siteManagerApp: ["./pluginSiteManager.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"
- }]
- }, {
- //don't minify images
- test: /\.(png|gif|jpg|svg)$/,
- use: [{
- loader: 'url-loader',
- options: {
- limit: 10,
- name: './images/[name].[ext]'
- }
- }]
- }]
- },
-
- 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: proxyConf,
- }
- }];
-}
+++ /dev/null
-{
- "presets": [
- ["@babel/preset-react"],
- ["@babel/preset-env", {
- "targets": {
- "chrome": "66"
- },
- "spec": true,
- "loose": false,
- "modules": false,
- "debug": false,
- "useBuiltIns": "usage",
- "forceAllTransforms": true
- }]
- ],
- "plugins": []
-}
+++ /dev/null
-{
- "name": "@odlux/unm-fault-management-app",
- "version": "0.1.0",
- "description": "A react based modular UI to demo the fault management.",
- "main": "index.js",
- "scripts": {
- "start": "webpack-dev-server --env debug",
- "build": "webpack --env release --config webpack.config.js",
- "build:dev": "webpack --env debug --config webpack.config.js"
- },
- "repository": {
- "type": "git",
- "url": "https://git.mfico.de/highstreet-technologies/odlux.git"
- },
- "keywords": [
- "reactjs",
- "redux",
- "ui",
- "framework"
- ],
- "author": "Sai Neetha Phulmali",
- "license": "Apache-2.0",
- "dependencies": {
- "@emotion/react": "^11.7.0",
- "@emotion/styled": "^11.6.0",
- "@mui/icons-material": "^5.2.0",
- "@mui/material": "^5.2.2",
- "@mui/styles": "^5.2.2",
- "@odlux/framework": "*",
- "@fortawesome/free-solid-svg-icons": "5.6.3",
- "@fortawesome/react-fontawesome": "0.1.14"
- },
- "peerDependencies": {
- "@types/classnames": "2.2.6",
- "@types/flux": "3.1.8",
- "@types/jquery": "3.3.10",
- "@types/react": "17.0.37",
- "@types/react-dom": "17.0.11",
- "@types/react-router-dom": "5.1.7",
- "jquery": "3.3.1",
- "react": "17.0.2",
- "react-dom": "17.0.2",
- "react-router-dom": "5.2.0",
- "react-chartjs-2": "^3.0.3"
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ ============LICENSE_START=======================================================
- ~ ONAP : SDNR ODLUX
- ~ ================================================================================
- ~ Copyright (C) 2020 AT&T 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=======================================================
- ~
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.o-ran-sc.oam-controller.features.sdnr.odlux</groupId>
- <artifactId>sdnr-odlux-app-unmFaultManagementApp</artifactId>
- <version>1.7.0-SNAPSHOT</version>
- <packaging>jar</packaging>
-
- <name>SDNR ODLUX :: ${project.artifactId}</name>
- <licenses>
- <license>
- <name>Apache License, Version 2.0</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0</url>
- </license>
- </licenses>
-
- <build>
- <resources>
- <resource>
- <directory>dist</directory>
- <targetPath>odlux</targetPath>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <artifactId>maven-clean-plugin</artifactId>
- <configuration>
- <filesets>
- <fileset>
- <directory>dist</directory>
- <followSymlinks>false</followSymlinks>
- </fileset>
- <fileset>
- <directory>node</directory>
- <followSymlinks>false</followSymlinks>
- </fileset>
- <fileset>
- <directory>node_modules</directory>
- <followSymlinks>false</followSymlinks>
- </fileset>
- <fileset>
- <directory>../node_modules</directory>
- <followSymlinks>false</followSymlinks>
- </fileset>
- <!-- eclipse bug build bin folder in basedir -->
- <fileset>
- <directory>bin</directory>
- <followSymlinks>false</followSymlinks>
- </fileset>
- </filesets>
- </configuration>
- </plugin>
- <plugin>
- <groupId>de.jacks-it-lab</groupId>
- <artifactId>frontend-maven-plugin</artifactId>
- <version>1.7.2</version>
- <executions>
- <execution>
- <id>install node and yarn</id>
- <goals>
- <goal>install-node-and-yarn</goal>
- </goals>
- <!-- optional: default phase is "generate-resources" -->
- <phase>initialize</phase>
- <configuration>
- <nodeVersion>v16.17.0</nodeVersion>
- <yarnVersion>v1.22.19</yarnVersion>
- </configuration>
- </execution>
- <execution>
- <id>yarn build</id>
- <goals>
- <goal>yarn</goal>
- </goals>
- <configuration>
- <arguments>run build</arguments>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
+++ /dev/null
-/**
- * ============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 { PanelId } from '../models/panelId';
-
-export class SetPanelAction extends Action {
- constructor(public panelId: PanelId) {
- super();
- }
-}
-
-export class RememberCurrentPanelAction extends Action {
- constructor(public panelId: PanelId) {
- super();
- }
-}
-
-export const setPanelAction = (panelId: PanelId) => {
- return new SetPanelAction(panelId);
-};
-
+++ /dev/null
-/**
- * ============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 { Dispatch } from '../../../../framework/src/flux/store';
-
-import { Action } from '../../../../framework/src/flux/action';
-import { getUnmFaultCountBySeverity } from '../services/unmFaultStatusService';
-
-export class BaseAction extends Action { }
-
-export class SetUnmFaultStatusAction extends BaseAction {
- constructor(public criticalFaults: number, public majorFaults: number,
- public minorFaults: number, public warnings: number, public indeterminate: number) {
- super();
- }
-}
-
-export const loadAllUnmFaultStatusCountAsyncAction = async (dispatch: Dispatch) => {
- const result = await getUnmFaultCountBySeverity().catch(_ => null);
- if (result) {
- const statusAction = new SetUnmFaultStatusAction(
- result.Critical || 0,
- result.Major || 0,
- result.Minor || 0,
- result.Warning || 0,
- result.Indeterminate || 0,
- );
- dispatch(statusAction);
- return;
- } else {
- dispatch(new SetUnmFaultStatusAction(0, 0, 0, 0, 0));
- }
-};
+++ /dev/null
-<!-- highstreet technologies GmbH colour scheme
- Grey #565656
- LBlue #36A9E1
- DBlue #246DA2
- Green #003F2C / #006C4B
- Yellw #C8D400
- Red #D81036
--->
-
-<svg viewBox="0 0 500 540" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
- <g transform="matrix(27.7762,0,0,27.7762,-13.8603,-27.7762)">
-
- <path fill="#565656" d="M 16.8 15.101 C 15.656 14.242 15 12.929 15 11.5 L 15 8.5 C 15 5.987 13.306 3.862 11 3.208 L 11 2.5 C 11 1.673 10.327 1 9.5 1 C 8.673 1 8 1.673 8 2.5 L 8 3.208 C 5.694 3.863 4 5.987 4 8.5 L 4 11.5 C 4 12.929 3.344 14.241 2.2 15.101 C 2.028 15.23 1.958 15.455 2.026 15.659 C 2.094 15.863 2.285 16.001 2.5 16.001 L 16.499 16.001 C 16.714 16.001 16.905 15.863 16.973 15.659 C 17.041 15.455 16.971 15.23 16.799 15.101 L 16.8 15.101 Z" />
-
- <path fill="#D81036" d="m 7.05 17.001 c -0.033 0.164 -0.051 0.331 -0.051 0.5 c 0 1.378 1.122 2.5 2.5 2.5 c 1.378 0 2.5 -1.122 2.5 -2.5 c 0 -0.168 -0.017 -0.336 -0.05 -0.5 l -4.899 0 z" />
-
-
- </g>
-</svg>
+++ /dev/null
-/**
- * ============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 '@mui/material/Button';
-import Dialog from '@mui/material/Dialog';
-import DialogActions from '@mui/material/DialogActions';
-import DialogContent from '@mui/material/DialogContent';
-import DialogContentText from '@mui/material/DialogContentText';
-import DialogTitle from '@mui/material/DialogTitle';
-
-import { connect, Connect, IDispatcher } from '../../../../framework/src/flux/connect';
-import { unmFaultLogEntriesReloadAction } from '../handlers/unmFaultLogEntriesHandler';
-import { FaultLog } from '../models/unmFault';
-
-export enum RefreshFaultLogDialogMode {
- None = 'none',
- RefreshFaultLogTable = 'RefreshFaultLogTable',
-}
-
-const mapDispatch = (dispatcher: IDispatcher) => ({
- refreshFaultLog: () => dispatcher.dispatch(unmFaultLogEntriesReloadAction),
-});
-
-type DialogSettings = {
- dialogTitle: string;
- dialogDescription: string;
- applyButtonText: string;
- cancelButtonText: string;
- enableMountIdEditor: boolean;
- enableUsernameEditor: boolean;
- enableExtendedEditor: boolean;
-};
-
-const settings: { [key: string]: DialogSettings } = {
- [RefreshFaultLogDialogMode.None]: {
- dialogTitle: '',
- dialogDescription: '',
- applyButtonText: '',
- cancelButtonText: '',
- enableMountIdEditor: false,
- enableUsernameEditor: false,
- enableExtendedEditor: false,
- },
- [RefreshFaultLogDialogMode.RefreshFaultLogTable]: {
- dialogTitle: 'Do you want to refresh the Fault Log?',
- dialogDescription: '',
- applyButtonText: 'Yes',
- cancelButtonText: 'Cancel',
- enableMountIdEditor: true,
- enableUsernameEditor: true,
- enableExtendedEditor: true,
- },
-};
-
-type RefreshFaultLogDialogComponentProps = Connect<undefined, typeof mapDispatch> & {
- mode: RefreshFaultLogDialogMode;
- onClose: () => void;
-};
-
-type RefreshFaultLogDialogComponentState = FaultLog & { isNameValid: boolean; isHostSet: boolean };
-
-class RefreshFaultLogDialogComponent extends React.Component<RefreshFaultLogDialogComponentProps, RefreshFaultLogDialogComponentState> {
- render(): JSX.Element {
- const setting = settings[this.props.mode];
- return (
- <Dialog open={this.props.mode !== RefreshFaultLogDialogMode.None}>
- <DialogTitle id="form-dialog-title" aria-label={`${setting.dialogTitle.replace(/ /g, '-').toLowerCase()}-dialog`}>{setting.dialogTitle}</DialogTitle>
- <DialogContent>
- <DialogContentText>
- {setting.dialogDescription}
- </DialogContentText>
- </DialogContent>
- <DialogActions>
- <Button aria-label="dialog-confirm-button" onClick={() => {
- this.onRefresh();
- }} color="inherit" > {setting.applyButtonText} </Button>
- <Button aria-label="dialog-cancel-button" onClick={() => {
- this.onCancel();
- }} color="secondary"> {setting.cancelButtonText} </Button>
- </DialogActions>
- </Dialog>
- );
- }
-
- private onRefresh = () => {
- this.props.refreshFaultLog();
- this.props.onClose();
- };
-
- private onCancel = () => {
- this.props.onClose();
- };
-}
-
-export const RefreshFaultLogDialog = connect(undefined, mapDispatch)(RefreshFaultLogDialogComponent);
-export default RefreshFaultLogDialog;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React from 'react';
-
-import { TextField } from '@mui/material';
-import Button from '@mui/material/Button';
-import Dialog from '@mui/material/Dialog';
-import DialogActions from '@mui/material/DialogActions';
-import DialogContent from '@mui/material/DialogContent';
-import DialogContentText from '@mui/material/DialogContentText';
-import DialogTitle from '@mui/material/DialogTitle';
-
-import { connect, Connect } from '../../../../framework/src/flux/connect';
-
-import { FaultLog } from '../models/unmFault';
-
-export enum ViewAlarmDetailsDialogMode {
- None = 'none',
- ViewAlarmDetails = 'viewDetails',
-}
-
-const mapDispatch = () => ({
-});
-
-type DialogSettings = {
- dialogTitle: string;
- dialogDescription: string;
- applyButtonText: string;
- cancelButtonText: string;
- enableMountIdEditor: boolean;
- enableUsernameEditor: boolean;
- enableExtendedEditor: boolean;
-};
-
-const settings: { [key: string]: DialogSettings } = {
- [ViewAlarmDetailsDialogMode.None]: {
- dialogTitle: '',
- dialogDescription: '',
- applyButtonText: '',
- cancelButtonText: '',
- enableMountIdEditor: false,
- enableUsernameEditor: false,
- enableExtendedEditor: false,
- },
- [ViewAlarmDetailsDialogMode.ViewAlarmDetails]: {
- dialogTitle: 'Alarm Details',
- dialogDescription: 'Details',
- applyButtonText: 'Save',
- cancelButtonText: 'Cancel',
- enableMountIdEditor: false,
- enableUsernameEditor: true,
- enableExtendedEditor: false,
- },
-};
-
-type ViewAlarmDetailsDialogComponentProps = Connect<undefined, typeof mapDispatch> & {
- initialAlarmDetails: FaultLog;
- mode: ViewAlarmDetailsDialogMode;
- onClose: () => void;
-};
-
-type ViewAlarmDetailsDialogComponentState = FaultLog & {
-};
-
-class UnmFaultManagementAlarmDetailsComponent extends React.Component<ViewAlarmDetailsDialogComponentProps, ViewAlarmDetailsDialogComponentState> {
- constructor(props: ViewAlarmDetailsDialogComponentProps) {
- super(props);
- this.state = {
- nodeId: this.props.initialAlarmDetails.nodeId,
- counter: this.props.initialAlarmDetails.counter,
- timestamp: this.props.initialAlarmDetails.timestamp,
- objectId: this.props.initialAlarmDetails.objectId,
- severity: this.props.initialAlarmDetails.severity,
- problem: this.props.initialAlarmDetails.problem,
- sourceType: this.props.initialAlarmDetails.sourceType,
- };
- }
-
- render(): JSX.Element {
- const setting = settings[this.props.mode];
- return (
- <Dialog open={this.props.mode !== ViewAlarmDetailsDialogMode.None}>
- <DialogTitle id="form-dialog-title" aria-label={`${setting.dialogTitle.replace(/ /g, '-').toLowerCase()}-dialog`}>{setting.dialogTitle}</DialogTitle>
- <DialogContent>
- <DialogContentText>
- {setting.dialogDescription}
- </DialogContentText>
- <TextField variant="standard" disabled spellCheck={false} autoFocus margin="dense"
- id="nodeId" label="Node ID" aria-label="nodeId" type="text" fullWidth value={this.state.nodeId} />
-
- <TextField variant="standard" disabled spellCheck={false} margin="dense"
- id="objectId" label="Object Id" aria-label="objectId" type="text" fullWidth value={this.state.objectId} />
-
- <TextField variant="standard" disabled spellCheck={false} margin="dense"
- id="timestamp" label="Timestamp" aria-label="timestamp" type="text" fullWidth value={this.state.timestamp} />
-
- <TextField variant="standard" disabled spellCheck={false} autoFocus margin="dense"
- id="severity" label="Severity" aria-label="severity" type="text" fullWidth value={this.state.severity} />
-
- <TextField variant="standard" disabled spellCheck={false} margin="dense"
- id="problem" label="Problem" aria-label="problem" type="text" fullWidth value={this.state.problem} />
-
- <TextField variant="standard" disabled spellCheck={false} margin="dense"
- id="sourceType" label="Source Type" aria-label="sourceType" type="text" fullWidth value={this.state.sourceType} />
-
- <TextField variant="standard" spellCheck={false} margin="dense"
- id="comment" label="Comment" aria-label="comment" type="text" fullWidth value={this.state.comment}
- onChange={(event) => { this.setState({ comment: event.target.value }); }} />
-
- </DialogContent>
- <DialogActions>
- <Button aria-label="dialog-confirm-button" onClick={(event) => {
- event.preventDefault();
- event.stopPropagation();
- }} color="inherit" > {setting.applyButtonText} </Button>
- <Button aria-label="dialog-cancel-button" onClick={(event) => {
- this.onCancel();
- event.preventDefault();
- event.stopPropagation();
- }} color="secondary"> {setting.cancelButtonText} </Button>
- </DialogActions>
- </Dialog>
- );
- }
-
- public componentDidMount() {
- }
-
-
- private onApply = () => {
- if (this.props.onClose) this.props.onClose();
-
- switch (this.props.mode) {
- case ViewAlarmDetailsDialogMode.ViewAlarmDetails:
- break;
- }
- };
-
- private onCancel = () => {
- if (this.props.onClose) this.props.onClose();
- };
-
- static getDerivedStateFromProps(props: ViewAlarmDetailsDialogComponentProps, state: ViewAlarmDetailsDialogComponentState & { initialAlarmDetails: FaultLog }): ViewAlarmDetailsDialogComponentState & { initialAlarmDetails: FaultLog } {
- let returnState = state;
- if (props.initialAlarmDetails !== state.initialAlarmDetails) {
- returnState = {
- ...state,
- ...props.initialAlarmDetails,
- initialAlarmDetails: props.initialAlarmDetails,
- };
- }
- return returnState;
- }
-}
-
-export const ViewAlarmDetailsDialog = connect(undefined, mapDispatch)(UnmFaultManagementAlarmDetailsComponent);
-export default ViewAlarmDetailsDialog;
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 React from 'react';
-import { RouteComponentProps } from 'react-router-dom';
-
-import { WithStyles, withStyles } from '@mui/styles';
-import createStyles from '@mui/styles/createStyles';
-
-import { connect, Connect } from '../../../../framework/src/flux/connect';
-import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore';
-
-const styles = () => createStyles({
- pageWidthSettings: {
- width: '50%',
- float: 'left',
- },
- root: {
- borderTopWidth: 5,
- borderBottomWidth: 5,
- borderColor: '#eee',
- borderStyle: 'solid',
- width: '75%',
- padding: '15px',
- 'fontfamily': 'Arial, Helvetica, sans-serif',
- 'borderCollapse': 'collapse',
- 'paddingBottom': '12px',
- 'paddingLeft': '25px',
- 'text-align': 'left',
- 'color': 'black',
- },
-
-});
-
-const scrollbar = { overflow: 'auto', paddingRight: '20px' };
-
-
-const mapProps = (state: IApplicationStoreState) => ({
- unmAlarmCount: state.unmFaultManagement.unmFaultStatus,
-});
-
-const mapDispatch = () => ({
-});
-
-type UnmFaultManagementComponentProps = RouteComponentProps & Connect<typeof mapProps, typeof mapDispatch> & WithStyles<typeof styles>;
-
-class UnmFaultManagementDashboard extends React.Component<UnmFaultManagementComponentProps> {
- constructor(props: UnmFaultManagementComponentProps) {
- super(props);
- this.state = {
- };
- }
-
- render(): JSX.Element {
- const { classes, unmAlarmCount } = this.props;
- return (
- <>
- <div style={scrollbar} >
- <h3 aria-label='unm-alarm-overview'>Alarm Overview</h3>
- <div style={{ width: '50%', float: 'left' }}>
- <table className={classes.root} >
- <tbody>
- <tr>
- <th><h3>Total number of Alarms</h3></th>
- <td> {unmAlarmCount.critical + unmAlarmCount.major + unmAlarmCount.minor
- + unmAlarmCount.warning + unmAlarmCount.indeterminate} </td>
- </tr>
- <tr>
- <th><h3>Critical</h3></th>
- <td> {unmAlarmCount.critical} </td>
- </tr>
- <tr>
- <th><h3>Major</h3></th>
- <td> {unmAlarmCount.major} </td>
- </tr>
- <tr>
- <th><h3>Minor</h3></th>
- <td> {unmAlarmCount.minor} </td>
- </tr>
- <tr>
- <th><h3>Warning</h3></th>
- <td> {unmAlarmCount.warning} </td>
- </tr>
- <tr>
- <th><h3>Indeterminate</h3></th>
- <td> {unmAlarmCount.indeterminate} </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </>
- );
- }
-}
-
-export default connect(mapProps, mapDispatch)(withStyles(styles)(UnmFaultManagementDashboard));
+++ /dev/null
-/**
- * ============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 React from 'react';
-
-import Refresh from '@mui/icons-material/Refresh';
-import { MenuItem, Typography } from '@mui/material';
-
-import { ColumnType, MaterialTable, MaterialTableCtorType } from '../../../../framework/src/components/material-table';
-import { connect, Connect, IDispatcher } from '../../../../framework/src/flux/connect';
-import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore';
-
-import RefreshFaultLogDialog, { RefreshFaultLogDialogMode } from '../components/refreshUnmFaultLogDialog';
-import ViewAlarmDetailsDialog, { ViewAlarmDetailsDialogMode } from '../components/unmFaultManagementAlarmDetailsDialog';
-import { createUnmFaultLogEntriesActions, createUnmFaultLogEntriesProperties } from '../handlers/unmFaultLogEntriesHandler';
-import { FaultLog } from '../models/unmFault';
-
-const mapProps = (state: IApplicationStoreState) => ({
- unmFaultLogEntriesProperties: createUnmFaultLogEntriesProperties(state),
-});
-
-const mapDispatch = (dispatcher: IDispatcher) => ({
- unmFaultLogEntriesActions: createUnmFaultLogEntriesActions(dispatcher.dispatch),
-});
-
-type UnmFaultManagementApplicationComponentProps = Connect<typeof mapProps, typeof mapDispatch>;
-
-type UnmFaultManagementApplicationState = {
- alarmToEdit: FaultLog;
- refreshFaultLogEditorMode: RefreshFaultLogDialogMode;
- viewAlarmDetailsMode: ViewAlarmDetailsDialogMode;
-};
-
-const emptyAlarmElement: FaultLog =
-{
- id: '',
- nodeId: '',
- counter: 0,
- timestamp: { value: '' },
- objectId: '',
- severity: null,
- problem: '',
- sourceType: '',
-};
-
-const FaultLogTable = MaterialTable as MaterialTableCtorType<any>;
-
-class UnmFaultManagementFaultLogComponent extends React.Component<UnmFaultManagementApplicationComponentProps, UnmFaultManagementApplicationState> {
- constructor(props: UnmFaultManagementApplicationComponentProps) {
- super(props);
- this.state = {
- alarmToEdit: emptyAlarmElement,
- refreshFaultLogEditorMode: RefreshFaultLogDialogMode.None,
- viewAlarmDetailsMode: ViewAlarmDetailsDialogMode.None,
- };
- }
-
- getContextMenu(rowData: FaultLog): JSX.Element[] {
- const buttonArray = [
- <MenuItem aria-label={'alarm-details-button'} onClick={event => this.onOpenViewAlarmDetailsDialog(event, rowData)}><Typography>View Details</Typography></MenuItem>,
- ];
- return buttonArray;
- }
-
-
- render(): JSX.Element {
- const refreshFaultLogAction = {
- icon: Refresh, tooltip: 'Refresh Fault log table', ariaLabel: 'refresh', onClick: () => {
- this.setState({
- refreshFaultLogEditorMode: RefreshFaultLogDialogMode.RefreshFaultLogTable,
- });
- },
- };
-
- return (
- <>
- <FaultLogTable stickyHeader idProperty={'id'} tableId="alarm-log-table" customActionButtons={[refreshFaultLogAction]}
- columns={[
- { property: 'severity', title: 'Severity', width: '140px' },
- {
- property: 'timestamp', title: 'Timestamp', type: ColumnType.custom, customControl: ({ rowData }) => {
- return (
- rowData.timestamp.value
- );
- },
- },
- { property: 'nodeId', title: 'Node Name' },
- { property: 'objectId', title: 'Object Id' },
- { property: 'problem', title: 'Problem' },
- { property: 'sourceType', title: 'Source', width: '140px' },
- ]} {...this.props.unmFaultLogEntriesProperties} {...this.props.unmFaultLogEntriesActions} createContextMenu={rowData => {
- return this.getContextMenu(rowData);
- }} />
- <RefreshFaultLogDialog
- mode={this.state.refreshFaultLogEditorMode}
- onClose={this.onCloseRefreshFaultLogDialog}
- />
- <ViewAlarmDetailsDialog
- initialAlarmDetails={this.state.alarmToEdit}
- mode={this.state.viewAlarmDetailsMode}
- onClose={this.onCloseViewAlarmDetailsDialog}
-
- />
- </>
- );
- }
-
- private onCloseRefreshFaultLogDialog = () => {
- this.setState({
- refreshFaultLogEditorMode: RefreshFaultLogDialogMode.None,
- });
- };
-
- private onOpenViewAlarmDetailsDialog = (event: React.MouseEvent<HTMLElement>, element: FaultLog) => {
- this.setState({
- alarmToEdit: {
- nodeId: element.nodeId,
- counter: element.counter,
- timestamp: element.timestamp,
- objectId: element.objectId,
- severity: element.severity,
- problem: element.problem,
- sourceType: element.sourceType,
- },
- viewAlarmDetailsMode: ViewAlarmDetailsDialogMode.ViewAlarmDetails,
- });
- };
-
- private onCloseViewAlarmDetailsDialog = () => {
- this.setState({
- viewAlarmDetailsMode: ViewAlarmDetailsDialogMode.None,
- });
- };
-}
-
-export const UnmFaultManagementFaultLog = connect(mapProps, mapDispatch)(UnmFaultManagementFaultLogComponent);
-export default UnmFaultManagementFaultLog;
+++ /dev/null
-/**
- * ============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 { FaultLog } from '../models/unmFault';
-
-export interface IUnmFaultLogEntriesState extends IExternalTableState<FaultLog> { }
-
-// create eleactic search data fetch handler
-const unmFaultLogEntriesSearchHandler = createSearchDataHandler<any>('faultlog');
-
-export const {
- actionHandler: unmFaultLogEntriesActionHandler,
- createActions: createUnmFaultLogEntriesActions,
- createProperties: createUnmFaultLogEntriesProperties,
- reloadAction: unmFaultLogEntriesReloadAction,
-
- // set value action, to change a value
-} = createExternal<FaultLog>(unmFaultLogEntriesSearchHandler, appState => appState.unmFaultManagement.unmFaultLogEntries);
-
+++ /dev/null
-/**
- * ============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 { SetUnmFaultStatusAction } from '../actions/unmFaultManagementAlarmStatusActions';
-
-export interface IUnmFaultStatusCount {
- critical: number;
- major: number;
- minor: number;
- warning: number;
- indeterminate: number;
-}
-
-const unmFaultStatusInit: IUnmFaultStatusCount = {
- critical: 0,
- major: 0,
- minor: 0,
- warning: 0,
- indeterminate: 0,
-};
-
-export const unmFaultStatusHandler: IActionHandler<IUnmFaultStatusCount> = (state = unmFaultStatusInit, action) => {
- if (action instanceof SetUnmFaultStatusAction) {
- state = {
- critical: action.criticalFaults,
- major: action.majorFaults,
- minor: action.minorFaults,
- warning: action.warnings,
- indeterminate: action.indeterminate,
- };
- }
-
- return state;
-};
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-// main state handler
-
-import { IActionHandler } from '../../../../framework/src/flux/action';
-import { combineActionHandler } from '../../../../framework/src/flux/middleware';
-// ** do not remove **
-// eslint-disable-next-line @typescript-eslint/no-unused-vars
-import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore';
-
-import { SetPanelAction } from '../actions/panelChangeActions';
-import { PanelId } from '../models/panelId';
-
-import { unmFaultStatusHandler, IUnmFaultStatusCount } from './unmFaultManagementAlarmStatusHandler';
-import { IUnmFaultLogEntriesState, unmFaultLogEntriesActionHandler } from './unmFaultLogEntriesHandler';
-
-export interface IUnmFaultManagementAppStoreState {
- unmFaultLogEntries: IUnmFaultLogEntriesState;
- currentOpenPanel: PanelId | null;
- unmFaultStatus: IUnmFaultStatusCount;
-}
-
-const currentOpenPanelHandler: IActionHandler<PanelId | null> = (state = null, action) => {
- if (action instanceof SetPanelAction) {
- state = action.panelId;
- }
- return state;
-};
-
-declare module '../../../../framework/src/store/applicationStore' {
- interface IApplicationStoreState {
- unmFaultManagement: IUnmFaultManagementAppStoreState;
- }
-}
-
-const actionHandlers = {
- unmFaultLogEntries: unmFaultLogEntriesActionHandler,
- currentOpenPanel: currentOpenPanelHandler,
- unmFaultStatus: unmFaultStatusHandler,
-};
-
-export const UnmFaultManagementAppRootHandler = combineActionHandler<IUnmFaultManagementAppStoreState>(actionHandlers);
-export default UnmFaultManagementAppRootHandler;
+++ /dev/null
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <!-- <link rel="stylesheet" href="./vendor.css"> -->
- <title>UNM Fault Management App</title>
-</head>
-
-<body>
- <div id="app"></div>
- <script type="text/javascript" src="./require.js"></script>
- <script type="text/javascript" src="./config.js"></script>
- <script>
- // run the application
- require(["app", "unmFaultManagementApp" ], function (app, unmFaultManagementApp) {
- unmFaultManagementApp.register();
- app("./app.tsx").runApplication();
- });
- </script>
-</body>
-
-</html>
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 PanelId = 'Dashboard' | 'FaultLog';
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 FaultLog = {
- id?: string;
- nodeId: string;
- counter: number;
- objectId: string;
- timestamp: { value: string };
- problem: string;
- severity: null | 'Warning' | 'Minor' | 'Major' | 'Critical' | 'Indeterminate';
- sourceType?: string;
- comment?: string;
-};
-
-
-/**
- * Fault status count return
- */
-export type FaultsCountReturnType = {
- criticals: number;
- majors: number;
- minors: number;
- warnings: number;
- indeterminate: number;
-};
-
-export type FaultType = {
- Critical: number;
- Major: number;
- Minor: number;
- Warning: number;
- Indeterminate: number;
-};
-
-export type Faults = {
- faults: FaultsCountReturnType;
-};
+++ /dev/null
-/**
- * ============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==========================================================================
- */
-// app configuration and main entry point for the app
-
-
-import React from 'react';
-import { Redirect, Route, RouteComponentProps, Switch, withRouter } from 'react-router-dom';
-
-import { connect, Connect, IDispatcher } from '../../../framework/src/flux/connect';
-import applicationManager from '../../../framework/src/services/applicationManager';
-
-import { SetPanelAction } from './actions/panelChangeActions';
-import UnmFaultManagementDashboard from './components/unmFaultManagementDashboard';
-import { UnmFaultManagementAppRootHandler } from './handlers/unmFaultManagementAppRootHandler';
-import { PanelId } from './models/panelId';
-import UnmFaultManagementApplication from './views/unmFaultManagementApplication';
-
-const appIcon = require('./assets/icons/unmFaultManagementAppIcon.svg'); // select app icon
-
-let currentMountId: string | undefined = undefined;
-let currentSeverity: string | undefined = undefined;
-
-const mapProps = () => ({
-});
-
-const mapDispatch = (dispatcher: IDispatcher) => ({
- setCurrentPanel: (panelId: PanelId) => dispatcher.dispatch(new SetPanelAction(panelId)),
-});
-
-const UnmFaultManagementApplicationRouteAdapter = connect(mapProps, mapDispatch)((props: RouteComponentProps<{ mountId?: string }> & Connect<typeof mapProps, typeof mapDispatch>) => {
- if (currentMountId !== props.match.params.mountId) {
- currentMountId = props.match.params.mountId || undefined;
- }
- <UnmFaultManagementDashboard />;
- return (
- <UnmFaultManagementApplication />
- );
-});
-
-const UnmFaultManagementApplicationAlarmStatusRouteAdapter = connect(mapProps, mapDispatch)((props: RouteComponentProps<{ severity?: string }> & Connect<typeof mapProps, typeof mapDispatch>) => {
- if (currentSeverity !== props.match.params.severity) {
- currentSeverity = props.match.params.severity || undefined;
- }
- return (
- <UnmFaultManagementApplication />
- );
-});
-
-const App = withRouter((props: RouteComponentProps) => (
- <Switch>
- <Route path={`${props.match.path}/alarmStatus/:severity?`} component={UnmFaultManagementApplicationAlarmStatusRouteAdapter} />
- <Route path={`${props.match.path}/:mountId?`} component={UnmFaultManagementApplicationRouteAdapter} />
- <Route path={`${props.match.url}`} component={UnmFaultManagementApplication} />
- <Redirect to={`${props.match.url}`} />
- </Switch>
-));
-
-export function register() {
- applicationManager.registerApplication({
- name: 'unmFaultManagement',
- icon: appIcon,
- rootComponent: App,
- rootActionHandler: UnmFaultManagementAppRootHandler,
- menuEntry: 'UNM Fault Management',
- });
-}
\ No newline at end of file
+++ /dev/null
-/**
- * ============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 { Result } from '../../../../framework/src/models/elasticSearch';
-import { requestRest } from '../../../../framework/src/services/restService';
-
-import { FaultType, Faults } from '../models/unmFault';
-
-
-export const getUnmFaultCountBySeverity = async (): Promise<FaultType | null> => {
- const path = 'rests/operations/data-provider:read-status';
- const query = {
- 'data-provider:input': {
- 'filter': [],
- 'sortorder': [{
- 'property': 'timestamp',
- 'sortorder': 'descending',
- }],
- 'pagination': {
- 'size': 20,
- 'page': 1,
- },
- },
- };
- const result = await requestRest<Result<Faults>>(path, { method: 'POST', body: JSON.stringify(query) });
-
- let faultType: FaultType = {
- Critical: 0,
- Major: 0,
- Minor: 0,
- Warning: 0,
- Indeterminate: 0,
- };
- let faults: Faults[] | null = null;
-
- if (result && result['data-provider:output'] && result['data-provider:output'].data) {
- faults = result['data-provider:output'].data;
- faultType = {
- Critical: faults[0].faults.criticals,
- Major: faults[0].faults.majors,
- Minor: faults[0].faults.minors,
- Warning: faults[0].faults.warnings,
- Indeterminate: faults[0].faults.indeterminate,
- };
- }
- return faultType;
-};
+++ /dev/null
-/**
- * ============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 React from 'react';
-
-import { AppBar, Tab, Tabs } from '@mui/material';
-
-import { useApplicationDispatch, useSelectApplicationState } from '../../../../framework/src/flux/connect';
-
-import { setPanelAction } from '../actions/panelChangeActions';
-import { loadAllUnmFaultStatusCountAsyncAction } from '../actions/unmFaultManagementAlarmStatusActions';
-import UnmFaultManagementDashboard from '../components/unmFaultManagementDashboard';
-import UnmFaultManagementFaultLog from '../components/unmFaultManagementFaultLog';
-import { unmFaultLogEntriesReloadAction } from '../handlers/unmFaultLogEntriesHandler';
-import { PanelId } from '../models/panelId';
-
-
-const UnmFaultManagementApplication: React.FC<{}> = () => {
-
- const panel = useSelectApplicationState(state => state.unmFaultManagement.currentOpenPanel);
-
- const dispatch = useApplicationDispatch();
- const onLoadFaultLogEntries = () => dispatch(unmFaultLogEntriesReloadAction);
- const onLoadDashboard = () => dispatch(loadAllUnmFaultStatusCountAsyncAction);
- const switchActivePanel = (panelId: PanelId) => dispatch(setPanelAction(panelId));
-
- const onTogglePanel = (panelId: PanelId) => {
- const nextActivePanel = panelId;
- switchActivePanel(nextActivePanel);
-
-
- switch (nextActivePanel) {
- case 'Dashboard':
- onLoadDashboard();
- break;
- case 'FaultLog':
- onLoadFaultLogEntries();
- break;
- case null:
- // do nothing if all panels are closed
- break;
- default:
- console.warn('Unknown nextActivePanel [' + nextActivePanel + '] in connectView');
- break;
- }
- };
-
- const onHandleTabChange = (event: React.SyntheticEvent, newValue: PanelId) => {
- switchActivePanel(newValue);
- onTogglePanel(newValue);
- };
-
- React.useEffect(() => {
- if (panel === null) {
- onTogglePanel('Dashboard');
- }
- }, []);
-
-
- return (
- <>
- <AppBar enableColorOnDark position="static">
- <Tabs indicatorColor="secondary" textColor="inherit" value={panel} onChange={onHandleTabChange} aria-label="unm-fault-app-tabs">
- <Tab aria-label="dashboard-tab" label="Dashboard" value="Dashboard" />
- <Tab aria-label="fault-log-tab" label="Alarm Log" value="FaultLog" />
- </Tabs>
- </AppBar>
- {
- panel === 'Dashboard'
- ? <UnmFaultManagementDashboard />
- : panel === 'FaultLog'
- ? <UnmFaultManagementFaultLog />
- : null
- }
- </>
- );
-};
-
-export default UnmFaultManagementApplication;
\ No newline at end of file
+++ /dev/null
-{
- "compilerOptions": {
- "baseUrl": "./src",
- "outDir": "./dist",
- "sourceMap": true,
- "forceConsistentCasingInFileNames": true,
- "allowSyntheticDefaultImports": true,
- "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"
- ]
-}
+++ /dev/null
-/**
- * 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: {
- unmFaultManagementApp: ["./pluginUnmFaultManagement.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"
- }]
- },{
- //don't minify images
- test: /\.(png|gif|jpg|svg)$/,
- use: [{
- loader: 'url-loader',
- options: {
- limit: 10,
- name: './images/[name].[ext]'
- }
- }]
- }]
- },
- 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: {
- "/oauth2/": {
- target: "http://sdncweb:8080",
- secure: false
- },
- "/database/": {
- target: "http://sdncweb:8080",
- secure: false
- },
- "/restconf/": {
- target: "http://sdncweb:8080",
- secure: false
- },
- "/rests/": {
- target: "http://sdncweb:8080",
- secure: false
- },
- "/help/": {
- target: "http://sdncweb:8080",
- secure: false
- },
- "/websocket": {
- target: "http://sdncweb:8080",
- ws: true,
- changeOrigin: true,
- secure: false
- }
- }
- }
- }];
-}
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.o-ran-sc.oam-controller.parent</groupId>
+ <artifactId>oparent</artifactId>
+ <version>3.0.2-SNAPSHOT</version>
+ </parent>
+
<groupId>org.o-ran-sc.oam-controller.features.sdnr.odlux</groupId>
<artifactId>sdnr-odlux-framework</artifactId>
<version>1.7.0-SNAPSHOT</version>
<token>##odlux.apps.inventoryApp.buildno##</token>
<value>${odlux.apps.inventoryApp.buildno}</value>
</replacement>
- <replacement>
- <token>##odlux.apps.microwaveApp.buildno##</token>
- <value>${odlux.apps.microwaveApp.buildno}</value>
- </replacement>
<replacement>
<token>##odlux.apps.maintenanceApp.buildno##</token>
<value>${odlux.apps.maintenanceApp.buildno}</value>
<token>##odlux.apps.mediatorApp.buildno##</token>
<value>${odlux.apps.mediatorApp.buildno}</value>
</replacement>
- <replacement>
- <token>##odlux.apps.networkMapApp.buildno##</token>
- <value>${odlux.apps.networkMapApp.buildno}</value>
- </replacement>
- <replacement>
- <token>##odlux.apps.siteManagerApp.buildno##</token>
- <value>${odlux.apps.siteManagerApp.buildno}</value>
- </replacement>
<replacement>
<token>##odlux.apps.permanceHistoryApp.buildno##</token>
<value>${odlux.apps.permanceHistoryApp.buildno}</value>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.o-ran-sc.oam-controller.parent</groupId>
+ <artifactId>oparent</artifactId>
+ <version>3.0.2-SNAPSHOT</version>
+ </parent>
+
<groupId>org.o-ran-sc.oam-controller.features.sdnr.odlux</groupId>
<artifactId>sdnr-odlux-installer</artifactId>
<version>1.7.0-SNAPSHOT</version>
<type>jar</type>
<overWrite>false</overWrite>
</artifactItem>
- <!-- networkMapApp-->
- <artifactItem>
- <groupId>${project.groupId}</groupId>
- <artifactId>sdnr-odlux-app-networkMapApp</artifactId>
- <version>${project.version}</version>
- <type>jar</type>
- <overWrite>false</overWrite>
- </artifactItem>
- <!-- microwaveApp-->
- <artifactItem>
- <groupId>${project.groupId}</groupId>
- <artifactId>sdnr-odlux-app-microwaveApp</artifactId>
- <version>${project.version}</version>
- <type>jar</type>
- <overWrite>false</overWrite>
- </artifactItem>
- <!-- line of sight app-->
- <!--<artifactItem>
- <groupId>${project.groupId}</groupId>
- <artifactId>sdnr-odlux-app-lineOfSightApp</artifactId>
- <version>${project.version}</version>
- <type>jar</type>
- <overWrite>false</overWrite>
- </artifactItem>-->
<!-- inventoryApp -->
<artifactItem>
<groupId>${project.groupId}</groupId>
<type>jar</type>
<overWrite>false</overWrite>
</artifactItem>
- <artifactItem>
- <groupId>${project.groupId}</groupId>
- <artifactId>sdnr-odlux-app-siteManagerApp</artifactId>
- <version>${project.version}</version>
- <type>jar</type>
- <overWrite>false</overWrite>
- </artifactItem>
- <artifactItem>
- <groupId>${project.groupId}</groupId>
- <artifactId>sdnr-odlux-app-unmFaultManagementApp</artifactId>
- <version>${project.version}</version>
- <type>jar</type>
- <overWrite>false</overWrite>
- </artifactItem>
<!-- helpserver resources -->
<artifactItem>
<groupId>${project.groupId}</groupId>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.o-ran-sc.oam-controller.parent</groupId>
+ <artifactId>oparent</artifactId>
+ <version>3.0.2-SNAPSHOT</version>
+ </parent>
+
<groupId>org.o-ran-sc.oam-controller.features.sdnr.odlux</groupId>
<artifactId>odlux-top</artifactId>
<version>1.7.0-SNAPSHOT</version>
<module>apps/performanceHistoryApp</module>
<module>apps/eventLogApp</module>
<module>apps/configurationApp</module>
- <module>apps/networkMapApp</module>
- <module>apps/microwaveApp</module>
<!--<module>apps/lineOfSightApp</module>-->
- <module>apps/siteManagerApp</module>
- <module>apps/unmFaultManagementApp</module>
<module>apps/app-installer</module>
<module>installer</module>
</modules>
<name>ccsdk-sdnr :: micro-services odlux only</name>
<description>SDN-R micro-services odlux only</description>
+ <distributionManagement>
+ <repository>
+ <id>o-ran-sc-releases</id>
+ <url>https://nexus.o-ran-sc.org/content/repositories/releases</url>
+ </repository>
+ <snapshotRepository>
+ <id>o-ran-sc-snapshots</id>
+ <url>https://nexus.o-ran-sc.org/content/repositories/snapshots</url>
+ </snapshotRepository>
+ </distributionManagement>
+
<modules>
<module>helpserver</module>
<module>odlux</module>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.o-ran-sc.oam-controller.parent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>3.0.2-SNAPSHOT</version>
+ <relativePath />
+ </parent>
+
<groupId>org.o-ran-sc.oam-controller.features.sdnr.wt</groupId>
<artifactId>sdnr-wt-devicemanager-o-ran-sc</artifactId>
<version>1.8.0-SNAPSHOT</version>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
- <dependencies>
- <dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-topology</artifactId>
- </dependency>
- <dependency>
- <groupId>org.o-ran-sc.oam-controller.features.sdnr.wt</groupId>
- <artifactId>sdnr-wt-data-provider-model</artifactId>
- <version>1.8.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
<parent>
<groupId>org.o-ran-sc.oam-controller.parent</groupId>
<name>ccsdk-sdnr-wireless transport :: micro-services</name>
<description>SDN-R wireless transport micro-services</description>
+ <distributionManagement>
+ <repository>
+ <id>o-ran-sc-releases</id>
+ <url>${o-ran-sc.nexus.release-url}</url>
+ </repository>
+ <snapshotRepository>
+ <id>o-ran-sc-snapshots</id>
+ <url>${o-ran-sc.nexus.snapshot-url}</url>
+ </snapshotRepository>
+ </distributionManagement>
+
<modules>
<module>common</module>
<module>common-yang</module>
<module>oauth-provider</module>
<module>featureaggregator</module>
</modules>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-topology</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.o-ran-sc.oam-controller.features.sdnr.wt</groupId>
+ <artifactId>sdnr-wt-data-provider-model</artifactId>
+ <version>1.8.0-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <deployAtEnd>true</deployAtEnd>
+ <skip>false</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>default-deploy</id>
+ <phase>deploy</phase>
+ <goals>
+ <goal>deploy</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
</project>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
- <id>onap-settings</id>
+ <id>o-ran-sc-settings</id>
<properties>
- <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
- <onap.nexus.rawrepo.baseurl.upload>https://nexus.onap.org/content/sites/raw</onap.nexus.rawrepo.baseurl.upload>
- <onap.nexus.rawrepo.baseurl.download>https://nexus.onap.org/service/local/repositories/raw/content</onap.nexus.rawrepo.baseurl.download>
- <onap.nexus.rawrepo.serverid>ecomp-raw</onap.nexus.rawrepo.serverid>
+ <o-ran-sc.nexus.url>https://nexus.o-ran-sc.org</o-ran-sc.nexus.url>
+ <o-ran-sc.nexus.rawrepo.baseurl.upload>https://nexus.o-ran-sc.org/content/sites/raw</o-ran-sc.nexus.rawrepo.baseurl.upload>
+ <o-ran-sc.nexus.rawrepo.baseurl.download>https://nexus.o-ran-sc.org/service/local/repositories/raw/content</o-ran-sc.nexus.rawrepo.baseurl.download>
+ <o-ran-sc.nexus.rawrepo.serverid>ecomp-raw</o-ran-sc.nexus.rawrepo.serverid>
<!-- properties for Nexus Docker registry -->
- <onap.nexus.dockerregistry.daily>nexus3.onap.org:10003</onap.nexus.dockerregistry.daily>
- <onap.nexus.dockerregistry.release>nexus3.onap.org:10002</onap.nexus.dockerregistry.release>
- <docker.pull.registry>nexus3.onap.org:10001</docker.pull.registry>
- <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
+ <o-ran-sc.nexus.dockerregistry.daily>nexus3.o-ran-sc.org:10003</o-ran-sc.nexus.dockerregistry.daily>
+ <o-ran-sc.nexus.dockerregistry.release>nexus3.o-ran-sc.org:10002</o-ran-sc.nexus.dockerregistry.release>
+ <docker.pull.registry>nexus3.o-ran-sc.org:10001</docker.pull.registry>
+ <docker.push.registry>nexus3.o-ran-sc.org:10003</docker.push.registry>
</properties>
</profile>
<profile>
- <id>github-packages</id>
- <repositories>
- <repository>
- <id>github</id>
- <name>github-packages</name>
- <url>https://maven.pkg.github.com/o-ran-sc/netconf</url>
- </repository>
- </repositories>
- <pluginRepositories>
- <pluginRepository>
- <id>github</id>
- <name>github-packages</name>
- <url>https://maven.pkg.github.com/o-ran-sc/netconf</url>
- </pluginRepository>
- </pluginRepositories>
- </profile>
- <profile>
- <id>github-packages</id>
+ <id>onap-releases</id>
<repositories>
<repository>
- <id>github</id>
- <name>github-packages</name>
- <url>https://maven.pkg.github.com/o-ran-sc/ccsdk-features</url>
+ <id>onap-releases</id>
+ <name>onap-releases</name>
+ <url>https://nexus.onap.org/content/repositories/releases/</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
- <id>github</id>
- <name>github-packages</name>
- <url>https://maven.pkg.github.com/o-ran-sc/ccsdk-features</url>
+ <id>onap-releases</id>
+ <name>onap-releases</name>
+ <url>https://nexus.onap.org/content/repositories/releases/</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<profile>
- <id>onap-snapshots</id>
+ <id>o-ran-sc-snapshots</id>
<repositories>
<repository>
- <id>onap-snapshots</id>
- <name>onap-snapshots</name>
- <url>https://nexus.onap.org/content/repositories/snapshots/</url>
+ <id>o-ran-sc-snapshots</id>
+ <name>o-ran-sc-snapshots</name>
+ <url>https://nexus.o-ran-sc.org/content/repositories/snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
</repositories>
<pluginRepositories>
<pluginRepository>
- <id>onap-snapshots</id>
- <name>onap-snapshots</name>
- <url>https://nexus.onap.org/content/repositories/snapshots/</url>
+ <id>o-ran-sc-snapshots</id>
+ <name>o-ran-sc-snapshots</name>
+ <url>https://nexus.o-ran-sc.org/content/repositories/snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepositories>
</profile>
<profile>
- <id>onap-releases</id>
+ <id>o-ran-sc-releases</id>
<repositories>
<repository>
- <id>onap-releases</id>
- <name>onap-releases</name>
- <url>https://nexus.onap.org/content/repositories/releases/</url>
+ <id>o-ran-sc-releases</id>
+ <name>o-ran-sc-releases</name>
+ <url>https://nexus.o-ran-sc.org/content/repositories/releases/</url>
<releases>
<enabled>true</enabled>
</releases>
</repositories>
<pluginRepositories>
<pluginRepository>
- <id>onap-releases</id>
- <name>onap-releases</name>
- <url>https://nexus.onap.org/content/repositories/releases/</url>
+ <id>o-ran-sc-releases</id>
+ <name>o-ran-sc-releases</name>
+ <url>https://nexus.o-ran-sc.org/content/repositories/releases/</url>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepositories>
</profile>
<profile>
- <id>onap-public</id>
+ <id>o-ran-sc-public</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2/</url>
</repository>
<repository>
- <id>onap-public</id>
- <name>onap-public</name>
- <url>https://nexus.onap.org/content/repositories/public/</url>
+ <id>o-ran-sc-public</id>
+ <name>o-ran-sc-public</name>
+ <url>https://nexus.o-ran-sc.org/content/repositories/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<url>https://repo1.maven.org/maven2/</url>
</pluginRepository>
<pluginRepository>
- <id>onap-public</id>
- <name>onap-public</name>
- <url>https://nexus.onap.org/content/repositories/public/</url>
+ <id>o-ran-sc-public</id>
+ <name>o-ran-sc-public</name>
+ <url>https://nexus.o-ran-sc.org/content/repositories/public/</url>
<releases>
<enabled>true</enabled>
</releases>
</profile>
</profiles>
<activeProfiles>
- <activeProfile>github-packages</activeProfile>
- <activeProfile>onap-settings</activeProfile>
- <activeProfile>onap-snapshots</activeProfile>
<activeProfile>onap-releases</activeProfile>
- <activeProfile>onap-public</activeProfile>
+ <activeProfile>o-ran-sc-settings</activeProfile>
+ <activeProfile>o-ran-sc-snapshots</activeProfile>
+ <activeProfile>o-ran-sc-releases</activeProfile>
+ <activeProfile>o-ran-sc-public</activeProfile>
</activeProfiles>
<servers>
<server>
- <id>github</id>
- <username>o-ran-sc</username>
- <password>${env.GITHUB_TOKEN}</password>
- </server>
+ <id>nexus3.o-ran-sc.org</id>
+ <username>oam-oam-controller</username>
+ <password>${env.NEXUS_PASSWORD}</password>
+ </server>
+ <server>
+ <id>o-ran-sc-releases</id>
+ <username>oam-oam-controller</username>
+ <password>${env.NEXUS_PASSWORD}</password>
+ </server>
+ <server>
+ <id>o-ran-sc-snapshots</id>
+ <username>oam-oam-controller</username>
+ <password>${env.NEXUS_PASSWORD}</password>
+ </server>
</servers>
</settings>