aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/apps
diff options
context:
space:
mode:
authorAijana Schumann <aijana.schumann@highstreet-technologies.com>2020-08-12 12:28:06 +0200
committerAijana Schumann <aijana.schumann@highstreet-technologies.com>2020-08-12 12:29:48 +0200
commit3d02271058d2e59a71e49afdd866462f7b6ab1c6 (patch)
treebb42b3428055136a4a8f5def9c63e412390d40ef /sdnr/wt/odlux/apps
parentcd29d2dd98b7c40bd4efb6a8705787ca35e99fe9 (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/apps')
-rw-r--r--sdnr/wt/odlux/apps/configurationApp/src/actions/deviceActions.ts46
-rw-r--r--sdnr/wt/odlux/apps/configurationApp/src/services/restServices.ts20
-rw-r--r--sdnr/wt/odlux/apps/configurationApp/webpack.config.js35
-rw-r--r--sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts28
-rw-r--r--sdnr/wt/odlux/apps/connectApp/webpack.config.js14
-rw-r--r--sdnr/wt/odlux/apps/faultApp/src/actions/clearStuckAlarmsAction.ts6
-rw-r--r--sdnr/wt/odlux/apps/faultApp/src/components/clearStuckAlarmsDialog.tsx43
-rw-r--r--sdnr/wt/odlux/apps/faultApp/src/handlers/faultAppRootHandler.ts1
-rw-r--r--sdnr/wt/odlux/apps/faultApp/src/models/fault.ts2
-rw-r--r--sdnr/wt/odlux/apps/faultApp/src/services/faultStatusService.ts12
-rw-r--r--sdnr/wt/odlux/apps/faultApp/webpack.config.js18
-rw-r--r--sdnr/wt/odlux/apps/helpApp/src/services/helpService.ts2
-rw-r--r--sdnr/wt/odlux/apps/inventoryApp/src/services/inventoryService.ts4
-rw-r--r--sdnr/wt/odlux/apps/inventoryApp/webpack.config.js22
-rw-r--r--sdnr/wt/odlux/apps/maintenanceApp/src/services/maintenenceService.ts8
-rw-r--r--sdnr/wt/odlux/apps/maintenanceApp/webpack.config.js18
-rw-r--r--sdnr/wt/odlux/apps/mediatorApp/src/services/mediatorService.ts4
-rw-r--r--sdnr/wt/odlux/apps/performanceHistoryApp/src/services/performanceHistoryService.ts18
-rw-r--r--sdnr/wt/odlux/apps/performanceHistoryApp/webpack.config.js24
19 files changed, 186 insertions, 139 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
}
}