精简事件管理里的事件
This commit is contained in:
@@ -9,24 +9,12 @@ import { Switch } from "@/components/ui/switch"
|
||||
import { getChatEventFilter, setChatEventFilter } from "@/lib/api"
|
||||
|
||||
const ALL_EVENT_TYPES = [
|
||||
{
|
||||
id: "session_started",
|
||||
labelKey: "sessionStarted",
|
||||
descKey: "sessionStartedDesc",
|
||||
},
|
||||
{
|
||||
id: "turn_complete",
|
||||
labelKey: "turnComplete",
|
||||
descKey: "turnCompleteDesc",
|
||||
},
|
||||
{ id: "error", labelKey: "error", descKey: "errorDesc" },
|
||||
{
|
||||
id: "status_disconnected",
|
||||
labelKey: "statusDisconnected",
|
||||
descKey: "statusDisconnectedDesc",
|
||||
},
|
||||
{ id: "git_push", labelKey: "gitPush", descKey: "gitPushDesc" },
|
||||
{ id: "git_commit", labelKey: "gitCommit", descKey: "gitCommitDesc" },
|
||||
] as const
|
||||
|
||||
const ALL_IDS = ALL_EVENT_TYPES.map((e) => e.id)
|
||||
@@ -51,8 +39,6 @@ export function ChannelEventsTab() {
|
||||
.finally(() => setLoading(false))
|
||||
}, [])
|
||||
|
||||
const allEnabled = enabledEvents.size === ALL_EVENT_TYPES.length
|
||||
|
||||
const handleToggle = useCallback(
|
||||
async (eventId: string, checked: boolean) => {
|
||||
setSaving(true)
|
||||
@@ -86,9 +72,7 @@ export function ChannelEventsTab() {
|
||||
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
{allEnabled && (
|
||||
<p className="text-xs text-muted-foreground">{t("allEnabled")}</p>
|
||||
)}
|
||||
<p className="text-xs text-muted-foreground">{t("description")}</p>
|
||||
|
||||
<section className="space-y-1">
|
||||
{ALL_EVENT_TYPES.map((evt) => (
|
||||
|
||||
@@ -1733,20 +1733,11 @@
|
||||
},
|
||||
"events": {
|
||||
"title": "إشعارات الأحداث",
|
||||
"description": "تكوين الأحداث التي يتم إرسالها لكل قناة.",
|
||||
"allEnabled": "جميع الأحداث مفعلة (الافتراضي)",
|
||||
"sessionStarted": "بدء الجلسة",
|
||||
"sessionStartedDesc": "عندما يبدأ وكيل الذكاء الاصطناعي جلسة جديدة",
|
||||
"description": "عند تفعيل الأحداث، سيتم إرسالها إلى القناة عند تشغيلها.",
|
||||
"turnComplete": "اكتمال الدور",
|
||||
"turnCompleteDesc": "عند انتهاء دور الوكيل",
|
||||
"error": "خطأ الوكيل",
|
||||
"errorDesc": "عندما يواجه الوكيل خطأ",
|
||||
"statusDisconnected": "انقطاع الوكيل",
|
||||
"statusDisconnectedDesc": "عند فقدان اتصال الوكيل",
|
||||
"gitPush": "Git Push",
|
||||
"gitPushDesc": "عند نجاح عملية Git Push",
|
||||
"gitCommit": "Git Commit",
|
||||
"gitCommitDesc": "عند نجاح عملية Git Commit",
|
||||
"saved": "تم تحديث فلتر الأحداث.",
|
||||
"saveFailed": "فشل حفظ فلتر الأحداث."
|
||||
}
|
||||
|
||||
@@ -1733,20 +1733,11 @@
|
||||
},
|
||||
"events": {
|
||||
"title": "Ereignisbenachrichtigungen",
|
||||
"description": "Konfigurieren Sie, welche Ereignisse an jeden Kanal gesendet werden.",
|
||||
"allEnabled": "Alle Ereignisse aktiviert (Standard)",
|
||||
"sessionStarted": "Sitzung gestartet",
|
||||
"sessionStartedDesc": "Wenn ein KI-Agent eine neue Sitzung startet",
|
||||
"description": "Nach Aktivierung werden ausgelöste Ereignisse an den Kanal gesendet.",
|
||||
"turnComplete": "Runde abgeschlossen",
|
||||
"turnCompleteDesc": "Wenn eine Agentenrunde endet",
|
||||
"error": "Agentenfehler",
|
||||
"errorDesc": "Wenn ein Agent einen Fehler feststellt",
|
||||
"statusDisconnected": "Agent getrennt",
|
||||
"statusDisconnectedDesc": "Wenn die Agentenverbindung verloren geht",
|
||||
"gitPush": "Git Push",
|
||||
"gitPushDesc": "Wenn ein Git Push erfolgreich ist",
|
||||
"gitCommit": "Git Commit",
|
||||
"gitCommitDesc": "Wenn ein Git Commit erfolgreich ist",
|
||||
"saved": "Ereignisfilter aktualisiert.",
|
||||
"saveFailed": "Fehler beim Speichern des Ereignisfilters."
|
||||
}
|
||||
|
||||
@@ -1734,20 +1734,11 @@
|
||||
},
|
||||
"events": {
|
||||
"title": "Event Notifications",
|
||||
"description": "Configure which events are pushed to each channel.",
|
||||
"allEnabled": "All events enabled (default)",
|
||||
"sessionStarted": "Session Started",
|
||||
"sessionStartedDesc": "When an AI agent session begins",
|
||||
"description": "When enabled, triggered events will be pushed to the channel.",
|
||||
"turnComplete": "Turn Complete",
|
||||
"turnCompleteDesc": "When an agent turn ends",
|
||||
"error": "Agent Error",
|
||||
"errorDesc": "When an agent encounters an error",
|
||||
"statusDisconnected": "Agent Disconnected",
|
||||
"statusDisconnectedDesc": "When agent connection is lost",
|
||||
"gitPush": "Git Push",
|
||||
"gitPushDesc": "When a git push succeeds",
|
||||
"gitCommit": "Git Commit",
|
||||
"gitCommitDesc": "When a git commit succeeds",
|
||||
"saved": "Event filter updated.",
|
||||
"saveFailed": "Failed to save event filter."
|
||||
}
|
||||
|
||||
@@ -1733,20 +1733,11 @@
|
||||
},
|
||||
"events": {
|
||||
"title": "Notificaciones de eventos",
|
||||
"description": "Configura qué eventos se envían a cada canal.",
|
||||
"allEnabled": "Todos los eventos habilitados (predeterminado)",
|
||||
"sessionStarted": "Sesión iniciada",
|
||||
"sessionStartedDesc": "Cuando un agente IA inicia una nueva sesión",
|
||||
"description": "Al habilitar eventos, se enviarán al canal cuando se activen.",
|
||||
"turnComplete": "Turno completado",
|
||||
"turnCompleteDesc": "Cuando finaliza un turno del agente",
|
||||
"error": "Error del agente",
|
||||
"errorDesc": "Cuando un agente encuentra un error",
|
||||
"statusDisconnected": "Agente desconectado",
|
||||
"statusDisconnectedDesc": "Cuando se pierde la conexión del agente",
|
||||
"gitPush": "Git Push",
|
||||
"gitPushDesc": "Cuando un git push tiene éxito",
|
||||
"gitCommit": "Git Commit",
|
||||
"gitCommitDesc": "Cuando un git commit tiene éxito",
|
||||
"saved": "Filtro de eventos actualizado.",
|
||||
"saveFailed": "Error al guardar el filtro de eventos."
|
||||
}
|
||||
|
||||
@@ -1733,20 +1733,11 @@
|
||||
},
|
||||
"events": {
|
||||
"title": "Notifications d'événements",
|
||||
"description": "Configurez les événements envoyés à chaque canal.",
|
||||
"allEnabled": "Tous les événements activés (par défaut)",
|
||||
"sessionStarted": "Session démarrée",
|
||||
"sessionStartedDesc": "Lorsqu'un agent IA démarre une nouvelle session",
|
||||
"description": "Une fois activés, les événements déclenchés seront envoyés au canal.",
|
||||
"turnComplete": "Tour terminé",
|
||||
"turnCompleteDesc": "Lorsqu'un tour d'agent se termine",
|
||||
"error": "Erreur de l'agent",
|
||||
"errorDesc": "Lorsqu'un agent rencontre une erreur",
|
||||
"statusDisconnected": "Agent déconnecté",
|
||||
"statusDisconnectedDesc": "Lorsque la connexion de l'agent est perdue",
|
||||
"gitPush": "Git Push",
|
||||
"gitPushDesc": "Lorsqu'un git push réussit",
|
||||
"gitCommit": "Git Commit",
|
||||
"gitCommitDesc": "Lorsqu'un git commit réussit",
|
||||
"saved": "Filtre d'événements mis à jour.",
|
||||
"saveFailed": "Échec de l'enregistrement du filtre d'événements."
|
||||
}
|
||||
|
||||
@@ -1733,20 +1733,11 @@
|
||||
},
|
||||
"events": {
|
||||
"title": "イベント通知",
|
||||
"description": "各チャンネルにプッシュするイベントを設定します。",
|
||||
"allEnabled": "すべてのイベントが有効(デフォルト)",
|
||||
"sessionStarted": "セッション開始",
|
||||
"sessionStartedDesc": "AI エージェントが新しいセッションを開始した時",
|
||||
"description": "イベントを有効にすると、トリガーされた際にチャンネルにプッシュされます。",
|
||||
"turnComplete": "ターン完了",
|
||||
"turnCompleteDesc": "エージェントのターンが終了した時",
|
||||
"error": "エージェントエラー",
|
||||
"errorDesc": "エージェントがエラーに遭遇した時",
|
||||
"statusDisconnected": "エージェント切断",
|
||||
"statusDisconnectedDesc": "エージェントの接続が切断された時",
|
||||
"gitPush": "Git プッシュ",
|
||||
"gitPushDesc": "Git Push が成功した時",
|
||||
"gitCommit": "Git コミット",
|
||||
"gitCommitDesc": "Git Commit が成功した時",
|
||||
"saved": "イベントフィルターを更新しました。",
|
||||
"saveFailed": "イベントフィルターの保存に失敗しました。"
|
||||
}
|
||||
|
||||
@@ -1733,20 +1733,11 @@
|
||||
},
|
||||
"events": {
|
||||
"title": "이벤트 알림",
|
||||
"description": "각 채널에 전송할 이벤트를 설정합니다.",
|
||||
"allEnabled": "모든 이벤트 활성화 (기본값)",
|
||||
"sessionStarted": "세션 시작",
|
||||
"sessionStartedDesc": "AI 에이전트가 새 세션을 시작할 때",
|
||||
"description": "이벤트를 활성화하면, 트리거 시 채널로 푸시됩니다.",
|
||||
"turnComplete": "턴 완료",
|
||||
"turnCompleteDesc": "에이전트 턴이 종료될 때",
|
||||
"error": "에이전트 오류",
|
||||
"errorDesc": "에이전트에 오류가 발생했을 때",
|
||||
"statusDisconnected": "에이전트 연결 해제",
|
||||
"statusDisconnectedDesc": "에이전트 연결이 끊어졌을 때",
|
||||
"gitPush": "Git 푸시",
|
||||
"gitPushDesc": "Git Push 성공 시",
|
||||
"gitCommit": "Git 커밋",
|
||||
"gitCommitDesc": "Git Commit 성공 시",
|
||||
"saved": "이벤트 필터가 업데이트되었습니다.",
|
||||
"saveFailed": "이벤트 필터 저장에 실패했습니다."
|
||||
}
|
||||
|
||||
@@ -1733,20 +1733,11 @@
|
||||
},
|
||||
"events": {
|
||||
"title": "Notificações de eventos",
|
||||
"description": "Configure quais eventos são enviados para cada canal.",
|
||||
"allEnabled": "Todos os eventos habilitados (padrão)",
|
||||
"sessionStarted": "Sessão iniciada",
|
||||
"sessionStartedDesc": "Quando um agente IA inicia uma nova sessão",
|
||||
"description": "Ao habilitar eventos, eles serão enviados ao canal quando acionados.",
|
||||
"turnComplete": "Turno concluído",
|
||||
"turnCompleteDesc": "Quando um turno do agente termina",
|
||||
"error": "Erro do agente",
|
||||
"errorDesc": "Quando um agente encontra um erro",
|
||||
"statusDisconnected": "Agente desconectado",
|
||||
"statusDisconnectedDesc": "Quando a conexão do agente é perdida",
|
||||
"gitPush": "Git Push",
|
||||
"gitPushDesc": "Quando um git push é bem-sucedido",
|
||||
"gitCommit": "Git Commit",
|
||||
"gitCommitDesc": "Quando um git commit é bem-sucedido",
|
||||
"saved": "Filtro de eventos atualizado.",
|
||||
"saveFailed": "Falha ao salvar o filtro de eventos."
|
||||
}
|
||||
|
||||
@@ -1734,20 +1734,11 @@
|
||||
},
|
||||
"events": {
|
||||
"title": "事件通知",
|
||||
"description": "配置每个渠道推送哪些事件。",
|
||||
"allEnabled": "所有事件已启用(默认)",
|
||||
"sessionStarted": "会话开始",
|
||||
"sessionStartedDesc": "AI 代理开始新会话时",
|
||||
"description": "启用事件后,事件被触发时将推送到渠道。",
|
||||
"turnComplete": "对话完成",
|
||||
"turnCompleteDesc": "代理回合结束时",
|
||||
"error": "代理错误",
|
||||
"errorDesc": "代理遇到错误时",
|
||||
"statusDisconnected": "代理断开",
|
||||
"statusDisconnectedDesc": "代理连接断开时",
|
||||
"gitPush": "Git 推送",
|
||||
"gitPushDesc": "Git Push 成功时",
|
||||
"gitCommit": "Git 提交",
|
||||
"gitCommitDesc": "Git Commit 成功时",
|
||||
"saved": "事件过滤已更新。",
|
||||
"saveFailed": "保存事件过滤失败。"
|
||||
}
|
||||
|
||||
@@ -1733,20 +1733,11 @@
|
||||
},
|
||||
"events": {
|
||||
"title": "事件通知",
|
||||
"description": "設定每個頻道推送哪些事件。",
|
||||
"allEnabled": "所有事件已啟用(預設)",
|
||||
"sessionStarted": "工作階段開始",
|
||||
"sessionStartedDesc": "AI 代理開始新工作階段時",
|
||||
"description": "啟用事件後,事件被觸發時將推送到頻道。",
|
||||
"turnComplete": "對話完成",
|
||||
"turnCompleteDesc": "代理回合結束時",
|
||||
"error": "代理錯誤",
|
||||
"errorDesc": "代理遇到錯誤時",
|
||||
"statusDisconnected": "代理斷線",
|
||||
"statusDisconnectedDesc": "代理連線中斷時",
|
||||
"gitPush": "Git 推送",
|
||||
"gitPushDesc": "Git Push 成功時",
|
||||
"gitCommit": "Git 提交",
|
||||
"gitCommitDesc": "Git Commit 成功時",
|
||||
"saved": "事件篩選已更新。",
|
||||
"saveFailed": "儲存事件篩選失敗。"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user