Notes
Notes - notes.io |
import { useLocation } from "react-router-dom";
import Loader from "../../commonComponents/Loader";
import CommonTableComponent from "../CallDropsComponent/CommonTableComponent";
import { alarmTable ,triggerPDFDownload,get5gMaxDate} from "../../services/request";
import SubString from "../../commonComponents/SubString";
import UpdateAlarmStatus from "../UpdateAlarmStatus";
import { getApiURL } from "../../utils/PropertiesReader";
import "./FiveGNetworkPerformance.css";
const FiveGNetworkPerformance = ({ payLoad,setEnodeBcheckId, PDF_SUB_ID,
SUB_ID,Pdf_Pop_Up }) => {
const [loading, setLoading] = useState(false);
const [alarmTableData, setAlarmTableData] = useState([]);
const [showModalPopup, setShowModalpopup] = useState(false);
const [csvTableColumns, setCsvTableColumns] = useState([]);
const [selectedRowData, setSelectedRowData] = useState([]);
const alarmTableFunction = (obj) => {
// let alarmTablePaylods = {
// date: payLoad,
// };
alarmTable(obj)
.then((response) => {
setAlarmTableData(response.data.AlarmTable);
})
.catch((err) => {
console.log(err);
setAlarmTableData([]);
})
.finally(() => {
setLoading(false);
});
};
let alarmTableColumns = [
{
title: "Date",
field: "date",
filtering: true,
},
{
title: "Start Time",
field: "start_time",
filtering: true,
},
{
title: "Alarm ID",
field: "Alarm_ID",
filtering: true,
},
{
title: "Alarm Category",
field: "Alarm_Category",
render: (el) => SubString(el["Alarm_Category"]),
filtering: true,
},
{
title: "eNodeB",
field: "eNodeB",
filtering: true,
},
{
title: "Impacted MDN Count",
field: "Impacted_MDN_Count",
filtering: true,
},
];
let location = useLocation();
const parameters = new URLSearchParams(location.search);
const screenName = "FivegAnalytics";
const downloadPdfTrigger = (Pdf_Pop_Up=false) => {
setLoading(true);
let urlParamsDwd = {
// anomalies flex filter load pdf
params: CreateParameters(),
screenName: screenName,
flow: "download",
// tabScreenName: props.radioButton,
};
if(Pdf_Pop_Up){
urlParamsDwd.params.Pdf_Pop_Up=true;
}
triggerPDFDownload(urlParamsDwd).then((response) => {
if (response.data.downloadPDFName) {
let pdfURL = `${getApiURL()}/downloadPDF?pdfFileName=${
response.data.downloadPDFName
}`;
window.open(pdfURL, "download");
setLoading(false);
}
setLoading(false);
});
};
const CreateParameters = (data) => {
let obj = {
Date:"2023-04-27"
// topfilters: `selectToggle=${
// selectedToggle ? selectedToggle[0].value : "Mobile"
// }`,
};
return obj;
};
const downloadHandler=()=>{
downloadPdfTrigger(true)
}
useEffect(() => {
setLoading(true);
let obj;
let date1;
if (Pdf_Pop_Up==="true") {
let obj = {
Date:"2023-04-27"
// topfilters: `selectToggle=${
// selectedToggle ? selectedToggle[0].value : "Mobile"
// }`,
};
// date1 = get5gMaxDate
// .then((res) => {
// let dateList = res.data ? [...res.data] : [];
// if (dateList.length > 0) {
// return dateList[0];
// }
// })
// .catch((error) => {
// console.log(error);
// });
alarmTableFunction(obj);
}
else {
if (payLoad) {
obj = {
Date: payLoad.date,
};
alarmTableFunction(obj);
}
}
setCsvTableColumns(alarmTableColumns.map((obj) => obj["title"]));
}, [payLoad]);
return (
<React.Fragment>
<div>{loading ? <Loader /> : null}</div>
<div className="FiveGNetworkPerformanceMainContainer">
<div className="alarmTableContainer">
<CommonTableComponent
title={"Alarm Summary"}
columns={alarmTableColumns}
data={alarmTableData}
exportFileName={"Alarm Summary"}
sorting={true}
exportCsv={true}
filtering={false}
pagination={true}
active={true}
exportAllData={true}
csvTableColumns={csvTableColumns}
search={true}
maxBodyHeight={600}
pageSize={10}
draggable={false}
onRowClick={(rowData) => {
setSelectedRowData(rowData);
setShowModalpopup(true);
}}
/>
</div>
{showModalPopup ? (
<UpdateAlarmStatus
show={showModalPopup}
setShow={setShowModalpopup}
selectedRowData={selectedRowData}
setEnodeBcheckId = {setEnodeBcheckId}
downloadHandler={downloadHandler}
Pdf_Pop_Up={Pdf_Pop_Up}
alarmTableFunction={alarmTableFunction}
/>
) : null}
</div>
</React.Fragment>
);
};
export default FiveGNetworkPerformance;
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team