diff options
author | Dan Timoney <dtimoney@att.com> | 2022-02-03 16:41:14 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2022-02-03 16:41:14 +0000 |
commit | 652d7ca972652ef437769cc2e88afddbb7f06ca2 (patch) | |
tree | 08da4fc171617be44aa95cf7d80a5cec1468de8d /sdnr/wt/odlux/apps | |
parent | f23a3d5d957c4c510a7436c0acba57d95e4a13ce (diff) | |
parent | 1a868116614dd9996c78e69941b537e9da19460b (diff) |
Merge "Update ODLUX"
Diffstat (limited to 'sdnr/wt/odlux/apps')
200 files changed, 1140 insertions, 9805 deletions
diff --git a/sdnr/wt/odlux/apps/apiDemo/package.json b/sdnr/wt/odlux/apps/apiDemo/package.json index af47a025e..f01a396e8 100644 --- a/sdnr/wt/odlux/apps/apiDemo/package.json +++ b/sdnr/wt/odlux/apps/apiDemo/package.json @@ -21,20 +21,23 @@ "author": "Matthias Fischer", "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": "*" }, "peerDependencies": { - "@types/react": "17.0.3", - "@types/react-dom": "17.0.2", - "@types/react-router-dom": "5.1.7", - "@material-ui/core": "4.11.4", - "@material-ui/icons": "4.11.2", "@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.1", - "react-dom": "17.0.1", + "react": "17.0.2", + "react-dom": "17.0.2", "react-router-dom": "5.2.0" } -}
\ No newline at end of file +} diff --git a/sdnr/wt/odlux/apps/apiDemo/pom.xml b/sdnr/wt/odlux/apps/apiDemo/pom.xml index 77917570a..f7ed19b3f 100644 --- a/sdnr/wt/odlux/apps/apiDemo/pom.xml +++ b/sdnr/wt/odlux/apps/apiDemo/pom.xml @@ -19,13 +19,14 @@ ~ ============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> <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>binding-parent</artifactId> - <version>2.3.2</version> + <version>2.2.4</version> <relativePath/> </parent> diff --git a/sdnr/wt/odlux/apps/apiDemo/src/plugin.tsx b/sdnr/wt/odlux/apps/apiDemo/src/plugin.tsx index 6790ee929..076eb5c70 100644 --- a/sdnr/wt/odlux/apps/apiDemo/src/plugin.tsx +++ b/sdnr/wt/odlux/apps/apiDemo/src/plugin.tsx @@ -32,7 +32,7 @@ type AppProps = RouteComponentProps & Connect & { modules: Module[], requestModu const App = (props: AppProps ) => ( <> - <button onClick={ props.requestModules }>Load Modules</button> + <button color="inherit" onClick={ props.requestModules }>Load Modules</button> <ul>{ props.modules.map((mod, ind) => (<li key={ ind }>{ mod.name }</li>)) }</ul> </> ); diff --git a/sdnr/wt/odlux/apps/apiDemo/webpack.config.js b/sdnr/wt/odlux/apps/apiDemo/webpack.config.js index 1c699e15b..6564bef26 100644 --- a/sdnr/wt/odlux/apps/apiDemo/webpack.config.js +++ b/sdnr/wt/odlux/apps/apiDemo/webpack.config.js @@ -88,7 +88,7 @@ module.exports = (env) => { manifest: require(path.resolve(frameworkPath, "app-manifest.json")), sourceType: "umd2" }), - ...(env === "release") ? [ + ...(env === "release" ? [ new webpack.DefinePlugin({ "process.env": { NODE_ENV: "'production'", @@ -106,7 +106,7 @@ module.exports = (env) => { from: 'index.html', to: distPath }]), - ] + ]) ], devServer: { diff --git a/sdnr/wt/odlux/apps/app-feature/pom.xml b/sdnr/wt/odlux/apps/app-feature/pom.xml index 9a1614439..ba308cd44 100644 --- a/sdnr/wt/odlux/apps/app-feature/pom.xml +++ b/sdnr/wt/odlux/apps/app-feature/pom.xml @@ -95,23 +95,5 @@ <artifactId>sdnr-wt-odlux-app-configurationApp</artifactId> <version>${project.version}</version> </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>sdnr-wt-odlux-app-networkMapApp</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>sdnr-wt-odlux-app-linkCalculationApp</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>sdnr-wt-odlux-app-lineOfSightApp</artifactId> - <version>${project.version}</version> - </dependency> - - - </dependencies> </project> diff --git a/sdnr/wt/odlux/apps/app-installer/pom.xml b/sdnr/wt/odlux/apps/app-installer/pom.xml index ff4b4ff24..c27f59980 100755 --- a/sdnr/wt/odlux/apps/app-installer/pom.xml +++ b/sdnr/wt/odlux/apps/app-installer/pom.xml @@ -121,21 +121,6 @@ <artifactId>sdnr-wt-odlux-app-configurationApp</artifactId> <version>${project.version}</version> </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>sdnr-wt-odlux-app-networkMapApp</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>sdnr-wt-odlux-app-linkCalculationApp</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>sdnr-wt-odlux-app-lineOfSightApp</artifactId> - <version>${project.version}</version> - </dependency> </dependencies> diff --git a/sdnr/wt/odlux/apps/configurationApp/package.json b/sdnr/wt/odlux/apps/configurationApp/package.json index 8dd2d041f..afd5456ec 100644 --- a/sdnr/wt/odlux/apps/configurationApp/package.json +++ b/sdnr/wt/odlux/apps/configurationApp/package.json @@ -21,20 +21,23 @@ "author": "Matthias Fischer", "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": "*" }, "peerDependencies": { - "@types/react": "17.0.3", - "@types/react-dom": "17.0.2", - "@types/react-router-dom": "5.1.7", - "@material-ui/core": "4.11.4", - "@material-ui/icons": "4.11.2", "@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.1", - "react-dom": "17.0.1", + "react": "17.0.2", + "react-dom": "17.0.2", "react-router-dom": "5.2.0" } -}
\ No newline at end of file +} diff --git a/sdnr/wt/odlux/apps/configurationApp/src/actions/deviceActions.ts b/sdnr/wt/odlux/apps/configurationApp/src/actions/deviceActions.ts index ac8aa0ac2..0dd42e3b7 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/actions/deviceActions.ts +++ b/sdnr/wt/odlux/apps/configurationApp/src/actions/deviceActions.ts @@ -1,3 +1,21 @@ +/** + * ============LICENSE_START======================================================================== + * ONAP : ccsdk feature sdnr wt odlux + * ================================================================================================= + * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. + * ================================================================================================= + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * ============LICENSE_END========================================================================== + */ + import { Action } from '../../../../framework/src/flux/action'; import { Dispatch } from '../../../../framework/src/flux/store'; import { IApplicationStoreState } from "../../../../framework/src/store/applicationStore"; @@ -9,7 +27,7 @@ import { restService } from "../services/restServices"; import { YangParser } from "../yang/yangParser"; import { Module } from "../models/yang"; import { ViewSpecification, ViewElement, isViewElementReference, isViewElementList, isViewElementObjectOrList, isViewElementRpc, isViewElementChoise, ViewElementChoiseCase, ViewElementString } from "../models/uiModels"; -import { exception } from 'console'; + export class EnableValueSelector extends Action { constructor(public listSpecification: ViewSpecification, public listData: any[], public keyProperty: string, public onValueSelected : (value: any) => void ) { @@ -570,7 +588,7 @@ export const updateDataActionAsyncCreator = (vPath: string, data: any) => async } if (isNew) { - return dispatch(new ReplaceAction(`/configuration/${nodeId}/${vPath.replace(/\[\]$/i, `[${isNew}]`)}`)) // navigate to new element + return dispatch(new ReplaceAction(`/configuration/${nodeId}/${vPath.replace(/\[\]$/i, `[${isNew}]`)}`)); // navigate to new element } // create display specification diff --git a/sdnr/wt/odlux/apps/configurationApp/src/components/ifWhenTextInput.tsx b/sdnr/wt/odlux/apps/configurationApp/src/components/ifWhenTextInput.tsx index 56ec8dfd0..8ce3106a6 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/components/ifWhenTextInput.tsx +++ b/sdnr/wt/odlux/apps/configurationApp/src/components/ifWhenTextInput.tsx @@ -17,11 +17,26 @@ */ import { ViewElementBase } from "models/uiModels"; -import { TextField, InputAdornment, Input, Tooltip, Divider, IconButton, InputBase, Paper, makeStyles, Theme, createStyles, FormControl, InputLabel, FormHelperText } from "@material-ui/core"; +import { + TextField, + InputAdornment, + Input, + Tooltip, + Divider, + IconButton, + InputBase, + Paper, + Theme, + FormControl, + InputLabel, + FormHelperText, +} from "@mui/material"; +import makeStyles from '@mui/styles/makeStyles'; +import createStyles from '@mui/styles/createStyles'; import * as React from 'react'; import { faAdjust } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { InputProps } from "@material-ui/core/Input"; +import { InputProps } from "@mui/material/Input"; const useStyles = makeStyles((theme: Theme) => createStyles({ @@ -54,7 +69,7 @@ export const IfWhenTextInput = (props: IfwhenProps) => { const ifFeature = element.ifFeature ? ( - <Tooltip onMouseMove={e => props.onChangeTooltipVisuability(false)} onMouseOut={e => props.onChangeTooltipVisuability(true)} title={element.ifFeature}> + <Tooltip disableInteractive onMouseMove={e => props.onChangeTooltipVisuability(false)} onMouseOut={e => props.onChangeTooltipVisuability(true)} title={element.ifFeature}> <InputAdornment position="start"> <FontAwesomeIcon icon={faAdjust} className={classes.iconDark} /> </InputAdornment> @@ -64,7 +79,7 @@ export const IfWhenTextInput = (props: IfwhenProps) => { const whenFeature = element.when ? ( - <Tooltip className={classes.padding} onMouseMove={() => props.onChangeTooltipVisuability(false)} onMouseOut={() => props.onChangeTooltipVisuability(true)} title={element.when}> + <Tooltip disableInteractive className={classes.padding} onMouseMove={() => props.onChangeTooltipVisuability(false)} onMouseOut={() => props.onChangeTooltipVisuability(true)} title={element.when}> <InputAdornment className={classes.padding} position="end"> <FontAwesomeIcon icon={faAdjust} className={classes.iconLight}/> </InputAdornment> @@ -73,7 +88,7 @@ export const IfWhenTextInput = (props: IfwhenProps) => { : null; return ( - <FormControl error={error} style={style}> + <FormControl variant="standard" error={error} style={style}> <InputLabel htmlFor={id} >{label}</InputLabel> <Input id={id} inputProps={{'aria-label': label+'-input'}} endAdornment={<div>{ifFeature}{whenFeature}</div>} {...otherProps} /> <FormHelperText>{errorText}</FormHelperText> diff --git a/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementBoolean.tsx b/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementBoolean.tsx index 081ec46e8..81c9d6dcd 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementBoolean.tsx +++ b/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementBoolean.tsx @@ -17,7 +17,7 @@ */ import * as React from "react" -import { MenuItem, FormHelperText, Select, FormControl, InputLabel } from "@material-ui/core"; +import { MenuItem, FormHelperText, Select, FormControl, InputLabel } from "@mui/material"; import { ViewElementBoolean } from "../models/uiModels"; import { BaseProps } from "./baseProps"; @@ -32,9 +32,9 @@ export const UiElementBoolean = (props: BooleanInputProps) => { const mandetoryError = element.mandatory && value !== 'true' && value !== 'false'; return (!props.readOnly || element.id != null - ? (<FormControl style={{ width: 485, marginLeft: 20, marginRight: 20 }}> + ? (<FormControl variant="standard" style={{ width: 485, marginLeft: 20, marginRight: 20 }}> <InputLabel htmlFor={`select-${element.id}`} >{element.label}</InputLabel> - <Select + <Select variant="standard" aria-label={element.label+'-selection'} required={!!element.mandatory} error={mandetoryError} diff --git a/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementLeafList.tsx b/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementLeafList.tsx index c705b982f..5937ed7b3 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementLeafList.tsx +++ b/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementLeafList.tsx @@ -17,10 +17,11 @@ */ import * as React from "react" -import { FormControl, InputLabel, Paper, Chip, FormHelperText, Dialog, DialogTitle, DialogContentText, DialogActions, Button, DialogContent } from "@material-ui/core"; -import { makeStyles } from '@material-ui/core/styles'; -import AddIcon from '@material-ui/icons/Add'; +import { FormControl, InputLabel, Paper, Chip, FormHelperText, Dialog, DialogTitle, DialogContentText, DialogActions, Button, DialogContent } from "@mui/material"; +import makeStyles from '@mui/styles/makeStyles'; +import AddIcon from '@mui/icons-material/Add'; +import { Theme } from '@mui/material/styles'; import { ViewElement } from "../models/uiModels"; import { BaseProps } from "./baseProps"; @@ -29,8 +30,8 @@ type LeafListProps = BaseProps<any []> & { getEditorForViewElement: (uiElement: ViewElement) => (null | React.ComponentType<BaseProps<any>>) }; -const useStyles = makeStyles((theme) => { - const light = theme.palette.type === 'light'; +const useStyles = makeStyles((theme: Theme) => { + const light = theme.palette.mode === 'light'; const bottomLineColor = light ? 'rgba(0, 0, 0, 0.42)' : 'rgba(255, 255, 255, 0.7)'; return ({ @@ -64,10 +65,10 @@ const useStyles = makeStyles((theme) => { }), pointerEvents: 'none', // Transparent to the hover style. }, - '&$focused:after': { + '&.Mui-focused:after': { transform: 'scaleX(1)', }, - '&$error:after': { + '&.Mui-error:after': { borderBottomColor: theme.palette.error.main, transform: 'scaleX(1)', // error is always underlined in red }, @@ -91,7 +92,7 @@ const useStyles = makeStyles((theme) => { borderBottom: `1px solid ${bottomLineColor}`, }, }, - '&$disabled:before': { + '&.Mui-disabled:before': { borderBottomStyle: 'dotted', }, }, @@ -144,7 +145,7 @@ export const UiElementLeafList = (props: LeafListProps) => { return ( <> - <FormControl style={{ width: 485, marginLeft: 20, marginRight: 20 }}> + <FormControl variant="standard" style={{ width: 485, marginLeft: 20, marginRight: 20 }}> <InputLabel htmlFor={`list-${element.id}`} shrink={!props.readOnly || !!(inputValue && inputValue.length)} >{element.label}</InputLabel> <ul className={`${classes.root} ${classes.underline}`} id={`list-${element.id}`}> { !props.readOnly ? <li> @@ -195,7 +196,7 @@ export const UiElementLeafList = (props: LeafListProps) => { /> || null } </DialogContent> <DialogActions> - <Button onClick={ handleClose }> Cancel </Button> + <Button color="inherit" onClick={ handleClose }> Cancel </Button> <Button disabled={editorValue == null || editorValue === "" } onClick={ onApplyButton } color="secondary"> {editorValueIndex < 0 ? "Add" : "Apply"} </Button> </DialogActions> </Dialog> diff --git a/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementNumber.tsx b/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementNumber.tsx index ac4afc1d9..c4816686a 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementNumber.tsx +++ b/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementNumber.tsx @@ -17,7 +17,7 @@ */ import { ViewElementNumber } from "models/uiModels"; -import { Tooltip, InputAdornment } from "@material-ui/core"; +import { Tooltip, InputAdornment } from "@mui/material"; import * as React from 'react'; import { BaseProps } from "./baseProps"; import { IfWhenTextInput } from "./ifWhenTextInput"; @@ -53,7 +53,7 @@ export const UiElementNumber = (props: numberInputProps) => { } return ( - <Tooltip title={isTooltipVisible ? element.description || '' : ''}> + <Tooltip disableInteractive title={isTooltipVisible ? element.description || '' : ''}> <IfWhenTextInput element={element} onChangeTooltipVisuability={setTooltipVisibility} spellCheck={false} autoFocus margin="dense" id={element.id} label={element.label} type="text" value={props.inputValue} diff --git a/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementReference.tsx b/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementReference.tsx index b7697c880..9e863f0d0 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementReference.tsx +++ b/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementReference.tsx @@ -17,7 +17,10 @@ */ import React, { useState } from 'react'; -import { Tooltip, Button, FormControl, Theme, createStyles, makeStyles } from '@material-ui/core'; +import { Tooltip, Button, FormControl, Theme } from '@mui/material'; + +import createStyles from '@mui/styles/createStyles'; +import makeStyles from '@mui/styles/makeStyles'; import { ViewElement } from '../models/uiModels'; @@ -38,8 +41,8 @@ export const UIElementReference: React.FC<UIElementReferenceProps> = (props) => const [disabled, setDisabled] = useState(true); const { element } = props; return ( - <FormControl key={element.id} style={{ width: 485, marginLeft: 20, marginRight: 20 }} onMouseDown={(ev) => { ev.preventDefault(); ev.stopPropagation(); ev.button === 1 && setDisabled(!disabled) }}> - <Tooltip title={element.description || element.path || ''}> + <FormControl variant="standard" key={element.id} style={{ width: 485, marginLeft: 20, marginRight: 20 }} onMouseDown={(ev) => { ev.preventDefault(); ev.stopPropagation(); ev.button === 1 && setDisabled(!disabled) }}> + <Tooltip disableInteractive title={element.description || element.path || ''}> <Button className={classes.button} aria-label={element.label+'-button'} color="secondary" disabled={props.disabled && disabled} onClick={() => { props.onOpenReference(element); }} >{`${element.label}`}</Button> diff --git a/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementSelection.tsx b/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementSelection.tsx index 530b0be9b..7ca9ae36b 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementSelection.tsx +++ b/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementSelection.tsx @@ -19,7 +19,7 @@ import * as React from 'react'; import { BaseProps } from './baseProps'; import { ViewElementSelection } from '../models/uiModels' -import { FormControl, InputLabel, Select, FormHelperText, MenuItem, Tooltip } from '@material-ui/core'; +import { FormControl, InputLabel, Select, FormHelperText, MenuItem, Tooltip } from '@mui/material'; type selectionProps = BaseProps; @@ -34,9 +34,9 @@ export const UiElementSelection = (props: selectionProps) => { } return (props.readOnly || props.inputValue != null - ? (<FormControl style={{ width: 485, marginLeft: 20, marginRight: 20 }}> + ? (<FormControl variant="standard" style={{ width: 485, marginLeft: 20, marginRight: 20 }}> <InputLabel htmlFor={`select-${element.id}`} >{element.label}</InputLabel> - <Select + <Select variant="standard" required={!!element.mandatory} error={!!error} onChange={(e) => { props.onChange(e.target.value as string) }} @@ -50,7 +50,7 @@ export const UiElementSelection = (props: selectionProps) => { }} > {element.options.map(option => ( - <MenuItem key={option.key} value={option.key} aria-label={option.key}><Tooltip title={option.description || '' }><div style={{width:"100%"}}>{option.key}</div></Tooltip></MenuItem> + <MenuItem key={option.key} value={option.key} aria-label={option.key}><Tooltip disableInteractive title={option.description || '' }><div style={{width:"100%"}}>{option.key}</div></Tooltip></MenuItem> ))} </Select> <FormHelperText>{error}</FormHelperText> diff --git a/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementString.tsx b/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementString.tsx index f87b94f1d..4908c41aa 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementString.tsx +++ b/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementString.tsx @@ -17,7 +17,7 @@ */ import * as React from "react" -import { Tooltip, TextField } from "@material-ui/core"; +import { Tooltip, TextField } from "@mui/material"; import { ViewElementString } from "../models/uiModels"; import { BaseProps } from "./baseProps"; import { IfWhenTextInput } from "./ifWhenTextInput"; @@ -68,7 +68,7 @@ export const UiElementString = (props: stringEntryProps) => { } return ( - <Tooltip title={isTooltipVisible ? element.description || '' : ''}> + <Tooltip disableInteractive title={isTooltipVisible ? element.description || '' : ''}> <IfWhenTextInput element={element} onChangeTooltipVisuability={setTooltipVisibility} spellCheck={false} autoFocus margin="dense" id={element.id} label={props?.isKey ? "🔑 " + element.label : element.label} type="text" value={props.inputValue} diff --git a/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementUnion.tsx b/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementUnion.tsx index 669e39360..67cd998d7 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementUnion.tsx +++ b/sdnr/wt/odlux/apps/configurationApp/src/components/uiElementUnion.tsx @@ -18,7 +18,7 @@ import * as React from 'react' import { BaseProps } from './baseProps'; -import { Tooltip } from '@material-ui/core'; +import { Tooltip } from '@mui/material'; import { IfWhenTextInput } from './ifWhenTextInput'; import { ViewElementUnion, isViewElementString, isViewElementNumber, isViewElementObject, ViewElementNumber } from '../models/uiModels'; import { checkRange, checkPattern } from './verifyer'; @@ -76,7 +76,7 @@ export const UIElementUnion = (props: UiElementUnionProps) => { } }; - return <Tooltip title={isTooltipVisible ? element.description || '' : ''}> + return <Tooltip disableInteractive title={isTooltipVisible ? element.description || '' : ''}> <IfWhenTextInput element={element} onChangeTooltipVisuability={setTooltipVisibility} spellCheck={false} autoFocus margin="dense" id={element.id} label={props.isKey ? "🔑 " + element.label : element.label} type="text" value={props.inputValue} diff --git a/sdnr/wt/odlux/apps/configurationApp/src/pluginConfiguration.tsx b/sdnr/wt/odlux/apps/configurationApp/src/pluginConfiguration.tsx index 3b9baa657..e37879102 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/pluginConfiguration.tsx +++ b/sdnr/wt/odlux/apps/configurationApp/src/pluginConfiguration.tsx @@ -63,7 +63,7 @@ const ConfigurationApplicationRouteAdapter = connect(undefined, mapDisp)((props: currentNodeId = currentNodeId.replace(/\|dump$/i, ''); } currentVirtualPath = null; - currentNodeId && await props.updateNodeId(currentNodeId); + currentNodeId && (await props.updateNodeId(currentNodeId)); } if (currentVirtualPath !== props.match.params[0]) { diff --git a/sdnr/wt/odlux/apps/configurationApp/src/services/yangService.ts b/sdnr/wt/odlux/apps/configurationApp/src/services/yangService.ts index 3dc3a8634..cf4677bc9 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/services/yangService.ts +++ b/sdnr/wt/odlux/apps/configurationApp/src/services/yangService.ts @@ -31,7 +31,7 @@ class YangService { if (cacheHit) return cacheHit; const res = await fetch(url); - const yangFile = res.ok && await res.text(); + const yangFile = res.ok && (await res.text()); if (yangFile !== false && yangFile !== null) { cache[url] = yangFile; } diff --git a/sdnr/wt/odlux/apps/configurationApp/src/views/configurationApplication.tsx b/sdnr/wt/odlux/apps/configurationApp/src/views/configurationApplication.tsx index b777cdbe5..2879899a5 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/views/configurationApplication.tsx +++ b/sdnr/wt/odlux/apps/configurationApp/src/views/configurationApplication.tsx @@ -19,7 +19,11 @@ import React, { useState } from 'react'; import { RouteComponentProps, withRouter } from 'react-router-dom'; -import { WithStyles, withStyles, createStyles, Theme } from '@material-ui/core/styles'; +import { Theme } from '@mui/material/styles'; + +import { WithStyles } from '@mui/styles'; +import withStyles from '@mui/styles/withStyles'; +import createStyles from '@mui/styles/createStyles'; import connect, { IDispatcher, Connect } from "../../../../framework/src/flux/connect"; import { IApplicationStoreState } from "../../../../framework/src/store/applicationStore"; @@ -33,28 +37,28 @@ import { ViewSpecification, isViewElementString, isViewElementNumber, isViewElem import { getAccessPolicyByUrl } from "../../../../framework/src/services/restService"; -import Fab from '@material-ui/core/Fab'; -import AddIcon from '@material-ui/icons/Add'; -import PostAdd from '@material-ui/icons/PostAdd'; -import ArrowBack from '@material-ui/icons/ArrowBack'; -import RemoveIcon from '@material-ui/icons/RemoveCircleOutline'; -import SaveIcon from '@material-ui/icons/Save'; -import EditIcon from '@material-ui/icons/Edit'; -import Tooltip from "@material-ui/core/Tooltip"; -import FormControl from "@material-ui/core/FormControl"; -import IconButton from "@material-ui/core/IconButton"; - -import InputLabel from "@material-ui/core/InputLabel"; -import Select from "@material-ui/core/Select"; -import MenuItem from "@material-ui/core/MenuItem"; -import Breadcrumbs from "@material-ui/core/Breadcrumbs"; -import Button from '@material-ui/core/Button'; -import Link from "@material-ui/core/Link"; -import Accordion from '@material-ui/core/Accordion'; -import AccordionSummary from '@material-ui/core/AccordionSummary'; -import AccordionDetails from '@material-ui/core/AccordionDetails'; -import Typography from '@material-ui/core/Typography'; -import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; +import Fab from '@mui/material/Fab'; +import AddIcon from '@mui/icons-material/Add'; +import PostAdd from '@mui/icons-material/PostAdd'; +import ArrowBack from '@mui/icons-material/ArrowBack'; +import RemoveIcon from '@mui/icons-material/RemoveCircleOutline'; +import SaveIcon from '@mui/icons-material/Save'; +import EditIcon from '@mui/icons-material/Edit'; +import Tooltip from "@mui/material/Tooltip"; +import FormControl from "@mui/material/FormControl"; +import IconButton from "@mui/material/IconButton"; + +import InputLabel from "@mui/material/InputLabel"; +import Select from "@mui/material/Select"; +import MenuItem from "@mui/material/MenuItem"; +import Breadcrumbs from "@mui/material/Breadcrumbs"; +import Button from '@mui/material/Button'; +import Link from "@mui/material/Link"; +import Accordion from '@mui/material/Accordion'; +import AccordionSummary from '@mui/material/AccordionSummary'; +import AccordionDetails from '@mui/material/AccordionDetails'; +import Typography from '@mui/material/Typography'; +import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import { BaseProps } from '../components/baseProps'; @@ -425,9 +429,9 @@ class ConfigurationApplicationComponent extends React.Component<ConfigurationApp const subElements = currentCase?.elements; return ( <> - <FormControl key={uiElement.id} style={{ width: 485, marginLeft: 20, marginRight: 20 }}> + <FormControl variant="standard" key={uiElement.id} style={{ width: 485, marginLeft: 20, marginRight: 20 }}> <InputLabel htmlFor={`select-${uiElement.id}`} >{uiElement.label}</InputLabel> - <Select + <Select variant="standard" aria-label={uiElement.label + '-selection'} required={!!uiElement.mandatory} onChange={(e) => { @@ -615,15 +619,19 @@ class ConfigurationApplicationComponent extends React.Component<ConfigurationApp const confirm = useConfirm(); return ( - <Tooltip title={"Remove"} > - <IconButton disabled={props.disabled} className={classes.button} aria-label="remove-element-button" + <Tooltip disableInteractive title={"Remove"} > + <IconButton + disabled={props.disabled} + className={classes.button} + aria-label="remove-element-button" onClick={async (e) => { e.stopPropagation(); e.preventDefault(); - confirm({ title: "Do you really want to delete this element ?", description: "This action is permanent!", confirmationButtonProps: { color: "secondary" } }) + confirm({ title: "Do you really want to delete this element ?", description: "This action is permanent!", confirmationButtonProps: { color: "secondary" }, cancellationButtonProps: { color:"inherit" } }) .then(() => removeElement(`${this.props.vPath}[${props.rowData[listKeyProperty]}]`)) .then(props.onReload); - }} > + }} + size="large"> <RemoveIcon /> </IconButton> </Tooltip> @@ -714,7 +722,7 @@ class ConfigurationApplicationComponent extends React.Component<ConfigurationApp </div> ) : null } - <Button onClick={() => { + <Button color="inherit" onClick={() => { const resultingViewData = inputViewSpecification && this.collectData(inputViewSpecification.elements); this.props.executeRpc(this.props.vPath!, resultingViewData); }} >Exec</Button> @@ -738,12 +746,12 @@ class ConfigurationApplicationComponent extends React.Component<ConfigurationApp <div className={this.props.classes.header}> <div> <Breadcrumbs aria-label="breadcrumbs"> - <Link color="inherit" href="#" aria-label="back-breadcrumb" + <Link underline="hover" color="inherit" href="#" aria-label="back-breadcrumb" onClick={(ev: React.MouseEvent<HTMLElement>) => { ev.preventDefault(); this.props.history.push(lastPath); }}>Back</Link> - <Link color="inherit" href="#" + <Link underline="hover" color="inherit" href="#" aria-label={nodeId + '-breadcrumb'} onClick={(ev: React.MouseEvent<HTMLElement>) => { ev.preventDefault(); @@ -756,14 +764,14 @@ class ConfigurationApplicationComponent extends React.Component<ConfigurationApp const propTitle = prop.replace(/^[^:]+:/, ""); const ret = ( <span key={ind}> - <Link color="inherit" href="#" + <Link underline="hover" color="inherit" href="#" aria-label={propTitle + '-breadcrumb'} onClick={(ev: React.MouseEvent<HTMLElement>) => { ev.preventDefault(); this.props.history.push(path); }}><span>{propTitle}</span></Link> { - keyPath && <Link color="inherit" href="#" + keyPath && <Link underline="hover" color="inherit" href="#" aria-label={key + '-breadcrumb'} onClick={(ev: React.MouseEvent<HTMLElement>) => { ev.preventDefault(); @@ -781,7 +789,7 @@ class ConfigurationApplicationComponent extends React.Component<ConfigurationApp </div> {this.state.editMode && ( <Fab color="secondary" aria-label="back-button" className={this.props.classes.fab} onClick={async () => { - this.props.vPath && await this.props.reloadView(this.props.vPath); + this.props.vPath && (await this.props.reloadView(this.props.vPath)); this.setState({ editMode: false }); }} ><ArrowBack /></Fab> ) || null} diff --git a/sdnr/wt/odlux/apps/configurationApp/webpack.config.js b/sdnr/wt/odlux/apps/configurationApp/webpack.config.js index e3f3b6f19..5461c14f2 100644 --- a/sdnr/wt/odlux/apps/configurationApp/webpack.config.js +++ b/sdnr/wt/odlux/apps/configurationApp/webpack.config.js @@ -88,7 +88,7 @@ module.exports = (env) => { manifest: require(path.resolve(frameworkPath, "app-manifest.json")), sourceType: "umd2" }), - ...(env === "release") ? [ + ...(env === "release" ? [ new webpack.DefinePlugin({ "process.env": { NODE_ENV: "'production'", @@ -106,7 +106,7 @@ module.exports = (env) => { from: 'index.html', to: distPath }]), - ] + ]) ], watchOptions: { diff --git a/sdnr/wt/odlux/apps/connectApp/package.json b/sdnr/wt/odlux/apps/connectApp/package.json index a6b23df84..9ecdaf853 100644 --- a/sdnr/wt/odlux/apps/connectApp/package.json +++ b/sdnr/wt/odlux/apps/connectApp/package.json @@ -21,20 +21,25 @@ "author": "Matthias Fischer", "license": "Apache-2.0", "dependencies": { - "@odlux/framework": "*" + "@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": "*", + "react-chartjs-2": "2.7.6", + "chart.js": "2.8.0" }, "peerDependencies": { - "@types/react": "17.0.3", - "@types/react-dom": "17.0.2", - "@types/react-router-dom": "5.1.7", - "@material-ui/core": "4.11.4", - "@material-ui/icons": "4.11.2", "@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.1", - "react-dom": "17.0.1", + "react": "17.0.2", + "react-dom": "17.0.2", "react-router-dom": "5.2.0" } -}
\ No newline at end of file +} diff --git a/sdnr/wt/odlux/apps/connectApp/src/actions/networkElementsActions.ts b/sdnr/wt/odlux/apps/connectApp/src/actions/networkElementsActions.ts index 1e569a196..041cff9da 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/actions/networkElementsActions.ts +++ b/sdnr/wt/odlux/apps/connectApp/src/actions/networkElementsActions.ts @@ -37,7 +37,7 @@ export const addNewNetworkElementAsyncActionCreator = (element: NetworkElementCo /** Represents an async thunk action creator to edit network element. */ export const editNetworkElementAsyncActionCreator = (element: UpdateNetworkElement) => async (dispatch: Dispatch) => { - const connectionStatus: ConnectionStatus[] = await connectService.getNetworkElementConnectionStatus(element.id).then(ne => (ne)) || []; + const connectionStatus: ConnectionStatus[] = (await connectService.getNetworkElementConnectionStatus(element.id).then(ne => (ne))) || []; const currentConnectionStatus = connectionStatus[0].status; if (currentConnectionStatus === "Disconnected") { const res = await connectService.deleteNetworkElement(element); diff --git a/sdnr/wt/odlux/apps/connectApp/src/components/connectionStatusLog.tsx b/sdnr/wt/odlux/apps/connectApp/src/components/connectionStatusLog.tsx index 5a5ebcc45..a7d96d072 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/components/connectionStatusLog.tsx +++ b/sdnr/wt/odlux/apps/connectApp/src/components/connectionStatusLog.tsx @@ -19,7 +19,7 @@ import * as React from 'react'; import connect, { IDispatcher, Connect } from '../../../../framework/src/flux/connect'; import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; import { MaterialTable, ColumnType, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; -import Refresh from '@material-ui/icons/Refresh'; +import Refresh from '@mui/icons-material/Refresh'; import { createConnectionStatusLogActions, createConnectionStatusLogProperties } from '../handlers/connectionStatusLogHandler'; import { NetworkElementConnectionLog } from '../models/networkElementConnectionLog'; diff --git a/sdnr/wt/odlux/apps/connectApp/src/components/dashboardHome.tsx b/sdnr/wt/odlux/apps/connectApp/src/components/dashboardHome.tsx new file mode 100644 index 000000000..683c59623 --- /dev/null +++ b/sdnr/wt/odlux/apps/connectApp/src/components/dashboardHome.tsx @@ -0,0 +1,425 @@ +/** + * ============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 { withRouter, RouteComponentProps } from 'react-router-dom'; +import connect, { Connect, IDispatcher } from '../../../../framework/src/flux/connect';; +import { Theme } from '@mui/material'; +import { WithStyles } from '@mui/styles'; +import createStyles from '@mui/styles/createStyles'; +import withStyles from '@mui/styles/withStyles'; +import { Doughnut } from 'react-chartjs-2'; +import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; +import { NavigateToApplication } from '../../../../framework/src/actions/navigationActions'; + +const styles = (theme: Theme) => createStyles({ + pageWidthSettings: { + width: '50%', + float: 'left' + }, +}) + +const scrollbar = { overflow: "auto", paddingRight: "20px" } + +let connectionStatusinitialLoad = true; +let connectionStatusinitialStateChanged = false; +let connectionStatusDataLoad: number[] = [0, 0, 0, 0]; +let connectionTotalCount = 0; + +let alarmStatusinitialLoad = true; +let alarmStatusinitialStateChanged = false; +let alarmStatusDataLoad: number[] = [0, 0, 0, 0]; +let alarmTotalCount = 0; + +const mapProps = (state: IApplicationStoreState) => ({ + connectionStatusCount: state.connect.connectionStatusCount, + alarmStatus: state.fault.faultStatus +}); + +const mapDispatch = (dispatcher: IDispatcher) => ({ + navigateToApplication: (applicationName: string, path?: string) => dispatcher.dispatch(new NavigateToApplication(applicationName, path)), +}); + +type HomeComponentProps = RouteComponentProps & Connect<typeof mapProps, typeof mapDispatch> & WithStyles<typeof styles>; + +class DashboardHome extends React.Component<HomeComponentProps> { + constructor(props: HomeComponentProps) { + super(props); + this.state = { + } + } + + render(): JSX.Element { + const { classes } = this.props; + + if (!this.props.connectionStatusCount.isLoadingConnectionStatusChart) { + connectionStatusDataLoad = [ + this.props.connectionStatusCount.Connected, + this.props.connectionStatusCount.Connecting, + this.props.connectionStatusCount.Disconnected, + this.props.connectionStatusCount.UnableToConnect + ]; + connectionTotalCount = this.props.connectionStatusCount.Connected + this.props.connectionStatusCount.Connecting + + this.props.connectionStatusCount.Disconnected + this.props.connectionStatusCount.UnableToConnect; + + } + + if (!this.props.alarmStatus.isLoadingAlarmStatusChart) { + alarmStatusDataLoad = [ + this.props.alarmStatus.critical, + this.props.alarmStatus.major, + this.props.alarmStatus.minor, + this.props.alarmStatus.warning + ]; + alarmTotalCount = this.props.alarmStatus.critical + this.props.alarmStatus.major + + this.props.alarmStatus.minor + this.props.alarmStatus.warning; + } + + /** Available Network Connection Status chart data */ + const connectionStatusData = { + labels: ['Connected', 'Connecting', 'Disconnected', 'UnableToConnect'], + datasets: [{ + data: connectionStatusDataLoad, + backgroundColor: [ + 'rgb(0, 153, 51)', + 'rgb(255, 102, 0)', + 'rgb(191, 191, 191)', + 'rgb(191, 191, 191)' + ] + }] + }; + + + /** No Devices available */ + const connectionStatusUnavailableData = { + labels: ['No Devices available'], + datasets: [{ + data: [1], + backgroundColor: [ + 'rgb(255, 255, 255)' + ] + }] + }; + + /** Loading Connection Status chart */ + const connectionStatusisLoading = { + labels: ['Loading chart...'], + datasets: [{ + data: [1], + backgroundColor: [ + 'rgb(255, 255, 255)' + ] + }] + }; + + /** Loading Alarm Status chart */ + const alarmStatusisLoading = { + labels: ['Loading chart...'], + datasets: [{ + data: [1], + backgroundColor: [ + 'rgb(255, 255, 255)' + ] + }] + }; + + /** Connection status options */ + let labels: String[] = ['Connected', 'Connecting', 'Disconnected', 'UnableToConnect']; + const connectionStatusOptions = { + responsive: true, + maintainAspectRatio: false, + animation: { + duration: 0 + }, + plugins: { + legend: { + display: true, + position: 'top' + } + }, + onClick: (event: MouseEvent, item: any) => { + if (item[0]) { + let connectionStatus = labels[item[0]._index] + ''; + this.props.navigateToApplication("connect", '/connectionStatus/' + connectionStatus); + } + } + } + + /** Connection status unavailable options */ + const connectionStatusUnavailableOptions = { + responsive: true, + maintainAspectRatio: false, + animation: { + duration: 0 + }, + plugins: { + legend: { + display: true, + position: 'top' + }, + tooltip: { + enabled: false + } + } + } + + /** Add text inside the doughnut chart for Connection Status */ + const connectionStatusPlugins = [{ + beforeDraw: function (chart: any) { + var width = chart.width, + height = chart.height, + ctx = chart.ctx; + ctx.restore(); + var fontSize = (height / 480).toFixed(2); + ctx.font = fontSize + "em sans-serif"; + ctx.textBaseline = "top"; + var text = "Network Connection Status", + textX = Math.round((width - ctx.measureText(text).width) / 2), + textY = height / 2; + ctx.fillText(text, textX, textY); + ctx.save(); + } + }] + + /** Alarm status Data */ + const alarmStatusData = { + labels: [ + 'Critical', + 'Major', + 'Minor', + 'Warning' + ], + datasets: [{ + data: alarmStatusDataLoad, + backgroundColor: [ + 'rgb(240, 25, 10)', + 'rgb(240, 133, 10)', + 'rgb(240, 240, 10)', + 'rgb(46, 115, 176)' + ], + }] + } + + /** No Alarm status available */ + const alarmStatusUnavailableData = { + labels: ['No Alarms available'], + datasets: [{ + data: [1], + backgroundColor: [ + 'rgb(0, 153, 51)' + ] + }] + }; + + /** Alarm status Options */ + let alarmLabels: String[] = ['Critical', 'Major', 'Minor', 'Warning']; + const alarmStatusOptions = { + responsive: true, + maintainAspectRatio: false, + animation: { + duration: 0 + }, + plugins: { + legend: { + display: true, + position: 'top' + } + }, + onClick: (event: MouseEvent, item: any) => { + if (item[0]) { + let severity = alarmLabels[item[0].index] + ''; + this.props.navigateToApplication("fault", '/alarmStatus/' + severity); + } + }, + }; + + /** Alarm status unavailable options */ + const alarmStatusUnavailableOptions = { + responsive: true, + maintainAspectRatio: false, + animation: { + duration: 0 + }, + plugins: { + legend: { + display: true, + position: 'top' + }, + tooltip: { + enabled: false + } + } + } + /** Add text inside the doughnut chart for Alarm Status */ + const alarmStatusPlugins = [{ + beforeDraw: function (chart: any) { + var width = chart.width, + height = chart.height, + ctx = chart.ctx; + ctx.restore(); + var fontSize = (height / 480).toFixed(2); + ctx.font = fontSize + "em sans-serif"; + ctx.textBaseline = "top"; + var text = "Network Alarm Status", + textX = Math.round((width - ctx.measureText(text).width) / 2), + textY = height / 2; + ctx.fillText(text, textX, textY); + ctx.save(); + } + }] + + return ( + <> + <div style={scrollbar} > + <h1>Welcome to ODLUX</h1> + <div style={{ width: '50%', float: 'left' }}> + {this.checkElementsAreLoaded() ? + this.checkConnectionStatus() && connectionTotalCount != 0 ? + <Doughnut + data={connectionStatusData} + type={Doughnut} + width={500} + height={500} + options={connectionStatusOptions} + plugins={connectionStatusPlugins} + /> + : <Doughnut + data={connectionStatusUnavailableData} + type={Doughnut} + width={500} + height={500} + options={connectionStatusUnavailableOptions} + plugins={connectionStatusPlugins} /> + : <Doughnut + data={connectionStatusisLoading} + type={Doughnut} + width={500} + height={500} + options={connectionStatusUnavailableOptions} + plugins={connectionStatusPlugins} + /> + } + </div> + <div style={{ width: '50%', float: 'left' }}> + {this.checkAlarmsAreLoaded() ? + this.checkAlarmStatus() && alarmTotalCount != 0 ? + <Doughnut + data={alarmStatusData} + type={Doughnut} + width={500} + height={500} + options={alarmStatusOptions} + plugins={alarmStatusPlugins} + /> + : <Doughnut + data={alarmStatusUnavailableData} + type={Doughnut} + width={500} + height={500} + options={alarmStatusUnavailableOptions} + plugins={alarmStatusPlugins} + /> + : <Doughnut + data={alarmStatusisLoading} + type={Doughnut} + width={500} + height={500} + options={alarmStatusUnavailableOptions} + plugins={alarmStatusPlugins} + /> + } + </div> + </div> + </> + ) + } + + /** Check if connection status data available */ + public checkConnectionStatus = () => { + let statusCount = this.props.connectionStatusCount; + if (statusCount.isLoadingConnectionStatusChart) { + return true; + } + if (statusCount.Connected == 0 && statusCount.Connecting == 0 && statusCount.Disconnected == 0 + && statusCount.UnableToConnect == 0) { + return false; + } else { + return true; + } + } + + /** Check if connection status chart data is loaded */ + public checkElementsAreLoaded = () => { + let isLoadingCheck = this.props.connectionStatusCount; + if (connectionStatusinitialLoad && !isLoadingCheck.isLoadingConnectionStatusChart) { + if (this.checkConnectionStatus()) { + connectionStatusinitialLoad = false; + return true; + } + return false; + } else if (connectionStatusinitialLoad && isLoadingCheck.isLoadingConnectionStatusChart) { + connectionStatusinitialLoad = false; + connectionStatusinitialStateChanged = true; + return !isLoadingCheck.isLoadingConnectionStatusChart; + } else if (connectionStatusinitialStateChanged) { + if (!isLoadingCheck.isLoadingConnectionStatusChart) { + connectionStatusinitialStateChanged = false; + } + return !isLoadingCheck.isLoadingConnectionStatusChart; + } + return true; + } + + /** Check if alarms data available */ + public checkAlarmStatus = () => { + let alarmCount = this.props.alarmStatus; + if (alarmCount.isLoadingAlarmStatusChart) { + return true; + } + if (alarmCount.critical == 0 && alarmCount.major == 0 && alarmCount.minor == 0 && alarmCount.warning == 0) { + return false; + } + else { + return true; + } + } + + /** Check if alarm status chart data is loaded */ + public checkAlarmsAreLoaded = () => { + let isLoadingCheck = this.props.alarmStatus; + if (alarmStatusinitialLoad && !isLoadingCheck.isLoadingAlarmStatusChart) { + if (this.checkAlarmStatus()) { + alarmStatusinitialLoad = false; + return true; + } + return false; + } else if (alarmStatusinitialLoad && isLoadingCheck.isLoadingAlarmStatusChart) { + alarmStatusinitialLoad = false; + alarmStatusinitialStateChanged = true; + return !isLoadingCheck.isLoadingAlarmStatusChart; + } else if (alarmStatusinitialStateChanged) { + if (!isLoadingCheck.isLoadingAlarmStatusChart) { + alarmStatusinitialStateChanged = false; + } + return !isLoadingCheck.isLoadingAlarmStatusChart; + } + return true; + } +} + +export default (withRouter(connect(mapProps, mapDispatch)(DashboardHome)));
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/connectApp/src/components/editNetworkElementDialog.tsx b/sdnr/wt/odlux/apps/connectApp/src/components/editNetworkElementDialog.tsx index 061303976..7324ffab8 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/components/editNetworkElementDialog.tsx +++ b/sdnr/wt/odlux/apps/connectApp/src/components/editNetworkElementDialog.tsx @@ -17,14 +17,14 @@ */ import * as React from 'react'; -import Button from '@material-ui/core/Button'; -import TextField from '@material-ui/core/TextField'; -import Dialog from '@material-ui/core/Dialog'; -import DialogActions from '@material-ui/core/DialogActions'; -import DialogContent from '@material-ui/core/DialogContent'; -import DialogContentText from '@material-ui/core/DialogContentText'; -import DialogTitle from '@material-ui/core/DialogTitle'; -import { FormControl, InputLabel, Select, MenuItem, Typography, Radio, RadioGroup, Options, FormLabel, FormControlLabel } from '@material-ui/core'; +import Button from '@mui/material/Button'; +import TextField from '@mui/material/TextField'; +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 { FormControl, InputLabel, Select, MenuItem, Typography, Radio, RadioGroup, Options, FormLabel, FormControlLabel } from '@mui/material'; import { loadAllTlsKeyListAsync } from '../actions/tlsKeyActions'; import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; @@ -222,32 +222,32 @@ class EditNetworkElementDialogComponent extends React.Component<EditNetworkEleme <DialogContentText> {setting.dialogDescription} </DialogContentText> - <TextField disabled={!setting.enableMountIdEditor} spellCheck={false} autoFocus margin="dense" id="name" label="Name" aria-label="name" type="text" fullWidth value={this.state.nodeId} onChange={(event) => { this.setState({ nodeId: event.target.value }); }} /> + <TextField variant="standard" disabled={!setting.enableMountIdEditor} spellCheck={false} autoFocus margin="dense" id="name" label="Name" aria-label="name" type="text" fullWidth value={this.state.nodeId} onChange={(event) => { this.setState({ nodeId: event.target.value }); }} /> {!this.state.isNameValid && <Typography variant="body1" color="error">Name cannot be empty.</Typography>} - <TextField disabled={!setting.enableMountIdEditor} spellCheck={false} margin="dense" id="ipaddress" label="IP address" aria-label="ip adress" type="text" fullWidth value={this.state.host} onChange={(event) => { this.setState({ host: event.target.value }); }} /> + <TextField variant="standard" disabled={!setting.enableMountIdEditor} spellCheck={false} margin="dense" id="ipaddress" label="IP address" aria-label="ip adress" type="text" fullWidth value={this.state.host} onChange={(event) => { this.setState({ host: event.target.value }); }} /> {!this.state.isHostSet && <Typography variant="body1" color="error">IP Adress cannot be empty.</Typography>} - <TextField disabled={!setting.enableMountIdEditor} spellCheck={false} margin="dense" id="netconfport" label="NetConf port" aria-label="netconf port" type="number" fullWidth value={this.state.port.toString()} onChange={(event) => { this.setState({ port: +event.target.value }); }} /> - {setting.enableUsernameEditor && <TextField disabled={!setting.enableUsernameEditor} spellCheck={false} margin="dense" id="username" label="Username" aria-label="username" type="text" fullWidth value={this.state.username} onChange={(event) => { this.setState({ username: event.target.value }); }} /> || null} + <TextField variant="standard" disabled={!setting.enableMountIdEditor} spellCheck={false} margin="dense" id="netconfport" label="NetConf port" aria-label="netconf port" type="number" fullWidth value={this.state.port.toString()} onChange={(event) => { this.setState({ port: +event.target.value }); }} /> + {setting.enableUsernameEditor && <TextField variant="standard" disabled={!setting.enableUsernameEditor} spellCheck={false} margin="dense" id="username" label="Username" aria-label="username" type="text" fullWidth value={this.state.username} onChange={(event) => { this.setState({ username: event.target.value }); }} /> || null} {setting.enableUsernameEditor && <RadioGroup row aria-label="password-tls-key" name="password-tls-key" value={radioSelected} onChange={this.handleRadioChange} > - <FormControlLabel aria-label="passwordSelection" value='password' control={<Radio />} label="Password" onChange={this.onRadioSelect} /> - <FormControlLabel aria-label="tlsKeySelection" value='tlsKey' control={<Radio />} label="TlsKey" onChange={this.onRadioSelect} /> + <FormControlLabel aria-label="passwordSelection" value='password' control={<Radio color="secondary" />} label="Password" onChange={this.onRadioSelect} /> + <FormControlLabel aria-label="tlsKeySelection" value='tlsKey' control={<Radio color="secondary" />} label="TlsKey" onChange={this.onRadioSelect} /> </RadioGroup> || null} {setting.enableUsernameEditor && showPasswordTextField && - <TextField disabled={!setting.enableUsernameEditor || !showPasswordTextField} spellCheck={false} margin="dense" + <TextField variant="standard" disabled={!setting.enableUsernameEditor || !showPasswordTextField} spellCheck={false} margin="dense" id="password" aria-label="password" type="password" fullWidth value={this.state.password} onChange={(event) => { this.setState({ password: event.target.value }); }} /> || null} - <FormControl fullWidth disabled={!setting.enableUsernameEditor}> + <FormControl variant="standard" fullWidth disabled={!setting.enableUsernameEditor}> {setting.enableUsernameEditor && showTlsDropdown && <div> <InputLabel htmlFor="pass">--Select tls-key--</InputLabel> - <Select disabled={!setting.enableUsernameEditor || !showTlsDropdown} + <Select variant="standard" disabled={!setting.enableUsernameEditor || !showTlsDropdown} id="tlsKey" aria-label="tlsKey" value={this.state.tlsKey} fullWidth // displayEmpty onChange={(event) => { this.setState({ tlsKey: event.target.value as any }); }} inputProps={{ name: 'tlsKey', id: 'tlsKey' }} > @@ -259,9 +259,9 @@ class EditNetworkElementDialogComponent extends React.Component<EditNetworkEleme } </FormControl> - <FormControl fullWidth disabled={!setting.enableUsernameEditor}> + <FormControl variant="standard" fullWidth disabled={!setting.enableUsernameEditor}> <InputLabel htmlFor="active">Required</InputLabel> - <Select aria-label="required-selection" value={this.state.isRequired || false} onChange={(event) => { + <Select variant="standard" aria-label="required-selection" value={this.state.isRequired || false} onChange={(event) => { this.setState({ isRequired: event.target.value as any as boolean }); }} inputProps={{ name: 'required', id: 'required' }} fullWidth > <MenuItem value={true as any as string} aria-label="true">True</MenuItem> @@ -286,7 +286,7 @@ class EditNetworkElementDialogComponent extends React.Component<EditNetworkEleme } event.preventDefault(); event.stopPropagation(); - }} > {setting.applyButtonText} </Button> + }} color="inherit" > {setting.applyButtonText} </Button> <Button aria-label="dialog-cancel-button" onClick={(event) => { this.onCancel(); event.preventDefault(); @@ -294,7 +294,7 @@ class EditNetworkElementDialogComponent extends React.Component<EditNetworkEleme }} color="secondary"> {setting.cancelButtonText} </Button> </DialogActions> </Dialog> - ) + ); } public renderTlsKeys = () => { @@ -333,7 +333,8 @@ class EditNetworkElementDialogComponent extends React.Component<EditNetworkEleme case EditNetworkElementDialogMode.AddNewNetworkElement: element && this.props.addNewNetworkElement(element); this.setState({ - radioSelected: '' + radioSelected: '', + isPasswordSelected: true, }); break; case EditNetworkElementDialogMode.MountNetworkElement: diff --git a/sdnr/wt/odlux/apps/connectApp/src/components/infoNetworkElementDialog.tsx b/sdnr/wt/odlux/apps/connectApp/src/components/infoNetworkElementDialog.tsx index aeaaa91e7..5514fa5f8 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/components/infoNetworkElementDialog.tsx +++ b/sdnr/wt/odlux/apps/connectApp/src/components/infoNetworkElementDialog.tsx @@ -17,10 +17,10 @@ */ import * as React from 'react'; - import Button from '@material-ui/core/Button'; - import Dialog from '@material-ui/core/Dialog'; - import DialogActions from '@material-ui/core/DialogActions'; - import DialogTitle from '@material-ui/core/DialogTitle'; + import Button from '@mui/material/Button'; + import Dialog from '@mui/material/Dialog'; + import DialogActions from '@mui/material/DialogActions'; + import DialogTitle from '@mui/material/DialogTitle'; import { MaterialTable, ColumnType, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; import { IDispatcher, connect, Connect } from '../../../../framework/src/flux/connect'; diff --git a/sdnr/wt/odlux/apps/connectApp/src/components/networkElements.tsx b/sdnr/wt/odlux/apps/connectApp/src/components/networkElements.tsx index 4a7a0d269..a17a247d2 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/components/networkElements.tsx +++ b/sdnr/wt/odlux/apps/connectApp/src/components/networkElements.tsx @@ -16,17 +16,21 @@ * ============LICENSE_END========================================================================== */ import * as React from 'react'; -import { Theme, createStyles, withStyles, WithStyles } from '@material-ui/core/styles'; - -import AddIcon from '@material-ui/icons/Add'; -import Refresh from '@material-ui/icons/Refresh'; -import LinkIcon from '@material-ui/icons/Link'; -import LinkOffIcon from '@material-ui/icons/LinkOff'; -import RemoveIcon from '@material-ui/icons/RemoveCircleOutline'; -import EditIcon from '@material-ui/icons/Edit'; -import Info from '@material-ui/icons/Info'; -import ComputerIcon from '@material-ui/icons/Computer'; -import { MenuItem, Divider, Typography } from '@material-ui/core'; +import { Theme } from '@mui/material/styles'; + +import { WithStyles } from '@mui/styles'; +import createStyles from '@mui/styles/createStyles'; +import withStyles from '@mui/styles/withStyles'; + +import AddIcon from '@mui/icons-material/Add'; +import Refresh from '@mui/icons-material/Refresh'; +import LinkIcon from '@mui/icons-material/Link'; +import LinkOffIcon from '@mui/icons-material/LinkOff'; +import RemoveIcon from '@mui/icons-material/RemoveCircleOutline'; +import EditIcon from '@mui/icons-material/Edit'; +import Info from '@mui/icons-material/Info'; +import ComputerIcon from '@mui/icons-material/Computer'; +import { MenuItem, Divider, Typography } from '@mui/material'; import { MaterialTable, ColumnType, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; @@ -189,39 +193,37 @@ export class NetworkElementsListComponent extends React.Component<NetworkElement } }; - return ( - <> - <NetworkElementTable stickyHeader tableId="network-element-table" customActionButtons={[refreshNetworkElementsAction, ...canAdd ? [addRequireNetworkElementAction] : []]} columns={[ - { property: "nodeId", title: "Node Name", type: ColumnType.text }, - { property: "isRequired", title: "Required", type: ColumnType.boolean }, - { property: "status", title: "Connection Status", type: ColumnType.text, width:'15%' }, - { property: "host", title: "Host", type: ColumnType.text }, - { property: "port", title: "Port", type: ColumnType.numeric }, - { property: "coreModelCapability", title: "Core Model", type: ColumnType.text }, - { property: "deviceType", title: "Device Type", type: ColumnType.text }, - { property: "deviceFunction", title: "Device Function", type: ColumnType.text, width: '15%' } - ]} idProperty="id" {...this.props.networkElementsActions} {...this.props.networkElementsProperties} asynchronus createContextMenu={rowData => { - - return this.getContextMenu(rowData); - }} > - </NetworkElementTable> - <EditNetworkElementDialog - initialNetworkElement={networkElementToEdit} - mode={this.state.networkElementEditorMode} - onClose={this.onCloseEditNetworkElementDialog} - radioChecked={savedRadio} - /> - <RefreshNetworkElementsDialog - mode={this.state.refreshNetworkElementsEditorMode} - onClose={this.onCloseRefreshNetworkElementsDialog} - /> - <InfoNetworkElementDialog - initialNetworkElement={networkElementToEdit} - mode={this.state.infoNetworkElementEditorMode} - onClose={this.onCloseInfoNetworkElementDialog} - /> - </> - ); + return <> + <NetworkElementTable stickyHeader tableId="network-element-table" customActionButtons={[refreshNetworkElementsAction, ...(canAdd ? [addRequireNetworkElementAction] : [])]} columns={[ + { property: "nodeId", title: "Node Name", type: ColumnType.text }, + { property: "isRequired", title: "Required", type: ColumnType.boolean }, + { property: "status", title: "Connection Status", type: ColumnType.text, width:'15%' }, + { property: "host", title: "Host", type: ColumnType.text }, + { property: "port", title: "Port", type: ColumnType.numeric }, + { property: "coreModelCapability", title: "Core Model", type: ColumnType.text }, + { property: "deviceType", title: "Device Type", type: ColumnType.text }, + { property: "deviceFunction", title: "Device Function", type: ColumnType.text, width: '15%' } + ]} idProperty="id" {...this.props.networkElementsActions} {...this.props.networkElementsProperties} asynchronus createContextMenu={rowData => { + + return this.getContextMenu(rowData); + }} > + </NetworkElementTable> + <EditNetworkElementDialog + initialNetworkElement={networkElementToEdit} + mode={this.state.networkElementEditorMode} + onClose={this.onCloseEditNetworkElementDialog} + radioChecked={savedRadio} + /> + <RefreshNetworkElementsDialog + mode={this.state.refreshNetworkElementsEditorMode} + onClose={this.onCloseRefreshNetworkElementsDialog} + /> + <InfoNetworkElementDialog + initialNetworkElement={networkElementToEdit} + mode={this.state.infoNetworkElementEditorMode} + onClose={this.onCloseInfoNetworkElementDialog} + /> + </>; }; public componentDidMount() { diff --git a/sdnr/wt/odlux/apps/connectApp/src/components/refreshConnectionStatusLogDialog.tsx b/sdnr/wt/odlux/apps/connectApp/src/components/refreshConnectionStatusLogDialog.tsx index 41229eae6..c09f59b40 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/components/refreshConnectionStatusLogDialog.tsx +++ b/sdnr/wt/odlux/apps/connectApp/src/components/refreshConnectionStatusLogDialog.tsx @@ -17,12 +17,12 @@ */ import * as React from 'react'; -import Button from '@material-ui/core/Button'; -import Dialog from '@material-ui/core/Dialog'; -import DialogActions from '@material-ui/core/DialogActions'; -import DialogContent from '@material-ui/core/DialogContent'; -import DialogContentText from '@material-ui/core/DialogContentText'; -import DialogTitle from '@material-ui/core/DialogTitle'; +import 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 { connectionStatusLogReloadAction } from '../handlers/connectionStatusLogHandler'; import { IDispatcher, connect, Connect } from '../../../../framework/src/flux/connect'; @@ -94,13 +94,13 @@ class RefreshConnectionStatusLogDialogComponent extends React.Component<RefreshC <DialogActions> <Button aria-label="dialog-confirm-button" onClick={(event) => { this.onRefresh(); - }} > {setting.applyButtonText} </Button> + }} color="inherit" > {setting.applyButtonText} </Button> <Button aria-label="dialog-cancel-button" onClick={(event) => { this.onCancel(); }} color="secondary"> {setting.cancelButtonText} </Button> </DialogActions> </Dialog> - ) + ); } private onRefresh = () => { diff --git a/sdnr/wt/odlux/apps/connectApp/src/components/refreshNetworkElementsDialog.tsx b/sdnr/wt/odlux/apps/connectApp/src/components/refreshNetworkElementsDialog.tsx index a349977ab..27288faa6 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/components/refreshNetworkElementsDialog.tsx +++ b/sdnr/wt/odlux/apps/connectApp/src/components/refreshNetworkElementsDialog.tsx @@ -17,12 +17,12 @@ */ import * as React from 'react'; -import Button from '@material-ui/core/Button'; -import Dialog from '@material-ui/core/Dialog'; -import DialogActions from '@material-ui/core/DialogActions'; -import DialogContent from '@material-ui/core/DialogContent'; -import DialogContentText from '@material-ui/core/DialogContentText'; -import DialogTitle from '@material-ui/core/DialogTitle'; +import 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 { networkElementsReloadAction } from '../handlers/networkElementsHandler'; import { IDispatcher, connect, Connect } from '../../../../framework/src/flux/connect'; @@ -94,13 +94,13 @@ class RefreshNetworkElementsDialogComponent extends React.Component<RefreshNetwo <DialogActions> <Button aria-label="dialog-confirm-button" onClick={(event) => { this.onRefresh(); - }} > {setting.applyButtonText} </Button> + }} color="inherit" > {setting.applyButtonText} </Button> <Button aria-label="dialog-cancel-button" onClick={(event) => { this.onCancel(); }} color="secondary"> {setting.cancelButtonText} </Button> </DialogActions> </Dialog> - ) + ); } private onRefresh = () => { diff --git a/sdnr/wt/odlux/apps/connectApp/src/pluginConnect.tsx b/sdnr/wt/odlux/apps/connectApp/src/pluginConnect.tsx index afca74664..83763485b 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/pluginConnect.tsx +++ b/sdnr/wt/odlux/apps/connectApp/src/pluginConnect.tsx @@ -32,18 +32,19 @@ import { createNetworkElementsActions, createNetworkElementsProperties, networkE import connectAppRootHandler from './handlers/connectAppRootHandler'; import ConnectApplication from './views/connectView'; import { PanelId } from "./models/panelId"; -import { NetworkElementsList } from './components/networkElements' +import { NetworkElementsList } from './components/networkElements'; +import DashboardHome from "./components/dashboardHome"; let currentStatus: string | undefined = undefined; let refreshInterval: ReturnType<typeof window.setInterval> | null = null; const mapProps = (state: IApplicationStoreState) => ({ - currentProblemsProperties: createNetworkElementsProperties(state), + networkElementDashboardProperties: createNetworkElementsProperties(state), }); const mapDisp = (dispatcher: IDispatcher) => ({ - currentProblemsActions: createNetworkElementsActions(dispatcher.dispatch, true), + networkElementsDashboardActions: createNetworkElementsActions(dispatcher.dispatch, true), setCurrentPanel: (panelId: PanelId) => dispatcher.dispatch(new SetPanelAction(panelId)), }); @@ -53,13 +54,13 @@ const ConnectApplicationRouteAdapter = connect(mapProps, mapDisp)((props: RouteC window.setTimeout(() => { if (currentStatus) { props.setCurrentPanel("NetworkElements"); - props.currentProblemsActions.onFilterChanged("status", currentStatus); - if (!props.currentProblemsProperties.showFilter) { - props.currentProblemsActions.onToggleFilter(false); - props.currentProblemsActions.onRefresh(); + props.networkElementsDashboardActions.onFilterChanged("status", currentStatus); + if (!props.networkElementDashboardProperties.showFilter) { + props.networkElementsDashboardActions.onToggleFilter(false); + props.networkElementsDashboardActions.onRefresh(); } else - props.currentProblemsActions.onRefresh(); + props.networkElementsDashboardActions.onRefresh(); } }); } @@ -83,6 +84,7 @@ export function register() { icon: faPlug, rootComponent: App, rootActionHandler: connectAppRootHandler, + dashbaordElement: DashboardHome, menuEntry: "Connect" }); diff --git a/sdnr/wt/odlux/apps/connectApp/src/views/connectView.tsx b/sdnr/wt/odlux/apps/connectApp/src/views/connectView.tsx index 34b1b94b6..e99b6af8e 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/views/connectView.tsx +++ b/sdnr/wt/odlux/apps/connectApp/src/views/connectView.tsx @@ -28,7 +28,7 @@ import { ConnectionStatusLog } from '../components/connectionStatusLog'; import { setPanelAction, findWebUrisForGuiCutThroughAsyncAction, SetWeburiSearchBusy } from '../actions/commonNetworkElementsActions'; import { PanelId } from '../models/panelId'; import { NetworkElementConnection } from 'models/networkElementConnection'; -import { AppBar, Tabs, Tab } from '@material-ui/core'; +import { AppBar, Tabs, Tab } from '@mui/material'; const mapProps = (state: IApplicationStoreState) => ({ panelId: state.connect.currentOpenPanel, @@ -96,7 +96,7 @@ class ConnectApplicationComponent extends React.Component<ConnectApplicationComp }; - private onHandleTabChange = (event: React.ChangeEvent<{}>, newValue: PanelId) => { + private onHandleTabChange = (event: React.SyntheticEvent, newValue: PanelId) => { this.props.switchActivePanel(newValue); } @@ -105,8 +105,8 @@ class ConnectApplicationComponent extends React.Component<ConnectApplicationComp return ( <> - <AppBar position="static"> - <Tabs value={activePanelId} onChange={this.onHandleTabChange} aria-label="connect-app-tabs"> + <AppBar enableColorOnDark position="static"> + <Tabs indicatorColor="secondary" textColor="inherit" value={activePanelId} onChange={this.onHandleTabChange} aria-label="connect-app-tabs"> <Tab aria-label="network-elements-list-tab" label="Network Elements" value="NetworkElements" /> <Tab aria-label="connection-status-log-tab" label="Connection Status Log" value="ConnectionStatusLog" /> </Tabs> diff --git a/sdnr/wt/odlux/apps/connectApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml b/sdnr/wt/odlux/apps/connectApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml index 685ea76ba..295e8f894 100644 --- a/sdnr/wt/odlux/apps/connectApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml +++ b/sdnr/wt/odlux/apps/connectApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml @@ -25,6 +25,6 @@ <bean id="bundle" init-method="initialize" destroy-method="clean" class="org.onap.ccsdk.features.sdnr.wt.odlux.bundles.MyOdluxBundle"> <property name="loader" ref="loadersvc"/> <property name="bundleName" value="connectApp"/> - <property name="index" value="0"/> + <property name="index" value="1"/> </bean> </blueprint>
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/connectApp/webpack.config.js b/sdnr/wt/odlux/apps/connectApp/webpack.config.js index 70ddd4932..b283e426c 100644 --- a/sdnr/wt/odlux/apps/connectApp/webpack.config.js +++ b/sdnr/wt/odlux/apps/connectApp/webpack.config.js @@ -87,7 +87,7 @@ module.exports = (env) => { manifest: require(path.resolve(frameworkPath, "app-manifest.json")), sourceType: "umd2" }), - ...(env === "release") ? [ + ...(env === "release" ? [ new webpack.DefinePlugin({ "process.env": { NODE_ENV: "'production'", @@ -105,7 +105,7 @@ module.exports = (env) => { from: 'index.html', to: distPath }]), - ] + ]) ], devServer: { diff --git a/sdnr/wt/odlux/apps/demoApp/package.json b/sdnr/wt/odlux/apps/demoApp/package.json index d52383719..951332a28 100644 --- a/sdnr/wt/odlux/apps/demoApp/package.json +++ b/sdnr/wt/odlux/apps/demoApp/package.json @@ -21,20 +21,23 @@ "author": "Matthias Fischer", "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": "*" }, "peerDependencies": { - "@types/react": "17.0.3", - "@types/react-dom": "17.0.2", - "@types/react-router-dom": "5.1.7", - "@material-ui/core": "4.11.4", - "@material-ui/icons": "4.11.2", "@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.1", - "react-dom": "17.0.1", + "react": "17.0.2", + "react-dom": "17.0.2", "react-router-dom": "5.2.0" } -}
\ No newline at end of file +} diff --git a/sdnr/wt/odlux/apps/demoApp/src/components/counter.tsx b/sdnr/wt/odlux/apps/demoApp/src/components/counter.tsx index b47fa4507..6b960cdae 100644 --- a/sdnr/wt/odlux/apps/demoApp/src/components/counter.tsx +++ b/sdnr/wt/odlux/apps/demoApp/src/components/counter.tsx @@ -28,7 +28,7 @@ export class Counter extends React.Component<{}, { counter: number }> { render() { return ( - <button onClick={ () => this.setState({ counter: this.state.counter + 1 }) }>{ this.state.counter }</button> + <button onClick={ () => this.setState({ counter: this.state.counter + 1 }) } color="inherit">{ this.state.counter }</button> ) } }
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/demoApp/src/views/authorsList.tsx b/sdnr/wt/odlux/apps/demoApp/src/views/authorsList.tsx index 3d0651b49..b56058d36 100644 --- a/sdnr/wt/odlux/apps/demoApp/src/views/authorsList.tsx +++ b/sdnr/wt/odlux/apps/demoApp/src/views/authorsList.tsx @@ -18,12 +18,12 @@ import * as React from 'react'; import { withRouter, RouteComponentProps } from 'react-router-dom'; -import Table from '@material-ui/core/Table'; -import TableBody from '@material-ui/core/TableBody'; -import TableCell from '@material-ui/core/TableCell'; -import TableHead from '@material-ui/core/TableHead'; -import TableRow from '@material-ui/core/TableRow'; -import Paper from '@material-ui/core/Paper'; // means border +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'; // means border import connect from '../../../../framework/src/flux/connect'; @@ -42,7 +42,7 @@ class AuthorsListComponent extends React.Component<RouteComponentProps & IAuthor const { authors, busy } = this.props; return ( <Paper> - <Table > + <Table padding="normal" > <TableHead> <TableRow> <TableCell align="right">Id</TableCell> diff --git a/sdnr/wt/odlux/apps/demoApp/webpack.config.js b/sdnr/wt/odlux/apps/demoApp/webpack.config.js index 61dd8f6f6..0476c301e 100644 --- a/sdnr/wt/odlux/apps/demoApp/webpack.config.js +++ b/sdnr/wt/odlux/apps/demoApp/webpack.config.js @@ -84,7 +84,7 @@ module.exports = (env) => { manifest: require(path.resolve(frameworkPath, "app-manifest.json")), sourceType: "umd2" }), - ...(env === "release") ? [ + ...(env === "release" ? [ new webpack.DefinePlugin({ "process.env": { NODE_ENV: "'production'", @@ -102,7 +102,7 @@ module.exports = (env) => { from: 'index.html', to: distPath }]), - ] + ]) ], devServer: { diff --git a/sdnr/wt/odlux/apps/eventLogApp/package.json b/sdnr/wt/odlux/apps/eventLogApp/package.json index 52c49b328..fb6cedf56 100644 --- a/sdnr/wt/odlux/apps/eventLogApp/package.json +++ b/sdnr/wt/odlux/apps/eventLogApp/package.json @@ -21,20 +21,23 @@ "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": "*" }, "peerDependencies": { - "@types/react": "17.0.3", - "@types/react-dom": "17.0.2", - "@types/react-router-dom": "5.1.7", - "@material-ui/core": "4.11.4", - "@material-ui/icons": "4.11.2", "@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.1", - "react-dom": "17.0.1", + "react": "17.0.2", + "react-dom": "17.0.2", "react-router-dom": "5.2.0" } -}
\ No newline at end of file +} diff --git a/sdnr/wt/odlux/apps/eventLogApp/src/components/refreshEventLogDialog.tsx b/sdnr/wt/odlux/apps/eventLogApp/src/components/refreshEventLogDialog.tsx index 7d86e9f04..8b5d95173 100644 --- a/sdnr/wt/odlux/apps/eventLogApp/src/components/refreshEventLogDialog.tsx +++ b/sdnr/wt/odlux/apps/eventLogApp/src/components/refreshEventLogDialog.tsx @@ -17,12 +17,12 @@ */ import * as React from 'react'; -import Button from '@material-ui/core/Button'; -import Dialog from '@material-ui/core/Dialog'; -import DialogActions from '@material-ui/core/DialogActions'; -import DialogContent from '@material-ui/core/DialogContent'; -import DialogContentText from '@material-ui/core/DialogContentText'; -import DialogTitle from '@material-ui/core/DialogTitle'; +import 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 { eventLogReloadAction } from '../handlers/eventLogHandler'; import { IDispatcher, connect, Connect } from '../../../../framework/src/flux/connect'; @@ -94,13 +94,13 @@ class RefreshEventLogDialogComponent extends React.Component<RefreshEventLogDial <DialogActions> <Button aria-label="dialog-confirm-button" onClick={(event) => { this.onRefresh(); - }} > {setting.applyButtonText} </Button> + }} color="inherit" > {setting.applyButtonText} </Button> <Button aria-label="dialog-cancel-button" onClick={(event) => { this.onCancel(); }} color="secondary"> {setting.cancelButtonText} </Button> </DialogActions> </Dialog> - ) + ); } private onRefresh = () => { diff --git a/sdnr/wt/odlux/apps/eventLogApp/src/views/eventLog.tsx b/sdnr/wt/odlux/apps/eventLogApp/src/views/eventLog.tsx index 0308828c9..1fc53f284 100644 --- a/sdnr/wt/odlux/apps/eventLogApp/src/views/eventLog.tsx +++ b/sdnr/wt/odlux/apps/eventLogApp/src/views/eventLog.tsx @@ -19,7 +19,7 @@ import * as React from "react"; import { Connect, connect, IDispatcher } from '../../../../framework/src/flux/connect'; import { MaterialTable, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; -import Refresh from '@material-ui/icons/Refresh'; +import Refresh from '@mui/icons-material/Refresh'; import { EventLogType } from '../models/eventLogType'; import { IApplicationStoreState } from "../../../../framework/src/store/applicationStore"; diff --git a/sdnr/wt/odlux/apps/eventLogApp/webpack.config.js b/sdnr/wt/odlux/apps/eventLogApp/webpack.config.js index a67a34074..de309c1ba 100644 --- a/sdnr/wt/odlux/apps/eventLogApp/webpack.config.js +++ b/sdnr/wt/odlux/apps/eventLogApp/webpack.config.js @@ -86,7 +86,7 @@ module.exports = (env) => { manifest: require(path.resolve(frameworkPath, "app-manifest.json")), sourceType: "umd2" }), - ...(env === "release") ? [ + ...(env === "release" ? [ new webpack.DefinePlugin({ "process.env": { NODE_ENV: "'production'", @@ -104,7 +104,7 @@ module.exports = (env) => { from: 'index.html', to: distPath }]), - ] + ]) ], devServer: { diff --git a/sdnr/wt/odlux/apps/faultApp/package.json b/sdnr/wt/odlux/apps/faultApp/package.json index cb03e49d9..a5958d8c4 100644 --- a/sdnr/wt/odlux/apps/faultApp/package.json +++ b/sdnr/wt/odlux/apps/faultApp/package.json @@ -21,20 +21,23 @@ "author": "Matthias Fischer", "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": "*" }, "peerDependencies": { - "@types/react": "17.0.3", - "@types/react-dom": "17.0.2", - "@types/react-router-dom": "5.1.7", - "@material-ui/core": "4.11.4", - "@material-ui/icons": "4.11.2", "@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.1", - "react-dom": "17.0.1", + "react": "17.0.2", + "react-dom": "17.0.2", "react-router-dom": "5.2.0" } -}
\ No newline at end of file +} diff --git a/sdnr/wt/odlux/apps/faultApp/src/components/clearStuckAlarmsDialog.tsx b/sdnr/wt/odlux/apps/faultApp/src/components/clearStuckAlarmsDialog.tsx index 5155d2690..463c2079c 100644 --- a/sdnr/wt/odlux/apps/faultApp/src/components/clearStuckAlarmsDialog.tsx +++ b/sdnr/wt/odlux/apps/faultApp/src/components/clearStuckAlarmsDialog.tsx @@ -17,7 +17,7 @@ */ import * as React from 'react' -import { DialogContent, DialogActions, Button, Dialog, DialogTitle, DialogContentText } from '@material-ui/core'; +import { DialogContent, DialogActions, Button, Dialog, DialogTitle, DialogContentText } from '@mui/material'; import { currentProblemsReloadAction } from '../handlers/currentProblemsHandler'; import { clearStuckAlarmAsyncAction } from '../actions/clearStuckAlarmsAction'; import connect, { IDispatcher, Connect } from '../../../../framework/src/flux/connect'; @@ -117,13 +117,13 @@ class ClearStuckAlarmsDialogComponent extends React.Component<clearStuckAlarmsPr { this.state.clearAlarmsSuccessful && <> - <Button onClick={this.onRefresh}>Yes</Button> - <Button onClick={this.onClose}>No</Button> + <Button color="inherit" onClick={this.onRefresh}>Yes</Button> + <Button color="inherit" onClick={this.onClose}>No</Button> </> } { - !this.state.clearAlarmsSuccessful && <Button onClick={this.onOk}>Ok</Button> + !this.state.clearAlarmsSuccessful && <Button color="inherit" onClick={this.onOk}>Ok</Button> } </DialogActions> </Dialog> diff --git a/sdnr/wt/odlux/apps/faultApp/src/components/faultStatus.tsx b/sdnr/wt/odlux/apps/faultApp/src/components/faultStatus.tsx index b711b0375..7820dfdeb 100644 --- a/sdnr/wt/odlux/apps/faultApp/src/components/faultStatus.tsx +++ b/sdnr/wt/odlux/apps/faultApp/src/components/faultStatus.tsx @@ -17,13 +17,16 @@ */ import * as React from 'react'; -import { withStyles, WithStyles, createStyles, Theme } from '@material-ui/core/styles'; +import { Theme } from '@mui/material/styles'; +import { WithStyles } from '@mui/styles'; +import withStyles from '@mui/styles/withStyles'; +import createStyles from '@mui/styles/createStyles'; import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons'; // select app icon import connect, { Connect } from '../../../../framework/src/flux/connect'; import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; -import Typography from '@material-ui/core/Typography'; +import Typography from '@mui/material/Typography'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; const styles = (theme: Theme) => createStyles({ diff --git a/sdnr/wt/odlux/apps/faultApp/src/components/refreshAlarmLogDialog.tsx b/sdnr/wt/odlux/apps/faultApp/src/components/refreshAlarmLogDialog.tsx index 1d1b34cf2..8c639eec9 100644 --- a/sdnr/wt/odlux/apps/faultApp/src/components/refreshAlarmLogDialog.tsx +++ b/sdnr/wt/odlux/apps/faultApp/src/components/refreshAlarmLogDialog.tsx @@ -17,12 +17,12 @@ */ import * as React from 'react'; -import Button from '@material-ui/core/Button'; -import Dialog from '@material-ui/core/Dialog'; -import DialogActions from '@material-ui/core/DialogActions'; -import DialogContent from '@material-ui/core/DialogContent'; -import DialogContentText from '@material-ui/core/DialogContentText'; -import DialogTitle from '@material-ui/core/DialogTitle'; +import 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 { alarmLogEntriesReloadAction } from '../handlers/alarmLogEntriesHandler'; import { IDispatcher, connect, Connect } from '../../../../framework/src/flux/connect'; @@ -94,13 +94,13 @@ class RefreshAlarmLogDialogComponent extends React.Component<RefreshAlarmLogDial <DialogActions> <Button aria-label="dialog-confirm-button" onClick={(event) => { this.onRefresh(); - }} > {setting.applyButtonText} </Button> + }} color="inherit" > {setting.applyButtonText} </Button> <Button aria-label="dialog-cancel-button" onClick={(event) => { this.onCancel(); }} color="secondary"> {setting.cancelButtonText} </Button> </DialogActions> </Dialog> - ) + ); } private onRefresh = () => { diff --git a/sdnr/wt/odlux/apps/faultApp/src/components/refreshCurrentProblemsDialog.tsx b/sdnr/wt/odlux/apps/faultApp/src/components/refreshCurrentProblemsDialog.tsx index c49722077..e501ec0ad 100644 --- a/sdnr/wt/odlux/apps/faultApp/src/components/refreshCurrentProblemsDialog.tsx +++ b/sdnr/wt/odlux/apps/faultApp/src/components/refreshCurrentProblemsDialog.tsx @@ -17,12 +17,12 @@ */ import * as React from 'react'; -import Button from '@material-ui/core/Button'; -import Dialog from '@material-ui/core/Dialog'; -import DialogActions from '@material-ui/core/DialogActions'; -import DialogContent from '@material-ui/core/DialogContent'; -import DialogContentText from '@material-ui/core/DialogContentText'; -import DialogTitle from '@material-ui/core/DialogTitle'; +import 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 { currentProblemsReloadAction } from '../handlers/currentProblemsHandler'; import { IDispatcher, connect, Connect } from '../../../../framework/src/flux/connect'; @@ -94,13 +94,13 @@ class RefreshCurrentProblemsDialogComponent extends React.Component<RefreshCurre <DialogActions> <Button aria-label="dialog-confirm-button" onClick={(event) => { this.onRefresh(); - }} > {setting.applyButtonText} </Button> + }} color="inherit" > {setting.applyButtonText} </Button> <Button aria-label="dialog-cancel-button" onClick={(event) => { this.onCancel(); }} color="secondary"> {setting.cancelButtonText} </Button> </DialogActions> </Dialog> - ) + ); } private onRefresh = () => { diff --git a/sdnr/wt/odlux/apps/faultApp/src/views/faultApplication.tsx b/sdnr/wt/odlux/apps/faultApp/src/views/faultApplication.tsx index 0fc7b390e..456e05e84 100644 --- a/sdnr/wt/odlux/apps/faultApp/src/views/faultApplication.tsx +++ b/sdnr/wt/odlux/apps/faultApp/src/views/faultApplication.tsx @@ -34,9 +34,9 @@ import { PanelId } from '../models/panelId'; import { createCurrentProblemsProperties, createCurrentProblemsActions, currentProblemsReloadAction } from '../handlers/currentProblemsHandler'; import { createAlarmLogEntriesProperties, createAlarmLogEntriesActions, alarmLogEntriesReloadAction } from '../handlers/alarmLogEntriesHandler'; import { setPanelAction } from '../actions/panelChangeActions'; -import { Tooltip, IconButton, AppBar, Tabs, Tab } from '@material-ui/core'; -import Sync from '@material-ui/icons/Sync'; -import Refresh from '@material-ui/icons/Refresh'; +import { Tooltip, IconButton, AppBar, Tabs, Tab } from '@mui/material'; +import Sync from '@mui/icons-material/Sync'; +import Refresh from '@mui/icons-material/Refresh'; import ClearStuckAlarmsDialog, { ClearStuckAlarmsDialogMode } from '../components/clearStuckAlarmsDialog'; import RefreshAlarmLogDialog, { RefreshAlarmLogDialogMode } from '../components/refreshAlarmLogDialog'; @@ -99,7 +99,7 @@ class FaultApplicationComponent extends React.Component<FaultApplicationComponen this.setState({ clearAlarmDialogMode: ClearStuckAlarmsDialogMode.Show, stuckAlarms: stuckAlarms }) } - private onHandleTabChange = (event: React.ChangeEvent<{}>, newValue: PanelId) => { + private onHandleTabChange = (event: React.SyntheticEvent, newValue: PanelId) => { this.onToggleTabs(newValue); } @@ -162,8 +162,8 @@ class FaultApplicationComponent extends React.Component<FaultApplicationComponen return ( <> - <AppBar position="static" > - <Tabs value={activePanelId} onChange={this.onHandleTabChange} aria-label="fault-tabs"> + <AppBar enableColorOnDark position="static" > + <Tabs indicatorColor="secondary" textColor="inherit" value={activePanelId} onChange={this.onHandleTabChange} aria-label="fault-tabs"> <Tab aria-label="current-problem-list-tab" label="Current Problem List" value="CurrentProblem" /> <Tab aria-label="alarm-notifications-list-tab" label={`Alarm Notifications (${this.props.faultNotifications.faults.length})`} value="AlarmNotifications" /> <Tab aria-label="alarm-log-tab" label="Alarm Log" value="AlarmLog" /> diff --git a/sdnr/wt/odlux/apps/faultApp/webpack.config.js b/sdnr/wt/odlux/apps/faultApp/webpack.config.js index da092d0dc..d34d31c91 100644 --- a/sdnr/wt/odlux/apps/faultApp/webpack.config.js +++ b/sdnr/wt/odlux/apps/faultApp/webpack.config.js @@ -84,7 +84,7 @@ module.exports = (env) => { manifest: require(path.resolve(frameworkPath, "app-manifest.json")), sourceType: "umd2" }), - ...(env === "release") ? [ + ...(env === "release" ? [ new webpack.DefinePlugin({ "process.env": { NODE_ENV: "'production'", @@ -102,7 +102,7 @@ module.exports = (env) => { from: 'index.html', to: distPath }]), - ] + ]) ], devServer: { diff --git a/sdnr/wt/odlux/apps/helpApp/package.json b/sdnr/wt/odlux/apps/helpApp/package.json index 51e383b11..5bcfdce7b 100644 --- a/sdnr/wt/odlux/apps/helpApp/package.json +++ b/sdnr/wt/odlux/apps/helpApp/package.json @@ -21,25 +21,28 @@ "author": "Matthias Fischer", "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": "*", - "marked": "0.6.0", + "@types/highlight.js": "9.12.3", "@types/marked": "0.6.0", + "github-markdown-css": "2.10.0", "highlight.js": "9.13.1", - "@types/highlight.js": "9.12.3", - "github-markdown-css": "2.10.0" + "marked": "0.6.0" }, "peerDependencies": { - "@types/react": "17.0.3", - "@types/react-dom": "17.0.2", - "@types/react-router-dom": "5.1.7", - "@material-ui/core": "4.11.4", - "@material-ui/icons": "4.11.2", "@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.1", - "react-dom": "17.0.1", + "react": "17.0.2", + "react-dom": "17.0.2", "react-router-dom": "5.2.0" } -}
\ No newline at end of file +} diff --git a/sdnr/wt/odlux/apps/helpApp/src/components/helpStatus.tsx b/sdnr/wt/odlux/apps/helpApp/src/components/helpStatus.tsx index 140935715..fd4cd3fa4 100644 --- a/sdnr/wt/odlux/apps/helpApp/src/components/helpStatus.tsx +++ b/sdnr/wt/odlux/apps/helpApp/src/components/helpStatus.tsx @@ -17,13 +17,16 @@ */ import * as React from 'react'; -import { withStyles, WithStyles, createStyles, Theme } from '@material-ui/core/styles'; +import { Theme } from '@mui/material/styles'; +import { WithStyles } from '@mui/styles'; +import withStyles from '@mui/styles/withStyles'; +import createStyles from '@mui/styles/createStyles'; import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons'; // select app icon import connect, { Connect } from '../../../../framework/src/flux/connect'; import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; -import Typography from '@material-ui/core/Typography'; +import Typography from '@mui/material/Typography'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faQuestionCircle } from '@fortawesome/free-solid-svg-icons'; import { withRouter, RouteComponentProps } from 'react-router'; diff --git a/sdnr/wt/odlux/apps/helpApp/src/components/tocEntry.tsx b/sdnr/wt/odlux/apps/helpApp/src/components/tocEntry.tsx index fc7b8dff5..295b3caf9 100644 --- a/sdnr/wt/odlux/apps/helpApp/src/components/tocEntry.tsx +++ b/sdnr/wt/odlux/apps/helpApp/src/components/tocEntry.tsx @@ -18,7 +18,10 @@ import * as React from "react" import { TocTreeNode } from "../models/tocNode" -import { Typography, Link, makeStyles, Theme, createStyles } from "@material-ui/core" +import { Typography, Link, Theme } from "@mui/material"; + +import makeStyles from '@mui/styles/makeStyles'; +import createStyles from '@mui/styles/createStyles'; const useStyles = makeStyles((theme: Theme) => createStyles({ @@ -57,7 +60,7 @@ const TocEntry: React.FunctionComponent<tocEntryProps> = (props) => { return (<div> { areNodesEmpty ? <Typography variant="h6"> - <Link onClick={(event: any) => navigate(event, props.overviewUri)} className={classes.link}> {props.label}</Link> + <Link underline="hover" onClick={(event: any) => navigate(event, props.overviewUri)} className={classes.link}> {props.label}</Link> </Typography> : <> <Typography variant="h6"> @@ -65,11 +68,11 @@ const TocEntry: React.FunctionComponent<tocEntryProps> = (props) => { </Typography> <div className={classes.container}> <Typography variant="body1"> - <Link onClick={(event: any) => navigate(event, props.overviewUri)} className={classes.sublink}>Overview</Link> + <Link underline="hover" onClick={(event: any) => navigate(event, props.overviewUri)} className={classes.sublink}>Overview</Link> </Typography> {props.nodes !== undefined && props.nodes.map((item, index) => <Typography variant="body1" key={index + 'x' + item.id}> - <Link onClick={(event: any) => navigate(event, item.uri)} className={classes.sublink}>{item.label}</Link> + <Link underline="hover" onClick={(event: any) => navigate(event, item.uri)} className={classes.sublink}>{item.label}</Link> </Typography> )} </div> diff --git a/sdnr/wt/odlux/apps/helpApp/src/views/helpTocApp.tsx b/sdnr/wt/odlux/apps/helpApp/src/views/helpTocApp.tsx index 65d4609e2..2d8b0364d 100644 --- a/sdnr/wt/odlux/apps/helpApp/src/views/helpTocApp.tsx +++ b/sdnr/wt/odlux/apps/helpApp/src/views/helpTocApp.tsx @@ -23,7 +23,7 @@ import * as React from 'react' import { FunctionComponent } from "react"; import { IApplicationStoreState } from "../../../../framework/src/store/applicationStore"; import TocEntry from "../components/tocEntry"; -import { Typography } from "@material-ui/core"; +import { Typography } from "@mui/material"; const mapProps = (state: IApplicationStoreState) => ({ helpToc: state.help.toc, diff --git a/sdnr/wt/odlux/apps/helpApp/webpack.config.js b/sdnr/wt/odlux/apps/helpApp/webpack.config.js index 14ab528a7..963a99ef3 100644 --- a/sdnr/wt/odlux/apps/helpApp/webpack.config.js +++ b/sdnr/wt/odlux/apps/helpApp/webpack.config.js @@ -103,7 +103,7 @@ module.exports = (env) => { manifest: require(path.resolve(frameworkPath, "app-manifest.json")), sourceType: "umd2" }), - ...(env === "release") ? [ + ...(env === "release" ? [ new webpack.DefinePlugin({ "process.env": { NODE_ENV: "'production'", @@ -121,7 +121,7 @@ module.exports = (env) => { from: 'index.html', to: distPath }]), - ] + ]) ], devServer: { public: "http://localhost:3100", diff --git a/sdnr/wt/odlux/apps/inventoryApp/package.json b/sdnr/wt/odlux/apps/inventoryApp/package.json index e78f3ac82..5e37c52bb 100644 --- a/sdnr/wt/odlux/apps/inventoryApp/package.json +++ b/sdnr/wt/odlux/apps/inventoryApp/package.json @@ -21,20 +21,23 @@ "author": "Matthias Fischer", "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": "*" }, "peerDependencies": { - "@types/react": "17.0.3", - "@types/react-dom": "17.0.2", - "@types/react-router-dom": "5.1.7", - "@material-ui/core": "4.11.4", - "@material-ui/icons": "4.11.2", "@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.1", - "react-dom": "17.0.1", + "react": "17.0.2", + "react-dom": "17.0.2", "react-router-dom": "5.2.0" } -}
\ No newline at end of file +} diff --git a/sdnr/wt/odlux/apps/inventoryApp/src/components/refreshInventoryDialog.tsx b/sdnr/wt/odlux/apps/inventoryApp/src/components/refreshInventoryDialog.tsx index d2efb4e97..04658a319 100644 --- a/sdnr/wt/odlux/apps/inventoryApp/src/components/refreshInventoryDialog.tsx +++ b/sdnr/wt/odlux/apps/inventoryApp/src/components/refreshInventoryDialog.tsx @@ -17,12 +17,12 @@ */ import * as React from 'react'; -import Button from '@material-ui/core/Button'; -import Dialog from '@material-ui/core/Dialog'; -import DialogActions from '@material-ui/core/DialogActions'; -import DialogContent from '@material-ui/core/DialogContent'; -import DialogContentText from '@material-ui/core/DialogContentText'; -import DialogTitle from '@material-ui/core/DialogTitle'; +import 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 { inventoryElementsReloadAction } from '../handlers/inventoryElementsHandler'; import { IDispatcher, connect, Connect } from '../../../../framework/src/flux/connect'; @@ -94,13 +94,13 @@ class RefreshInventoryDialogComponent extends React.Component<RefreshInventoryDi <DialogActions> <Button aria-label="dialog-confirm-button" onClick={(event) => { this.onRefresh(); - }} > {setting.applyButtonText} </Button> + }} color="inherit" > {setting.applyButtonText} </Button> <Button aria-label="dialog-cancel-button" onClick={(event) => { this.onCancel(); }} color="secondary"> {setting.cancelButtonText} </Button> </DialogActions> </Dialog> - ) + ); } private onRefresh = () => { diff --git a/sdnr/wt/odlux/apps/inventoryApp/src/views/dashboard.tsx b/sdnr/wt/odlux/apps/inventoryApp/src/views/dashboard.tsx index 0a1bea0f1..284f70239 100644 --- a/sdnr/wt/odlux/apps/inventoryApp/src/views/dashboard.tsx +++ b/sdnr/wt/odlux/apps/inventoryApp/src/views/dashboard.tsx @@ -22,8 +22,8 @@ import { RouteComponentProps, withRouter } from 'react-router-dom'; import connect, { IDispatcher, Connect } from "../../../../framework/src/flux/connect"; import { IApplicationStoreState } from "../../../../framework/src/store/applicationStore"; import { MaterialTable, MaterialTableCtorType, ColumnType } from "../../../../framework/src/components/material-table"; -import { AppBar, Tabs, Tab, MenuItem, Typography } from "@material-ui/core"; -import Refresh from '@material-ui/icons/Refresh'; +import { AppBar, Tabs, Tab, MenuItem, Typography } from "@mui/material"; +import Refresh from '@mui/icons-material/Refresh'; import { PanelId } from "../models/panelId"; import { setPanelAction } from "../actions/panelActions"; @@ -77,7 +77,7 @@ class DashboardSelectorComponent extends React.Component<DashboardComponentProps }; } - private onHandleTabChange = (event: React.ChangeEvent<{}>, newValue: PanelId) => { + private onHandleTabChange = (event: React.SyntheticEvent, newValue: PanelId) => { this.onTogglePanel(newValue); } @@ -133,8 +133,8 @@ class DashboardSelectorComponent extends React.Component<DashboardComponentProps const { panelId: activePanelId } = this.props; return ( <> - <AppBar position="static"> - <Tabs value={activePanelId} onChange={this.onHandleTabChange} aria-label="inventory-app-tabs"> + <AppBar enableColorOnDark position="static"> + <Tabs indicatorColor="secondary" textColor="inherit" value={activePanelId} onChange={this.onHandleTabChange} aria-label="inventory-app-tabs"> <Tab label="Table View" value="InventoryElementsTable" aria-label="table-tab" /> <Tab label="Tree view" value="TreeviewTable" aria-label="treeview-tab" /> </Tabs> diff --git a/sdnr/wt/odlux/apps/inventoryApp/src/views/detail.tsx b/sdnr/wt/odlux/apps/inventoryApp/src/views/detail.tsx index f03b30cdd..252663935 100644 --- a/sdnr/wt/odlux/apps/inventoryApp/src/views/detail.tsx +++ b/sdnr/wt/odlux/apps/inventoryApp/src/views/detail.tsx @@ -18,8 +18,12 @@ import * as React from "react"; import { withRouter, RouteComponentProps } from 'react-router-dom'; -import Button from '@material-ui/core/Button'; -import { WithStyles, withStyles, createStyles, Theme } from '@material-ui/core/styles'; // infra for styling +import Button from '@mui/material/Button'; +import { Theme } from '@mui/material/styles'; // infra for styling + +import { WithStyles } from '@mui/styles'; +import withStyles from '@mui/styles/withStyles'; +import createStyles from '@mui/styles/createStyles'; const styles = (theme: Theme) => createStyles({ warnButton: { @@ -34,7 +38,7 @@ export const Detail = withStyles( styles )( withRouter( (props: DetailProps) => <h1>Detail {props.match.params.id}</h1> <p>This are the information about {props.staticContext}.</p> <Button color={"secondary"} variant={"contained"}>Start</Button> - <Button className={ props.classes.warnButton } variant={"contained"}>Stop</Button> + <Button color="inherit" className={ props.classes.warnButton } variant={"contained"}>Stop</Button> </div> ))); diff --git a/sdnr/wt/odlux/apps/inventoryApp/src/views/treeview.tsx b/sdnr/wt/odlux/apps/inventoryApp/src/views/treeview.tsx index cfcfd3fec..b0e962daa 100644 --- a/sdnr/wt/odlux/apps/inventoryApp/src/views/treeview.tsx +++ b/sdnr/wt/odlux/apps/inventoryApp/src/views/treeview.tsx @@ -16,7 +16,11 @@ * ============LICENSE_END========================================================================== */ import * as React from "react"; -import { withStyles, WithStyles, createStyles, Theme } from '@material-ui/core/styles'; +import { Theme } from '@mui/material/styles'; + +import { WithStyles } from '@mui/styles'; +import withStyles from '@mui/styles/withStyles'; +import createStyles from '@mui/styles/createStyles'; import { renderObject } from '../../../../framework/src/components/objectDump'; import { Connect, connect, IDispatcher } from '../../../../framework/src/flux/connect'; @@ -24,8 +28,8 @@ import { TreeView, TreeViewCtorType, SearchMode } from '../../../../framework/sr import { IApplicationStoreState } from "../../../../framework/src/store/applicationStore"; -import Breadcrumbs from '@material-ui/core/Breadcrumbs'; -import Link from '@material-ui/core/Link'; +import Breadcrumbs from '@mui/material/Breadcrumbs'; +import Link from '@mui/material/Link'; import { updateInventoryTreeAsyncAction, selectInventoryNodeAsyncAction, UpdateSelectedNodeAction, UpdateExpandedNodesAction, setSearchTermAction } from "../actions/inventoryTreeActions"; import { TreeDemoItem } from "../models/inventory"; @@ -41,11 +45,11 @@ const styles = (theme: Theme) => createStyles({ tree: { flex: "1 0 0%", minWidth: "250px", - padding: `0px ${theme.spacing(1)}px` + padding: `0px ${theme.spacing(1)}` }, details: { flex: "5 0 0%", - padding: `0px ${theme.spacing(1)}px` + padding: `0px ${theme.spacing(1)}` } }); @@ -108,12 +112,12 @@ class DashboardComponent extends React.Component<TreeviewComponentProps, Treevie <div style={scrollbar} > <div > <Breadcrumbs aria-label="breadcrumbs"> - <Link color="inherit" href="#" aria-label="back-breadcrumb" + <Link underline="hover" color="inherit" href="#" aria-label="back-breadcrumb" onClick={(event: React.MouseEvent<HTMLElement>) => { event.preventDefault(); this.props.history.push(filteredDashboardPath); }}>Back</Link> - <Link color="inherit" href="#" + <Link underline="hover" color="inherit" href="#" aria-label={this.props.match.params.mountId + '-breadcrumb'} onClick={(event: React.MouseEvent<HTMLElement>) => { event.preventDefault(); diff --git a/sdnr/wt/odlux/apps/inventoryApp/webpack.config.js b/sdnr/wt/odlux/apps/inventoryApp/webpack.config.js index 3668cf03a..403cc53f5 100644 --- a/sdnr/wt/odlux/apps/inventoryApp/webpack.config.js +++ b/sdnr/wt/odlux/apps/inventoryApp/webpack.config.js @@ -86,7 +86,7 @@ module.exports = (env) => { manifest: require(path.resolve(frameworkPath, "app-manifest.json")), sourceType: "umd2" }), - ...(env === "release") ? [ + ...(env === "release" ? [ new webpack.DefinePlugin({ "process.env": { NODE_ENV: "'production'", @@ -104,7 +104,7 @@ module.exports = (env) => { from: 'index.html', to: distPath }]), - ] + ]) ], devServer: { diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/.babelrc b/sdnr/wt/odlux/apps/lineOfSightApp/.babelrc deleted file mode 100644 index 3d8cd1260..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/.babelrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "presets": [ - ["@babel/preset-react"], - ["@babel/preset-env", { - "targets": { - "chrome": "66" - }, - "spec": true, - "loose": false, - "modules": false, - "debug": false, - "useBuiltIns": "usage", - "forceAllTransforms": true - }] - ], - "plugins": [] -} diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/package.json b/sdnr/wt/odlux/apps/lineOfSightApp/package.json deleted file mode 100644 index dbba7ecfb..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "@odlux/line-of-sight-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": { - "@odlux/framework": "*", - "@types/d3": "^6.7.0", - "@types/mapbox-gl": "^1.10.2", - "@types/node": "^12.0.0", - "d3": "^7.0.0", - "d3-polygon": "^3.0.1", - "mapbox-gl": "^1.11.0", - "object.values": "^1.1.1" - }, - "peerDependencies": { - "@material-ui/core": "4.11.4", - "@material-ui/icons": "4.11.2", - "@types/classnames": "2.2.6", - "@types/flux": "3.1.8", - "@types/jquery": "3.3.10", - "@types/react": "17.0.3", - "@types/react-dom": "17.0.2", - "@types/react-router-dom": "5.1.7", - "jquery": "3.3.1", - "react": "17.0.1", - "react-dom": "17.0.1", - "react-router-dom": "5.2.0" - } -} diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/pom.xml b/sdnr/wt/odlux/apps/lineOfSightApp/pom.xml deleted file mode 100644 index 717bb9bf3..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/pom.xml +++ /dev/null @@ -1,159 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ~ ============LICENSE_START======================================================= - ~ ONAP : ccsdk features - ~ ================================================================================ - ~ 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> - - <parent> - <groupId>org.onap.ccsdk.parent</groupId> - <artifactId>binding-parent</artifactId> - <version>2.3.2</version> - <relativePath/> - </parent> - - <groupId>org.onap.ccsdk.features.sdnr.wt</groupId> - <artifactId>sdnr-wt-odlux-app-lineOfSightApp</artifactId> - <version>1.3.0-SNAPSHOT</version> - <packaging>bundle</packaging> - - <name>ccsdk-features :: ${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> - - <dependencies> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>sdnr-wt-odlux-core-model</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>sdnr-wt-odlux-core-provider</artifactId> - <version>${project.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <sourceDirectory>src2/main/java</sourceDirectory> - <resources> - <resource> - <directory>dist</directory> - <targetPath>odlux</targetPath> - </resource> - <resource> - <directory>src2/main/resources</directory> - </resource> - <resource> - <directory>src2/test/resources</directory> - </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>org.codehaus.mojo</groupId> - <artifactId>build-helper-maven-plugin</artifactId> - <executions> - <execution> - <id>add-test-source</id> - <phase>generate-test-sources</phase> - <goals> - <goal>add-test-source</goal> - </goals> - <configuration> - <sources> - <source>src2/test/java</source> - </sources> - </configuration> - </execution> - </executions> - </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>v12.13.0</nodeVersion> - <yarnVersion>v1.22.10</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> diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src/actions/commonActions.ts b/sdnr/wt/odlux/apps/lineOfSightApp/src/actions/commonActions.ts deleted file mode 100644 index 3cc8ea4a7..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src/actions/commonActions.ts +++ /dev/null @@ -1,80 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - - import { Height } from "model/Height"; -import { isNumber } from "../utils/math"; -import { Action } from "../../../../framework/src/flux/action"; - import { Dispatch } from "../../../../framework/src/flux/store"; - import { IApplicationStoreState } from "../../../../framework/src/store/applicationStore"; - - import { LatLon } from "../model/LatLon"; - - - 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[1], longitude: midpoint[0]}; - 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)); - } - - //taken from https://www.movable-type.co.uk/scripts/latlong.html -const calculateMidPoint = (lat1: number, lon1: number, lat2: number, lon2: number) =>{ - - 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); - - return [radians_to_degrees(lon3), radians_to_degrees(lat3)]; -} - -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); -}
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src/actions/mapActions.ts b/sdnr/wt/odlux/apps/lineOfSightApp/src/actions/mapActions.ts deleted file mode 100644 index 37ef5ee25..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src/actions/mapActions.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { LatLon } from "../model/LatLon"; -import { Action } from "../../../../framework/src/flux/action"; -import { Height } from "model/Height"; - -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{ - constructor(){ - super(); - } -} - -export class SetMapCenterAction extends Action{ - /** - * - */ - constructor(public point: LatLon, public zoom: number) { - super(); - - } -}
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src/components/ConnectionErrorPoup.tsx b/sdnr/wt/odlux/apps/lineOfSightApp/src/components/ConnectionErrorPoup.tsx deleted file mode 100644 index 7d9339fc0..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src/components/ConnectionErrorPoup.tsx +++ /dev/null @@ -1,40 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { faExclamationTriangle } from "@fortawesome/free-solid-svg-icons" -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" -import { Paper, Typography } from "@material-ui/core" -import * as React from "react" - -type props = { reachable: boolean|null}; - - -const ConnectionErrorPoup: React.FunctionComponent<props> = (props) => { - - return (props.reachable === false ? - <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 ConnectionErrorPoup;
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src/components/heightChart.tsx b/sdnr/wt/odlux/apps/lineOfSightApp/src/components/heightChart.tsx deleted file mode 100644 index 3030fe7dd..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src/components/heightChart.tsx +++ /dev/null @@ -1,126 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import * as React from 'react'; - -import type { FC } from 'react'; -import * as d3 from 'd3'; - -import { useD3 } from "../hooks/d3"; -import { GPSProfileResult } from "../model/GPSProfileResult"; -import { max } from '../utils/math'; - -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 }; diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src/components/map.tsx b/sdnr/wt/odlux/apps/lineOfSightApp/src/components/map.tsx deleted file mode 100644 index 6f29d5993..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src/components/map.tsx +++ /dev/null @@ -1,329 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import * as React from 'react' -import * as mapboxgl from 'mapbox-gl'; -import { render } from 'react-dom'; -import { RouteComponentProps, withRouter } from 'react-router-dom'; -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; -import connect, { Connect, IDispatcher } from '../../../../framework/src/flux/connect'; -import { OSM_STYLE, URL_BASEPATH } from '../config'; -import { GPSProfileResult } from '../model/GPSProfileResult'; -import MapContextMenu from './mapContextMenu'; -import { getGPSProfile } from '../services/heightService'; -import { max, min } from '../utils/math'; -import { HeightChart } from './heightChart'; -import { makeStyles } from '@material-ui/core'; -import { ClearSavedChartAction, SetChartAction, SetEndpointAction, SetHeightA, SetHeightB, SetMapCenterAction, SetStartPointAction } from '../actions/mapActions'; -import { LatLon } from '../model/LatLon'; -import MapInfo from './mapInfo'; -import { Height } from 'model/Height'; -import { PictureAsPdf } from '@material-ui/icons'; -import ConnectionErrorPoup from './ConnectionErrorPoup'; -import { addBaseLayer, addBaseSource, addPoint } from '../utils/map'; -import { SetReachableAction } from '../actions/commonActions'; - -import 'mapbox-gl/dist/mapbox-gl.css'; - -type mapProps = RouteComponentProps & Connect<typeof mapStateToProps, typeof mapDispatchToProps>; - -const mapStateToProps = (state: IApplicationStoreState) => ({ - center: state.lineOfSight.map.center, - zoom: state.lineOfSight.map.zoom, - start: state.lineOfSight.map.start, - end: state.lineOfSight.map.end, - heightA: state.lineOfSight.map.heightA, - heightB: state.lineOfSight.map.heightB, - ready: state.lineOfSight.map.ready -}); - -const mapDispatchToProps = (dispatcher: IDispatcher) => ({ - ClearChartAction: () => dispatcher.dispatch(new ClearSavedChartAction), - SetMapPosition: (point: LatLon, zoom: number) => dispatcher.dispatch(new SetMapCenterAction(point, zoom)), - SetHeightStart: (height: Height) => dispatcher.dispatch(new SetHeightA(height)), - SetHeightEnd: (height: Height) => dispatcher.dispatch(new SetHeightB(height)), - setStartPosition: (position: LatLon|null) => dispatcher.dispatch(new SetStartPointAction(position)), - setEndPosition: (position: LatLon|null) => dispatcher.dispatch(new SetEndpointAction(position)), - setReachable : (reachable: boolean |null) => dispatcher.dispatch(new SetReachableAction(reachable)), - - - -}) - - -let map: mapboxgl.Map; - -const styles = makeStyles({ - chart: { - position: "absolute", - top: 0, - bottom: 0, - left: 0, - right: 0 - - } - }); - - -const Map: React.FC<mapProps> = (props) => { - - //const [start, setStart] = React.useState<mapboxgl.LngLat| undefined>(); - //const [end, setEnd] = React.useState<mapboxgl.LngLat| undefined>(); - const [data, setData] = React.useState<GPSProfileResult[] | number>(Number.NaN); - const [dataMin, setDataMin] = React.useState<GPSProfileResult|undefined>(); - const [dataMax, setDataMax] = React.useState<GPSProfileResult|undefined>(); - const [isMapLoaded, setMapLoaded] = React.useState<boolean>(false); - - -const mapRef = React.useRef<{ map: mapboxgl.Map | null }>({ map: null }); -const mapContainerRef = React.useRef<HTMLDivElement>(null); - - - -const classes = styles(); - -const heightA = props.heightA !== null ? props.heightA.amsl + props.heightA.antennaHeight : 0; -const heightB = props.heightB !== null ? props.heightB.amsl + props.heightB.antennaHeight : 0; - -const {start, end} = props; - -const handleResize = () =>{ - - if (map) { - // wait a moment until resizing actually happened - window.setTimeout(() => map.resize(), 500); - } - -} - -//on mount -React.useEffect(()=>{ - - window.addEventListener("menu-resized", handleResize); - - - return () =>{ - console.log("unmount") - window.removeEventListener("menu-resized", handleResize); - - const center = mapRef.current.map?.getCenter(); - const mapZoom = mapRef.current.map?.getZoom(); - if(center){ - props.SetMapPosition({latitude: center.lat, longitude:center.lng}, mapZoom!); - } - - props.setReachable(null); - } - -},[]); - - - React.useEffect(()=>{ - - if(props.ready){ - setupMap(); - } - - },[props.ready]); - - React.useEffect(() => { - if (props.ready && isMapLoaded) { - drawChart(); - updateLosUrl(); - } - - }, [start, end, isMapLoaded]); - - const drawChart = () =>{ - if(start && end){ - - addBaseSource(map, 'route'); - addBaseLayer(map, 'route'); - - const json = `{ - "type": "Feature", - "properties": {}, - "geometry": { - "type": "LineString", - "coordinates": [ - [${start.longitude}, ${start.latitude}], - [${end.longitude}, ${end.latitude}] - ]} - }`; - - - - (map.getSource("route") as mapboxgl.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 noticable lag of line being cleared) - 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(props.heightA && props.heightB){ - heightPart = `&amslA=${props.heightA.amsl}&antennaHeightA=${props.heightA.antennaHeight}&amslB=${props.heightB.amsl}&antennaHeightB=${props.heightB.antennaHeight}`; - - } - - props.history.replace(`/${URL_BASEPATH}/los?${locationPart}${heightPart}`) - - }else if(!start && !end){ - props.history.replace(`/${URL_BASEPATH}`); - } - } - - - const updateHeightA = (value:number, value2: number) =>{ - props.SetHeightStart({amsl: value, antennaHeight: value2}); - } - - const updateHeightB = (value:number, value2: number) =>{ - props.SetHeightEnd({amsl: value, antennaHeight: value2}); - } - - const OnEndPosition = (position: mapboxgl.LngLat) =>{ - props.setEndPosition({latitude: position.lat, longitude: position.lng}) - } - - const OnStartPosition = (position: mapboxgl.LngLat) =>{ - props.setStartPosition({latitude: position.lat, longitude: position.lng}) - } - - - const setupMap = () => { - - let lat = props.center.latitude - let lon = props.center.longitude; - let zoom = props.zoom; - - map = new mapboxgl.Map({ - container: mapContainerRef.current!, - style: OSM_STYLE as any, - center: [lon, lat], - zoom: zoom, - accessToken: '' - }); - - mapRef.current.map = map; - - map.on('load', (ev) => { - - map.setMaxZoom(18); - setMapLoaded(true); - - //add source, layer - - addBaseSource(map, 'route'); - addBaseLayer(map, 'route'); - - }); - - let currentPopup: mapboxgl.Popup | null = null; - map.on('contextmenu', (e) => { - - if (currentPopup) - currentPopup.remove(); - - //change height if start/end changes - //??? -> show value? / reset after chart display? - - 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 mapboxgl.Popup() - .setLngLat(e.lngLat) - .setDOMContent(popupNode) - .addTo(map); - }); - - map.on('moveend', mapMoveEnd); - - }; - - 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)); - - props.SetMapPosition({latitude: lat, longitude: lon}, mapZoom); - - } - - - - return <> - <div id="map" style={{ width: "100%", height:'100%', position: 'relative' }} ref={mapContainerRef} > - <MapInfo minHeight={dataMin} maxHeight={dataMax} /> - <ConnectionErrorPoup reachable={props.ready} /> - - {typeof data === "object" - ? ( - < div className={classes.chart} onClick={() => { - setData(Number.NaN); - setDataMax(undefined); - setDataMin(undefined); - props.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(connect(mapStateToProps, mapDispatchToProps)(Map)); - - diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src/components/mapContextMenu.tsx b/sdnr/wt/odlux/apps/lineOfSightApp/src/components/mapContextMenu.tsx deleted file mode 100644 index 0fc51cabf..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src/components/mapContextMenu.tsx +++ /dev/null @@ -1,86 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Button, InputAdornment, makeStyles, TextField, Tooltip } from "@material-ui/core"; -import * as React from "react"; -import { FC, useEffect, useState } from "react"; -import { getGPSHeight } from "../services/heightService"; - -type MapContextMenuProps = { - pos: mapboxgl.LngLat; - onStart: (pos: mapboxgl.LngLat) => void; - onEnd: (pos: mapboxgl.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 className={classes.button} variant="contained" onClick={() => { onStart(pos); props.onHeightA(height!,+value1); }}>Start</Button> - <Tooltip title="Please add the antenna height in meters above sea level."> - <TextField className={classes.textField} value={value1} onChange={(e)=>handleChangeHeight(e,"heightA")} InputProps={{endAdornment: <InputAdornment position="start">m</InputAdornment>}}/> - </Tooltip> - </div> - <div className={classes.flexContainer}> - <Button className={classes.button} variant="contained" onClick={() => { onEnd(pos); props.onHeightB(height!,+value2);}}>End</Button> - <Tooltip title="Please add the antenna height in meters above sea level."> - <TextField 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 diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src/components/mapInfo.tsx b/sdnr/wt/odlux/apps/lineOfSightApp/src/components/mapInfo.tsx deleted file mode 100644 index 43a6e478a..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src/components/mapInfo.tsx +++ /dev/null @@ -1,171 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Accordion, AccordionDetails, AccordionSummary, makeStyles, Paper, Typography } from '@material-ui/core'; -import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; -import { GPSProfileResult } from '../model/GPSProfileResult'; -import * as React from 'react'; -import { calculateDistanceInMeter } from '../utils/map'; -import connect, { Connect, IDispatcher } from '../../../../framework/src/flux/connect'; -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; - -const mapStateToProps = (state: IApplicationStoreState) => ({ - center: state.lineOfSight.map.center, - zoom: state.lineOfSight.map.zoom, - start: state.lineOfSight.map.start, - end: state.lineOfSight.map.end, - heightA: state.lineOfSight.map.heightA, - heightB: state.lineOfSight.map.heightB, -}); - -const mapDispatchToProps = (dispatcher: IDispatcher) => ({ - - -}) - -type props = Connect<typeof mapStateToProps, typeof mapDispatchToProps> & { - 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: { display: 'flex', 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: React.FC<props> = (props) =>{ - - const [expanded, setExpanded] = React.useState(false); - const [width, setWidth] = React.useState(470); - const [length, setLength] = React.useState<string | undefined>(); - - const classes = styles({width: width})(); - - const {start, end, center, zoom, heightA, heightB, minHeight, maxHeight} = props; - - React.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 >Map Info</Typography> - </AccordionSummary> - <AccordionDetails 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 connect(mapStateToProps, mapDispatchToProps)(MapInfo);
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src/config.ts b/sdnr/wt/odlux/apps/lineOfSightApp/src/config.ts deleted file mode 100644 index bc1e1ff99..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src/config.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export const URL_BASEPATH="lineOfSight"; - -export const TERRAIN_URL="/terrain"; //http://10.20.11.163:5200 /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 diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src/handlers/mapHandler.ts b/sdnr/wt/odlux/apps/lineOfSightApp/src/handlers/mapHandler.ts deleted file mode 100644 index 6d11977bf..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src/handlers/mapHandler.ts +++ /dev/null @@ -1,82 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - - import { LatLon } from "../model/LatLon"; -import { IActionHandler } from "../../../../framework/src/flux/action"; -import { SetPassedInValuesAction, SetReachableAction } from "../actions/commonActions"; -import { ClearSavedChartAction, SetChartAction, SetEndpointAction, SetHeightA, SetHeightB, SetMapCenterAction, SetStartPointAction } from "../actions/mapActions"; -import { Height } from "model/Height"; -import { isNullOrUndefined } from "util"; - - - - 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 diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src/handlers/rootHandler.ts b/sdnr/wt/odlux/apps/lineOfSightApp/src/handlers/rootHandler.ts deleted file mode 100644 index e7d58c41f..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src/handlers/rootHandler.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** -* ============LICENSE_START======================================================================== -* ONAP : ccsdk feature sdnr wt odlux -* ================================================================================================= -* Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. -* ================================================================================================= -* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except -* in compliance with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software distributed under the License -* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -* or implied. See the License for the specific language governing permissions and limitations under -* the License. -* ============LICENSE_END========================================================================== -*/ -// main state handler - -import { combineActionHandler } from '../../../../framework/src/flux/middleware'; - -// ** do not remove ** -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; -import { IActionHandler } from '../../../../framework/src/flux/action'; - - -import { IMap, mapHandler } from './mapHandler'; - -export interface ILineOfSightAppStateState { - map: IMap; -} - - - - -declare module '../../../../framework/src/store/applicationStore' { - interface IApplicationStoreState { - lineOfSight: ILineOfSightAppStateState; - } -} - -const actionHandlers = { - map: mapHandler, -}; - -export const lineofSightRootHandler = combineActionHandler<ILineOfSightAppStateState>(actionHandlers); -export default lineofSightRootHandler; - diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src/hooks/d3.ts b/sdnr/wt/odlux/apps/lineOfSightApp/src/hooks/d3.ts deleted file mode 100644 index dfebe8605..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src/hooks/d3.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -/* 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; -} diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src/index.html b/sdnr/wt/odlux/apps/lineOfSightApp/src/index.html deleted file mode 100644 index 6c1478e42..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src/index.html +++ /dev/null @@ -1,31 +0,0 @@ -<!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>LineOfSightApp</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", "lineOfSightApp", "linkCalculationApp"], function (app, connectApp, faultApp, networkMapApp, lineOfSightApp, linkCalculationApp) { - connectApp.register(); - faultApp.register(); - //configurationApp.register(); - //linkCalculationApp.register(); - networkMapApp.register(); - lineOfSightApp.register(); - app("./app.tsx").runApplication(); - }); - </script> -</body> - -</html>
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src/model/GPSProfileResult.ts b/sdnr/wt/odlux/apps/lineOfSightApp/src/model/GPSProfileResult.ts deleted file mode 100644 index 567946bc6..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src/model/GPSProfileResult.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type GPSProfileResult = { height: number, gps: { latitude: number, longitude: number }, band: string, zone: number, easting: number, northing: number };
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src/model/Height.tsx b/sdnr/wt/odlux/apps/lineOfSightApp/src/model/Height.tsx deleted file mode 100644 index 7014095cb..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src/model/Height.tsx +++ /dev/null @@ -1,22 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type Height = { - amsl: number; - antennaHeight: number; -}
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src/model/LatLon.ts b/sdnr/wt/odlux/apps/lineOfSightApp/src/model/LatLon.ts deleted file mode 100644 index a447aa52a..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src/model/LatLon.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type LatLon ={ - latitude: number, - longitude: number -}
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src/pluginLineOfSight.tsx b/sdnr/wt/odlux/apps/lineOfSightApp/src/pluginLineOfSight.tsx deleted file mode 100644 index b193cfb22..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src/pluginLineOfSight.tsx +++ /dev/null @@ -1,138 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -// app configuration and main entry point for the app - -import * as React from "react"; -import { faRoute } from '@fortawesome/free-solid-svg-icons'; // select app icon -import applicationManager from '../../../framework/src/services/applicationManager'; - - -import { lineofSightRootHandler } from './handlers/rootHandler'; -import MainView from "./views/main"; -import applicationApi from "../../../framework/src/services/applicationApi"; - -import { Redirect, Route, RouteComponentProps, Switch, useLocation, withRouter } from "react-router-dom"; -import connect, { Connect, IDispatcher } from "../../../framework/src/flux/connect"; -import { IApplicationStoreState } from "../../../framework/src/store/applicationStore"; -import { SetPassedInValues, SetReachableAction } from "./actions/commonActions"; -import { TERRAIN_URL, TILE_URL } from "./config"; -import { isNumber } from "./utils/math"; - -const mapProps = (state: IApplicationStoreState) => ({ -}); - -const mapDisp = (dispatcher: IDispatcher) => ({ - setPassedInValues: (values: (string | null)[]) => dispatcher.dispatch(SetPassedInValues(values)), - setReachable: (reachable: boolean) => dispatcher.dispatch(new SetReachableAction(reachable)) - -}); - -let lastSearch = ""; - -const useQuery = () => { - return new URLSearchParams(useLocation().search); -} - - -const LineOfSightApplicationRouteAdapter = connect(mapProps, mapDisp)((props: RouteComponentProps<{ mountId?: string }> & Connect<typeof mapProps, typeof mapDisp>) => { - - let query = useQuery(); - - // called when component finshed mounting - React.useEffect(() => { - extractAndDispatchUrlValues(props.location.search); - - //check tiles/terrain connectivity - tryCheckConnection(); - - }, []); - - - const extractAndDispatchUrlValues = (url: string) => { - - if (lastSearch !== url) { - lastSearch = url; - - //if mandatory values aren't there, do nothing - if (areMandatoryParamsPresent(query)) { - const values = extractValuesFromURL(query); - props.setPassedInValues(values); - } - } - } - - const tryCheckConnection =() =>{ - const terrain = fetch(`${TERRAIN_URL}/`); - const tiles = fetch(`${TILE_URL}/10/0/0.png`); - - Promise.all([terrain, tiles]) - .then((result) => { - props.setReachable(true); - - }) - .catch(error=>{ - console.error("services not reachable."); - console.error(error); - props.setReachable(false); - - }) - - } - - /*** - * - * Checks if lat1, lon1, lat2, lon2 were passed in as url parameters - */ - const areMandatoryParamsPresent = (query: URLSearchParams) => { - - return isNumber(query.get("lat1")) && isNumber(query.get("lon1")) && isNumber(query.get("lat2")) && isNumber(query.get("lon2")) - - } - - const extractValuesFromURL = (query: URLSearchParams) => { - - return [query.get("lat1"), query.get("lon1"), query.get("lat2"), query.get("lon2"), query.get("amslA"), query.get("antennaHeightA"), query.get("amslB"), query.get("antennaHeightB")] - } - - return ( - <MainView /> - ); -}); - - -const LoSRouterApp = withRouter(connect(mapProps, mapDisp)((props: RouteComponentProps & Connect<typeof mapProps, typeof mapDisp>) => { - - return ( - <Switch> - <Route path={`${props.match.path}`} component={LineOfSightApplicationRouteAdapter} /> - <Redirect to={`${props.match.path}`} /> - </Switch> - ) -})); - -export function register() { - applicationManager.registerApplication({ - name: "lineOfSight", // used as name of state as well - icon: faRoute, - rootActionHandler: lineofSightRootHandler, - rootComponent: LoSRouterApp, - menuEntry: "Line of Sight" - }); -} - diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src/services/heightService.ts b/sdnr/wt/odlux/apps/lineOfSightApp/src/services/heightService.ts deleted file mode 100644 index 8b0535881..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src/services/heightService.ts +++ /dev/null @@ -1,62 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { GPSProfileResult } from "../model/GPSProfileResult"; -import { TERRAIN_URL } from "../config"; -import { LatLon } from "../model/LatLon"; - -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; - } -} - diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src/styles/index.css b/sdnr/wt/odlux/apps/lineOfSightApp/src/styles/index.css deleted file mode 100644 index ec2585e8c..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src/styles/index.css +++ /dev/null @@ -1,13 +0,0 @@ -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; -} diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src/styles/mapbox-gl.css b/sdnr/wt/odlux/apps/lineOfSightApp/src/styles/mapbox-gl.css deleted file mode 100644 index 03c479af9..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src/styles/mapbox-gl.css +++ /dev/null @@ -1 +0,0 @@ -.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 diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src/utils/map.ts b/sdnr/wt/odlux/apps/lineOfSightApp/src/utils/map.ts deleted file mode 100644 index abdd27ed2..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src/utils/map.ts +++ /dev/null @@ -1,103 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import * as mapboxgl from "mapbox-gl"; -import { LatLon } from "../model/LatLon"; - - -export const addBaseSource = (map : mapboxgl.Map, name: string) =>{ - - if(!map.getSource(name)) - - map.addSource(name, { - type: 'geojson', - data: { type: "FeatureCollection", features: [] } - }); - -} - -export const addPoint = (map : mapboxgl.Map, point: LatLon) =>{ - const json = `{ - "type": "Feature", - "properties": {}, - "geometry": { - "type": "Point", - "coordinates": - [${point.longitude}, ${point.latitude}] - } - }`; - - - (map.getSource("route") as mapboxgl.GeoJSONSource).setData(JSON.parse(json)); -} - -export const addBaseLayer = (map: mapboxgl.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 - } - }); -} - -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; - - } - - function toRad(value: number) { - return (value * Math.PI) / 180; - } -
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src/utils/math.ts b/sdnr/wt/odlux/apps/lineOfSightApp/src/utils/math.ts deleted file mode 100644 index 9e0447b97..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src/utils/math.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -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 diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src/views/main.tsx b/sdnr/wt/odlux/apps/lineOfSightApp/src/views/main.tsx deleted file mode 100644 index bbe6f34e6..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src/views/main.tsx +++ /dev/null @@ -1,30 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import * as React from 'react'; -import Map from '../components/map'; - -function MainView() { - return ( - <div className="App" style={{height:"100%"}}> - <Map /> - </div> - ); -} - -export default MainView;
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java b/sdnr/wt/odlux/apps/lineOfSightApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java deleted file mode 100644 index 43b072c4b..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -package org.onap.ccsdk.features.sdnr.wt.odlux.bundles; - -import org.onap.ccsdk.features.sdnr.wt.odlux.model.bundles.OdluxBundle; -import org.onap.ccsdk.features.sdnr.wt.odlux.model.bundles.OdluxBundleLoader; - -public class MyOdluxBundle extends OdluxBundle { - - @Override - public void initialize() { - super.initialize(); - } - - @Override - public void clean() { - super.clean(); - } - - @Override - public String getResourceFileContent(String filename) { - return super.getResourceFileContent(filename); - } - - @Override - public boolean hasResource(String filename) { - return super.hasResource(filename); - } - - @Override - public void setBundleName(String bundleName) { - super.setBundleName(bundleName); - } - - @Override - public void setLoader(OdluxBundleLoader loader) { - super.setLoader(loader); - } - - @Override - public String getBundleName() { - return super.getBundleName(); - } - - @Override - public OdluxBundleLoader getLoader() { - return super.getLoader(); - } - - public MyOdluxBundle() { - super(); - } -} diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml b/sdnr/wt/odlux/apps/lineOfSightApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml deleted file mode 100644 index 982379dda..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml +++ /dev/null @@ -1,9 +0,0 @@ -<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"> - <reference id="loadersvc" availability="mandatory" activation="eager" interface="org.onap.ccsdk.features.sdnr.wt.odlux.model.bundles.OdluxBundleLoader"/> - - <bean id="bundle" init-method="initialize" destroy-method="clean" class="org.onap.ccsdk.features.sdnr.wt.odlux.bundles.MyOdluxBundle"> - <property name="loader" ref="loadersvc"/> - <property name="bundleName" value="lineOfSightApp"/> - <property name="index" value="130"/> - </bean> -</blueprint>
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java b/sdnr/wt/odlux/apps/lineOfSightApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java deleted file mode 100644 index c319bb189..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -package org.onap.ccsdk.features.sdnr.wt.odlux.bundles.test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import org.junit.Test; -import org.onap.ccsdk.features.sdnr.wt.odlux.OdluxBundleLoaderImpl; -import org.onap.ccsdk.features.sdnr.wt.odlux.bundles.MyOdluxBundle; - -public class TestBundleRes { - - @Test - public void test() { - OdluxBundleLoaderImpl loader = OdluxBundleLoaderImpl.getInstance(); - MyOdluxBundle b = new MyOdluxBundle(); - b.setLoader(loader); - b.setIndex(0); - b.setBundleName("abc"); - b.initialize(); - assertTrue(loader.getNumberOfBundles()==1); - assertNotNull(b.getLoader()); - assertEquals("abc",b.getBundleName()); - assertTrue(b.hasResource("test.js")); - assertNotNull(b.getResourceFileContent("test.js")); - b.clean(); - assertTrue(loader.getNumberOfBundles()==0); - } - -} diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/src2/test/resources/test.js b/sdnr/wt/odlux/apps/lineOfSightApp/src2/test/resources/test.js deleted file mode 100644 index b47fdc39f..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/src2/test/resources/test.js +++ /dev/null @@ -1,5 +0,0 @@ -asdac sad -as -d -sad - sadfa
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/tsconfig.json b/sdnr/wt/odlux/apps/lineOfSightApp/tsconfig.json deleted file mode 100644 index a66b5d828..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/tsconfig.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "./src", - "outDir": "./dist", - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "allowSyntheticDefaultImports": false, - "allowUnreachableCode": false, - "allowUnusedLabels": false, - "noFallthroughCasesInSwitch": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "strictNullChecks": true, - "pretty": true, - "newLine": "LF", - "module": "es2015", - "target": "es2016", - "moduleResolution": "node", - "experimentalDecorators": true, - "jsx": "preserve", - "lib": [ - "dom", - "es2015", - "es2016" - ], - "types": [ - "prop-types", - "react", - "react-dom" - ] - }, - "exclude": [ - "dist", - "node_modules" - ] -} diff --git a/sdnr/wt/odlux/apps/lineOfSightApp/webpack.config.js b/sdnr/wt/odlux/apps/lineOfSightApp/webpack.config.js deleted file mode 100644 index 54ba1b499..000000000 --- a/sdnr/wt/odlux/apps/lineOfSightApp/webpack.config.js +++ /dev/null @@ -1,211 +0,0 @@ -/** - * Webpack 4 configuration file - * see https://webpack.js.org/configuration/ - * see https://webpack.js.org/configuration/dev-server/ - */ - -"use strict"; - -const path = require("path"); -const webpack = require("webpack"); -const CopyWebpackPlugin = require("copy-webpack-plugin"); -const TerserPlugin = require('terser-webpack-plugin'); - -// const __dirname = (path => path.replace(/^([a-z]\:)/, c => c.toUpperCase()))(process.__dirname()); - -module.exports = (env) => { - const distPath = path.resolve(__dirname, env === "release" ? "." : "../..", "dist"); - const frameworkPath = path.resolve(__dirname, env === "release" ? "../../framework" : "../..", "dist"); - return [{ - name: "App", - - mode: "none", //disable default behavior - - target: "web", - - context: path.resolve(__dirname, "src"), - - entry: { - lineOfSightApp: ["./pluginLineOfSight.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: /\.(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: { - "/yang-schema/": { - target: "http://sdnr:8181", - secure: false - }, - "/userdata": { - target: "http://sdnr:8181", - secure: false - }, - "/userdata/": { - target: "http://sdnr:8181", - secure: false - }, - "/oauth2/": { - target: "http://sdnr:8181", - secure: false - }, - "/database/": { - target: "http://sdnr:8181", - secure: false - }, - "/restconf/": { - target: "http://sdnr:8181", - secure: false - }, - "/rests/": { - target: "http://sdnr:8181", - secure: false - }, - "/topology/": { - target: "http://localhost:3002", - secure: false - }, - "/sitedoc/": { - target: "http://10.20.35.184:3002", - secure: false, - pathRewrite(pathname) { - return pathname.replace(/^\/sitedoc/, '/topology/stadok') - } - }, - "/terrain/": { - target: "http://10.20.11.163:5200", - secure: false, - pathRewrite(pathname) { - return pathname.replace(/^\/terrain/, '/') - } - }, - "/tiles/": { - target: "http://tile.openstreetmap.org", - secure: false, - pathRewrite(pathname) { - return pathname.replace(/^\/tiles/, '') - } - }, - "/help/": { - target: "http://sdnr:8181", - secure: false - }, - "/websocket": { - target: "http://sdnr:8181", - ws: true, - changeOrigin: true, - secure: false - } - } - - } - }]; -} diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/.babelrc b/sdnr/wt/odlux/apps/linkCalculationApp/.babelrc deleted file mode 100644 index 3d8cd1260..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/.babelrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "presets": [ - ["@babel/preset-react"], - ["@babel/preset-env", { - "targets": { - "chrome": "66" - }, - "spec": true, - "loose": false, - "modules": false, - "debug": false, - "useBuiltIns": "usage", - "forceAllTransforms": true - }] - ], - "plugins": [] -} diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/package.json b/sdnr/wt/odlux/apps/linkCalculationApp/package.json deleted file mode 100644 index c03afe19b..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "@odlux/linkcalculation-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": { - "@odlux/framework": "*", - "formik": "^2.1.5", - "yup": "^0.29.3" - }, - "peerDependencies": { - "@types/react": "17.0.3", - "@types/react-dom": "17.0.2", - "@types/react-router-dom": "5.1.7", - "@material-ui/core": "4.11.4", - "@material-ui/icons": "4.11.2", - "@types/classnames": "2.2.6", - "@types/flux": "3.1.8", - "@types/jquery": "3.3.10", - "jquery": "3.3.1", - "react": "17.0.1", - "react-dom": "17.0.1", - "react-router-dom": "5.2.0" - }, - "devDependencies": { - "@types/yup": "^0.29.7", - "node-sass": "^4.14.1", - "sass": "^1.26.11", - "sass-loader": "^10.0.2", - "webpack": "^4.44.2" - } -} diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/pom.xml b/sdnr/wt/odlux/apps/linkCalculationApp/pom.xml deleted file mode 100644 index 606eb24df..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/pom.xml +++ /dev/null @@ -1,159 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ~ ============LICENSE_START======================================================= - ~ ONAP : ccsdk features - ~ ================================================================================ - ~ 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> - - <parent> - <groupId>org.onap.ccsdk.parent</groupId> - <artifactId>binding-parent</artifactId> - <version>2.3.2</version> - <relativePath/> - </parent> - - <groupId>org.onap.ccsdk.features.sdnr.wt</groupId> - <artifactId>sdnr-wt-odlux-app-linkCalculationApp</artifactId> - <version>1.3.0-SNAPSHOT</version> - <packaging>bundle</packaging> - - <name>ccsdk-features :: ${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> - - <dependencies> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>sdnr-wt-odlux-core-model</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>sdnr-wt-odlux-core-provider</artifactId> - <version>${project.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <sourceDirectory>src2/main/java</sourceDirectory> - <resources> - <resource> - <directory>dist</directory> - <targetPath>odlux</targetPath> - </resource> - <resource> - <directory>src2/main/resources</directory> - </resource> - <resource> - <directory>src2/test/resources</directory> - </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>org.codehaus.mojo</groupId> - <artifactId>build-helper-maven-plugin</artifactId> - <executions> - <execution> - <id>add-test-source</id> - <phase>generate-test-sources</phase> - <goals> - <goal>add-test-source</goal> - </goals> - <configuration> - <sources> - <source>src2/test/java</source> - </sources> - </configuration> - </execution> - </executions> - </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>v12.13.0</nodeVersion> - <yarnVersion>v1.22.10</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> diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/src/actions/commonLinkCalculationActions.ts b/sdnr/wt/odlux/apps/linkCalculationApp/src/actions/commonLinkCalculationActions.ts deleted file mode 100644 index d499ec209..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/src/actions/commonLinkCalculationActions.ts +++ /dev/null @@ -1,160 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Action } from "../../../../framework/src/flux/action"; -import { Dispatch } from "../../../../framework/src/flux/store"; -import { IApplicationStoreState } from "../../../../framework/src/store/applicationStore"; - - -export class UpdateLinkIdAction extends Action { - constructor(public linkId: string) { - super(); - } -} - -export class UpdateFrequencyAction extends Action { - constructor(public frequency: number) { - super(); - } -} -export class UpdateSiteAction extends Action { - constructor( - public siteA?: any, - public siteB?: any - ) { - super(); - } -} -export class UpdateRainAttAction extends Action { - - constructor(public rainAtt: number) { - super(); - } -} -export class UpdateRainValAction extends Action { - constructor(public rainVal: number) { - super(); - } -} - -export class updateHideForm extends Action { - constructor(public formView: boolean) { - super(); - } -} -export class UpdateDistanceAction extends Action { - constructor(public distance: number) { - super(); - } -} - -export class UpdateFslCalculation extends Action { - constructor(public fsl: number) { - super(); - } -} - - -export class UpdateLatLonAction extends Action { - constructor( - public Lat1: number, - public Lon1: number, - public Lat2: number, - public Lon2: number - ) { - super(); - - } -} -export class UpdatePolAction extends Action { - constructor(public polarization: string) { - super(); - } -} -export class isCalculationServerReachableAction extends Action { - constructor(public reachable: boolean) { - super(); - } -} -export class updateAltitudeAction extends Action { - constructor( - public amslA: number, - public aglA: number, - public amslB: number, - public aglB: number - ) { - super(); - } -} -export class UpdateAbsorptionLossAction extends Action { - constructor( - public absorptionOxygen: number, - public absorptionWater: number, - - ) { - super(); - } -} -export class UpdateWorstMonthRainAction extends Action { - constructor(public month: string) { - super(); - } -} - - -export class UpdateAntennaGainAction extends Action { - constructor(public antennaGainA: number, public antennaGainB: number) { - super(); - } -} -export class updateAntennaNameAction extends Action { - constructor(public antennaNameA: string, public antennaNameB: string) { - super(); - } -} -export class UpdateTxPowerAction extends Action { - constructor(public txPowerA: string | null, public txPowerB: string | null) { - super(); - } -} -export class UpdateRxSensitivityAction extends Action { - constructor(public rxSensitivityA: string | null, public rxSensitivityB: string | null) { - super(); - } -} -export class UpdateWaveguideLossAction extends Action { - constructor(public waveguideLossA: number, public waveguideLossB: number) { - super(); - } -} - -export class UpdateEIRPAction extends Action { - constructor(public eirpA: number, public eirpB: number) { - 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(); - } -} diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/src/components/connectionInfo.tsx b/sdnr/wt/odlux/apps/linkCalculationApp/src/components/connectionInfo.tsx deleted file mode 100644 index e6d82e236..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/src/components/connectionInfo.tsx +++ /dev/null @@ -1,56 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import * as React from 'react' - -import { IApplicationStoreState } from "../../../../framework/src/store/applicationStore"; -import connect, { IDispatcher, Connect } from "../../../../framework/src/flux/connect"; -import { Paper, Typography } from "@material-ui/core"; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons'; - - -type props = Connect<typeof mapStateToProps, typeof mapDispatchToProps>; - -const ConnectionInfo: React.FunctionComponent<props> = (props) => { - - return ( - (props.isCalculationServerReachable === false)? <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} /> Connection Error</Typography></div> - {props.isCalculationServerReachable === false && <Typography> Calculation data can't be loaded.</Typography>} - </div> - </Paper> : null - -)} - -const mapStateToProps = (state: IApplicationStoreState) => ({ - isCalculationServerReachable: state.linkCalculation.calculations.reachable -}); - - - -const mapDispatchToProps = (dispatcher: IDispatcher) => ({ - - //zoomToSearchResult: (lat: number, lon: number) => dispatcher.dispatch(new ZoomToSearchResultAction(lat, lon)) - -});; - - -export default connect(mapStateToProps,mapDispatchToProps)(ConnectionInfo) - diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/src/handlers/linkCalculationAppRootHandler.ts b/sdnr/wt/odlux/apps/linkCalculationApp/src/handlers/linkCalculationAppRootHandler.ts deleted file mode 100644 index 01512eb92..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/src/handlers/linkCalculationAppRootHandler.ts +++ /dev/null @@ -1,199 +0,0 @@ -/** -* ============LICENSE_START======================================================================== -* ONAP : ccsdk feature sdnr wt odlux -* ================================================================================================= -* Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. -* ================================================================================================= -* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except -* in compliance with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software distributed under the License -* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -* or implied. See the License for the specific language governing permissions and limitations under -* the License. -* ============LICENSE_END========================================================================== -*/ - -import { combineActionHandler } from '../../../../framework/src/flux/middleware'; - -// ** do not remove ** -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; -import { IActionHandler } from '../../../../framework/src/flux/action';; -import { UpdateLinkIdAction, UpdateFrequencyAction , UpdateLatLonAction, UpdateRainAttAction, UpdateRainValAction, updateHideForm, UpdateFslCalculation, UpdateSiteAction, UpdateDistanceAction, isCalculationServerReachableAction, UpdatePolAction, updateAltitudeAction, UpdateAbsorptionLossAction, UpdateWorstMonthRainAction, UpdateEIRPAction, UpdateAntennaGainAction, UpdateTxPowerAction, UpdateRxSensitivityAction, updateAntennaNameAction, UpdateWaveguideLossAction, UpdateRxPowerAction, UpdateSomAction} from '../actions/commonLinkCalculationActions'; - -declare module '../../../../framework/src/store/applicationStore' { - interface IApplicationStoreState { - linkCalculation: ICalculationsState; - } -} - -type ICalculationsState = { - calculations:ILinkCalculationAppStateState -} - -export type ILinkCalculationAppStateState= { - linkId: string | null, - frequency: number, - formView:boolean, - fsl:number, - distance:number, - Lat1: number, - Lon1: number, - Lat2: number, - Lon2: number, - rainVal : number, - rainAtt : number, - siteA: string, - siteB: string, - reachable: boolean, - polarization : string | null, - amslA: number, - amslB:number, - aglA: number, - aglB:number, - absorptionWater:number, - absorptionOxygen: number, - month: string, - eirpA: number, - eirpB: number, - antennaGainA: number, - antennaGainB :number, - antennaNameA: string, - antennaNameB:string, - systemOperatingMarginA : number, - systemOperatingMarginB : number, - txPowerA : string, - txPowerB: string, - rxSensitivityA : string, - rxSensitivityB: string, - waveguideLossA : number, - waveguideLossB: number, - rxPowerA :number, - rxPowerB: number -} - -const initialState: ILinkCalculationAppStateState ={ - linkId: null, - frequency: 0, - Lat1: 0, - Lon1: 0, - Lat2: 0, - Lon2: 0, - formView : false, - fsl:0, - distance:0, - siteA : '', - siteB: '', - rainVal : 0, - rainAtt: 0, - reachable : true, - polarization : 'Horizontal', - amslA: 0, - amslB:0, - aglA: 0, - aglB:0, - absorptionWater:0, - absorptionOxygen: 0, - month: '', - eirpA: 0, - eirpB: 0, - antennaGainA :0, - antennaGainB :0, - antennaNameA: '', - antennaNameB:'', - systemOperatingMarginA : 0, - systemOperatingMarginB : 0, - txPowerA : '0', - txPowerB: '0', - rxSensitivityA: '0', - rxSensitivityB: '0', - waveguideLossA : 0, - waveguideLossB: 0, - rxPowerA : 0, - rxPowerB: 0 -} - -export const LinkCalculationHandler: IActionHandler<ILinkCalculationAppStateState> = (state=initialState, action) => { - - if(action instanceof UpdateLinkIdAction){ - state = Object.assign({}, state, {linkId:action.linkId}) - } - else if(action instanceof updateHideForm){ - - state = Object.assign({}, state, {formView:action.formView}) - } - else if (action instanceof UpdateDistanceAction){ - state = Object.assign({}, state, {distance:action.distance}) - } - else if (action instanceof UpdateFrequencyAction){ - state = Object.assign({}, state, {frequency:action.frequency}) - } - else if (action instanceof UpdateFslCalculation){ - state = Object.assign({}, state, {fsl:action.fsl}) - } - else if (action instanceof UpdateLatLonAction){ - state = Object.assign({}, state, {Lat1:action.Lat1, Lon1:action.Lon1, Lat2:action.Lat2, Lon2:action.Lon2}) - } - else if (action instanceof UpdateRainAttAction){ - state = Object.assign({}, state, {rainAtt:action.rainAtt}) - } - else if (action instanceof UpdateRainValAction){ - state = Object.assign({}, state, {rainVal:action.rainVal}) - } - else if (action instanceof UpdateSiteAction){ - state = Object.assign({}, state, {siteA:action.siteA, siteB:action.siteB}) - } - else if(action instanceof isCalculationServerReachableAction){ - state = Object.assign({}, state, { reachable: action.reachable }); - } - else if (action instanceof UpdatePolAction){ - state = Object.assign({}, state, {polarization: action.polarization}) - } - else if (action instanceof updateAltitudeAction){ - state = Object.assign({}, state, {amslA:action.amslA, amslB:action.amslA, aglA:action.aglA, aglB:action.aglB}) - } - else if (action instanceof UpdateAbsorptionLossAction){ - state = Object.assign({}, state, {absorptionOxygen:action.absorptionOxygen, absorptionWater:action.absorptionWater}) - } - else if (action instanceof UpdateWorstMonthRainAction){ - state = Object.assign({}, state, {month:action.month}) - } - - else if (action instanceof UpdateAntennaGainAction){ - state = Object.assign({}, state, {antennaGainA:action.antennaGainA,antennaGainB:action.antennaGainB}) - } - else if (action instanceof updateAntennaNameAction){ - state = Object.assign({}, state, {antennaNameA:action.antennaNameA, antennaNameB: action.antennaNameB}) - } - else if (action instanceof UpdateTxPowerAction){ - state = Object.assign({}, state, {txPowerA:action.txPowerA == null ? state.txPowerA : action.txPowerA , txPowerB: action.txPowerB == null? state.txPowerB : action.txPowerB}) - } - else if (action instanceof UpdateRxSensitivityAction){ - state = Object.assign({}, state, {rxSensitivityA:action.rxSensitivityA == null ? state.rxSensitivityA : action.rxSensitivityA , rxSensitivityB: action.rxSensitivityB == null? state.rxSensitivityB : action.rxSensitivityB}) - } - else if (action instanceof UpdateWaveguideLossAction){ - state = Object.assign({}, state, {waveguideLossA:action.waveguideLossA, waveguideLossB: action.waveguideLossB}) - } - else if (action instanceof UpdateEIRPAction){ - state = Object.assign({}, state, {eirpA:action.eirpA, eirpB:action.eirpB}) - } - 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}) - } - - - return state -} - -const actionHandlers = { - calculations: LinkCalculationHandler -} - -export const LinkCalculationAppRootHandler = combineActionHandler<ICalculationsState>(actionHandlers); -export default LinkCalculationAppRootHandler; - diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/src/index.html b/sdnr/wt/odlux/apps/linkCalculationApp/src/index.html deleted file mode 100644 index edcbd2514..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/src/index.html +++ /dev/null @@ -1,28 +0,0 @@ -<!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>Link Calculation 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", "linkCalculationApp", "networkMapApp" , "lineOfSightApp"], function (app, connectApp, linkCalculationApp,networkMapApp, lineOfSightApp) { - connectApp.register(); - linkCalculationApp.register(); - networkMapApp.register(); - lineOfSightApp.register(); - app("./app.tsx").runApplication(); - }); - </script> -</body> - -</html>
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/src/pluginLinkCalculation.tsx b/sdnr/wt/odlux/apps/linkCalculationApp/src/pluginLinkCalculation.tsx deleted file mode 100644 index a15bf033d..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/src/pluginLinkCalculation.tsx +++ /dev/null @@ -1,192 +0,0 @@ -/** -* ============LICENSE_START======================================================================== -* ONAP : ccsdk feature sdnr wt odlux -* ================================================================================================= -* Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. -* ================================================================================================= -* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except -* in compliance with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software distributed under the License -* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -* or implied. See the License for the specific language governing permissions and limitations under -* the License. -* ============LICENSE_END========================================================================== -*/ - -// app configuration and main entry point for the app - -import * as React from "react"; -import { withRouter, RouteComponentProps, Route, Switch, Redirect } from 'react-router-dom'; - -import { faBookOpen } from '@fortawesome/free-solid-svg-icons'; // select app icon -import applicationManager from '../../../framework/src/services/applicationManager'; - -import LinkCalculation from './views/linkCalculationComponent'; -import LinkCalculationAppRootHandler from './handlers/linkCalculationAppRootHandler'; -import connect, { Connect, IDispatcher } from '../../../framework/src/flux/connect'; -import { IApplicationStoreState } from "../../../framework/src/store/applicationStore"; -import { UpdateLinkIdAction, UpdateLatLonAction, updateHideForm, UpdateSiteAction, UpdateDistanceAction, isCalculationServerReachableAction, updateAltitudeAction, updateAntennaNameAction, UpdateAntennaGainAction, UpdateWaveguideLossAction } from "./actions/commonLinkCalculationActions"; - - -let currentLinkId: string | null = null; -let lastUrl: string = "/linkCalculation"; - -const mapProps = (state: IApplicationStoreState) => ({ - reachable: state.linkCalculation.calculations.reachable -}); - -const mapDisp = (dispatcher: IDispatcher) => ({ - updateLinkId: (mountId: string) => dispatcher.dispatch(new UpdateLinkIdAction(mountId)), - - updateSiteName: (siteNameA?: any, siteNameB?: any) => { - dispatcher.dispatch(new UpdateSiteAction(siteNameA, siteNameB)) - }, - updateDistance: (distance: number) => { - dispatcher.dispatch(new UpdateDistanceAction(distance)) - }, - updateLatLon: (Lat1: number, Lon1: number, Lat2: number, Lon2: number) => { - - dispatcher.dispatch(new UpdateLatLonAction(Lat1, Lon1, Lat2, Lon2)) - dispatcher.dispatch(new updateHideForm(true)) - }, - updateAltitude: (amslA: number, aglA: number, amslB: number, aglB: number) => { - dispatcher.dispatch(new updateAltitudeAction(amslA, aglA, amslB, aglB)) - }, - updateAntennaName: (antennaNameA: string, antennaNameB: string) => { - dispatcher.dispatch(new updateAntennaNameAction(antennaNameA, antennaNameB)) - }, - updateAntennaGainAction: (antennaGainA: number, antennaGainB: number) => { - dispatcher.dispatch(new UpdateAntennaGainAction(antennaGainA, antennaGainB)) - }, - updateWaveguideLossAction: (waveguideLossA: number, waveguideLossB: number) => { - dispatcher.dispatch(new UpdateWaveguideLossAction(waveguideLossA, waveguideLossB)) - } -}); - - -const LinkCalculationRouteAdapter = connect(mapProps, mapDisp)((props: RouteComponentProps<{ mountId?: string }> & Connect<typeof mapProps, typeof mapDisp>) => { - let linkId: string = ""; - - // called when component finshed mounting - React.useEffect(() => { - - lastUrl = props.location.pathname; - linkId = getLinkId(lastUrl); - - const data = props.location.search - - - - if (data !== undefined && data.length > 0) { - - - const lat1 = data.split('&')[0].split('=')[1] - const lon1 = data.split('&')[1].split('=')[1] - const lat2 = data.split('&')[2].split('=')[1] - const lon2 = data.split('&')[3].split('=')[1] - - const siteNameA = data.split('&')[4].split('=')[1] - const siteNameB = data.split('&')[5].split('=')[1] - - const distance = data.split('&')[8].split('=')[1] - - const amslA = data.split('&')[9].split('=')[1] - const aglA = data.split('&')[10].split('=')[1] - - const amslB = data.split('&')[11].split('=')[1] - const aglB = data.split('&')[12].split('=')[1] - - const antennaNameA = data.split('&')[13].split('=')[1].replace("%20", " ") - const antennaGainA = data.split('&')[14].split('=')[1] - const waveguideLossA = data.split('&')[15].split('=')[1] - const antennaNameB = data.split('&')[16].split('=')[1].replace("%20", " ") - const antennaGainB = data.split('&')[17].split('=')[1] - const waveguideLossB = data.split('&')[18].split('=')[1] - - - if (siteNameA !== null && siteNameB !== null) { - props.updateSiteName(String(siteNameA), String(siteNameB)) - } - - if (Number(distance) !== null) { - props.updateDistance(Number(distance)) - } - if (Number(lat1) >= -90 && Number(lat2) >= -90 && Number(lat1) <= 90 && Number(lat2) <= 90 && Number(lon1) >= -180 && Number(lon2) >= -180 && Number(lon1) <= 180 && Number(lon2) <= 180) { - props.updateLatLon(Number(lat1), Number(lon1), Number(lat2), Number(lon2)) - } - if (Number(amslA)> 0 && Number(amslB)> 0) { - if (Number(aglA)>= Number(amslA) && Number(aglB)>= Number(amslB)) { - props.updateAltitude(Number(amslA), Number(aglA), Number(amslB), Number(aglB)) - } - } - if (antennaNameA && antennaNameB.length) { - props.updateAntennaName(String(antennaNameA), String(antennaNameB)) - } - if (Number(antennaGainA) > 0 && Number(antennaGainA) > 0) { - props.updateAntennaGainAction(Number(antennaGainA), Number(antennaGainB)) - } - if(Number(waveguideLossA) !== null, Number(waveguideLossB) !== null){ - props.updateWaveguideLossAction(Number(waveguideLossA),Number(waveguideLossB) ) - } - } - - - if (currentLinkId !== linkId) { // new element is loaded - currentLinkId = linkId; - props.updateLinkId(currentLinkId); - } - }, []); - - // called when component gets updated - React.useEffect(() => { - - lastUrl = props.location.pathname; - linkId = getLinkId(lastUrl); - - if (currentLinkId !== linkId) { - currentLinkId = linkId; - props.updateLinkId(currentLinkId); - } - }); - - const getLinkId = (lastUrl: string) => { - let index = lastUrl.lastIndexOf("linkCalculation/"); - if (index >= 0) { - linkId = lastUrl.substr(index + 16); - } else { - linkId = ""; - } - - return linkId; - } - - - return ( - <LinkCalculation /> - ); -}); - -const App = withRouter((props: RouteComponentProps) => { - props.history.action = "POP"; - return ( - <Switch> - <Route path={`${props.match.path}/:linkId`} component={LinkCalculationRouteAdapter} /> - <Route path={`${props.match.path}`} component={LinkCalculationRouteAdapter} /> - <Redirect to={`${props.match.path}`} /> - </Switch> - ) -}); - -export function register() { - applicationManager.registerApplication({ - name: "linkCalculation", - icon: faBookOpen, - rootActionHandler: LinkCalculationAppRootHandler, - rootComponent: App, - menuEntry: "Link Calculation" - }); -} - diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/src/views/Style.scss b/sdnr/wt/odlux/apps/linkCalculationApp/src/views/Style.scss deleted file mode 100644 index e4b0c7797..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/src/views/Style.scss +++ /dev/null @@ -1,116 +0,0 @@ -// .parent{ - -// display: flex; -// justify-content: space-evenly; -// margin: auto; - - -//} -.input { - width: 150px; - box-sizing: border-box; - // margin-bottom: 5px; - -} -.error { - border: 1px solid red; - width: 150px; - box-sizing: border-box; -} - -.container1{ - margin-bottom: 15px; - -} - -.container1 div{ - display:flex; - flex-direction: row; - - width:100%; - padding-top: 2px; -} - -.container1 div div{ - width:50%; - border-bottom-style: solid; - border-bottom-width: thin; - border-color: silver; -} - -.firstBox div:first-child{ - margin-left: 33.5%; -} - -// .container-1 { -// width: 80%; -// justify-content: center; -// align-items: baseline;; -// display: flex; -// flex-direction: row; -// align-content: space-between; -// padding: 20px 40px; -// border-radius: 10px; -// // box-shadow: 0px 10px 50px #555; -// background-color: #ffffff; -// // padding-top: 10px; - -// } - - // .column1 { - // flex-direction: column; - // width: 30%; - // align-items: flex-end;; - // // padding: 2em; - - // } - // .column1 div { - // margin-top: 10px; - // // align-items: space-between; - // // flex-wrap: wrap; - // border-bottom-style: solid; - // border-bottom-width: thin; - // border-color: silver; - // } - // .middlecolumn{ - - // flex-direction: column; - // flex-grow: 1; - // // padding: 10px 10px; - // } - - // .middlecolumn div{ - // margin-top: 10px; - // border-bottom-style: solid; - // border-bottom-width: thin; - // border-color: silver; - // } - - // .column2 { - // margin-left: 200px; - // } - // .column2 div{ - // margin-top: 10px; - - // } - - .antennaContainer{ - margin-bottom: 15px; - background-color: rgb(184, 181, 181); - - } - .antennaContainer div { - display:flex; - flex-direction: row; - - width:100%; - padding-top: 2px; -} -.antennaContainer div div{ - - width:50%; - -} -.antennaFont{ - font-family: "Lucida Console"; -}
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/src/views/linkCalculationComponent.tsx b/sdnr/wt/odlux/apps/linkCalculationApp/src/views/linkCalculationComponent.tsx deleted file mode 100644 index e3eaa6ba0..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/src/views/linkCalculationComponent.tsx +++ /dev/null @@ -1,579 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import * as React from "react"; - -import { Connect, connect, IDispatcher } from '../../../../framework/src/flux/connect'; -import { MaterialTable, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; -import { TextField, Tabs, Tab, Typography, AppBar, Button, Tooltip, Checkbox, Table, TableCell, TableHead, TableRow, TableBody, Paper } from '@material-ui/core'; -import './Style.scss' - -import { IApplicationStoreState } from "../../../../framework/src/store/applicationStore"; -import { UpdateFrequencyAction, UpdateLatLonAction, UpdateRainAttAction, UpdateRainValAction, UpdateFslCalculation, isCalculationServerReachableAction, UpdatePolAction, UpdateDistanceAction, updateAltitudeAction, UpdateAbsorptionLossAction, UpdateWorstMonthRainAction, UpdateTxPowerAction, UpdateRxSensitivityAction, UpdateEIRPAction, UpdateRxPowerAction, UpdateSomAction } from "../actions/commonLinkCalculationActions"; -import { faPlaneArrival, faAlignCenter } from "@fortawesome/free-solid-svg-icons"; -import ConnectionInfo from '../components/connectionInfo' -import { red } from "@material-ui/core/colors"; -import { Dvr } from "@material-ui/icons"; - - - -const mapProps = (state: IApplicationStoreState) => ({ - linkId: state.linkCalculation.calculations.linkId, - frequency: state.linkCalculation.calculations.frequency, - lat1: state.linkCalculation.calculations.Lat1, - lon1: state.linkCalculation.calculations.Lon1, - lat2: state.linkCalculation.calculations.Lat2, - lon2: state.linkCalculation.calculations.Lon2, - rainAtt: state.linkCalculation.calculations.rainAtt, - rainVal: state.linkCalculation.calculations.rainVal, - formView: state.linkCalculation.calculations.formView, - fsl: state.linkCalculation.calculations.fsl, - siteA: state.linkCalculation.calculations.siteA, - siteB: state.linkCalculation.calculations.siteB, - distance: state.linkCalculation.calculations.distance, - reachable: state.linkCalculation.calculations.reachable, - polarization: state.linkCalculation.calculations.polarization, - amslA: state.linkCalculation.calculations.amslA, - amslB: state.linkCalculation.calculations.amslB, - aglA: state.linkCalculation.calculations.aglA, - aglB: state.linkCalculation.calculations.aglB, - absorptionOxygen: state.linkCalculation.calculations.absorptionOxygen, - absorptionWater: state.linkCalculation.calculations.absorptionWater, - month: state.linkCalculation.calculations.month, - eirpA: state.linkCalculation.calculations.eirpA, - eirpB: state.linkCalculation.calculations.eirpB, - antennaGainA: state.linkCalculation.calculations.antennaGainA, - antennaGainB: state.linkCalculation.calculations.antennaGainB, - antennaNameA: state.linkCalculation.calculations.antennaNameA, - antennaNameB: state.linkCalculation.calculations.antennaNameB, - systemOperatingMarginA: state.linkCalculation.calculations.systemOperatingMarginA, - systemOperatingMarginB: state.linkCalculation.calculations.systemOperatingMarginB, - waveguideLossA: state.linkCalculation.calculations.waveguideLossA, - waveguideLossB: state.linkCalculation.calculations.waveguideLossB, - rxPowerA: state.linkCalculation.calculations.rxPowerA, - rxPowerB: state.linkCalculation.calculations.rxPowerB, - txPowerA: state.linkCalculation.calculations.txPowerA, - txPowerB: state.linkCalculation.calculations.txPowerB, - rxSensitivityA: state.linkCalculation.calculations.rxSensitivityA, - rxSensitivityB: state.linkCalculation.calculations.rxSensitivityB - -}); - -const BASE_URL = "/topology/linkcalculator" - -const mapDispatch = (dispatcher: IDispatcher) => ({ - - updateFrequency: (frequency: number) => { - - dispatcher.dispatch(new UpdateFrequencyAction(frequency)) - }, - updateLatLon: (Lat1: number, Lon1: number, Lat2: number, Lon2: number) => { - dispatcher.dispatch(new UpdateLatLonAction(Lat1, Lon1, Lat2, Lon2)) - }, - - updateRainValue: (rainVal: number) => { - dispatcher.dispatch(new UpdateRainValAction(rainVal)) - }, - - UpdateRainAtt: (rainAtt: number) => { - dispatcher.dispatch(new UpdateRainAttAction(rainAtt)) - }, - - specificRain: (rainAtt: number) => { - dispatcher.dispatch(new UpdateRainAttAction(rainAtt)) - - }, - - FSL: (free: number) => { - dispatcher.dispatch(new UpdateFslCalculation(free)) - }, - - UpdateConectivity: (reachable: boolean) => { - dispatcher.dispatch(new isCalculationServerReachableAction(reachable)) - }, - - updatePolarization: (polarization: any) => { - dispatcher.dispatch(new UpdatePolAction(polarization)) - }, - - updateAutoDistance: (distance: number) => { - dispatcher.dispatch(new UpdateDistanceAction(distance)) - }, - UpdateAbsorption: (OxLoss: number, WaterLoss: number) => { - dispatcher.dispatch(new UpdateAbsorptionLossAction(OxLoss, WaterLoss)) - }, - UpdateWorstMonthRain: (month: string) => { - dispatcher.dispatch(new UpdateWorstMonthRainAction(month)) - }, - UpdateEIRP: (eirpA: number, eirpB: number) => { - dispatcher.dispatch(new UpdateEIRPAction(eirpA, eirpB)) - }, - UpdateRxPower: (rxPowerA: number, rxPowerB: number) => { - dispatcher.dispatch(new UpdateRxPowerAction(rxPowerA, rxPowerB)) - }, - UpdateSom: (somA: number, somB: number) => { - dispatcher.dispatch(new UpdateSomAction(somA, somB)) - }, - - UpdateTxPower: (txPowerA: string | null, txPowerB: string | null) => { - dispatcher.dispatch(new UpdateTxPowerAction(txPowerA, txPowerB)) - }, - UpdateRxSensitivity: (rxSensitivityA: string | null, rxSensitivityB: string | null) => { - dispatcher.dispatch(new UpdateRxSensitivityAction(rxSensitivityA, rxSensitivityB)) - } -}); - - -type linkCalculationProps = Connect<typeof mapProps, typeof mapDispatch>; - -interface initialState { - rainMethodDisplay: boolean, - absorptionMethod: string; - horizontalBoxChecked: boolean, - latitude1Error: string, - longitude1Error: string - latitude2Error: string, - longitude2Error: string, - frequencyError: string, - rainMethodError: string, - antennaTypeError: string, - attenuationMethodError: string, - worstmonth: boolean, - showWM: string, - rainMethodErrorState: string -} - -class LinkCalculation extends React.Component<linkCalculationProps, initialState> { - constructor(props: any) { - super(props); - this.state = { - rainMethodDisplay: false, - horizontalBoxChecked: true, - absorptionMethod: '0', - latitude1Error: '', - longitude1Error: '', - latitude2Error: '', - longitude2Error: '', - frequencyError: '', - rainMethodError: '', - attenuationMethodError: '', - antennaTypeError: '', - worstmonth: false, - showWM: '', - rainMethodErrorState: '0' - }; - } - - updateAutoDistance = async (lat1: number, lon1: number, lat2: number, lon2: number) => { - const result = await fetch(BASE_URL + '/distance/' + lat1 + ',' + lon1 + ',' + lat2 + ',' + lon2) - const json = await result.json() - return json.distanceInKm - } - - updateLatLon = (e: any) => { - - e.target.id == 'Lat1' ? this.props.updateLatLon(e.target.value, this.props.lon1, this.props.lat2, this.props.lon2) : null - e.target.id == 'Lon1' ? this.props.updateLatLon(this.props.lat1, e.target.value, this.props.lat2, this.props.lon2) : null - e.target.id == 'Lat2' ? this.props.updateLatLon(this.props.lat1, this.props.lon1, e.target.value, this.props.lon2) : null - e.target.id == 'Lon2' ? this.props.updateLatLon(this.props.lat1, e.target.value, this.props.lat2, e.target.value) : null - - - } - - updatePoli = (val: string) => { - - this.setState({ horizontalBoxChecked: !this.state.horizontalBoxChecked }); - this.props.updatePolarization(val); - - } - - 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"; - } - } - - rainAttCal = (lat1: any, lon1: any, lat2: any, lon2: any, frequency: any, distance: number, polarization: string, worstmonth: boolean) => { - if (!worstmonth) { - fetch(BASE_URL + '/rain/annual/' + lat1 + ',' + lon1 + ',' + lat2 + ',' + lon2 + '/' + frequency + '/' + distance + '/' + polarization.toUpperCase()) - .then(res => res.json()) - .then(result => { this.props.UpdateRainAtt(result.rainAttenuation); this.props.updateRainValue(result.rainFall.rainrate) }) - } - else { - fetch(BASE_URL + '/rain/worstmonth/' + lat1 + ',' + lon1 + ',' + lat2 + ',' + lon2 + '/' + frequency + '/' + distance + '/' + polarization.toUpperCase()) - .then(res => res.json()) - .then(result => { this.props.UpdateRainAtt(result.rainAttenuation); this.props.updateRainValue(result.rainFall.rainrate); this.props.UpdateWorstMonthRain(result.rainFall.period); this.setState({ showWM: '- Wm is : ' }) }) - } - } - - - manualRain = (rainfall: number, frequency: number, distance: number, polarization: string) => { - fetch(BASE_URL + '/rain/' + rainfall + '/' + frequency + '/' + distance + '/' + polarization.toUpperCase()) - .then(res => res.json()) - .then(result => { this.props.specificRain(result.rainAttenuation) }) - } - - - FSL = (distance: number, frequency: number) => { - fetch(BASE_URL + '/fsl/' + distance + '/' + frequency) - .then(res => res.json()) - .then(result => { this.props.FSL(result.fspl) }) - } - - AbsorptionAtt = (lat1: number, lon1: number, lat2: number, lon2: number, distance: number, frequency: number, worstmonth: boolean, absorptionMethod: string) => { - if (!worstmonth) { - fetch(BASE_URL + '/absorption/annual/' + lat1 + ',' + lon1 + ',' + lat2 + ',' + lon2 + '/' + distance + '/' + frequency + '/' + absorptionMethod) - .then(res => res.json()) - .then(result => { this.props.UpdateAbsorption(result.oxygenLoss, result.waterLoss) }) - } - else { - fetch(BASE_URL + '/absorption/annual/' + lat1 + ',' + lon1 + ',' + lat2 + ',' + lon2 + '/' + distance + '/' + frequency + '/' + absorptionMethod) - .then(res => res.json()) - .then(result => { this.props.UpdateAbsorption(result.oxygenLoss, result.waterLoss) }) - } - } - - linkBudget = (lat1: number, lon1: number, lat2: number, lon2: number, distance: number, frequency: number, absorptionMethod: string, polarization: string, antennaGainA: number, antennaGainB: number, waveguideLossA: number, waveguideLossB: number, transmissionPowerA: number, transmissionPowerB: number, rxSensitivityA: number, rxSensitivityB: number) => { - fetch(BASE_URL + '/linkbudget/' + lat1 + ',' + lon1 + ',' + lat2 + ',' + lon2 + '/' + distance + '/' + frequency + '/' + absorptionMethod + '/' + polarization.toUpperCase() + '/' + antennaGainA + '/' + antennaGainB + '/' + waveguideLossA + '/' + waveguideLossB + '/' + transmissionPowerA + '/' + transmissionPowerB + '/' + rxSensitivityA + '/' + rxSensitivityB) - .then(res => res.json()) - .then(result => { this.props.UpdateEIRP(result.eirpA, result.eirpB); this.props.UpdateRxPower(result.receivedPowerA, result.receivedPowerB); this.props.UpdateSom(result.systemOperatingMarginA, result.systemOperatingMarginA) }) - } - - formValid = () => { - - this.props.lat1 === 0 ? this.setState({ latitude1Error: 'Enter a number between -90 to 90' }) : null - this.props.lat2 === 0 ? this.setState({ latitude2Error: 'Enter a number between -90 to 90' }) : null - this.props.lon1 === 0 ? this.setState({ longitude1Error: 'Enter a number between -180 to 180' }) : null - this.props.lon2 === 0 ? this.setState({ longitude2Error: 'Enter a number between -180 to 180' }) : null - this.props.frequency === 0 ? this.setState({ frequencyError: 'Select a frequency' }) : this.setState({ frequencyError: '' }) - - // this.state.rainMethodDisplay === null && this.props.rainVal === 0 ? this.setState({ rainMethodError: 'Select the rain method' }) : this.setState({ rainMethodError: '' }) - - this.state.rainMethodErrorState === '0' ? this.setState({ rainMethodError: 'Select the rain method' }) : this.setState({ rainMethodError: '' }) - - this.state.absorptionMethod === '0' ? this.setState({ attenuationMethodError: 'Select the attenuation method' }) : this.setState({ attenuationMethodError: '' }) - console.log(this.state); - console.log(this.props.lat1 !== 0 && this.props.lat2 !== 0 && this.props.lon1 !== 0 && this.props.lon2 !== 0 && this.props.frequency !== 0 && this.state.rainMethodError === '' && this.state.attenuationMethodError === ''); - - return this.props.lat1 !== 0 && this.props.lat2 !== 0 && this.props.lon1 !== 0 && this.props.lon2 !== 0 && this.props.frequency !== 0 && this.state.rainMethodError === '' && this.state.attenuationMethodError === ''; - - } - - - - buttonHandler = async () => { - - if (this.formValid()) { - - this.props.updateAutoDistance(await this.updateAutoDistance(this.props.lat1, this.props.lon1, this.props.lat2, this.props.lon2)) - this.FSL(this.props.distance, this.props.frequency) - - if (this.state.worstmonth === false) { - this.setState({ showWM: ' ' }) - this.props.UpdateWorstMonthRain('') - this.AbsorptionAtt(this.props.lat1, this.props.lon1, this.props.lat2, this.props.lon2, this.props.distance, this.props.frequency, this.state.worstmonth, this.state.absorptionMethod) - this.linkBudget(this.props.lat1, this.props.lon1, this.props.lat2, this.props.lon2, this.props.distance, this.props.frequency, this.state.absorptionMethod, this.props.polarization!, this.props.antennaGainA, this.props.antennaGainB, this.props.waveguideLossA, this.props.waveguideLossB, Number(this.props.txPowerA), Number(this.props.txPowerB), Number(this.props.rxSensitivityA), Number(this.props.rxSensitivityB)) - - if (this.state.rainMethodDisplay === true) { - - this.manualRain(this.props.rainVal, this.props.frequency, this.props.distance, this.props.polarization!); - } - else { - this.rainAttCal(this.props.lat1, this.props.lon1, this.props.lat2, this.props.lon2, this.props.frequency, this.props.distance, this.props.polarization!, this.state.worstmonth); - } - } - else { - this.AbsorptionAtt(this.props.lat1, this.props.lon1, this.props.lat2, this.props.lon2, this.props.distance, this.props.frequency, this.state.worstmonth, this.state.absorptionMethod) - this.rainAttCal(this.props.lat1, this.props.lon1, this.props.lat2, this.props.lon2, this.props.frequency, this.props.distance, this.props.polarization!, this.state.worstmonth); - } - } - else console.log('form is not valid') - - } - - componentDidMount = () => { - fetch(BASE_URL + '/fsl/1/1') - .then(res => { if (res.ok) { this.props.UpdateConectivity(true) } else { this.props.UpdateConectivity(false) } }) - .catch(res => { this.props.UpdateConectivity(false) }) - } - - handleChange = (e: any) => { - - switch (e.target.id) { - case 'Lat1': if (e.target.value > 90 || e.target.value < -90) { this.setState({ latitude1Error: 'Enter a number between -90 to 90' }) } - else { - this.updateLatLon(e) - this.setState({ latitude1Error: '' }) - } - break; - case 'Lat2': if (e.target.value > 90 || e.target.value < -90) { this.setState({ latitude2Error: 'Enter a number between -90 to 90' }) } - else { - this.updateLatLon(e) - this.setState({ latitude2Error: '' }) - } - break; - case 'Lon1': if (e.target.value > 180 || e.target.value < -180) { this.setState({ longitude1Error: 'Enter a number between -180 to 180' }) } - else { - this.updateLatLon(e) - this.setState({ longitude1Error: '' }) - } - break; - case 'Lon2': if (e.target.value > 180 || e.target.value < -180) { this.setState({ longitude2Error: 'Enter a number between -180 to 180' }) } - else { - this.updateLatLon(e) - this.setState({ longitude2Error: '' }) - } - break; - - } - } - - render() { - return ( - - <div > - - {!this.props.formView && - - <div className='container1'> - <div className='firstBox'> - <div>SiteA</div> - <div>SiteB</div> - </div> - - <div className='firstBox'> - <div> - <form > - <label>Latitude: <input aria-label="site-a-latitude-input" className={this.state.latitude1Error.length > 0 ? 'error' : 'input'} id='Lat1' type='number' onChange={(e: any) => { this.handleChange(e) }} /></label> - <div style={{ fontSize: 12, color: 'red' }}> {this.state.latitude1Error} </div> - </form></div> - <div> - <form> - <label>Latitude: <input aria-label="site-b-latitude-input" className={this.state.latitude2Error.length > 0 ? 'error' : 'input'} id='Lat2' type='number' onChange={(e: any) => { this.handleChange(e) }} /></label><div style={{ fontSize: 12, color: 'red' }}> {this.state.latitude2Error} </div> - </form></div> - </div> - - <div className='firstBox'> - <div> - <form><label>Longitude: <input aria-label="site-a-longitude-input" className={this.state.longitude1Error.length > 0 ? 'error' : 'input'} id='Lon1' type='number' onChange={(e: any) => this.handleChange(e)} /></label><div style={{ fontSize: 12, color: 'red' }}> {this.state.longitude1Error} </div> - </form></div> - <div> - <form><label>Longitude: <input aria-label="site-b-longitude-input" className={this.state.longitude2Error.length > 0 ? 'error' : 'input'} id='Lon2' type='number' onChange={(e: any) => { this.handleChange(e) }} /></label><div style={{ fontSize: 12, color: 'red' }}> {this.state.longitude2Error} </div></form> - </div> - </div> - - - - </div> - } - - - <div className='container1'> - <div >{<form><input aria-label="annual" type='checkbox' id='Annual' value="Annual" checked={this.state.worstmonth === false} onClick={(e: any) => this.setState({ worstmonth: false })}></input>Annual - <input aria-label="worst-month" style={{ marginLeft: 10 }} type='checkbox' id='Worst Month' value="Worst" checked={this.state.worstmonth === true} onClick={(e: any) => this.setState({ worstmonth: true })}></input>WM</form>} - </div> - <div className='firstBox'> - <div>Site A</div> - <div>Site B</div> - </div> - {/* <div> </div> */} - <div> - {(this.props.siteA.length > 0 || this.props.siteB.length > 0) && <div >Site Name</div>} - <div> {this.props.siteA}</div> - <div> {this.props.siteB}</div> - </div> - <div> - <div>Latitude</div> - <div aria-label="site-a-latitude-dms"> {this.props.lat1 && this.LatLonToDMS(this.props.lat1)}</div> - <div aria-label="site-b-latitude-dms"> {this.props.lat2 && this.LatLonToDMS(this.props.lat2)}</div> - - </div> - <div> - <div>Longitude</div> - <div aria-label="site-a-longitude-dms">{this.props.lon1 && this.LatLonToDMS(this.props.lon1)}</div> - <div aria-label="site-b-longitude-dms">{this.props.lon2 && this.LatLonToDMS(this.props.lon2)}</div> - </div> - <div> - <div>Azimuth</div> - <div>0</div> - <div>0</div> - </div> - <div> - <div>Average Mean Sea Level</div> - <div aria-label="site-a-amsl">{this.props.amslA.toFixed(2)} m</div> - <div aria-label="site-b-amsl">{this.props.amslB.toFixed(2)} m</div> - </div> - <div> - <div>Antenna Height Above Ground</div> - <div aria-label="site-a-antenna-amsl">{this.props.aglA.toFixed(2)} m</div> - <div aria-label="site-b-antenna-amsl">{this.props.aglB.toFixed(2)} m</div> - </div> - <div> - <div >Distance</div> - <div aria-label="distance-between-sites">{this.props.distance?.toFixed(3)} km</div> - </div> - <div> - <div >Polarization</div> - <div >{<form><input aria-label="polarization-horizontal" type='checkbox' id='Horizontal' value="Horizontal" checked={this.props.polarization === 'Horizontal'} onClick={(e: any) => this.props.updatePolarization(e.target.value)}></input>Horizontal - <input aria-label="polarization-vertical" style={{ marginLeft: 10 }} type='checkbox' id='Vertical' value="Vertical" checked={this.props.polarization === 'Vertical'} onClick={(e: any) => { this.props.updatePolarization(e.target.value) }}></input>Vertical</form>}</div> - </div> - <div> - <div style={{ marginTop: 5 }}>Frequency</div> - <div style={{ marginTop: 5 }}> {<select aria-label="select-frequency-in-ghz" className={this.state.frequencyError.length > 0 ? 'error' : 'input'} onChange={(e) => { this.props.updateFrequency(Number(e.target.value)); e.target.value === '0' ? this.setState({ frequencyError: 'select a frequency' }) : this.setState({ frequencyError: '' }) }}> - - <option value='0' aria-label="none-value" >Select Freq</option> - <option value='7' aria-label="7" >7 GHz</option> - <option value='11' aria-label="11" >11 GHz</option> - <option value='15' aria-label="15" >15 GHz</option> - <option value='23' aria-label="23">23 GHz</option> - <option value='26' aria-label="26">26 GHz</option> - <option value='28' aria-label="28">28 GHz</option> - <option value='38' aria-label="38">38 GHz</option> - <option value='42' aria-label="42">42 GHz</option> - <option value='80' aria-label="80">80 GHz</option> - </select>} <div style={{ fontSize: 12, color: 'red' }}> {this.state.frequencyError} </div> </div> - </div> - <div> - <div>Free Space Loss</div> - <div aria-label="fspl-value">{this.props.fsl.toFixed(3)} dB</div> - </div> - <div> - <div>Rain Model</div> - <div> {<select aria-label="select-rain-method" className={this.state.rainMethodError.length > 0 ? 'error' : 'input'} onChange={(e) => {if (e.target.value !== '') { this.setState({ rainMethodErrorState: e.target.value, rainMethodError: '' }) }; e.target.value === 'itu' ? this.setState({ rainMethodDisplay: false }) : this.setState({ rainMethodDisplay: true }) }}> - <option value='0' aria-label="none-value" >Select Rain Method</option> - <option value='itu' aria-label="itur8377">ITU-R P.837-7</option> - <option value='manual' aria-label="manual-entry">Specific Rain</option> - </select>} <div style={{ fontSize: 12, color: 'red' }}>{this.state.rainMethodError}</div> - </div> - </div> - <div> - <div>Rainfall Rate</div> - <div> {<form><input aria-label="rain-value" type="number" style={{ width: 70, height: 15, fontSize: 14 }} onChange={(e) => { this.props.updateRainValue(Number(e.target.value)) }} - value={this.props.rainVal} disabled={this.state.rainMethodDisplay === false ? true : false}> - </input> mm/hr {this.state.showWM} {this.props.month}</form>} </div> - </div> - <div> - <div>Rain Loss</div> - <div aria-label="rain-attenuation-value">{this.props.rainAtt.toFixed(3)} dB</div> - </div> - <div> - <div>Absorption Model</div> - <div> {<select aria-label="select-absorption-method" className={this.state.attenuationMethodError.length > 0 ? 'error' : 'input'} onChange={(e) => { if (e.target.value !== '') { this.setState({ absorptionMethod: e.target.value, attenuationMethodError: '' }) } }}> - <option value='0' aria-label="none-value" >Select Absorption Method</option> - <option value='ITURP67612' aria-label="iturp67612" >ITU-R P.676-12</option> - <option value='ITURP67611' aria-label="iturp67611" >ITU-R P.676-11</option> - <option value='ITURP67610' aria-label="iturp67610" >ITU-R P.676-10</option> - </select>} <div style={{ fontSize: 12, color: 'red' }}>{this.state.attenuationMethodError}</div> - </div> - </div> - <div> - <div>Oxygen Specific Attenuation</div> - <div aria-label="absorption-oxygen-value">{this.props.absorptionOxygen.toFixed(3)} dB</div> - </div> - <div> - <div>Water Vapor Specific Attenuation</div> - <div aria-label="absorption-water-value">{this.props.absorptionWater.toFixed(3)} dB</div> - </div> - <div> - <div>System Operating Margin</div> - <div aria-label="system-operating-margin">{this.props.systemOperatingMarginA.toFixed(3)} dB</div> - <div aria-label="system-operating-margin">{this.props.systemOperatingMarginB.toFixed(3)} dB</div> - </div> - <div> - <div>Radio Transmitted Power</div> - <div> {<form><input aria-label="site-a-transmitted-power" type="number" style={{ width: 70, height: 15, fontSize: 14 }} onChange={(e) => { if (e.target.value !== '') this.props.UpdateTxPower(e.target.value, null) }} - > - </input> dBm </form>} </div> - <div> {<form><input aria-label="site-b-transmitted-power" type="number" style={{ width: 70, height: 15, fontSize: 14 }} onChange={(e) => { if (e.target.value !== '') this.props.UpdateTxPower(null, e.target.value) }} - > - </input> dBm </form>} </div> - </div> - <div> - <div>RF Receiver Sensitivity</div> - <div> {<form><input aria-label="site-a-receiver-sensitivity" type="number" style={{ width: 70, height: 15, fontSize: 14 }} onChange={(e) => { if (e.target.value !== '') this.props.UpdateRxSensitivity(e.target.value, null) }} - > - </input> dBm </form>} </div> - <div> {<form><input aria-label="site-b-receiver-sensitivity" type="number" style={{ width: 70, height: 15, fontSize: 14 }} onChange={(e) => { if (e.target.value !== '') this.props.UpdateRxSensitivity(null, e.target.value) }} - > - </input> dBm </form>} </div> - </div> - <div> - <div>Rx power</div> - <div aria-label="site-a-effective-isotropic-radiated-power">{this.props.rxPowerA.toFixed(3)} dBm</div> - <div aria-label="site-b-effective-isotropic-radiated-power">{this.props.rxPowerB.toFixed(3)} dBm</div> - </div> - </div> - <div className='antennaContainer'> - <div> - <div></div> - <div className='antennaFont'>Antenna Settings</div> - </div> - - <div> - <div>Antenna</div> - <div aria-label="site-a-amsl">{this.props.antennaNameA} </div> - <div aria-label="site-b-amsl">{this.props.antennaNameB}</div> - </div> - - - <div> - <div>EIRP</div> - <div aria-label="site-a-effective-isotropic-radiated-power">{this.props.eirpA.toFixed(3)} dBm</div> - <div aria-label="site-b-effective-isotropic-radiated-power">{this.props.eirpB.toFixed(3)} dBm</div> - </div> - - <div> - <div>Gain</div> - <div aria-label="site-a-antenna-gain" > {this.props.antennaGainA} dBi</div> - <div aria-label="site-b-antenna-gain">{this.props.antennaGainB} dBi</div> - </div> - <div> - <div>Waveguide Loss</div> - <div aria-label="site-a-waveguide-loss" > {this.props.waveguideLossA} dB</div> - <div aria-label="site-b-waveguide-loss">{this.props.waveguideLossB} dB</div> - </div> - - <div> - <div></div> - <div>{<button aria-label="calculate-button" style={{ color: '#222', fontFamily: 'Arial', boxAlign: 'center', display: 'inline-block', insetInlineStart: '20', alignSelf: 'center' }} - onClick={(e) => this.buttonHandler()} >Calculate</button>} </div> - </div> - </div> - - - <ConnectionInfo /> - - - </div> - - ) - } - -} - -export default connect(mapProps, mapDispatch)(LinkCalculation); diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java b/sdnr/wt/odlux/apps/linkCalculationApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java deleted file mode 100644 index 43b072c4b..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -package org.onap.ccsdk.features.sdnr.wt.odlux.bundles; - -import org.onap.ccsdk.features.sdnr.wt.odlux.model.bundles.OdluxBundle; -import org.onap.ccsdk.features.sdnr.wt.odlux.model.bundles.OdluxBundleLoader; - -public class MyOdluxBundle extends OdluxBundle { - - @Override - public void initialize() { - super.initialize(); - } - - @Override - public void clean() { - super.clean(); - } - - @Override - public String getResourceFileContent(String filename) { - return super.getResourceFileContent(filename); - } - - @Override - public boolean hasResource(String filename) { - return super.hasResource(filename); - } - - @Override - public void setBundleName(String bundleName) { - super.setBundleName(bundleName); - } - - @Override - public void setLoader(OdluxBundleLoader loader) { - super.setLoader(loader); - } - - @Override - public String getBundleName() { - return super.getBundleName(); - } - - @Override - public OdluxBundleLoader getLoader() { - return super.getLoader(); - } - - public MyOdluxBundle() { - super(); - } -} diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml b/sdnr/wt/odlux/apps/linkCalculationApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml deleted file mode 100644 index 8eb652e2d..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml +++ /dev/null @@ -1,9 +0,0 @@ -<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"> - <reference id="loadersvc" availability="mandatory" activation="eager" interface="org.onap.ccsdk.features.sdnr.wt.odlux.model.bundles.OdluxBundleLoader"/> - - <bean id="bundle" init-method="initialize" destroy-method="clean" class="org.onap.ccsdk.features.sdnr.wt.odlux.bundles.MyOdluxBundle"> - <property name="loader" ref="loadersvc"/> - <property name="bundleName" value="linkCalculationApp"/> - <property name="index" value="120"/> - </bean> -</blueprint>
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java b/sdnr/wt/odlux/apps/linkCalculationApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java deleted file mode 100644 index c319bb189..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -package org.onap.ccsdk.features.sdnr.wt.odlux.bundles.test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import org.junit.Test; -import org.onap.ccsdk.features.sdnr.wt.odlux.OdluxBundleLoaderImpl; -import org.onap.ccsdk.features.sdnr.wt.odlux.bundles.MyOdluxBundle; - -public class TestBundleRes { - - @Test - public void test() { - OdluxBundleLoaderImpl loader = OdluxBundleLoaderImpl.getInstance(); - MyOdluxBundle b = new MyOdluxBundle(); - b.setLoader(loader); - b.setIndex(0); - b.setBundleName("abc"); - b.initialize(); - assertTrue(loader.getNumberOfBundles()==1); - assertNotNull(b.getLoader()); - assertEquals("abc",b.getBundleName()); - assertTrue(b.hasResource("test.js")); - assertNotNull(b.getResourceFileContent("test.js")); - b.clean(); - assertTrue(loader.getNumberOfBundles()==0); - } - -} diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/src2/test/resources/test.js b/sdnr/wt/odlux/apps/linkCalculationApp/src2/test/resources/test.js deleted file mode 100644 index b47fdc39f..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/src2/test/resources/test.js +++ /dev/null @@ -1,5 +0,0 @@ -asdac sad -as -d -sad - sadfa
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/tsconfig.json b/sdnr/wt/odlux/apps/linkCalculationApp/tsconfig.json deleted file mode 100644 index a66b5d828..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/tsconfig.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "./src", - "outDir": "./dist", - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "allowSyntheticDefaultImports": false, - "allowUnreachableCode": false, - "allowUnusedLabels": false, - "noFallthroughCasesInSwitch": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "strictNullChecks": true, - "pretty": true, - "newLine": "LF", - "module": "es2015", - "target": "es2016", - "moduleResolution": "node", - "experimentalDecorators": true, - "jsx": "preserve", - "lib": [ - "dom", - "es2015", - "es2016" - ], - "types": [ - "prop-types", - "react", - "react-dom" - ] - }, - "exclude": [ - "dist", - "node_modules" - ] -} diff --git a/sdnr/wt/odlux/apps/linkCalculationApp/webpack.config.js b/sdnr/wt/odlux/apps/linkCalculationApp/webpack.config.js deleted file mode 100644 index 55d98b4d7..000000000 --- a/sdnr/wt/odlux/apps/linkCalculationApp/webpack.config.js +++ /dev/null @@ -1,187 +0,0 @@ -/** - * Webpack 4 configuration file - * see https://webpack.js.org/configuration/ - * see https://webpack.js.org/configuration/dev-server/ - */ - -"use strict"; - -const path = require("path"); -const webpack = require("webpack"); -const CopyWebpackPlugin = require("copy-webpack-plugin"); -const TerserPlugin = require('terser-webpack-plugin'); - -// const __dirname = (path => path.replace(/^([a-z]\:)/, c => c.toUpperCase()))(process.__dirname()); - -module.exports = (env) => { - const distPath = path.resolve(__dirname, env === "release" ? "." : "../..", "dist"); - const frameworkPath = path.resolve(__dirname, env === "release" ? "../../framework" : "../..", "dist"); - return [{ - name: "App", - - mode: "none", //disable default behavior - - target: "web", - - context: path.resolve(__dirname, "src"), - - entry: { - linkCalculationApp: ["./pluginLinkCalculation.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: /\.scss$/, - include: /node_modules/, - use: ['style-loader', 'css-loader', 'sass-loader'], - },{ - test: /\.s[ac]ss$/i, - use: [ - // Creates `style` nodes from JS strings - 'style-loader', - // Translates CSS into CommonJS - 'css-loader', - // Compiles Sass to CSS - 'sass-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: { - "/oauth2/": { - target: "http://sdnr:8181", - secure: false - }, - "/database/": { - target: "http://sdnr:8181", - secure: false - }, - "/rests/": { - target: "http://sdnr:8181", - secure: false - }, - "/topology/": { - target: "http://localhost:3002", - secure: false - }, - "/help/": { - target: "http://sdnr:8181", - secure: false - }, - "/websocket/": { - target: "http://sdnr:8181", - ws: true, - changeOrigin: true, - secure: false - }, - "/terrain": { - target: "http://10.20.11.163:5200", - secure: false, - pathRewrite(pathname) { - return pathname.replace(/^\/terrain/, '') - } - }, - "/terrain/": { - target: "http://10.20.11.163:5200", - secure: false, - pathRewrite(pathname) { - return pathname.replace(/^\/terrain/, '/') - } - } - } - - } - }]; -} diff --git a/sdnr/wt/odlux/apps/maintenanceApp/package.json b/sdnr/wt/odlux/apps/maintenanceApp/package.json index 939044e20..dd678d693 100644 --- a/sdnr/wt/odlux/apps/maintenanceApp/package.json +++ b/sdnr/wt/odlux/apps/maintenanceApp/package.json @@ -21,21 +21,24 @@ "author": "Matthias Fischer", "license": "Apache-2.0", "dependencies": { - "@odlux/framework": "*", - "@odlux/connect-app": "*" + "@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/connect-app": "*", + "@odlux/framework": "*" }, "peerDependencies": { - "@types/react": "17.0.3", - "@types/react-dom": "17.0.2", - "@types/react-router-dom": "5.1.7", - "@material-ui/core": "4.11.4", - "@material-ui/icons": "4.11.2", "@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.1", - "react-dom": "17.0.1", + "react": "17.0.2", + "react-dom": "17.0.2", "react-router-dom": "5.2.0" } -}
\ No newline at end of file +} diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src/components/editMaintenenceEntryDialog.tsx b/sdnr/wt/odlux/apps/maintenanceApp/src/components/editMaintenenceEntryDialog.tsx index 5ffd98799..829289224 100644 --- a/sdnr/wt/odlux/apps/maintenanceApp/src/components/editMaintenenceEntryDialog.tsx +++ b/sdnr/wt/odlux/apps/maintenanceApp/src/components/editMaintenenceEntryDialog.tsx @@ -17,13 +17,13 @@ */ import * as React from 'react'; -import Button from '@material-ui/core/Button'; -import TextField from '@material-ui/core/TextField'; -import Dialog from '@material-ui/core/Dialog'; -import DialogActions from '@material-ui/core/DialogActions'; -import DialogContent from '@material-ui/core/DialogContent'; -import DialogContentText from '@material-ui/core/DialogContentText'; -import DialogTitle from '@material-ui/core/DialogTitle'; +import Button from '@mui/material/Button'; +import TextField from '@mui/material/TextField'; +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 { IDispatcher, connect, Connect } from '../../../../framework/src/flux/connect'; @@ -33,7 +33,7 @@ import { } from '../actions/maintenenceActions'; import { MaintenenceEntry } from '../models/maintenenceEntryType'; -import { FormControl, InputLabel, Select, MenuItem, Typography } from '@material-ui/core'; +import { FormControl, InputLabel, Select, MenuItem, Typography } from '@mui/material'; export enum EditMaintenenceEntryDialogMode { None = "none", @@ -122,13 +122,13 @@ class EditMaintenenceEntryDIalogComponent extends React.Component<EditMaintenenc <DialogContentText> {setting.dialogDescription} </DialogContentText> - <TextField disabled={!setting.enableMountIdEditor} spellCheck={false} autoFocus margin="dense" id="name" label="Name" type="text" fullWidth value={this.state.nodeId} onChange={(event) => { this.setState({ nodeId: event.target.value }); }} /> + <TextField variant="standard" disabled={!setting.enableMountIdEditor} spellCheck={false} autoFocus margin="dense" id="name" label="Name" type="text" fullWidth value={this.state.nodeId} onChange={(event) => { this.setState({ nodeId: event.target.value }); }} /> {this.state.isErrorVisible && <Typography variant="body1" color="error" >Name must not be empty.</Typography>} - <TextField disabled={!setting.enableTimeEditor} spellCheck={false} autoFocus margin="dense" id="start" label="Start (Local DateTime)" type="datetime-local" fullWidth value={this.state.start} onChange={(event) => { this.setState({ start: event.target.value }); }} /> - <TextField disabled={!setting.enableTimeEditor} spellCheck={false} autoFocus margin="dense" id="end" label="End (Local DateTime)" type="datetime-local" fullWidth value={this.state.end} onChange={(event) => { this.setState({ end: event.target.value }); }} /> - <FormControl fullWidth disabled={!setting.enableTimeEditor}> + <TextField variant="standard" disabled={!setting.enableTimeEditor} spellCheck={false} autoFocus margin="dense" id="start" label="Start (Local DateTime)" type="datetime-local" fullWidth value={this.state.start} onChange={(event) => { this.setState({ start: event.target.value }); }} /> + <TextField variant="standard" disabled={!setting.enableTimeEditor} spellCheck={false} autoFocus margin="dense" id="end" label="End (Local DateTime)" type="datetime-local" fullWidth value={this.state.end} onChange={(event) => { this.setState({ end: event.target.value }); }} /> + <FormControl variant="standard" fullWidth disabled={!setting.enableTimeEditor}> <InputLabel htmlFor="active">Active</InputLabel> - <Select value={this.state.active || false} onChange={(event) => { + <Select variant="standard" value={this.state.active || false} onChange={(event) => { this.setState({ active: event.target.value as any as boolean }); }} inputProps={{ name: 'active', id: 'active' }} fullWidth > <MenuItem value={true as any as string}>active</MenuItem> @@ -155,7 +155,7 @@ class EditMaintenenceEntryDIalogComponent extends React.Component<EditMaintenenc event.preventDefault(); event.stopPropagation(); - }} > {setting.applyButtonText} </Button> + }} color="inherit" > {setting.applyButtonText} </Button> <Button onClick={(event) => { this.onCancel(); event.preventDefault(); diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src/components/refreshMaintenanceEntries.tsx b/sdnr/wt/odlux/apps/maintenanceApp/src/components/refreshMaintenanceEntries.tsx index 1a00c70c4..c66b6f460 100644 --- a/sdnr/wt/odlux/apps/maintenanceApp/src/components/refreshMaintenanceEntries.tsx +++ b/sdnr/wt/odlux/apps/maintenanceApp/src/components/refreshMaintenanceEntries.tsx @@ -17,12 +17,12 @@ */ import * as React from 'react'; -import Button from '@material-ui/core/Button'; -import Dialog from '@material-ui/core/Dialog'; -import DialogActions from '@material-ui/core/DialogActions'; -import DialogContent from '@material-ui/core/DialogContent'; -import DialogContentText from '@material-ui/core/DialogContentText'; -import DialogTitle from '@material-ui/core/DialogTitle'; +import 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 { IDispatcher, connect, Connect } from '../../../../framework/src/flux/connect'; @@ -94,13 +94,13 @@ class RefreshMaintenanceEntriesDialogComponent extends React.Component<RefreshMa <DialogActions> <Button aria-label="dialog-confirm-button" onClick={(event) => { this.onRefresh(); - }} > {setting.applyButtonText} </Button> + }} color="inherit" > {setting.applyButtonText} </Button> <Button aria-label="dialog-cancel-button" onClick={(event) => { this.onCancel(); }} color="secondary"> {setting.cancelButtonText} </Button> </DialogActions> </Dialog> - ) + ); } private onRefresh = () => { diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src/views/maintenenceView.tsx b/sdnr/wt/odlux/apps/maintenanceApp/src/views/maintenenceView.tsx index 0be28b748..d040e3dda 100644 --- a/sdnr/wt/odlux/apps/maintenanceApp/src/views/maintenenceView.tsx +++ b/sdnr/wt/odlux/apps/maintenanceApp/src/views/maintenenceView.tsx @@ -17,16 +17,20 @@ */ import * as React from 'react'; -import { Theme, createStyles, WithStyles, withStyles, Tooltip } from '@material-ui/core'; +import { Theme, Tooltip } from '@mui/material'; + +import { WithStyles } from '@mui/styles'; +import createStyles from '@mui/styles/createStyles'; +import withStyles from '@mui/styles/withStyles'; import { faBan } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import AddIcon from '@material-ui/icons/Add'; -import EditIcon from '@material-ui/icons/Edit'; -import RemoveIcon from '@material-ui/icons/RemoveCircleOutline'; -import Refresh from '@material-ui/icons/Refresh'; -import { MenuItem, Divider, Typography } from '@material-ui/core'; +import AddIcon from '@mui/icons-material/Add'; +import EditIcon from '@mui/icons-material/Edit'; +import RemoveIcon from '@mui/icons-material/RemoveCircleOutline'; +import Refresh from '@mui/icons-material/Refresh'; +import { MenuItem, Divider, Typography } from '@mui/material'; import connect, { IDispatcher, Connect } from '../../../../framework/src/flux/connect'; import MaterialTable, { MaterialTableCtorType, ColumnType } from '../../../../framework/src/components/material-table'; @@ -212,9 +216,7 @@ class MaintenenceViewComponent extends React.Component<MaintenenceViewComponentP this.setState({ maintenenceEntryToEdit: { ...entry, - ...(entry.start && endTime) - ? { start: convertToLocaleString(entry.start), end: convertToLocaleString(entry.end) } - : { start: convertToLocaleString(startTime), end: convertToLocaleString(endTime) } + ...(entry.start && endTime ? { start: convertToLocaleString(entry.start), end: convertToLocaleString(entry.end) } : { start: convertToLocaleString(startTime), end: convertToLocaleString(endTime) }) }, maintenenceEntryEditorMode: EditMaintenenceEntryDialogMode.EditMaintenenceEntry }); @@ -228,9 +230,7 @@ class MaintenenceViewComponent extends React.Component<MaintenenceViewComponentP this.setState({ maintenenceEntryToEdit: { ...entry, - ...(entry.start && endTime) - ? { start: convertToLocaleString(entry.start), end: convertToLocaleString(entry.end) } - : { start: convertToLocaleString(startTime), end: convertToLocaleString(endTime) } + ...(entry.start && endTime ? { start: convertToLocaleString(entry.start), end: convertToLocaleString(entry.end) } : { start: convertToLocaleString(startTime), end: convertToLocaleString(endTime) }) }, maintenenceEntryEditorMode: EditMaintenenceEntryDialogMode.RemoveMaintenenceEntry }); diff --git a/sdnr/wt/odlux/apps/maintenanceApp/webpack.config.js b/sdnr/wt/odlux/apps/maintenanceApp/webpack.config.js index eb6f785f3..da5cf5880 100644 --- a/sdnr/wt/odlux/apps/maintenanceApp/webpack.config.js +++ b/sdnr/wt/odlux/apps/maintenanceApp/webpack.config.js @@ -86,7 +86,7 @@ module.exports = (env) => { manifest: require(path.resolve(frameworkPath, "app-manifest.json")), sourceType: "umd2" }), - ...(env === "release") ? [ + ...(env === "release" ? [ new webpack.DefinePlugin({ "process.env": { NODE_ENV: "'production'", @@ -104,7 +104,7 @@ module.exports = (env) => { from: 'index.html', to: distPath }]), - ] + ]) ], devServer: { diff --git a/sdnr/wt/odlux/apps/mediatorApp/package.json b/sdnr/wt/odlux/apps/mediatorApp/package.json index 74fdd33ac..867a8790d 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/package.json +++ b/sdnr/wt/odlux/apps/mediatorApp/package.json @@ -21,21 +21,24 @@ "author": "Matthias Fischer", "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": "*" }, "peerDependencies": { "@fortawesome/free-solid-svg-icons": "5.6.3", - "@types/react": "17.0.3", - "@types/react-dom": "17.0.2", - "@types/react-router-dom": "5.1.7", - "@material-ui/core": "4.11.4", - "@material-ui/icons": "4.11.2", "@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.1", - "react-dom": "17.0.1", + "react": "17.0.2", + "react-dom": "17.0.2", "react-router-dom": "5.2.0" } -}
\ No newline at end of file +} diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/components/editMediatorConfigDialog.tsx b/sdnr/wt/odlux/apps/mediatorApp/src/components/editMediatorConfigDialog.tsx index bcbccccd7..34ffc5e20 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/components/editMediatorConfigDialog.tsx +++ b/sdnr/wt/odlux/apps/mediatorApp/src/components/editMediatorConfigDialog.tsx @@ -16,30 +16,34 @@ * ============LICENSE_END========================================================================== */ import * as React from 'react'; -import { Theme, createStyles, WithStyles, withStyles, Typography, FormControlLabel, Checkbox } from '@material-ui/core'; +import { Theme, Typography, FormControlLabel, Checkbox } from '@mui/material'; -import Button from '@material-ui/core/Button'; -import TextField from '@material-ui/core/TextField'; -import Select from '@material-ui/core/Select'; -import Dialog from '@material-ui/core/Dialog'; -import DialogActions from '@material-ui/core/DialogActions'; -import DialogContent from '@material-ui/core/DialogContent'; -import DialogContentText from '@material-ui/core/DialogContentText'; -import DialogTitle from '@material-ui/core/DialogTitle'; +import { WithStyles } from '@mui/styles'; +import createStyles from '@mui/styles/createStyles'; +import withStyles from '@mui/styles/withStyles'; -import Tabs from '@material-ui/core/Tabs'; -import Tab from '@material-ui/core/Tab'; +import Button from '@mui/material/Button'; +import TextField from '@mui/material/TextField'; +import Select from '@mui/material/Select'; +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 Fab from '@material-ui/core/Fab'; -import AddIcon from '@material-ui/icons/Add'; -import DeleteIcon from '@material-ui/icons/Delete'; -import IconButton from '@material-ui/core/IconButton'; +import Tabs from '@mui/material/Tabs'; +import Tab from '@mui/material/Tab'; + +import Fab from '@mui/material/Fab'; +import AddIcon from '@mui/icons-material/Add'; +import DeleteIcon from '@mui/icons-material/Delete'; +import IconButton from '@mui/material/IconButton'; import { addMediatorConfigAsyncActionCreator, updateMediatorConfigAsyncActionCreator, removeMediatorConfigAsyncActionCreator } from '../actions/mediatorConfigActions'; import { MediatorConfig, ODLConfig } from '../models/mediatorServer'; -import FormControl from '@material-ui/core/FormControl'; -import InputLabel from '@material-ui/core/InputLabel'; -import MenuItem from '@material-ui/core/MenuItem'; +import FormControl from '@mui/material/FormControl'; +import InputLabel from '@mui/material/InputLabel'; +import MenuItem from '@mui/material/MenuItem'; import { Panel } from '../../../../framework/src/components/material-ui/panel'; @@ -202,10 +206,10 @@ class EditMediatorConfigDialogComponent extends React.Component<EditMediatorConf <Tab label="ODL AutoConnect" /> </Tabs> {this.state.activeTab === 0 ? <TabContainer > - <TextField disabled={setting.readonly || setting.readonlyName} spellCheck={false} autoFocus margin="dense" id="name" label="Name" type="text" fullWidth value={this.state.Name} onChange={(event) => { this.setState({ Name: event.target.value }); }} /> - <FormControl fullWidth disabled={setting.readonly}> + <TextField variant="standard" disabled={setting.readonly || setting.readonlyName} spellCheck={false} autoFocus margin="dense" id="name" label="Name" type="text" fullWidth value={this.state.Name} onChange={(event) => { this.setState({ Name: event.target.value }); }} /> + <FormControl variant="standard" fullWidth disabled={setting.readonly}> <InputLabel htmlFor="deviceType">Device</InputLabel> - <Select value={this.state.DeviceType} onChange={(event, value) => { + <Select variant="standard" value={this.state.DeviceType} onChange={(event, value) => { const device = this.props.supportedDevices.find(device => device.id === event.target.value); if (device) { this.setState({ @@ -223,46 +227,48 @@ class EditMediatorConfigDialogComponent extends React.Component<EditMediatorConf {this.props.supportedDevices.map(device => (<MenuItem key={device.id} value={device.id} >{`${device.vendor} - ${device.device} (${device.version || '0.0.0'}) `}</MenuItem>))} </Select> </FormControl> - <TextField disabled={setting.readonly} spellCheck={false} autoFocus margin="dense" id="ipAddress" label="Device IP" type="text" fullWidth value={this.state.DeviceIp} onChange={(event) => { this.setState({ DeviceIp: event.target.value }); }} /> - <TextField disabled={setting.readonly} spellCheck={false} autoFocus margin="dense" id="devicePort" label="Device SNMP Port" type="number" fullWidth value={this.state.DevicePort || ""} onChange={(event) => { this.setState({ DevicePort: +event.target.value }); }} /> - <TextField disabled={setting.readonly} spellCheck={false} autoFocus margin="dense" id="trapsPort" label="TrapsPort" type="number" fullWidth value={this.state.TrapPort || ""} onChange={(event) => { this.setState({ TrapPort: +event.target.value }); }} /> - <TextField disabled={setting.readonly} spellCheck={false} autoFocus margin="dense" id="ncUser" label="Netconf User" type="text" fullWidth value={this.state.NcUsername} onChange={(event) => { this.setState({ NcUsername: event.target.value }); }} /> - <TextField disabled={setting.readonly} spellCheck={false} autoFocus margin="dense" id="ncPassword" label="Netconf Password" type="password" fullWidth value={this.state.NcPassword} onChange={(event) => { this.setState({ NcPassword: event.target.value }); }} /> - <TextField disabled={setting.readonly} spellCheck={false} autoFocus margin="dense" id="ncPort" label="Netconf Port" type="number" fullWidth value={this.state.NcPort || ""} onChange={(event) => { this.setState({ NcPort: +event.target.value }); }} /> + <TextField variant="standard" disabled={setting.readonly} spellCheck={false} autoFocus margin="dense" id="ipAddress" label="Device IP" type="text" fullWidth value={this.state.DeviceIp} onChange={(event) => { this.setState({ DeviceIp: event.target.value }); }} /> + <TextField variant="standard" disabled={setting.readonly} spellCheck={false} autoFocus margin="dense" id="devicePort" label="Device SNMP Port" type="number" fullWidth value={this.state.DevicePort || ""} onChange={(event) => { this.setState({ DevicePort: +event.target.value }); }} /> + <TextField variant="standard" disabled={setting.readonly} spellCheck={false} autoFocus margin="dense" id="trapsPort" label="TrapsPort" type="number" fullWidth value={this.state.TrapPort || ""} onChange={(event) => { this.setState({ TrapPort: +event.target.value }); }} /> + <TextField variant="standard" disabled={setting.readonly} spellCheck={false} autoFocus margin="dense" id="ncUser" label="Netconf User" type="text" fullWidth value={this.state.NcUsername} onChange={(event) => { this.setState({ NcUsername: event.target.value }); }} /> + <TextField variant="standard" disabled={setting.readonly} spellCheck={false} autoFocus margin="dense" id="ncPassword" label="Netconf Password" type="password" fullWidth value={this.state.NcPassword} onChange={(event) => { this.setState({ NcPassword: event.target.value }); }} /> + <TextField variant="standard" disabled={setting.readonly} spellCheck={false} autoFocus margin="dense" id="ncPort" label="Netconf Port" type="number" fullWidth value={this.state.NcPort || ""} onChange={(event) => { this.setState({ NcPort: +event.target.value }); }} /> </TabContainer> : null} {this.state.activeTab === 1 ? <TabContainer > {this.state.ODLConfig && this.state.ODLConfig.length > 0 ? this.state.ODLConfig.map((cfg, ind) => { const panelId = `panel-${ind}`; - const deleteButton = (<IconButton onClick={() => { - this.setState({ - ODLConfig: [ - ...this.state.ODLConfig.slice(0, ind), - ...this.state.ODLConfig.slice(ind + 1) - ] - }); - }} ><DeleteIcon /></IconButton>) + const deleteButton = (<IconButton + onClick={() => { + this.setState({ + ODLConfig: [ + ...this.state.ODLConfig.slice(0, ind), + ...this.state.ODLConfig.slice(ind + 1) + ] + }); + }} + size="large"><DeleteIcon /></IconButton>) return ( <Panel title={cfg.Server && `${cfg.User ? `${cfg.User}@` : ''}${cfg.Protocol}://${cfg.Server}:${cfg.Port}` || "new odl config"} key={panelId} panelId={panelId} activePanel={this.state.activeOdlConfig} customActionButtons={[deleteButton]} onToggle={(id) => { this.setState({ activeOdlConfig: (this.state.activeOdlConfig === id) ? "" : (id || "") }); console.log("activeOdlConfig " + id); this.hideHostnameErrormessage(id) }} > <div className={classes.alignInOneLine}> - <FormControl className={classes.left} margin={"dense"} > + <FormControl variant="standard" className={classes.left} margin={"dense"} > <InputLabel htmlFor={`protocol-${ind}`}>Protocoll</InputLabel> - <Select value={cfg.Protocol} onChange={(e, v) => this.odlConfigValueChangeHandlerCreator(ind, "Protocol", e => v)} inputProps={{ name: `protocol-${ind}`, id: `protocol-${ind}` }} fullWidth > + <Select variant="standard" value={cfg.Protocol} onChange={(e, v) => this.odlConfigValueChangeHandlerCreator(ind, "Protocol", e => v)} inputProps={{ name: `protocol-${ind}`, id: `protocol-${ind}` }} fullWidth > <MenuItem value={"http"}>http</MenuItem> <MenuItem value={"https"}>https</MenuItem> </Select> </FormControl> - <TextField className={classes.left} spellCheck={false} margin="dense" id="hostname" label="Hostname" type="text" value={cfg.Server} onChange={this.odlConfigValueChangeHandlerCreator(ind, "Server", e => e.target.value)} /> - <TextField className={classes.right} style={{ maxWidth: "65px" }} spellCheck={false} margin="dense" id="port" label="Port" type="number" value={cfg.Port || ""} onChange={this.odlConfigValueChangeHandlerCreator(ind, "Port", e => +e.target.value)} /> + <TextField variant="standard" className={classes.left} spellCheck={false} margin="dense" id="hostname" label="Hostname" type="text" value={cfg.Server} onChange={this.odlConfigValueChangeHandlerCreator(ind, "Server", e => e.target.value)} /> + <TextField variant="standard" className={classes.right} style={{ maxWidth: "65px" }} spellCheck={false} margin="dense" id="port" label="Port" type="number" value={cfg.Port || ""} onChange={this.odlConfigValueChangeHandlerCreator(ind, "Port", e => +e.target.value)} /> </div> { this.state.isOdlConfigHostnameEmpty && <Typography component={"div"} className={classes.left} color="error" gutterBottom>Please add a hostname.</Typography> } <div className={classes.alignInOneLine}> - <TextField className={classes.left} spellCheck={false} margin="dense" id="username" label="Username" type="text" value={cfg.User} onChange={this.odlConfigValueChangeHandlerCreator(ind, "User", e => e.target.value)} /> - <TextField className={classes.right} spellCheck={false} margin="dense" id="password" label="Password" type="password" value={cfg.Password} onChange={this.odlConfigValueChangeHandlerCreator(ind, "Password", e => e.target.value)} /> + <TextField variant="standard" className={classes.left} spellCheck={false} margin="dense" id="username" label="Username" type="text" value={cfg.User} onChange={this.odlConfigValueChangeHandlerCreator(ind, "User", e => e.target.value)} /> + <TextField variant="standard" className={classes.right} spellCheck={false} margin="dense" id="password" label="Password" type="password" value={cfg.Password} onChange={this.odlConfigValueChangeHandlerCreator(ind, "Password", e => e.target.value)} /> </div> <div className={classes.alignInOneLine}> <FormControlLabel className={classes.right} control={<Checkbox checked={cfg.Trustall} onChange={this.odlConfigValueChangeHandlerCreator(ind, "Trustall", e => e.target.checked)} />} label="Trustall" /> @@ -288,7 +294,7 @@ class EditMediatorConfigDialogComponent extends React.Component<EditMediatorConf </DialogContent> <DialogActions> - <Button onClick={(event) => { this.addConfig(event) }} > {setting.applyButtonText} </Button> + <Button color="inherit" onClick={(event) => { this.addConfig(event) }} > {setting.applyButtonText} </Button> <Button onClick={(event) => { this.onCancel(); event.preventDefault(); @@ -297,7 +303,7 @@ class EditMediatorConfigDialogComponent extends React.Component<EditMediatorConf }} color="secondary"> {setting.cancelButtonText} </Button> </DialogActions> </Dialog> - ) + ); } private addConfig = (event: any) => { diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/components/editMediatorServerDialog.tsx b/sdnr/wt/odlux/apps/mediatorApp/src/components/editMediatorServerDialog.tsx index d520db466..c8b158749 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/components/editMediatorServerDialog.tsx +++ b/sdnr/wt/odlux/apps/mediatorApp/src/components/editMediatorServerDialog.tsx @@ -17,19 +17,19 @@ */ import * as React from 'react'; -import Button from '@material-ui/core/Button'; -import TextField from '@material-ui/core/TextField'; -import Dialog from '@material-ui/core/Dialog'; -import DialogActions from '@material-ui/core/DialogActions'; -import DialogContent from '@material-ui/core/DialogContent'; -import DialogContentText from '@material-ui/core/DialogContentText'; -import DialogTitle from '@material-ui/core/DialogTitle'; +import Button from '@mui/material/Button'; +import TextField from '@mui/material/TextField'; +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 { IDispatcher, connect, Connect } from '../../../../framework/src/flux/connect'; import { addAvaliableMediatorServerAsyncActionCreator, removeAvaliableMediatorServerAsyncActionCreator, updateAvaliableMediatorServerAsyncActionCreator } from '../actions/avaliableMediatorServersActions'; import { MediatorServer } from '../models/mediatorServer'; -import { Typography } from '@material-ui/core'; +import { Typography } from '@mui/material'; export enum EditMediatorServerDialogMode { None = "none", @@ -151,8 +151,8 @@ class EditMediatorServerDialogComponent extends React.Component<EditMediatorServ {setting.dialogDescription} </DialogContentText> {/* <TextField disabled spellCheck={false} autoFocus margin="dense" id="id" label="Id" type="text" fullWidth value={ this.state._id } onChange={(event)=>{ this.setState({_id: event.target.value}); } } /> */} - <TextField disabled={setting.readonly} spellCheck={false} margin="dense" id="name" label="Name" type="text" fullWidth value={this.state.name} onChange={(event) => { this.setState({ name: event.target.value }); }} /> - <TextField disabled={setting.readonly} spellCheck={false} margin="dense" id="url" label="Url" type="text" fullWidth value={this.state.url} onChange={(event) => { this.setState({ url: event.target.value }); }} /> + <TextField variant="standard" disabled={setting.readonly} spellCheck={false} margin="dense" id="name" label="Name" type="text" fullWidth value={this.state.name} onChange={(event) => { this.setState({ name: event.target.value }); }} /> + <TextField variant="standard" disabled={setting.readonly} spellCheck={false} margin="dense" id="url" label="Url" type="text" fullWidth value={this.state.url} onChange={(event) => { this.setState({ url: event.target.value }); }} /> <Typography id="errorMessage" component={"div"} color="error">{this.state.errorMessage.map((error, index) => <div key={index}>{error}</div>)}</Typography> @@ -174,7 +174,7 @@ class EditMediatorServerDialogComponent extends React.Component<EditMediatorServ event.preventDefault(); event.stopPropagation(); - }} > {setting.applyButtonText} </Button> + }} color="inherit" > {setting.applyButtonText} </Button> <Button onClick={(event) => { this.onCancel(); this.setState({ errorMessage: [] }); diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/components/refreshMediatorDialog.tsx b/sdnr/wt/odlux/apps/mediatorApp/src/components/refreshMediatorDialog.tsx index af94f5a32..db1ef8771 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/components/refreshMediatorDialog.tsx +++ b/sdnr/wt/odlux/apps/mediatorApp/src/components/refreshMediatorDialog.tsx @@ -17,12 +17,12 @@ */ import * as React from 'react'; -import Button from '@material-ui/core/Button'; -import Dialog from '@material-ui/core/Dialog'; -import DialogActions from '@material-ui/core/DialogActions'; -import DialogContent from '@material-ui/core/DialogContent'; -import DialogContentText from '@material-ui/core/DialogContentText'; -import DialogTitle from '@material-ui/core/DialogTitle'; +import 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 { avaliableMediatorServersReloadAction } from '../handlers/avaliableMediatorServersHandler'; import { IDispatcher, connect, Connect } from '../../../../framework/src/flux/connect'; @@ -94,13 +94,13 @@ class RefreshMediatorDialogComponent extends React.Component<RefreshMediatorDial <DialogActions> <Button aria-label="dialog-confirm-button" onClick={(event) => { this.onRefresh(); - }} > {setting.applyButtonText} </Button> + }} color="inherit" > {setting.applyButtonText} </Button> <Button aria-label="dialog-cancel-button" onClick={(event) => { this.onCancel(); }} color="secondary"> {setting.cancelButtonText} </Button> </DialogActions> </Dialog> - ) + ); } private onRefresh = () => { diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/components/showMeditaorInfoDialog.tsx b/sdnr/wt/odlux/apps/mediatorApp/src/components/showMeditaorInfoDialog.tsx index fd8a2496a..2b91079b5 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/components/showMeditaorInfoDialog.tsx +++ b/sdnr/wt/odlux/apps/mediatorApp/src/components/showMeditaorInfoDialog.tsx @@ -17,7 +17,7 @@ */ import * as React from 'react' -import { Dialog, DialogTitle, DialogContent, DialogActions, TextField, DialogContentText, Checkbox, Button, FormControlLabel, FormGroup } from '@material-ui/core'; +import { Dialog, DialogTitle, DialogContent, DialogActions, TextField, DialogContentText, Checkbox, Button, FormControlLabel, FormGroup } from '@mui/material'; import { IApplicationState } from '../../../../framework/src/handlers/applicationStateHandler'; import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; import connect, { Connect } from '../../../../framework/src/flux/connect'; @@ -73,11 +73,11 @@ class ShowMediatorInfoDialogComponent extends React.Component<ShowMediatorInfoDi <Dialog open={this.props.mode !== MediatorInfoDialogMode.None} onBackdropClick={this.props.onClose} > <DialogTitle>{this.props.config.Name}</DialogTitle> <DialogContent> - <TextField disabled margin="dense" id="deviceIp" label="Device IP" fullWidth defaultValue={this.props.config.DeviceIp} /> - <TextField disabled margin="dense" id="deviceport" label="Device Port" fullWidth defaultValue={this.props.config.DevicePort} /> - <TextField disabled margin="dense" id="status" label="Status" fullWidth defaultValue={this.state.status} /> - <TextField disabled margin="dense" id="deviceType" label="Device Type" fullWidth defaultValue={this.state.devicetype} /> - <TextField disabled margin="dense" id="ncPort" label="Netconf Port" fullWidth defaultValue={this.props.config.NcPort} /> + <TextField variant="standard" disabled margin="dense" id="deviceIp" label="Device IP" fullWidth defaultValue={this.props.config.DeviceIp} /> + <TextField variant="standard" disabled margin="dense" id="deviceport" label="Device Port" fullWidth defaultValue={this.props.config.DevicePort} /> + <TextField variant="standard" disabled margin="dense" id="status" label="Status" fullWidth defaultValue={this.state.status} /> + <TextField variant="standard" disabled margin="dense" id="deviceType" label="Device Type" fullWidth defaultValue={this.state.devicetype} /> + <TextField variant="standard" disabled margin="dense" id="ncPort" label="Netconf Port" fullWidth defaultValue={this.props.config.NcPort} /> <FormGroup> <FormControlLabel control={<Checkbox disabled defaultChecked={this.props.config.IsNCConnected}></Checkbox>} label="Netconf Connection" /> <FormControlLabel control={<Checkbox disabled defaultChecked={this.props.config.IsNeConnected}></Checkbox>} label="Network Element Connection" /> @@ -86,8 +86,8 @@ class ShowMediatorInfoDialogComponent extends React.Component<ShowMediatorInfoDi { this.props.config.ODLConfig.map((element, index) => <Panel title={"ODL config " + (this.props.config.ODLConfig.length > 1 ? index + 1 : '')} key={index} panelId={'panel-' + index} activePanel={this.state.activeOdlConfig} onToggle={(id: string) => { this.setState({ activeOdlConfig: (this.state.activeOdlConfig === id) ? "" : (id || "") }); }}> - <TextField disabled margin="dense" defaultValue={element.Protocol + '://' + element.Server} label="Server" /> - <TextField disabled margin="dense" defaultValue={element.Port} label="Port" /> + <TextField variant="standard" disabled margin="dense" defaultValue={element.Protocol + '://' + element.Server} label="Server" /> + <TextField variant="standard" disabled margin="dense" defaultValue={element.Port} label="Port" /> <FormControlLabel control={<Checkbox disabled checked={element.Trustall} />} label="Trustall" /> </Panel> ) @@ -95,7 +95,7 @@ class ShowMediatorInfoDialogComponent extends React.Component<ShowMediatorInfoDi </DialogContent> <DialogActions> - <Button onClick={this.onClose}>Close</Button> + <Button onClick={this.onClose} color="inherit">Close</Button> </DialogActions> </Dialog> ) diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorApplication.tsx b/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorApplication.tsx index fbf6d5774..da0ffa048 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorApplication.tsx +++ b/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorApplication.tsx @@ -16,17 +16,21 @@ * ============LICENSE_END========================================================================== */ import * as React from 'react'; -import { Theme, createStyles, WithStyles, withStyles, Tooltip } from '@material-ui/core'; +import { Theme, Tooltip } from '@mui/material'; -import AddIcon from '@material-ui/icons/Add'; -import IconButton from '@material-ui/core/IconButton'; -import EditIcon from '@material-ui/icons/Edit'; -import DeleteIcon from '@material-ui/icons/Delete'; -import InfoIcon from '@material-ui/icons/Info'; -import StartIcon from '@material-ui/icons/PlayArrow'; -import StopIcon from '@material-ui/icons/Stop'; +import { WithStyles } from '@mui/styles'; +import createStyles from '@mui/styles/createStyles'; +import withStyles from '@mui/styles/withStyles'; -import CircularProgress from '@material-ui/core/CircularProgress' +import AddIcon from '@mui/icons-material/Add'; +import IconButton from '@mui/material/IconButton'; +import EditIcon from '@mui/icons-material/Edit'; +import DeleteIcon from '@mui/icons-material/Delete'; +import InfoIcon from '@mui/icons-material/Info'; +import StartIcon from '@mui/icons-material/PlayArrow'; +import StopIcon from '@mui/icons-material/Stop'; + +import CircularProgress from '@mui/material/CircularProgress' import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; import connect, { Connect, IDispatcher } from '../../../../framework/src/flux/connect'; @@ -130,23 +134,34 @@ class MediatorApplicationComponent extends React.Component<MediatorApplicationCo const renderActions = (rowData: MediatorConfigResponse) => ( <> <div className={classes.spacer}> - <Tooltip title={"Start"} > - <IconButton disabled={rowData[BusySymbol]} className={classes.button}> + <Tooltip disableInteractive title={"Start"} > + <IconButton disabled={rowData[BusySymbol]} className={classes.button} size="large"> <StartIcon onClick={(event) => { event.preventDefault(); event.stopPropagation(); this.props.startMediator(rowData.Name); }} /> </IconButton> </Tooltip> - <Tooltip title={"Stop"} > - <IconButton disabled={rowData[BusySymbol]} className={classes.button}> + <Tooltip disableInteractive title={"Stop"} > + <IconButton disabled={rowData[BusySymbol]} className={classes.button} size="large"> <StopIcon onClick={(event) => { event.preventDefault(); event.stopPropagation(); this.props.stopMediator(rowData.Name); }} /> </IconButton> </Tooltip> </div> <div className={classes.spacer}> - <Tooltip title={"Info"} ><IconButton className={classes.button} onClick={(event) => { this.onOpenInfoDialog(event, rowData) }}><InfoIcon /></IconButton></Tooltip> + <Tooltip disableInteractive title={"Info"} ><IconButton + className={classes.button} + onClick={(event) => { this.onOpenInfoDialog(event, rowData) }} + size="large"><InfoIcon /></IconButton></Tooltip> </div> <div className={classes.spacer}> - {process.env.NODE_ENV === "development" ? <Tooltip title={"Edit"} ><IconButton disabled={rowData[BusySymbol]} className={classes.button} onClick={event => this.onOpenEditConfigurationDialog(event, rowData)}><EditIcon /></IconButton></Tooltip> : null} - <Tooltip title={"Remove"} ><IconButton disabled={rowData[BusySymbol]} className={classes.button} onClick={event => this.onOpenRemoveConfigutationDialog(event, rowData)}><DeleteIcon /></IconButton></Tooltip> + {process.env.NODE_ENV === "development" ? <Tooltip disableInteractive title={"Edit"} ><IconButton + disabled={rowData[BusySymbol]} + className={classes.button} + onClick={event => this.onOpenEditConfigurationDialog(event, rowData)} + size="large"><EditIcon /></IconButton></Tooltip> : null} + <Tooltip disableInteractive title={"Remove"} ><IconButton + disabled={rowData[BusySymbol]} + className={classes.button} + onClick={event => this.onOpenRemoveConfigutationDialog(event, rowData)} + size="large"><DeleteIcon /></IconButton></Tooltip> </div> </> ); diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorServerSelection.tsx b/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorServerSelection.tsx index be1ecc718..c44e2ccc1 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorServerSelection.tsx +++ b/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorServerSelection.tsx @@ -16,13 +16,17 @@ * ============LICENSE_END========================================================================== */ import * as React from 'react'; -import { WithStyles, withStyles, createStyles, Theme, Tooltip } from '@material-ui/core'; +import { Theme, Tooltip } from '@mui/material'; -import AddIcon from '@material-ui/icons/Add'; -import IconButton from '@material-ui/core/IconButton'; -import EditIcon from '@material-ui/icons/Edit'; -import DeleteIcon from '@material-ui/icons/Delete'; -import Refresh from '@material-ui/icons/Refresh'; +import { WithStyles } from '@mui/styles'; +import withStyles from '@mui/styles/withStyles'; +import createStyles from '@mui/styles/createStyles'; + +import AddIcon from '@mui/icons-material/Add'; +import IconButton from '@mui/material/IconButton'; +import EditIcon from '@mui/icons-material/Edit'; +import DeleteIcon from '@mui/icons-material/Delete'; +import Refresh from '@mui/icons-material/Refresh'; import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; import connect, { IDispatcher, Connect } from '../../../../framework/src/flux/connect'; @@ -105,31 +109,35 @@ class MediatorServerSelectionComponent extends React.Component<MediatorServerSel }); } }; - return ( - <> - <MediatorServersTable stickyHeader title={"Mediator"} customActionButtons={[refreshMediatorAction, addMediatorServerActionButton]} idProperty={"id"} - {...this.props.mediatorServersActions} {...this.props.mediatorServersProperties} columns={[ - { property: "name", title: "Name", type: ColumnType.text }, - { property: "url", title: "Url", type: ColumnType.text }, - { - property: "actions", title: "Actions", type: ColumnType.custom, customControl: ({ rowData }) => ( - <div className={classes.spacer}> - <Tooltip title={"Edit"} ><IconButton className={classes.button} onClick={event => { this.onEditMediatorServer(event, rowData); }}><EditIcon /></IconButton></Tooltip> - <Tooltip title={"Remove"} ><IconButton className={classes.button} onClick={event => { this.onRemoveMediatorServer(event, rowData); }}><DeleteIcon /></IconButton></Tooltip> - </div> - ) - } - ]} onHandleClick={this.onSelectMediatorServer} /> - <EditMediatorServerDialog - mediatorServer={this.state.mediatorServerToEdit} - mode={this.state.mediatorServerEditorMode} - onClose={this.onCloseEditMediatorServerDialog} /> - <RefreshMediatorDialog - mode={this.state.refreshMediatorEditorMode} - onClose={this.onCloseRefreshMediatorDialog} - /> - </> - ); + return <> + <MediatorServersTable stickyHeader title={"Mediator"} customActionButtons={[refreshMediatorAction, addMediatorServerActionButton]} idProperty={"id"} + {...this.props.mediatorServersActions} {...this.props.mediatorServersProperties} columns={[ + { property: "name", title: "Name", type: ColumnType.text }, + { property: "url", title: "Url", type: ColumnType.text }, + { + property: "actions", title: "Actions", type: ColumnType.custom, customControl: ({ rowData }) => ( + <div className={classes.spacer}> + <Tooltip disableInteractive title={"Edit"} ><IconButton + className={classes.button} + onClick={event => { this.onEditMediatorServer(event, rowData); }} + size="large"><EditIcon /></IconButton></Tooltip> + <Tooltip disableInteractive title={"Remove"} ><IconButton + className={classes.button} + onClick={event => { this.onRemoveMediatorServer(event, rowData); }} + size="large"><DeleteIcon /></IconButton></Tooltip> + </div> + ) + } + ]} onHandleClick={this.onSelectMediatorServer} /> + <EditMediatorServerDialog + mediatorServer={this.state.mediatorServerToEdit} + mode={this.state.mediatorServerEditorMode} + onClose={this.onCloseEditMediatorServerDialog} /> + <RefreshMediatorDialog + mode={this.state.refreshMediatorEditorMode} + onClose={this.onCloseRefreshMediatorDialog} + /> + </>; } public componentDidMount() { diff --git a/sdnr/wt/odlux/apps/mediatorApp/webpack.config.js b/sdnr/wt/odlux/apps/mediatorApp/webpack.config.js index 94943ecd5..f626632e2 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/webpack.config.js +++ b/sdnr/wt/odlux/apps/mediatorApp/webpack.config.js @@ -86,7 +86,7 @@ module.exports = (env) => { manifest: require(path.resolve(frameworkPath, "app-manifest.json")), sourceType: "umd2" }), - ...(env === "release") ? [ + ...(env === "release" ? [ new webpack.DefinePlugin({ "process.env": { NODE_ENV: "'production'", @@ -104,7 +104,7 @@ module.exports = (env) => { from: 'index.html', to: distPath }]), - ] + ]) ], devServer: { diff --git a/sdnr/wt/odlux/apps/minimumApp/package.json b/sdnr/wt/odlux/apps/minimumApp/package.json index 6c4193310..2c88f301b 100644 --- a/sdnr/wt/odlux/apps/minimumApp/package.json +++ b/sdnr/wt/odlux/apps/minimumApp/package.json @@ -21,20 +21,23 @@ "author": "Matthias Fischer", "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": "*" }, "peerDependencies": { - "@types/react": "17.0.3", - "@types/react-dom": "17.0.2", - "@types/react-router-dom": "5.1.7", - "@material-ui/core": "4.11.4", - "@material-ui/icons": "4.11.2", "@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.1", - "react-dom": "17.0.1", + "react": "17.0.2", + "react-dom": "17.0.2", "react-router-dom": "5.2.0" } -}
\ No newline at end of file +} diff --git a/sdnr/wt/odlux/apps/minimumApp/webpack.config.js b/sdnr/wt/odlux/apps/minimumApp/webpack.config.js index 64a534464..50b24e718 100644 --- a/sdnr/wt/odlux/apps/minimumApp/webpack.config.js +++ b/sdnr/wt/odlux/apps/minimumApp/webpack.config.js @@ -86,7 +86,7 @@ module.exports = (env) => { manifest: require(path.resolve(frameworkPath, "app-manifest.json")), sourceType: "umd2" }), - ...(env === "release") ? [ + ...(env === "release" ? [ new webpack.DefinePlugin({ "process.env": { NODE_ENV: "'production'", @@ -104,7 +104,7 @@ module.exports = (env) => { from: 'index.html', to: distPath }]), - ] + ]) ], devServer: { diff --git a/sdnr/wt/odlux/apps/networkMapApp/.babelrc b/sdnr/wt/odlux/apps/networkMapApp/.babelrc deleted file mode 100644 index 3d8cd1260..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/.babelrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "presets": [ - ["@babel/preset-react"], - ["@babel/preset-env", { - "targets": { - "chrome": "66" - }, - "spec": true, - "loose": false, - "modules": false, - "debug": false, - "useBuiltIns": "usage", - "forceAllTransforms": true - }] - ], - "plugins": [] -} diff --git a/sdnr/wt/odlux/apps/networkMapApp/icons/README.md b/sdnr/wt/odlux/apps/networkMapApp/icons/README.md deleted file mode 100644 index b26fbc29b..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/icons/README.md +++ /dev/null @@ -1,29 +0,0 @@ -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 diff --git a/sdnr/wt/odlux/apps/networkMapApp/icons/apartment.png b/sdnr/wt/odlux/apps/networkMapApp/icons/apartment.png Binary files differdeleted file mode 100644 index d4a1c5e7c..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/icons/apartment.png +++ /dev/null diff --git a/sdnr/wt/odlux/apps/networkMapApp/icons/apartment.png.d.ts b/sdnr/wt/odlux/apps/networkMapApp/icons/apartment.png.d.ts deleted file mode 100644 index bf398f5a4..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/icons/apartment.png.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const apartment: string; -export default apartment;
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/icons/customize.png b/sdnr/wt/odlux/apps/networkMapApp/icons/customize.png Binary files differdeleted file mode 100644 index 91dbf6824..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/icons/customize.png +++ /dev/null diff --git a/sdnr/wt/odlux/apps/networkMapApp/icons/customize.png.d.ts b/sdnr/wt/odlux/apps/networkMapApp/icons/customize.png.d.ts deleted file mode 100644 index 7bcffb2ca..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/icons/customize.png.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const customize: string; -export default customize;
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/icons/datacenter.png b/sdnr/wt/odlux/apps/networkMapApp/icons/datacenter.png Binary files differdeleted file mode 100644 index eb2a6278d..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/icons/datacenter.png +++ /dev/null diff --git a/sdnr/wt/odlux/apps/networkMapApp/icons/datacenter.png.d.ts b/sdnr/wt/odlux/apps/networkMapApp/icons/datacenter.png.d.ts deleted file mode 100644 index a58a9f5af..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/icons/datacenter.png.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const datacenter: string; -export default datacenter;
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/icons/datacenterred.png b/sdnr/wt/odlux/apps/networkMapApp/icons/datacenterred.png Binary files differdeleted file mode 100644 index 5d5a6c523..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/icons/datacenterred.png +++ /dev/null diff --git a/sdnr/wt/odlux/apps/networkMapApp/icons/datacenterred.png.d.ts b/sdnr/wt/odlux/apps/networkMapApp/icons/datacenterred.png.d.ts deleted file mode 100644 index 33f3061e2..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/icons/datacenterred.png.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const datacenterred: string; -export default datacenterred;
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/icons/factory.png b/sdnr/wt/odlux/apps/networkMapApp/icons/factory.png Binary files differdeleted file mode 100644 index a38781baa..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/icons/factory.png +++ /dev/null diff --git a/sdnr/wt/odlux/apps/networkMapApp/icons/factory.png.d.ts b/sdnr/wt/odlux/apps/networkMapApp/icons/factory.png.d.ts deleted file mode 100644 index b5c4f19d9..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/icons/factory.png.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const factory: string; -export default factory;
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/icons/factoryred.png b/sdnr/wt/odlux/apps/networkMapApp/icons/factoryred.png Binary files differdeleted file mode 100644 index 959603ab1..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/icons/factoryred.png +++ /dev/null diff --git a/sdnr/wt/odlux/apps/networkMapApp/icons/factoryred.png.d.ts b/sdnr/wt/odlux/apps/networkMapApp/icons/factoryred.png.d.ts deleted file mode 100644 index 1fac0a943..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/icons/factoryred.png.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const factoryRed: string; -export default factoryRed;
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/icons/lamp.png b/sdnr/wt/odlux/apps/networkMapApp/icons/lamp.png Binary files differdeleted file mode 100644 index f5ea00138..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/icons/lamp.png +++ /dev/null diff --git a/sdnr/wt/odlux/apps/networkMapApp/icons/lamp.png.d.ts b/sdnr/wt/odlux/apps/networkMapApp/icons/lamp.png.d.ts deleted file mode 100644 index 9634b1275..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/icons/lamp.png.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const lamp: string; -export default lamp;
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/icons/lampred.png b/sdnr/wt/odlux/apps/networkMapApp/icons/lampred.png Binary files differdeleted file mode 100644 index 4678ce91c..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/icons/lampred.png +++ /dev/null diff --git a/sdnr/wt/odlux/apps/networkMapApp/icons/lampred.png.d.ts b/sdnr/wt/odlux/apps/networkMapApp/icons/lampred.png.d.ts deleted file mode 100644 index 12a8f91cb..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/icons/lampred.png.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const lampred: string; -export default lampred;
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/package.json b/sdnr/wt/odlux/apps/networkMapApp/package.json deleted file mode 100644 index 160537045..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "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": { - "@odlux/framework": "*", - "@types/mapbox-gl": "^1.10.2", - "mapbox-gl": "^1.11.0", - "object.values": "^1.1.1" - }, - "peerDependencies": { - "@types/react": "17.0.3", - "@types/react-dom": "17.0.2", - "@types/react-router-dom": "5.1.7", - "@material-ui/core": "4.11.4", - "@material-ui/icons": "4.11.2", - "@types/classnames": "2.2.6", - "@types/flux": "3.1.8", - "@types/jquery": "3.3.10", - "jquery": "3.3.1", - "react": "17.0.1", - "react-dom": "17.0.1", - "react-router-dom": "5.2.0" - - } -} diff --git a/sdnr/wt/odlux/apps/networkMapApp/pom.xml b/sdnr/wt/odlux/apps/networkMapApp/pom.xml deleted file mode 100644 index b0349786a..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/pom.xml +++ /dev/null @@ -1,159 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ~ ============LICENSE_START======================================================= - ~ ONAP : ccsdk features - ~ ================================================================================ - ~ 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> - - <parent> - <groupId>org.onap.ccsdk.parent</groupId> - <artifactId>binding-parent</artifactId> - <version>2.3.2</version> - <relativePath/> - </parent> - - <groupId>org.onap.ccsdk.features.sdnr.wt</groupId> - <artifactId>sdnr-wt-odlux-app-networkMapApp</artifactId> - <version>1.3.0-SNAPSHOT</version> - <packaging>bundle</packaging> - - <name>ccsdk-features :: ${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> - - <dependencies> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>sdnr-wt-odlux-core-model</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>sdnr-wt-odlux-core-provider</artifactId> - <version>${project.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <sourceDirectory>src2/main/java</sourceDirectory> - <resources> - <resource> - <directory>dist</directory> - <targetPath>odlux</targetPath> - </resource> - <resource> - <directory>src2/main/resources</directory> - </resource> - <resource> - <directory>src2/test/resources</directory> - </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>org.codehaus.mojo</groupId> - <artifactId>build-helper-maven-plugin</artifactId> - <executions> - <execution> - <id>add-test-source</id> - <phase>generate-test-sources</phase> - <goals> - <goal>add-test-source</goal> - </goals> - <configuration> - <sources> - <source>src2/test/java</source> - </sources> - </configuration> - </execution> - </executions> - </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>v12.13.0</nodeVersion> - <yarnVersion>v1.22.10</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> diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/App.tsx b/sdnr/wt/odlux/apps/networkMapApp/src/App.tsx deleted file mode 100644 index 5840d1842..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/App.tsx +++ /dev/null @@ -1,32 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import * as React from 'react'; -import Map from './components/map/map' -import Details from './components/details/details' - -function MainView() { - return ( - <div className="App" style={{display: 'flex', flexDirection:'row', flexGrow:1, height:"100%"}}> - <Map /> - <Details /> - </div> - ); -} - -export default MainView; diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/actions/connectivityAction.ts b/sdnr/wt/odlux/apps/networkMapApp/src/actions/connectivityAction.ts deleted file mode 100644 index 63f52c8f9..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/actions/connectivityAction.ts +++ /dev/null @@ -1,63 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Action } from "../../../../framework/src/flux/action"; -import { Dispatch } from "../../../../framework/src/flux/store"; -import { IApplicationStoreState } from "../../../../framework/src/store/applicationStore"; - - -export class IsTopologyServerReachableAction extends Action{ - constructor(public reachable: boolean){ - super(); - } -} - -export class IsTileServerReachableAction extends Action{ - constructor(public reachable: boolean){ - super(); - } -} - -export class IsBusycheckingConnectivityAction extends Action{ - constructor(public isBusy: boolean){ - super(); - } -} - -export const verifyResponse = (response: Response) =>{ - - if(response.ok){ - return response - }else{ - throw Error(`Connection Error: ${response.status} | ${response.statusText} | ${response.url}`) - } -} - -export const handleConnectionError = (error: Error) => (dispatcher: Dispatch, getState: () => IApplicationStoreState)=>{ - const {network:{connectivity: {isToplogyServerAvailable}}} = getState(); - if(isToplogyServerAvailable){ - dispatcher(new IsTopologyServerReachableAction(false)) - } -} - -export const setTileServerReachableAction = (isReachable: boolean) => (dispatcher: Dispatch, getState: () => IApplicationStoreState)=>{ - const {network:{connectivity: {isTileServerAvailable}}} = getState(); - if(isReachable !== isTileServerAvailable){ - dispatcher(new IsTileServerReachableAction(isReachable)) - } -}
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/actions/detailsAction.ts b/sdnr/wt/odlux/apps/networkMapApp/src/actions/detailsAction.ts deleted file mode 100644 index a9bea4fc2..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/actions/detailsAction.ts +++ /dev/null @@ -1,161 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Action } from '../../../../framework/src/flux/action'; -import { requestRest } from '../../../../framework/src/services/restService'; - - -import { Site, Device } from "../model/site"; -import { link } from '../model/link'; -import { HistoryEntry } from "../model/historyEntry"; -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; -import { Dispatch } from '../../../../framework/src/flux/store'; -import { SITEDOC_URL } from '../config'; - -export class SelectSiteAction extends Action { - constructor(public site: Site){ - super() - } -} - -export class SelectLinkAction extends Action { - constructor(public link: link){ - super(); - } -} - -export class ClearDetailsAction extends Action{ - constructor(){ - super(); - } -} - -export class AddToHistoryAction extends Action { - constructor(public entry: HistoryEntry){ - super(); - } -} - -export class ClearHistoryAction extends Action { - constructor(){ - super(); - } -} - -export class IsBusyCheckingDeviceListAction extends Action{ - constructor(public isBusy: boolean){ - super(); - } -} - -export class FinishedLoadingDeviceListAction extends Action{ - constructor(public devices: Device[]){ - super(); - } -} - -export class ClearLoadedDevicesAction extends Action{ - constructor(){ - super(); - } -} - -export class InitializeLoadedDevicesAction extends Action{ - constructor(public devices: Device[]){ - super(); - } -} - -export class IsSitedocReachableAction extends Action{ - constructor(public isReachable: boolean){ - super(); - } -} - -let running=false; - -export const UpdateDetailsView = (nodeId: string) =>(dispatcher: Dispatch, getState: () => IApplicationStoreState) =>{ - const {network:{details:{checkedDevices}}} = getState(); - if(checkedDevices!==null){ - const index = checkedDevices.findIndex(item=>item.name===nodeId) - if(index!==-1) - requestRest<any>("/rests/operational/network-topology:network-topology/topology/topology-netconf/node/"+nodeId, { method: "GET" }) - .then(result =>{ - if(result!==null){ - checkedDevices[index].status = result.node[0]["netconf-node-topology:connection-status"]; - - }else{ - checkedDevices[index].status = "Not connected"; - } - dispatcher(new FinishedLoadingDeviceListAction(checkedDevices)); - - }); - } -} - -export const CheckDeviceList = (list: Device[]) => async (dispatcher: Dispatch, getState: () => IApplicationStoreState) =>{ -if(running) return; -running=true; - dispatcher(new IsBusyCheckingDeviceListAction(true)); - - const promises = list.map((device)=>{ - if(device.name){ - return requestRest<any>("/rests/data/network-topology:network-topology/topology=topology-netconf/node="+device.name, { method: "GET" }) - }else{ - return device; - } - - }) - - Promise.all(promises).then((result)=>{ - running=false; - - - result.forEach((res: any, index)=>{ - if(res !==null && res["network-topology:node"]){ - list[index].status = res["network-topology:node"][0]["netconf-node-topology:connection-status"]; - }else{ - list[index].status = "Not connected"; - } - }); - - dispatcher(new FinishedLoadingDeviceListAction(list)); - dispatcher(new IsBusyCheckingDeviceListAction(false)); - - }) - .catch(err=>{ - console.error(err); - - dispatcher(new IsBusyCheckingDeviceListAction(false)); - - }); -} - -export const checkSitedockReachablity = () => async (dispatcher: Dispatch, getState: () => IApplicationStoreState) =>{ - console.log("searching for sitedoc server...") - requestRest<any>(SITEDOC_URL+'/app/versioninfo').then(response =>{ - console.log(response); - if(response){ - - dispatcher(new IsSitedocReachableAction(true)); - - }else{ - dispatcher(new IsSitedocReachableAction(false)); - } - }) -}
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/actions/mapActions.ts b/sdnr/wt/odlux/apps/networkMapApp/src/actions/mapActions.ts deleted file mode 100644 index 9830c06e4..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/actions/mapActions.ts +++ /dev/null @@ -1,84 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Action } from '../../../../framework/src/flux/action'; -import { Dispatch } from '../../../../framework/src/flux/store'; - - -import { link } from "../model/link"; -import { Site } from "../model/site"; -import { Feature } from '../model/Feature'; -import { URL_API } from '../config'; - - -export class HighlightLinkAction extends Action{ - constructor(public link: link){ - super(); - } -} - -export class HighlightSiteAction extends Action{ - constructor(public site: Site){ - super(); - } -} - -export class RemoveHighlightingAction extends Action { - constructor(){ - super(); - } -} - -export class ZoomToSearchResultAction extends Action{ - constructor(public lat: number, public lon: number){ - super(); - } -} - -export class AddAlarmAction extends Action{ - constructor(public site: Site){ - super(); - } -} - -export class SetCoordinatesAction extends Action{ - constructor(public lat: number, public lon: number, public zoom: number){ - super(); - } -} - -export class SetStatistics extends Action{ - constructor(public siteCount: string, public linkCount: string){ - super(); - } -} - -export class SetIconSwitchAction extends Action{ - constructor(public enable:boolean){ - super(); - } -} - -export const findSiteToAlarm = (alarmedNodeId: string) => (dispatcher: Dispatch) =>{ - //TODO: fix! - fetch(URL_API+"/sites/devices/"+alarmedNodeId) - .then(res => res.json()) - .then(result=>{ - dispatcher(new AddAlarmAction(result)); - }); -}
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/actions/popupActions.ts b/sdnr/wt/odlux/apps/networkMapApp/src/actions/popupActions.ts deleted file mode 100644 index a8c54d4df..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/actions/popupActions.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { PopupElement } from '../model/popupElements'; -import { Action } from '../../../../framework/src/flux/action'; - -export class SetPopupPositionAction extends Action { - constructor(public top: number, public left: number){ - super() - } -} - -export class SelectMultipleLinksAction extends Action { - constructor(public elements: PopupElement[]) { - super(); - } -} - - - -export class SelectMultipleSitesAction extends Action { - constructor(public elements: PopupElement[]) { - super(); - } -}
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/actions/searchAction.ts b/sdnr/wt/odlux/apps/networkMapApp/src/actions/searchAction.ts deleted file mode 100644 index a553319da..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/actions/searchAction.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Action } from '../../../../framework/src/flux/action'; - -export class SetSearchValueAction extends Action{ - constructor(public value: string){ - super(); - } -} diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/actions/settingsAction.ts b/sdnr/wt/odlux/apps/networkMapApp/src/actions/settingsAction.ts deleted file mode 100644 index 5b8982368..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/actions/settingsAction.ts +++ /dev/null @@ -1,85 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { NetworkMapSettings, NetworkMapThemes, NetworkSettings } from '../model/settings'; -import { Action } from '../../../../framework/src/flux/action'; -import { Dispatch } from '../../../../framework/src/flux/store'; -import { settingsService } from '../services/settingsService'; - -export class SetMapSettingsAction extends Action{ - - constructor(public settings:NetworkMapSettings) { - super(); - } -} - -export class SetThemeSettingsAction extends Action{ - - constructor(public settings:NetworkMapThemes) { - super(); - } -} - -export class SetSettingsAction extends Action{ - - constructor(public settings:NetworkSettings) { - super(); - } -} - -export class SetBusyLoadingAction extends Action{ - - constructor(public busy: boolean) { - super(); - - } -} - - -export const getSettings = () => async (dispatcher: Dispatch) => { - dispatcher(new SetBusyLoadingAction(true)); - console.log("getting settings in action..") - settingsService.getMapSettings().then(result =>{ - if(result){ - if(result.networkMap && result.networkMapThemes){ - const mapSettings : NetworkSettings = { networkMap: result.networkMap, networkMapThemes: result.networkMapThemes} - dispatcher(new SetSettingsAction(mapSettings)); - }else if(result.networkMap){ - dispatcher(new SetMapSettingsAction(result)); - }else if(result.networkMapThemes){ - dispatcher(new SetThemeSettingsAction(result)); - } - } - else{ - console.warn("settings couldn't be loaded."); - } - dispatcher(new SetBusyLoadingAction(false)); - }); -} - -export const updateSettings = (mapSettings: NetworkMapSettings) => async (dispatcher: Dispatch) =>{ - - const result = await settingsService.updateMapSettings(mapSettings); - console.log("update settings"); - dispatcher(new SetMapSettingsAction(mapSettings)); - - console.log(result); - if(result){ - } - -} diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/components/customize/customizationView.tsx b/sdnr/wt/odlux/apps/networkMapApp/src/components/customize/customizationView.tsx deleted file mode 100644 index 82e7b795b..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/components/customize/customizationView.tsx +++ /dev/null @@ -1,291 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Button, Grid, InputLabel, makeStyles, MenuItem, Select, Slider, TextField, Typography } from '@material-ui/core'; -import { NetworkMapSettings, ThemeElement } from '../../model/settings'; -import * as React from 'react' -import connect, { Connect, IDispatcher } from '../../../../../framework/src/flux/connect'; -import { IApplicationStoreState } from '../../../../../framework/src/store/applicationStore'; -import { updateSettings } from '../../actions/settingsAction'; -import ThemeEntry from './themeElement' -import * as mapboxgl from 'mapbox-gl'; -import { OSM_STYLE } from '../../config'; -import mapLayerService from '../../utils/mapLayers'; -import { requestRest } from '../../../../../framework/src/services/restService'; -import { NavigateToApplication } from '../../../../../framework/src/actions/navigationActions'; - -type props = Connect<typeof mapProps, typeof mapDispatch>; -let map: mapboxgl.Map; -let myMapRef = React.createRef<HTMLDivElement>(); -const default_boundingbox = "12.882544785787754,52.21421979821472,13.775455214211949,52.80406241672602"; - - -const mapProps = (state: IApplicationStoreState) => ({ - settings: state.network.settings, -}); - -const mapDispatch = (dispatcher: IDispatcher) => ({ - updateSettings: (mapSettings: NetworkMapSettings) => dispatcher.dispatch(updateSettings(mapSettings)), - navigateToApplication: (applicationName: string) => dispatcher.dispatch(new NavigateToApplication(applicationName)), - - -}); - -const styles = makeStyles({ - sectionMargin: { - marginTop: "30px", - marginBottom: "15px" - }, - elementMargin: { - - marginLeft: "10px" - } -}); - -const CustomizationView: React.FunctionComponent<props> = (props) => { - - const [opacity, setOpacity] = React.useState(Number(props.settings.mapSettings?.networkMap.tileOpacity) || 100); - const [theme, setTheme] = React.useState(props.settings.mapSettings?.networkMap.styling.theme || ''); - const [latitude, setLatitude] = React.useState<number>(Number(props.settings.mapSettings?.networkMap.startupPosition.latitude)|| 52.5); - const [longitude, setLongitude] = React.useState<number>(Number(props.settings.mapSettings?.networkMap.startupPosition.longitude)|| 13.35); - const [zoom, setZoom] = React.useState<number>(Number(props.settings.mapSettings?.networkMap.startupPosition.zoom) || 10); - - - //used to make opacity available within the map event-listeners - //(hook state values are snapshotted at initalization and not updated afterwards, thus use a ref here) - const myOpacityRef = React.useRef(opacity); - const setOpacityState = (data:any) => { - myOpacityRef.current = data; - setOpacity(data); - }; - - const classes = styles(); - const currentTheme = props.settings.themes.networkMapThemes.themes.find(el => el.key === theme); - - - React.useEffect(() => { - mapLayerService.settings = props.settings.themes; - - map = new mapboxgl.Map({ - container: myMapRef.current!, - style: OSM_STYLE as any, - center: [longitude, latitude], - zoom: zoom, - accessToken: '' - }); - - map.on('load', (ev) => { - - mapLayerService.addBaseSources(map, null, null); - if(props.settings.mapSettings?.networkMap.styling.theme !== theme){ - mapLayerService.addBaseLayers(map, currentTheme); - - }else{ - mapLayerService.addBaseLayers(map); - } - - mapLayerService.changeMapOpacity(map, myOpacityRef.current); - - getData(); - }); - - map.on('moveend', () => { - const center = map.getCenter(); - setZoom(Number(map.getZoom().toFixed(4))); - setLatitude(Number(center.lat.toFixed(4))); - setLongitude(Number(center.lng.toFixed(4))); - }); - - }, []); - - React.useEffect(() => { - recenterMap(); - }, [latitude, longitude, zoom]); - - const setState = () => { - if (props.settings.mapSettings?.networkMap.styling) { - setTheme(props.settings.mapSettings.networkMap.styling.theme); - mapLayerService.changeTheme(map, props.settings.mapSettings.networkMap.styling.theme); - } - - const propOpacity = props.settings.mapSettings?.networkMap.tileOpacity; - if (propOpacity) { - setOpacityState(propOpacity); - } - } - - React.useEffect(() => { - setState(); - }, [props.settings.mapSettings]); - - const onOpacityChange = (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>, newValue: number) => { - setOpacity(newValue); - mapLayerService.changeMapOpacity(map, newValue); - - }; - - const onChangeTheme = (e: any) => { - - const newTheme = e.target.value; - setTheme(newTheme); - mapLayerService.changeTheme(map, newTheme); - } - - const onCancel = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => { - e.preventDefault(); - props.navigateToApplication("network"); - } - - const onSaveSettings = async (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => { - e.preventDefault(); - - const updatedSettings: NetworkMapSettings = { - networkMap: { - tileOpacity: opacity.toString(), - styling: { theme: theme }, - startupPosition: { - latitude: latitude.toString(), - longitude: longitude.toString(), - zoom: zoom.toString() - } - } - }; - - console.log(updatedSettings); - - await props.updateSettings(updatedSettings) - props.navigateToApplication("network"); - - } - - const recenterMap = () => { - - if (!isNaN(latitude) && !isNaN(longitude) && !isNaN(zoom)) - - map.flyTo({ - center: [ - longitude, - latitude - ], zoom: zoom, - essential: false - }); - } - - - - const getData = () => { - - //get data of boundingbox from networkmap - - const links = requestRest<any>("/topology/network/links/geojson/" + default_boundingbox); - const sites = requestRest<any>("/topology/network/sites/geojson/" + default_boundingbox); - - Promise.all([links, sites]).then(results => { - if (map.getSource('lines')) { - (map.getSource('lines') as mapboxgl.GeoJSONSource).setData(results[0]); - } - - if (map.getSource('points')) { - (map.getSource('points') as mapboxgl.GeoJSONSource).setData(results[1]); - } - - if (map.getSource('selectedPoints')) { - (map.getSource('selectedPoints') as mapboxgl.GeoJSONSource).setData(results[1].features[0]); - } - }); - } - - /** - * Style property names to readable text - * @param text propretyName - * @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 style={{ display: 'flex', flexDirection: 'row', flexGrow: 1, height: "100%", position: 'relative' }}> - <div style={{ width: "60%", flexDirection: 'column', position:'relative' }}> - <Typography variant="body1" style={{ fontWeight: "bold" }} gutterBottom>Startup Position</Typography> - <div style={{ display: 'flex', flexDirection: 'row' }}> - <TextField type="number" value={latitude} onChange={(e) => setLatitude(e.target.value as any)} style={{ marginLeft: 10 }} label="Latitude" /> - <TextField type="number" value={longitude} onChange={(e) => setLongitude(e.target.value as any)} style={{ marginLeft: 5 }} label="Longitude" /> - <TextField type="number" value={zoom} onChange={(e) => setZoom(e.target.value as any)} style={{ marginLeft: 5 }} label="Zoom" /> - </div> - - <Typography className={classes.sectionMargin} variant="body1" style={{ fontWeight: "bold" }} gutterBottom> - Tile Opacity - </Typography> - <Grid className={classes.elementMargin} container spacing={2} style={{ width: '50%' }}> - <Grid item>0</Grid> - <Grid item xs> - <Slider color="secondary" min={0} max={100} value={opacity} onChange={onOpacityChange} aria-labelledby="continuous-slider" /> - </Grid> - <Grid item>100</Grid> - </Grid> - - <Typography className={classes.sectionMargin} variant="body1" style={{ fontWeight: "bold" }} gutterBottom> - Style of properties - </Typography> - <InputLabel id="theme-select-label">Theme</InputLabel> - <Select - className={classes.elementMargin} - value={theme} - onChange={onChangeTheme} - labelId="theme-select-label" - style={{ marginLeft: 10 }}> - { - props.settings.themes.networkMapThemes.themes.map(el => <MenuItem value={el.key}>{el.key}</MenuItem>) - } - - </Select> - - { - currentTheme && <div style={{ marginLeft: 60 }}> - { //skip the 'key' (theme name) entry - Object.keys(currentTheme).slice(1).map(el => <ThemeEntry text={styleText(el)} color={(currentTheme as any)[el]} />) - } - </div> - } - - - <div className={classes.sectionMargin} style={{ position: 'absolute', right: 0, top: '60%' }}> - <Button className={classes.elementMargin} variant="contained" - color="primary" onClick={onCancel}>Cancel</Button> - - <Button className={classes.elementMargin} variant="contained" - color="secondary" onClick={onSaveSettings}>Save</Button> - </div> - </div> - <div id="map" ref={myMapRef} style={{ width: "35%", height: "50%" }}> - - </div> - </div> - - </>) - -} - -export default connect(mapProps, mapDispatch)(CustomizationView); - - diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/components/customize/themeElement.tsx b/sdnr/wt/odlux/apps/networkMapApp/src/components/customize/themeElement.tsx deleted file mode 100644 index c991aaf63..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/components/customize/themeElement.tsx +++ /dev/null @@ -1,47 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Typography } from '@material-ui/core'; -import * as React from 'react' - - -type props={ - color: string, - text: string -}; - -const ThemeEntry = (props: props) =>{ - - var 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> - -} - -export default ThemeEntry;
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/components/denseTable.tsx b/sdnr/wt/odlux/apps/networkMapApp/src/components/denseTable.tsx deleted file mode 100644 index e04fda547..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/components/denseTable.tsx +++ /dev/null @@ -1,139 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import * as React from 'react'; -import Table from '@material-ui/core/Table'; -import TableBody from '@material-ui/core/TableBody'; -import TableCell from '@material-ui/core/TableCell'; -import TableContainer from '@material-ui/core/TableContainer'; -import TableHead from '@material-ui/core/TableHead'; -import TableRow from '@material-ui/core/TableRow'; -import Paper from '@material-ui/core/Paper'; -import { makeStyles, Button, Tooltip } from '@material-ui/core'; - -type props = { headers: string[], - height: number, - navigate?(applicationName: string, path?: string): void, - onLinkClick?(id: string): void, data: any[], - hover: boolean, - ariaLabelRow: string, - ariaLabelColumn?: string[], - verticalTable?: boolean, - onClick?(id: string): void, - actions?: boolean }; - - -const styles = makeStyles({ - container: { - overflow: "auto" - }, - button: { - margin: 0, - padding: "6px 6px", - minWidth: 'unset' - } - -}); - - -const DenseTable: React.FunctionComponent<props> = (props) => { - - const classes = styles(); - - const handleClick = (event: any, id: string) => { - event.preventDefault(); - props.onClick !== undefined && props.onClick(id); - - } - - const handleHover = (event: any, id: string) => { - event.preventDefault(); - - } - - return ( - <Paper style={{ borderRadius: "0px" }}> - <div style={{ height: props.height, overflow: "auto" }}> - <Table stickyHeader size="small" aria-label="a dense table" > - <TableHead> - <TableRow> - { - props.headers.map((data) => { - return <TableCell>{data}</TableCell> - }) - } - </TableRow> - </TableHead> - <TableBody> - {props.data.map((row, index) => { - var values = Object.keys(row).map(function (e) { return row[e]; }); - return ( - <TableRow aria-label={props.ariaLabelRow} key={index} hover={props.hover} onMouseOver={e => handleHover(e, row.name)} onClick={e => handleClick(e, row.name)}> - - { - values.map((data: any, i) => { - if (data !== undefined) { - - if (!props.verticalTable) { - const ariaLabel = props.ariaLabelColumn === undefined ? props.headers[i].toLowerCase() : props.ariaLabelColumn[i]; - if (ariaLabel.length > 0) { - return <TableCell aria-label={ariaLabel}>{data}</TableCell> - } else { - return <TableCell>{data}</TableCell> - } - } - else { - // skip adding aria label to 'header' column - if (i === 0) { - return <TableCell>{data}</TableCell> - } else { - const ariaLabel = props.ariaLabelColumn === undefined ? props.headers[index].toLowerCase() : props.ariaLabelColumn[index]; - return <TableCell aria-label={ariaLabel}>{data}</TableCell> - } - } - } - else - return null; - }) - } - { - - props.actions && <TableCell > - <div style={{ display: "flex" }}> - <Tooltip title="Configure"> - <Button className={classes.button} disabled={row.status !== "connected"} onClick={(e: any) => { e.preventDefault(); e.stopPropagation(); props.navigate && props.navigate("configuration", row.simulatorId ? row.simulatorId : row.name) }}>C</Button> - </Tooltip> - <Tooltip title="Fault"> - <Button className={classes.button} disabled={row.status !== "connected"} onClick={(e: any) => { e.preventDefault(); e.stopPropagation(); props.navigate && props.navigate("fault", row.simulatorId ? row.simulatorId : row.name) }}>F</Button> - </Tooltip> - </div> - </TableCell> - } - </TableRow>) - }) - } - - </TableBody> - </Table> - </div> - </Paper> - ); - -} - -export default DenseTable;
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/components/details/details.tsx b/sdnr/wt/odlux/apps/networkMapApp/src/components/details/details.tsx deleted file mode 100644 index 2540b20a7..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/components/details/details.tsx +++ /dev/null @@ -1,204 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import * as React from 'react' - -import connect, { IDispatcher, Connect } from '../../../../../framework/src/flux/connect'; - -import { Site, Device } from '../../model/site'; -import Typography from '@material-ui/core/Typography'; -import { link } from '../../model/link'; -import { Breadcrumbs, Link, Paper } from '@material-ui/core'; -import SiteDetails from './siteDetails'; -import LinkDetails from './linkDetails'; -import { URL_API, URL_BASEPATH } from '../../config'; -import { SelectSiteAction, SelectLinkAction, AddToHistoryAction, ClearHistoryAction, CheckDeviceList, ClearDetailsAction } from '../../actions/detailsAction'; -import { HistoryEntry } from '../../model/historyEntry'; -import { HighlightLinkAction, HighlightSiteAction, RemoveHighlightingAction } from '../../actions/mapActions'; -import { isSite } from '../../utils/utils'; -import { IApplicationStoreState } from '../../../../../framework/src/store/applicationStore'; -import { NavigateToApplication } from '../../../../../framework/src/actions/navigationActions'; -import { RouteComponentProps, withRouter } from 'react-router-dom'; - - -const Details: React.FunctionComponent<porps> = (props) => { - - const [message, setMessage] = React.useState("No data selected."); - - - //on mount - React.useEffect(() => { - const detailsId = getDetailsIdFromUrl(); - if (detailsId !== null && props.data?.name !== detailsId) { - loadDetailsData(detailsId) - } - - }, []); - - // if url changed, load details data - React.useEffect(() => { - const detailsId = getDetailsIdFromUrl(); - if (detailsId !== null && props.data?.name !== detailsId) { - loadDetailsData(detailsId) - } - else if(detailsId===null){ - setMessage("No data selected."); - props.clearDetails(); - props.undoMapSelection(); - } - - }, [props.location.pathname]); - - //update url if new element loaded - React.useEffect(() => { - if (props.data !== null) { - const currentUrl = window.location.href; - const parts = currentUrl.split(URL_BASEPATH); - const detailsPath = parts[1].split("/details/"); - props.history.replace(`/${URL_BASEPATH}${detailsPath[0]}/details/${props.data.name}`) - } - - }, [props.data]) - - const onLinkClick = async (id: string) => { - const result = await fetch(`${URL_API}/links/${id}`); - if(result.ok){ - const resultAsJson = await result.json(); - const link = resultAsJson as link; - props.selectLink(link); - props.addHistory({ id: props.data!.name, data: props.data! }); - props.highlightLink(link); - - } - } - - const backClick = (e: any) => { - if (isSite(props.breadcrumbs[0].data)) { - props.selectSite(props.breadcrumbs[0].data) - props.highlightSite(props.breadcrumbs[0].data); - - } else { - props.selectLink(props.breadcrumbs[0].data); - props.highlightLink(props.breadcrumbs[0].data); - - } - - props.clearHistory(); - e.preventDefault(); - } - - const createDetailPanel = (data: Site | link) => { - if (isSite(data)) { - return <SiteDetails site={data} onLinkClick={onLinkClick} /> - } else { - return <LinkDetails link={data} /> - } - } - - const getDetailsIdFromUrl = () =>{ - const currentUrl = window.location.href; - const parts = currentUrl.split(URL_BASEPATH); - const detailsPath = parts[1].split("/details/") - return detailsPath[1] ? detailsPath[1] : null; - } - - const loadDetailsData = (id: string) =>{ - - fetch(`${URL_API}/links/${id}`) - .then(res => { - if (res.ok) - return res.json() - else - return Promise.reject() - - }) - .then(result => { - props.selectLink(result) - props.highlightLink(result); - - }) - .catch(error => { - - fetch(`${URL_API}/sites/name/${id}`) - .then(res => { - if (res.ok) - return res.json() - else return Promise.reject(); - }) - .then(result => { - props.selectSite(result); - props.highlightSite(result); - }) - .catch(error =>{ - setMessage("No element with name " + id + " found"); - props.clearDetails(); - props.undoMapSelection(); - }); - }) - } - - const panelId = props.data!== null ? (isSite(props.data) ? 'site-details-panel' : 'link-details-panel' ): 'details-panel'; - - return (<div style={{ width: '30%', background: "#bbbdbf", padding: "20px", alignSelf:"stretch" }}> - <Paper style={{ height:"100%"}} id={panelId} aria-label={panelId} > - { - props.breadcrumbs.length > 0 && - <Breadcrumbs style={{ marginLeft: "15px", marginTop: "5px" }} aria-label="breadcrumbs-navigation"> - <Link aria-label="parent-element" color="inherit" href="/" onClick={backClick}> - {props.breadcrumbs[0].id} - </Link> - <Link aria-label="child-element" color="textSecondary"> - {props.data?.name} - </Link> - </Breadcrumbs> - } - { - props.data !== null ? - createDetailPanel(props.data) - : <Typography aria-label="details-panel-alt-message" style={{ marginTop: "5px" }} align="center" variant="body1">{message}</Typography> - - } - </Paper> - </div>) -} - -type porps = RouteComponentProps & Connect<typeof mapStateToProps, typeof mapDispatchToProps>; - -//select always via details? -const mapStateToProps = (state: IApplicationStoreState) => ({ - data: state.network.details?.data, - breadcrumbs: state.network.details.history, - updatedDevices: state.network.details.checkedDevices -}); - -const mapDispatchToProps = (dispatcher: IDispatcher) => ({ - selectSite: (site: Site) => dispatcher.dispatch(new SelectSiteAction(site)), - selectLink: (link: link) => dispatcher.dispatch(new SelectLinkAction(link)), - clearDetails: () => dispatcher.dispatch(new ClearDetailsAction()), - addHistory: (newEntry: HistoryEntry) => dispatcher.dispatch(new AddToHistoryAction(newEntry)), - clearHistory: () => dispatcher.dispatch(new ClearHistoryAction()), - highlightLink: (link: link) => dispatcher.dispatch(new HighlightLinkAction(link)), - highlightSite: (site: Site) => dispatcher.dispatch(new HighlightSiteAction(site)), - loadDevices: async (networkElements: Device[]) => { await dispatcher.dispatch(CheckDeviceList(networkElements)) }, - navigateToApplication: (applicationName: string, path?: string) => dispatcher.dispatch(new NavigateToApplication(applicationName, path, "test3")), - undoMapSelection: () => dispatcher.dispatch(new RemoveHighlightingAction()) - -}) - - -export default withRouter(connect(mapStateToProps, mapDispatchToProps)(Details));
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/components/details/linkDetails.tsx b/sdnr/wt/odlux/apps/networkMapApp/src/components/details/linkDetails.tsx deleted file mode 100644 index 96727cc0d..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/components/details/linkDetails.tsx +++ /dev/null @@ -1,130 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import * as React from 'react'; - -import { link } from '../../model/link'; -import { TextField, Tabs, Tab, Typography, AppBar, Button, Link } from '@material-ui/core'; -import DenseTable from '../denseTable'; -import { LatLonToDMS } from '../../utils/mapUtils'; - -type panelId = "siteA" | "siteB"; -type props = { link: link }; - -const LinkDetails: React.FunctionComponent<props> = (props) => { - - const [value, setValue] = React.useState<panelId>("siteA"); - const [height, setHeight] = React.useState(330); - - const handleResize = () =>{ - const el = document.getElementById('link-details-panel')?.getBoundingClientRect(); - const el2 = document.getElementById('site-tabs')?.getBoundingClientRect(); - - if(el && el2){ - if(props.link.type==="microwave") - setHeight(el!.height - el2!.y -50); - else - setHeight(el!.height - el2!.y +20); - - } - } - - //on mount - React.useEffect(()=>{ - handleResize(); - - //window.addEventListener("resize", handleResize); - },[]); - - React.useEffect(()=>{ - handleResize(); - }, [props.link]) - - const onHandleTabChange = (event: React.ChangeEvent<{}>, newValue: panelId) => { - setValue(newValue); - } - - const onCalculateLinkClick = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) =>{ - e.preventDefault(); - const siteA= props.link.locationA; - const siteB =props.link.locationB; - const nameA = props.link.siteA; - const nameB = props.link.siteB; - const distance = props.link.length > 0 ? props.link.length : props.link.calculatedLength; - const azimuthA = props.link.azimuthA; - const azimuthB = props.link.azimuthB; - const antennaA = props.link.locationA.antenna; - const antennaB = props.link.locationB.antenna; - - - let antennaData = ""; - if(antennaA!==null && antennaB!==null){ - antennaData = `&antennaNameA=${antennaA.name}&antennaGainA=${antennaA.gain}&waveguideLossA=${antennaA.waveguideLossIndB}&antennaNameB=${antennaB.name}&antennaGainB=${antennaB.gain}&waveguideLossB=${antennaB.waveguideLossIndB}`; - } - - - - const baseUrl = window.location.pathname.split('#')[0]; - window.open(`${baseUrl}#/linkCalculation?lat1=${siteA.lat}&lon1=${siteA.lon}&lat2=${siteB.lat}&lon2=${siteB.lon}&siteA=${nameA}&siteB=${nameB}&azimuthA=${azimuthA}&azimuthB=${azimuthB}&distance=${distance}&amslSiteA=${siteA.amsl}&AGLsiteA=${siteA.antennaHeight}&amslSiteB=${siteB.amsl}&AGLsiteB=${siteB.antennaHeight}${antennaData}`) - - } - - const onLineofSightClick = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) =>{ - e.preventDefault(); - - const siteA= props.link.locationA; - const siteB =props.link.locationB; - - //TODO: add check if available - let heightPart = `&amslA=${siteA.amsl}&antennaHeightA=${siteA.antennaHeight}&amslB=${siteB.amsl}&antennaHeightB=${siteB.antennaHeight}`; - - - const baseUrl = window.location.pathname.split('#')[0]; - window.open(`${baseUrl}#/lineofsight/los?lat1=${siteA.lat}&lon1=${siteA.lon}&lat2=${siteB.lat}&lon2=${siteB.lon}${heightPart}`); - } - - const data = [ - - {name:"Site Name", val1: props.link.siteA, val2: props.link.siteB}, - {name:"Latitude", val1: LatLonToDMS(props.link.locationA.lat), val2: LatLonToDMS(props.link.locationB.lat)}, - {name:"Longitude", val1: LatLonToDMS(props.link.locationA.lon, true), val2: LatLonToDMS(props.link.locationB.lon, true)}, - props.link.azimuthA!= null && props.link.azimuthB != null && {name:"Azimuth in °", val1: props.link.azimuthA.toFixed(2), val2: props.link.azimuthB.toFixed(2)} -]; - - return (<div style={{ paddingLeft: "15px", paddingRight: "15px", paddingTop: "0px", display: 'flex', flexDirection: 'column' }}> - <h2>{props.link.name}</h2> - <TextField inputProps={{ 'aria-label': 'operator' }} disabled style={{ marginTop: "5px" }} value="Unkown" label="Operator" /> - <TextField inputProps={{ 'aria-label': 'type' }} disabled style={{ marginTop: "5px" }} value={props.link.type} label="Type" /> - <TextField inputProps={{ 'aria-label': 'planned-distance-in-km' }} disabled style={{ marginTop: "5px" }} value={props.link.length.toFixed(2)} label="Distance planned in km" /> - <TextField inputProps={{ 'aria-label': 'calculated-distance-in-km' }} disabled style={{ marginTop: "5px" }} value={props.link.calculatedLength.toFixed(2)} label="Distance calculated in km" /> - - <AppBar position="static" id="site-tabs" style={{ marginTop: "20px", background: '#2E3B55' }}> - <Typography aria-label="details-of-link-sites" style={{ margin:"5px"}}>SITE DETAILS</Typography> - </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.type==="microwave" &&<> - <Button style={{marginTop:20}} fullWidth variant="contained" color="primary" onClick={onCalculateLinkClick}>Calculate link</Button> - <Button style={{marginTop:20}} fullWidth variant="contained" color="primary" onClick={onLineofSightClick}>Line of Sight</Button> - - </> - } - </div>) -} - -export default LinkDetails;
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/components/details/siteDetails.tsx b/sdnr/wt/odlux/apps/networkMapApp/src/components/details/siteDetails.tsx deleted file mode 100644 index 7f0c1c926..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/components/details/siteDetails.tsx +++ /dev/null @@ -1,248 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import * as React from 'react'; -import { TextField, Tabs, Tab, Typography, AppBar, Button, Tooltip } from '@material-ui/core'; - - -import MaterialTable, { ColumnModel, ColumnType, MaterialTableCtorType } from "../../../../../framework/src/components/material-table"; - - -import { Site, Device, Address } from '../../model/site'; -import DenseTable from '../denseTable'; -import { LatLonToDMS } from '../../utils/mapUtils'; -import { CheckDeviceList, InitializeLoadedDevicesAction } from '../../actions/detailsAction'; -import { NavigateToApplication } from '../../../../../framework/src/actions/navigationActions'; -import connect, { Connect, IDispatcher } from '../../../../../framework/src/flux/connect'; -import { IApplicationStoreState } from '../../../../../framework/src/store/applicationStore'; -import StadokSite from '../../model/stadokSite'; -import { requestRest } from '../../../../../framework/src/services/restService'; -import StadokDetailsPopup from './stadokDetailsPopup'; - -type linkRow = { name: string, azimuth?: string} -type deviceRow = { id: string;type: string,name: string,manufacturer: string,owner: string,status?: string,port: number[]} - - -type panelId="links" | "nodes"; -type siteDetailProps = { - site: Site, - onLinkClick(id: string): void, -} & props; - -type props = Connect<typeof mapStateToProps, typeof mapDispatchToProps>; - - -const SiteDetails: React.FunctionComponent<siteDetailProps> = (props) => { - - 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 handleResize = () =>{ - const el = document.getElementById('site-details-panel')?.getBoundingClientRect(); - const el2 = document.getElementById('site-tabs')?.getBoundingClientRect(); - - if(el && el2){ - setHeight(el!.height - el2!.y +20); - } - - } - - //on mount - React.useEffect(()=>{ - handleResize(); - - window.addEventListener("resize", ()=>{console.log("really got resized.")}); - },[]); - - // on update - React.useEffect(()=>{ - - if(props.site.devices!== null && props.site.devices.length>0){ - props.initializeDevices(props.site.devices); - props.loadDevices(props.site.devices); - } - - handleResize(); - - }, [props.site]); - - const onHandleTabChange = (event: React.ChangeEvent<{}>, 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.azimuthB!==null){ - hasAzimuth=true; - return {name: link.name, azimuth: link.azimuthB.toFixed(2) } - - }else{ - return {name: link.name } - } - }); - - const linkTableHeader = hasAzimuth ? ["Link Name", "Azimuth in °"] : ["Link Name"]; - - //prepare device table - const deviceRows : deviceRow[] = props.updatedDevices?.map(device=>{ - return{ - id: device.id, - name: device.name, - type: device.type, - status: device.status, - manufacturer: device.manufacturer, - owner: device.owner, - port: device.port - } - }); - - - const adressString = props.site.address == null ? null : buildAdress(props.site.address); - - - return (<div style={{ padding: '15px', display: "flex", flexDirection:"column", minWidth:0, minHeight:0 }}> - <h2 >{props.site.name}</h2> - { - props.site.operator !== '' && props.site.operator !== null ? - <TextField inputProps={{ 'aria-label': 'operator' }} disabled={true} value={props.site.operator} label="Operator" /> : - <TextField inputProps={{ 'aria-label': 'operator' }} disabled={true} value="Unkown" label="Operator" style={{ marginTop: "5px" }} /> - } - { - props.site.type !== undefined && props.site.type.length > 0 && - <TextField inputProps={{ 'aria-label': 'type' }} disabled={true} value={props.site.type} label="Type" style={{ marginTop: "5px" }} /> - } - { - adressString !== null && - <TextField inputProps={{ 'aria-label': 'adress' }} disabled={true} value={adressString} label="Address" style={{ marginTop: "5px" }} /> - } - { - props.site.heightAmslInMeters !== undefined && props.site.heightAmslInMeters > 0 && - <TextField 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 inputProps={{ 'aria-label': 'antenna-above-ground-in-meters' }} disabled={true} value={props.site.antennaHeightAmslInMeters} label="Atenna above ground in meters" style={{ marginTop: "5px" }} /> - } - - <TextField inputProps={{ 'aria-label': 'latitude' }} style={{ marginTop: "5px" }} disabled={true} value={LatLonToDMS(props.site.location.lat)} label="Latitude" /> - <TextField inputProps={{ 'aria-label': 'longitude' }} style={{ marginTop: "5px" }} disabled={true} value={LatLonToDMS(props.site.location.lon, true)} label="Longitude" /> - - <AppBar position="static" style={{ marginTop: "5px", background: '#2E3B55' }}> - <Tabs id="site-tabs" value={value} onChange={onHandleTabChange} aria-label="simple tabs example"> - <Tab label="Links" value="links" /> - <Tab label="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 && props.updatedDevices !== null && - <DenseTable ariaLabelRow="available-nodes-table" ariaLabelColumn={["id","name","type","status", "manufacturer","owner", "ports", "actions"]} navigate={props.navigateToApplication} height={height} hover={false} headers={["ID","Name","Type","Status", "Manufacturer","Owner", "Ports", "Actions"]} actions={true} data={deviceRows!} /> - } - </> - } - { - props.isSitedocReachable && props.site.furtherInformation!==null && props.site.furtherInformation.length>0 && - <Button style={{marginTop:20}} fullWidth variant="contained" color="primary" onClick={e => getFurtherInformation(props.site.furtherInformation) }>Further information available</Button> - } - - { - staSite !== null && openPopup && <StadokDetailsPopup site={staSite} onClose={closePopup} open={true} /> - } - - </div> - ) -} - -const buildAdress = (adress: Address) =>{ - - switch(adress.country){ - case "de": - return `${adress.streetAndNr}, ${adress.zipCode!== null? adress.zipCode : ''} ${adress.city}` - - case "us": - return `${adress.streetAndNr}, ${adress.city} ${adress.zipCode!== null? adress.zipCode : ''}` - - default: - console.log("address formatting for country {"+adress.country+"} not recognized, defaulting."); - return `${adress.streetAndNr}, ${adress.zipCode!== null? adress.zipCode : ''} ${adress.city}` - } - - -} - -const mapStateToProps = (state: IApplicationStoreState) => ({ - updatedDevices: state.network.details.checkedDevices, - isSitedocReachable: state.network.details.isSitedocReachable -}); - -const mapDispatchToProps = (dispatcher: IDispatcher) => ({ - initializeDevices: (devices: Device[]) => {dispatcher.dispatch(new InitializeLoadedDevicesAction(devices))}, - loadDevices: async (networkElements: Device[]) => { await dispatcher.dispatch(CheckDeviceList(networkElements)) }, - navigateToApplication: (applicationName: string, path?: string) => dispatcher.dispatch(new NavigateToApplication(applicationName, path, "test3")), - -}) - -export default connect(mapStateToProps, mapDispatchToProps)(SiteDetails);
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/components/details/stadokDetailsPopup.tsx b/sdnr/wt/odlux/apps/networkMapApp/src/components/details/stadokDetailsPopup.tsx deleted file mode 100644 index 4f3235db7..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/components/details/stadokDetailsPopup.tsx +++ /dev/null @@ -1,274 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import * as React from 'react'; - -import MuiDialogTitle from '@material-ui/core/DialogTitle'; -import { AppBar, Dialog, DialogContent, IconButton, Tab, Tabs, TextField, Typography } from '@material-ui/core'; -import CloseIcon from '@material-ui/icons/Close'; -import { withStyles, WithStyles, createStyles, Theme, makeStyles } from '@material-ui/core/styles'; - - -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 { CSSProperties } from '@material-ui/core/styles/withStyles'; -import { SITEDOC_URL } from '../../config'; - - -type props = { site: StadokSite; onClose(): void; open:boolean }; - -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 StadokDetailsPopup: React.FunctionComponent<props> = (props) => { - const classes = useStyles(); - - const [open, setOpen] = React.useState(props.open); - const [value, setValue] = React.useState("devices"); - const [orders, setOrders] = React.useState<OrderToDisplay[]|null>(null); - - const DialogTitle = withStyles(styles)((props: any) => { - const { children, classes, onClose, ...other } = props; - return ( - <MuiDialogTitle disableTypography 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}> - <CloseIcon /> - </IconButton> - ) : null} - </MuiDialogTitle> - ); - }); - - 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 onHandleTabChange = (event: React.ChangeEvent<{}>, newValue: string) => { - setValue(newValue); -} -console.log(props.site) - const contacts = getContacts(props.site); - - const orderUrl=`${SITEDOC_URL}/site/${props.site.siteId}/orders`; - - if(orders==null){ - requestRest<StadokOrder[]>(orderUrl,{ method: "GET"}).then(result =>{ - if(result){ - const orderList = result.map(order =>{ - return OrderToDisplay.parse(order); - }); - setOrders(orderList); - - }else{ - setOrders([]); - } - }); - } - - 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.siteId, props.site.images[0],"large") - } else { - return <> - { - stadokImage(props.site.siteId, props.site.images[0], "large") - } - <div style={{ display: 'flex', flexDirection: 'row', flexWrap:'wrap' }}> - - { - props.site.images.length<=9 ? - props.site.images.slice(1, props.site.images.length).map(image => - stadokImage(props.site.siteId, image, "small") - ) - : - <> - { - props.site.images.slice(1, 9).map(image => - stadokImage(props.site.siteId, image, "small") - ) - } - - </> - } - </div> - </> - } - - } - - const stadokImage = (siteId: string, imagename: string, size: 'large' | 'small') => { - const url = `${SITEDOC_URL}/site/${siteId}/files/${imagename}`; - const className = size === "small" ? classes.smallImage : classes.largeImage; - return <img className={className} src={url} onClick={e => window.open(url)} /> - - } - - - return (<Dialog onClose={onClose} fullWidth maxWidth="md" aria-labelledby="customized-dialog-title" open={open}> - <DialogTitle id="customized-dialog-title" onClose={onClose}> - {props.site.siteId} - </DialogTitle> - <DialogContent style={{minWidth:'900px'}} dividers> - <div style={{ display: 'flex', flexDirection: 'row', flexGrow: 1 }}> - <div style={{ width: '60%', display:'flex', flexDirection: 'column' }}> - - <TextField inputProps={{ 'aria-label': 'type' }} disabled={true} value={props.site.updatedOn} label="Updated on" style={{ marginTop: "5px" }} /> - - - { - props.site.type !== undefined && props.site.type.length > 0 && - <TextField inputProps={{ 'aria-label': 'type' }} disabled={true} value={props.site.type} label="Type" style={{ marginTop: "5px" }} /> - } - - - <TextField inputProps={{ 'aria-label': 'adress' }} 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 inputProps={{ 'aria-label': 'latitude' }} style={{ marginTop: "5px" }} disabled={true} value={LatLonToDMS(props.site.location.lat)} label="Latitude" /> - <TextField inputProps={{ 'aria-label': 'longitude' }} style={{ marginTop: "5px" }} disabled={true} value={LatLonToDMS(props.site.location.lon, true)} label="Longitude" /> - <AppBar position="static" style={{ marginTop: "5px", background: '#2E3B55' }}> - <Tabs id="site-tabs" variant="scrollable" scrollButtons="on" value={value} onChange={onHandleTabChange} aria-label="simple tabs example"> - <Tab label="Devices" value="devices" /> - <Tab label="Contacts" value="contacts" /> - <Tab label="Saftey" value="safteyInfo" /> - <Tab label="Logs" value="logs" /> - <Tab label="Orders" value="orders" /> - </Tabs> - </AppBar> - { - value == "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>) - } - { - value == "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>) - } - { - value == "safteyInfo" && (props.site.safteyNotices.length>0 ? - <DenseTable data={props.site.safteyNotices} height={300} headers={["Note"]} hover={false} ariaLabelRow="saftey-info-table" /> - : - <div style={{height:300}}> - <Typography variant="body1" style={{ marginTop: '10px' }}> - No saftey notices applicable - </Typography> - </div>) - } - { - value == "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>) - } - - { - value ==="orders" && createOrderInfo() - } - - </div> - <div style={{padding: '10px', display: 'flex', alignItems:'center', flexDirection:'column', justifyContent: 'start', width:'40%'}}> - { - props.site.images.length == 0 ? - <Typography variant="body1" style={{ marginTop: '10px' }}> - No images available - </Typography> - : displayImages() - } - </div> - </div> - - </DialogContent> - </Dialog>) - -} - -export default StadokDetailsPopup;
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/components/map/connectionInfo.tsx b/sdnr/wt/odlux/apps/networkMapApp/src/components/map/connectionInfo.tsx deleted file mode 100644 index 3b5a15ce5..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/components/map/connectionInfo.tsx +++ /dev/null @@ -1,59 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import * as React from 'react' - -import { IApplicationStoreState } from "../../../../../framework/src/store/applicationStore"; -import connect, { IDispatcher, Connect } from "../../../../../framework/src/flux/connect"; -import { Paper, Typography } from "@material-ui/core"; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons'; - - -type props = Connect<typeof mapStateToProps, typeof mapDispatchToProps>; - -const ConnectionInfo: React.FunctionComponent<props> = (props) => { - - return ((props.isTopoServerReachable === false || props.isTileServerReachable === false )? <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> - {props.isTileServerReachable === false && <Typography> Tile data can't be loaded.</Typography>} - {props.isTopoServerReachable === false && <Typography > Network data can't be loaded.</Typography>} - </div> - </Paper> : null -) - -} - -const mapStateToProps = (state: IApplicationStoreState) => ({ - isTopoServerReachable: state.network.connectivity.isToplogyServerAvailable, - isTileServerReachable: state.network.connectivity.isTileServerAvailable - -}); - - - -const mapDispatchToProps = (dispatcher: IDispatcher) => ({ - - //zoomToSearchResult: (lat: number, lon: number) => dispatcher.dispatch(new ZoomToSearchResultAction(lat, lon)) - -});; - - -export default connect(mapStateToProps,mapDispatchToProps)(ConnectionInfo) - diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/components/map/iconSwitch.tsx b/sdnr/wt/odlux/apps/networkMapApp/src/components/map/iconSwitch.tsx deleted file mode 100644 index 221e7dab8..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/components/map/iconSwitch.tsx +++ /dev/null @@ -1,53 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import * as React from 'react'; -import { FormControlLabel, Switch, Paper } from "@material-ui/core"; -import connect, { Connect, IDispatcher } from '../../../../../framework/src/flux/connect'; -import { IApplicationStoreState } from '../../../../../framework/src/store/applicationStore'; -import { SetIconSwitchAction } from '../../actions/mapActions'; - -type props = Connect<typeof mapStateToProps, typeof mapDispatchToProps> & {visible: boolean} - -const IconSwitch: React.FunctionComponent<props> = (props) =>{ - - const toggleChecked = () => { - props.toogle(!props.areIconsEnabled) - }; - - return ( - props.visible ? - <FormControlLabel style={{ padding:5, position: 'absolute',top: 190, zIndex:1}} - value="end" - control={<Switch color="secondary" style={{zIndex:1}} checked={props.areIconsEnabled} onChange={toggleChecked} />} - label="Show icons" - labelPlacement="end" - />: null) -} - -const mapStateToProps = (state: IApplicationStoreState) => ({ - areIconsEnabled: state.network.map.allowIconSwitch -}); - - -const mapDispatchToProps = (dispatcher: IDispatcher) => ({ - toogle : (enable:boolean) => dispatcher.dispatch(new SetIconSwitchAction(enable)) - -});; - -export default (connect(mapStateToProps,mapDispatchToProps)(IconSwitch)) diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/components/map/map.tsx b/sdnr/wt/odlux/apps/networkMapApp/src/components/map/map.tsx deleted file mode 100644 index 1314edbba..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/components/map/map.tsx +++ /dev/null @@ -1,697 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import * as React from 'react' -import * as mapboxgl from 'mapbox-gl'; -import { RouteComponentProps, withRouter } from 'react-router-dom'; - - -import { Site } from '../../model/site'; -import { SelectSiteAction, ClearHistoryAction, SelectLinkAction } from '../../actions/detailsAction'; -import { OSM_STYLE, URL_API, URL_BASEPATH, URL_TILE_API } from '../../config'; -import { link } from '../../model/link'; -import MapPopup from './mapPopup'; -import { SetPopupPositionAction, SelectMultipleLinksAction, SelectMultipleSitesAction } from '../../actions/popupActions'; -import { Feature } from '../../model/Feature'; -import { HighlightLinkAction, HighlightSiteAction, SetCoordinatesAction, SetStatistics } from '../../actions/mapActions'; -import { addDistance, getUniqueFeatures, increaseBoundingBox } from '../../utils/mapUtils'; -import { IApplicationStoreState } from '../../../../../framework/src/store/applicationStore'; -import connect, { IDispatcher, Connect } from '../../../../../framework/src/flux/connect'; -import SearchBar from './searchBar'; -import { verifyResponse, IsTileServerReachableAction, handleConnectionError, setTileServerReachableAction, IsBusycheckingConnectivityAction } from '../../actions/connectivityAction'; -import ConnectionInfo from './connectionInfo' -import mapLayerService from '../../utils/mapLayers'; -import Statistics from './statistics'; -import IconSwitch from './iconSwitch'; -import { addImages } from '../../services/mapImagesService'; -import { PopupElement } from '../../model/popupElements'; -import { Button } from '@material-ui/core'; -import { NavigateToApplication } from '../../../../../framework/src/actions/navigationActions'; -import customize from '../../../icons/customize.png'; - -type coordinates = { lat: number, lon: number, zoom: number } - -let alarmElements: Feature[] = []; -let map: mapboxgl.Map; -let isLoadingInProgress = false; -let notLoadedBoundingBoxes: mapboxgl.LngLatBounds[] = []; - -let lastBoundingBox: mapboxgl.LngLatBounds | null = null; -let myRef = React.createRef<HTMLDivElement>(); - -import 'mapbox-gl/dist/mapbox-gl.css'; - -class Map extends React.Component<mapProps, { isPopupOpen: boolean }> { - - constructor(props: mapProps) { - super(props); - //any state stuff - this.state = { isPopupOpen: false } - - } - - updateTheme(){ - mapLayerService.settings=this.props.settings.themes; - if(this.props.settings.mapSettings?.networkMap.styling.theme){ - mapLayerService.selectedTheme = this.props.settings.mapSettings?.networkMap.styling.theme; - } - } - - updateOpacity(){ - if(this.props.settings.mapSettings && this.props.settings.mapSettings.networkMap.tileOpacity){ - mapLayerService.changeMapOpacity(map, Number(this.props.settings.mapSettings.networkMap.tileOpacity)); - } - } - - async componentDidMount() { - - // resize the map, if menu gets collapsed - window.addEventListener("menu-resized", this.handleResize); - - //pass themes to mapLayerService - this.updateTheme(); - - // try if connection to tile + topologyserver are available - - try { - const tiles = await fetch(URL_TILE_API + '/10/0/0.png'); - if (tiles.ok) { - this.props.setTileServerLoaded(true); - }else{ - this.props.setTileServerLoaded(false); - } - - } catch (error) { - this.props.setTileServerLoaded(false); - console.error("tileserver " + URL_TILE_API + " can't be reached."); - } - - try { - const topology = await fetch(URL_API + "/info/count/all"); - verifyResponse(topology); - } catch (error) { - this.props.handleConnectionError(error) - } - - //both done - this.props.setConnectivityCheck(false); - //map loaded in componentDidUpdate - } - - setupMap = () => { - - let lat = this.props.lat; - let lon = this.props.lon; - let zoom = this.props.zoom; - - if(this.props.settings.mapSettings){ - if(this.props.settings.mapSettings.networkMap.startupPosition.latitude){ - lat = Number(this.props.settings.mapSettings.networkMap.startupPosition.latitude) - } - - if(this.props.settings.mapSettings.networkMap.startupPosition.longitude){ - lon = Number(this.props.settings.mapSettings.networkMap.startupPosition.longitude) - } - - if(this.props.settings.mapSettings.networkMap.startupPosition.zoom){ - zoom = Number(this.props.settings.mapSettings.networkMap.startupPosition.zoom) - } - - } - - const coordinates = this.extractCoordinatesFromUrl(); - // override lat/lon/zoom with coordinates from url, if available - if (this.areCoordinatesValid(coordinates)) { - lat = coordinates.lat; - lon = coordinates.lon; - zoom = !Number.isNaN(coordinates.zoom) ? coordinates.zoom : zoom; - } - - map = new mapboxgl.Map({ - container: myRef.current!, - style: OSM_STYLE as any, - center: [lon, lat], - zoom: zoom, - accessToken: '' - }); - - map.on('load', (ev) => { - - map.setMaxZoom(18); - const bbox = map.getBounds(); - this.props.updateMapPosition(bbox.getCenter().lat, bbox.getCenter().lng, map.getZoom()) - - mapLayerService.addBaseSources(map, this.props.selectedSite, this.props.selectedLink); - - addImages(map, (result: boolean)=>{ - if(map.getZoom()>11 && this.props.showIcons) - { - mapLayerService.addIconLayers(map, this.props.selectedSite?.properties.id) - }else{ - mapLayerService.addBaseLayers(map); - } - this.updateOpacity(); - - }); - - const boundingBox = increaseBoundingBox(map); - - fetch(`${URL_API}/links/geojson/${boundingBox.west},${boundingBox.south},${boundingBox.east},${boundingBox.north}`) - .then(result => verifyResponse(result)) - .then(result => result.json()) - .then(features => { - if (map.getSource('lines')) { - (map.getSource('lines') as mapboxgl.GeoJSONSource).setData(features); - } - }) - .catch(error => this.props.handleConnectionError(error)); - - - fetch(`${URL_API}/sites/geojson/${boundingBox.west},${boundingBox.south},${boundingBox.east},${boundingBox.north}`) - .then(result => verifyResponse(result)) - .then(result => result.json()) - .then(features => { - if (map.getSource('points')) { - (map.getSource('points') as mapboxgl.GeoJSONSource).setData(features); - } - }) - .catch(error => this.props.handleConnectionError(error)); - - map.on('click', this.mapClick); - map.on('moveend', this.mapMoveEnd); - map.on('move', this.mapMove); - - }); - } - - mapMove = () => { - - const mapZoom = map.getZoom(); - - const boundingBox = map.getBounds(); - - this.loadNetworkData(boundingBox); - if (mapZoom > 9) { - - if (map.getLayer('points')) { - map.setLayoutProperty('selectedPoints', 'visibility', 'visible'); - map.setPaintProperty('points', 'circle-radius', 7); - } - } else { - - // reduce size of points / lines if zoomed out - map.setPaintProperty('points', 'circle-radius', 2); - map.setLayoutProperty('selectedPoints', 'visibility', 'none'); - - if (mapZoom <= 4) { - map.setPaintProperty('fibre-lines', 'line-width', 1); - map.setPaintProperty('microwave-lines', 'line-width', 1); - - } else { - map.setPaintProperty('fibre-lines', 'line-width', 2); - map.setPaintProperty('microwave-lines', 'line-width', 2); - } - } - }; - - mapClick = (e: any) => { - - - if (map.getLayer('points')) { // data is shown as points - - var 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'] - }), "id"); - - const clickedPoints = getUniqueFeatures(map.queryRenderedFeatures(e.point, { layers: ['points'] }), "id"); - const alarmedSites = getUniqueFeatures(map.queryRenderedFeatures(e.point, { layers: ['alarmedPoints'] }), "id"); - - if (clickedPoints.length != 0) { - - - if (alarmedSites.length > 0) { - alarmedSites.forEach(alarm => { - const index = clickedPoints.findIndex(item => item.properties!.id === alarm.properties!.id); - - if (index !== -1) { - clickedPoints[index].properties!.alarmed = true; - clickedPoints[index].properties!.type = "alarmed"; - } - }); - } - - this.showSitePopup(clickedPoints, e.point.x, e.point.y); - } else if (clickedLines.length != 0) { - this.showLinkPopup(clickedLines, 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', 'point-remaining'] }), "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'] - }), "id"); - - if (clickedSites.length > 0) - this.showSitePopup(clickedSites, e.point.x, e.point.y); - else if (clickedLines.length != 0) { - this.showLinkPopup(clickedLines, e.point.x, e.point.y); - } - } - }; - - mapMoveEnd = () => { - - const mapZoom = Number(map.getZoom().toFixed(2)); - const lat = Number(map.getCenter().lat.toFixed(4)); - const lon = Number(map.getCenter().lng.toFixed(4)); - - - if (this.props.lat !== lat || this.props.lon !== lon || this.props.zoom !== mapZoom) { - this.props.updateMapPosition(lat, lon, mapZoom) - } - - // update the url to current lat,lon,zoom values - - const currentUrl = window.location.href; - const parts = currentUrl.split(URL_BASEPATH); - if (parts.length > 0) { - - const detailsPath = parts[1].split("/details/"); - - if (detailsPath[1] !== undefined && detailsPath[1].length > 0) { - this.props.history.replace(`/${URL_BASEPATH}/${map.getCenter().lat.toFixed(4)},${map.getCenter().lng.toFixed(4)},${mapZoom.toFixed(2)}/details/${detailsPath[1]}`) - } - else { - this.props.history.replace(`/${URL_BASEPATH}/${map.getCenter().lat.toFixed(4)},${map.getCenter().lng.toFixed(4)},${mapZoom.toFixed(2)}`) - } - } - - - //switch icon layers if applicable - - mapLayerService.showIconLayers(map, this.props.showIcons, this.props.selectedSite?.properties.id); - - //update statistics - const boundingBox = map.getBounds(); - - fetch(`${URL_API}/info/count/${boundingBox.getWest()},${boundingBox.getSouth()},${boundingBox.getEast()},${boundingBox.getNorth()}`) - .then(result => verifyResponse(result)) - .then(res => res.json()) - .then(result => { - if (result.links !== this.props.linkCount || result.sites !== this.props.siteCount) { - this.props.setStatistics(result.links, result.sites); - } - }) - .catch(error => this.props.handleConnectionError(error));; - } - - componentDidUpdate(prevProps: mapProps, prevState: {}) { - - if(prevProps !== this.props){ - //(load map) - //triggered if either settings were done loading or tile/topology server connectivity checked - if(prevProps.settings !== this.props.settings || this.props.isConnectivityCheckBusy !== prevProps.isConnectivityCheckBusy){ - - //update theme if settings changed - if(prevProps.settings !== this.props.settings){ - this.updateTheme(); - } - - //if everything done loading/reachable, load map - if(!this.props.isConnectivityCheckBusy && this.props.isTileServerReachable && !this.props.settings.isLoadingData && (prevProps.settings.isLoadingData !==this.props.settings.isLoadingData || prevProps.isConnectivityCheckBusy !== this.props.isConnectivityCheckBusy)){ - - if(map == undefined){ - this.setupMap(); - } - else - if(map.getContainer() !== myRef.current){ - // reload map, because the current container (fresh div) doesn't hold the map and changing containers isn't supported - map.remove(); - this.setupMap(); - } - } - } - - if (map !== undefined) { - if (prevProps.selectedSite?.properties.id !== this.props.selectedSite?.properties.id) { - - if (this.props.selectedSite != null) { - if (map.getSource("selectedLine") !== undefined) { - (map.getSource("selectedLine") as mapboxgl.GeoJSONSource).setData({ type: "FeatureCollection", features: [] }); - (map.getSource("selectedPoints") as mapboxgl.GeoJSONSource).setData({ type: "FeatureCollection", features: [this.props.selectedSite] }); - } - - - if (map.getLayer('point-lamps') !== undefined) { - - map.setFilter('point-lamps', ['==', 'type', 'street lamp']); - map.setFilter('point-data-center', ['==', 'type', 'data center']); - map.setFilter('point-building', ['==', 'type', 'high rise building']); - map.setFilter('point-factory', ['==', 'type', 'factory']); - - if (this.props.selectedSite?.properties.type !== undefined) { - switch (this.props.selectedSite?.properties.type) { - case 'street lamp': - map.setFilter('point-lamps', ["all", ['==', 'type', 'street lamp'], ['!=', 'id', this.props.selectedSite.properties.id]]); - break; - case 'data center': - map.setFilter('point-data-center', ["all", ['==', 'type', 'data center'], ['!=', 'id', this.props.selectedSite.properties.id]]); - break; - case 'high rise building': - map.setFilter('point-building', ["all", ['==', 'type', 'high rise building'], ['!=', 'id', this.props.selectedSite.properties.id]]) - break; - case 'factory': - map.setFilter('point-factory', ["all", ['==', 'type', 'factory'], ['!=', 'id', this.props.selectedSite.properties.id]]); - break; - } - } - } - - - } - else - { - if (map.getSource("selectedPoints") !== undefined) - (map.getSource("selectedPoints") as mapboxgl.GeoJSONSource).setData({ type: "FeatureCollection", features: [] }); - - } - } - - if (prevProps.selectedLink !== this.props.selectedLink) { - if (this.props.selectedLink != null) { - - if (map.getLayer('point-lamps') !== undefined) { - map.setFilter('point-lamps', ['==', 'type', 'street lamp']); - map.setFilter('point-data-center', ['==', 'type', 'data center']); - map.setFilter('point-building', ['==', 'type', 'high rise building']); - map.setFilter('point-factory', ['==', 'type', 'factory']); - } - - if (map.getSource("selectedLine") !== undefined) { - (map.getSource("selectedPoints") as mapboxgl.GeoJSONSource).setData({ type: "FeatureCollection", features: [] }); - (map.getSource("selectedLine") as mapboxgl.GeoJSONSource).setData({ type: "FeatureCollection", features: [this.props.selectedLink] }); - } - } - else - { - if (map.getSource("selectedLine") !== undefined) - (map.getSource("selectedLine") as mapboxgl.GeoJSONSource).setData({ type: "FeatureCollection", features: [] }); - } - } - - if (prevProps.location.pathname !== this.props.location.pathname) { - if (map) { - const coordinates = this.extractCoordinatesFromUrl(); - this.moveMapToCoordinates(coordinates); - } - } - - if (prevProps.alarmlement !== this.props.alarmlement) { - if (this.props.alarmlement !== null && !alarmElements.includes(this.props.alarmlement)) { - if (map.getSource("alarmedPoints")) - (map.getSource("alarmedPoints") as mapboxgl.GeoJSONSource).setData({ type: "FeatureCollection", features: alarmElements }); - alarmElements.push(this.props.alarmlement) - } - } - - if (prevProps.showIcons !== this.props.showIcons) { - if (map && map.getZoom() > 11) { - mapLayerService.showIconLayers(map, this.props.showIcons, this.props.selectedSite?.properties.id); - } - } - - if (prevProps.zoomToElement !== this.props.zoomToElement) { - if (this.props.zoomToElement !== null) { - const currentZoom = map?.getZoom(); - - map.flyTo({ - center: [ - this.props.zoomToElement.lon, - this.props.zoomToElement.lat - ], zoom: currentZoom < 10 ? 10 : currentZoom, - essential: true - }); - } - } - } - } - } - - componentWillUnmount(){ - - //unregister events - window.removeEventListener("menu-resized", this.handleResize); - - if(map){ - map.off('click', this.mapClick); - map.off('moveend', this.mapMoveEnd); - map.off('move', this.mapMove); - } - - lastBoundingBox=null; - - // will be checked again on next load - this.props.setConnectivityCheck(true); - } - - handleResize = () => { - if (map) { - // wait a moment until resizing actually happened - window.setTimeout(() => map.resize(), 500); - } - } - - extractCoordinatesFromUrl = (): coordinates => { - const currentUrl = window.location.href; - const mainPathParts = currentUrl.split(URL_BASEPATH); - const coordinatePathPart = mainPathParts[1].split("/details/"); // split by details if present - const allCoordinates = coordinatePathPart[0].replace("/", ""); - const coordinates = allCoordinates.split(","); - return { lat: Number(coordinates[0]), lon: Number(coordinates[1]), zoom: Number(coordinates[2]) } - } - - areCoordinatesValid = (coordinates: coordinates) => { - - if ((!Number.isNaN(coordinates.lat)) && (!Number.isNaN(coordinates.lon))) { - return true; - } else { - return false; - } - } - - moveMapToCoordinates = (coordinates: coordinates) => { - - if (this.areCoordinatesValid(coordinates)) { - let zoom = -1; - - if (!Number.isNaN(coordinates.zoom)) { - zoom = coordinates.zoom; - } - - map.flyTo({ - center: [ - coordinates.lon, - coordinates.lat - ], zoom: zoom !== -1 ? zoom : this.props.zoom, - essential: true - }) - } - } - - loadNetworkData = async (bbox: mapboxgl.LngLatBounds) => { - if (!isLoadingInProgress) { // only load data if loading not in progress - isLoadingInProgress = true; - - if (lastBoundingBox == null) { - lastBoundingBox = bbox; - await this.draw('lines', `${URL_API}/links/geojson/${lastBoundingBox.getWest()},${lastBoundingBox.getSouth()},${lastBoundingBox.getEast()},${lastBoundingBox.getNorth()}`); - await this.draw('points', `${URL_API}/sites/geojson/${lastBoundingBox.getWest()},${lastBoundingBox.getSouth()},${lastBoundingBox.getEast()},${lastBoundingBox.getNorth()}`); - } else { - - // 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 - - lastBoundingBox = bbox; - - //calculate new boundingBox - const increasedBoundingBox = increaseBoundingBox(map); - - await this.draw('lines', `${URL_API}/links/geojson/${increasedBoundingBox.west},${increasedBoundingBox.south},${increasedBoundingBox.east},${increasedBoundingBox.north}`); - await this.draw('points', `${URL_API}/sites/geojson/${increasedBoundingBox.west},${increasedBoundingBox.south},${increasedBoundingBox.east},${increasedBoundingBox.north}`); - - } else if (lastBoundingBox.contains(bbox.getNorthEast()) && lastBoundingBox.contains(bbox.getSouthWest())) { // last one contains new one - // bbox is contained in last one, do nothing - isLoadingInProgress = false; - - } else { // bbox is not fully contained in old one, extend - - lastBoundingBox.extend(bbox); - - await this.draw('lines', `${URL_API}/links/geojson/${lastBoundingBox.getWest()},${lastBoundingBox.getSouth()},${lastBoundingBox.getEast()},${lastBoundingBox.getNorth()}`); - await this.draw('points', `${URL_API}/sites/geojson/${lastBoundingBox.getWest()},${lastBoundingBox.getSouth()},${lastBoundingBox.getEast()},${lastBoundingBox.getNorth()}`); - } - - } - - - if (notLoadedBoundingBoxes.length > 0) { // load last not loaded boundingbox - this.loadNetworkData(notLoadedBoundingBoxes.pop()!) - notLoadedBoundingBoxes = []; - } - - } else { - notLoadedBoundingBoxes.push(bbox); - } - } - - showSitePopup = (sites: mapboxgl.MapboxGeoJSONFeature[], top: number, left: number) => { - if (sites.length > 1) { - const elements: PopupElement[] = sites.map(feature => {return {name: feature.properties!.name, id: feature.properties!.id}}); - - this.props.setPopupPosition(top, left); - this.props.selectMultipleSites(elements); //name, id object container - this.setState({ isPopupOpen: true }); - - } else { - const id = sites[0].properties!.id; - - fetch(`${URL_API}/sites/${id}`) - .then(result => verifyResponse(result)) - .then(res => res.json() as Promise<Site>) - .then(result => { - this.props.selectSite(result); - this.props.highlightSite(result); - this.props.clearDetailsHistory(); - }) - .catch(error => this.props.handleConnectionError(error));; - } - } - - showLinkPopup = (links: mapboxgl.MapboxGeoJSONFeature[], top: number, left: number) => { - - if (links.length > 1) { - - const elements: PopupElement[] = links.map(feature => {return {name: feature.properties!.name, id: feature.properties!.id}}); - - this.props.setPopupPosition(top, left); - this.props.selectMultipleLinks(elements); - this.setState({ isPopupOpen: true }); - - } else { - var id = links[0].properties!.id; - - fetch(`${URL_API}/links/${id}`) - .then(result => verifyResponse(result)) - .then(res => res.json() as Promise<link>) - .then(result => { - this.props.selectLink(result); - this.props.highlightLink(result); - - this.props.clearDetailsHistory(); - }) - .catch(error => this.props.handleConnectionError(error));; - } - } - - draw = async (layer: string, url: string) => { - - fetch(url) - .then(result => verifyResponse(result)) - .then(res => res.json()) - .then(result => { - isLoadingInProgress = false; - if (map.getSource(layer)) { - (map.getSource(layer) as mapboxgl.GeoJSONSource).setData(result); - } - }) - .catch(error => this.props.handleConnectionError(error));; - } - - render() { - - return <> - -{ - !this.props.settings.isLoadingData ? - - <div id="map" style={{ width: "70%", position: 'relative' }} ref={myRef} > - { - this.state.isPopupOpen && - <MapPopup onClose={() => { this.setState({ isPopupOpen: false }); }} /> - } - <SearchBar /> - <Statistics /> - <IconSwitch visible={this.props.zoom>11} /> - <ConnectionInfo /> - <Button - disabled={!this.props.isTopoServerReachable} - style={{'position': 'absolute', 'right':5, top:5, backgroundColor:'white', zIndex:1}} - onClick={e => this.props.navigateToApplication("network", "customize")} > - <img src={customize} /> - </Button> - </div> - :<div style={{ width: "70%", position: 'relative' }} /> - - } - </> - } - -} - -type mapProps = RouteComponentProps & Connect<typeof mapStateToProps, typeof mapDispatchToProps>; - -const mapStateToProps = (state: IApplicationStoreState) => ({ - selectedLink: state.network.map.selectedLink, - selectedSite: state.network.map.selectedSite, - zoomToElement: state.network.map.zoomToElement, - alarmlement: state.network.map.alarmlement, - lat: state.network.map.lat, - lon: state.network.map.lon, - zoom: state.network.map.zoom, - linkCount: state.network.map.statistics.links, - siteCount: state.network.map.statistics.sites, - isTopoServerReachable: state.network.connectivity.isToplogyServerAvailable, - isTileServerReachable: state.network.connectivity.isTileServerAvailable, - isConnectivityCheckBusy: state.network.connectivity.isBusy, - showIcons: state.network.map.allowIconSwitch, - settings: state.network.settings, -}); - -const mapDispatchToProps = (dispatcher: IDispatcher) => ({ - selectSite: (site: Site) => dispatcher.dispatch(new SelectSiteAction(site)), - selectLink: (link: link) => dispatcher.dispatch(new SelectLinkAction(link)), - clearDetailsHistory: () => dispatcher.dispatch(new ClearHistoryAction()), - selectMultipleLinks: (ids: PopupElement[]) => dispatcher.dispatch(new SelectMultipleLinksAction(ids)), - selectMultipleSites: (ids: PopupElement[]) => dispatcher.dispatch(new SelectMultipleSitesAction(ids)), - setPopupPosition: (x: number, y: number) => dispatcher.dispatch(new SetPopupPositionAction(x, y)), - highlightLink: (link: link) => dispatcher.dispatch(new HighlightLinkAction(link)), - highlightSite: (site: Site) => dispatcher.dispatch(new HighlightSiteAction(site)), - updateMapPosition: (lat: number, lon: number, zoom: number) => dispatcher.dispatch(new SetCoordinatesAction(lat, lon, zoom)), - setStatistics: (linkCount: string, siteCount: string) => dispatcher.dispatch(new SetStatistics(siteCount, linkCount)), - setTileServerLoaded: (reachable: boolean) => dispatcher.dispatch(setTileServerReachableAction(reachable)), - handleConnectionError: (error: Error) => dispatcher.dispatch(handleConnectionError(error)), - navigateToApplication: (applicationName: string, path?: string) => dispatcher.dispatch(new NavigateToApplication(applicationName, path, "test3")), - setConnectivityCheck: (done: boolean) => dispatcher.dispatch(new IsBusycheckingConnectivityAction(done)), - -}) - -export default withRouter(connect(mapStateToProps, mapDispatchToProps)(Map));
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/components/map/mapPopup.tsx b/sdnr/wt/odlux/apps/networkMapApp/src/components/map/mapPopup.tsx deleted file mode 100644 index 7a64f5a58..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/components/map/mapPopup.tsx +++ /dev/null @@ -1,94 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import * as React from 'react'; -import { Typography, Select, MenuItem, ClickAwayListener, Popper, Paper, FormGroup, Portal, Popover } from '@material-ui/core'; -import { SelectSiteAction, ClearHistoryAction, ClearDetailsAction } from '../../actions/detailsAction'; -import { Site } from '../../model/site'; -import { link } from '../../model/link'; -import { URL_API } from '../../config'; -import { HighlightLinkAction, HighlightSiteAction } from '../../actions/mapActions'; -import { IApplicationStoreState } from '../../../../../framework/src/store/applicationStore'; -import connect, { IDispatcher, Connect } from '../../../../../framework/src/flux/connect'; -import { verifyResponse, handleConnectionError } from '../../actions/connectivityAction'; - - - - -const MapPopup: React.FunctionComponent<props> = (props) => { - - const [value, setValue] = React.useState(""); - - const handleChange = (event: any) => { - setValue(event.target.value); - - const id = event.target.value; - - - fetch(`${URL_API}/${props.type.toLocaleLowerCase()}s/${id}`) - .then(result => verifyResponse(result)) - .then(res => res.json()) - .then(result => { - props.clearDetailsHistory(); - props.selectElement(result); - props.type === "link" ? props.highlightLink(result) : props.highlightSite(result) - props.onClose(); - }) - .catch(error => { - props.handleConnectionError(error); - props.onClose(); - // props.clearDetails(); - }); - }; - - return <> - <Popover open={true} anchorEl={undefined} onClose={props.onClose} anchorReference="anchorPosition" anchorPosition={{ top: props.position.left, left: props.position.top }}> - <Paper style={{ padding: "15px" }}> - <Typography variant="h5">{`Multiple ${props.type.toLowerCase()}s were selected`}</Typography> - <Typography variant="body1">Please select one.</Typography> - <Select style={{ width: 300 }} onChange={handleChange} value={value} native> - <option value={""} disabled>{props.type} ids</option> - { - props.elements.map(el => <option key={el.id} value={el.id}>{el.name}</option>) - } - </Select> - </Paper> - </Popover> - </> -} - -type props = Connect<typeof mapStateToProps, typeof mapDispatchToProps>& { onClose(): void } - -const mapStateToProps = (state: IApplicationStoreState) => ({ - elements: state.network.popup.selectionPendingForElements, - type: state.network.popup.pendingDataType, - position: state.network.popup.position - -}); - -const mapDispatchToProps = (dispatcher: IDispatcher) => ({ - selectElement: (site: Site) => dispatcher.dispatch(new SelectSiteAction(site)), - clearDetailsHistory:()=> dispatcher.dispatch(new ClearHistoryAction()), - highlightLink: (link: link) => dispatcher.dispatch(new HighlightLinkAction(link)), - highlightSite: (site: Site) => dispatcher.dispatch(new HighlightSiteAction(site)), - handleConnectionError: (error:Error) => dispatcher.dispatch(handleConnectionError(error)), - clearDetails: () => dispatcher.dispatch(new ClearDetailsAction()), - -}); - -export default (connect(mapStateToProps, mapDispatchToProps))(MapPopup);
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/components/map/searchBar.tsx b/sdnr/wt/odlux/apps/networkMapApp/src/components/map/searchBar.tsx deleted file mode 100644 index 307c5d203..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/components/map/searchBar.tsx +++ /dev/null @@ -1,161 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import * as React from 'react'; -import { makeStyles, Paper, InputBase, IconButton, Divider, Popover, Typography } from '@material-ui/core'; -import SearchIcon from '@material-ui/icons/Search'; - -import { URL_API } from '../../config'; -import { isSite } from '../../utils/utils'; -import { Site } from '../../model/site'; -import { link } from '../../model/link'; -import { SelectSiteAction, SelectLinkAction } from '../../actions/detailsAction'; -import { HighlightLinkAction, HighlightSiteAction, ZoomToSearchResultAction } from '../../actions/mapActions'; -import { calculateMidPoint } from '../../utils/mapUtils'; -import { SetSearchValueAction } from '../../actions/searchAction'; -import connect,{ Connect, IDispatcher } from '../../../../../framework/src/flux/connect'; -import { IApplicationStoreState } from '../../../../../framework/src/store/applicationStore'; - - - - - - -const styles = makeStyles({ - root: { - //{ padding:5, position: 'absolute', display:'flex', flexDirection:"column",top: 150, width: 200} - 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: React.FunctionComponent<searchBarProps> = (props) =>{ - - const classes = styles(); - const [anchorEl, setAnchorEl] = React.useState<any>(null); - const [errorMessage, setErrorMessage] = React.useState(""); - - const divRef = React.useRef(); - - const handleClick = (e: any) =>{ - - setAnchorEl(null); - if(props.searchterm.length>0){ - - const siteResult = fetch(`${URL_API}/sites/name/${props.searchterm}`) - - const linkResult = fetch(`${URL_API}/links/${props.searchterm}`); - - Promise.all([ siteResult, linkResult]).then((result)=>{ - const suceededResults = result.filter(el=> el.ok); - - if(suceededResults.length==0){ - setAnchorEl(divRef.current); - setErrorMessage("No element found.") - // hide message after 3 sec - window.setTimeout(()=>{setAnchorEl(null)}, 3000); - - }else{ - suceededResults[0].json().then(result =>{ - if(isSite(result)){ - props.selectSite(result); - props.highlightSite(result); - props.zoomToSearchResult(result.location.lat, result.location.lon); - }else{ - props.selectLink(result); - props.highlightLink(result); - const midPoint = calculateMidPoint(result.locationA.lat, result.locationA.lon, result.locationB.lat, result.locationB.lon); - props.zoomToSearchResult(midPoint[1], midPoint[0]) - } - }); - } - }); - } - e.preventDefault(); -} - - const open = Boolean(anchorEl); - - const reachabe = props.isTopoServerReachable && props.isTileServerReachable; - - return ( - <> - <Paper ref={divRef} component="form" className={classes.root}> - <InputBase - disabled={!reachabe} - className={classes.input} - placeholder="Find sites or links by name" - inputProps={{ 'aria-label': 'networkmap-searchbar' }} - value={props.searchterm} - onChange={e=> props.setSearchTerm(e.currentTarget.value)} - /> - <Divider className={classes.divider} orientation="vertical" /> - <IconButton type="submit" className={classes.iconButton} aria-label="search" onClick={handleClick}> - <SearchIcon /> - </IconButton> - </Paper> - <Popover open={open} onClose={e=> setAnchorEl(null)} anchorEl={anchorEl} anchorOrigin={{ - vertical: "bottom", - horizontal: "left" - }}> - <Paper style={{width: 380, padding:10}}> - <Typography variant="body1">{errorMessage}</Typography> - </Paper> - </Popover> - </> - ); -} - -const mapStateToProps = (state: IApplicationStoreState) => ({ - searchterm: state.network.search.value, - isTopoServerReachable: state.network.connectivity.isToplogyServerAvailable, - isTileServerReachable: state.network.connectivity.isTileServerAvailable - -}); - -type searchBarProps = Connect<typeof mapStateToProps, typeof mapDispatchToProps>; - - -const mapDispatchToProps = (dispatcher: IDispatcher) => ({ - selectSite:(site: Site)=> dispatcher.dispatch(new SelectSiteAction(site)), - selectLink:(link: link) => dispatcher.dispatch(new SelectLinkAction(link)), - highlightLink:(link: link)=> dispatcher.dispatch(new HighlightLinkAction(link)), - highlightSite: (site: Site) => dispatcher.dispatch(new HighlightSiteAction(site)), - setSearchTerm: (value: string) => dispatcher.dispatch(new SetSearchValueAction(value)), - zoomToSearchResult: (lat: number, lon: number) => dispatcher.dispatch(new ZoomToSearchResultAction(lat, lon)), -});; - -export default (connect(mapStateToProps,mapDispatchToProps)(SearchBar))
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/components/map/statistics.tsx b/sdnr/wt/odlux/apps/networkMapApp/src/components/map/statistics.tsx deleted file mode 100644 index 562689198..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/components/map/statistics.tsx +++ /dev/null @@ -1,57 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import * as React from 'react'; -import { Paper, Typography, Tooltip } from '@material-ui/core'; -import InfoIcon from '@material-ui/icons/Info'; - -import { IApplicationStoreState } from '../../../../../framework/src/store/applicationStore'; -import connect, { IDispatcher, Connect } from '../../../../../framework/src/flux/connect'; - -type props = Connect<typeof mapStateToProps, typeof mapDispatchToProps>; - -const mapStateToProps = (state: IApplicationStoreState) => ({ - linkCount: state.network.map.statistics.links, - siteCount: state.network.map.statistics.sites, - isTopoServerReachable: state.network.connectivity.isToplogyServerAvailable, - isTileServerReachable: state.network.connectivity.isTileServerAvailable, - -}); - -const mapDispatchToProps = (dispatcher: IDispatcher) => ({ -}); - -const Statistics: React.FunctionComponent<props> = (props: props) =>{ - - const reachabe = props.isTopoServerReachable && props.isTileServerReachable; - - - return (<Paper style={{ padding: 5, position: 'absolute', display: 'flex', flexDirection: "column", top: 70, width: 200, marginLeft: 5, zIndex:1 }}> - <div style={{ display: 'flex', flexDirection: "row" }}> - <Typography style={{ fontWeight: "bold", flex: "1", color: reachabe ? "black" : "lightgrey" }} >Statistics</Typography> - <Tooltip style={{ alignSelf: "flex-end" }} title="Gets updated when the map stops moving."> - <InfoIcon fontSize="small" /> - </Tooltip> - </div> - - <Typography style={{ color: reachabe ? "black" : "lightgrey" }}>Sites: {props.siteCount}</Typography> - <Typography style={{ color: reachabe ? "black" : "lightgrey" }}>Links: {props.linkCount}</Typography> -</Paper>) -} - -export default connect(mapStateToProps, mapDispatchToProps)(Statistics); diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/config.ts b/sdnr/wt/odlux/apps/networkMapApp/src/config.ts deleted file mode 100644 index bdb7d15e6..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/config.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -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"; - - diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/handlers/connectivityReducer.ts b/sdnr/wt/odlux/apps/networkMapApp/src/handlers/connectivityReducer.ts deleted file mode 100644 index 8ab82f2e9..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/handlers/connectivityReducer.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { IActionHandler } from "../../../../framework/src/flux/action"; -import { IsTopologyServerReachableAction, IsTileServerReachableAction, IsBusycheckingConnectivityAction } from "../actions/connectivityAction"; - - -export type connectivityState = {isToplogyServerAvailable: boolean, isTileServerAvailable: boolean, isBusy: boolean }; - -const initialState: connectivityState = {isToplogyServerAvailable: true, isTileServerAvailable: true, isBusy: true}; - -export const ConnectivityReducer: IActionHandler<connectivityState> =(state=initialState, action)=> { - - if(action instanceof IsTopologyServerReachableAction){ - state = Object.assign({}, state, { isToplogyServerAvailable: action.reachable }); - } - else if (action instanceof IsTileServerReachableAction){ - state = Object.assign({}, state, { isTileServerAvailable: action.reachable }); - - }else if(action instanceof IsBusycheckingConnectivityAction){ - state = {...state, isBusy: action.isBusy} - - } - - return state; -}
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/handlers/detailsReducer.ts b/sdnr/wt/odlux/apps/networkMapApp/src/handlers/detailsReducer.ts deleted file mode 100644 index 8a7fc6ada..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/handlers/detailsReducer.ts +++ /dev/null @@ -1,76 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { IActionHandler } from '../../../../framework/src/flux/action'; -import { link } from "../model/link"; -import { Site, Device } from "../model/site"; -import { HistoryEntry } from "../model/historyEntry"; -import { SelectSiteAction, SelectLinkAction, AddToHistoryAction, ClearHistoryAction, IsBusyCheckingDeviceListAction, FinishedLoadingDeviceListAction, ClearLoadedDevicesAction, ClearDetailsAction, InitializeLoadedDevicesAction, IsSitedocReachableAction } from '../actions/detailsAction'; - -export type DetailsStoreState={ - data: Site | link | 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 SelectSiteAction){ - state= Object.assign({}, state, {data: action.site}); - } - else if(action instanceof SelectLinkAction){ - state = Object.assign({}, state, {data: action.link}); - }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; - -} - diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/handlers/mapReducer.ts b/sdnr/wt/odlux/apps/networkMapApp/src/handlers/mapReducer.ts deleted file mode 100644 index 442a5083c..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/handlers/mapReducer.ts +++ /dev/null @@ -1,81 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { IActionHandler } from '../../../../framework/src/flux/action'; -import { Feature } from "../model/Feature"; -import { HighlightLinkAction, HighlightSiteAction, ZoomToSearchResultAction, AddAlarmAction, SetCoordinatesAction, SetStatistics, SetIconSwitchAction, RemoveHighlightingAction } from '../actions/mapActions'; - -export type location = {lat: number, lon:number} - -export type mapState = { - selectedLink: Feature | null, - selectedSite: Feature | null, - zoomToElement: location | null, - alarmlement: Feature|null, - lat: number, - lon: number, - zoom: number, - statistics:{links: string, sites: string}, - allowIconSwitch: boolean -} - -const initialState: mapState ={ - selectedLink: null, - selectedSite: null, - zoomToElement: null, - alarmlement: null, - lat: 52.5095, - lon: 13.3290, - zoom: 10, - statistics:{links:"Not counted yet.", sites: "Not counted yet."}, - allowIconSwitch: true -} - -export const MapReducer: IActionHandler<mapState> = (state=initialState, action: any) => { - - if(action instanceof HighlightLinkAction){ - - state = Object.assign({}, state, {selectedSite: null, selectedLink:{type: "Feature", properties:{id:action.link.id, type: action.link.type}, geometry:{type:"LineString", coordinates:[[action.link.locationA.lon,action.link.locationA.lat ],[action.link.locationB.lon,action.link.locationB.lat ]]}}}) - - - } - else if(action instanceof HighlightSiteAction){ - - state = Object.assign({}, state, {selectedLink: null, selectedSite:{type: "Feature", properties: {id: action.site.id, type:action.site.type}, geometry:{type:"Point", coordinates:[action.site.location.lon,action.site.location.lat ]}}}) - - }else if (action instanceof ZoomToSearchResultAction){ - state = Object.assign({}, state, {zoomToElement:{lat: action.lat, lon: action.lon}}); - }else if (action instanceof AddAlarmAction){ - state = Object.assign({}, state, {alarmlement:{type: "Feature", properties: {id: action.site.id, type:action.site.type}, geometry:{type:"Point", coordinates:[action.site.location.lon,action.site.location.lat ]}}}); - - }else if(action instanceof SetCoordinatesAction){ - state = Object.assign({}, state, {lat:action.lat, lon: action.lon, zoom:action.zoom}); - - }else if(action instanceof SetStatistics){ - state = Object.assign({}, state, {statistics:{sites: action.siteCount, links: action.linkCount}}); - - }else if (action instanceof SetIconSwitchAction){ - state = Object.assign({}, state, {allowIconSwitch: action.enable}); - - }else if(action instanceof RemoveHighlightingAction){ - state = Object.assign({}, state, {selectedLink: null, selectedSite:null}) - - } - - return state; -}
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/handlers/popupReducer.ts b/sdnr/wt/odlux/apps/networkMapApp/src/handlers/popupReducer.ts deleted file mode 100644 index deb366e09..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/handlers/popupReducer.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { PopupElement } from 'model/popupElements'; -import { IActionHandler } from '../../../../framework/src/flux/action'; -import { SelectMultipleLinksAction, SelectMultipleSitesAction, SetPopupPositionAction } from "../actions/popupActions"; - -export type popupStoreState = { - selectionPendingForElements: PopupElement[], - pendingDataType: "link"|"site"| "", - position: { top: number, left: number } -}; - -const initialState: popupStoreState = { - selectionPendingForElements: [], - pendingDataType: "", - position: { top: 0, left: 0 } -}; - -export const PopupsReducer: IActionHandler<popupStoreState> = (state = initialState, action) => { - - if(action instanceof SelectMultipleLinksAction){ - state = Object.assign({}, state, { selectionPendingForElements: action.elements, pendingDataType: "link", isSelectionNeeded: true }); - - }else if(action instanceof SelectMultipleSitesAction){ - state = Object.assign({}, state, { selectionPendingForElements: action.elements, pendingDataType: "site", isSelectionNeeded: true }); - - }else if(action instanceof SetPopupPositionAction){ - state= Object.assign({}, state, {position:{top:action.top, left: action.left}}) - - } - - - return state; - -}
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/handlers/rootReducer.ts b/sdnr/wt/odlux/apps/networkMapApp/src/handlers/rootReducer.ts deleted file mode 100644 index 697dbd7a0..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/handlers/rootReducer.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { combineActionHandler } from '../../../../framework/src/flux/middleware'; - -import { DetailsReducer, DetailsStoreState } from "./detailsReducer"; -import { PopupsReducer, popupStoreState } from "./popupReducer"; -import { MapReducer, mapState } from "./mapReducer"; -import { SearchReducer, searchState } from "./searchReducer"; -import { connectivityState, ConnectivityReducer } from './connectivityReducer'; -import { SettingsReducer, SettingsState } from './settingsReducer'; - -export interface INetworkAppStoreState{ - details: DetailsStoreState, - popup: popupStoreState, - map: mapState, - search: searchState, - connectivity: connectivityState, - settings: SettingsState -} - -declare module '../../../../framework/src/store/applicationStore' { - interface IApplicationStoreState { - network: INetworkAppStoreState - } - } - -const appHandler = { - details: DetailsReducer, - popup: PopupsReducer, - map: MapReducer, - search: SearchReducer, - connectivity: ConnectivityReducer, - settings: SettingsReducer}; - -export const networkmapRootHandler = combineActionHandler<INetworkAppStoreState>(appHandler) - -export default networkmapRootHandler;
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/handlers/searchReducer.ts b/sdnr/wt/odlux/apps/networkMapApp/src/handlers/searchReducer.ts deleted file mode 100644 index 68aade477..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/handlers/searchReducer.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { IActionHandler } from '../../../../framework/src/flux/action'; -import { SetSearchValueAction } from "../actions/searchAction"; - -export type searchState = {value: string}; - -const initialState: searchState = {value: ''}; - -export const SearchReducer: IActionHandler<searchState> =(state=initialState, action)=> { - - if(action instanceof SetSearchValueAction){ - state = Object.assign({}, state, { value: action.value }); - } - - return state; -}
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/handlers/settingsReducer.ts b/sdnr/wt/odlux/apps/networkMapApp/src/handlers/settingsReducer.ts deleted file mode 100644 index 977a379a0..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/handlers/settingsReducer.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { NetworkMapSettings, NetworkMapThemes } from "../model/settings"; -import { IActionHandler } from "../../../../framework/src/flux/action"; -import { SetBusyLoadingAction, SetMapSettingsAction, SetSettingsAction, SetThemeSettingsAction } from "../actions/settingsAction"; - -export type SettingsState = { - mapSettings: NetworkMapSettings|null, - themes: NetworkMapThemes, - isLoadingData: boolean -}; - - -const defaultThemes:NetworkMapThemes = {networkMapThemes:{themes: [ - - {key: "light", site: "#11b4da", selectedSite: "#116bda", fiberLink: "#1154d9", microwaveLink: "#039903"}, - {key: "dark", site: "#000000", selectedSite: "#6e6e6e", fiberLink: "#0a2a6b", microwaveLink: "#005200"}, -]}} - -const initialState: SettingsState = { - mapSettings: null, - themes: defaultThemes, - isLoadingData: true - -}; - -export const SettingsReducer: IActionHandler<SettingsState> = (state = initialState, action) => { - - if(action instanceof SetSettingsAction){ - state = { - isLoadingData: false, - mapSettings: {networkMap: action.settings.networkMap}, - themes:{networkMapThemes: {themes: action.settings.networkMapThemes.themes}} - }; - }else if(action instanceof SetMapSettingsAction){ - state={...state, mapSettings: action.settings}; - }else if(action instanceof SetThemeSettingsAction){ - state={...state, themes:{networkMapThemes: {themes: action.settings.networkMapThemes.themes}}}; - }else if(action instanceof SetBusyLoadingAction){ - state={...state, isLoadingData: action.busy}; - } - - return state; - -}
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/index.html b/sdnr/wt/odlux/apps/networkMapApp/src/index.html deleted file mode 100644 index f70571152..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/index.html +++ /dev/null @@ -1,30 +0,0 @@ -<!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", "configurationApp", "linkCalculationApp"], function (app, connectApp, faultApp, networkMapApp, configurationApp, linkCalculationApp) { - connectApp.register(); - faultApp.register(); - //configurationApp.register(); - linkCalculationApp.register(); - networkMapApp.register(); - app("./app.tsx").runApplication(); - }); - </script> -</body> - -</html>
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/model/Feature.ts b/sdnr/wt/odlux/apps/networkMapApp/src/model/Feature.ts deleted file mode 100644 index c4f9ad1cb..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/model/Feature.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type Feature = {type: "Feature", properties: {id: string, type?: string}, geometry: Geometry} - -export type Geometry = Point | LineString; - -type Point = {type: "Point", coordinates: number[]} - -type LineString ={type: "LineString", coordinates: number[][]}
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/model/count.ts b/sdnr/wt/odlux/apps/networkMapApp/src/model/count.ts deleted file mode 100644 index 726e2ff76..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/model/count.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type elementCount ={sites: string, links: string}
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/model/historyEntry.ts b/sdnr/wt/odlux/apps/networkMapApp/src/model/historyEntry.ts deleted file mode 100644 index d7197a4d1..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/model/historyEntry.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Site } from "./site"; -import { link } from "./link"; - -export type HistoryEntry={id: string, data: Site|link};
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/model/link.ts b/sdnr/wt/odlux/apps/networkMapApp/src/model/link.ts deleted file mode 100644 index c1612098d..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/model/link.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -type Antenna = { - name:string, - waveguideLossIndB: number, - gain: number -} - -export type link = {id: string, - name: string, - length: number, - calculatedLength: number, - type: string, - siteA: string, - siteB: string, - azimuthA: number | null, - azimuthB: number | null, - locationA: { lon: number, lat: number, amsl:number | null, antennaHeight: number | null, antenna: Antenna |null }, - locationB: { lon: number, lat: number, amsl:number | null, antennaHeight: number | null, antenna: Antenna |null }, - };
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/model/popupElements.ts b/sdnr/wt/odlux/apps/networkMapApp/src/model/popupElements.ts deleted file mode 100644 index 320d7ca6e..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/model/popupElements.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type PopupElement = { - name: string, - id: string -}
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/model/settings.ts b/sdnr/wt/odlux/apps/networkMapApp/src/model/settings.ts deleted file mode 100644 index 521f47ccc..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/model/settings.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type NetworkMapSettings = { - networkMap: { - startupPosition: { latitude?: string, longitude?: string, zoom?: string }, - tileOpacity: string, - styling: { theme: string } } }; - -export type ThemeElement = { - key: string, - site: string, - selectedSite: string, - microwaveLink: string, - fiberLink: string}; - -export type NetworkMapThemes = {networkMapThemes: {themes: ThemeElement[]} }; - -export type NetworkSettings = NetworkMapSettings & NetworkMapThemes;
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/model/site.ts b/sdnr/wt/odlux/apps/networkMapApp/src/model/site.ts deleted file mode 100644 index 13a7361f6..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/model/site.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { link } from "./link"; - -export type Site = { - id: string, - name: string, - address: Address, - heightAmslInMeters?: number, //AboveGroundLevel - antennaHeightAmslInMeters?: number, - type?: string, - operator: string, - location:{lon: number, lat: number}, - devices: Device[], - links: link[], - furtherInformation:string -} - -export type Address={ - streetAndNr: string, - city: string, - zipCode: string | null, - country: string -} - -export class Device { - id: string; - type: string; - name: string; - manufacturer: string; - owner: string; - status?: string; - port: number[]; -}
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/model/stadokOrder.ts b/sdnr/wt/odlux/apps/networkMapApp/src/model/stadokOrder.ts deleted file mode 100644 index 1aad3aa97..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/model/stadokOrder.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -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 diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/model/stadokSite.ts b/sdnr/wt/odlux/apps/networkMapApp/src/model/stadokSite.ts deleted file mode 100644 index ed0ca397f..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/model/stadokSite.ts +++ /dev/null @@ -1,54 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Address } from "./site"; - -type StadokSite = { - - siteId: string; - createdBy: Contact; - updatedOn: Date; - location: { lat: number, lon: number }, - address: Address; - contacts: { manager: Contact, owner: Contact }; - safteyNotices: 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 diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/pluginTransport.tsx b/sdnr/wt/odlux/apps/networkMapApp/src/pluginTransport.tsx deleted file mode 100644 index 24a46994a..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/pluginTransport.tsx +++ /dev/null @@ -1,117 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -// app configuration and main entry point for the app - -import * as React from "react"; -import { faMapMarked } from '@fortawesome/free-solid-svg-icons'; // select app icon -import applicationManager from '../../../framework/src/services/applicationManager'; - - -import { networkmapRootHandler } from './handlers/rootReducer'; -import MainView from "./App"; -import { subscribe, IFormatedMessage } from "../../../framework/src/services/notificationService"; -import applicationApi from "../../../framework/src/services/applicationApi"; -import { checkSitedockReachablity, IsSitedocReachableAction, UpdateDetailsView } from "./actions/detailsAction"; -import { findSiteToAlarm } from "./actions/mapActions"; -import { URL_BASEPATH } from "./config"; -import { Redirect, Route, RouteComponentProps, Switch, withRouter } from "react-router-dom"; -import CustomizationView from "./components/customize/customizationView"; -import { getSettings } from "./actions/settingsAction"; -import connect, { Connect, IDispatcher } from "../../../framework/src/flux/connect"; -import { IApplicationStoreState } from "../../../framework/src/store/applicationStore"; - -const mapProps = (state: IApplicationStoreState) => ({ -}); - -const mapDisp = (dispatcher: IDispatcher) => ({ - getSettings: () => dispatcher.dispatch(getSettings()), - tryReachSitedoc: () => dispatcher.dispatch(checkSitedockReachablity()) - -}); - - -const NetworkRouterApp = withRouter(connect(mapProps, mapDisp)((props: RouteComponentProps & Connect<typeof mapProps, typeof mapDisp>) => { - - React.useLayoutEffect(() => { - (async function waitFor() { - await props.getSettings(); - })(); - - props.tryReachSitedoc(); - - }, []); - - //props.history.action = "POP"; - return ( - <Switch> - <Route path={`${props.match.path}/customize`} component={CustomizationView} /> - <Route path={`${props.match.path}`} component={MainView} /> - <Redirect to={`${props.match.path}`} /> - </Switch> - ) -})); - -export function register() { - applicationManager.registerApplication({ - name: URL_BASEPATH, // used as name of state as well - icon: faMapMarked, - rootActionHandler: networkmapRootHandler, - rootComponent: NetworkRouterApp, - menuEntry: "Network Map" - }); -} - -type ObjectNotification = { - counter: string; - nodeName: string; - objectId: string; - timeStamp: string; -} - -type FaultAlarmNotification = { - id: string; - nodeName: string; - counter: number; - timeStamp: string; - objectId: string; - problem: string; - severity: null | 'Warning' | 'Minor' | 'Major' | 'Critical'; - type: string; - sourceType: string; -} -/* -// subscribe to the websocket notifications from connect -subscribe<ObjectNotification & IFormatedMessage>(["ObjectCreationNotification", "ObjectDeletionNotification", "AttributeValueChangedNotification"], (msg => { - const store = applicationApi.applicationStore; - - //store && store.dispatch(UpdateDetailsView(msg.nodeName)) - -})); -*/ - -/* -subscribe<FaultAlarmNotification & IFormatedMessage>("ProblemNotification", (fault => { - const store = applicationApi && applicationApi.applicationStore; - if (fault && store) { - store.dispatch(findSiteToAlarm(fault.nodeName)); - - - } -}));*/ - diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/services/mapImagesService.ts b/sdnr/wt/odlux/apps/networkMapApp/src/services/mapImagesService.ts deleted file mode 100644 index 30714b82a..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/services/mapImagesService.ts +++ /dev/null @@ -1,66 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import * as mapboxgl from 'mapbox-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; -type MapImages = {name: string, url: string} - -export const Images : MapImages[] = [ - {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: mapboxgl.Map, callback?: ImagesLoaded) =>{ - - Images.forEach(image => { - - map.loadImage( - image.url, - function (error: any, img: any) { - if (error) throw error; - map.addImage(image.name, img); - allImagesLoaded(map, callback); - }); - }); -} - -const allImagesLoaded = (map: mapboxgl.Map, callback?: ImagesLoaded) =>{ - - const loadedImages = Images.map(image =>{ - return map.hasImage(image.name); - }); - - const allImagesLoaded = loadedImages.filter(el => !el); - if(allImagesLoaded.length===0){ - callback && callback(true); - } -}
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/services/settingsService.ts b/sdnr/wt/odlux/apps/networkMapApp/src/services/settingsService.ts deleted file mode 100644 index 2a2f09466..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/services/settingsService.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { NetworkMapSettings, NetworkMapThemes, NetworkSettings } from "../model/settings"; -import { requestRest } from "../../../../framework/src/services/restService"; - - class SettingsService{ - - public getMapSettings = async () =>{ - const result = await requestRest<any>("/userdata", {method: "GET"}); - return result; - } - - public getMapThemes = async () =>{ - const result = await requestRest<NetworkMapThemes>("/userdata/networkMapThemes", {method: "GET"}); - return result; - } - - public updateMapSettings = async (newElement: NetworkMapSettings) =>{ - - const result = await requestRest<NetworkMapSettings>("/userdata/networkMap", {method: "PUT", body: JSON.stringify(newElement.networkMap)}); - return result; - } - - - } - - export const settingsService = new SettingsService();
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/styles/index.css b/sdnr/wt/odlux/apps/networkMapApp/src/styles/index.css deleted file mode 100644 index ec2585e8c..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/styles/index.css +++ /dev/null @@ -1,13 +0,0 @@ -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; -} diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/styles/mapbox-gl.css b/sdnr/wt/odlux/apps/networkMapApp/src/styles/mapbox-gl.css deleted file mode 100644 index 03c479af9..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/styles/mapbox-gl.css +++ /dev/null @@ -1 +0,0 @@ -.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 diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/utils/mapLayers.ts b/sdnr/wt/odlux/apps/networkMapApp/src/utils/mapLayers.ts deleted file mode 100644 index 7ce4bfa92..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/utils/mapLayers.ts +++ /dev/null @@ -1,332 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import * as mapboxgl from 'mapbox-gl'; -import { Feature } from 'model/Feature'; -import { NetworkMapThemes, ThemeElement } from 'model/settings'; - -const fibreLinkColor = "#1154d9"; -const microwaveLinkColor = "#039903"; - -class MapLayerService { - - checkedLayers = false; - settings: NetworkMapThemes; - selectedTheme: string | null = null; - - public addBaseSources = (map: mapboxgl.Map, selectedPoint: Feature | null, selectedLine: 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("selectedLine")) { - const features = selectedLine !== null ? [selectedLine] : []; - 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 } - - }); - } - - if (!map.getSource("alarmedPoints")) { - map.addSource("alarmedPoints", { - type: 'geojson', - data: { type: "FeatureCollection", features: [] } - }); - } - } - - private addCircleLayer = (map: mapboxgl.Map, id: string, source: string, circleColor: string, radius: number, strokeWidth: number, outerColor: string) => { - - map.addLayer({ - id: id, - source: source, - type: 'circle', - paint: { - 'circle-color': circleColor, - 'circle-radius': radius, - 'circle-stroke-width': strokeWidth, - 'circle-stroke-color': outerColor - } - }); - } - - private addLineLayer = (map: mapboxgl.Map, id: string, source: string, color: string, width: number, filter: string[]) => { - - map.addLayer({ - 'id': id, - 'type': 'line', - 'source': source, - 'layout': { - 'line-join': 'round', - 'line-cap': 'round' - }, - 'paint': { - 'line-color': color, - 'line-width': width - }, - 'filter': filter - }); - } - - private addIconLayer = (map: mapboxgl.Map, id: string, source: string, iconName: string, iconSize: number, filter: (string | string[])[]) => { - map.addLayer({ - 'id': id, - 'type': 'symbol', - 'source': source, - 'layout': { - 'icon-allow-overlap': true, - 'icon-image': iconName, - 'icon-size': iconSize - - }, - 'filter': filter, - }); - } - - /** - * Pick the correct theme based on user selection - */ - private pickTheme = () => { - if (this.selectedTheme !== null) { - const result = this.settings.networkMapThemes.themes.find(el => el.key === this.selectedTheme); - if (result) - return result; - - } - - return this.settings.networkMapThemes.themes[0]; - - } - - public addBaseLayers = (map: mapboxgl.Map, themesettings?: ThemeElement) => { - - const theme = !themesettings ? this.pickTheme() : themesettings; - console.log("user selected theme: " + this.selectedTheme) - console.log("found theme:" + theme); - - this.addCommonLayers(map); - - this.addCircleLayer(map, 'points', 'points', theme.site, 7, 1, '#fff'); - this.addCircleLayer(map, 'selectedPoints', 'selectedPoints', theme.selectedSite, 9, 1, '#fff'); - this.addCircleLayer(map, 'alarmedPoints', 'alarmedPoints', '#CC0000', 9, 1, '#fff'); - } - - public addIconLayers = (map: mapboxgl.Map, selectedSiteId?: string) => { - - this.addCommonLayers(map); - this.createIconLayers(map, selectedSiteId); - } - - private createIconLayers = (map: mapboxgl.Map, selectedSiteId?: string) => { - - this.addIconLayer(map, 'point-lamps', 'points', 'lamp', 0.1, this.createFilter("street lamp", selectedSiteId)); - this.addIconLayer(map, 'point-building', 'points', 'house', 0.1, this.createFilter("high rise building", selectedSiteId)); - this.addIconLayer(map, 'point-data-center', 'points', 'data-center', 0.1, this.createFilter("data center", selectedSiteId)); - this.addIconLayer(map, 'point-factory', 'points', 'factory', 0.2, this.createFilter("factory", selectedSiteId)); - - - //select layers - this.addIconLayer(map, 'select-point-lamps', 'selectedPoints', 'lamp', 0.15, ['==', 'type', 'street lamp']); - this.addIconLayer(map, 'select-point-buildings', 'selectedPoints', 'house', 0.15, ['==', 'type', 'high rise building']); - this.addIconLayer(map, 'select-point-data-center', 'selectedPoints', 'data-center', 0.15, ['==', 'type', 'data center']); - this.addIconLayer(map, 'select-point-factory', 'selectedPoints', 'factory', 0.3, ['==', 'type', 'factory']); - - //alarm layers - this.addIconLayer(map, 'point-lamps-alarm', 'alarmedPoints', 'lamp-red', 0.3, this.createFilter("street lamp")); - this.addIconLayer(map, 'point-building-alarm', 'alarmedPoints', 'house-red', 0.3, this.createFilter("high rise building")); - this.addIconLayer(map, 'point-data-center-alarm', 'alarmedPoints', 'data-center-red', 0.3, this.createFilter("data center")); - this.addIconLayer(map, 'point-factory-alarm', 'alarmedPoints', 'factory-red', 0.45, this.createFilter("factory")); - - map.addLayer({ - id: 'point-remaining', - source: 'points', - type: 'circle', - 'filter': ['none', ['==', 'type', "high rise building"], ['==', 'type', "data center"], ['==', 'type', "factory"], ['==', 'type', "street lamp"]], - paint: { - 'circle-color': '#11b4da', - 'circle-radius': 7, - 'circle-stroke-width': 1, - 'circle-stroke-color': '#fff' - } - }); - } - - private addCommonLayers = (map: mapboxgl.Map, themesettings?: ThemeElement) => { - - const theme = !themesettings ? this.pickTheme() : themesettings; - - this.addLineLayer(map, 'microwave-lines', 'lines', theme.microwaveLink, 2, ['==', 'type', 'microwave']); - this.addLineLayer(map, 'fibre-lines', 'lines', theme.fiberLink, 2, ['==', 'type', 'fibre']); - this.addLineLayer(map, 'selectedLineMicrowave', 'selectedLine', theme.microwaveLink, 4, ['==', 'type', 'microwave']); - this.addLineLayer(map, 'selectedLineFibre', 'selectedLine', theme.fiberLink, 4, ['==', 'type', 'fibre']); - } - - public removeBaseLayers = (map: mapboxgl.Map) => { - - map.removeLayer("points"); - map.removeLayer("lines"); - map.removeLayer('selectedPoints'); - map.removeLayer('selectedLine'); - } - - private removeIconLayers = (map: mapboxgl.Map) => { - - map.removeLayer('point-building'); - map.removeLayer('point-lamps'); - map.removeLayer('point-data-center'); - map.removeLayer('point-factory'); - map.removeLayer('point-remaining'); - map.removeLayer('select-point-data-center'); - map.removeLayer('select-point-buildings'); - map.removeLayer('select-point-lamps'); - map.removeLayer('select-point-factory'); - map.removeLayer('point-building-alarm'); - map.removeLayer('point-lamps-alarm'); - map.removeLayer('point-data-center-alarm'); - map.removeLayer('point-factory-alarm'); - } - - - private createFilter = (type: 'street lamp' | 'high rise building' | 'data center' | 'factory', selectedSiteId?: string) => { - - return selectedSiteId === undefined ? ['==', 'type', type] : ["all", ['==', 'type', type], ['!=', 'id', selectedSiteId]] - } - - public showIconLayers = (map: mapboxgl.Map, show: boolean, selectedSiteId?: string) => { - - const zoom = map.getZoom(); - - if (show) { - - if (zoom > 11) { - - const bounds = map.getBounds(); - - if (map.getLayer('points') !== undefined && map.getLayer('point-lamps') === undefined && !this.checkedLayers) { - - // if sites don't have a type don't change layers to icons - const elements = map.queryRenderedFeatures(undefined, { - layers: ['points'], filter: ['has', 'type'] - }); - this.checkedLayers = true; - - if (elements.length > 0 && elements.length < 1000) { - - if (map.getLayer('point-lamps') === undefined) { - map.removeLayer('points'); - map.setLayoutProperty('alarmedPoints', 'visibility', 'none'); - map.setLayoutProperty('selectedPoints', 'visibility', 'none'); - this.createIconLayers(map, selectedSiteId); - //map.moveLayer('point-remaining','selectedPoints'); - - } - } - } - - } else { - this.swapLayersBack(map); - } - } else { - this.swapLayersBack(map); - } - } - - public swapLayersBack = (map: mapboxgl.Map) => { - this.checkedLayers = false; - const theme = this.pickTheme(); - - if (map.getLayer('selectedPoints') === undefined) { - this.addCircleLayer(map, 'selectedPoints', 'selectedPoints', theme.selectedSite, 9, 1, '#fff'); - - } - - if (map.getLayer('alarmedPoints') === undefined) { - this.addCircleLayer(map, 'alarmedPoints', 'alarmedPoints', '#CC0000', 9, 1, '#fff'); - - } - - - if (map.getLayer('points') === undefined) { - - map.setLayoutProperty('selectedPoints', 'visibility', 'visible'); - map.setLayoutProperty('alarmedPoints', 'visibility', 'visible'); - this.removeIconLayers(map); - - this.addCircleLayer(map, 'points', 'points', theme.site, 7, 1, '#fff'); - - - map.moveLayer('points', map.getLayer('selectedPoints').id); - } - } - - public changeMapOpacity = (map: mapboxgl.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: mapboxgl.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); - } - } -} - -const mapLayerService = new MapLayerService(); -export default mapLayerService; - diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/utils/mapUtils.ts b/sdnr/wt/odlux/apps/networkMapApp/src/utils/mapUtils.ts deleted file mode 100644 index da3e97ee3..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/utils/mapUtils.ts +++ /dev/null @@ -1,146 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -const EARTHRADIUSM = 6378137; - -type updatedCoordinates = { south: number, west: number, north: number, east: number }; - - -export const increaseBoundingBox = (map: mapboxgl.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; -} - - - -export const addDistance = (south: number, west: number, north: number, east: number, distanceKm: number): updatedCoordinates => { - - 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 { east: newEast, north: newNorth, south: newSouth, west: newWest }; - -} - - -//taken from https://www.movable-type.co.uk/scripts/latlong.html -export const calculateMidPoint = (lat1: number, lon1: number, lat2: number, lon2: number) =>{ - - 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); - - return [radians_to_degrees(lon3), radians_to_degrees(lat3)]; -} - - -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: mapboxgl.MapboxGeoJSONFeature[], 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; - } - -const radians_to_degrees = (radians:number) =>{ - - var pi = Math.PI; - return radians * (180/pi); -} - - 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; -} - - - diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/utils/utils.ts b/sdnr/wt/odlux/apps/networkMapApp/src/utils/utils.ts deleted file mode 100644 index 59085d499..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src/utils/utils.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { link } from "../model/link"; -import { Site } from "../model/site"; - - -export function isSite(data: link | Site): data is Site { - return (data as Site).location !== undefined; -}
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java b/sdnr/wt/odlux/apps/networkMapApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java deleted file mode 100644 index 43b072c4b..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -package org.onap.ccsdk.features.sdnr.wt.odlux.bundles; - -import org.onap.ccsdk.features.sdnr.wt.odlux.model.bundles.OdluxBundle; -import org.onap.ccsdk.features.sdnr.wt.odlux.model.bundles.OdluxBundleLoader; - -public class MyOdluxBundle extends OdluxBundle { - - @Override - public void initialize() { - super.initialize(); - } - - @Override - public void clean() { - super.clean(); - } - - @Override - public String getResourceFileContent(String filename) { - return super.getResourceFileContent(filename); - } - - @Override - public boolean hasResource(String filename) { - return super.hasResource(filename); - } - - @Override - public void setBundleName(String bundleName) { - super.setBundleName(bundleName); - } - - @Override - public void setLoader(OdluxBundleLoader loader) { - super.setLoader(loader); - } - - @Override - public String getBundleName() { - return super.getBundleName(); - } - - @Override - public OdluxBundleLoader getLoader() { - return super.getLoader(); - } - - public MyOdluxBundle() { - super(); - } -} diff --git a/sdnr/wt/odlux/apps/networkMapApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml b/sdnr/wt/odlux/apps/networkMapApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml deleted file mode 100644 index 4ede94477..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml +++ /dev/null @@ -1,9 +0,0 @@ -<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"> - <reference id="loadersvc" availability="mandatory" activation="eager" interface="org.onap.ccsdk.features.sdnr.wt.odlux.model.bundles.OdluxBundleLoader"/> - - <bean id="bundle" init-method="initialize" destroy-method="clean" class="org.onap.ccsdk.features.sdnr.wt.odlux.bundles.MyOdluxBundle"> - <property name="loader" ref="loadersvc"/> - <property name="bundleName" value="networkMapApp"/> - <property name="index" value="110"/> - </bean> -</blueprint>
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java b/sdnr/wt/odlux/apps/networkMapApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java deleted file mode 100644 index c319bb189..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -package org.onap.ccsdk.features.sdnr.wt.odlux.bundles.test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import org.junit.Test; -import org.onap.ccsdk.features.sdnr.wt.odlux.OdluxBundleLoaderImpl; -import org.onap.ccsdk.features.sdnr.wt.odlux.bundles.MyOdluxBundle; - -public class TestBundleRes { - - @Test - public void test() { - OdluxBundleLoaderImpl loader = OdluxBundleLoaderImpl.getInstance(); - MyOdluxBundle b = new MyOdluxBundle(); - b.setLoader(loader); - b.setIndex(0); - b.setBundleName("abc"); - b.initialize(); - assertTrue(loader.getNumberOfBundles()==1); - assertNotNull(b.getLoader()); - assertEquals("abc",b.getBundleName()); - assertTrue(b.hasResource("test.js")); - assertNotNull(b.getResourceFileContent("test.js")); - b.clean(); - assertTrue(loader.getNumberOfBundles()==0); - } - -} diff --git a/sdnr/wt/odlux/apps/networkMapApp/src2/test/resources/test.js b/sdnr/wt/odlux/apps/networkMapApp/src2/test/resources/test.js deleted file mode 100644 index b47fdc39f..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/src2/test/resources/test.js +++ /dev/null @@ -1,5 +0,0 @@ -asdac sad -as -d -sad - sadfa
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/tsconfig.json b/sdnr/wt/odlux/apps/networkMapApp/tsconfig.json deleted file mode 100644 index a66b5d828..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/tsconfig.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "./src", - "outDir": "./dist", - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "allowSyntheticDefaultImports": false, - "allowUnreachableCode": false, - "allowUnusedLabels": false, - "noFallthroughCasesInSwitch": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "strictNullChecks": true, - "pretty": true, - "newLine": "LF", - "module": "es2015", - "target": "es2016", - "moduleResolution": "node", - "experimentalDecorators": true, - "jsx": "preserve", - "lib": [ - "dom", - "es2015", - "es2016" - ], - "types": [ - "prop-types", - "react", - "react-dom" - ] - }, - "exclude": [ - "dist", - "node_modules" - ] -} diff --git a/sdnr/wt/odlux/apps/networkMapApp/webpack.config.js b/sdnr/wt/odlux/apps/networkMapApp/webpack.config.js deleted file mode 100644 index 5684040b7..000000000 --- a/sdnr/wt/odlux/apps/networkMapApp/webpack.config.js +++ /dev/null @@ -1,200 +0,0 @@ -/** - * Webpack 4 configuration file - * see https://webpack.js.org/configuration/ - * see https://webpack.js.org/configuration/dev-server/ - */ - -"use strict"; - -const path = require("path"); -const webpack = require("webpack"); -const CopyWebpackPlugin = require("copy-webpack-plugin"); -const TerserPlugin = require('terser-webpack-plugin'); - -// const __dirname = (path => path.replace(/^([a-z]\:)/, c => c.toUpperCase()))(process.__dirname()); - -module.exports = (env) => { - const distPath = path.resolve(__dirname, env === "release" ? "." : "../..", "dist"); - const frameworkPath = path.resolve(__dirname, env === "release" ? "../../framework" : "../..", "dist"); - return [{ - name: "App", - - mode: "none", //disable default behavior - - target: "web", - - context: path.resolve(__dirname, "src"), - - entry: { - networkMapApp: ["./pluginTransport.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: /\.(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: { - "/yang-schema/": { - target: "http://sdnr:8181", - secure: false - }, - "/userdata": { - target: "http://sdnr:8181", - secure: false - }, - "/userdata/": { - target: "http://sdnr:8181", - secure: false - }, - "/oauth2/": { - target: "http://sdnr:8181", - secure: false - }, - "/database/": { - target: "http://sdnr:8181", - secure: false - }, - "/restconf/": { - target: "http://sdnr:8181", - secure: false - }, - "/rests/": { - target: "http://sdnr:8181", - secure: false - }, - "/topology/": { - target: "http://localhost:3002", - secure: false - }, - "/sitedoc/": { - target: "http://localhost:3002", - secure: false, - pathRewrite(pathname) { - return pathname.replace(/^\/sitedoc/, '/topology/stadok') - } - }, - "/tiles/": { - target: "http://tile.openstreetmap.org", - secure: false - }, - "/help/": { - target: "http://sdnr:8181", - secure: false - }, - "/websocket": { - target: "http://sdnr:8181", - ws: true, - changeOrigin: true, - secure: false - } - } - - } - }]; -} diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/package.json b/sdnr/wt/odlux/apps/performanceHistoryApp/package.json index af38fb116..9a08612b8 100644 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/package.json +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/package.json @@ -21,23 +21,26 @@ "author": "Sai Neetha Phulmali", "license": "Apache-2.0", "dependencies": { - "@odlux/framework": "*", + "@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/connect-app": "*", - "react-chartjs-2": "2.7.6", - "chart.js": "2.8.0" + "@odlux/framework": "*", + "chart.js": "2.8.0", + "react-chartjs-2": "2.7.6" }, "peerDependencies": { - "@types/react": "17.0.3", - "@types/react-dom": "17.0.2", - "@types/react-router-dom": "5.1.7", - "@material-ui/core": "4.11.4", - "@material-ui/icons": "4.11.2", "@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.1", - "react-dom": "17.0.1", + "react": "17.0.2", + "react-dom": "17.0.2", "react-router-dom": "5.2.0" } -}
\ No newline at end of file +} diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/actions/deviceListActions.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/actions/deviceListActions.ts index 9637fec81..2b8e6e286 100644 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/actions/deviceListActions.ts +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/actions/deviceListActions.ts @@ -51,8 +51,8 @@ export class AllDeviceListLoadedAction extends BaseAction { */ export const loadAllDeviceListAsync = async (dispatch: Dispatch) => { dispatch(new LoadAllDeviceListAction()); - const deviceListFromPerfHistory: DeviceListType[] = await PerformanceHistoryService.getDeviceListfromPerf15minHistory().then(ne => (ne)) || []; - const deviceListFromPerf24History: DeviceListType[] = await PerformanceHistoryService.getDeviceListfromPerf24hHistory().then(ne => (ne)) || []; + const deviceListFromPerfHistory: DeviceListType[] = (await PerformanceHistoryService.getDeviceListfromPerf15minHistory().then(ne => (ne))) || []; + const deviceListFromPerf24History: DeviceListType[] = (await PerformanceHistoryService.getDeviceListfromPerf24hHistory().then(ne => (ne))) || []; deviceListFromPerf24History.forEach(deviceList24h => { if (deviceListFromPerfHistory.findIndex(deviceList15min => deviceList15min.nodeId === deviceList24h.nodeId) < 0) { deviceListFromPerfHistory.push(deviceList24h); diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/chartFilter.tsx b/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/chartFilter.tsx index e7583de12..e66e6c1e6 100644 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/chartFilter.tsx +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/chartFilter.tsx @@ -18,7 +18,9 @@ import * as React from 'react'; -import { makeStyles, TextField, Typography, Select, MenuItem, FormControl, InputLabel } from '@material-ui/core'; +import { TextField, Typography, Select, MenuItem, FormControl, InputLabel } from '@mui/material'; + +import makeStyles from '@mui/styles/makeStyles'; const styles = makeStyles({ filterInput: { @@ -44,19 +46,19 @@ const ChartFilter: React.FunctionComponent<filterProps> = (props) => { { props.isVisible && <div className={classes.filterContainer}> - <TextField inputProps={{'aria-label': 'radio-signal-filter'}} className={classes.filterInput} label="Radio Signal" value={props.filters.radioSignalId || ''} onChange={(event) => props.onFilterChanged("radioSignalId", event.target.value)} InputLabelProps={{ + <TextField variant="standard" inputProps={{'aria-label': 'radio-signal-filter'}} className={classes.filterInput} label="Radio Signal" value={props.filters.radioSignalId || ''} onChange={(event) => props.onFilterChanged("radioSignalId", event.target.value)} InputLabelProps={{ shrink: true, }} /> - <TextField inputProps={{'aria-label': 'scanner-id-filter'}} className={classes.filterInput} label="Scanner ID" value={props.filters.scannerId || ''} onChange={(event) => props.onFilterChanged("scannerId", event.target.value)} InputLabelProps={{ + <TextField variant="standard" inputProps={{'aria-label': 'scanner-id-filter'}} className={classes.filterInput} label="Scanner ID" value={props.filters.scannerId || ''} onChange={(event) => props.onFilterChanged("scannerId", event.target.value)} InputLabelProps={{ shrink: true, }} /> - <TextField inputProps={{'aria-label': 'end-time-filter'}} className={classes.filterInput} label="End Time" value={props.filters.timeStamp || ''} onChange={(event) => props.onFilterChanged("timeStamp", event.target.value)} InputLabelProps={{ + <TextField variant="standard" inputProps={{'aria-label': 'end-time-filter'}} className={classes.filterInput} label="End Time" value={props.filters.timeStamp || ''} onChange={(event) => props.onFilterChanged("timeStamp", event.target.value)} InputLabelProps={{ shrink: true, }} /> - <FormControl> + <FormControl variant="standard"> <InputLabel id="suspect-interval-label" shrink>Suspect Interval</InputLabel> - <Select aria-label="suspect-interval-selection" labelId="suspect-interval-label" value={suspectIntervalFlag || ''} onChange={(event) => props.onFilterChanged("suspectIntervalFlag", event.target.value as string)}> + <Select variant="standard" aria-label="suspect-interval-selection" labelId="suspect-interval-label" value={suspectIntervalFlag || ''} onChange={(event) => props.onFilterChanged("suspectIntervalFlag", event.target.value as string)}> <MenuItem value={undefined} aria-label="none">None</MenuItem> <MenuItem value={"true"} aria-label="true">true</MenuItem> <MenuItem value={"false"} aria-label="false">false</MenuItem> diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/ltpSelection.tsx b/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/ltpSelection.tsx index b6c14a9ce..ef6cfc712 100644 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/ltpSelection.tsx +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/ltpSelection.tsx @@ -17,13 +17,14 @@ */ import * as React from 'react'; -import { MenuItem, Select, FormControl, Typography } from '@material-ui/core'; -import { makeStyles } from '@material-ui/core/styles'; +import { MenuItem, Select, FormControl, Typography, SelectChangeEvent } from '@mui/material'; +import makeStyles from '@mui/styles/makeStyles'; import { LtpIds } from 'models/availableLtps'; import { Loader } from '../../../../framework/src/components/material-ui'; +import { Theme } from '@mui/material/styles'; -const useStyles = makeStyles(theme => ({ +const useStyles = makeStyles((theme: Theme) => ({ display: { display: "inline-block" }, @@ -47,24 +48,28 @@ const useStyles = makeStyles(theme => ({ } })); -type LtpSelectionProps = { selectedNE: string, error?: string, finishedLoading: boolean, selectedLtp: string, availableLtps: LtpIds[], onChangeLtp(event: React.ChangeEvent<HTMLSelectElement>): void, selectedTimePeriod: string, onChangeTimePeriod(event: React.ChangeEvent<HTMLSelectElement>): void }; +type LtpSelectionProps = { selectedNE: string, error?: string, finishedLoading: boolean, selectedLtp: string, + availableLtps: LtpIds[], + onChangeLtp(event: SelectChangeEvent<HTMLSelectElement | string> ): void, + selectedTimePeriod: string, + onChangeTimePeriod(event: SelectChangeEvent<HTMLSelectElement | string> ): void }; export const LtpSelection = (props: LtpSelectionProps) => { const classes = useStyles(); return ( <> <h3>Selected Network Element: {props.selectedNE} </h3> - <FormControl className={classes.display}> + <FormControl variant="standard" className={classes.display}> <span> Select LTP </span> - <Select className={classes.selectDropdown} value={props.selectedLtp} onChange={props.onChangeLtp} aria-label="ltp-selection" > + <Select variant="standard" className={classes.selectDropdown} value={props.selectedLtp} onChange={props.onChangeLtp} aria-label="ltp-selection" > <MenuItem value={"-1"} aria-label="none"><em>--Select--</em></MenuItem> {props.availableLtps.map(ltp => (<MenuItem value={ltp.key} key={ltp.key} aria-label={ltp.key}>{ltp.key}</MenuItem>))} </Select> <span> Time-Period </span> - <Select className={classes.selectDropdown} value={props.selectedTimePeriod} onChange={props.onChangeTimePeriod} aria-label="time-period-selection"> + <Select variant="standard" className={classes.selectDropdown} value={props.selectedTimePeriod} onChange={props.onChangeTimePeriod} aria-label="time-period-selection"> <MenuItem value={"15min"} aria-label="15minutes">15min</MenuItem> <MenuItem value={"24hours"} aria-label="24hours">24hours</MenuItem> </Select> diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/toggleContainer.tsx b/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/toggleContainer.tsx index 88dc9fd11..8696fe4d6 100644 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/toggleContainer.tsx +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/components/toggleContainer.tsx @@ -17,14 +17,14 @@ */ import * as React from 'react'; -import ToggleButton from '@material-ui/lab/ToggleButton'; -import ToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup'; -import BarChartIcon from '@material-ui/icons/BarChart'; -import TableChartIcon from '@material-ui/icons/TableChart'; -import { makeStyles } from '@material-ui/core'; -import Tooltip from '@material-ui/core/Tooltip'; +import ToggleButton from '@mui/material/ToggleButton'; +import ToggleButtonGroup from '@mui/material/ToggleButtonGroup'; +import BarChartIcon from '@mui/icons-material/BarChart'; +import TableChartIcon from '@mui/icons-material/TableChart'; +import makeStyles from '@mui/styles/makeStyles'; +import Tooltip from '@mui/material/Tooltip'; import ChartFilter from './chartFilter' -import FilterListIcon from '@material-ui/icons/FilterList'; +import FilterListIcon from '@mui/icons-material/FilterList'; const styles = makeStyles({ toggleButtonContainer: { @@ -67,20 +67,20 @@ const ToggleContainer: React.FunctionComponent<toggleProps> = (props) => { <div className={classes.toggleButtonContainer} > <ToggleButtonGroup className={classes.subViewGroup} size="medium" value={props.selectedValue} exclusive onChange={handleChange}> <ToggleButton aria-label="display-chart" key={1} value="chart"> - <Tooltip title="Chart"> + <Tooltip disableInteractive title="Chart"> <BarChartIcon /> </Tooltip> </ToggleButton> <ToggleButton aria-label="display-table" key={2} value="table"> - <Tooltip title="Table"> + <Tooltip disableInteractive title="Table"> <TableChartIcon /> </Tooltip> </ToggleButton> </ToggleButtonGroup> <ToggleButtonGroup className={classes.filterGroup} onChange={handleFilterChange} > - <ToggleButton aria-label="show-filter" selected={props.showFilter as boolean} disabled={props.selectedValue !== "chart"}> - <Tooltip title={props.showFilter ? 'Hide filter' : 'Show available filter'}> + <ToggleButton value="" aria-label="show-filter" selected={props.showFilter as boolean} disabled={props.selectedValue !== "chart"}> + <Tooltip disableInteractive title={props.showFilter ? 'Hide filter' : 'Show available filter'}> <FilterListIcon /> </Tooltip> </ToggleButton> diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/views/performanceHistoryApplication.tsx b/sdnr/wt/odlux/apps/performanceHistoryApp/src/views/performanceHistoryApplication.tsx index b0fd54c42..b33b442d3 100644 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/views/performanceHistoryApplication.tsx +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/views/performanceHistoryApplication.tsx @@ -17,10 +17,13 @@ */ import * as React from 'react'; -import { createStyles, Theme, withStyles, WithStyles } from '@material-ui/core/styles'; -import FormControl from '@material-ui/core/FormControl'; -import MenuItem from '@material-ui/core/MenuItem'; -import Select from '@material-ui/core/Select'; +import { Theme } from '@mui/material/styles'; +import { WithStyles } from '@mui/styles'; +import createStyles from '@mui/styles/createStyles'; +import withStyles from '@mui/styles/withStyles'; +import FormControl from '@mui/material/FormControl'; +import MenuItem from '@mui/material/MenuItem'; +import Select from '@mui/material/Select'; import connect, { Connect, IDispatcher } from '../../../../framework/src/flux/connect'; import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; @@ -50,7 +53,7 @@ import { createSignalToInterferencePreActions, signalToInterferenceReloadAction, import { createCrossPolarDiscriminationPreActions, crossPolarDiscriminationReloadAction, createCrossPolarDiscriminationActions } from '../handlers/crossPolarDiscriminationHandler'; import { MaterialTable, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; -import { AppBar, Tabs, Tab } from '@material-ui/core'; +import { AppBar, Tabs, Tab, SelectChangeEvent } from '@mui/material'; import LtpSelection from '../components/ltpSelection'; import { ResetAllSubViewsAction } from '../actions/toggleActions'; import { ReloadAction } from '../actions/reloadAction'; @@ -152,7 +155,7 @@ class PerformanceHistoryComponent extends React.Component<PerformanceHistoryComp }; } - onChangeTabs = (event: React.ChangeEvent<{}>, newValue: PanelId) => { + onChangeTabs = (event: React.SyntheticEvent, newValue: PanelId) => { const nextActivePanel = newValue; this.changeTabs(nextActivePanel); } @@ -244,8 +247,8 @@ class PerformanceHistoryComponent extends React.Component<PerformanceHistoryComp {this.state.showPanels && <> - <AppBar position="static" > - <Tabs value={activePanel} onChange={this.onChangeTabs} variant="scrollable" scrollButtons="auto" aria-label="performance-data-tabs"> + <AppBar enableColorOnDark position="static" > + <Tabs indicatorColor="secondary" textColor="inherit" value={activePanel} onChange={this.onChangeTabs} variant="scrollable" scrollButtons="auto" aria-label="performance-data-tabs"> <Tab label="Performance Data" value="PerformanceData" aria-label="performance-data" /> <Tab label="Receive Level" value="ReceiveLevel" aria-label="receive-level" /> <Tab label="Transmission Power" value="TransmissionPower" aria-label="transmission-power" /> @@ -411,25 +414,25 @@ class PerformanceHistoryComponent extends React.Component<PerformanceHistoryComp /** * Function which handles the time period changes. */ - private handleTimePeriodChange = (event: React.ChangeEvent<HTMLSelectElement>) => { + private handleTimePeriodChange = (event: SelectChangeEvent<HTMLSelectElement>) => { const selectedTimeInterval = event.target.value === "15min" ? PmDataInterval.pmInterval15Min : PmDataInterval.pmInterval24Hours; this.setState({ - selectedTimePeriod: event.target.value, + selectedTimePeriod: event.target.value as string, }); this.props.timeIntervalChange(selectedTimeInterval); - this.props.getDistinctLtpsIds(this.state.selectedNetworkElement, event.target.value, this.state.selectedLtp, undefined, this.resetLtpDropdown); - this.preFilterChangeAndReload(this.state.selectedNetworkElement, event.target.value, this.state.selectedLtp); + this.props.getDistinctLtpsIds(this.state.selectedNetworkElement, event.target.value as string, this.state.selectedLtp, undefined, this.resetLtpDropdown); + this.preFilterChangeAndReload(this.state.selectedNetworkElement, event.target.value as string, this.state.selectedLtp); } /** * Function which handles the ltp changes. */ - private handleLtpChange = (event: React.ChangeEvent<HTMLSelectElement>) => { + private handleLtpChange = (event:SelectChangeEvent<HTMLSelectElement> ) => { if (event.target.value === "-1") { this.setState({ @@ -440,9 +443,9 @@ class PerformanceHistoryComponent extends React.Component<PerformanceHistoryComp } else if (event.target.value !== this.state.selectedLtp) { this.setState({ showPanels: true, - selectedLtp: event.target.value + selectedLtp: event.target.value as string }); - this.preFilterChangeAndReload(this.state.selectedNetworkElement, this.state.selectedTimePeriod, event.target.value); + this.preFilterChangeAndReload(this.state.selectedNetworkElement, this.state.selectedTimePeriod, event.target.value as string); } } diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/webpack.config.js b/sdnr/wt/odlux/apps/performanceHistoryApp/webpack.config.js index 5faf69e83..8f2192f12 100644 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/webpack.config.js +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/webpack.config.js @@ -85,7 +85,7 @@ module.exports = (env) => { manifest: require(path.resolve(frameworkPath, "app-manifest.json")), sourceType: "umd2" }), - ...(env === "release") ? [ + ...(env === "release" ? [ new webpack.DefinePlugin({ "process.env": { NODE_ENV: "'production'", @@ -103,7 +103,7 @@ module.exports = (env) => { from: 'index.html', to: distPath }]), - ] + ]) ], devServer: { |