From a2b6dd34d73bf432846dc59c6f57dd59a03aff9b Mon Sep 17 00:00:00 2001 From: Michael Dürre Date: Thu, 8 Sep 2022 09:45:06 +0200 Subject: update odlux sources MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit update basic odlux functionality for kohn Issue-ID: CCSDK-3765 Signed-off-by: Michael Dürre Change-Id: I3723c9c2f35b9012ba537920b294a54bb556cbc6 Signed-off-by: Michael Dürre --- sdnr/wt/odlux/framework/src/views/about.tsx | 6 +----- sdnr/wt/odlux/framework/src/views/frame.tsx | 3 ++- sdnr/wt/odlux/framework/src/views/login.tsx | 28 ++++++++++++++++++++++++---- sdnr/wt/odlux/framework/src/views/test.tsx | 2 +- 4 files changed, 28 insertions(+), 11 deletions(-) (limited to 'sdnr/wt/odlux/framework/src/views') diff --git a/sdnr/wt/odlux/framework/src/views/about.tsx b/sdnr/wt/odlux/framework/src/views/about.tsx index 1b6135e5f..ac219708d 100644 --- a/sdnr/wt/odlux/framework/src/views/about.tsx +++ b/sdnr/wt/odlux/framework/src/views/about.tsx @@ -38,10 +38,8 @@ type odluxVersion= {version:string,build:string, framework: string, faultApp: string, helpApp: string, inventoryApp: string, - linkCalculationApp: string, maintenanceApp: string, mediatorApp: string, - networkMapApp: string, permanceHistoryApp: string }}; @@ -74,8 +72,6 @@ class AboutComponent extends React.Component { `| InventoryApp | ${data.applications.inventoryApp}|\n `+ `| EventLogApp | ${data.applications.eventLogApp}|\n `+ `| MediatorApp | ${data.applications.mediatorApp}|\n `+ - `| NetworkMapApp | ${data.applications.networkMapApp}|\n `+ - `| LinkCalculatorApp | ${data.applications.linkCalculationApp}|\n `+ `| HelpApp | ${data.applications.helpApp}|\n `; } @@ -167,7 +163,7 @@ class AboutComponent extends React.Component {
{ this.state.isContentLoadedSucessfully &&
- { diff --git a/sdnr/wt/odlux/framework/src/views/frame.tsx b/sdnr/wt/odlux/framework/src/views/frame.tsx index 278fbe1db..4676f5ac2 100644 --- a/sdnr/wt/odlux/framework/src/views/frame.tsx +++ b/sdnr/wt/odlux/framework/src/views/frame.tsx @@ -22,7 +22,8 @@ import { Theme } from '@mui/material/styles'; import { WithStyles } from '@mui/styles'; import withStyles from '@mui/styles/withStyles'; import createStyles from '@mui/styles/createStyles'; -import { faHome, faAddressBook, faSignInAlt, faCog } from '@fortawesome/free-solid-svg-icons'; +import { faHome, faAddressBook, faSignInAlt, faCog } from '@fortawesome/free-solid-svg-icons' + import { SnackbarProvider } from 'notistack'; import { ConfirmProvider } from 'material-ui-confirm'; diff --git a/sdnr/wt/odlux/framework/src/views/login.tsx b/sdnr/wt/odlux/framework/src/views/login.tsx index 8eb7a6c0f..e037edf82 100644 --- a/sdnr/wt/odlux/framework/src/views/login.tsx +++ b/sdnr/wt/odlux/framework/src/views/login.tsx @@ -119,6 +119,7 @@ interface ILoginState { password: string; scope: string; message: string; + isServerReady: boolean; providers: { id: string; title: string; @@ -141,6 +142,7 @@ class LoginComponent extends React.Component { scope: 'sdn', message: '', providers: null, + isServerReady: false }; } @@ -148,6 +150,13 @@ class LoginComponent extends React.Component { if (this.props.authentication === "oauth" && (this.props.externalLoginProviders == null || this.props.externalLoginProviders.length === 0)){ this.props.updateExternalProviders(); } + + authenticationService.getServerReadyState().then(result =>{ + this.setState({isServerReady: result}); + }) + + + } private setExternalProviderAnchor = (el: HTMLElement | null) => { @@ -262,10 +271,21 @@ class LoginComponent extends React.Component { this.props.history.replace(returnTo && returnTo[1] || "/"); } else { - this.setState({ - message: "Could not log in. Please check your credentials or ask your administrator for assistence.", - password: "" - }) + + if(!this.state.isServerReady){ + const ready = await authenticationService.getServerReadyState(); + if(ready){ + this.setState({isServerReady: true}); + }else{ + this.setState({message: "Login is currently not possible. Please re-try in a few minutes. If the problem persits, ask your administrator for assistence."}); + } + + }else{ + this.setState({ + message: "Could not log in. Please check your credentials or ask your administrator for assistence.", + password: "" + }) + } } } } diff --git a/sdnr/wt/odlux/framework/src/views/test.tsx b/sdnr/wt/odlux/framework/src/views/test.tsx index 84c4094c3..72f8d2cc8 100644 --- a/sdnr/wt/odlux/framework/src/views/test.tsx +++ b/sdnr/wt/odlux/framework/src/views/test.tsx @@ -848,7 +848,7 @@ const TestComponent = (props: WithComponents & WithStylesClient Side Table Demo -