Skip to content

Commit

Permalink
Ignore scrolling query till we fix the issues with query (#13)
Browse files Browse the repository at this point in the history
Also, change the field separator for tags and metadata
to '^' from earlier ','.
  • Loading branch information
nitisht authored Sep 2, 2022
1 parent e17af21 commit da51ccf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 73 deletions.
71 changes: 3 additions & 68 deletions src/components/SideDialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Transition.Root show={open} as={Fragment}>
<Dialog as="div" className="relative z-10" onClose={setOpen}>
Expand All @@ -69,14 +45,6 @@ export default function SideDialog({ open, setOpen, data }) {
<div className="bg-drawerBlue py-1 px-4 sm:px-6">
<div className="flex items-center justify-between">
<Dialog.Title className="text-xs flex items-center font-medium text-white">
{/* <div className="">
<div>Status</div>
<div className="mt-1 text-sky-500 flex space-x-1 items-center">
<ExclamationCircleIcon className="w-4" />
<div>info</div>
</div>
</div> */}
{/* <div className="w-px h-6 mx-5 bg-gray-500"></div> */}
<div className="">
<div className="flex space-x-10">
<div>Timestamp</div>
Expand All @@ -101,42 +69,26 @@ export default function SideDialog({ open, setOpen, data }) {
</button>
</div>
</div>
{/* <div className="mt-1">
<p className="text-sm text-indigo-300">
{data?.time}
</p>
</div> */}
</div>
<div className="relative flex-1 py-1 px-4 sm:px-6">
{/* Replace with your content */}
<div className="absolute inset-0 py-1 px-4 sm:px-6">
<div className="flex flex-wrap items-center">
{data.p_tags?.split(",").map((tag, index) => (
{data.p_tags?.split("^").map((tag, index) => (
<div className="mx-1 h-6 text-xs mt-2 bg-slate-200 rounded-md flex justify-center items-center px-2 py-1">
{tag}
</div>
))}
</div>

<div className="border-t mt-3 border-gray-300"></div>

{/* <div className="bg-slate-100 rounded-md py-3 px-3 my-2">
<div className="text-xs font-bold text-gray-700 ">
Message
</div>
<div className="text-xs text-gray-600 ">
Exception in channel pipeline
</div>
</div> */}

<div className="border-y border-gray-300 grid md:grid-cols-2">
{data.p_metadata?.split(",").map((field) => (
{data.p_metadata?.split("^").map((field) => (
<div className="ml-2 py-3 border-gray-300">
<div className="text-xs font-bold text-gray-700 ">
{field.split("=")[0]}
</div>
<div className="text-xs text-gray-600 ">
{field.split("=")[1]}
{field.substring(field.indexOf('=')+1)}
</div>
</div>
))}
Expand All @@ -146,30 +98,13 @@ export default function SideDialog({ open, setOpen, data }) {
<div className="text-xs font-bold text-gray-700 ">
Logger Message
</div>
{/* <div className="text-xs text-gray-600 ">
Sakjdha askdjahd akjhda sk ajdhas kdaskdha skajhd
asakjh
</div> */}

<div className="bg-codeBack p-1 mt-5">
<div className="bg-codeBack h-500 scrollbar-thin scrollbar-thumb-white scrollbar-codeBlack overflow-y-scroll scrollbar-thumb-rounded-full scrollbar-track-rounded-full py-3 px-3">
<div>
<pre className="text-white text-xs font-light">
{JSON.stringify(removeMeta(data), null, 2)}
</pre>
{/* <pre className="text-white text-xs font-light">
{data.log}
</pre>
<pre className="text-white text-xs font-light">
{str}
</pre> */}
{/* <pre className="text-white text-xs font-light">
{JSON.stringify(
JSON.parse(`${data?.log}`),
null,
2
)}
</pre> */}
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/page/Dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ const Dashboard = () => {
page?.data?.map(
(data, index) =>
hasSubArray(
data.p_tags?.split(","),
data.p_tags?.split("^"),
selectedTags,
) &&
(searchQuery === "" ||
Expand All @@ -682,7 +682,7 @@ const Dashboard = () => {
))}
<td className="flex whitespace-nowrap px-3 py-4 text-sm text-gray-700">
{data.p_tags
?.split(",")
?.split("^")
.map((tag, index) => {
addAvailableTags(tag);
return (
Expand Down
4 changes: 1 addition & 3 deletions src/utils/api/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down

0 comments on commit da51ccf

Please sign in to comment.