chore(frontend): fix corn task (#3)

This commit is contained in:
Haze
2026-02-07 01:28:38 +08:00
committed by GitHub
Unverified
parent fa6c23b82a
commit e6317cafd6
12 changed files with 530 additions and 4399 deletions

View File

@@ -8,8 +8,8 @@ import { ChatToolbar } from '@/pages/Chat/ChatToolbar';
// Page titles mapping
const pageTitles: Record<string, string> = {
'/': 'Dashboard',
'/chat': 'Chat',
'/': 'Chat',
'/dashboard': 'Dashboard',
'/channels': 'Channels',
'/skills': 'Skills',
'/cron': 'Cron Tasks',
@@ -19,7 +19,7 @@ const pageTitles: Record<string, string> = {
export function Header() {
const location = useLocation();
const currentTitle = pageTitles[location.pathname] || 'ClawX';
const isChatPage = location.pathname === '/chat';
const isChatPage = location.pathname === '/';
return (
<header className="flex h-14 items-center justify-between border-b bg-background px-6">

View File

@@ -17,7 +17,7 @@ import {
} from 'lucide-react';
import { cn } from '@/lib/utils';
import { useSettingsStore } from '@/stores/settings';
import { useGatewayStore } from '@/stores/gateway';
import { Button } from '@/components/ui/button';
import { Badge } from '@/components/ui/badge';
@@ -64,19 +64,17 @@ export function Sidebar() {
const sidebarCollapsed = useSettingsStore((state) => state.sidebarCollapsed);
const setSidebarCollapsed = useSettingsStore((state) => state.setSidebarCollapsed);
const devModeUnlocked = useSettingsStore((state) => state.devModeUnlocked);
const gatewayStatus = useGatewayStore((state) => state.status);
// Open developer console
const openDevConsole = () => {
window.electron.openExternal('http://localhost:18789');
};
const navItems = [
{ to: '/', icon: <Home className="h-5 w-5" />, label: 'Dashboard' },
{ to: '/chat', icon: <MessageSquare className="h-5 w-5" />, label: 'Chat' },
{ to: '/channels', icon: <Radio className="h-5 w-5" />, label: 'Channels' },
{ to: '/skills', icon: <Puzzle className="h-5 w-5" />, label: 'Skills' },
{ to: '/', icon: <MessageSquare className="h-5 w-5" />, label: 'Chat' },
{ to: '/cron', icon: <Clock className="h-5 w-5" />, label: 'Cron Tasks' },
{ to: '/skills', icon: <Puzzle className="h-5 w-5" />, label: 'Skills' },
{ to: '/channels', icon: <Radio className="h-5 w-5" />, label: 'Channels' },
{ to: '/dashboard', icon: <Home className="h-5 w-5" />, label: 'Dashboard' },
{ to: '/settings', icon: <Settings className="h-5 w-5" />, label: 'Settings' },
];
@@ -108,30 +106,7 @@ export function Sidebar() {
</nav>
{/* Footer */}
<div className="border-t p-2 space-y-2">
{/* Gateway Status */}
<div
className={cn(
'flex items-center gap-2 rounded-lg px-3 py-2',
sidebarCollapsed && 'justify-center px-2'
)}
>
<div
className={cn(
'h-2 w-2 rounded-full',
gatewayStatus.state === 'running' && 'bg-green-500',
gatewayStatus.state === 'starting' && 'bg-yellow-500 animate-pulse',
gatewayStatus.state === 'stopped' && 'bg-gray-400',
gatewayStatus.state === 'error' && 'bg-red-500'
)}
/>
{!sidebarCollapsed && (
<span className="text-xs text-muted-foreground">
Gateway: {gatewayStatus.state}
</span>
)}
</div>
<div className="p-2 space-y-2">
{/* Developer Mode Button */}
{devModeUnlocked && !sidebarCollapsed && (
<Button