diff options
author | Aijana Schumann <aijana.schumann@highstreet-technologies.com> | 2020-08-12 12:28:06 +0200 |
---|---|---|
committer | Aijana Schumann <aijana.schumann@highstreet-technologies.com> | 2020-08-12 12:29:48 +0200 |
commit | 3d02271058d2e59a71e49afdd866462f7b6ab1c6 (patch) | |
tree | bb42b3428055136a4a8f5def9c63e412390d40ef /sdnr/wt/odlux | |
parent | cd29d2dd98b7c40bd4efb6a8705787ca35e99fe9 (diff) |
Switch odlux from Biermann-RestConf to RFC8040 interface
Switched rest-calls in odlux to use RFC8040 interface
Issue-ID: CCSDK-2565
Signed-off-by: Aijana Schumann <aijana.schumann@highstreet-technologies.com>
Change-Id: Ia59dd02bc6456bad648083146c0256f204e134d1
Diffstat (limited to 'sdnr/wt/odlux')
27 files changed, 235 insertions, 166 deletions
diff --git a/sdnr/wt/odlux/apps/configurationApp/src/actions/deviceActions.ts b/sdnr/wt/odlux/apps/configurationApp/src/actions/deviceActions.ts index dbe95e0d1..1db66c0d4 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/actions/deviceActions.ts +++ b/sdnr/wt/odlux/apps/configurationApp/src/actions/deviceActions.ts @@ -89,7 +89,8 @@ export const splitVPath = (vPath: string, vPathParser : RegExp): [string, string const getReferencedDataList = async (refPath: string, dataPath: string, modules: { [name: string]: Module }, views: ViewSpecification[]) => { const pathParts = splitVPath(refPath, /(?:(?:([^\/\:]+):)?([^\/]+))/g); // 1 = opt: namespace / 2 = property - let referencedModule = modules[pathParts[0][0]]; + const defaultNS = pathParts[0][0]; + let referencedModule = modules[defaultNS]; let dataMember: string; let view: ViewSpecification; @@ -121,14 +122,17 @@ const getReferencedDataList = async (refPath: string, dataPath: string, modules: throw new Error(`Server Error. Status: [${restResult.status}]\n${message || restResult.message || ''}`); } - let dataRaw = restResult.data[dataMember!]; + let dataRaw = restResult.data[`${defaultNS}:${dataMember!}`]; + if (dataRaw === undefined) { + dataRaw = restResult.data[dataMember!]; + } dataRaw = dataRaw instanceof Array ? dataRaw[0] : dataRaw; data = dataRaw && dataRaw[viewElement.label] || []; const keys: string[] = data.map((entry: { [key: string]: any } )=> entry[viewElement.key!]); - resultingDataUrls.push(...keys.map(key => `${dataUrl}/${viewElement.label.replace(/\//ig, "%2F")}/${key.replace(/\//ig, "%2F")}`)); + resultingDataUrls.push(...keys.map(key => `${dataUrl}/${viewElement.label.replace(/\//ig, "%2F")}=${key.replace(/\//ig, "%2F")}`)); } dataMember = viewElement.label; } else { @@ -149,7 +153,10 @@ const getReferencedDataList = async (refPath: string, dataPath: string, modules: const message = restResult.data && restResult.data.errors && restResult.data.errors.error && restResult.data.errors.error[0] && restResult.data.errors.error[0]["error-message"] || ""; throw new Error(`Server Error. Status: [${restResult.status}]\n${message || restResult.message || ''}`); } - let dataRaw = restResult.data[dataMember!]; + let dataRaw = restResult.data[`${defaultNS}:${dataMember!}`]; + if (dataRaw === undefined) { + dataRaw = restResult.data[dataMember!]; + } dataRaw = dataRaw instanceof Array ? dataRaw[0] : dataRaw; @@ -227,7 +234,7 @@ const flatenViewElements = (defaultNS: string | null, parentPath: string, elemen export const updateViewActionAsyncCreator = (vPath: string) => async (dispatch: Dispatch, getState: () => IApplicationStoreState) => { const pathParts = splitVPath(vPath, /(?:([^\/\["]+)(?:\[([^\]]*)\])?)/g); // 1 = property / 2 = optional key const { configuration: { deviceDescription: { nodeId, modules, views } }, framework: { navigationState } } = getState(); - let dataPath = `/restconf/config/network-topology:network-topology/topology/topology-netconf/node/${nodeId}/yang-ext:mount`; + let dataPath = `/rests/data/network-topology:network-topology/topology=topology-netconf/node=${nodeId}/yang-ext:mount`; let inputViewSpecification: ViewSpecification | undefined = undefined; let outputViewSpecification: ViewSpecification | undefined = undefined; @@ -302,7 +309,11 @@ export const updateViewActionAsyncCreator = (vPath: string) => async (dispatch: } extractList = true; } else { - dataPath += `/${property}${key ? `/${key.replace(/\//ig, "%2F")}` : ""}`; + // normal case + dataPath += `/${property}${key ? `=${key.replace(/\//ig, "%2F")}` : ""}`; + + // in case of the root element the required namespace will be added later, + // while extracting the data dataMember = namespace === defaultNS ? viewElement.label : `${namespace}:${viewElement.label}`; @@ -352,7 +363,11 @@ export const updateViewActionAsyncCreator = (vPath: string) => async (dispatch: const message = restResult.data.errors && restResult.data.errors.error && restResult.data.errors.error[0] && restResult.data.errors.error[0]["error-message"] || ""; throw new Error(`Server Error. Status: [${restResult.status}]\n${message}`); } else { - data = restResult.data[dataMember!]; // extract dataMember + // https://tools.ietf.org/html/rfc7951#section-4 the root element may countain a namesapce or not ! + data = restResult.data[`${defaultNS}:${dataMember!}`]; + if (data === undefined) { + data = restResult.data[dataMember!]; // extract dataMember w/o namespace + } } // extract the first element list[key] @@ -405,7 +420,7 @@ export const updateViewActionAsyncCreator = (vPath: string) => async (dispatch: export const updateDataActionAsyncCreator = (vPath: string, data: any) => async (dispatch: Dispatch, getState: () => IApplicationStoreState) => { const pathParts = splitVPath(vPath, /(?:([^\/\["]+)(?:\[([^\]]*)\])?)/g); // 1 = property / 2 = optional key const { configuration: { deviceDescription: { nodeId, views } } } = getState(); - let dataPath = `/restconf/config/network-topology:network-topology/topology/topology-netconf/node/${nodeId}/yang-ext:mount`; + let dataPath = `/rests/data/network-topology:network-topology/topology=topology-netconf/node=${nodeId}/yang-ext:mount`; let viewSpecification: ViewSpecification = views[0]; let viewElement: ViewElement; let dataMember: string; @@ -445,7 +460,7 @@ export const updateDataActionAsyncCreator = (vPath: string, data: any) => async } } - dataPath += `/${property}${key ? `/${key.replace(/\//ig, "%2F")}` : ""}`; + dataPath += `/${property}${key ? `=${key.replace(/\//ig, "%2F")}` : ""}`; dataMember = viewElement.label; embedList = false; @@ -466,7 +481,7 @@ export const updateDataActionAsyncCreator = (vPath: string, data: any) => async // do not extract root member (0) if (viewSpecification && viewSpecification.id !== "0") { - const updateResult = await restService.setConfigData(dataPath, { [dataMember!]: data }); // extractDataMember + const updateResult = await restService.setConfigData(dataPath, { [`${defaultNS}:${dataMember!}`]: data }); // addDataMember using defaultNS if (updateResult.status < 200 || updateResult.status > 299) { const message = updateResult.data && updateResult.data.errors && updateResult.data.errors.error && updateResult.data.errors.error[0] && updateResult.data.errors.error[0]["error-message"] || ""; throw new Error(`Server Error. Status: [${updateResult.status}]\n${message || updateResult.message || ''}`); @@ -499,7 +514,7 @@ export const updateDataActionAsyncCreator = (vPath: string, data: any) => async export const removeElementActionAsyncCreator = (vPath: string) => async (dispatch: Dispatch, getState: () => IApplicationStoreState) => { const pathParts = splitVPath(vPath, /(?:([^\/\["]+)(?:\[([^\]]*)\])?)/g); // 1 = property / 2 = optional key const { configuration: { deviceDescription: { nodeId, views } } } = getState(); - let dataPath = `/restconf/config/network-topology:network-topology/topology/topology-netconf/node/${nodeId}/yang-ext:mount`; + let dataPath = `/rests/data/network-topology:network-topology/topology=topology-netconf/node=${nodeId}/yang-ext:mount`; let viewSpecification: ViewSpecification = views[0]; let viewElement: ViewElement; @@ -529,7 +544,7 @@ export const removeElementActionAsyncCreator = (vPath: string) => async (dispatc } } - dataPath += `/${property}${key ? `/${key.replace(/\//ig, "%2F")}` : ""}`; + dataPath += `/${property}${key ? `=${key.replace(/\//ig, "%2F")}` : ""}`; if (viewElement && "viewId" in viewElement) { viewSpecification = views[+viewElement.viewId]; @@ -555,7 +570,7 @@ export const removeElementActionAsyncCreator = (vPath: string) => async (dispatc export const executeRpcActionAsyncCreator = (vPath: string, data: any) => async (dispatch: Dispatch, getState: () => IApplicationStoreState) => { const pathParts = splitVPath(vPath, /(?:([^\/\["]+)(?:\[([^\]]*)\])?)/g); // 1 = property / 2 = optional key const { configuration: { deviceDescription: { nodeId, views }, viewDescription: oldViewDescription } } = getState(); - let dataPath = `/restconf/operations/network-topology:network-topology/topology/topology-netconf/node/${nodeId}/yang-ext:mount`; + let dataPath = `/rests/operations/network-topology:network-topology/topology=topology-netconf/node=${nodeId}/yang-ext:mount`; let viewSpecification: ViewSpecification = views[0]; let viewElement: ViewElement; let dataMember: string; @@ -595,7 +610,7 @@ export const executeRpcActionAsyncCreator = (vPath: string, data: any) => async // } } - dataPath += `/${property}${key ? `/${key.replace(/\//ig, "%2F")}` : ""}`; + dataPath += `/${property}${key ? `=${key.replace(/\//ig, "%2F")}` : ""}`; dataMember = viewElement.label; embedList = false; @@ -637,8 +652,7 @@ export const executeRpcActionAsyncCreator = (vPath: string, data: any) => async const message = updateResult.data && updateResult.data.errors && updateResult.data.errors.error && updateResult.data.errors.error[0] && updateResult.data.errors.error[0]["error-message"] || ""; throw new Error(`Server Error. Status: [${updateResult.status}]\n${message || updateResult.message || ''}`); } - const viewData = { ...oldViewDescription.viewData, output: updateResult.data || null}; - dispatch(new UpdatOutputData(viewData)); + dispatch(new UpdatOutputData(updateResult.data)); } else { throw new Error(`There is NO RPC specified.`); } diff --git a/sdnr/wt/odlux/apps/configurationApp/src/services/restServices.ts b/sdnr/wt/odlux/apps/configurationApp/src/services/restServices.ts index b260f1ffb..eb2c67c26 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/services/restServices.ts +++ b/sdnr/wt/odlux/apps/configurationApp/src/services/restServices.ts @@ -23,10 +23,10 @@ import { NetworkElementConnection } from "../models/networkElementConnection"; class RestService { public async getCapabilitiesByMoutId(nodeId: string): Promise<{ "capabilityOrigin": string, "capability": string }[] | null> { - const path = `/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/${nodeId}`; - const capabilitiesResult = await requestRest<{ node: { "node-id": string, "netconf-node-topology:available-capabilities": { "available-capability": { "capabilityOrigin": string, "capability": string }[] }}[] }>(path, { method: "GET" }); - return capabilitiesResult && capabilitiesResult.node && capabilitiesResult.node.length > 0 && - capabilitiesResult.node[0]["netconf-node-topology:available-capabilities"]["available-capability"].map(obj => convertPropertyNames(obj, replaceHyphen)) || null; + const path = `/rests/data/network-topology:network-topology/topology=topology-netconf/node=${nodeId}`; + const capabilitiesResult = await requestRest<{"network-topology:node": {"node-id": string, "netconf-node-topology:available-capabilities": { "available-capability": { "capability-origin": string, "capability": string }[] }}[] }>(path, { method: "GET" }); + return capabilitiesResult && capabilitiesResult["network-topology:node"] && capabilitiesResult["network-topology:node"].length > 0 && + capabilitiesResult["network-topology:node"][0]["netconf-node-topology:available-capabilities"]["available-capability"].map<any>(obj => convertPropertyNames(obj, replaceHyphen)) || null; } public async getMountedNetworkElementByMountId(nodeId: string): Promise<NetworkElementConnection | null> { @@ -34,13 +34,13 @@ class RestService { // const connectedNetworkElement = await requestRest<NetworkElementConnection>(path, { method: "GET" }); // return connectedNetworkElement || null; - const path = "/restconf/operations/data-provider:read-network-element-connection-list"; - const body = { "input": { "filter": [{ "property": "node-id", "filtervalue": nodeId }], "sortorder": [], "pagination": { "size": 1, "page": 1 } } }; - const networkElementResult = await requestRest<{ output: { data: NetworkElementConnection[] } }>(path, { method: "POST", body: JSON.stringify(body) }); - return networkElementResult && networkElementResult.output && networkElementResult.output.data && - networkElementResult.output.data.map(obj => convertPropertyNames(obj, replaceHyphen))[0] || null; + const path = "/rests/operations/data-provider:read-network-element-connection-list"; + const body = { "data-provider:input": { "filter": [{ "property": "node-id", "filtervalue": nodeId }], "sortorder": [], "pagination": { "size": 1, "page": 1 } } }; + const networkElementResult = await requestRest<{ "data-provider:output": { data: NetworkElementConnection[] } }>(path, { method: "POST", body: JSON.stringify(body) }); + return networkElementResult && networkElementResult["data-provider:output"] && networkElementResult["data-provider:output"].data && + networkElementResult["data-provider:output"].data.map(obj => convertPropertyNames(obj, replaceHyphen))[0] || null; } - + /** Reads the config data by restconf path. * @param path The restconf path to be used for read. * @returns The data. diff --git a/sdnr/wt/odlux/apps/configurationApp/webpack.config.js b/sdnr/wt/odlux/apps/configurationApp/webpack.config.js index dccf34919..329eb00f4 100644 --- a/sdnr/wt/odlux/apps/configurationApp/webpack.config.js +++ b/sdnr/wt/odlux/apps/configurationApp/webpack.config.js @@ -107,8 +107,11 @@ module.exports = (env) => { ] ], + watchOptions: { + ignored: /node_modules/ + }, + devServer: { - public: "http://localhost:3100", contentBase: frameworkPath, compress: true, @@ -125,31 +128,39 @@ module.exports = (env) => { stats: { colors: true }, - proxy: { - "/oauth2/": { - target: "http://localhost:48181", - secure: false - }, + proxy: { "/yang-schema/": { - target: "http://localhost:48181", + target: "http://10.20.6.29:48181", + secure: false + }, + "/oauth2/": { + target: "http://10.20.6.29:48181", secure: false }, "/database/": { - target: "http://localhost:48181", + target: "http://10.20.6.29:48181", secure: false }, "/restconf/": { - target: "http://localhost:48181", + target: "http://10.20.6.29:48181", + secure: false + }, + "/rests/": { + target: "http://10.20.6.29:48181", secure: false }, "/help/": { - target: "http://localhost:48181", + target: "http://10.20.6.29:48181", + secure: false + }, + "/tree/": { + target: "http://10.20.6.29:48181", secure: false }, "/websocket": { - target: "http://localhost:48181", + target: "http://10.20.6.29:48181", ws: true, - changeOrigin: false, + changeOrigin: true, secure: false } } diff --git a/sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts b/sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts index 41449e83f..2aa9e3958 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts +++ b/sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts @@ -33,9 +33,9 @@ class ConnectService { * Inserts a network elements. */ public async createNetworkElement(element: NetworkElementConnection): Promise<NetworkElementConnection | null> { - const path = `/restconf/operations/data-provider:create-network-element-connection`; + const path = `/rests/operations/data-provider:create-network-element-connection`; const result = await requestRest<NetworkElementConnection>(path, { - method: "POST", body: JSON.stringify(convertPropertyNames({ input: element }, replaceUpperCase)) + method: "POST", body: JSON.stringify(convertPropertyNames({ "data-provider:input": element }, replaceUpperCase)) }); return result || null; } @@ -44,9 +44,9 @@ class ConnectService { * Updates a network element. */ public async updateNetworkElement(element: UpdateNetworkElement): Promise<NetworkElementConnection | null> { - const path = `/restconf/operations/data-provider:update-network-element-connection`; + const path = `/rests/operations/data-provider:update-network-element-connection`; const result = await requestRest<NetworkElementConnection>(path, { - method: "POST", body: JSON.stringify(convertPropertyNames({ input: element }, replaceUpperCase)) + method: "POST", body: JSON.stringify(convertPropertyNames({ "data-provider:input": element }, replaceUpperCase)) }); return result || null; } @@ -58,16 +58,16 @@ class ConnectService { const query = { "id": element.id }; - const path = `/restconf/operations/data-provider:delete-network-element-connection`; + const path = `/rests/operations/data-provider:delete-network-element-connection`; const result = await requestRest<NetworkElementConnection>(path, { - method: "POST", body: JSON.stringify(convertPropertyNames({ input: query }, replaceUpperCase)) + method: "POST", body: JSON.stringify(convertPropertyNames({ "data-provider:input": query }, replaceUpperCase)) }); return result || null; } /** Mounts network element. */ public async mountNetworkElement(networkElement: NetworkElementConnection): Promise<boolean> { - const path = 'restconf/config/network-topology:network-topology/topology/topology-netconf/node/' + networkElement.nodeId; + const path = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=' + networkElement.nodeId; const mountXml = [ '<node xmlns="urn:TBD:params:xml:ns:yang:network-topology">', `<node-id>${networkElement.nodeId}</node-id>`, @@ -106,7 +106,7 @@ class ConnectService { /** Unmounts a network element by its id. */ public async unmountNetworkElement(nodeId: string): Promise<boolean> { - const path = 'restconf/config/network-topology:network-topology/topology/topology-netconf/node/' + nodeId; + const path = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=' + nodeId; try { const result = await requestRest<string>(path, { @@ -126,7 +126,7 @@ class ConnectService { /** Yang capabilities of the selected network elements. */ public async infoNetworkElement(nodeId: string): Promise<TopologyNode | null> { - const path = 'restconf/operational/network-topology:network-topology/topology/topology-netconf/node/' + nodeId; + const path = '/rests/operational/network-topology:network-topology/topology=topology-netconf/node=' + nodeId; const topologyRequestPomise = requestRest<Topology>(path, { method: "GET" }); return topologyRequestPomise && topologyRequestPomise.then(result => { @@ -138,9 +138,9 @@ class ConnectService { * Get the connection state of the network element. */ public async getNetworkElementConnectionStatus(element: string): Promise<(ConnectionStatus)[] | null> { - const path = `/restconf/operations/data-provider:read-network-element-connection-list`; + const path = `/rests/operations/data-provider:read-network-element-connection-list`; const query = { - "input": { + "data-provider:input": { "filter": [{ "property": "node-id", "filtervalue": element @@ -152,13 +152,13 @@ class ConnectService { } } const result = await requestRest<Result<ConnectionStatus>>(path, { method: "POST", body: JSON.stringify(query) }); - return result && result.output && result.output.data && result.output.data.map(ne => ({ + return result && result["data-provider:output"] && result["data-provider:output"].data && result["data-provider:output"].data.map(ne => ({ status: ne.status })) || null; } public async getWebUriExtensionForNetworkElementAsync(ne: string) { - const path = 'restconf/config/network-topology:network-topology/topology/topology-netconf/node/' + ne + '/yang-ext:mount/core-model:network-element'; + const path = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=' + ne + '/yang-ext:mount/core-model:network-element'; try { const result = await requestRest<any>(path, { method: "GET" }); @@ -182,7 +182,7 @@ class ConnectService { let webUris: guiCutThrough[] = [] ne.forEach(nodeId => { - const path = 'restconf/config/network-topology:network-topology/topology/topology-netconf/node/' + nodeId + '/yang-ext:mount/core-model:network-element'; + const path = '/rests/data/network-topology:network-topology/topology=topology-netconf/node=' + nodeId + '/yang-ext:mount/core-model:network-element'; // add search request to array promises.push(requestRest<any>(path, { method: "GET" }) diff --git a/sdnr/wt/odlux/apps/connectApp/webpack.config.js b/sdnr/wt/odlux/apps/connectApp/webpack.config.js index b72f5da76..7b0a51714 100644 --- a/sdnr/wt/odlux/apps/connectApp/webpack.config.js +++ b/sdnr/wt/odlux/apps/connectApp/webpack.config.js @@ -126,23 +126,27 @@ module.exports = (env) => { }, proxy: { "/oauth2/": { - target: "http://localhost:48181", + target: "http://10.20.6.29:48181", secure: false }, "/database/": { - target: "http://localhost:48181", + target: "http://10.20.6.29:48181", secure: false }, "/restconf/": { - target: "http://localhost:48181", + target: "http://10.20.6.29:48181", + secure: false + }, + "/rests/": { + target: "http://10.20.6.29:48181", secure: false }, "/help/": { - target: "http://localhost:48181", + target: "http://10.20.6.29:48181", secure: false }, "/websocket": { - target: "http://localhost:48181", + target: "http://10.20.6.29:48181", ws: true, changeOrigin: true, secure: false diff --git a/sdnr/wt/odlux/apps/faultApp/src/actions/clearStuckAlarmsAction.ts b/sdnr/wt/odlux/apps/faultApp/src/actions/clearStuckAlarmsAction.ts index ba1a24822..fea500dd3 100644 --- a/sdnr/wt/odlux/apps/faultApp/src/actions/clearStuckAlarmsAction.ts +++ b/sdnr/wt/odlux/apps/faultApp/src/actions/clearStuckAlarmsAction.ts @@ -28,9 +28,9 @@ export class AreStuckAlarmsCleared extends FaultApplicationBaseAction { } -export const clearStuckAlarmAsyncAction = (dispatcher: Dispatch) => async (nodeNames: string[]) => { - dispatcher(new AreStuckAlarmsCleared(true)) +export const clearStuckAlarmAsyncAction = (dispatch: Dispatch) => async (nodeNames: string[]) => { + dispatch(new AreStuckAlarmsCleared(true)) const result = await clearStuckAlarms(nodeNames).catch(error => { console.error(error); return undefined }); - dispatcher(new AreStuckAlarmsCleared(false)) + dispatch(new AreStuckAlarmsCleared(false)) return result; }
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/faultApp/src/components/clearStuckAlarmsDialog.tsx b/sdnr/wt/odlux/apps/faultApp/src/components/clearStuckAlarmsDialog.tsx index 3b8b9b684..e131fa619 100644 --- a/sdnr/wt/odlux/apps/faultApp/src/components/clearStuckAlarmsDialog.tsx +++ b/sdnr/wt/odlux/apps/faultApp/src/components/clearStuckAlarmsDialog.tsx @@ -30,25 +30,29 @@ export enum ClearStuckAlarmsDialogMode { const mapDispatch = (dispatcher: IDispatcher) => ({ clearStuckAlarmsAsync: clearStuckAlarmAsyncAction(dispatcher.dispatch), reloadCurrentProblemsAction: () => dispatcher.dispatch(currentProblemsReloadAction) -}) +}); type clearStuckAlarmsProps = Connect<typeof undefined, typeof mapDispatch> & { - numberDevices: Number, - mode: ClearStuckAlarmsDialogMode, - stuckAlarms: string[] - onClose: () => void + numberDevices: Number; + mode: ClearStuckAlarmsDialogMode; + stuckAlarms: string[]; + onClose: () => void; } type ClearStuckAlarmsState = { - clearAlarmsSuccessful: boolean, - errormessage: string, - unclearedAlarms: string[] + clearAlarmsSuccessful: boolean; + errormessage: string; + unclearedAlarms: string[]; } class ClearStuckAlarmsDialogComponent extends React.Component<clearStuckAlarmsProps, ClearStuckAlarmsState>{ constructor(props: clearStuckAlarmsProps) { super(props); - this.state = { clearAlarmsSuccessful: true, errormessage: '', unclearedAlarms: [] } + this.state = { + clearAlarmsSuccessful: true, + errormessage: '', + unclearedAlarms: [] + }; } onClose = (event: React.MouseEvent) => { @@ -62,19 +66,14 @@ class ClearStuckAlarmsDialogComponent extends React.Component<clearStuckAlarmsPr event.preventDefault(); const result = await this.props.clearStuckAlarmsAsync(this.props.stuckAlarms); - if (result) { - if (result.output.nodenames) { - if (result.output.nodenames.length !== this.props.stuckAlarms.length) { //show errormessage if not all devices were cleared - const undeletedAlarm = this.props.stuckAlarms.filter(item => !result.output.nodenames.includes(item)) - const error = "The alarms of the following devices couldn't be refreshed: "; - this.setState({ clearAlarmsSuccessful: false, errormessage: error, unclearedAlarms: undeletedAlarm }) - return; - } - } - } - else { //show errormessage if no devices were cleared - this.setState({ clearAlarmsSuccessful: false, errormessage: "Alarms couldn't be refreshed.", unclearedAlarms: [] }) + if (result && result["data-provider:output"].nodenames && result["data-provider:output"].nodenames.length !== this.props.stuckAlarms.length) { //show errormessage if not all devices were cleared + const undeletedAlarm = this.props.stuckAlarms.filter(item => !result["data-provider:output"].nodenames.includes(item)); + const error = "The alarms of the following devices couldn't be refreshed: "; + this.setState({ clearAlarmsSuccessful: false, errormessage: error, unclearedAlarms: undeletedAlarm }); return; + + } else { //show errormessage if no devices were cleared + this.setState({ clearAlarmsSuccessful: false, errormessage: "Alarms couldn't be refreshed.", unclearedAlarms: [] }); } this.props.reloadCurrentProblemsAction(); @@ -132,5 +131,5 @@ class ClearStuckAlarmsDialogComponent extends React.Component<clearStuckAlarmsPr } } -const ClearStuckAlarmsDialog = connect(undefined, mapDispatch)(ClearStuckAlarmsDialogComponent) +const ClearStuckAlarmsDialog = connect(undefined, mapDispatch)(ClearStuckAlarmsDialogComponent); export default ClearStuckAlarmsDialog; diff --git a/sdnr/wt/odlux/apps/faultApp/src/handlers/faultAppRootHandler.ts b/sdnr/wt/odlux/apps/faultApp/src/handlers/faultAppRootHandler.ts index e03d2b560..5b51a100c 100644 --- a/sdnr/wt/odlux/apps/faultApp/src/handlers/faultAppRootHandler.ts +++ b/sdnr/wt/odlux/apps/faultApp/src/handlers/faultAppRootHandler.ts @@ -67,7 +67,6 @@ const actionHandlers = { alarmLogEntries: alarmLogEntriesActionHandler, currentOpenPanel: currentOpenPanelHandler, faultStatus: faultStatusHandler, - stuckAlarms: stuckAlarmHandler, listenForPartialUpdates: arePartialUpdatesActiveHandler }; diff --git a/sdnr/wt/odlux/apps/faultApp/src/models/fault.ts b/sdnr/wt/odlux/apps/faultApp/src/models/fault.ts index c65734437..e4e43f19c 100644 --- a/sdnr/wt/odlux/apps/faultApp/src/models/fault.ts +++ b/sdnr/wt/odlux/apps/faultApp/src/models/fault.ts @@ -61,7 +61,5 @@ export type Faults = { }; export type DeletedStuckAlarms = { - output: { nodenames: string[] - } }
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/faultApp/src/services/faultStatusService.ts b/sdnr/wt/odlux/apps/faultApp/src/services/faultStatusService.ts index d3409e095..d1236d2e7 100644 --- a/sdnr/wt/odlux/apps/faultApp/src/services/faultStatusService.ts +++ b/sdnr/wt/odlux/apps/faultApp/src/services/faultStatusService.ts @@ -16,12 +16,12 @@ * ============LICENSE_END========================================================================== */ import { requestRest } from "../../../../framework/src/services/restService"; -import { Result, PostResponse } from "../../../../framework/src/models/elasticSearch"; +import { Result, SingeResult } from "../../../../framework/src/models/elasticSearch"; import { FaultType, Faults, DeletedStuckAlarms } from "../models/fault"; export const getFaultStateFromDatabase = async (): Promise<FaultType | null> => { - const path = 'restconf/operations/data-provider:read-status'; + const path = 'rests/operations/data-provider:read-status'; const result = await requestRest<Result<Faults>>(path, { method: "POST" }); let faultType: FaultType = { @@ -32,8 +32,8 @@ export const getFaultStateFromDatabase = async (): Promise<FaultType | null> => } let faults: Faults[] | null = null; - if (result && result.output && result.output.data) { - faults = result.output.data; + if (result && result["data-provider:output"] && result["data-provider:output"].data) { + faults = result["data-provider:output"].data; faultType = { Critical: faults[0].faults.criticals, Major: faults[0].faults.majors, @@ -46,8 +46,8 @@ export const getFaultStateFromDatabase = async (): Promise<FaultType | null> => } export const clearStuckAlarms = async (nodeNames: string[]) => { - const path = 'restconf/operations/devicemanager:clear-current-fault-by-nodename' - const result = await requestRest<DeletedStuckAlarms>(path, { method: 'Post', body: JSON.stringify({ input: { nodenames: nodeNames } }) }) + const path = 'rests/operations/devicemanager:clear-current-fault-by-nodename' + const result = await requestRest<SingeResult<DeletedStuckAlarms>>(path, { method: 'Post', body: JSON.stringify({ input: { nodenames: nodeNames } }) }) return result; }
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/faultApp/webpack.config.js b/sdnr/wt/odlux/apps/faultApp/webpack.config.js index c91b1f4cc..8131c9835 100644 --- a/sdnr/wt/odlux/apps/faultApp/webpack.config.js +++ b/sdnr/wt/odlux/apps/faultApp/webpack.config.js @@ -123,25 +123,29 @@ module.exports = (env) => { stats: { colors: true }, - proxy: { + proxy: { "/oauth2/": { - target: "http://localhost:48181", + target: "http://10.20.6.29:48181", secure: false }, "/database/": { - target: "http://localhost:48181", + target: "http://10.20.6.29:48181", secure: false }, "/restconf/": { - target: "http://localhost:48181", + target: "http://10.20.6.29:48181", + secure: false + }, + "/rests/": { + target: "http://10.20.6.29:48181", secure: false }, "/help/": { - target: "http://localhost:48181", + target: "http://10.20.6.29:48181", secure: false }, - "/websocket/": { - target: "http://localhost:48181", + "/websocket": { + target: "http://10.20.6.29:48181", ws: true, changeOrigin: true, secure: false diff --git a/sdnr/wt/odlux/apps/helpApp/src/services/helpService.ts b/sdnr/wt/odlux/apps/helpApp/src/services/helpService.ts index c8b247832..728f243a0 100644 --- a/sdnr/wt/odlux/apps/helpApp/src/services/helpService.ts +++ b/sdnr/wt/odlux/apps/helpApp/src/services/helpService.ts @@ -55,7 +55,7 @@ class HelpService { }, []); } - this.tocNodeCollection = result && mapNodesCollection(result); + this.tocNodeCollection = result && mapNodesCollection(result) || null; } return this.tocNodeCollection || null; } diff --git a/sdnr/wt/odlux/apps/inventoryApp/src/services/inventoryService.ts b/sdnr/wt/odlux/apps/inventoryApp/src/services/inventoryService.ts index b6025d4da..d43d2988d 100644 --- a/sdnr/wt/odlux/apps/inventoryApp/src/services/inventoryService.ts +++ b/sdnr/wt/odlux/apps/inventoryApp/src/services/inventoryService.ts @@ -36,9 +36,9 @@ class InventoryService { } public async getInventoryEntry(id: string): Promise<InventoryType | undefined> { - const path = `/restconf/operations/data-provider:read-inventory-list`; + const path = `/rests/operations/data-provider:read-inventory-list`; const body = { - "input": { + "data-provider:input": { "filter": [ { property: "id", filtervalue: id }, ], diff --git a/sdnr/wt/odlux/apps/inventoryApp/webpack.config.js b/sdnr/wt/odlux/apps/inventoryApp/webpack.config.js index d81797c1e..66c861389 100644 --- a/sdnr/wt/odlux/apps/inventoryApp/webpack.config.js +++ b/sdnr/wt/odlux/apps/inventoryApp/webpack.config.js @@ -127,33 +127,33 @@ module.exports = (env) => { }, proxy: { "/oauth2/": { - target: "http://localhost:48181", - secure: false - }, - "/yang-schema/": { - target: "http://localhost:48181", + target: "http://10.20.6.29:48181", secure: false }, "/database/": { - target: "http://localhost:48181", + target: "http://10.20.6.29:48181", secure: false }, "/restconf/": { - target: "http://localhost:48181", + target: "http://10.20.6.29:48181", + secure: false + }, + "/rests/": { + target: "http://10.20.6.29:48181", secure: false }, "/help/": { - target: "http://localhost:48181", + target: "http://10.20.6.29:48181", secure: false }, "/tree/": { - target: "http://localhost:48181", + target: "http://10.20.6.29:48181", secure: false }, "/websocket": { - target: "http://localhost:48181", + target: "http://10.20.6.29:48181", ws: true, - changeOrigin: false, + changeOrigin: true, secure: false } } diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src/services/maintenenceService.ts b/sdnr/wt/odlux/apps/maintenanceApp/src/services/maintenenceService.ts index daa6082d7..613b4786d 100644 --- a/sdnr/wt/odlux/apps/maintenanceApp/src/services/maintenenceService.ts +++ b/sdnr/wt/odlux/apps/maintenanceApp/src/services/maintenenceService.ts @@ -34,7 +34,7 @@ class MaintenenceService { * Adds or updates one maintenence entry to the backend. */ public async writeMaintenenceEntry(maintenenceEntry: MaintenenceEntry): Promise<PostResponse | null> { - const path = `/restconf/operations/data-provider:create-maintenance`; + const path = `/rests/operations/data-provider:create-maintenance`; const query = { "id": maintenenceEntry._id, @@ -45,7 +45,7 @@ class MaintenenceService { "start": convertToISODateString(maintenenceEntry.start) }; - const result = await requestRest<PostResponse>(path, { method: "POST", body: JSON.stringify(convertPropertyNames({ input: query }, replaceUpperCase)) }); + const result = await requestRest<PostResponse>(path, { method: "POST", body: JSON.stringify(convertPropertyNames({ "data-provider:input": query }, replaceUpperCase)) }); return result || null; } @@ -53,7 +53,7 @@ class MaintenenceService { * Deletes one maintenence entry by its mountId from the backend. */ public async deleteMaintenenceEntry(maintenenceEntry: MaintenenceEntry): Promise<(DeleteResponse) | null> { - const path = `/restconf/operations/data-provider:delete-maintenance`; + const path = `/rests/operations/data-provider:delete-maintenance`; const query = { "id": maintenenceEntry._id, @@ -63,7 +63,7 @@ class MaintenenceService { "end": convertToISODateString(maintenenceEntry.end), "start": convertToISODateString(maintenenceEntry.start) }; - const result = await requestRest<DeleteResponse>(path, { method: "POST", body: JSON.stringify(convertPropertyNames({ input: query }, replaceUpperCase)) }); + const result = await requestRest<DeleteResponse>(path, { method: "POST", body: JSON.stringify(convertPropertyNames({ "data-provider:input": query }, replaceUpperCase)) }); return result || null; } } diff --git a/sdnr/wt/odlux/apps/maintenanceApp/webpack.config.js b/sdnr/wt/odlux/apps/maintenanceApp/webpack.config.js index 33a3bed73..eb6f785f3 100644 --- a/sdnr/wt/odlux/apps/maintenanceApp/webpack.config.js +++ b/sdnr/wt/odlux/apps/maintenanceApp/webpack.config.js @@ -125,25 +125,29 @@ module.exports = (env) => { stats: { colors: true }, - proxy: { + proxy: { "/oauth2/": { - target: "http://localhost:48181", + target: "http://10.20.6.29:48181", secure: false }, "/database/": { - target: "http://localhost:48181", + target: "http://10.20.6.29:48181", secure: false }, "/restconf/": { - target: "http://localhost:48181", + target: "http://10.20.6.29:48181", + secure: false + }, + "/rests/": { + target: "http://10.20.6.29:48181", secure: false }, "/help/": { - target: "http://localhost:48181", + target: "http://10.20.6.29:48181", secure: false }, - "/websocket/": { - target: "http://localhost:48181", + "/websocket": { + target: "http://10.20.6.29:48181", ws: true, changeOrigin: true, secure: false diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/services/mediatorService.ts b/sdnr/wt/odlux/apps/mediatorApp/src/services/mediatorService.ts index aee086689..ede681776 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/services/mediatorService.ts +++ b/sdnr/wt/odlux/apps/mediatorApp/src/services/mediatorService.ts @@ -83,8 +83,8 @@ class MediatorService { const result = await requestRest<Result<MediatorServer>>(path, { method: "POST", body: JSON.stringify({ input: data }) }); - if (result && result.output.data[0]) { - const firstResult = result.output.data[0]; + if (result && result["data-provider:output"].data[0]) { + const firstResult = result["data-provider:output"].data[0]; return { id: firstResult.id, diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/services/performanceHistoryService.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/services/performanceHistoryService.ts index 685859850..70a8771b7 100644 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/services/performanceHistoryService.ts +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/services/performanceHistoryService.ts @@ -47,13 +47,13 @@ class PerformanceService { if (selectedTimePeriod === "15min") { - path = '/restconf/operations/data-provider:read-pmdata-15m-ltp-list'; + path = '/rests/operations/data-provider:read-pmdata-15m-ltp-list'; } else { - path = '/restconf/operations/data-provider:read-pmdata-24h-ltp-list'; + path = '/rests/operations/data-provider:read-pmdata-24h-ltp-list'; } const result = await requestRest<Result<string>>(path, { method: "POST", body: JSON.stringify(convertPropertyNames({ input: query }, replaceUpperCase)) }); - return result && result.output && result.output.data && result.output.data.map(ne => ({ key: ne })) || null; + return result && result["data-provider:output"] && result["data-provider:output"].data && result["data-provider:output"].data.map(ne => ({ key: ne })) || null; } @@ -62,9 +62,9 @@ class PerformanceService { * Gets all devices from the performanceHistory 15min backend. */ public async getDeviceListfromPerf15minHistory(): Promise<(DeviceListType)[] | null> { - const path = '/restconf/operations/data-provider:read-pmdata-15m-device-list'; + const path = '/rests/operations/data-provider:read-pmdata-15m-device-list'; const query = { - "input": { + "data-provider:input": { "filter": [], "sortorder": [], "pagination": { @@ -75,7 +75,7 @@ class PerformanceService { }; const result = await requestRest<Result<string>>(path, { method: "POST", body: JSON.stringify(query) }); - return result && result.output && result.output.data && result.output.data.map(ne => ({ + return result && result["data-provider:output"] && result["data-provider:output"].data && result["data-provider:output"].data.map(ne => ({ nodeId: ne })) || null; } @@ -84,9 +84,9 @@ class PerformanceService { * Gets all devices from the performanceHistory 24h backend. */ public async getDeviceListfromPerf24hHistory(): Promise<(DeviceListType)[] | null> { - const path = '/restconf/operations/data-provider:read-pmdata-24h-device-list'; + const path = '/rests/operations/data-provider:read-pmdata-24h-device-list'; const query = { - "input": { + "data-provider:input": { "filter": [], "sortorder": [], "pagination": { @@ -97,7 +97,7 @@ class PerformanceService { }; const result = await requestRest<Result<string>>(path, { method: "POST", body: JSON.stringify(query) }); - return result && result.output && result.output.data && result.output.data.map(ne => ({ + return result && result["data-provider:output"] && result["data-provider:output"].data && result["data-provider:output"].data.map(ne => ({ nodeId: ne })) || null; } diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/webpack.config.js b/sdnr/wt/odlux/apps/performanceHistoryApp/webpack.config.js index 6579db3ec..5faf69e83 100644 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/webpack.config.js +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/webpack.config.js @@ -126,15 +126,29 @@ module.exports = (env) => { }, proxy: { "/oauth2/": { - target: "http://10.20.6.29:28181", + target: "http://10.20.6.29:48181", secure: false }, - "/restconf": { - target: "http://10.20.6.29:28181", + "/database/": { + target: "http://10.20.6.29:48181", secure: false }, - "/database": { - target: "http://10.20.6.29:28181", + "/restconf/": { + target: "http://10.20.6.29:48181", + secure: false + }, + "/rests/": { + target: "http://10.20.6.29:48181", + secure: false + }, + "/help/": { + target: "http://10.20.6.29:48181", + secure: false + }, + "/websocket": { + target: "http://10.20.6.29:48181", + ws: true, + changeOrigin: true, secure: false } } diff --git a/sdnr/wt/odlux/framework/pom.xml b/sdnr/wt/odlux/framework/pom.xml index c7d9c3295..db42ef1ac 100644 --- a/sdnr/wt/odlux/framework/pom.xml +++ b/sdnr/wt/odlux/framework/pom.xml @@ -46,7 +46,7 @@ <properties> <buildtime>${maven.build.timestamp}</buildtime> <distversion>ONAP Frankfurt (Neon, mdsal ${odl.mdsal.version})</distversion> - <buildno>56.139cd6d(20/07/08)</buildno> + <buildno>57.3e1d5cf(20/08/11)</buildno> <odlux.version>ONAP SDN-R | ONF Wireless for ${distversion} - Build: ${buildtime} ${buildno} ${project.version}</odlux.version> </properties> @@ -56,6 +56,10 @@ <directory>dist</directory> <targetPath>odlux</targetPath> </resource> + <resource> + <directory>src2/main/resources</directory> + <targetPath>odlux</targetPath> + </resource> </resources> <plugins> <plugin> @@ -172,12 +176,21 @@ <basedir>${project.build.directory}/classes/odlux</basedir> <includes> <include>app.js</include> + <include>version.json</include> </includes> <replacements> <replacement> <token>##odlux.version##</token> <value>${odlux.version}</value> </replacement> + <replacement> + <token>##buildno##</token> + <value>${buildno}</value> + </replacement> + <replacement> + <token>##build-timestamp##</token> + <value>${buildtime}</value> + </replacement> </replacements> </configuration> </plugin> diff --git a/sdnr/wt/odlux/framework/src/models/elasticSearch.ts b/sdnr/wt/odlux/framework/src/models/elasticSearch.ts index 12cfd7d28..b5f25097c 100644 --- a/sdnr/wt/odlux/framework/src/models/elasticSearch.ts +++ b/sdnr/wt/odlux/framework/src/models/elasticSearch.ts @@ -16,16 +16,21 @@ * ============LICENSE_END==========================================================================
*/
export type Result<TSource extends {}> = {
- output: {
+ "data-provider:output": {
pagination?: {
- size: number,
- page: number,
- total: number
+ size: number;
+ page: number;
+ total: number;
},
data: TSource[];
}
}
+export type SingeResult<TSource extends {}> = {
+ "data-provider:output": TSource;
+}
+
+
export type HitEntry<TSource extends {}> = {
_index: string;
_type: string;
diff --git a/sdnr/wt/odlux/framework/src/services/restService.ts b/sdnr/wt/odlux/framework/src/services/restService.ts index b02d7d19f..19ef34f91 100644 --- a/sdnr/wt/odlux/framework/src/services/restService.ts +++ b/sdnr/wt/odlux/framework/src/services/restService.ts @@ -33,7 +33,7 @@ export const formEncode = (params: { [key: string]: string | number }) => Object /** Sends a rest request to the given path. * @returns The data, or null it there was any error */ -export async function requestRest<TData>(path: string = '', init: RequestInit = {}, authenticate: boolean = true, isResource: boolean = false): Promise<TData | null> { +export async function requestRest<TData>(path: string = '', init: RequestInit = {}, authenticate: boolean = true, isResource: boolean = false): Promise<TData | null | undefined> { const res = await requestRestExt<TData>(path, init, authenticate, isResource); if (res && res.status >= 200 && res.status < 300) { return res.data; @@ -42,9 +42,9 @@ export async function requestRest<TData>(path: string = '', init: RequestInit = } /** Sends a rest request to the given path and reports the server state. - * @returns An object with the server state, a message and the data. + * @returns An object with the server state, a message and the data or undefined in case of a json parse error. */ -export async function requestRestExt<TData>(path: string = '', init: RequestInit = {}, authenticate: boolean = true, isResource: boolean = false): Promise<{ status: number, message?: string, data: TData | null }> { +export async function requestRestExt<TData>(path: string = '', init: RequestInit = {}, authenticate: boolean = true, isResource: boolean = false): Promise<{ status: number, message?: string, data: TData | null | undefined }> { const result: { status: number, message?: string, data: TData | null } = { status: -1, data: null, @@ -99,7 +99,7 @@ export async function requestRestExt<TData>(path: string = '', init: RequestInit ...result, status: fetchResult.status, message: error && error.message || String(error), - data: null + data: undefined }; } }
\ No newline at end of file diff --git a/sdnr/wt/odlux/framework/src/utilities/elasticSearch.ts b/sdnr/wt/odlux/framework/src/utilities/elasticSearch.ts index c18a40b0b..6f4c71ec7 100644 --- a/sdnr/wt/odlux/framework/src/utilities/elasticSearch.ts +++ b/sdnr/wt/odlux/framework/src/utilities/elasticSearch.ts @@ -33,14 +33,14 @@ type dataType = { [prop: string]: propType }; */ export function createSearchDataHandler<TResult>(typeName: (() => string) | string, additionalFilters?: {} | null | undefined): DataCallback<(TResult)> { const fetchData: DataCallback<(TResult)> = async (pageIndex, rowsPerPage, orderBy, order, filter) => { - const url = `/restconf/operations/data-provider:read-${typeof typeName === "function" ? typeName(): typeName}-list`; + const url = `/rests/operations/data-provider:read-${typeof typeName === "function" ? typeName(): typeName}-list`; filter = { ...filter, ...additionalFilters }; const filterKeys = filter && Object.keys(filter) || []; const query = { - input: { + "data-provider:input": { filter: filterKeys.filter(f => filter![f] != null && filter![f] !== "").map(property => ({ property, filtervalue: filter![property]})), sortorder: orderBy ? [{ property: orderBy, sortorder: order === "desc" ? "descending" : "ascending" }] : [], pagination: { size: rowsPerPage, page: (pageIndex != null && pageIndex > 0 && pageIndex || 0) +1 } @@ -60,12 +60,12 @@ export function createSearchDataHandler<TResult>(typeName: (() => string) | stri if (result) { let rows: TResult[] = []; - if (result && result.output && result.output.data) { - rows = result.output.data.map(obj => convertPropertyNames(obj, replaceHyphen)) || [] + if (result && result["data-provider:output"] && result["data-provider:output"].data) { + rows = result["data-provider:output"].data.map(obj => convertPropertyNames(obj, replaceHyphen)) || [] } const data = { - page: result.output.pagination && result.output.pagination.page != null && result.output.pagination.page - 1 || 0 , total: result.output.pagination && result.output.pagination.total || 0, rows: rows + page: +(result["data-provider:output"].pagination && result["data-provider:output"].pagination.page != null && result["data-provider:output"].pagination.page - 1 || 0) , total: +(result["data-provider:output"].pagination && result["data-provider:output"].pagination.total || 0), rows: rows }; return data; } diff --git a/sdnr/wt/odlux/framework/src/views/about.tsx b/sdnr/wt/odlux/framework/src/views/about.tsx index ca3953af1..c4a5488e0 100644 --- a/sdnr/wt/odlux/framework/src/views/about.tsx +++ b/sdnr/wt/odlux/framework/src/views/about.tsx @@ -44,7 +44,7 @@ class AboutComponent extends React.Component<any, AboutState> { requestRestExt<string>('/about').then((response) => { const content = response.status == 200 ? response.data : `${response.status} ${response.message}` || "Server error"; const loadedSucessfully = response.status == 200 ? true : false; - this.setState({ content: content, isContentLoadedSucessfully: loadedSucessfully }); + this.setState({ content: content || null, isContentLoadedSucessfully: loadedSucessfully }); }).catch((error) => { this.setState({ content: error }) }) diff --git a/sdnr/wt/odlux/framework/src2/main/resources/version.json b/sdnr/wt/odlux/framework/src2/main/resources/version.json new file mode 100644 index 000000000..f74d2c966 --- /dev/null +++ b/sdnr/wt/odlux/framework/src2/main/resources/version.json @@ -0,0 +1,4 @@ +{ + "version":"##buildno##", + "build":"##build-timestamp##" +}
\ No newline at end of file diff --git a/sdnr/wt/odlux/framework/webpack.config.js b/sdnr/wt/odlux/framework/webpack.config.js index 4887a757e..c7ef72e80 100644 --- a/sdnr/wt/odlux/framework/webpack.config.js +++ b/sdnr/wt/odlux/framework/webpack.config.js @@ -176,7 +176,7 @@ module.exports = (env) => { ],
devServer: {
- public: "http://localhost:3100",
+ public: "http://10.20.6.29:3100",
contentBase: distPath,
compress: true,
@@ -195,23 +195,23 @@ module.exports = (env) => { },
proxy: {
"/oauth2/": {
- target: "http://localhost:48181",
+ target: "http://10.20.6.29:48181",
secure: false
},
"/database/": {
- target: "http://localhost:48181",
+ target: "http://10.20.6.29:48181",
secure: false
},
"/restconf/": {
- target: "http://localhost:48181",
+ target: "http://10.20.6.29:48181",
secure: false
},
"/help/": {
- target: "http://localhost:48181",
+ target: "http://10.20.6.29:48181",
secure: false
},
"/websocket": {
- target: "http://localhost:48181",
+ target: "http://10.20.6.29:48181",
ws: true,
changeOrigin: true,
secure: false
diff --git a/sdnr/wt/odlux/yarn.lock b/sdnr/wt/odlux/yarn.lock index 71488be68..3db21a253 100644 --- a/sdnr/wt/odlux/yarn.lock +++ b/sdnr/wt/odlux/yarn.lock @@ -1512,9 +1512,9 @@ universal-user-agent "^5.0.0" "@octokit/rest@^16.16.0": - version "16.43.1" - resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-16.43.1.tgz#3b11e7d1b1ac2bbeeb23b08a17df0b20947eda6b" - integrity sha512-gfFKwRT/wFxq5qlNjnW2dh+qh74XgTQ2B179UX5K1HYCluioWj8Ndbgqw2PVqa1NnVJkGHp2ovMpVn/DImlmkw== + version "16.43.2" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-16.43.2.tgz#c53426f1e1d1044dee967023e3279c50993dd91b" + integrity sha512-ngDBevLbBTFfrHZeiS7SAMAZ6ssuVmXuya+F/7RaVvlysgGa1JKJkKWY+jV6TCJYcW0OALfJ7nTIGXcBXzycfQ== dependencies: "@octokit/auth-token" "^2.4.0" "@octokit/plugin-paginate-rest" "^1.1.1" @@ -7857,9 +7857,9 @@ npm-registry-fetch@^3.9.0: npm-package-arg "^6.1.0" npm-registry-fetch@^4.0.0: - version "4.0.4" - resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-4.0.4.tgz#2da1ecf3f43d419d96abf313664291a4623d3ea5" - integrity sha512-6jb34hX/iYNQebqWUHtU8YF6Cjb1H6ouTFPClYsyiW6lpFkljTpdeftm53rRojtja1rKAvKNIIiTS5Sjpw4wsA== + version "4.0.5" + resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-4.0.5.tgz#cb87cf7f25bfb048d6c3ee19d115bebf93ea5bfa" + integrity sha512-yQ0/U4fYpCCqmueB2g8sc+89ckQ3eXpmU4+Yi2j5o/r0WkKvE2+Y0tK3DEILAtn2UaQTkjTHxIXe2/CSdit+/Q== dependencies: JSONStream "^1.3.4" bluebird "^3.5.1" |