mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-11 20:27:43 +02:00
add workspace usage info
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"changes": [
|
||||
{
|
||||
"packageName": "@hcengineering/account-client",
|
||||
"comment": "add workspace usage info",
|
||||
"type": "patch"
|
||||
}
|
||||
],
|
||||
"packageName": "@hcengineering/account-client"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"changes": [
|
||||
{
|
||||
"packageName": "@hcengineering/core",
|
||||
"comment": "add workspace usae info",
|
||||
"type": "patch"
|
||||
}
|
||||
],
|
||||
"packageName": "@hcengineering/core"
|
||||
}
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
type AccountInfo,
|
||||
type AccountRole,
|
||||
type AccountUuid,
|
||||
BackupStatus,
|
||||
type BackupStatus,
|
||||
concatLink,
|
||||
Data,
|
||||
type Person,
|
||||
@@ -25,6 +25,7 @@ import {
|
||||
type PersonUuid,
|
||||
type SocialIdType,
|
||||
Version,
|
||||
type UsageStatus,
|
||||
type WorkspaceInfoWithStatus,
|
||||
type WorkspaceMemberInfo,
|
||||
WorkspaceMode,
|
||||
@@ -182,6 +183,7 @@ export interface AccountClient {
|
||||
) => Promise<boolean>
|
||||
assignWorkspace: (email: string, workspaceUuid: string, role: AccountRole) => Promise<void>
|
||||
updateBackupInfo: (info: BackupStatus) => Promise<void>
|
||||
updateUsageInfo: (info: UsageStatus) => Promise<void>
|
||||
updateWorkspaceRoleBySocialKey: (socialKey: string, targetRole: AccountRole) => Promise<void>
|
||||
ensurePerson: (
|
||||
socialType: SocialIdType,
|
||||
@@ -846,6 +848,15 @@ class AccountClientImpl implements AccountClient {
|
||||
await this.rpc(request)
|
||||
}
|
||||
|
||||
async updateUsageInfo (usageInfo: UsageStatus): Promise<void> {
|
||||
const request = {
|
||||
method: 'updateUsageInfo' as const,
|
||||
params: { usageInfo }
|
||||
}
|
||||
|
||||
await this.rpc(request)
|
||||
}
|
||||
|
||||
async assignWorkspace (email: string, workspaceUuid: string, role: AccountRole): Promise<void> {
|
||||
const request = {
|
||||
method: 'assignWorkspace' as const,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// Copyright © 2020, 2021 Anticrm Platform Contributors.
|
||||
// Copyright © 2021 Hardcore Engineering Inc.
|
||||
// Copyright © 2021, 2025 Hardcore Engineering Inc.
|
||||
//
|
||||
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License. You may
|
||||
@@ -873,6 +873,12 @@ export interface BackupStatus {
|
||||
backups: number
|
||||
}
|
||||
|
||||
export interface UsageStatus {
|
||||
usage: Record<string, number>
|
||||
startTime: Timestamp
|
||||
updateTime: Timestamp
|
||||
}
|
||||
|
||||
export interface WorkspaceInfoWithStatus extends WorkspaceInfo {
|
||||
isDisabled?: boolean
|
||||
versionMajor: number
|
||||
@@ -882,6 +888,7 @@ export interface WorkspaceInfoWithStatus extends WorkspaceInfo {
|
||||
mode: WorkspaceMode
|
||||
processingProgress?: number
|
||||
backupInfo?: BackupStatus
|
||||
usageInfo?: UsageStatus
|
||||
processingAttemps: number
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user