aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/apps/connectApp
diff options
context:
space:
mode:
authorAijana Schumann <aijana.schumann@highstreet-technologies.com>2021-12-06 15:09:15 +0100
committerAijana Schumann <aijana.schumann@highstreet-technologies.com>2021-12-06 15:12:24 +0100
commit152cb381ea2c915c762416092337ce1d8589d1c6 (patch)
tree63b71c8343f9292281f5d7f5eac14342fec06402 /sdnr/wt/odlux/apps/connectApp
parent8ea94e1210671b941f84abfe16e248cfa086fe49 (diff)
Update ODLUX
Update login view, add logout after user session ends, add user settings, several bugfixes Issue-ID: CCSDK-3540 Signed-off-by: Aijana Schumann <aijana.schumann@highstreet-technologies.com> Change-Id: I21137756b204287e25766a9646bf2faf7bad9d35
Diffstat (limited to 'sdnr/wt/odlux/apps/connectApp')
-rw-r--r--sdnr/wt/odlux/apps/connectApp/src/actions/connectionStatusCountActions.ts9
-rw-r--r--sdnr/wt/odlux/apps/connectApp/src/components/editNetworkElementDialog.tsx4
-rw-r--r--sdnr/wt/odlux/apps/connectApp/src/components/infoNetworkElementDialog.tsx2
-rw-r--r--sdnr/wt/odlux/apps/connectApp/src/handlers/connectionStatusCountHandler.ts9
-rw-r--r--sdnr/wt/odlux/apps/connectApp/src/index.html2
-rw-r--r--sdnr/wt/odlux/apps/connectApp/src/pluginConnect.tsx25
-rw-r--r--sdnr/wt/odlux/apps/connectApp/webpack.config.js22
7 files changed, 49 insertions, 24 deletions
diff --git a/sdnr/wt/odlux/apps/connectApp/src/actions/connectionStatusCountActions.ts b/sdnr/wt/odlux/apps/connectApp/src/actions/connectionStatusCountActions.ts
index e1e16b704..43bae720c 100644
--- a/sdnr/wt/odlux/apps/connectApp/src/actions/connectionStatusCountActions.ts
+++ b/sdnr/wt/odlux/apps/connectApp/src/actions/connectionStatusCountActions.ts
@@ -26,13 +26,14 @@ export class ConnectionStatusCountBaseAction extends Action { }
export class SetConnectionStatusCountAction extends ConnectionStatusCountBaseAction {
constructor(public ConnectedCount: number, public ConnectingCount: number, public DisconnectedCount: number,
- public MountedCount: number, public UnableToConnectCount: number, public UndefinedCount: number, public UnmountedCount: number, public totalCount: number) {
+ public MountedCount: number, public UnableToConnectCount: number, public UndefinedCount: number, public UnmountedCount: number, public totalCount: number, public isLoadingConnectionStatusChart: boolean) {
super();
}
}
export const refreshConnectionStatusCountAsyncAction = async (dispatch: Dispatch) => {
+ dispatch(new SetConnectionStatusCountAction(0, 0, 0, 0, 0, 0, 0, 0, true));
const result = await getConnectionStatusCountStateFromDatabase().catch(_ => null);
if (result) {
const statusAction = new SetConnectionStatusCountAction(
@@ -43,10 +44,12 @@ export const refreshConnectionStatusCountAsyncAction = async (dispatch: Dispatch
result["UnableToConnect"] || 0,
result["Undefined"] || 0,
result["Unmounted"] || 0,
- result["total"] || 0
+ result["total"] || 0,
+ false
);
dispatch(statusAction);
return;
+ } else {
+ dispatch(new SetConnectionStatusCountAction(0, 0, 0, 0, 0, 0, 0, 0, false));
}
- dispatch(new SetConnectionStatusCountAction(0, 0, 0, 0, 0, 0, 0, 0));
}
diff --git a/sdnr/wt/odlux/apps/connectApp/src/components/editNetworkElementDialog.tsx b/sdnr/wt/odlux/apps/connectApp/src/components/editNetworkElementDialog.tsx
index df265c23d..061303976 100644
--- a/sdnr/wt/odlux/apps/connectApp/src/components/editNetworkElementDialog.tsx
+++ b/sdnr/wt/odlux/apps/connectApp/src/components/editNetworkElementDialog.tsx
@@ -233,8 +233,8 @@ class EditNetworkElementDialogComponent extends React.Component<EditNetworkEleme
{setting.enableUsernameEditor &&
<RadioGroup row aria-label="password-tls-key" name="password-tls-key" value={radioSelected}
onChange={this.handleRadioChange} >
- <FormControlLabel value='password' control={<Radio />} label="Password" onChange={this.onRadioSelect} />
- <FormControlLabel value='tlsKey' control={<Radio />} label="TlsKey" onChange={this.onRadioSelect} />
+ <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} />
</RadioGroup> || null}
{setting.enableUsernameEditor && showPasswordTextField &&
diff --git a/sdnr/wt/odlux/apps/connectApp/src/components/infoNetworkElementDialog.tsx b/sdnr/wt/odlux/apps/connectApp/src/components/infoNetworkElementDialog.tsx
index 9b71eb354..aeaaa91e7 100644
--- a/sdnr/wt/odlux/apps/connectApp/src/components/infoNetworkElementDialog.tsx
+++ b/sdnr/wt/odlux/apps/connectApp/src/components/infoNetworkElementDialog.tsx
@@ -113,7 +113,7 @@
<>
<Dialog open={this.props.mode !== InfoNetworkElementDialogMode.None} >
<DialogTitle id="form-dialog-title">{setting.dialogTitle + ' - ' + this.state.nodeId}</DialogTitle>
- <InfoElementTable stickyHeader tableId="info-element-table" asynchronus columns={[
+ <InfoElementTable stickyHeader isPopup tableId="info-element-table" asynchronus columns={[
{ property: "module", title: "Module", type: ColumnType.text, width:900 },
{
property: "revision", title: "Revision", type: ColumnType.custom, customControl: ({ rowData }) => {
diff --git a/sdnr/wt/odlux/apps/connectApp/src/handlers/connectionStatusCountHandler.ts b/sdnr/wt/odlux/apps/connectApp/src/handlers/connectionStatusCountHandler.ts
index 611786520..219a09617 100644
--- a/sdnr/wt/odlux/apps/connectApp/src/handlers/connectionStatusCountHandler.ts
+++ b/sdnr/wt/odlux/apps/connectApp/src/handlers/connectionStatusCountHandler.ts
@@ -26,7 +26,8 @@ export interface IConnectionStatusCount {
UnableToConnect: number,
Undefined: number,
Unmounted: number,
- total: number
+ total: number,
+ isLoadingConnectionStatusChart: boolean
}
const connectionStatusCountInit: IConnectionStatusCount = {
@@ -37,7 +38,8 @@ const connectionStatusCountInit: IConnectionStatusCount = {
UnableToConnect: 0,
Undefined: 0,
Unmounted: 0,
- total: 0
+ total: 0,
+ isLoadingConnectionStatusChart: false
};
export const connectionStatusCountHandler: IActionHandler<IConnectionStatusCount> = (state = connectionStatusCountInit, action) => {
@@ -50,7 +52,8 @@ export const connectionStatusCountHandler: IActionHandler<IConnectionStatusCount
UnableToConnect: action.UnableToConnectCount,
Undefined: action.UndefinedCount,
Unmounted: action.UnmountedCount,
- total: action.totalCount
+ total: action.totalCount,
+ isLoadingConnectionStatusChart: action.isLoadingConnectionStatusChart
}
}
diff --git a/sdnr/wt/odlux/apps/connectApp/src/index.html b/sdnr/wt/odlux/apps/connectApp/src/index.html
index 35dbdf71d..1a16876c9 100644
--- a/sdnr/wt/odlux/apps/connectApp/src/index.html
+++ b/sdnr/wt/odlux/apps/connectApp/src/index.html
@@ -19,7 +19,7 @@
connectApp.register();
faultApp.register();
inventoryApp.register();
- app("./app.tsx").configureApplication({ authentication:"oauth", enablePolicy: false, transportpceUrl:"http://test.de"});
+ app("./app.tsx").configureApplication({ authentication:"basic", enablePolicy: false, transportpceUrl:"http://test.de"});
app("./app.tsx").runApplication();
});
</script>
diff --git a/sdnr/wt/odlux/apps/connectApp/src/pluginConnect.tsx b/sdnr/wt/odlux/apps/connectApp/src/pluginConnect.tsx
index 1990cc03d..afca74664 100644
--- a/sdnr/wt/odlux/apps/connectApp/src/pluginConnect.tsx
+++ b/sdnr/wt/odlux/apps/connectApp/src/pluginConnect.tsx
@@ -35,6 +35,8 @@ import { PanelId } from "./models/panelId";
import { NetworkElementsList } from './components/networkElements'
let currentStatus: string | undefined = undefined;
+let refreshInterval: ReturnType<typeof window.setInterval> | null = null;
+
const mapProps = (state: IApplicationStoreState) => ({
currentProblemsProperties: createNetworkElementsProperties(state),
@@ -108,9 +110,26 @@ export function register() {
applicationApi.applicationStoreInitialized.then(store => {
store.dispatch(refreshConnectionStatusCountAsyncAction);
});
- window.setInterval(() => {
+
+
+ applicationApi.loginEvent.addHandler(e=>{
+ refreshInterval = startRefreshInterval() as any;
+ })
+
+ applicationApi.logoutEvent.addHandler(e=>{
+
applicationApi.applicationStoreInitialized.then(store => {
- store.dispatch(refreshConnectionStatusCountAsyncAction);
+ clearInterval(refreshInterval!);
});
- }, 15000);
+ })
+
+ const startRefreshInterval =() =>{
+ const refresh = window.setInterval(() => {
+ applicationApi.applicationStoreInitialized.then(store => {
+ store.dispatch(refreshConnectionStatusCountAsyncAction);
+ });
+ }, 15000);
+
+ return refresh;
+ }
} \ 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 df88a80a9..70ddd4932 100644
--- a/sdnr/wt/odlux/apps/connectApp/webpack.config.js
+++ b/sdnr/wt/odlux/apps/connectApp/webpack.config.js
@@ -131,49 +131,49 @@ module.exports = (env) => {
},
proxy: {
"/about": {
- target: "http://localhost:18181",
+ target: "http://sdnr:8181",
secure: false
},
"/yang-schema/": {
- target: "http://localhost:18181",
+ target: "http://sdnr:8181",
secure: false
},
"/oauth/": {
- target: "http://localhost:18181",
+ target: "http://sdnr:8181",
secure: false
},
"/database/": {
- target: "http://localhost:18181",
+ target: "http://sdnr:8181",
secure: false
},
"/restconf/": {
- target: "http://localhost:18181",
+ target: "http://sdnr:8181",
secure: false
},
"/rests/": {
- target: "http://localhost:18181",
+ target: "http://sdnr:8181",
secure: false
},
"/help/": {
- target: "http://localhost:18181",
+ target: "http://sdnr:8181",
secure: false
},
"/about/": {
- target: "http://localhost:18181",
+ target: "http://sdnr:8181",
secure: false
},
"/tree/": {
- target: "http://localhost:18181",
+ target: "http://sdnr:8181",
secure: false
},
"/websocket": {
- target: "http://localhost:18181",
+ target: "http://sdnr:8181",
ws: true,
changeOrigin: true,
secure: false
},
"/apidoc": {
- target: "http://localhost:18181",
+ target: "http://sdnr:8181",
ws: true,
changeOrigin: true,
secure: false