mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: update workspace setting store
This commit is contained in:
@ -2069,10 +2069,10 @@ definitions:
|
||||
type: integer
|
||||
format: int32
|
||||
description: The id of actived external storage.
|
||||
localStoragePath:
|
||||
localStoragePathTemplate:
|
||||
type: string
|
||||
title: |-
|
||||
The local storage path for STORAGE_TYPE_LOCAL.
|
||||
The template of local storage path.
|
||||
e.g. assets/{timestamp}_{filename}
|
||||
uploadSizeLimitMb:
|
||||
type: string
|
||||
|
@ -260,8 +260,8 @@ func SaveResourceBlob(ctx context.Context, s *store.Store, create *store.Resourc
|
||||
|
||||
if workspaceStorageSetting.StorageType == storepb.WorkspaceStorageSetting_STORAGE_TYPE_LOCAL {
|
||||
localStoragePath := "assets/{timestamp}_{filename}"
|
||||
if workspaceStorageSetting.LocalStoragePath != "" {
|
||||
localStoragePath = workspaceStorageSetting.LocalStoragePath
|
||||
if workspaceStorageSetting.LocalStoragePathTemplate != "" {
|
||||
localStoragePath = workspaceStorageSetting.LocalStoragePathTemplate
|
||||
}
|
||||
|
||||
internalPath := localStoragePath
|
||||
|
@ -176,9 +176,10 @@ func convertWorkspaceStorageSettingFromStore(setting *storepb.WorkspaceStorageSe
|
||||
return nil
|
||||
}
|
||||
return &apiv2pb.WorkspaceStorageSetting{
|
||||
StorageType: apiv2pb.WorkspaceStorageSetting_StorageType(setting.StorageType),
|
||||
LocalStoragePath: setting.LocalStoragePath,
|
||||
UploadSizeLimitMb: setting.UploadSizeLimitMb,
|
||||
StorageType: apiv2pb.WorkspaceStorageSetting_StorageType(setting.StorageType),
|
||||
LocalStoragePathTemplate: setting.LocalStoragePathTemplate,
|
||||
UploadSizeLimitMb: setting.UploadSizeLimitMb,
|
||||
ActivedExternalStorageId: setting.ActivedExternalStorageId,
|
||||
}
|
||||
}
|
||||
|
||||
@ -187,9 +188,10 @@ func convertWorkspaceStorageSettingToStore(setting *apiv2pb.WorkspaceStorageSett
|
||||
return nil
|
||||
}
|
||||
return &storepb.WorkspaceStorageSetting{
|
||||
StorageType: storepb.WorkspaceStorageSetting_StorageType(setting.StorageType),
|
||||
LocalStoragePath: setting.LocalStoragePath,
|
||||
UploadSizeLimitMb: setting.UploadSizeLimitMb,
|
||||
StorageType: storepb.WorkspaceStorageSetting_StorageType(setting.StorageType),
|
||||
LocalStoragePathTemplate: setting.LocalStoragePathTemplate,
|
||||
UploadSizeLimitMb: setting.UploadSizeLimitMb,
|
||||
ActivedExternalStorageId: setting.ActivedExternalStorageId,
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user