init: hermes-web-ui v0.1.0

Hermes Agent Web 管理面板,支持对话交互和定时任务管理。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
ekko
2026-04-11 15:59:14 +08:00
co-authored by Claude Opus 4.6
commit cd58797f4c
41 changed files with 3627 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
import { onMounted, onUnmounted } from 'vue'
import { useRouter } from 'vue-router'
import { useChatStore } from '@/stores/chat'
export function useKeyboard() {
const router = useRouter()
const chatStore = useChatStore()
function handleKeydown(e: KeyboardEvent) {
const mod = e.ctrlKey || e.metaKey
if (mod && e.key === 'n') {
e.preventDefault()
chatStore.newChat()
}
if (mod && e.key === 'j') {
e.preventDefault()
router.push({ name: 'jobs' })
}
if (e.key === 'Escape') {
// Close any open modals — naive-ui handles this internally
const modal = document.querySelector('.n-modal-mask')
if (modal) {
const closeBtn = modal.querySelector('.n-base-close') as HTMLElement
closeBtn?.click()
}
}
}
onMounted(() => {
window.addEventListener('keydown', handleKeydown)
})
onUnmounted(() => {
window.removeEventListener('keydown', handleKeydown)
})
}