diff --git a/apps/sim/app/api/logs/export/route.ts b/apps/sim/app/api/logs/export/route.ts index 645d8613333..08cad297a0b 100644 --- a/apps/sim/app/api/logs/export/route.ts +++ b/apps/sim/app/api/logs/export/route.ts @@ -60,7 +60,12 @@ export async function GET(request: NextRequest) { let conditions: SQL | undefined = eq(workflow.workspaceId, params.workspaceId) if (params.level && params.level !== 'all') { - conditions = and(conditions, eq(workflowExecutionLogs.level, params.level)) + const levels = params.level.split(',').filter(Boolean) + if (levels.length === 1) { + conditions = and(conditions, eq(workflowExecutionLogs.level, levels[0])) + } else if (levels.length > 1) { + conditions = and(conditions, inArray(workflowExecutionLogs.level, levels)) + } } if (params.workflowIds) { diff --git a/apps/sim/app/api/logs/route.ts b/apps/sim/app/api/logs/route.ts index b55e2d1323d..3d7e532825c 100644 --- a/apps/sim/app/api/logs/route.ts +++ b/apps/sim/app/api/logs/route.ts @@ -126,9 +126,14 @@ export async function GET(request: NextRequest) { // Build additional conditions for the query let conditions: SQL | undefined - // Filter by level + // Filter by level (supports comma-separated for OR conditions) if (params.level && params.level !== 'all') { - conditions = and(conditions, eq(workflowExecutionLogs.level, params.level)) + const levels = params.level.split(',').filter(Boolean) + if (levels.length === 1) { + conditions = and(conditions, eq(workflowExecutionLogs.level, levels[0])) + } else if (levels.length > 1) { + conditions = and(conditions, inArray(workflowExecutionLogs.level, levels)) + } } // Filter by specific workflow IDs diff --git a/apps/sim/app/workspace/[workspaceId]/logs/components/dashboard/controls.tsx b/apps/sim/app/workspace/[workspaceId]/logs/components/dashboard/controls.tsx index 485d4cb750c..93bfee6b599 100644 --- a/apps/sim/app/workspace/[workspaceId]/logs/components/dashboard/controls.tsx +++ b/apps/sim/app/workspace/[workspaceId]/logs/components/dashboard/controls.tsx @@ -1,5 +1,5 @@ import type { ReactNode } from 'react' -import { Loader2, RefreshCw, Search } from 'lucide-react' +import { ArrowUp, Loader2, RefreshCw, Search } from 'lucide-react' import { Button, Tooltip } from '@/components/emcn' import { Input } from '@/components/ui/input' import { cn } from '@/lib/utils' @@ -16,7 +16,6 @@ export function Controls({ viewMode, setViewMode, searchComponent, - showExport = true, onExport, }: { searchQuery?: string @@ -72,6 +71,23 @@ export function Controls({ )}
+ {viewMode !== 'dashboard' && ( + + + + + Export CSV + + )} + @@ -91,32 +107,6 @@ export function Controls({ {isRefetching ? 'Refreshing...' : 'Refresh'} - - - - - Export CSV - -
- ) - })} -
- )} -
- {currentHoverDate ? ( -
{currentHoverDate}
- ) : null} + }} + onClick={() => setActiveSeriesId((prev) => (prev === s.id ? null : s.id || null))} + > +