Initial code commit for dashboard 99/9299/1
authortganesh2k <ganesh.kumar@samsung.com>
Tue, 18 Oct 2022 07:19:49 +0000 (12:49 +0530)
committertganesh2k <ganesh.kumar@samsung.com>
Tue, 18 Oct 2022 07:22:02 +0000 (12:52 +0530)
Issue-Id: AIMLFW-2

Signed-off-by: tganesh2k <ganesh.kumar@samsung.com>
Change-Id: I36ce4af781fc31bd03085cf05d6b2242bf87a9d4

src/components/home/common/CommonMethods.js [new file with mode: 0644]
src/components/home/common/Constants.js [new file with mode: 0644]

diff --git a/src/components/home/common/CommonMethods.js b/src/components/home/common/CommonMethods.js
new file mode 100644 (file)
index 0000000..b89050d
--- /dev/null
@@ -0,0 +1,55 @@
+// ==================================================================================
+
+//        Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved.
+
+//    Licensed under the Apache License, Version 2.0 (the "License");
+//    you may not use this file except in compliance with the License.
+//    You may obtain a copy of the License at
+
+//           http://www.apache.org/licenses/LICENSE-2.0
+
+//    Unless required by applicable law or agreed to in writing, software
+//    distributed under the License is distributed on an "AS IS" BASIS,
+//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//    See the License for the specific language governing permissions and
+//    limitations under the License.
+
+// ==================================================================================
+
+export function getDatalakeNameWithoutConversion(datalakeNameWhichIsConverted){
+  if(datalakeNameWhichIsConverted === 'InfluxSource'){
+    return  'Influx DB';
+  }
+  else if(datalakeNameWhichIsConverted === 'CassandraSource'){
+    return  'Cassandra DB';
+  }
+  return null;
+}
+
+export function convertDatalakeDBName(datalakeNameWithoutConversion){
+  if(datalakeNameWithoutConversion === 'Influx DB'){
+    return 'InfluxSource';
+  }
+  else if(datalakeNameWithoutConversion === 'Cassandra DB'){
+    return 'CassandraSource';
+  }
+  return null;
+}
+
+export function convertToCommaSeparatedString(obj){
+  console.log("before changing in convertToCommaSeparatedString: ", obj);
+  let cs_string = "";
+  let counter = 0;
+  // Object.entries(obj).map(([key, value]) => {
+  for(const [key,value] of Object.entries(obj)){
+      if(key !== "usecase"){
+        if (counter > 0){
+          cs_string += ","
+      }
+      cs_string += key.toString() + ":" + value.toString();
+      counter += 1;
+      }  
+  };
+  console.log("after changing in convertToCommaSeparatedString: ", cs_string);
+  return cs_string;
+}
diff --git a/src/components/home/common/Constants.js b/src/components/home/common/Constants.js
new file mode 100644 (file)
index 0000000..9248954
--- /dev/null
@@ -0,0 +1,24 @@
+// ==================================================================================
+
+//        Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved.
+
+//    Licensed under the Apache License, Version 2.0 (the "License");
+//    you may not use this file except in compliance with the License.
+//    You may obtain a copy of the License at
+
+//           http://www.apache.org/licenses/LICENSE-2.0
+
+//    Unless required by applicable law or agreed to in writing, software
+//    distributed under the License is distributed on an "AS IS" BASIS,
+//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//    See the License for the specific language governing permissions and
+//    limitations under the License.
+
+// ==================================================================================
+
+export const UCMgr_baseUrl = 'http://' + process.env.REACT_APP_UCM_HOST +':' + process.env.REACT_APP_UCM_PORT
+export const notebook_url = 'http://'  + process.env.REACT_APP_NOTEBOOK_HOST +':' + process.env.REACT_APP_NOTEBOOK_PORT
+export const ServiceMgr_baseUrl = 'http://' + process.env.REACT_APP_ServiceMgr_HOST +':' + process.env.REACT_APP_ServiceMgr_PORT
+// export const UCMgr_baseUrl = 'http://localhost:32002'  
+// export const notebook_url = 'http://localhost:32088'  
+// export const ServiceMgr_baseUrl = 'http://localhost:30180' 
\ No newline at end of file