From: tganesh2k Date: Tue, 18 Oct 2022 07:19:49 +0000 (+0530) Subject: Initial code commit for dashboard X-Git-Tag: 1.0.0~12 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F99%2F9299%2F1;p=portal%2Faiml-dashboard.git Initial code commit for dashboard Issue-Id: AIMLFW-2 Signed-off-by: tganesh2k Change-Id: I36ce4af781fc31bd03085cf05d6b2242bf87a9d4 --- diff --git a/src/components/home/common/CommonMethods.js b/src/components/home/common/CommonMethods.js new file mode 100644 index 0000000..b89050d --- /dev/null +++ b/src/components/home/common/CommonMethods.js @@ -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 index 0000000..9248954 --- /dev/null +++ b/src/components/home/common/Constants.js @@ -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