Skip to content
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ packages/nodes/tsconfig.tsbuildinfo
.agents/rules/code-mentor.md
standard the output.md
packages/kafka/tsconfig.tsbuildinfo
.agents/rules/
59 changes: 58 additions & 1 deletion apps/http-backend/src/routes/userRoutes/userRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,27 @@ router.get("/dashboard/overview",
description: true,
createdAt: true,
status: true,
nodes: {
select: {
id: true,
name: true,
stage: true,
},
},
Trigger: {
select: {
id: true,
name: true,
},
},
executions: {
orderBy: { startAt: "desc" },
take: 1,
select: {
status: true,
startAt: true,
},
},
},
}),
prismaClient.credential.findMany({
Expand Down Expand Up @@ -344,6 +365,16 @@ router.get("/dashboard/overview",
const googleSheetsConnected =
hasSharedGoogleOAuth || credentialTypes.has("gsheet_oauth");

const formattedRecentWorkflows = recentWorkflows.map((wf) => ({
id: wf.id,
name: wf.name,
description: wf.description,
createdAt: wf.createdAt,
status: (wf as any).executions?.[0]?.status || wf.status || null,
lastExecutionAt: (wf as any).executions?.[0]?.startAt || null,
nodeCount: ((wf as any).nodes?.length || 0) + ((wf as any).Trigger ? 1 : 0),
}));

return res.status(statusCodes.OK).json({
message: "Dashboard overview fetched successfully",
data: {
Expand All @@ -365,7 +396,7 @@ router.get("/dashboard/overview",
connected: googleSheetsConnected,
},
],
recentWorkflows,
recentWorkflows: formattedRecentWorkflows,
},
});
} catch (error) {
Expand Down Expand Up @@ -563,6 +594,32 @@ router.get("/workflows",
where: {
userId,
},
include: {
nodes: {
select: {
id: true,
name: true,
stage: true,
},
},
Trigger: {
select: {
id: true,
name: true,
},
},
executions: {
orderBy: { startAt: "desc" },
take: 1,
select: {
status: true,
startAt: true,
},
},
},
orderBy: {
createdAt: "desc",
},
});
// console.log(workflows);
return res
Expand Down
Binary file added apps/web/app/apple-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 16 additions & 16 deletions apps/web/app/components/Actions/ActionSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,44 +42,44 @@ export const ActionSideBar = ({ isOpen, onClose, onSelectAction }: SideBarProps)

return (
<Sheet open={isOpen} onOpenChange={(open) => !open && onClose()}>
<SheetContent className="w-[380px] sm:w-[480px] bg-[#f8fafc] border-l border-gray-200 text-gray-900 p-6 flex flex-col font-sans">
<SheetContent className="w-[380px] sm:w-[480px] bg-card border-l border-border text-foreground p-6 flex flex-col font-sans">
<SheetHeader className="mb-4">
<div className="flex items-center gap-3">
<div className="h-10 w-10 rounded-2xl bg-[#18181b] text-white flex items-center justify-center shadow-sm">
<Layers className="h-5 w-5 text-indigo-400" />
<div className="h-10 w-10 rounded-xl bg-secondary border border-border text-primary flex items-center justify-center shadow-xs">
<Layers className="h-5 w-5" />
</div>
<div>
<SheetTitle className="text-lg font-bold text-gray-900">Add Action Step</SheetTitle>
<p className="text-xs text-gray-500">Choose a tool, app, or transform node</p>
<SheetTitle className="text-base sm:text-lg font-bold text-foreground">Add Action Step</SheetTitle>
<p className="text-xs text-muted-foreground">Choose a tool, app, or transform node</p>
</div>
</div>
</SheetHeader>

{/* Search */}
<div className="relative mb-4">
<Search className="absolute left-3.5 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" />
<Search className="absolute left-3.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" />
<input
type="text"
placeholder="Search actions & connectors..."
value={search}
onChange={(e) => setSearch(e.target.value)}
className="w-full pl-10 pr-4 py-2.5 rounded-2xl bg-white border border-gray-200 text-xs text-gray-900 placeholder-gray-400 focus:outline-none focus:border-black focus:ring-1 focus:ring-black/10 transition-all shadow-sm"
className="w-full pl-10 pr-4 py-2.5 rounded-xl bg-secondary border border-border text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:border-primary/50 transition-all font-medium"
/>
</div>

{/* Actions list */}
<div className="flex-1 overflow-y-auto space-y-2.5 pr-1">
{loading ? (
<div className="flex flex-col items-center justify-center h-48 gap-3 text-gray-500">
<Loader2 className="h-6 w-6 animate-spin text-gray-900" />
<div className="flex flex-col items-center justify-center h-48 gap-3 text-muted-foreground">
<Loader2 className="h-6 w-6 animate-spin text-primary" />
<span className="text-xs">Loading available actions...</span>
</div>
) : error ? (
<div className="p-4 rounded-2xl bg-rose-50 border border-rose-200 text-rose-700 text-xs">
<div className="p-4 rounded-xl bg-destructive/10 border border-destructive/20 text-destructive text-xs">
Error fetching actions.
</div>
) : filteredActions.length === 0 ? (
<div className="p-6 text-center text-xs text-gray-400">
<div className="p-6 text-center text-xs text-muted-foreground">
No actions found matching &quot;{search}&quot;
</div>
) : (
Expand All @@ -95,27 +95,27 @@ export const ActionSideBar = ({ isOpen, onClose, onSelectAction }: SideBarProps)
});
onClose();
}}
className="group p-4 rounded-3xl bg-white border border-gray-200 hover:border-gray-900 hover:shadow-md transition-all cursor-pointer flex items-center justify-between"
className="group p-4 rounded-2xl bg-card border border-border hover:border-primary/50 hover:bg-secondary/40 hover:shadow-md transition-all cursor-pointer flex items-center justify-between"
>
<div className="flex items-center gap-3">
<NodeIcon
icon={"icon" in action && action.icon ? action.icon : undefined}
name={action.name}
size="md"
nodeType="action"
className="w-10 h-10 bg-gray-50 border border-gray-100 rounded-2xl"
className="w-10 h-10 bg-secondary border border-border rounded-xl"
/>
<div>
<h5 className="font-bold text-xs text-gray-900 group-hover:text-black transition-colors">
<h5 className="font-bold text-xs text-foreground group-hover:text-primary transition-colors">
{action.name}
</h5>
<span className="text-[11px] text-gray-500 block">
<span className="text-[11px] text-muted-foreground block">
{action.description || `Node type: ${action.type}`}
</span>
</div>
</div>

