diff --git a/web/static/css/style.css b/web/static/css/style.css index 653a6604..dcc7c5ac 100644 --- a/web/static/css/style.css +++ b/web/static/css/style.css @@ -5732,6 +5732,16 @@ html[data-theme="dark"] .openapi-doc-btn:hover { max-width: 680px; } +.robot-commands-modal-content { + max-width: 720px; + max-height: 86vh; +} + +.robot-commands-modal-body { + max-height: calc(86vh - 88px); + overflow-y: auto; +} + .robot-type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); @@ -5804,6 +5814,29 @@ html[data-theme="dark"] .openapi-doc-btn:hover { margin-bottom: 12px; } +.robot-command-entry { + display: flex; + align-items: center; + justify-content: space-between; + gap: 16px; + padding: 16px 18px; + border: 1px solid var(--border-color); + border-radius: 8px; + background: var(--bg-secondary); +} + +.robot-command-entry h4 { + margin: 0 0 6px; +} + +.robot-command-entry .settings-description { + margin: 0; +} + +.robot-command-entry-copy { + min-width: 0; +} + .robot-cmd-category { font-size: 0.8125rem; font-weight: 600; @@ -5829,6 +5862,17 @@ html[data-theme="dark"] .openapi-doc-btn:hover { margin-bottom: 0 !important; } +@media (max-width: 768px) { + .robot-command-entry { + align-items: stretch; + flex-direction: column; + } + + .robot-command-entry .btn-secondary { + width: 100%; + } +} + .form-hint { display: block; font-size: 0.8125rem; diff --git a/web/static/i18n/en-US.json b/web/static/i18n/en-US.json index a20f7c64..ccf9419e 100644 --- a/web/static/i18n/en-US.json +++ b/web/static/i18n/en-US.json @@ -2565,6 +2565,8 @@ }, "settingsRobotsExtra": { "botCommandsTitle": "Bot command instructions", + "botCommandsEntryDesc": "View the Chinese and English commands available in robot chats, including common conversation, role, and project actions.", + "viewAllCommands": "View all commands", "botCommandsDesc": "You can send the following commands in chat (Chinese and English supported):", "botCmdCategoryGeneral": "General", "botCmdCategoryConversation": "Conversation", diff --git a/web/static/i18n/zh-CN.json b/web/static/i18n/zh-CN.json index d5784b83..8bdd3fc1 100644 --- a/web/static/i18n/zh-CN.json +++ b/web/static/i18n/zh-CN.json @@ -2553,6 +2553,8 @@ }, "settingsRobotsExtra": { "botCommandsTitle": "机器人命令说明", + "botCommandsEntryDesc": "查看机器人对话中可用的中英文命令,包括对话、角色、项目等常用操作。", + "viewAllCommands": "查看全部命令", "botCommandsDesc": "在对话中可发送以下命令(支持中英文):", "botCmdCategoryGeneral": "通用", "botCmdCategoryConversation": "对话", diff --git a/web/static/js/settings.js b/web/static/js/settings.js index 87693df7..890d3835 100644 --- a/web/static/js/settings.js +++ b/web/static/js/settings.js @@ -97,6 +97,24 @@ function closeRobotCreateModal() { if (modal) modal.style.display = 'none'; } +function openRobotCommandsModal() { + if (typeof openAppModal === 'function') { + openAppModal('robot-commands-modal', { focus: false }); + return; + } + const modal = document.getElementById('robot-commands-modal'); + if (modal) modal.style.display = 'block'; +} + +function closeRobotCommandsModal() { + if (typeof closeAppModal === 'function') { + closeAppModal('robot-commands-modal'); + return; + } + const modal = document.getElementById('robot-commands-modal'); + if (modal) modal.style.display = 'none'; +} + function selectRobotType(type) { closeRobotCreateModal(); openRobotEditor(type); @@ -129,6 +147,14 @@ function bindRobotManagerEvents() { }); modal.dataset.robotManagerBound = 'true'; } + + const commandsModal = document.getElementById('robot-commands-modal'); + if (commandsModal && !commandsModal.dataset.robotManagerBound) { + commandsModal.addEventListener('click', (event) => { + if (event.target === commandsModal) closeRobotCommandsModal(); + }); + commandsModal.dataset.robotManagerBound = 'true'; + } } // 生成工具的唯一标识符,用于区分同名但来源不同的工具 diff --git a/web/templates/index.html b/web/templates/index.html index d3002aa8..08eabe0d 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -3717,42 +3717,57 @@ -
在对话中可发送以下命令(支持中英文):
+查看机器人对话中可用的中英文命令,包括对话、角色、项目等常用操作。
+