mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-05-27 11:20:04 +08:00
feat: ClawPanel v0.1.0 项目骨架
- Tauri v2 + Vanilla JS + Vite 技术栈 - 9 个页面: 仪表盘/服务管理/日志/模型配置/Agent配置/Gateway/MCP工具/记忆文件/部署 - Rust 后端: 配置读写/服务管理(launchd)/日志读取/记忆文件管理 - 暗色主题 + 玻璃拟态 UI - Mock 数据支持纯浏览器开发调试
This commit is contained in:
28
src/components/toast.js
Normal file
28
src/components/toast.js
Normal file
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Toast 通知组件
|
||||
*/
|
||||
let _container = null
|
||||
|
||||
function ensureContainer() {
|
||||
if (!_container) {
|
||||
_container = document.createElement('div')
|
||||
_container.className = 'toast-container'
|
||||
document.body.appendChild(_container)
|
||||
}
|
||||
return _container
|
||||
}
|
||||
|
||||
export function toast(message, type = 'info', duration = 3000) {
|
||||
const container = ensureContainer()
|
||||
const el = document.createElement('div')
|
||||
el.className = `toast ${type}`
|
||||
el.textContent = message
|
||||
container.appendChild(el)
|
||||
|
||||
setTimeout(() => {
|
||||
el.style.opacity = '0'
|
||||
el.style.transform = 'translateX(20px)'
|
||||
el.style.transition = 'all 250ms ease'
|
||||
setTimeout(() => el.remove(), 250)
|
||||
}, duration)
|
||||
}
|
||||
Reference in New Issue
Block a user