优化文件管理器视觉设计和安全性
核心改进: - 统一图标色调:所有文件类型图标改为黑白配色,消除彩色差异 - 恢复原始主题:修复shadcn样式导致的过暗背景问题 - 增强大文件安全:后端10MB文件大小限制,防止内存溢出 - 优化警告样式:Large File Warning使用shadcn设计规范 技术细节: - getFileIcon()全部使用text-muted-foreground统一色调 - 恢复bg-dark-bg/border-dark-border原始主题色彩 - readFile API增加stat文件大小检查和错误处理 - FileViewer警告组件使用destructive色彩体系 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -126,11 +126,17 @@ export function FileWindow({
|
||||
} catch (error: any) {
|
||||
console.error('Failed to load file:', error);
|
||||
|
||||
// 如果是连接错误,提供更明确的错误信息
|
||||
if (error.message?.includes('connection') || error.message?.includes('established')) {
|
||||
// 检查是否是大文件错误
|
||||
const errorData = error?.response?.data;
|
||||
if (errorData?.tooLarge) {
|
||||
toast.error(`File too large: ${errorData.error}`, {
|
||||
duration: 10000, // 10 seconds for important message
|
||||
});
|
||||
} else if (error.message?.includes('connection') || error.message?.includes('established')) {
|
||||
// 如果是连接错误,提供更明确的错误信息
|
||||
toast.error(`SSH connection failed. Please check your connection to ${sshHost.name} (${sshHost.ip}:${sshHost.port})`);
|
||||
} else {
|
||||
toast.error(`Failed to load file: ${error.message || 'Unknown error'}`);
|
||||
toast.error(`Failed to load file: ${error.message || errorData?.error || 'Unknown error'}`);
|
||||
}
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
|
||||
Reference in New Issue
Block a user