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 --- .../odlux/apps/helpApp/src/components/subMenuEntry.tsx | 14 +++++++------- .../apps/helpApp/src/handlers/helpAppRootHandler.ts | 4 ++-- sdnr/wt/odlux/apps/helpApp/src/index.html | 2 +- sdnr/wt/odlux/apps/helpApp/src/plugin.tsx | 10 +++++----- sdnr/wt/odlux/apps/helpApp/src/services/helpService.ts | 4 ++-- sdnr/wt/odlux/apps/helpApp/src/views/helpApplication.tsx | 16 ++++++++-------- 6 files changed, 25 insertions(+), 25 deletions(-) (limited to 'sdnr/wt/odlux/apps/helpApp/src') 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; 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> = (props) => { return props.helpToc ? ( - ) - : ( - Loading ... - ) + : ( + Loading ... + ) }; 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(); }); 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) => { 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 { // 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(`/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('/help/?meta'); + const result = await requestRest('/help/?meta', undefined, false); if (result !== false) { const mapNodesCollection = (col: TocNodeCollection): TocTreeNode[] => { return Object.keys(col).reduce ((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; @@ -22,27 +22,27 @@ class HelpApplicationComponent extends React.Component { // check if href is rel or abs const absUrlMatch = href.trim().match(/^https?:\/\//i); - return `${ text }` + return `${text}` }; this.renderer.image = (href: string, title: string) => { - return `${ title }` + return `${title}` }; } render(): JSX.Element { return this.props.content ? ( - + ) : (

Loading ...

) } -- cgit 1.2.3-korg