mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-05-30 04:40:18 +08:00
feat: 全面完善功能和修复 CSS/API 问题
- 修复暗色主题缺少 --accent 变量导致按钮颜色异常 - 消除所有 CSS 硬编码颜色(btn-primary, btn-danger:hover, sidebar-logo) - 添加 toast.warning 样式支持 - Modal 支持 Enter 确认和 Escape 关闭 - Dashboard 快速操作按钮添加 loading 状态 - Services 操作后延迟刷新确保状态同步 - Memory 页面添加预览/新建/删除文件功能 - Deploy 页面 .env 路径添加默认值 - Rust 后端补充 delete_memory_file/check_installation/write_env_file 命令 - Mock 数据补全所有 API 端点
This commit is contained in:
@@ -46,6 +46,17 @@ export function showModal({ title, fields, onConfirm }) {
|
||||
onConfirm(result)
|
||||
}
|
||||
|
||||
// 键盘事件:Enter 确认,Escape 关闭
|
||||
const handleKey = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault()
|
||||
overlay.querySelector('[data-action="confirm"]')?.click()
|
||||
} else if (e.key === 'Escape') {
|
||||
overlay.remove()
|
||||
}
|
||||
}
|
||||
overlay.addEventListener('keydown', handleKey)
|
||||
|
||||
// 自动聚焦第一个输入框
|
||||
const firstInput = overlay.querySelector('input, select')
|
||||
if (firstInput) firstInput.focus()
|
||||
|
||||
Reference in New Issue
Block a user