aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/apps/inventoryApp
diff options
context:
space:
mode:
authorHerbert Eiselt <herbert.eiselt@highstreet-technologies.com>2019-03-28 19:00:35 +0100
committerHerbert Eiselt <herbert.eiselt@highstreet-technologies.com>2019-03-28 19:01:01 +0100
commit62e834802dae0bd15504785503060d7875c7b4ad (patch)
tree0b3d3ae0c62b279773a2aea3daebcad5f8ad78a2 /sdnr/wt/odlux/apps/inventoryApp
parentf2bb490d9c82decbdb50c1e4db1be2f34b28d097 (diff)
Add SDN-R odlux performance
A UI displaying performance monitoring data Change-Id: I2a9c28549aee1bcac366354c343a63f884bf09e0 Issue-ID: SDNC-585 Signed-off-by: Herbert Eiselt <herbert.eiselt@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/odlux/apps/inventoryApp')
-rw-r--r--sdnr/wt/odlux/apps/inventoryApp/pom.xml8
-rw-r--r--sdnr/wt/odlux/apps/inventoryApp/src/plugin.tsx4
-rw-r--r--sdnr/wt/odlux/apps/inventoryApp/src/views/dashboard.tsx15
3 files changed, 17 insertions, 10 deletions
diff --git a/sdnr/wt/odlux/apps/inventoryApp/pom.xml b/sdnr/wt/odlux/apps/inventoryApp/pom.xml
index b2572563f..713dd3606 100644
--- a/sdnr/wt/odlux/apps/inventoryApp/pom.xml
+++ b/sdnr/wt/odlux/apps/inventoryApp/pom.xml
@@ -1,11 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>odlparent</artifactId>
<version>1.2.2-SNAPSHOT</version>
- <relativePath/>
+ <relativePath />
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
@@ -125,7 +127,7 @@
<configuration>
<instructions>
<Import-Package>org.onap.ccsdk.features.sdnr.wt.odlux.model.*,com.opensymphony.*</Import-Package>
- <Private-Package/>
+ <Private-Package></Private-Package>
</instructions>
</configuration>
</plugin>
diff --git a/sdnr/wt/odlux/apps/inventoryApp/src/plugin.tsx b/sdnr/wt/odlux/apps/inventoryApp/src/plugin.tsx
index 52e1d4802..6022d9569 100644
--- a/sdnr/wt/odlux/apps/inventoryApp/src/plugin.tsx
+++ b/sdnr/wt/odlux/apps/inventoryApp/src/plugin.tsx
@@ -9,9 +9,9 @@ import { Dashboard } from './views/dashboard';
export function register() {
applicationManager.registerApplication({
- name: "inventoryApp",
+ name: "inventory",
icon: faShoppingBag,
rootComponent: Dashboard,
- menuEntry: "Inventory App"
+ menuEntry: "Inventory"
});
}
diff --git a/sdnr/wt/odlux/apps/inventoryApp/src/views/dashboard.tsx b/sdnr/wt/odlux/apps/inventoryApp/src/views/dashboard.tsx
index 8d07fa88c..b2361af7f 100644
--- a/sdnr/wt/odlux/apps/inventoryApp/src/views/dashboard.tsx
+++ b/sdnr/wt/odlux/apps/inventoryApp/src/views/dashboard.tsx
@@ -6,13 +6,13 @@ import { Result, InventoryType } from '../models/inventory';
const url = `${ window.location.origin}/database/sdnevents/inventoryequipment/_search`;
-const fetchData: DataCallback = async (page, rowsPerPage, orderBy, order, filter) => {
+const fetchData: DataCallback = async (page, rowsPerPage, orderBy, order, filter) => {
const from = rowsPerPage && page != null && !isNaN(+page)
? (+page) * rowsPerPage
: null;
const filterKeys = filter && Object.keys(filter) || [];
-
+
const query = {
...filterKeys.length > 0 ? {
query: {
@@ -30,7 +30,7 @@ const fetchData: DataCallback = async (page, rowsPerPage, orderBy, order, filter
...from ? { "from": from } : {},
...orderBy && order ? { "sort": [{ [orderBy]: order }] } : {},
};
-
+
const result = await fetch(url, {
method: "POST", // *GET, POST, PUT, DELETE, etc.
mode: "no-cors", // no-cors, cors, *same-origin
@@ -45,8 +45,13 @@ const fetchData: DataCallback = async (page, rowsPerPage, orderBy, order, filter
if (result.ok) {
const queryResult: Result<InventoryType> = await result.json();
const data = {
- page: Math.min(page || 0, queryResult.hits.total || 0 / (rowsPerPage || 1)), rowCount: queryResult.hits.total, rows: queryResult && queryResult.hits && queryResult.hits.hits && queryResult.hits.hits.map(h => (
- { ...h._source, _id: h._id }
+ page: Math.min(page || 0, queryResult.hits.total || 0 / (rowsPerPage || 1)),
+ rowCount: queryResult.hits.total,
+ rows: queryResult && queryResult.hits && queryResult.hits.hits && queryResult.hits.hits.map(h => (
+ {
+ ...h._source,
+ _id: h._id
+ }
)) || []
};
return data;