fix(desktop): remove heartbeat section from home page
This commit is contained in:
parent
b9d9ae99b0
commit
02838bba78
1 changed files with 14 additions and 52 deletions
|
|
@ -1,10 +1,9 @@
|
|||
import { useState, useEffect, useRef } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { useState, useEffect, useRef } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { Button } from '@multica/ui/components/ui/button'
|
||||
import { Switch } from '@multica/ui/components/ui/switch'
|
||||
import { HugeiconsIcon } from '@hugeicons/react'
|
||||
import {
|
||||
Comment01Icon,
|
||||
import { HugeiconsIcon } from '@hugeicons/react'
|
||||
import {
|
||||
Comment01Icon,
|
||||
LinkSquare01Icon,
|
||||
Loading03Icon,
|
||||
AlertCircleIcon,
|
||||
|
|
@ -16,19 +15,17 @@ import {
|
|||
import { ConnectionQRCode } from '../components/qr-code'
|
||||
import { DeviceList } from '../components/device-list'
|
||||
import { AgentSettingsDialog } from '../components/agent-settings-dialog'
|
||||
import { ApiKeyDialog } from '../components/api-key-dialog'
|
||||
import { OAuthDialog } from '../components/oauth-dialog'
|
||||
import { ApiKeyDialog } from '../components/api-key-dialog'
|
||||
import { OAuthDialog } from '../components/oauth-dialog'
|
||||
import { useHub } from '../hooks/use-hub'
|
||||
import { useProvider } from '../hooks/use-provider'
|
||||
import { useHeartbeat } from '../hooks/use-heartbeat'
|
||||
|
||||
export default function HomePage() {
|
||||
const navigate = useNavigate()
|
||||
|
||||
export default function HomePage() {
|
||||
const navigate = useNavigate()
|
||||
const { hubInfo, agents, loading, error } = useHub()
|
||||
const { providers, current, setProvider, refresh, loading: providerLoading } = useProvider()
|
||||
const heartbeat = useHeartbeat()
|
||||
const [settingsOpen, setSettingsOpen] = useState(false)
|
||||
const [agentName, setAgentName] = useState<string | undefined>()
|
||||
const [settingsOpen, setSettingsOpen] = useState(false)
|
||||
const [agentName, setAgentName] = useState<string | undefined>()
|
||||
const [providerDropdownOpen, setProviderDropdownOpen] = useState(false)
|
||||
const [switching, setSwitching] = useState(false)
|
||||
const [apiKeyDialogOpen, setApiKeyDialogOpen] = useState(false)
|
||||
|
|
@ -275,43 +272,8 @@ export default function HomePage() {
|
|||
)}
|
||||
</div>
|
||||
|
||||
{/* Heartbeat Status */}
|
||||
<div className="p-4 rounded-lg bg-muted/50 border border-border/50">
|
||||
<div className="flex items-center justify-between mb-2">
|
||||
<p className="text-xs text-muted-foreground uppercase tracking-wider">
|
||||
Heartbeat
|
||||
</p>
|
||||
<Switch checked={heartbeat.enabled} onCheckedChange={() => void heartbeat.toggleEnabled()} />
|
||||
</div>
|
||||
<p className="text-sm font-medium">
|
||||
{heartbeat.lastEvent
|
||||
? `Last: ${heartbeat.lastEvent.status}`
|
||||
: heartbeat.loading
|
||||
? 'Loading...'
|
||||
: 'No heartbeat yet'}
|
||||
</p>
|
||||
{heartbeat.lastEvent?.reason && (
|
||||
<p className="text-xs text-muted-foreground mt-1 truncate">
|
||||
{heartbeat.lastEvent.reason}
|
||||
</p>
|
||||
)}
|
||||
{heartbeat.error && (
|
||||
<p className="text-xs text-destructive mt-1 truncate">{heartbeat.error}</p>
|
||||
)}
|
||||
<div className="mt-3">
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
onClick={() => void heartbeat.wakeNow()}
|
||||
disabled={heartbeat.loading}
|
||||
>
|
||||
Trigger Now
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Stats Grid */}
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
{/* Stats Grid */}
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div className="p-4 rounded-lg bg-muted/50 border border-border/50">
|
||||
<p className="text-xs text-muted-foreground uppercase tracking-wider mb-1">
|
||||
Gateway
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue