From 62e834802dae0bd15504785503060d7875c7b4ad Mon Sep 17 00:00:00 2001 From: Herbert Eiselt Date: Thu, 28 Mar 2019 19:00:35 +0100 Subject: Add SDN-R odlux performance A UI displaying performance monitoring data Change-Id: I2a9c28549aee1bcac366354c343a63f884bf09e0 Issue-ID: SDNC-585 Signed-off-by: Herbert Eiselt --- sdnr/wt/odlux/apps/mediatorApp/pom.xml | 10 ++++--- .../src/actions/mediatorConfigActions.ts | 16 +++++----- .../src/actions/mediatorServerActions.ts | 6 ++-- .../src/components/editMediatorConfigDialog.tsx | 22 +++++++------- .../src/components/editMediatorServerDialog.tsx | 34 +++++++++++----------- .../handlers/avaliableMediatorServersHandler.ts | 4 +-- .../src/handlers/mediatorAppRootHandler.ts | 2 +- sdnr/wt/odlux/apps/mediatorApp/src/plugin.tsx | 14 ++++----- .../mediatorApp/src/views/mediatorApplication.tsx | 14 ++++----- .../src/views/mediatorServerSelection.tsx | 10 +++---- 10 files changed, 66 insertions(+), 66 deletions(-) (limited to 'sdnr/wt/odlux/apps/mediatorApp') diff --git a/sdnr/wt/odlux/apps/mediatorApp/pom.xml b/sdnr/wt/odlux/apps/mediatorApp/pom.xml index 826e6b586..a8c9cea9f 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/pom.xml +++ b/sdnr/wt/odlux/apps/mediatorApp/pom.xml @@ -1,11 +1,13 @@ - + org.onap.ccsdk.parent odlparent - 1.2.2-SNAPSHOT - + 1.1.2 + 4.0.0 @@ -126,7 +128,7 @@ org.onap.ccsdk.features.sdnr.wt.odlux.model.*,com.opensymphony.* - + diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/actions/mediatorConfigActions.ts b/sdnr/wt/odlux/apps/mediatorApp/src/actions/mediatorConfigActions.ts index fcfc63e22..058110614 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/actions/mediatorConfigActions.ts +++ b/sdnr/wt/odlux/apps/mediatorApp/src/actions/mediatorConfigActions.ts @@ -38,11 +38,11 @@ export class RemoveMediatorConfig extends BaseAction { export const startMediatorByNameAsyncActionCreator = (name: string) => (dispatch: Dispatch, getState: () => IApplicationStoreState) => { dispatch(new SetMediatorBusyByName(name, true)); - const { mediatorApp: { mediatorServerState: { url } } } = getState(); + const { mediator: { mediatorServerState: { url } } } = getState(); if (url) { mediatorService.startMediatorByName(url, name).then(msg => { dispatch(new AddSnackbarNotification({ message: msg + ' ' + name, options: { variant: 'info' } })); - // since there is no notification, a timeout will be need here + // since there is no notification, a timeout will be need here window.setTimeout(() => { mediatorService.getMediatorServerConfigByName(url, name).then(config => { if (config) { @@ -62,11 +62,11 @@ export const startMediatorByNameAsyncActionCreator = (name: string) => (dispatch export const stopMediatorByNameAsyncActionCreator = (name: string) => (dispatch: Dispatch, getState: () => IApplicationStoreState) => { dispatch(new SetMediatorBusyByName(name, true)); - const { mediatorApp: { mediatorServerState: { url } } } = getState(); + const { mediator: { mediatorServerState: { url } } } = getState(); if (url) { mediatorService.stopMediatorByName(url, name).then(msg => { dispatch(new AddSnackbarNotification({ message: msg + ' ' + name, options: { variant: 'info' } })); - // since there is no notification, a timeout will be need here + // since there is no notification, a timeout will be need here window.setTimeout(() => { mediatorService.getMediatorServerConfigByName(url, name).then(config => { if (config) { @@ -86,11 +86,11 @@ export const stopMediatorByNameAsyncActionCreator = (name: string) => (dispatch: export const addMediatorConfigAsyncActionCreator = (config: MediatorConfig) => (dispatch: Dispatch, getState: () => IApplicationStoreState) => { const { Name: name } = config; - const { mediatorApp: { mediatorServerState: { url } } } = getState(); + const { mediator: { mediatorServerState: { url } } } = getState(); if (url) { mediatorService.createMediatorConfig(url, config).then(msg => { dispatch(new AddSnackbarNotification({ message: msg + ' ' + name, options: { variant: 'info' } })); - // since there is no notification, a timeout will be need here + // since there is no notification, a timeout will be need here window.setTimeout(() => { mediatorService.getMediatorServerConfigByName(url, name).then(config => { if (config) { @@ -112,11 +112,11 @@ export const updateMediatorConfigAsyncActionCreator = (config: MediatorConfig) = export const removeMediatorConfigAsyncActionCreator = (config: MediatorConfig) => (dispatch: Dispatch, getState: () => IApplicationStoreState) => { const { Name: name } = config; - const { mediatorApp: { mediatorServerState: { url } } } = getState(); + const { mediator: { mediatorServerState: { url } } } = getState(); if (url) { mediatorService.deleteMediatorConfigByName(url, name).then(msg => { dispatch(new AddSnackbarNotification({ message: msg + ' ' + name, options: { variant: 'info' } })); - // since there is no notification, a timeout will be need here + // since there is no notification, a timeout will be need here window.setTimeout(() => { mediatorService.getMediatorServerConfigByName(url, config.Name).then(config => { if (!config) { diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/actions/mediatorServerActions.ts b/sdnr/wt/odlux/apps/mediatorApp/src/actions/mediatorServerActions.ts index b8e8c7e94..e7719aac5 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/actions/mediatorServerActions.ts +++ b/sdnr/wt/odlux/apps/mediatorApp/src/actions/mediatorServerActions.ts @@ -62,11 +62,11 @@ export const initializeMediatorServerAsyncActionCreator = (serverId: string) => if (!mediatorServer) { dispatch(new SetMediatorServerBusy(false)); dispatch(new AddSnackbarNotification({ message: `Error loading mediator server [${serverId}]`, options: { variant: 'error' } })); - dispatch(new NavigateToApplication("mediatorApp")); - return; + dispatch(new NavigateToApplication("mediator")); + return; } dispatch(new SetMediatorServerInfo(mediatorServer.name, mediatorServer.url)); - + mediatorService.getMediatorServerVersion(mediatorServer.url).then(versionInfo => { dispatch(new SetMediatorServerVersion(versionInfo)); }); diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/components/editMediatorConfigDialog.tsx b/sdnr/wt/odlux/apps/mediatorApp/src/components/editMediatorConfigDialog.tsx index c1167c4a7..ef12ee253 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/components/editMediatorConfigDialog.tsx +++ b/sdnr/wt/odlux/apps/mediatorApp/src/components/editMediatorConfigDialog.tsx @@ -78,7 +78,7 @@ export enum EditMediatorConfigDialogMode { } const mapProps = (state: IApplicationStoreState) => ({ - supportedDevices: state.mediatorApp.mediatorServerState.supportedDevices + supportedDevices: state.mediator.mediatorServerState.supportedDevices }); const mapDispatch = (dispatcher: IDispatcher) => ({ @@ -182,7 +182,7 @@ class EditMediatorConfigDialogComponent extends React.Component - { this.state.activeTab === 0 ? + {this.state.activeTab === 0 ? { this.setState({ Name: event.target.value }); }} /> Device @@ -204,15 +204,15 @@ class EditMediatorConfigDialogComponent extends React.Component ({`${device.vendor} - ${device.device} (${device.version || '0.0.0'}) `}))} - { this.setState({ DeviceIp: event.target.value }); }} /> - { this.setState({ DevicePort: +event.target.value }); }} /> + { this.setState({ DeviceIp: event.target.value }); }} /> + { this.setState({ DevicePort: +event.target.value }); }} /> { this.setState({ TrapPort: +event.target.value }); }} /> { this.setState({ NcUsername: event.target.value }); }} /> { this.setState({ NcPassword: event.target.value }); }} /> { this.setState({ NcPort: +event.target.value }); }} /> : null} - { this.state.activeTab === 1 ? - { this.state.ODLConfig && this.state.ODLConfig.length > 0 + {this.state.activeTab === 1 ? + {this.state.ODLConfig && this.state.ODLConfig.length > 0 ? this.state.ODLConfig.map((cfg, ind) => { const panelId = `panel-${ind}`; const deleteButton = ( { @@ -227,15 +227,15 @@ class EditMediatorConfigDialogComponent extends React.Component this.setState({ activeOdlConfig: (this.state.activeOdlConfig === id) ? "" : (id || "") })} >
- + Protocoll - (e.target.value))} inputProps={{ name: `protocol-${ind}`, id: `protocol-${ind}` }} fullWidth > http https e.target.value)} /> - +e.target.value)} /> + +e.target.value)} />
e.target.value)} /> @@ -310,6 +310,4 @@ class EditMediatorConfigDialogComponent extends React.Component & { +type EditMediatorServerDialogComponentProps = Connect & { mode: EditMediatorServerDialogMode; mediatorServer: MediatorServer; onClose: () => void; }; -type EditMediatorServerDialogComponentState = MediatorServer ; +type EditMediatorServerDialogComponentState = MediatorServer; class EditMediatorServerDialogComponent extends React.Component { - constructor(props: EditMediatorServerDialogComponentProps) { + constructor (props: EditMediatorServerDialogComponentProps) { super(props); - + this.state = { ...this.props.mediatorServer }; @@ -91,18 +91,18 @@ class EditMediatorServerDialogComponent extends React.Component - { setting.dialogTitle } + + {setting.dialogTitle} - { setting.dialogDescription } + {setting.dialogDescription} - { this.setState({_id: event.target.value}); } } /> - { this.setState({name: event.target.value}); } }/> - { this.setState({url: event.target.value}); } }/> - + {/* { this.setState({_id: event.target.value}); } } /> */} + { this.setState({ name: event.target.value }); }} /> + { this.setState({ url: event.target.value }); }} /> + - - + + }} color="secondary"> {setting.cancelButtonText} ) diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/handlers/avaliableMediatorServersHandler.ts b/sdnr/wt/odlux/apps/mediatorApp/src/handlers/avaliableMediatorServersHandler.ts index 447e5e5bd..244a9d185 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/handlers/avaliableMediatorServersHandler.ts +++ b/sdnr/wt/odlux/apps/mediatorApp/src/handlers/avaliableMediatorServersHandler.ts @@ -15,5 +15,5 @@ export const { createProperties: createAvaliableMediatorServersProperties, reloadAction: avaliableMediatorServersReloadAction, - // set value action, to change a value -} = createExternal(avaliableMediatorServersSearchHandler, appState => appState.mediatorApp.avaliableMediatorServers); \ No newline at end of file + // set value action, to change a value +} = createExternal(avaliableMediatorServersSearchHandler, appState => appState.mediator.avaliableMediatorServers); \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/handlers/mediatorAppRootHandler.ts b/sdnr/wt/odlux/apps/mediatorApp/src/handlers/mediatorAppRootHandler.ts index bfebbdf5d..b64c0a72a 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/handlers/mediatorAppRootHandler.ts +++ b/sdnr/wt/odlux/apps/mediatorApp/src/handlers/mediatorAppRootHandler.ts @@ -13,7 +13,7 @@ export interface IMediatorAppStoreState { declare module '../../../../framework/src/store/applicationStore' { interface IApplicationStoreState { - mediatorApp: IMediatorAppStoreState + mediator: IMediatorAppStoreState } } diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/plugin.tsx b/sdnr/wt/odlux/apps/mediatorApp/src/plugin.tsx index 0878fee65..7f440a2ae 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/plugin.tsx +++ b/sdnr/wt/odlux/apps/mediatorApp/src/plugin.tsx @@ -16,7 +16,7 @@ import { MediatorApplication } from "./views/mediatorApplication"; import { MediatorServerSelection } from "./views/mediatorServerSelection"; import { initializeMediatorServerAsyncActionCreator } from "./actions/mediatorServerActions"; -let currentMediatorServerId: string | undefined = undefined; +let currentMediatorServerId: string | undefined = undefined; const mapDisp = (dispatcher: IDispatcher) => ({ loadMediatorServer : (mediatorServerId: string) => dispatcher.dispatch(initializeMediatorServerAsyncActionCreator(mediatorServerId)), @@ -24,7 +24,7 @@ const mapDisp = (dispatcher: IDispatcher) => ({ const MediatorServerRouteAdapter = connect(undefined, mapDisp)((props: RouteComponentProps<{ mediatorServerId: string }> & Connect) => { if (currentMediatorServerId !== props.match.params.mediatorServerId) { - // route parameter has changed + // route parameter has changed currentMediatorServerId = props.match.params.mediatorServerId || undefined; // Hint: This timeout is need, since it is not recommended to change the state while rendering is in progress ! window.setTimeout(() => { @@ -42,21 +42,21 @@ type AppProps = RouteComponentProps & Connect; const App = (props: AppProps) => ( - - + + -); +); const FinalApp = withRouter(connect()(App)); export function register() { const applicationApi = applicationManager.registerApplication({ - name: "mediatorApp", + name: "mediator", icon: faGlobe, rootComponent: FinalApp, rootActionHandler: mediatorAppRootHandler, - menuEntry: "Mediator App" + menuEntry: "Mediator" }); // prefetch all avaliable mediator servers diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorApplication.tsx b/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorApplication.tsx index 6b1532cc8..95dee8df7 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorApplication.tsx +++ b/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorApplication.tsx @@ -50,13 +50,13 @@ const styles = (theme: Theme) => createStyles({ }); const mapProps = (state: IApplicationStoreState) => ({ - serverName: state.mediatorApp.mediatorServerState.name, - serverUrl: state.mediatorApp.mediatorServerState.url, - serverVersion: state.mediatorApp.mediatorServerState.serverVersion, - mediatorVersion: state.mediatorApp.mediatorServerState.mediatorVersion, - configurations: state.mediatorApp.mediatorServerState.configurations, - supportedDevices: state.mediatorApp.mediatorServerState.supportedDevices, - busy: state.mediatorApp.mediatorServerState.busy, + serverName: state.mediator.mediatorServerState.name, + serverUrl: state.mediator.mediatorServerState.url, + serverVersion: state.mediator.mediatorServerState.serverVersion, + mediatorVersion: state.mediator.mediatorServerState.mediatorVersion, + configurations: state.mediator.mediatorServerState.configurations, + supportedDevices: state.mediator.mediatorServerState.supportedDevices, + busy: state.mediator.mediatorServerState.busy, }); const mapDispatch = (dispatcher: IDispatcher) => ({ diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorServerSelection.tsx b/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorServerSelection.tsx index 38bbdecb4..4e221b613 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorServerSelection.tsx +++ b/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorServerSelection.tsx @@ -37,7 +37,7 @@ const mapProps = (state: IApplicationStoreState) => ({ const mapDispatch = (dispatcher: IDispatcher) => ({ mediatorServersActions: createAvaliableMediatorServersActions(dispatcher.dispatch), - selectMediatorServer: (mediatorServerId: string) => mediatorServerId && dispatcher.dispatch(new NavigateToApplication("mediatorApp", mediatorServerId)), + selectMediatorServer: (mediatorServerId: string) => mediatorServerId && dispatcher.dispatch(new NavigateToApplication("mediator", mediatorServerId)), }); const emptyMediatorServer: MediatorServer = { @@ -77,7 +77,7 @@ class MediatorServerSelectionComponent extends React.Component - - @@ -103,7 +103,7 @@ class MediatorServerSelectionComponent extends React.Component, server: MediatorServer) => { event.preventDefault(); @@ -121,7 +121,7 @@ class MediatorServerSelectionComponent extends React.Component { this.setState({ -- cgit 1.2.3-korg