shared group provisioning, upload context menu, go path fix
- provision linux users with pastilhas:officerdev ownership so server can always read/write, terminal users get group access - add officerdev shared group setup to setup.sh - move go install to ~/.local/go with GOPATH at ~/.local/go-path - add upload file/folder items to file browser context menu Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+31
-1
@@ -1,4 +1,5 @@
|
||||
import { Loader2, Folder, ClipboardPaste, FolderPlus, LayoutGrid, Upload, ClipboardCopy, MessageSquare, Download, Mic } from 'lucide-react';
|
||||
import { useRef } from 'react';
|
||||
import { Loader2, Folder, ClipboardPaste, FolderPlus, FolderUp, LayoutGrid, Upload, ClipboardCopy, MessageSquare, Download, Mic } from 'lucide-react';
|
||||
import { getIcon } from 'material-file-icons';
|
||||
import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuTrigger } from '@/components/ui/context-menu';
|
||||
import type { UseFileBrowserAppType } from '../useFileBrowserApp';
|
||||
@@ -29,8 +30,19 @@ export const FileViewContainer = ({ fileBrowserManager }: FileViewContainerProps
|
||||
handleCreateDashboardHere,
|
||||
setShowVideoDownload,
|
||||
setShowDictate,
|
||||
handleUpload,
|
||||
} = fileBrowserManager;
|
||||
|
||||
const fileInputRef = useRef<HTMLInputElement | null>(null);
|
||||
const folderInputRef = useRef<HTMLInputElement | null>(null);
|
||||
|
||||
const handleFileChange = (ev: React.ChangeEvent<HTMLInputElement>) => {
|
||||
if (ev.target.files?.length) {
|
||||
handleUpload(ev.target.files);
|
||||
ev.target.value = '';
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
className="flex-1 min-h-0 relative"
|
||||
@@ -121,6 +133,14 @@ export const FileViewContainer = ({ fileBrowserManager }: FileViewContainerProps
|
||||
<FolderPlus className="mr-2 h-4 w-4" />
|
||||
New folder
|
||||
</ContextMenuItem>
|
||||
<ContextMenuItem onClick={() => fileInputRef.current?.click()} className="cursor-pointer">
|
||||
<Upload className="mr-2 h-4 w-4" />
|
||||
Upload files
|
||||
</ContextMenuItem>
|
||||
<ContextMenuItem onClick={() => folderInputRef.current?.click()} className="cursor-pointer">
|
||||
<FolderUp className="mr-2 h-4 w-4" />
|
||||
Upload folder
|
||||
</ContextMenuItem>
|
||||
<ContextMenuItem onClick={handleCreateDashboardHere} className="cursor-pointer">
|
||||
<LayoutGrid className="mr-2 h-4 w-4" />
|
||||
Create Dashboard here
|
||||
@@ -136,6 +156,16 @@ export const FileViewContainer = ({ fileBrowserManager }: FileViewContainerProps
|
||||
</ContextMenuContent>
|
||||
</ContextMenu>
|
||||
)}
|
||||
<input ref={fileInputRef} type="file" multiple className="hidden" onChange={handleFileChange} />
|
||||
<input
|
||||
ref={(input) => {
|
||||
folderInputRef.current = input;
|
||||
if (input) input.setAttribute('webkitdirectory', '');
|
||||
}}
|
||||
type="file"
|
||||
className="hidden"
|
||||
onChange={handleFileChange}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user