fix: filter logs correctly by dokploy ui

This commit is contained in:
Mauricio Siu
2024-09-06 23:22:12 -06:00
parent 25753b6027
commit e6a55920b5
2 changed files with 9 additions and 6 deletions

View File

@@ -49,8 +49,11 @@ export const columns: ColumnDef<LogEntry>[] = [
const log = row.original; const log = row.original;
return ( return (
<div className=" flex flex-col gap-2"> <div className=" flex flex-col gap-2">
<div> <div className="flex flex-row gap-3 ">
{log.RequestMethod} {log.RequestPath} {log.RequestMethod}{" "}
{log.RequestPath.length > 100
? `${log.RequestPath.slice(0, 82)}...`
: log.RequestPath}
</div> </div>
<div className="flex flex-row gap-3 w-full"> <div className="flex flex-row gap-3 w-full">
<Badge variant={getStatusColor(log.OriginStatus)}> <Badge variant={getStatusColor(log.OriginStatus)}>

View File

@@ -63,6 +63,10 @@ export function parseRawConfig(
.map((line) => JSON.parse(line) as LogEntry) .map((line) => JSON.parse(line) as LogEntry)
.value(); .value();
parsedLogs = parsedLogs.filter(
(log) => log.ServiceName !== "dokploy-service-app@file",
);
if (search) { if (search) {
parsedLogs = parsedLogs.filter((log) => parsedLogs = parsedLogs.filter((log) =>
log.RequestPath.toLowerCase().includes(search.toLowerCase()), log.RequestPath.toLowerCase().includes(search.toLowerCase()),
@@ -90,10 +94,6 @@ export function parseRawConfig(
parsedLogs = parsedLogs.slice(startIndex, startIndex + page.pageSize); parsedLogs = parsedLogs.slice(startIndex, startIndex + page.pageSize);
} }
parsedLogs = parsedLogs.filter(
(log) => log.ServiceName !== "dokploy-service-app@file",
);
const totalCount = parsedLogs.length; const totalCount = parsedLogs.length;
return { data: parsedLogs, totalCount }; return { data: parsedLogs, totalCount };