directory downloads (zipped)
This commit is contained in:
@@ -143,10 +143,7 @@ function onDownload() {
|
||||
<Icon name="lucide:copy" />
|
||||
Copy
|
||||
</ContextMenuItem>
|
||||
<ContextMenuItem
|
||||
:disabled="entry.fileType !== 'file'"
|
||||
@select="onDownload"
|
||||
>
|
||||
<ContextMenuItem @select="onDownload">
|
||||
<Icon name="lucide:download" />
|
||||
Download
|
||||
</ContextMenuItem>
|
||||
|
||||
@@ -125,10 +125,15 @@ function onDowloadClicked() {
|
||||
return;
|
||||
}
|
||||
|
||||
downloadFile(
|
||||
share.file.name,
|
||||
getApiUrl(`warrens/files/cat_share?shareId=${share.data.id}&path=/`)
|
||||
const downloadName =
|
||||
share.file.fileType === 'directory'
|
||||
? `${share.file.name}.zip`
|
||||
: share.file.name;
|
||||
const downloadApiUrl = getApiUrl(
|
||||
`warrens/files/cat_share?shareId=${share.data.id}&path=/`
|
||||
);
|
||||
|
||||
downloadFile(downloadName, downloadApiUrl);
|
||||
}
|
||||
|
||||
function onEntryDownload(entry: DirectoryEntry) {
|
||||
@@ -136,12 +141,13 @@ function onEntryDownload(entry: DirectoryEntry) {
|
||||
return;
|
||||
}
|
||||
|
||||
downloadFile(
|
||||
entry.name,
|
||||
getApiUrl(
|
||||
`warrens/files/cat_share?shareId=${share.data.id}&path=${joinPaths(warrenStore.current.path, entry.name)}`
|
||||
)
|
||||
const downloadName =
|
||||
entry.fileType === 'directory' ? `${entry.name}.zip` : entry.name;
|
||||
const downloadApiUrl = getApiUrl(
|
||||
`warrens/files/cat_share?shareId=${share.data.id}&path=${joinPaths(warrenStore.current.path, entry.name)}`
|
||||
);
|
||||
|
||||
downloadFile(downloadName, downloadApiUrl);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -111,19 +111,13 @@ function onEntryDownload(entry: DirectoryEntry) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (entry.fileType !== 'file') {
|
||||
toast.warning('Download', {
|
||||
description: 'Directory downloads are not supported yet',
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
downloadFile(
|
||||
entry.name,
|
||||
getApiUrl(
|
||||
`warrens/files/cat?warrenId=${warrenStore.current.warrenId}&path=${joinPaths(warrenStore.current.path, entry.name)}`
|
||||
)
|
||||
const downloadName =
|
||||
entry.fileType === 'directory' ? `${entry.name}.zip` : entry.name;
|
||||
const downloadApiUrl = getApiUrl(
|
||||
`warrens/files/cat?warrenId=${warrenStore.current.warrenId}&path=${joinPaths(warrenStore.current.path, entry.name)}`
|
||||
);
|
||||
|
||||
downloadFile(downloadName, downloadApiUrl);
|
||||
}
|
||||
|
||||
function onBack() {
|
||||
|
||||
Reference in New Issue
Block a user