fix(desktop): session persistence — refresh/login/context/empty-content 4-bug fix
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
1. App.tsx: add restoreSession() call on startup to prevent redirect to login page after refresh (isRestoring guard + BootstrapScreen) 2. CloneManager: call syncAgents() after loadClones() to restore currentAgent and conversation history on app load 3. zclaw-memory: add get_or_create_session() so frontend session UUID is persisted directly — kernel no longer creates mismatched IDs 4. openai.rs: assistant message content must be non-empty for Kimi/Qwen APIs — replace empty content with meaningful placeholders Also includes admin-v2 ModelServices unified page (merge providers + models + API keys into expandable row layout)
This commit is contained in:
51
admin-v2/src/components/ErrorState.tsx
Normal file
51
admin-v2/src/components/ErrorState.tsx
Normal file
@@ -0,0 +1,51 @@
|
||||
import { Button, Result } from 'antd'
|
||||
import type { FallbackProps } from 'react-error-boundary'
|
||||
|
||||
interface ErrorStateProps {
|
||||
title?: string
|
||||
message?: string
|
||||
onRetry?: () => void
|
||||
}
|
||||
|
||||
export function ErrorState({
|
||||
title = '加载失败',
|
||||
message,
|
||||
onRetry,
|
||||
}: ErrorStateProps) {
|
||||
return (
|
||||
<div className="flex items-center justify-center min-h-[200px] p-8">
|
||||
<Result
|
||||
status="error"
|
||||
title={title}
|
||||
subTitle={message}
|
||||
extra={
|
||||
onRetry ? (
|
||||
<Button type="primary" onClick={onRetry}>
|
||||
重试
|
||||
</Button>
|
||||
) : undefined
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export function ErrorFallback({ error, resetErrorBoundary }: FallbackProps) {
|
||||
return (
|
||||
<div className="flex items-center justify-center min-h-[200px] p-8">
|
||||
<Result
|
||||
status="error"
|
||||
title="页面出现错误"
|
||||
subTitle={error.message}
|
||||
extra={
|
||||
<div className="flex gap-2">
|
||||
<Button onClick={resetErrorBoundary}>重试</Button>
|
||||
<Button type="primary" onClick={() => window.location.reload()}>
|
||||
刷新页面
|
||||
</Button>
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user