fix(frontend): update Share interface property from download_count to downloads
All checks were successful
Automated Container Build / build-and-push (push) Successful in 3m25s
All checks were successful
Automated Container Build / build-and-push (push) Successful in 3m25s
This commit is contained in:
parent
ed3eed6bb7
commit
1f83d57942
21 changed files with 241 additions and 137 deletions
|
|
@ -10,6 +10,8 @@ import {
|
|||
Sun, Moon, Music as MusicIcon, Code as CodeIcon, Archive as ArchiveIcon, CornerDownRight,
|
||||
CheckCircle, AlertCircle, Menu, FileText, LayoutTemplate, FileSpreadsheet
|
||||
} from 'lucide-react';
|
||||
import { FileItem } from '@/types/files';
|
||||
import { formatSize } from '@/lib/utils';
|
||||
import api from '@/lib/api';
|
||||
import { useIsMobile } from '@/hooks/useIsMobile';
|
||||
const Folder = ({ className, style }: { className?: string, style?: React.CSSProperties }) => (
|
||||
|
|
@ -30,18 +32,7 @@ import OfficeHome from './OfficeHome';
|
|||
import OnlyOfficeEditor from './OnlyOfficeEditor';
|
||||
import ThumbnailImage from './ThumbnailImage';
|
||||
|
||||
interface FileItem {
|
||||
name: string;
|
||||
path: string;
|
||||
is_dir: boolean;
|
||||
size: number;
|
||||
mime_type: string;
|
||||
is_pinned: boolean;
|
||||
is_trashed: boolean;
|
||||
mod_time: string;
|
||||
trashed_at?: string;
|
||||
checksum?: string;
|
||||
}
|
||||
// FileItem imported from types
|
||||
|
||||
interface FileExplorerProps {
|
||||
onLogout: () => void;
|
||||
|
|
@ -427,7 +418,7 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) {
|
|||
|
||||
window.addEventListener('keydown', handleKeyDown);
|
||||
return () => window.removeEventListener('keydown', handleKeyDown);
|
||||
}, [files, selectedFiles]);
|
||||
}, [files, selectedFiles, currentPath]);
|
||||
|
||||
useEffect(() => {
|
||||
const handleClickOutside = () => {
|
||||
|
|
@ -556,9 +547,10 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) {
|
|||
if (target.closest('button') || target.closest('input') || target.closest('[data-file-item]')) {
|
||||
return;
|
||||
}
|
||||
const rect = mainContainerRef.current!.getBoundingClientRect();
|
||||
const scrollLeft = mainContainerRef.current!.scrollLeft;
|
||||
const scrollTop = mainContainerRef.current!.scrollTop;
|
||||
if (!mainContainerRef.current) return;
|
||||
const rect = mainContainerRef.current.getBoundingClientRect();
|
||||
const scrollLeft = mainContainerRef.current.scrollLeft;
|
||||
const scrollTop = mainContainerRef.current.scrollTop;
|
||||
|
||||
setSelectionBox({
|
||||
startX: e.clientX - rect.left + scrollLeft,
|
||||
|
|
@ -1146,13 +1138,6 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) {
|
|||
|
||||
const pathSegments = currentPath === '.' ? [] : currentPath.split('/');
|
||||
|
||||
function formatSize(bytes: number): string {
|
||||
if (bytes === 0) return '—';
|
||||
const units = ['B', 'KB', 'MB', 'GB', 'TB'];
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(1024));
|
||||
return `${(bytes / Math.pow(1024, i)).toFixed(i === 0 ? 0 : 1)} ${units[i]}`;
|
||||
}
|
||||
|
||||
function formatDate(dateStr: string): string {
|
||||
if (!dateStr) return '';
|
||||
const date = new Date(dateStr);
|
||||
|
|
|
|||
Reference in a new issue