diff --git a/addOns/webuipoc/src/main/pocs/reactWebUI/src/App.js b/addOns/webuipoc/src/main/pocs/reactWebUI/src/App.js index 483f7a73bd5..66c89b3dd6a 100644 --- a/addOns/webuipoc/src/main/pocs/reactWebUI/src/App.js +++ b/addOns/webuipoc/src/main/pocs/reactWebUI/src/App.js @@ -4,8 +4,9 @@ import Sidebar from "./Components/Sidebar/Sidebar"; import HeaderBase from "./Components/Header/HeaderBase"; import SideTree from "./Components/SitesTree/SitesTree"; import RequestBar from "./Components/Request-Response/Req-Resp-Bar"; -import { sendChildNode } from "./Utilities/requests"; import SearchBar from "./Components/SearchBar/SearchBar"; +import History from "./Components/History/History"; + const App = () => { const [darkMode, setDarkMode] = useState(false); @@ -26,28 +27,11 @@ const App = () => {
-
-
-
- ID | Method | Host | Path | URI -
-
-
-
-

- {/* {childNode && - childNode.map((node) => ( -

- {node.hrefId} -

- ))} */} -
-
-
- -
- + + + + ); }; diff --git a/addOns/webuipoc/src/main/pocs/reactWebUI/src/Components/History/History.jsx b/addOns/webuipoc/src/main/pocs/reactWebUI/src/Components/History/History.jsx new file mode 100644 index 00000000000..9c3bc7b95c0 --- /dev/null +++ b/addOns/webuipoc/src/main/pocs/reactWebUI/src/Components/History/History.jsx @@ -0,0 +1,68 @@ +import React, { useState, useEffect } from "react"; +import {sendHistory} from "../../Utilities/history" + + +const History = () => { + const [history, setHistory] = useState(null) + + + useEffect(() => { + const fetchData = async () => { + try { + const response = await sendHistory(); + setHistory(response); + } catch (error) { + console.error("Error fetching data:", error); + } + }; + + fetchData(); + }, []); + +return ( +
+
+
+ History +
+
+
+
+ + + + + + + + + + + + + + + + + { + history?.log?.entries?.map((historyElement) => ( + + + + + + + + + + )) } + + +
IDMethodDate & TimeURLCodeReasonSize
{historyElement._zapMessageId}{historyElement.request?.method}{historyElement.startedDateTime}{historyElement.request?.url}{historyElement.response?.status}{historyElement.response?.statusText}{historyElement.response?.bodySize} bytes
+
+
+
+ ); +}; + +export default History; diff --git a/addOns/webuipoc/src/main/pocs/reactWebUI/src/Components/HistoryBar.js b/addOns/webuipoc/src/main/pocs/reactWebUI/src/Components/HistoryBar.js deleted file mode 100644 index 2afd3004e58..00000000000 --- a/addOns/webuipoc/src/main/pocs/reactWebUI/src/Components/HistoryBar.js +++ /dev/null @@ -1,13 +0,0 @@ -import React from 'react' - -function HistoryBar() { - return ( -
- History -
- ) -} - -export default HistoryBar - -// WIP \ No newline at end of file diff --git a/addOns/webuipoc/src/main/pocs/reactWebUI/src/Components/Request-Response/Req-Resp-Bar.jsx b/addOns/webuipoc/src/main/pocs/reactWebUI/src/Components/Request-Response/Req-Resp-Bar.jsx index aa3aa6a181b..c32a1efefd8 100644 --- a/addOns/webuipoc/src/main/pocs/reactWebUI/src/Components/Request-Response/Req-Resp-Bar.jsx +++ b/addOns/webuipoc/src/main/pocs/reactWebUI/src/Components/Request-Response/Req-Resp-Bar.jsx @@ -2,11 +2,13 @@ import React from 'react'; function ResponseBar() { return ( -
+ +
-
+
+
Request
@@ -18,7 +20,8 @@ function ResponseBar() {
-
+ +
Response
diff --git a/addOns/webuipoc/src/main/pocs/reactWebUI/src/Utilities/history.js b/addOns/webuipoc/src/main/pocs/reactWebUI/src/Utilities/history.js new file mode 100644 index 00000000000..50933f7edf7 --- /dev/null +++ b/addOns/webuipoc/src/main/pocs/reactWebUI/src/Utilities/history.js @@ -0,0 +1,15 @@ +import axios from 'axios'; + +const sendHistory = async () => { + try { + const response = await axios.get('/OTHER/exim/other/exportHar/'); + return response.data; + } + catch (error) { + console.error('Error fetching data:', error); + throw error; + } + +}; + +export { sendHistory };