mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-30 15:15:24 +00:00
Relocates guacamole backend/frontend source and tests into plugins/remote-desktop, following the ssh-terminal/docker pattern.
23 lines
609 B
TypeScript
23 lines
609 B
TypeScript
export type FileDropDisposition = "ignore" | "reject" | "upload";
|
|
|
|
export function hasDraggedFiles(types: readonly string[]): boolean {
|
|
return types.includes("Files");
|
|
}
|
|
|
|
export function getFileDropDisposition(
|
|
types: readonly string[],
|
|
fileCount: number,
|
|
canUpload: boolean,
|
|
): FileDropDisposition {
|
|
if (!hasDraggedFiles(types) || fileCount === 0) return "ignore";
|
|
return canUpload ? "upload" : "reject";
|
|
}
|
|
|
|
export function canUploadToRdpDrive(
|
|
uploadAllowed: boolean,
|
|
driveEnabled: boolean,
|
|
hasFilesystem: boolean,
|
|
): boolean {
|
|
return uploadAllowed && (driveEnabled || hasFilesystem);
|
|
}
|