<ArrowRight className="h-4 w-4 text-gray-400 group-hover:text-black group-hover:translate-x-0.5 transition-all" />
<ArrowRight className="h-4 w-4 text-muted-foreground group-hover:text-primary group-hover:translate-x-0.5 transition-all" />
</div>
))
)}
Expand Down
106 changes: 64 additions & 42 deletions apps/web/app/components/ExecutionHistoryFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ import {
ChevronDown,
ArrowLeft,
X,
CheckCircle2,
AlertCircle,
Loader2,
Clock,
RotateCcw,
PlayCircle,
Ban,
} from 'lucide-react';
import { WorkflowExecutionLog, NodeExecutionLog } from '@/app/types/execution.types';
import {
formatDate,
formatDuration,
getStatusIcon,
} from '@/app/lib/formatters';

interface ExecutionHistoryFooterProps {
Expand All @@ -25,35 +31,51 @@ interface ExecutionHistoryFooterProps {
}

// ─── Status Badge ───
const renderStatusIcon = (status: string) => {
switch (status) {
case 'Completed':
return <CheckCircle2 className="w-3.5 h-3.5 shrink-0" />;
case 'Failed':
return <AlertCircle className="w-3.5 h-3.5 shrink-0" />;
case 'InProgress':
return <Loader2 className="w-3.5 h-3.5 shrink-0 animate-spin" />;
case 'Pending':
return <Clock className="w-3.5 h-3.5 shrink-0" />;
case 'ReConnecting':
return <RotateCcw className="w-3.5 h-3.5 shrink-0 animate-spin" />;
case 'Start':
return <PlayCircle className="w-3.5 h-3.5 shrink-0" />;
case 'Skipped':
return <Ban className="w-3.5 h-3.5 shrink-0" />;
default:
return <Activity className="w-3.5 h-3.5 shrink-0" />;
}
};

const StatusBadge: React.FC<{ status: string }> = ({ status }) => {
const styles: Record<string, string> = {
Completed: 'background:rgba(16,185,129,0.15);color:#34d399;border:1px solid rgba(16,185,129,0.3);',
Failed: 'background:rgba(239,68,68,0.15);color:#f87171;border:1px solid rgba(239,68,68,0.3);',
InProgress: 'background:rgba(99,102,241,0.15);color:#818cf8;border:1px solid rgba(99,102,241,0.3);',
Pending: 'background:rgba(245,158,11,0.15);color:#fbbf24;border:1px solid rgba(245,158,11,0.3);',
Start: 'background:rgba(148,163,184,0.15);color:#cbd5e1;border:1px solid rgba(148,163,184,0.3);',
ReConnecting: 'background:rgba(249,115,22,0.15);color:#fb923c;border:1px solid rgba(249,115,22,0.3);',
Skipped: 'background:rgba(100,116,139,0.15);color:#94a3b8;border:1px solid rgba(100,116,139,0.3);',
const getBadgeClass = (s: string) => {
switch (s) {
case 'Completed':
return 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20';
case 'Failed':
return 'bg-rose-500/10 text-rose-600 dark:text-rose-400 border-rose-500/20';
case 'InProgress':
return 'bg-primary/10 text-primary border-primary/20';
case 'Pending':
return 'bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20';
case 'ReConnecting':
return 'bg-orange-500/10 text-orange-600 dark:text-orange-400 border-orange-500/20';
case 'Skipped':
return 'bg-muted text-muted-foreground border-border dark:border-white/10';
default:
return 'bg-muted text-muted-foreground border-border dark:border-white/10';
}
};

return (
<span
style={{
...Object.fromEntries((styles[status] || styles.Start)!.split(';').filter(Boolean).map(s => {
const [k, v] = s.split(':');
return [k!.trim().replace(/-([a-z])/g, (_, l) => l.toUpperCase()), v!.trim()];
})),
padding: '3px 10px',
borderRadius: '6px',
fontSize: '11px',
fontWeight: 600,
letterSpacing: '0.3px',
display: 'inline-flex',
alignItems: 'center',
gap: '4px',
whiteSpace: 'nowrap' as const,
}}
>
{getStatusIcon(status)} {status}
<span className={`px-2.5 py-1 rounded-md text-[11px] font-semibold tracking-wide inline-flex items-center gap-1.5 whitespace-nowrap border ${getBadgeClass(status)}`}>
{renderStatusIcon(status)}
<span>{status}</span>
</span>
);
};
Expand Down Expand Up @@ -303,8 +325,8 @@ export default function ExecutionHistoryFooter({
left: sidebarWidth,
right: 0,
height: '48px',
background: 'rgba(15, 16, 18, 0.95)',
borderTop: '1px solid #27282d',
background: 'var(--chassis)',
borderTop: '1px solid rgba(255, 255, 255, 0.1)',
zIndex: 9,
display: 'flex',
alignItems: 'center',
Expand All @@ -316,14 +338,14 @@ export default function ExecutionHistoryFooter({
>
{/* Left */}
<div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>
<span style={{ fontSize: '13px', fontWeight: 600, color: '#e2e8f0', display: 'flex', alignItems: 'center', gap: '7px' }}>
<span style={{ fontSize: '13px', fontWeight: 600, color: 'var(--chassis-foreground)', display: 'flex', alignItems: 'center', gap: '7px' }}>
<Activity style={{ width: '15px', height: '15px', color: '#818cf8', flexShrink: 0 }} />
<span>Executions</span>
</span>
<span style={{ fontSize: '11px', color: '#64748b' }}>
<span style={{ fontSize: '11px', color: 'rgba(255, 255, 255, 0.6)' }}>
Last: <StatusBadge status={lastStatus} />
</span>
<span style={{ fontSize: '11px', color: '#475569' }}>
<span style={{ fontSize: '11px', color: 'rgba(255, 255, 255, 0.4)' }}>
{executions.length} runs
</span>
</div>
Expand All @@ -334,13 +356,13 @@ export default function ExecutionHistoryFooter({
onClick={fetchExecutionLogs}
disabled={footerLoading}
style={{
padding: '4px 12px',
padding: '5px 14px',
fontSize: '11px',
fontWeight: 600,
background: footerLoading ? '#18191c' : '#ffffff',
color: footerLoading ? '#9ca3af' : '#000000',
border: 'none',
borderRadius: '6px',
background: footerLoading ? 'rgba(255, 255, 255, 0.05)' : 'rgba(255, 255, 255, 0.10)',
color: footerLoading ? 'rgba(255, 255, 255, 0.4)' : '#ffffff',
border: '1px solid rgba(255, 255, 255, 0.12)',
borderRadius: '8px',
cursor: footerLoading ? 'wait' : 'pointer',
transition: 'all 0.15s ease',
display: 'flex',
Expand All @@ -363,13 +385,13 @@ export default function ExecutionHistoryFooter({
if (!isExpanded) setSelectedExecution(null);
}}
style={{
padding: '4px 12px',
padding: '5px 14px',
fontSize: '11px',
fontWeight: 600,
background: isExpanded ? '#18191c' : '#ffffff',
color: isExpanded ? '#9ca3af' : '#000000',
border: isExpanded ? '1px solid #27282d' : 'none',
borderRadius: '6px',
background: isExpanded ? 'rgba(255, 255, 255, 0.05)' : 'rgba(255, 255, 255, 0.10)',
color: '#ffffff',
border: '1px solid rgba(255, 255, 255, 0.12)',
borderRadius: '8px',
cursor: 'pointer',
transition: 'all 0.15s ease',
display: 'flex',
Expand Down
Loading