mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-03 06:24:30 +00:00
feat(file-browser): add copy name and path option to context menu
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user