aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/apps/helpApp
diff options
context:
space:
mode:
authorHerbert Eiselt <herbert.eiselt@highstreet-technologies.com>2019-03-28 19:00:35 +0100
committerHerbert Eiselt <herbert.eiselt@highstreet-technologies.com>2019-03-28 19:01:01 +0100
commit62e834802dae0bd15504785503060d7875c7b4ad (patch)
tree0b3d3ae0c62b279773a2aea3daebcad5f8ad78a2 /sdnr/wt/odlux/apps/helpApp
parentf2bb490d9c82decbdb50c1e4db1be2f34b28d097 (diff)
Add SDN-R odlux performance
A UI displaying performance monitoring data Change-Id: I2a9c28549aee1bcac366354c343a63f884bf09e0 Issue-ID: SDNC-585 Signed-off-by: Herbert Eiselt <herbert.eiselt@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/odlux/apps/helpApp')
-rw-r--r--sdnr/wt/odlux/apps/helpApp/pom.xml8
-rw-r--r--sdnr/wt/odlux/apps/helpApp/src/components/subMenuEntry.tsx14
-rw-r--r--sdnr/wt/odlux/apps/helpApp/src/handlers/helpAppRootHandler.ts4
-rw-r--r--sdnr/wt/odlux/apps/helpApp/src/index.html2
-rw-r--r--sdnr/wt/odlux/apps/helpApp/src/plugin.tsx10
-rw-r--r--sdnr/wt/odlux/apps/helpApp/src/services/helpService.ts4
-rw-r--r--sdnr/wt/odlux/apps/helpApp/src/views/helpApplication.tsx16
-rw-r--r--sdnr/wt/odlux/apps/helpApp/webpack.config.js22
8 files changed, 50 insertions, 30 deletions
diff --git a/sdnr/wt/odlux/apps/helpApp/pom.xml b/sdnr/wt/odlux/apps/helpApp/pom.xml
index 3e1d4e0ca..9115d896a 100644
--- a/sdnr/wt/odlux/apps/helpApp/pom.xml
+++ b/sdnr/wt/odlux/apps/helpApp/pom.xml
@@ -1,11 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<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">
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>odlparent</artifactId>
<version>1.2.2-SNAPSHOT</version>
- <relativePath/>
+ <relativePath />
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
@@ -125,7 +127,7 @@
<configuration>
<instructions>
<Import-Package>org.onap.ccsdk.features.sdnr.wt.odlux.model.*,com.opensymphony.*</Import-Package>
- <Private-Package/>
+ <Private-Package></Private-Package>
</instructions>
</configuration>
</plugin>
diff --git a/sdnr/wt/odlux/apps/helpApp/src/components/subMenuEntry.tsx b/sdnr/wt/odlux/apps/helpApp/src/components/subMenuEntry.tsx
index 72bb39e39..2328b12b3 100644
--- a/sdnr/wt/odlux/apps/helpApp/src/components/subMenuEntry.tsx
+++ b/sdnr/wt/odlux/apps/helpApp/src/components/subMenuEntry.tsx
@@ -13,23 +13,23 @@ import { TocTreeNode } from '../models/tocNode';
const TocTree = TreeView as any as TreeViewCtorType<TocTreeNode>;
const mapProps = (state: IApplicationStoreState) => ({
- helpToc: state.helpApp.toc,
- helpBusy: state.helpApp.busy
+ helpToc: state.help.toc,
+ helpBusy: state.help.busy
});
const mapDisp = (dispatcher: IDispatcher) => ({
- requestDocument: (node: TocTreeNode) => dispatcher.dispatch(new NavigateToApplication("helpApp", node.uri))
+ requestDocument: (node: TocTreeNode) => dispatcher.dispatch(new NavigateToApplication("help", node.uri))
});
const SubMenuEntryComponent: React.SFC<Connect<typeof mapProps, typeof mapDisp>> = (props) => {
return props.helpToc
? (
- <TocTree items={ props.helpToc } contentProperty={ "label" } childrenProperty={ "nodes" } depthOffset={ 1 }
+ <TocTree items={ props.helpToc } contentProperty={ "label" } childrenProperty={ "nodes" } depthOffset={ 1 }
useFolderIcons={ false } enableSearchBar={ false } onItemClick={ props.requestDocument } />
)
- : (
- <ListItemText >Loading ...</ListItemText>
- )
+ : (
+ <ListItemText >Loading ...</ListItemText>
+ )
};
export const SubMenuEntry = connect(mapProps, mapDisp)(SubMenuEntryComponent);
diff --git a/sdnr/wt/odlux/apps/helpApp/src/handlers/helpAppRootHandler.ts b/sdnr/wt/odlux/apps/helpApp/src/handlers/helpAppRootHandler.ts
index efdc6e83d..b9ddc50af 100644
--- a/sdnr/wt/odlux/apps/helpApp/src/handlers/helpAppRootHandler.ts
+++ b/sdnr/wt/odlux/apps/helpApp/src/handlers/helpAppRootHandler.ts
@@ -14,14 +14,14 @@ export interface IHelpAppStoreState {
declare module '../../../../framework/src/store/applicationStore' {
interface IApplicationStoreState {
- helpApp: IHelpAppStoreState
+ help: IHelpAppStoreState
}
}
const helpAppStoreStateInit: IHelpAppStoreState = {
busy: false,
toc: undefined,
- content: undefined,
+ content: undefined,
currentPath: undefined
};
diff --git a/sdnr/wt/odlux/apps/helpApp/src/index.html b/sdnr/wt/odlux/apps/helpApp/src/index.html
index 2d20410e0..6865db051 100644
--- a/sdnr/wt/odlux/apps/helpApp/src/index.html
+++ b/sdnr/wt/odlux/apps/helpApp/src/index.html
@@ -17,7 +17,7 @@
// run the application
require(["app", "helpApp"], function (app, helpApp) {
helpApp.register();
- app("./app.tsx")
+ app("./app.tsx").runApplication();
});
</script>
</body>
diff --git a/sdnr/wt/odlux/apps/helpApp/src/plugin.tsx b/sdnr/wt/odlux/apps/helpApp/src/plugin.tsx
index d1cf80804..f871ab9d9 100644
--- a/sdnr/wt/odlux/apps/helpApp/src/plugin.tsx
+++ b/sdnr/wt/odlux/apps/helpApp/src/plugin.tsx
@@ -1,6 +1,6 @@
// app configuration and main entry point for the app
-import * as React from "react";
+import * as React from "react";
import { withRouter, RouteComponentProps, Route, Switch, Redirect } from 'react-router-dom';
import { faFirstAid } from '@fortawesome/free-solid-svg-icons'; // select app icon
@@ -18,7 +18,7 @@ import { SubMenuEntry } from "./components/subMenuEntry";
import '!style-loader!css-loader!highlight.js/styles/default.css';
const mapProps = (state: IApplicationStoreState) => ({
-
+
});
const mapDisp = (dispatcher: IDispatcher) => ({
@@ -31,7 +31,7 @@ let currentHelpPath: string | undefined = undefined;
const HelpApplicationRouteAdapter = connect(mapProps, mapDisp)((props: RouteComponentProps<{ '0'?: string }> & Connect<typeof mapProps, typeof mapDisp>) => {
if (currentHelpPath !== props.match.params["0"]) {
- // route parameter has changed
+ // route parameter has changed
currentHelpPath = props.match.params["0"] || undefined;
// Hint: This timeout is need, since it is not recommended to change the state while rendering is in progress !
window.setTimeout(() => {
@@ -54,7 +54,7 @@ const App = withRouter((props: RouteComponentProps) => (
export async function register() {
const applicationApi = applicationManager.registerApplication({
- name: "helpApp",
+ name: "help",
icon: faFirstAid,
rootComponent: App,
rootActionHandler: helpAppRootHandler,
@@ -63,7 +63,7 @@ export async function register() {
});
// start the initial toc request after the application store is initalized
- const store = await applicationApi.applicationStoreInitialized;
+ const store = await applicationApi.applicationStoreInitialized;
store.dispatch(requestTocAsyncAction);
} \ No newline at end of file
diff --git a/sdnr/wt/odlux/apps/helpApp/src/services/helpService.ts b/sdnr/wt/odlux/apps/helpApp/src/services/helpService.ts
index 480cdd04e..800e0b47f 100644
--- a/sdnr/wt/odlux/apps/helpApp/src/services/helpService.ts
+++ b/sdnr/wt/odlux/apps/helpApp/src/services/helpService.ts
@@ -9,7 +9,7 @@ class HelpService {
public async getDocument(path: string): Promise<string | null> {
// check if the result is allready in the cache
if (this.documents[path]) return Promise.resolve(this.documents[path]);
-
+
// request the document
const result = await requestRest<string>(`/help/${ path }`.replace(/\/{2,}/i, '/'));
if (result) {
@@ -23,7 +23,7 @@ class HelpService {
if (this.tocNodeCollection) return Promise.resolve(this.tocNodeCollection);
// request the table of contents
- const result = await requestRest<TocNodeCollection>('/help/?meta');
+ const result = await requestRest<TocNodeCollection>('/help/?meta', undefined, false);
if (result !== false) {
const mapNodesCollection = (col: TocNodeCollection): TocTreeNode[] => {
return Object.keys(col).reduce <TocTreeNode[]>((acc, key) => {
diff --git a/sdnr/wt/odlux/apps/helpApp/src/views/helpApplication.tsx b/sdnr/wt/odlux/apps/helpApp/src/views/helpApplication.tsx
index dedb93607..54f708458 100644
--- a/sdnr/wt/odlux/apps/helpApp/src/views/helpApplication.tsx
+++ b/sdnr/wt/odlux/apps/helpApp/src/views/helpApplication.tsx
@@ -11,8 +11,8 @@ import { Markdown } from "../components/markdown";
import '!style-loader!css-loader!github-markdown-css/github-markdown.css'
const mapProps = (state: IApplicationStoreState) => ({
- content: state.helpApp.content,
- currentPath: state.helpApp.currentPath
+ content: state.help.content,
+ currentPath: state.help.currentPath
});
type HelpApplicationComponentProps = Connect<typeof mapProps>;
@@ -22,27 +22,27 @@ class HelpApplicationComponent extends React.Component<HelpApplicationComponentP
/**
* Initializes a new instance.
*/
- constructor(props: HelpApplicationComponentProps) {
+ constructor (props: HelpApplicationComponentProps) {
super(props);
-
+
this.renderer = new marked.Renderer();
this.renderer.link = (href: string, title: string, text: string) => {
// check if href is rel or abs
const absUrlMatch = href.trim().match(/^https?:\/\//i);
- return `<a href="${ absUrlMatch ? href : resolvePath('#/helpApp/', this.props.currentPath || '/', href) }" title="${ title }" >${ text }</a>`
+ return `<a href="${absUrlMatch ? href : resolvePath('#/help/', this.props.currentPath || '/', href)}" title="${title}" >${text}</a>`
};
this.renderer.image = (href: string, title: string) => {
- return `<img src="${ resolvePath('/help/', this.props.currentPath || '/', href) }" alt="${ title }" />`
+ return `<img src="${resolvePath('/help/', this.props.currentPath || '/', href)}" alt="${title}" />`
};
}
render(): JSX.Element {
return this.props.content ? (
- <Markdown text={ this.props.content } markedOptions={ { renderer: this.renderer } } className="markdown-body"
- style={{ maxWidth: "960px", margin: "1.5em auto" }} />
+ <Markdown text={this.props.content} markedOptions={{ renderer: this.renderer }} className="markdown-body"
+ style={{ maxWidth: "960px", margin: "1.5em auto" }} />
) : (<h2>Loading ...</h2>)
}
diff --git a/sdnr/wt/odlux/apps/helpApp/webpack.config.js b/sdnr/wt/odlux/apps/helpApp/webpack.config.js
index fdae7d957..f9448a310 100644
--- a/sdnr/wt/odlux/apps/helpApp/webpack.config.js
+++ b/sdnr/wt/odlux/apps/helpApp/webpack.config.js
@@ -143,8 +143,26 @@ module.exports = (env) => {
colors: true
},
proxy: {
- "/help": {
- target: "http://localhost:8181",
+ "/oauth2/": {
+ target: "http://localhost:3000",
+ secure: false
+ },
+ "/database/": {
+ target: "http://localhost:3000",
+ secure: false
+ },
+ "/restconf/": {
+ target: "http://localhost:3000",
+ secure: false
+ },
+ "/help/": {
+ target: "http://localhost:3000",
+ secure: false
+ },
+ "/websocket/": {
+ target: "http://localhost:3000",
+ ws: true,
+ changeOrigin: true,
secure: false
}
}