Skip to content
This repository was archived by the owner on May 13, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/page/Dashboard/FieldBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const Field = ({
}) => {
return (
<div className="flex flex-col">
<div className="bg-gray-200 py-3 px-5">
<div className="bg-gray-200 py-3 px-5 border-b border-b-gray-300">
<h3 className=" font-semibold text-gray-600 ">Columns</h3>
</div>
<div>
Expand Down
34 changes: 14 additions & 20 deletions src/page/Dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ const Dashboard = () => {
selectedLogStream?.name,
moment(startTime).utcOffset("+00:00").format("YYYY-MM-DDTHH:mm:ssZ"),
moment(endTime).utcOffset("+00:00").format("YYYY-MM-DDTHH:mm:ssZ"),
selectedLogSchema,
logStreamSchema?.data?.data?.fields?.map((field) => {
return field.name;
}),
() => {
if (range < 7) {
const rangeVal = getRange();
Expand All @@ -195,7 +197,12 @@ const Dashboard = () => {
setAvailableTags([]);
},
retry: false,
enabled: !!(selectedLogSchema?.length !== 0),
enabled:
!!(
logStreamSchema?.data?.data?.fields?.map((field) => {
return field.name;
})?.length !== 0
) && !!(selectedLogStream?.name != null),
refetchOnWindowFocus: false,
refetchInterval:
interval === null || range === 7 ? false : interval * 1000,
Expand Down Expand Up @@ -623,12 +630,6 @@ const Dashboard = () => {
{name}
</th>
))}
<th
// scope="col"
className="px-3 py-3.5 text-left text-sm font-semibold text-gray-900"
>
Tags
</th>
</tr>
</thead>
{logQueries.isLoading &&
Expand Down Expand Up @@ -680,18 +681,11 @@ const Dashboard = () => {
{data[schema] || ""}
</td>
))}
<td className="flex whitespace-nowrap px-3 py-4 text-sm text-gray-700">
{data.p_tags
?.split("^")
.map((tag, index) => {
addAvailableTags(tag);
return (
<div className="mx-1 bg-slate-200 rounded-sm flex justify-center items-center px-1 py-1">
{tag}
</div>
);
})}
</td>
{data.p_tags
?.split("^")
.forEach((tag) => {
addAvailableTags(tag);
})}
</tr>
),
),
Expand Down
20 changes: 11 additions & 9 deletions src/utils/api/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,25 @@ const queryLogs = async (
endTime,
signal,
pageParam,
selectedLogSchema,
logSchema,
) => {
let dateStream = null;

for (let index in selectedLogSchema) {
for (let index in logSchema) {
if (
selectedLogSchema[index].includes("date") ||
selectedLogSchema[index].includes("time")
logSchema[index].includes("date") ||
logSchema[index].includes("time")
) {
dateStream = selectedLogSchema[index];
dateStream = logSchema[index];
}
}

return await post(
QUERY_URL,
{
query: `select * from ${streamName}`,
query: `select * from ${streamName} ${
dateStream !== null ? `order by ${dateStream} ` : ""
}limit 10${pageParam === 1 ? "" : ` offset ${(pageParam - 1) * 10}`}`,
startTime: startTime,
endTime: endTime,
},
Expand All @@ -36,12 +38,12 @@ export const useQueryLogs = (
streamName,
startTime,
endTime,
selectedLogSchema,
logSchema,
fn,
option = {},
) =>
useInfiniteQuery(
[QUERY, streamName, startTime, endTime],
[QUERY, streamName, logSchema, startTime, endTime],
async ({ signal, pageParam = 1 }) => {
await fn();
return await queryLogs(
Expand All @@ -50,7 +52,7 @@ export const useQueryLogs = (
endTime,
signal,
pageParam,
selectedLogSchema,
logSchema,
);
},
{
Expand Down