mirror of https://github.com/kortix-ai/suna.git
fix
This commit is contained in:
parent
8b6c3feb6f
commit
06ee5c4b15
|
@ -97,33 +97,53 @@ export const ConfiguredTriggersList: React.FC<ConfiguredTriggersListProps> = ({
|
|||
{triggers.map((trigger) => (
|
||||
<div
|
||||
key={trigger.trigger_id}
|
||||
className="flex items-center justify-between p-4 rounded-lg border bg-card hover:bg-muted/50 transition-colors"
|
||||
className={`flex items-start justify-between p-4 rounded-lg border transition-all duration-200 overflow-hidden ${
|
||||
trigger.is_active
|
||||
? "bg-card hover:bg-muted/50 border-border"
|
||||
: "bg-muted/20 hover:bg-muted/30 border-muted-foreground/30"
|
||||
}`}
|
||||
>
|
||||
<div className="flex items-center space-x-4 flex-1">
|
||||
<div className="p-2 rounded-lg bg-muted border">
|
||||
{getTriggerIcon(trigger.trigger_type)}
|
||||
<div className="flex items-start space-x-4 flex-1 min-w-0">
|
||||
<div className={`p-2 rounded-lg border transition-colors flex-shrink-0 ${
|
||||
trigger.is_active
|
||||
? "bg-muted border-border"
|
||||
: "bg-muted/50 border-muted-foreground/20"
|
||||
}`}>
|
||||
<div className={trigger.is_active ? "" : "opacity-70"}>
|
||||
{getTriggerIcon(trigger.trigger_type)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="flex-1 min-w-0 overflow-hidden">
|
||||
<div className="flex items-center space-x-2 mb-1">
|
||||
<h4 className="text-sm font-medium truncate">
|
||||
<h4 className={`text-sm font-medium truncate transition-colors ${
|
||||
trigger.is_active ? "text-foreground" : "text-muted-foreground"
|
||||
}`}>
|
||||
{trigger.name}
|
||||
</h4>
|
||||
<Badge
|
||||
variant={trigger.is_active ? "default" : "secondary"}
|
||||
className="text-xs"
|
||||
className={`text-xs transition-colors ${
|
||||
trigger.is_active
|
||||
? ""
|
||||
: "bg-muted text-muted-foreground border-muted-foreground/20"
|
||||
}`}
|
||||
>
|
||||
{trigger.is_active ? "Active" : "Inactive"}
|
||||
</Badge>
|
||||
</div>
|
||||
|
||||
{trigger.description && (
|
||||
<p className="text-xs text-muted-foreground truncate">
|
||||
<p className={`text-xs truncate transition-colors ${
|
||||
trigger.is_active ? "text-muted-foreground" : "text-muted-foreground/80"
|
||||
}`}>
|
||||
{truncateString(trigger.description, 50)}
|
||||
</p>
|
||||
)}
|
||||
{trigger.trigger_type === 'schedule' && trigger.config && (
|
||||
<div className="text-xs text-muted-foreground mt-1">
|
||||
<div className={`text-xs mt-1 transition-colors ${
|
||||
trigger.is_active ? "text-muted-foreground" : "text-muted-foreground/80"
|
||||
}`}>
|
||||
{trigger.config.execution_type === 'agent' && trigger.config.agent_prompt && (
|
||||
<p>Prompt: {truncateString(trigger.config.agent_prompt, 40)}</p>
|
||||
)}
|
||||
|
@ -133,47 +153,57 @@ export const ConfiguredTriggersList: React.FC<ConfiguredTriggersListProps> = ({
|
|||
</div>
|
||||
)}
|
||||
{trigger.webhook_url && (
|
||||
<div className="flex items-center space-x-2 mt-2">
|
||||
<code className="text-xs bg-muted px-2 py-1 rounded font-mono max-w-xs truncate">
|
||||
<div className="flex items-center space-x-2 mt-2 min-w-0">
|
||||
<code className={`text-xs px-2 py-1 rounded font-mono truncate flex-1 min-w-0 transition-colors ${
|
||||
trigger.is_active
|
||||
? "bg-muted text-foreground"
|
||||
: "bg-muted/50 text-muted-foreground/80"
|
||||
}`}>
|
||||
{trigger.webhook_url}
|
||||
</code>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
className="h-6 w-6 p-0"
|
||||
onClick={() => copyToClipboard(trigger.webhook_url!)}
|
||||
>
|
||||
<Copy className="h-3 w-3" />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>
|
||||
<p>Copy webhook URL</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
{trigger.webhook_url.startsWith('http') && (
|
||||
<div className="flex items-center space-x-1 flex-shrink-0">
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
className="h-6 w-6 p-0"
|
||||
onClick={() => window.open(trigger.webhook_url, '_blank')}
|
||||
className={`h-6 w-6 p-0 transition-opacity ${
|
||||
trigger.is_active ? "" : "opacity-70"
|
||||
}`}
|
||||
onClick={() => copyToClipboard(trigger.webhook_url!)}
|
||||
>
|
||||
<ExternalLink className="h-3 w-3" />
|
||||
<Copy className="h-3 w-3" />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>
|
||||
<p>Open webhook URL</p>
|
||||
<p>Copy webhook URL</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
)}
|
||||
{trigger.webhook_url.startsWith('http') && (
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
className={`h-6 w-6 p-0 transition-opacity ${
|
||||
trigger.is_active ? "" : "opacity-70"
|
||||
}`}
|
||||
onClick={() => window.open(trigger.webhook_url, '_blank')}
|
||||
>
|
||||
<ExternalLink className="h-3 w-3" />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>
|
||||
<p>Open webhook URL</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center space-x-2 flex-shrink-0">
|
||||
<div className="flex items-start space-x-2 flex-shrink-0 pt-1">
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<div className="flex items-center">
|
||||
|
@ -195,7 +225,9 @@ export const ConfiguredTriggersList: React.FC<ConfiguredTriggersListProps> = ({
|
|||
size="sm"
|
||||
variant="ghost"
|
||||
onClick={() => onEdit(trigger)}
|
||||
className="h-8 w-8 p-0"
|
||||
className={`h-8 w-8 p-0 transition-opacity ${
|
||||
trigger.is_active ? "" : "opacity-70"
|
||||
}`}
|
||||
disabled={isLoading}
|
||||
>
|
||||
<Edit className="h-4 w-4" />
|
||||
|
@ -212,7 +244,9 @@ export const ConfiguredTriggersList: React.FC<ConfiguredTriggersListProps> = ({
|
|||
size="sm"
|
||||
variant="ghost"
|
||||
onClick={() => handleDeleteClick(trigger)}
|
||||
className="h-8 w-8 p-0 text-destructive hover:text-destructive"
|
||||
className={`h-8 w-8 p-0 text-destructive hover:text-destructive transition-opacity ${
|
||||
trigger.is_active ? "" : "opacity-70"
|
||||
}`}
|
||||
disabled={isLoading}
|
||||
>
|
||||
<Trash2 className="h-4 w-4" />
|
||||
|
|
Loading…
Reference in New Issue