refactor: 将 WebUI 源码纳入仓库,移除打包产物

- 新增 webui/ 前端源码目录(React+Vite+TypeScript+Tailwind)
- 删除 api/webui/ 中旧的打包静态资源
- 更新 .gitignore 忽略 api/webui/ 构建输出和 webui/node_modules
- 更新 README 增加前端构建说明
This commit is contained in:
程序员阿江(Relakkes)
2026-07-01 23:05:03 +08:00
parent 2ac0716c41
commit 65ddaa8828
68 changed files with 9064 additions and 356 deletions
@@ -0,0 +1,70 @@
import { cn } from '@/lib/utils'
import type { LogEntry } from '@/types/crawler'
interface TerminalLineProps {
log: LogEntry
}
const levelConfig: Record<string, { text: string; bg: string; glow: string }> = {
info: {
text: 'text-cyber-neon-cyan',
bg: 'bg-cyber-neon-cyan/10',
glow: 'shadow-[0_0_3px_rgba(0,255,255,0.3)]'
},
success: {
text: 'text-cyber-neon-green',
bg: 'bg-cyber-neon-green/10',
glow: 'shadow-[0_0_3px_rgba(0,255,65,0.3)]'
},
warning: {
text: 'text-cyber-neon-orange',
bg: 'bg-cyber-neon-orange/10',
glow: 'shadow-[0_0_3px_rgba(255,152,0,0.3)]'
},
error: {
text: 'text-cyber-neon-pink',
bg: 'bg-cyber-neon-pink/10',
glow: 'shadow-[0_0_3px_rgba(255,0,128,0.3)]'
},
debug: {
text: 'text-[#8b949e]',
bg: 'bg-[#21262d]',
glow: ''
},
}
const levelIcons: Record<string, string> = {
info: 'DATA',
success: 'OK',
warning: 'WARN',
error: 'ERR',
debug: 'DBG',
}
export function TerminalLine({ log }: TerminalLineProps) {
const config = levelConfig[log.level] || levelConfig.info
return (
<div className="flex gap-2 text-xs leading-relaxed font-mono group hover:bg-[#21262d]/50 px-1 -mx-1 rounded transition-colors">
{/* Timestamp */}
<span className="text-[#8b949e] flex-shrink-0 opacity-60 group-hover:opacity-100 transition-opacity">
[{log.timestamp}]
</span>
{/* Level badge */}
<span className={cn(
'flex-shrink-0 w-14 px-1 rounded text-center',
config.bg,
config.text,
config.glow
)}>
[{levelIcons[log.level]}]
</span>
{/* Message */}
<span className={cn('break-all', config.text)}>
{log.message}
</span>
</div>
)
}