feat(file-browser): add copy name and path option to context menu

This commit is contained in:
yiling
2026-07-27 10:23:22 +08:00
parent d81fc09b35
commit f429873362
20 changed files with 284 additions and 13 deletions
+9
View File
@@ -55,6 +55,7 @@ export interface S3Service {
uploadFile(filePath: string, contentType: string): Promise<string>
uploadFileToKey(filePath: string, key: string, contentType: string): Promise<void>
presign(bucket: string, key: string, method: string, download?: boolean): Promise<string>
getAbsolutePathOrUrl(bucket: string, key: string): Promise<string>
}
export class S3StorageService implements S3Service {
@@ -230,6 +231,10 @@ export class S3StorageService implements S3Service {
return url
}
async getAbsolutePathOrUrl(bucket: string, key: string): Promise<string> {
return this.presign(bucket, key, 'GET', true)
}
}
export class LocalStorageService implements S3Service {
@@ -441,6 +446,10 @@ export class LocalStorageService implements S3Service {
}
return url
}
async getAbsolutePathOrUrl(bucket: string, key: string): Promise<string> {
return this.getFilePath(bucket, key)
}
}
const storageBackend = process.env.STORAGE_BACKEND || 'local'