mirror of
https://github.com/gtsteffaniak/filebrowser.git
synced 2026-11-15 05:31:59 -05:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5512d188ac |
No files matched your search
@@ -804,6 +804,7 @@ async function downloadChunked(file, shareHash = "") {
|
||||
* @param {((percent: number) => void) | undefined} [onupload]
|
||||
* @param {Record<string, string | number>} [headers]
|
||||
* @param {boolean} [isDir]
|
||||
* @param {(() => void) | undefined} [onsent]
|
||||
* @returns {Promise<any> & { xhr?: XMLHttpRequest | null, abort?: () => void }}
|
||||
*/
|
||||
export function post(
|
||||
@@ -1431,6 +1432,7 @@ export function getTextPreviewURLPublic(path, viewToken = state.req?.viewToken)
|
||||
* @param {((percent: number) => void) | undefined} [onupload]
|
||||
* @param {Record<string, string | number>} [headers]
|
||||
* @param {boolean} [isDir]
|
||||
* @param {(() => void) | undefined} [onsent]
|
||||
* @returns {Promise<any> & { xhr?: XMLHttpRequest | null, abort?: () => void }}
|
||||
*/
|
||||
export function postPublic(
|
||||
|
||||
@@ -638,6 +638,7 @@ export const mutations = {
|
||||
state.user.fileLoading = {
|
||||
maxConcurrentUpload: 3,
|
||||
uploadChunkSizeMb: 5,
|
||||
uploadStallTimeoutSeconds: 10,
|
||||
downloadChunkSizeMb: 0,
|
||||
clearAll: false
|
||||
};
|
||||
@@ -655,6 +656,9 @@ export const mutations = {
|
||||
if (state.user.fileLoading.downloadChunkSizeMb === undefined) {
|
||||
state.user.fileLoading.downloadChunkSizeMb = 0;
|
||||
}
|
||||
if (state.user.fileLoading.uploadStallTimeoutSeconds === undefined) {
|
||||
state.user.fileLoading.uploadStallTimeoutSeconds = 10;
|
||||
}
|
||||
}
|
||||
|
||||
// Load stored values or use defaults as fallback
|
||||
|
||||
@@ -286,6 +286,7 @@ export interface UserObject {
|
||||
fileLoading?: {
|
||||
maxConcurrentUpload?: number;
|
||||
uploadChunkSizeMb?: number;
|
||||
uploadStallTimeoutSeconds?: number;
|
||||
clearAll?: boolean;
|
||||
downloadChunkSizeMb?: number;
|
||||
maxConcurrent?: number;
|
||||
|
||||
@@ -329,9 +329,9 @@ class UploadManager {
|
||||
try {
|
||||
const testPath = `${basePath}${dirName}`;
|
||||
if (getters.isShare()) {
|
||||
await resourcesApi.postPublic(state.shareInfo?.hash, testPath, new Blob([]), false, undefined, {}, true);
|
||||
await resourcesApi.postPublic(state.shareInfo?.hash, testPath, new Blob([]), false, undefined, {}, true, undefined);
|
||||
} else {
|
||||
await resourcesApi.post(state.req?.source, testPath, new Blob([]), false, undefined, {}, true);
|
||||
await resourcesApi.post(state.req?.source, testPath, new Blob([]), false, undefined, {}, true, undefined);
|
||||
}
|
||||
// No conflict - directory was created successfully
|
||||
// Mark it so we can skip it later in the queue
|
||||
@@ -839,7 +839,7 @@ class UploadManager {
|
||||
}
|
||||
|
||||
progressTimeoutMs(): number {
|
||||
const seconds = state.user?.fileLoading?.uploadStallTimeoutSeconds;
|
||||
const seconds = state.user?.fileLoading?.uploadStallTimeoutSeconds ?? 0;
|
||||
return seconds > 0 ? seconds * 1000 : this.PROGRESS_TIMEOUT_MS;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user