From da51ccfe16d1b780933a2d1721cebbd7a098e0cd Mon Sep 17 00:00:00 2001 From: Nitish Tiwari Date: Fri, 2 Sep 2022 14:36:15 +0530 Subject: [PATCH] Ignore scrolling query till we fix the issues with query (#13) Also, change the field separator for tags and metadata to '^' from earlier ','. --- src/components/SideDialog/index.js | 71 ++---------------------------- src/page/Dashboard/index.js | 4 +- src/utils/api/query.js | 4 +- 3 files changed, 6 insertions(+), 73 deletions(-) diff --git a/src/components/SideDialog/index.js b/src/components/SideDialog/index.js index e1af30fe..e8617229 100644 --- a/src/components/SideDialog/index.js +++ b/src/components/SideDialog/index.js @@ -23,30 +23,6 @@ const removeMeta = (data) => { export default function SideDialog({ open, setOpen, data }) { const [log, setLog] = useState({}); - // const str = - // Object.keys(data).length !== 0 - // ? data?.log.replace(/"([^"]+)":/g, "$1:") - // : ""; - - // JSON.parse(str) - - // console.log(data?.log); - - // console.log(JSON.parse(`${Object.keys(data).length !== 0 ? data?.log : ""}`)); - // console.log(JSON.parse(`${data?.log}`)); - // console.log( - // JSON.parse( - // `{"host":"176.94.62.153", "user-identifier":"wehner6461", "datetime":"24/Jun/2022:14:11:59 +0000", "method": "POST", "request": "/schemas/facilitate/engage", "protocol":"HTTP/2.0", "status":502, "bytes":4859, "referer": "https://www.forwardstreamline.net/e-tailers"}` - // ) - // ); - - // useEffect(() => { - // if (Object.keys(data).length !== 0) { - // setLog(JSON.parse(`${data?.log}`)); - // } else { - // } - // }, [data]); - return ( @@ -69,14 +45,6 @@ export default function SideDialog({ open, setOpen, data }) {
- {/*
-
Status
-
- -
info
-
-
*/} - {/*
*/}
Timestamp
@@ -101,42 +69,26 @@ export default function SideDialog({ open, setOpen, data }) {
- {/*
-

- {data?.time} -

-
*/}
{/* Replace with your content */}
- {data.p_tags?.split(",").map((tag, index) => ( + {data.p_tags?.split("^").map((tag, index) => (
{tag}
))}
-
- - {/*
-
- Message -
-
- Exception in channel pipeline -
-
*/} -
- {data.p_metadata?.split(",").map((field) => ( + {data.p_metadata?.split("^").map((field) => (
{field.split("=")[0]}
- {field.split("=")[1]} + {field.substring(field.indexOf('=')+1)}
))} @@ -146,10 +98,6 @@ export default function SideDialog({ open, setOpen, data }) {
Logger Message
- {/*
- Sakjdha askdjahd akjhda sk ajdhas kdaskdha skajhd - asakjh -
*/}
@@ -157,19 +105,6 @@ export default function SideDialog({ open, setOpen, data }) {
                                   {JSON.stringify(removeMeta(data), null, 2)}
                                 
- {/*
-                                  {data.log}
-                                
-
-                                  {str}
-                                
*/} - {/*
-                                  {JSON.stringify(
-                                    JSON.parse(`${data?.log}`),
-                                    null,
-                                    2
-                                  )}
-                                
*/}
diff --git a/src/page/Dashboard/index.js b/src/page/Dashboard/index.js index 7758fdb1..df8b31f4 100644 --- a/src/page/Dashboard/index.js +++ b/src/page/Dashboard/index.js @@ -659,7 +659,7 @@ const Dashboard = () => { page?.data?.map( (data, index) => hasSubArray( - data.p_tags?.split(","), + data.p_tags?.split("^"), selectedTags, ) && (searchQuery === "" || @@ -682,7 +682,7 @@ const Dashboard = () => { ))} {data.p_tags - ?.split(",") + ?.split("^") .map((tag, index) => { addAvailableTags(tag); return ( diff --git a/src/utils/api/query.js b/src/utils/api/query.js index a6fa2d99..9ff79e6d 100644 --- a/src/utils/api/query.js +++ b/src/utils/api/query.js @@ -24,9 +24,7 @@ const queryLogs = async ( return await post( QUERY_URL, { - query: `select * from ${streamName} ${ - dateStream !== null ? `order by ${dateStream}` : "" - } limit 10 ${pageParam === 1 ? "" : `offset ${pageParam * 10}`} `, + query: `select * from ${streamName}`, startTime: startTime, endTime: endTime, },