mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
feat: add storage panel in setting (#4069)
This commit is contained in:
@@ -613,6 +613,17 @@ export class WorkspaceResolver {
|
||||
return this.storage.blobsSize(workspaceId).then(size => ({ size }));
|
||||
}
|
||||
|
||||
@Query(() => WorkspaceBlobSizes)
|
||||
async collectAllBlobSizes(@CurrentUser() user: User) {
|
||||
const workspaces = await this.workspaces(user);
|
||||
|
||||
const size = (
|
||||
await Promise.all(workspaces.map(({ id }) => this.storage.blobsSize(id)))
|
||||
).reduce((prev, curr) => prev + curr, 0);
|
||||
|
||||
return { size };
|
||||
}
|
||||
|
||||
@Mutation(() => String)
|
||||
async setBlob(
|
||||
@CurrentUser() user: UserType,
|
||||
|
||||
@@ -154,6 +154,7 @@ type Query {
|
||||
"""List blobs of workspace"""
|
||||
listBlobs(workspaceId: String!): [String!]!
|
||||
collectBlobSizes(workspaceId: String!): WorkspaceBlobSizes!
|
||||
collectAllBlobSizes: WorkspaceBlobSizes!
|
||||
|
||||
"""Get current user"""
|
||||
currentUser: UserType!
|
||||
|
||||
Reference in New Issue
Block a user