feat: add AgentsConfirmDialog component and integrate it into AgentsPage for agent deletion confirmation
- Implemented AgentsConfirmDialog for confirming agent deletions. - Updated AgentsPage to manage agent deletion state and feedback messages. - Refactored provider account loading logic to include channel groups. - Enhanced feedback mechanism for user actions such as agent creation and deletion.
This commit is contained in:
@@ -120,6 +120,23 @@ export const messages: I18nMessages = {
|
||||
saveLabel: 'Save',
|
||||
savingLabel: 'Saving...',
|
||||
},
|
||||
feedback: {
|
||||
created: 'Agent created.',
|
||||
createFailed: 'Failed to create Agent: {error}',
|
||||
deleted: 'Agent deleted.',
|
||||
deleteFailed: 'Failed to delete Agent: {error}',
|
||||
agentUpdated: 'Agent name updated.',
|
||||
agentUpdateFailedPrefix: 'Failed to update Agent name: ',
|
||||
agentModelUpdated: 'Agent model updated.',
|
||||
agentModelReset: 'Agent reverted to the default model.',
|
||||
agentModelUpdateFailedPrefix: 'Failed to update Agent model: ',
|
||||
},
|
||||
deleteDialog: {
|
||||
title: 'Delete Agent',
|
||||
message: 'Delete Agent "{name}"? Existing chats stay on disk.',
|
||||
confirm: 'Delete',
|
||||
deleting: 'Deleting...',
|
||||
},
|
||||
fields: {
|
||||
model: 'Model',
|
||||
workspace: 'Workspace',
|
||||
@@ -140,9 +157,11 @@ export const messages: I18nMessages = {
|
||||
},
|
||||
settings: {
|
||||
title: 'Agent settings',
|
||||
description: 'Review identity, model routing, and channel ownership for {name}.',
|
||||
titleWithName: '{name} settings',
|
||||
description: 'Update the Agent name and review which channel accounts belong to this Agent.',
|
||||
identityTitle: 'Identity',
|
||||
modelTitle: 'Model',
|
||||
modelLabel: 'Model',
|
||||
bindingTitle: 'Channel ownership',
|
||||
bindingHelp: 'Read-only summary of which channels and accounts currently resolve to this Agent.',
|
||||
bindingEmpty: 'No channels or account ownership are associated with this Agent yet.',
|
||||
@@ -182,6 +201,27 @@ export const messages: I18nMessages = {
|
||||
bindingReadonly: 'Ownership is read-only here. Change channel/account bindings in Channels.',
|
||||
providerLoadError: 'Provider accounts could not be loaded: {error}',
|
||||
channelLoadError: 'Channel accounts could not be loaded: {error}',
|
||||
closeLabel: 'Close dialog',
|
||||
notConfigured: 'Not configured',
|
||||
channelsTitle: 'Channels',
|
||||
channelsDescription: 'This list is read-only. Manage channel accounts and bindings from Channels.',
|
||||
noChannels: 'This Agent has not been assigned any channels yet.',
|
||||
channelsManagedInChannels: 'No explicit account bindings were found for this Agent. Review channel-level ownership in Channels.',
|
||||
mainAccount: 'Main account',
|
||||
unsavedChangesTitle: 'Discard unsaved changes?',
|
||||
unsavedChangesMessage: 'You have unsaved edits. Closing now will discard them.',
|
||||
closeWithoutSaving: 'Close without saving',
|
||||
modelOverrideDescription: 'Update this Agent\'s model override. Current default model: {defaultModel}',
|
||||
modelProviderLabel: 'Model provider',
|
||||
modelProviderPlaceholder: 'Select a provider',
|
||||
modelIdLabel: 'Model ID',
|
||||
modelIdPlaceholder: 'gpt-5.4',
|
||||
modelPreview: 'Model preview',
|
||||
modelProviderEmpty: 'No providers are available for model configuration yet. Configure a provider in Models first.',
|
||||
useDefaultModel: 'Use default model',
|
||||
modelProviderRequired: 'Select a provider first.',
|
||||
modelIdRequired: 'Enter a model ID.',
|
||||
modelInvalid: 'The model configuration format is invalid.',
|
||||
},
|
||||
},
|
||||
settings: {
|
||||
@@ -355,6 +395,23 @@ export const messages: I18nMessages = {
|
||||
saveLabel: '保存',
|
||||
savingLabel: '保存中...',
|
||||
},
|
||||
feedback: {
|
||||
created: 'Agent 已创建。',
|
||||
createFailed: '创建 Agent 失败:{error}',
|
||||
deleted: 'Agent 已删除。',
|
||||
deleteFailed: '删除 Agent 失败:{error}',
|
||||
agentUpdated: 'Agent 名称已更新。',
|
||||
agentUpdateFailedPrefix: '更新 Agent 名称失败:',
|
||||
agentModelUpdated: 'Agent 模型已更新。',
|
||||
agentModelReset: 'Agent 已恢复默认模型。',
|
||||
agentModelUpdateFailedPrefix: '更新 Agent 模型失败:',
|
||||
},
|
||||
deleteDialog: {
|
||||
title: '删除 Agent',
|
||||
message: '确定删除 Agent “{name}”吗?现有聊天记录仍会保留在磁盘中。',
|
||||
confirm: '确认删除',
|
||||
deleting: '删除中...',
|
||||
},
|
||||
fields: {
|
||||
model: '模型',
|
||||
workspace: '工作区',
|
||||
@@ -375,9 +432,11 @@ export const messages: I18nMessages = {
|
||||
},
|
||||
settings: {
|
||||
title: 'Agent 设置',
|
||||
description: '查看并调整 {name} 的基础信息、模型路由和频道归属摘要。',
|
||||
titleWithName: '{name} 设置',
|
||||
description: '更新 Agent 名称,并管理哪些频道归属于这个 Agent。',
|
||||
identityTitle: '基础信息',
|
||||
modelTitle: '模型',
|
||||
modelLabel: 'Model',
|
||||
bindingTitle: '频道归属',
|
||||
bindingHelp: '这里只展示这个 Agent 当前命中的频道和账号归属摘要。',
|
||||
bindingEmpty: '这个 Agent 还没有任何频道或账号归属。',
|
||||
@@ -417,6 +476,27 @@ export const messages: I18nMessages = {
|
||||
bindingReadonly: '这里只读展示归属;修改 channel/account 绑定请前往 Channels。',
|
||||
providerLoadError: '加载 Provider 账号失败:{error}',
|
||||
channelLoadError: '加载频道账号失败:{error}',
|
||||
closeLabel: '关闭弹窗',
|
||||
notConfigured: '未配置',
|
||||
channelsTitle: '频道',
|
||||
channelsDescription: '该列表为只读。频道账号与绑定关系请在 Channels 页面管理。',
|
||||
noChannels: '这个 Agent 还没有分配任何频道。',
|
||||
channelsManagedInChannels: '该 Agent 当前没有显式账号归属。频道级归属请前往 Channels 页面查看。',
|
||||
mainAccount: '主账号',
|
||||
unsavedChangesTitle: '放弃未保存的更改?',
|
||||
unsavedChangesMessage: '当前有尚未保存的修改。关闭后这些修改将丢失。',
|
||||
closeWithoutSaving: '直接关闭',
|
||||
modelOverrideDescription: '更新这个 Agent 的模型覆盖设置。当前默认模型:{defaultModel}',
|
||||
modelProviderLabel: '模型 Provider',
|
||||
modelProviderPlaceholder: '请选择 Provider',
|
||||
modelIdLabel: '模型 ID',
|
||||
modelIdPlaceholder: 'gpt-5.4',
|
||||
modelPreview: '模型预览',
|
||||
modelProviderEmpty: '当前没有可用于模型配置的 Provider。请先在 Models 页面完成账号配置。',
|
||||
useDefaultModel: '使用默认模型',
|
||||
modelProviderRequired: '请先选择一个 Provider。',
|
||||
modelIdRequired: '请输入模型 ID。',
|
||||
modelInvalid: '模型配置格式不正确。',
|
||||
},
|
||||
},
|
||||
settings: {
|
||||
@@ -590,6 +670,23 @@ export const messages: I18nMessages = {
|
||||
saveLabel: '保存',
|
||||
savingLabel: '保存中...',
|
||||
},
|
||||
feedback: {
|
||||
created: 'Agent を作成しました。',
|
||||
createFailed: 'Agent の作成に失敗しました: {error}',
|
||||
deleted: 'Agent を削除しました。',
|
||||
deleteFailed: 'Agent の削除に失敗しました: {error}',
|
||||
agentUpdated: 'Agent 名を更新しました。',
|
||||
agentUpdateFailedPrefix: 'Agent 名の更新に失敗しました: ',
|
||||
agentModelUpdated: 'Agent モデルを更新しました。',
|
||||
agentModelReset: 'Agent を既定モデルに戻しました。',
|
||||
agentModelUpdateFailedPrefix: 'Agent モデルの更新に失敗しました: ',
|
||||
},
|
||||
deleteDialog: {
|
||||
title: 'Agent を削除',
|
||||
message: 'Agent「{name}」を削除しますか?既存のチャットはディスクに残ります。',
|
||||
confirm: '削除する',
|
||||
deleting: '削除中...',
|
||||
},
|
||||
fields: {
|
||||
model: 'モデル',
|
||||
workspace: 'ワークスペース',
|
||||
@@ -610,9 +707,11 @@ export const messages: I18nMessages = {
|
||||
},
|
||||
settings: {
|
||||
title: 'Agent 設定',
|
||||
description: '{name} の基本情報、モデルルーティング、チャンネル担当の要約を確認します。',
|
||||
titleWithName: '{name} 設定',
|
||||
description: 'Agent 名を更新し、この Agent に属するチャンネルを確認します。',
|
||||
identityTitle: '基本情報',
|
||||
modelTitle: 'モデル',
|
||||
modelLabel: 'Model',
|
||||
bindingTitle: 'チャンネル担当',
|
||||
bindingHelp: 'この Agent に現在解決されるチャンネル / アカウント担当を読み取り専用で表示します。',
|
||||
bindingEmpty: 'この Agent にはまだチャンネルまたはアカウントの担当がありません。',
|
||||
@@ -652,6 +751,27 @@ export const messages: I18nMessages = {
|
||||
bindingReadonly: 'ここでは担当を読み取り専用で表示します。channel/account の変更は Channels ページで行ってください。',
|
||||
providerLoadError: 'Provider アカウントの読み込みに失敗しました: {error}',
|
||||
channelLoadError: 'チャンネルアカウントの読み込みに失敗しました: {error}',
|
||||
closeLabel: 'ダイアログを閉じる',
|
||||
notConfigured: '未設定',
|
||||
channelsTitle: 'チャンネル',
|
||||
channelsDescription: 'この一覧は読み取り専用です。チャンネルアカウントと紐付けは Channels ページで管理してください。',
|
||||
noChannels: 'この Agent にはまだチャンネルが割り当てられていません。',
|
||||
channelsManagedInChannels: 'この Agent に明示的なアカウント紐付けは見つかりませんでした。チャンネル単位の担当は Channels で確認してください。',
|
||||
mainAccount: 'メインアカウント',
|
||||
unsavedChangesTitle: '未保存の変更を破棄しますか?',
|
||||
unsavedChangesMessage: '未保存の変更があります。今閉じると破棄されます。',
|
||||
closeWithoutSaving: '保存せずに閉じる',
|
||||
modelOverrideDescription: 'この Agent のモデル上書きを更新します。現在の既定モデル: {defaultModel}',
|
||||
modelProviderLabel: 'モデル Provider',
|
||||
modelProviderPlaceholder: 'Provider を選択',
|
||||
modelIdLabel: 'モデル ID',
|
||||
modelIdPlaceholder: 'gpt-5.4',
|
||||
modelPreview: 'モデルプレビュー',
|
||||
modelProviderEmpty: 'モデル設定に使える Provider がまだありません。先に Models で Provider を設定してください。',
|
||||
useDefaultModel: '既定モデルを使う',
|
||||
modelProviderRequired: '先に Provider を選択してください。',
|
||||
modelIdRequired: 'モデル ID を入力してください。',
|
||||
modelInvalid: 'モデル設定の形式が正しくありません。',
|
||||
},
|
||||
},
|
||||
settings: {
|
||||
|
||||
Reference in New Issue
Block a user